:root {
  --bg: #f4efe5;
  --panel: rgba(255, 252, 246, 0.88);
  --line: rgba(89, 74, 55, 0.16);
  --ink: #2d2419;
  --muted: #6f6355;
  --accent: #bf5b2b;
  --accent-soft: #ffd7c3;
  --accent-dark: #8d3f18;
  --ok: #35644f;
  --warn: #b96d15;
  --danger: #8d2e24;
  --shadow: 0 18px 44px rgba(77, 56, 33, 0.13);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "PingFang SC", serif;
  background:
    radial-gradient(circle at top left, rgba(255, 217, 188, 0.9), transparent 28%),
    radial-gradient(circle at bottom right, rgba(210, 187, 150, 0.55), transparent 24%),
    linear-gradient(160deg, #f7f1e8 0%, #efe6d6 54%, #e7dcc9 100%);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 20px;
  padding: 22px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 30px 12px 6px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.12;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.hero-copy,
.muted {
  color: var(--muted);
}

.hero-copy {
  margin-top: 12px;
  line-height: 1.7;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.stack-form,
.detail-grid,
.detail-block,
.transcript-list,
.finding-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

label > span {
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(120, 96, 65, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 12px 18px;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #d98645);
  color: #fffaf3;
  box-shadow: 0 10px 24px rgba(191, 91, 43, 0.28);
}

.secondary-button {
  background: #fff8f2;
  color: var(--accent-dark);
  border: 1px solid rgba(191, 91, 43, 0.2);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid var(--line);
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.case-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(106, 83, 56, 0.12);
  border-radius: 18px;
}

.case-item.is-active {
  border-color: rgba(191, 91, 43, 0.45);
  background: linear-gradient(135deg, rgba(255, 235, 225, 0.95), rgba(255, 250, 244, 0.85));
}

.case-item-main,
.case-item-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-meta,
.case-score {
  font-size: 13px;
  color: var(--muted);
}

.status-badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(120, 96, 65, 0.1);
}

.status-badge[data-status="completed"] {
  background: rgba(53, 100, 79, 0.14);
  color: var(--ok);
}

.status-badge[data-status="failed"] {
  background: rgba(141, 46, 36, 0.12);
  color: var(--danger);
}

.status-badge[data-status="transcribing"],
.status-badge[data-status="auditing"] {
  background: rgba(185, 109, 21, 0.14);
  color: var(--warn);
}

.detail-card {
  min-height: 720px;
}

.detail-grid {
  gap: 18px;
}

.detail-block {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(120, 96, 65, 0.1);
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.code-block {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 16px;
  background: #fff9f1;
  border: 1px solid rgba(120, 96, 65, 0.1);
}

.utterance {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(120, 96, 65, 0.08);
}

.speaker {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 13px;
}

.finding {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.92);
  border-left: 5px solid rgba(120, 96, 65, 0.2);
}

.finding-high {
  border-left-color: var(--danger);
}

.finding-medium {
  border-left-color: var(--warn);
}

.finding-low {
  border-left-color: var(--ok);
}

.finding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-empty,
.fatal-error {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.error-text {
  color: var(--danger);
}

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

  .detail-card {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  .card {
    padding: 18px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}
