@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("/fonts/jakarta-400.ttf") format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("/fonts/jakarta-500.ttf") format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("/fonts/jakarta-600.ttf") format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("/fonts/jakarta-700.ttf") format("truetype"); }

:root {
  --bg: #f6f7fb; --surface: #ffffff; --sunken: #eff1f8; --ink: #151a2d; --muted: #5d6580; --line: #e0e4f0;
  --primary: #4169e1; --primary-ink: #ffffff; --primary-soft: #e8edfd;
  --lav: #7c6ad9; --lav-soft: #efebff;
  --ok: #17663a; --ok-bg: #e2f3ea; --warn: #8a5a00; --warn-bg: #fff1d6; --bad: #a3261f; --bad-bg: #fde6e4; --info: #2d4fb8; --info-bg: #e8edfd;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace; --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(21, 26, 45, .05), 0 4px 16px rgba(21, 26, 45, .04);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1120; --surface: #161a2e; --sunken: #1d2238; --ink: #e9ecf7; --muted: #9aa3c2; --line: #2a3050;
  --primary: #6f8df0; --primary-ink: #0e1120; --primary-soft: #1f2a52; --lav: #b4a6f5; --lav-soft: #2a2450;
  --ok: #6fd39a; --ok-bg: #12301f; --warn: #f0c36a; --warn-bg: #33270b; --bad: #ff8d84; --bad-bg: #3a1714; --info: #a9bdf7; --info-bg: #1f2a52;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1120; --surface: #161a2e; --sunken: #1d2238; --ink: #e9ecf7; --muted: #9aa3c2; --line: #2a3050;
    --primary: #6f8df0; --primary-ink: #0e1120; --primary-soft: #1f2a52; --lav: #b4a6f5; --lav-soft: #2a2450;
    --ok: #6fd39a; --ok-bg: #12301f; --warn: #f0c36a; --warn-bg: #33270b; --bad: #ff8d84; --bad-bg: #3a1714; --info: #a9bdf7; --info-bg: #1f2a52;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
h1 { font-size: 1.65rem; letter-spacing: -.02em; margin: 0 0 .25rem; font-weight: 700; } h2 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; font-weight: 700; } h3 { font-size: 1rem; margin: 0; font-weight: 600; }
.muted { color: var(--muted); } .mono { font-family: var(--mono); font-size: .84rem; } .small { font-size: .85rem; } .grow { flex: 1; } .spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { display: flex; align-items: center; gap: .9rem; padding: .65rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .55rem; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .95rem; }
.top select { width: auto; max-width: 15rem; padding: .35rem .6rem; }
.top a.navlink { text-decoration: none; color: var(--muted); padding: .3rem .6rem; border-radius: 8px; font-weight: 500; }
.top a.navlink[aria-current=page] { color: var(--primary); background: var(--primary-soft); }
.icon-btn { padding: .35rem .6rem; }
main { max-width: 1120px; margin: 0 auto; padding: 1.4rem 1.25rem 4rem; }
main.narrow { max-width: 440px; margin: 7vh auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: .8rem 0; box-shadow: var(--shadow); }
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.stack > * + * { margin-top: .65rem; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .7rem; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); } input[type=number] { max-width: 12.5rem; }
textarea { min-height: 4.2rem; font-family: var(--mono); font-size: .85rem; }
button { font: inherit; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: .5rem 1rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--primary); }
button.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
button.primary:hover:not(:disabled) { filter: brightness(1.06); }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.small { padding: .25rem .65rem; font-size: .82rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin: 1rem 0; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a[aria-current=page] { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.seg { display: inline-flex; background: var(--sunken); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: .3rem .8rem; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

.banner { border-radius: var(--radius); padding: .85rem 1.1rem; margin: .8rem 0; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.banner .grow { flex: 1; min-width: 14rem; }
.banner.shadow { background: var(--lav-soft); color: var(--ink); border: 1px solid var(--lav); }
.banner.enforce { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.error { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--radius-sm); padding: .5rem .75rem; }
.notice { background: var(--info-bg); color: var(--info); border-radius: var(--radius-sm); padding: .6rem .85rem; }
.badge { display: inline-block; border-radius: 999px; padding: .08rem .65rem; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge.block { background: var(--bad-bg); color: var(--bad); } .badge.ask { background: var(--warn-bg); color: var(--warn); }
.badge.allow { background: var(--ok-bg); color: var(--ok); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.lav { background: var(--lav-soft); color: var(--lav); }
.badge.suggest { background: var(--lav-soft); color: var(--lav); border: 1px dashed var(--lav); }

table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

.cards4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0; } @media (max-width: 860px) { .cards4 { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); }
.kpi .n { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .85rem; font-weight: 500; margin-top: .2rem; } .kpi .s { color: var(--muted); font-size: .78rem; margin-top: .35rem; }
.kpi.accent .n { color: var(--primary); }

.grid2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.2rem; align-items: start; } @media (max-width: 920px) { .grid2 { grid-template-columns: 1fr; } }
.tool { border-left: 3px solid var(--primary); } .tool.off { opacity: .7; border-left-color: var(--line); }
.tool .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .65rem 1rem; margin-top: .7rem; }
.opt { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; } .opt label { margin: 0; color: var(--ink); font-size: .9rem; }
.sentence { background: var(--primary-soft); color: var(--ink); border-radius: var(--radius-sm); padding: .55rem .8rem; font-size: .9rem; }
.sentence.lav { background: var(--lav-soft); }
pre.code { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; overflow: auto; font-family: var(--mono); font-size: .8rem; max-height: 26rem; margin: 0; white-space: pre-wrap; word-break: break-word; }
.feed .item { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed .item:last-child { border-bottom: 0; }
.feed .what { flex: 1; min-width: 0; } .feed .why { color: var(--muted); font-size: .86rem; margin-top: .15rem; } .feed .when { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.feed .item.hl { background: var(--lav-soft); margin: 0 -.6rem; padding-left: .6rem; padding-right: .6rem; border-radius: 10px; }

.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 25, .5); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.3rem; width: min(30rem, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.drawer-back { position: fixed; inset: 0; background: rgba(10, 12, 25, .45); z-index: 20; display: flex; justify-content: flex-end; }
.drawer { background: var(--surface); width: min(34rem, 100%); height: 100%; overflow-y: auto; padding: 1.3rem; box-shadow: -10px 0 40px rgba(0, 0, 0, .25); }

.steps { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 .4rem; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--muted); font-weight: 500; padding: .25rem .7rem; border-radius: 999px; background: var(--sunken); }
.steps li[aria-current=step] { background: var(--primary); color: var(--primary-ink); } .steps li.done { background: var(--ok-bg); color: var(--ok); }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; }
.choice label.pick { display: block; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--ink); background: var(--surface); }
.choice label.pick:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice label.pick b { display: block; margin-bottom: .15rem; }
.waiting { display: flex; gap: .8rem; align-items: center; padding: 1rem; border-radius: var(--radius); background: var(--sunken); }
.waiting.ok { background: var(--ok-bg); color: var(--ok); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lav); animation: pulse 1.4s ease-in-out infinite; } .waiting.ok .dot { background: var(--ok); animation: none; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
@media (max-width: 640px) { main { padding: 1rem .9rem 3rem; } .top { padding: .55rem .9rem; } .kpi .n { font-size: 1.6rem; } th, td { padding: .5rem .4rem; } }

.row > input:not([type=checkbox]):not([type=radio]):not([type=number]), .row > select { width: auto; flex: 1 1 11rem; }
.row > select.fixed, .tool .opts select { width: auto; }

@media (max-width: 640px) { .feed .item { flex-wrap: wrap; } .feed .what { flex: 1 1 100%; order: 2; } .feed .item > div:first-child { order: 1; } .feed .item > div:last-child { order: 1; margin-left: auto; text-align: right; } }

.banner.freeze { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; } .grid3 .card { margin: 0; }
@media print { .top, .tabs, .noprint, button { display: none !important; } body { background: #fff; } main { max-width: none; padding: 0; } .card { box-shadow: none; break-inside: avoid; } .footer { margin-top: 2rem; } }
input[type=color] { width: 3.2rem; height: 2.5rem; padding: .15rem; }
