:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-muted: #fbfbfd;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --line: #d2d2d7;
  --line-strong: #c7c7cc;
  --brand: #0071e3;
  --brand-hover: #0066cc;
  --focus: rgba(0, 113, 227, 0.22);
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 40%) minmax(320px, 60%);
  gap: 16px;
  padding: 16px;
}

.input-panel,
.report-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 30px;
  font-weight: 700;
}

h2 {
  font-size: 24px;
  font-weight: 700;
}

h3 {
  font-size: 17px;
  font-weight: 600;
}

h4 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 14px;
}

.tagline,
.muted,
.status {
  color: var(--text-muted);
  margin-top: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.tab-btn.active {
  background: #eef5ff;
  border-color: #b8d7ff;
  color: #004b9a;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

#samples {
  display: grid;
  gap: 12px;
}

.sample-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface-muted);
}

.sample-head {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.sample-label,
.sample-text,
.depth select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.sample-label:focus,
.sample-text:focus,
.depth select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus);
}

.sample-text {
  resize: vertical;
  min-height: 150px;
  line-height: 1.45;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.primary {
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  background: var(--brand-hover);
}

.secondary,
.remove-sample {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}

.secondary:hover,
.remove-sample:hover {
  background: #f8f8fa;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toolbar {
  margin-top: 12px;
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.depth {
  display: grid;
  gap: 4px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}

.support-card {
  margin-top: 22px;
  width: 50%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 10px;
}

.support-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
}

.donate-btn:hover {
  background: #f8f8fa;
  color: var(--text);
}

.report-panel {
  overflow: auto;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.report-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  margin-bottom: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 10px;
}

.kv strong {
  color: var(--text-muted);
  font-weight: 600;
}

p {
  margin: 0 0 10px;
  line-height: 1.5;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li {
  margin-bottom: 6px;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .input-panel,
  .report-panel {
    padding: 16px;
  }

  .support-card {
    width: 100%;
  }
}
