:root {
  --mint-50: #effaf6;
  --mint-100: #d7f2e9;
  --mint-300: #7fe1c9;
  --mint-500: #28c5a5;
  --mint-600: #17a98d;
  --teal-700: #0f7b6a;
  --teal-900: #172f2a;
  --lime-100: #dff2cf;
  --lime-200: #cceba9;
  --yellow-100: #fff1bd;
  --yellow-700: #8d6800;
  --canvas: #dfecea;
  --surface: #f7fbf9;
  --panel: rgba(255, 255, 255, 0.88);
  --line: #dbe8e3;
  --muted: #728681;
  --text: #213b36;
  --card-shadow: 0 10px 28px rgba(28, 63, 55, 0.07);
  --card-shadow-hover: 0 22px 52px rgba(28, 63, 55, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 30px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(circle at 78% 0%, rgba(40, 197, 165, 0.22), transparent 32%),
    radial-gradient(circle at 12% 12%, rgba(223, 242, 207, 0.88), transparent 30%),
    linear-gradient(90deg, rgba(15, 123, 106, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(15, 123, 106, 0.06) 1px, transparent 1px),
    var(--canvas);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { max-width: 640px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.12; letter-spacing: 0; }
h2 { font-size: clamp(20px, 2.1vw, 28px); line-height: 1.14; letter-spacing: 0; }
h3 { font-size: 15px; line-height: 1.25; letter-spacing: 0; }
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.sidebar-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  width: min(1280px, calc(100% - 48px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 30px;
  background: rgba(246, 250, 248, 0.84);
  box-shadow: 0 22px 70px rgba(28, 63, 55, 0.09);
  backdrop-filter: blur(18px);
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: calc(100vh - 48px);
  overflow-x: clip;
  overflow-y: auto;
  padding: 28px 18px;
  border-right: 1px solid rgba(219, 232, 227, 0.78);
  border-radius: 30px 0 0 30px;
  background: rgba(239, 250, 246, 0.74);
}

.brand, .nav-item, .system-card, .status-dot, .badge, .metric-icon, .topbar, .topbar-actions, .section-head, .panel-title, .button-row, .hero-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  padding: 0 8px;
  color: var(--teal-700);
  font-weight: 800;
}

.brand-mark, .ai-mark {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, var(--mint-500), var(--teal-700));
}

.brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #5e766f;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.nav-item:hover { color: var(--teal-700); border-color: var(--line); background: var(--panel); }
.nav-item.active { color: #fff; background: var(--mint-500); }
.system-card {
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.system-card strong { display: block; font-size: 12px; }
.system-card p { color: var(--muted); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.collapse-btn {
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-700);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(28, 63, 55, 0.08);
  transform: translateY(-50%);
  z-index: 3;
}
.menu-icon { display: none; }
.sidebar-toggle:checked ~ .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
.sidebar-toggle:checked ~ .app-shell .sidebar { align-items: center; padding-inline: 14px; }
.sidebar-toggle:checked ~ .app-shell .brand-name,
.sidebar-toggle:checked ~ .app-shell .nav-item span,
.sidebar-toggle:checked ~ .app-shell .system-card {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.sidebar-toggle:checked ~ .app-shell .nav-item { justify-content: center; width: 42px; padding-inline: 0; }
.sidebar-toggle:checked ~ .app-shell .collapse-btn svg { transform: rotate(180deg); }

.status-dot, .badge i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint-500);
  box-shadow: 0 0 0 4px rgba(40, 197, 165, 0.14);
}
.page { min-width: 0; padding: 28px; }
.topbar { justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.topbar-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { color: var(--mint-600); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.icon-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--teal-700);
  background: var(--panel);
}

.bento-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.72fr;
  grid-auto-rows: minmax(156px, auto);
  gap: 14px;
}
.panel {
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at var(--card-glow-x, 50%) var(--card-glow-y, 0%), rgba(127, 225, 201, 0.14), transparent 42%),
    var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--card-shadow);
  transition: border-color 180ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.panel:hover {
  border-color: rgba(40, 197, 165, 0.62);
  box-shadow: var(--card-shadow-hover), 0 0 0 1px rgba(127, 225, 201, 0.18) inset;
  transform: translateY(-3px);
}
.panel, .metric-panel, .ai-card { padding: 16px; }
.hero-panel {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border-color: rgba(40, 197, 165, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 250, 246, 0.72));
}
.hero-panel h2 {
  max-width: 560px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.16;
  font-weight: 800;
}
.hero-copy { max-width: 590px; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.hero-actions, .button-row { gap: 8px; flex-wrap: wrap; }
.panel-title { justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ai-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; font-family: var(--mono); }
.ai-card { background: linear-gradient(145deg, rgba(223, 242, 207, 0.84), rgba(255, 255, 255, 0.88)); }
.ai-card .panel-title { justify-content: flex-start; }
.ai-card p { color: var(--muted); font-size: 13px; font-weight: 700; }
.suggestion-list { display: grid; gap: 8px; margin: 16px 0 0; }
.suggestion-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
}
.suggestion-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-500); }
.metric-panel p { margin-top: 14px; color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-panel strong { display: block; margin: 3px 0 14px; font-size: 32px; line-height: 1; }
.metric-panel.lime { background: var(--lime-100); }
.metric-icon { justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: var(--teal-700); background: var(--mint-100); }
.compact-metric { max-width: 100%; overflow-wrap: anywhere; font-size: 15px !important; line-height: 1.25 !important; }

.btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { cursor: not-allowed; opacity: 0.62; transform: none; }
.btn-primary { color: #fff; background: var(--mint-500); }
.btn-primary:hover { background: var(--mint-600); }
.btn-secondary { color: var(--teal-700); border-color: var(--mint-100); background: var(--mint-50); }
.btn-ghost { color: var(--muted); border-color: var(--line); background: #fff; }
.badge {
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  max-width: 100%;
  white-space: nowrap;
}
.badge-success { color: var(--teal-700); background: var(--mint-100); }
.badge-warning { color: var(--yellow-700); background: var(--yellow-100); }
.badge-soft { color: var(--teal-700); background: var(--lime-100); }
.badge-dark { color: #fff; background: var(--teal-900); }

.section { margin-top: 30px; }
.section-head { justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2 {
  max-width: 720px;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.18;
}
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: 14px; }
.form-card, .mini-preview { display: grid; gap: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 7px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
}
.field textarea { resize: vertical; padding-top: 10px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px rgba(40, 197, 165, 0.15);
}
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; font-weight: 700; }
.progress-card { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--lime-100); }
.progress-card div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.75); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--teal-700); transition: width 220ms ease; }

.drop-zone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed var(--mint-500);
  border-radius: var(--radius-md);
  color: var(--teal-700);
  background: rgba(239, 250, 246, 0.78);
  text-align: center;
}
.drop-zone.dragging { background: var(--mint-100); border-color: var(--teal-700); }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; color: var(--teal-700); background: #fff; }
#file-meta { color: var(--muted); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.upload-form { display: grid; gap: 16px; }
.notice-list { display: grid; gap: 10px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--mint-50); }
.notice.warning { background: var(--yellow-100); }
.notice p { color: var(--muted); font-size: 12px; font-weight: 700; }
.transcript-panel textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .panel, .panel:hover, .btn:hover { transform: none !important; }
}

@media (max-width: 1180px) {
  .sidebar-toggle:checked ~ .app-shell, .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 30px 30px 0 0; }
  .collapse-btn { display: none; }
  .sidebar-toggle:checked ~ .app-shell .sidebar { align-items: stretch; padding: 28px 18px; }
  .sidebar-toggle:checked ~ .app-shell .brand-name,
  .sidebar-toggle:checked ~ .app-shell .nav-item span,
  .sidebar-toggle:checked ~ .app-shell .system-card { width: auto; opacity: 1; overflow: visible; pointer-events: auto; }
  .sidebar-toggle:checked ~ .app-shell .nav-item { justify-content: flex-start; width: auto; padding: 0 12px; }
  .nav-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .system-card { display: none; }
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel, .form-layout { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .app-shell { width: 100%; min-height: 100vh; margin: 0; border-radius: 0; }
  .page, .sidebar { padding: 18px; }
  .sidebar { position: sticky; top: 0; z-index: 10; border-radius: 0; gap: 0; background: rgba(239, 250, 246, 0.96); }
  .collapse-btn { position: fixed; top: 14px; right: 14px; display: grid; width: 48px; height: 48px; border-radius: 10px; transform: none; z-index: 30; }
  .collapse-icon { display: none; }
  .menu-icon { display: block; }
  .brand { min-height: 48px; padding-right: 58px; }
  .nav-list {
    position: fixed;
    top: 72px;
    right: 14px;
    left: 14px;
    z-index: 29;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(239, 250, 246, 0.98);
    box-shadow: 0 18px 46px rgba(28, 63, 55, 0.12);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }
  .sidebar-toggle:checked ~ .app-shell .nav-list { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .topbar, .section-head { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .bento-grid, .form-layout, .field-grid { grid-template-columns: 1fr; }
  .nav-item { justify-content: flex-start; min-height: 42px; }
}

@media (max-width: 430px) {
  h1 { font-size: 24px; }
  h2,
  .hero-panel h2,
  .section-head h2 { font-size: 22px; }
  .hero-panel, .panel, .metric-panel, .ai-card { padding: 14px; }
  .drop-zone { min-height: 190px; }
}
