/* Colors and spacing come from wa-design-system tokens.json. Light only, Inter only. */
:root {
  --blue: #165BC3;
  --blue-deep: #032962;
  --blue-soft: #E8EEFF;
  --blue-wash: #EBF1FA;
  --text: #322F2F;
  --text-2: #3A362E;
  --muted: #7A7468;
  --cool: #677489;
  --canvas: #F6F4F1;
  --base: #FFFFFF;
  --sunken: #F2F5F9;
  --ink: #1A1A1A;
  --line: #E6E1D6;
  --line-cool: #E3E8EF;
  --danger: #FF3B30;
  --danger-soft: #FFECEC;
  --green-bg: #DFFFEF;
  --green-text: #106C3E;
  --orange-bg: #FFECDC;
  --orange-text: #B14F00;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--text); }
body { font: 15px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; margin: 4px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 10px 0 0; }
.ok { color: var(--green-text); margin: 10px 0 0; }

.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  transition: background 220ms var(--ease), opacity 220ms var(--ease);
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.secondary { background: var(--blue-soft); color: var(--blue-deep); }
.btn.secondary:hover { background: var(--blue-wash); }
.btn.ghost { background: transparent; color: var(--cool); padding: 8px 12px; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { background: var(--danger-soft); color: #A12A48; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.small { padding: 6px 12px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.field span { font-size: 13px; color: var(--cool); }
.field.small span { font-size: 12px; }
.field.grow { flex: 1; }
input, textarea, select {
  font: inherit; color: var(--text); background: var(--base); border: 1px solid var(--line-cool);
  border-radius: 12px; padding: 10px 14px; outline: none; transition: border-color 220ms var(--ease);
}
textarea { resize: vertical; min-height: 120px; border-radius: 16px; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); }

.card { background: var(--base); border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; margin: 0 0 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.card, form.row { align-items: flex-end; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 32px; }
.google-button { min-height: 44px; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--base); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 20px; }
.brand { font-weight: 700; font-size: 18px; padding: 0 8px; }
nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { font: inherit; font-weight: 500; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--text-2); }
.nav-item:hover { background: var(--sunken); }
.nav-item.on { background: var(--blue-soft); color: var(--blue-deep); }
.signout { margin-top: auto; align-self: flex-start; }
.main { padding: 32px 40px; max-width: 920px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.back { margin-left: -12px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--base); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.list-row.link { cursor: pointer; transition: border-color 220ms var(--ease); }
.list-row.link:hover { border-color: var(--line-cool); }
.list-row .title { font-weight: 600; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--base); border: 1px dashed var(--line); border-radius: 14px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(103,116,137,0.10); color: var(--cool); }
.tag.on { background: var(--green-bg); color: var(--green-text); }
.tag.off { background: var(--orange-bg); color: var(--orange-text); }

ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
ul.problems li { color: #A12A48; }
ul.assumptions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
ul.assumptions li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--sunken); border-radius: 12px; padding: 10px 14px; }
ul.assumptions li.used { background: var(--green-bg); }
.json summary { cursor: pointer; font-weight: 600; }
.json pre { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--sunken); border-radius: 12px; padding: 14px; margin: 12px 0 0; max-height: 420px; overflow: auto; }
.code-card { text-align: center; }
.code { font-size: 40px; font-weight: 700; letter-spacing: 0.2em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 20px 16px; }
}
