:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1a1f29; --muted: #5d6675; --line: #dfe3ea;
  --accent: #0b6e69; --accent-ink: #ffffff; --accent-soft: #e2f3f1;
  --ok: #18794e; --ok-soft: #e3f4ea; --warn: #8a5a00; --warn-soft: #fdf1d5;
  --bad: #b3261e; --bad-soft: #fbe6e4; --info: #1d5fae; --info-soft: #e4eefb;
  --code-bg: #f1f3f6; --var: #7a3ea8; --shadow: 0 1px 2px rgba(20, 28, 40, .06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a; --panel: #1b1f26; --ink: #e8ebf0; --muted: #9aa4b2; --line: #2c333d;
    --accent: #3fb8b0; --accent-ink: #06211f; --accent-soft: #15332f;
    --ok: #5fd08f; --ok-soft: #14301f; --warn: #f0c060; --warn-soft: #3a2d0c;
    --bad: #ff8a80; --bad-soft: #3b1614; --info: #8ab8f5; --info-soft: #152841;
    --code-bg: #232932; --var: #c79bf0; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
p { margin: 0 0 10px; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
pre { background: var(--code-bg); border-radius: 6px; padding: 10px 12px; margin: 0; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; padding: 0 8px 18px; color: var(--accent); }
.brand span { color: var(--ink); font-size: 14px; line-height: 1.25; }
.brand svg { flex: none; }
nav a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); margin-bottom: 2px; }
nav a:hover { background: var(--bg); text-decoration: none; }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); padding: 8px; }
.view { padding: 26px 32px 60px; max-width: 1080px; width: 100%; }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.tight { padding: 0; overflow: hidden; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1 1 200px; }
.gap { height: 10px; }

button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 14px; border-radius: 7px; cursor: pointer; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.danger.solid { background: var(--bad); color: #fff; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button.primary.busy::after { border-color: var(--accent-ink); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
label .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=password], select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 13px; min-height: 220px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { margin-bottom: 14px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg label { margin: 0; padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg label + label { border-left: 1px solid var(--line); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--code-bg); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.banner { border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid transparent; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner strong { display: block; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; background: var(--code-bg); color: var(--muted); font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 2px; }
.cmd { font-family: var(--mono); font-size: 13.5px; background: var(--code-bg); border-radius: 6px; padding: 6px 10px; display: inline-block; max-width: 100%; word-break: break-word; }
.cmd .v { color: var(--var); font-weight: 600; }
.step-meta { font-size: 13px; color: var(--muted); margin-top: 5px; }
.step-meta b { color: var(--ink); font-weight: 600; }
.phase { margin-top: 18px; }
.phase:first-child { margin-top: 0; }
.phase-title { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.phase-title .tag { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.phase.discover .tag { color: var(--info); } .phase.apply .tag { color: var(--warn); } .phase.verify .tag { color: var(--ok); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.big { font-size: 28px; font-weight: 650; line-height: 1.2; }
.arrow { color: var(--muted); padding: 0 8px; }
.stat { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 14px; }
.stat > div > span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.question { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.question .q { font-weight: 600; margin-bottom: 6px; }
.question blockquote { margin: 6px 0 8px; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--code-bg); font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.opt { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-weight: 400; font-size: 14.5px; cursor: pointer; }
.opt input { margin-top: 4px; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { padding: 5px 0 5px 20px; position: relative; color: var(--muted); }
.log li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.log li:last-child { color: var(--ink); }
.log li:last-child::before { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.log.done li:last-child::before { animation: none; }
@keyframes pulse { 50% { opacity: .3; } }

details { border-top: 1px solid var(--line); padding: 10px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 600; }
details > *:not(summary) { margin-top: 10px; }
.tx { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.tx-head { display: flex; gap: 10px; align-items: center; padding: 7px 10px; background: var(--bg); font-size: 13px; }
.tx-head code { flex: 1; word-break: break-word; }
.tx pre { border-radius: 0; max-height: 260px; overflow: auto; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.checklist li:first-child { border-top: 0; }
.checklist .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--code-bg); color: var(--muted); flex: none; }
.checklist li.done .n { background: var(--ok-soft); color: var(--ok); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; max-width: 80vw; z-index: 10; }
.toast.bad { background: var(--bad); color: #fff; }
.confirm { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 0 8px; } nav { display: flex; flex-wrap: wrap; } .side-foot { margin: 0 0 0 auto; }
  .view { padding: 18px 16px 50px; } .two { grid-template-columns: 1fr; }
}

.signed-out .side { display: none; }
.signed-out .shell { grid-template-columns: 1fr; }
.signed-out .view { max-width: none; }
.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { width: min(380px, 92vw); }
.login h1 { margin-bottom: 8px; font-size: 20px; line-height: 1.25; }
