.ath-app {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.ath-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-wrap: wrap;
}

.ath-modes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
}

.ath-mode-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ath-mode-btn:hover {
  color: #0f172a;
}

.ath-mode-btn.is-active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ath-samples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ath-samples-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ath-sample-btn,
.ath-chip-btn {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-family: var(--font-sans, sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ath-sample-btn:hover,
.ath-chip-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.ath-chip-btn.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.ath-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ath-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ath-pane-out {
  border-left: 1px solid var(--border, #e2e8f0);
  background: #fcfdff;
}

.ath-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.ath-pane-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.ath-pane-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ath-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ath-tab-btn {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ath-tab-btn.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.ath-log-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
}

.ath-copy-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #14b8a6;
  background: #14b8a6;
  color: #ffffff;
  font-family: var(--font-sans, sans-serif);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ath-copy-btn:hover {
  background: #0d9488;
  border-color: #0d9488;
}

.ath-editor-wrap,
.ath-output-wrap {
  position: relative;
  flex: 1;
  min-height: 290px;
}

.ath-textarea {
  width: 100%;
  height: 100%;
  min-height: 290px;
  padding: 16px;
  border: 0;
  resize: vertical;
  font-family: var(--font-sans, sans-serif);
  font-size: 15px;
  line-height: 1.65;
  color: #0f172a;
  background: transparent;
  display: block;
}

.ath-textarea:focus {
  outline: none;
  background: #ffffff;
}

.ath-scan-overlay,
.ath-output-box {
  min-height: 290px;
  max-height: 460px;
  overflow-y: auto;
  padding: 16px;
  font-size: 15px;
  line-height: 1.65;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

.ath-scan-overlay {
  background: #fffbeb;
}

.ath-mark-cliche {
  background: #fee2e2;
  color: #991b1b;
  border-bottom: 2px solid #ef4444;
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 600;
}

.ath-placeholder {
  margin: 0;
  color: #64748b;
}

.ath-diff-box del {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 1px 3px;
  border-radius: 3px;
}

.ath-diff-box ins {
  background: #ccfbf1;
  color: #0f766e;
  text-decoration: none;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

.ath-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ath-log-item {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ath-log-tag {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
}

.ath-log-change {
  flex: 1;
  color: #334155;
}

.ath-pane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}

.ath-primary-btn {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-family: var(--font-sans, sans-serif);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ath-primary-btn:hover {
  background: #1d4ed8;
}

.ath-copy-status {
  color: #0f766e;
  font-weight: 700;
}

.ath-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.ath-metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ath-metric-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ath-metric-value {
  font-family: var(--font-mono, monospace);
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.ath-delta-up {
  font-size: 12px;
  color: #0f766e;
  font-weight: 700;
}

.ath-meter {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0;
}

.ath-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.ath-metric-sub {
  font-size: 12px;
  color: #64748b;
}

.ath-honest-bar {
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
  color: #475569;
  background: #ffffff;
}

.ath-honest-bar code {
  font-family: var(--font-mono, monospace);
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
}

@media (max-width: 820px) {
  .ath-grid {
    grid-template-columns: 1fr;
  }

  .ath-pane-out {
    border-left: 0;
    border-top: 1px solid var(--border, #e2e8f0);
  }

  .ath-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ath-metrics {
    grid-template-columns: 1fr;
  }

  .ath-primary-btn {
    width: 100%;
  }
}