:root {
  --bg: #0f1218;
  --panel: #161b24;
  --panel-2: #1d2530;
  --line: #2a3340;
  --txt: #e7edf5;
  --muted: #8b97a8;
  --accent: #4f8cff;
  --accent-2: #36d399;
  --warn: #f6a93b;
  --danger: #f06d6d;
  --chip: #232c39;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1b2740 0%, var(--bg) 55%);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: rgba(15, 18, 24, 0.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-size: 26px; width: 46px; height: 46px; flex: none;
  display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7b5cff); color: #fff;
}
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: .2px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.privacy { color: var(--accent-2); font-size: 13px; font-weight: 600; white-space: nowrap; }

main {
  display: grid; grid-template-columns: minmax(320px, 0.85fr) 1.3fr;
  gap: 20px; padding: 22px 28px; align-items: start;
  max-width: 1480px; margin: 0 auto;
}

.input-pane, .output-pane {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.input-pane { position: sticky; top: 96px; }

.input-head, .output-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
h2 { font-size: 15px; margin: 0; color: var(--txt); }
.samples { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.samples span { color: var(--muted); font-size: 12px; }

.chip {
  background: var(--chip); color: var(--txt); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  transition: .15s;
}
.chip:hover { border-color: var(--accent); color: #fff; }
.chip.ghost { color: var(--muted); }

textarea#docInput {
  width: 100%; height: 420px; resize: vertical;
  background: var(--panel-2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px; font-family: var(--font);
  font-size: 14px; line-height: 1.6; outline: none;
}
textarea#docInput:focus { border-color: var(--accent); }

.input-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
}
#charCount { color: var(--muted); font-size: 12.5px; }

button.primary {
  background: linear-gradient(135deg, var(--accent), #6a5cff); color: #fff;
  border: none; border-radius: 10px; padding: 11px 20px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: .15s;
}
button.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.actions { display: flex; gap: 8px; }
button.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 13px; font-size: 12.5px; cursor: pointer;
}
button.ghost:hover:not(:disabled) { color: var(--txt); border-color: var(--accent); }
button.ghost:disabled { opacity: .4; cursor: not-allowed; }

.stats {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.stat {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; min-width: 78px;
}
.stat .num { font-size: 20px; font-weight: 700; line-height: 1; }
.stat .lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stat.warn .num { color: var(--warn); }
.stat.good .num { color: var(--accent-2); }

.global-gaps {
  background: rgba(246, 169, 59, .08); border: 1px solid rgba(246, 169, 59, .35);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.global-gaps h3 { margin: 0 0 8px; font-size: 13px; color: var(--warn); }
.global-gaps ul { margin: 0; padding-left: 18px; }
.global-gaps li { font-size: 13px; margin: 3px 0; color: #ffe1b3; }

.canvas {
  display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px;
  align-items: start;
}
.empty-state {
  width: 100%; text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-emoji { font-size: 44px; margin-bottom: 10px; }
.muted { color: var(--muted); }

.phase {
  flex: 0 0 320px; max-width: 360px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.phase-head { display: flex; align-items: baseline; gap: 8px; }
.phase-idx {
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 6px; padding: 2px 8px; flex: none;
}
.phase-title { font-size: 14.5px; font-weight: 700; }
.phase-dep { font-size: 11.5px; color: var(--muted); margin-top: -4px; }

.task {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px;
}
.task.done { opacity: .58; }
.task.done .task-title { text-decoration: line-through; }
.task-top { display: flex; gap: 9px; align-items: flex-start; }
.task-top input[type=checkbox] {
  margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent-2);
  flex: none; cursor: pointer;
}
.task-title { font-size: 13.5px; font-weight: 600; }

.task-sec { margin-top: 8px; }
.task-sec .sec-lbl {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 3px;
}
.ac-list { margin: 0; padding-left: 16px; }
.ac-list li { font-size: 12.5px; margin: 2px 0; color: #c7d2e0; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dep-chip {
  background: rgba(79, 140, 255, .14); border: 1px solid rgba(79, 140, 255, .4);
  color: #aecbff; border-radius: 999px; padding: 2px 9px; font-size: 11.5px;
}
.gap-chip {
  background: rgba(240, 109, 109, .12); border: 1px solid rgba(240, 109, 109, .4);
  color: #ffb4b4; border-radius: 999px; padding: 2px 9px; font-size: 11.5px;
}
.gap-chip.soft {
  background: rgba(246, 169, 59, .12); border-color: rgba(246, 169, 59, .4);
  color: #ffd79a;
}

.sitefoot {
  border-top: 1px solid var(--line); margin-top: 10px; padding: 20px 28px;
  text-align: center; color: var(--muted); font-size: 12.5px;
}
.sitefoot p { margin: 3px 0; }
.hidden { display: none !important; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--accent-2); color: #06251a; font-weight: 600;
  padding: 10px 20px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0,0,0,.4); opacity: 0; transition: .25s;
  pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; bottom: 34px; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .input-pane { position: static; }
  textarea#docInput { height: 200px; }
  .canvas { flex-direction: column; }
  .phase { flex: 1 1 auto; max-width: none; }
  .topbar { padding: 14px 18px; }
  .privacy { display: none; }
  main { padding: 16px; }
}
