/* Kitaab pages: roadmap group. Loaded after app.css. Boards: KRoadmap, KSettings. */

/* Shared in this group */
.k-rm .btn-accent, .k-st .btn-accent { color: #FFFFFF; font-weight: 700; }
.k-rm .btn-accent:hover:not(:disabled), .k-st .btn-accent:hover:not(:disabled) { color: #FFFFFF; }

/* ---------- Roadmap: the path as a book's contents ---------- */
.page.k-rm {
  max-width: 1320px; padding: 36px 40px 48px;
  flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 40px 56px;
}
.k-rm-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.k-rm-head .k-kicker { margin: 0; }
.k-rm-title { margin: 6px 0 0; font-family: var(--font-serif); font-size: 46px; font-weight: 600; line-height: 1.05; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.k-rm-sub { margin: 10px 0 0; font-family: var(--font-serif); font-size: 20px; line-height: 1.5; color: #3D3D3D; }

.k-ch-list { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.stage-row.k-ch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 0;
  padding: 14px 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: #FFFFFF;
}
.stage-row.k-ch.dragging { opacity: .5; }
.stage-row.k-ch.drop-target { border: 0; border-bottom: 1px solid var(--ink); box-shadow: inset 0 3px 0 var(--accent); background: #FFFFFF; }

.k-ch-icon {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 0; background: #FFFFFF; color: var(--muted); cursor: pointer;
}
.k-ch-icon:hover:not(:disabled) { color: var(--ink); }
.k-ch-icon:disabled { opacity: .35; cursor: not-allowed; }
.k-ch-grip { cursor: grab; }
.k-ch-more, .k-ch-menu { display: none; } /* phones only (see Phone below) */
.k-ch-grip[aria-expanded="true"] { color: var(--accent); }
.k-ch-num { flex: none; width: 34px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #3D3D3D; }
.k-ch-body { flex: 1 1 300px; min-width: 0; }
.k-ch-titleline { display: flex; align-items: center; gap: 4px; }
.k-ch-titleline .k-ch-icon { color: var(--ink); }
.k-ch-title {
  flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 5px 0; border: 0; border-radius: 0; background: #FFFFFF;
  font-family: var(--font-serif); font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--ink);
  resize: none; overflow: hidden; field-sizing: content; box-sizing: border-box; display: block;
}
.k-ch-title:hover { box-shadow: inset 0 -1px 0 var(--muted); }
.k-ch-title:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.k-ch-sum { margin: 0; font-family: var(--font-serif); font-size: 17px; line-height: 1.5; color: #3D3D3D; }
.k-ch-time { flex: none; width: 70px; font-size: 14px; color: #3D3D3D; }
.k-ch-state { flex: none; width: 108px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.k-ch-go.btn { height: 44px; min-height: 44px; padding: 0 18px; border: 0; font-size: 15px; text-transform: none; letter-spacing: 0; }

/* Done chapters are struck through; the current one has a red numeral */
.k-ch.is-done .k-ch-num, .k-ch.is-done .k-ch-sum, .k-ch.is-done .k-ch-time,
.k-ch.is-done .k-ch-titleline .k-ch-icon { color: var(--muted); }
.k-ch.is-done .k-ch-title { color: #3D3D3D; }
.k-ch.is-done .k-ch-state { color: var(--success); }
.k-ch.is-done .k-ch-state::before { content: "✓ "; }
.k-ch.is-done .k-ch-title:focus-visible { text-decoration: none; color: var(--ink); }
.k-ch.is-now .k-ch-num { color: var(--accent); }

/* Move buttons (keyboard and touch path), opened from the grip */
.k-ch-move { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 10px; padding-left: 92px; }
.k-ch-move .btn { min-height: 44px; padding: 0 16px; }
.k-ch-move .btn-ghost { text-decoration: underline; text-underline-offset: 4px; }

/* Remove confirm, in the row */
.k-ch.is-confirm { padding: 12px 0; }
.k-ch-confirm { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border: 2px solid var(--accent); }
.k-ch-confirm-text { margin: 0; flex: 1 1 240px; font-family: var(--font-serif); font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.k-ch-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.k-ch-confirm-actions .btn { height: 44px; padding: 0 18px; }

/* Add a chapter */
.k-ch-add { padding: 6px 0; border-bottom: 2px solid var(--ink); }
.k-ch-add-btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 8px 0 12px;
  border: 0; background: #FFFFFF; color: var(--accent); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.k-ch-add-btn:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }
.k-ch-add-form { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 0; }
.k-ch-add-form .input { flex: 1 1 260px; min-width: 0; height: 48px; border: 1px solid var(--ink); border-radius: 0; font-size: 16px; }
.k-ch-add-form .btn { height: 48px; padding: 0 20px; }

/* Side column */
.k-rm-aside { flex: 1 1 260px; max-width: 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.k-rm-aside .k-label { margin: 0; }
.k-rm-sec { padding-top: 10px; border-top: 1px solid var(--ink); }
.k-rm-sec.is-dashed { border-top-style: dashed; }
.k-rm-sec p { margin: 0; }
.k-rm-sec-h { font-size: 14px; font-weight: 700; }
.k-rm-sec-text { margin-top: 4px !important; font-family: var(--font-serif); font-size: 17px; line-height: 1.5; color: #3D3D3D; overflow-wrap: anywhere; }
.k-rm-sec .k-note { font-size: 14px; color: var(--muted); }
.k-rm-danger { padding-top: 14px; }
.k-rm-danger .delete-plan { display: flex; flex-direction: column; gap: 12px; }
.k-rm-danger .delete-plan > .btn-danger {
  align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: #FFFFFF; color: var(--accent);
  font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px;
}
.k-rm-danger .delete-plan > .btn-danger:hover:not(:disabled) { background: #FFFFFF; color: var(--accent-hover); }
.k-rm-danger .delete-confirm { gap: 14px; padding: 16px; border: 2px solid var(--accent); }
.k-rm-danger .delete-confirm p { max-width: none; font-family: var(--font-serif); font-size: 18px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.k-rm-danger .delete-confirm .row { display: flex; flex-wrap: wrap; gap: 10px; }
.k-rm-danger .delete-confirm .btn { height: 44px; padding: 0 18px; font-size: 15px; }
.k-rm-danger .btn-destroy { color: #FFFFFF; border: 0; background: var(--accent); }
.k-rm-danger .btn-destroy:hover:not(:disabled) { background: var(--accent-hover); }

/* ---------- Settings: three "§" sections, one Save ---------- */
.page.k-st { max-width: 820px; padding: 32px 40px 56px; gap: 0; }
.k-st .k-kicker { margin: 0; }
.k-st-title { margin: 6px 0 8px; font-family: var(--font-serif); font-size: 46px; font-weight: 600; line-height: 1.05; letter-spacing: -0.015em; }
.k-st-intro { margin: 0 0 28px; font-family: var(--font-serif); font-size: 19px; line-height: 1.55; color: #3D3D3D; }
.k-st-form { display: flex; flex-direction: column; gap: 36px; }
.k-st-sec { border-top: 2px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; }
.k-st-h { margin: 0; font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.2; display: flex; align-items: baseline; gap: 14px; }
.k-st-mark { font-family: var(--font-ui); font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--accent); }
.k-st-field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.k-st-label { padding: 0; font-size: 14px; font-weight: 600; }
.k-seg-field { gap: 8px; }
.k-seg-field legend { margin-bottom: 8px; }
.k-st-note { margin: 0; font-family: var(--font-serif); font-size: 16px; line-height: 1.5; color: #3D3D3D; }
.k-st-lede { margin: 0; font-family: var(--font-serif); font-size: 18px; line-height: 1.55; color: #3D3D3D; }
.k-st-small { margin: 0; font-size: 13px; color: var(--muted); }

.k-st-input, .k-st-select {
  height: 48px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 0; background: #FFFFFF;
  font: inherit; font-size: 16px; color: var(--ink); min-width: 0; width: 100%; box-sizing: border-box;
}
.k-st-select { padding: 0 10px; }
.k-st-input:focus-visible, .k-st-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.k-st-name { max-width: 420px; }
.k-st-field .k-st-input[id$="-custom"] { margin-top: 8px; }

/* Segmented radios */
.k-seg { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; border: 1px solid var(--ink); }
.k-seg-opt { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; font-weight: 600; cursor: pointer; background: #FFFFFF; color: var(--ink); }
.k-seg-opt + .k-seg-opt { border-left: 1px solid var(--ink); }
.k-seg-opt input { margin: 0; accent-color: var(--accent); }
.k-seg-opt:has(input:checked) { background: var(--ink); color: #FFFFFF; }
.k-seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; position: relative; }

/* AI key */
.k-st-cols { display: flex; flex-wrap: wrap; gap: 18px; }
.k-st-cols > .k-st-field { flex: 1 1 220px; }
.k-st-keyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.k-st-key { flex: 1 1 260px; width: auto; font-family: var(--font-code); font-size: 15px; }
.k-st-key.is-saved { background: var(--soft); }
.k-st-key.is-saved::placeholder { color: var(--ink); opacity: 1; }
.k-st .k-st-btn { height: 48px; min-height: 48px; padding: 0 20px; font-size: 15px; font-weight: 700; }
.k-st .btn-danger.k-st-btn { border: 1px solid var(--accent); background: #FFFFFF; color: var(--accent); padding: 0 16px; }
.k-st .btn-danger.k-st-btn:hover:not(:disabled) { background: var(--tint); }
.k-st-remove { display: contents; }
.k-st-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.k-st-confirm-text { font-weight: 600; }
.k-st-keystatus { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: #3D3D3D; }
.k-st-keystatus.is-ok { color: var(--success); font-weight: 600; }
.k-st-keystatus svg { flex: none; }
.k-st-keystatus:empty { display: none; }
.k-st .field-error { margin: 0; }
.k-st .field-error:empty { display: none; }

/* Comfort: a square switch */
.k-switch-row { display: flex; align-items: center; gap: 16px; min-height: 44px; cursor: pointer; }
.k-switch {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 52px; height: 28px;
  border: 2px solid var(--ink); background: #FFFFFF; box-sizing: border-box; position: relative; cursor: pointer;
}
.k-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--ink); }
.k-switch:checked { background: var(--ink); }
.k-switch:checked::after { left: auto; right: 2px; background: #FFFFFF; }
.k-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.k-switch-text { display: flex; flex-direction: column; gap: 2px; }
.k-switch-name { font-weight: 700; }
.k-switch-state { font-weight: 600; color: var(--muted); }
.k-switch-state.is-on { color: var(--success); }
.k-switch-desc { font-family: var(--font-serif); font-size: 16px; line-height: 1.5; color: #3D3D3D; }

/* Save / Discard */
.k-st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border-top: 1px solid var(--ink); padding-top: 20px; }
.k-st-save.btn { height: 52px; min-height: 52px; padding: 0 32px; border: 0; font-size: 16px; }
.k-st-discard { min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.k-st-discard:hover { color: var(--accent-hover); }
.k-st-formstatus { margin: 0; font-size: 14px; font-weight: 600; color: var(--success); }
.k-st-formstatus:empty { display: none; }
.k-st-spacer { flex: 1 1 auto; }
.k-st-account { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.k-st-account .k-st-btn { height: 44px; min-height: 44px; font-size: 14px; font-weight: 600; }

/* ---------- Settings 2026-11-16 ("E"): key status box first, square boxes with grey header bars ---------- */
.page.k-st { max-width: 1000px; }
.k-st-intro { margin-bottom: 24px; }
.k-st-form { gap: 26px; }
.k-st-ai { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 16px; }

/* Status box: the one framed box with the offset shadow on this page; red frame when the key failed */
.k-st-band { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: #FFFFFF; }
.k-st-band[data-state="bad"] { border-color: var(--accent); box-shadow: 6px 6px 0 var(--accent); }
.k-st-bandh, .k-st-cardh { margin: 0; padding: 8px 16px; background: var(--soft); border-bottom: 1px solid var(--ink); font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.5; }
.k-st-bandb { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; padding: 20px 22px; }
.k-st-status { flex: 1 1 360px; min-width: 0; display: flex; align-items: center; gap: 18px; }
.k-st-mark { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid currentColor; color: var(--ink); }
.k-st-band[data-state="ok"] .k-st-mark { color: var(--success); }
.k-st-band[data-state="bad"] .k-st-mark, .k-st-band[data-state="none"] .k-st-mark { color: var(--accent); }
.k-st-statustext { min-width: 0; }
.k-st-statush { margin: 0; font-family: var(--font-serif); font-size: 30px; font-weight: 600; line-height: 1.15; }
.k-st-band[data-state="ok"] .k-st-statush { color: var(--success); }
.k-st-band[data-state="bad"] .k-st-statush { color: var(--accent); }
.k-st-statusp { margin: 4px 0 0; font-family: var(--font-serif); font-size: 17px; line-height: 1.5; color: #3D3D3D; }
.k-st-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.k-st-acts a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.k-st-facts { display: flex; flex-wrap: wrap; margin: 0; border-top: 1px dashed var(--ink); }
.k-st-facts[hidden] { display: none; }
.k-st-facts > div { flex: 1 1 180px; min-width: 0; padding: 10px 22px; }
.k-st-facts > div + div { border-left: 1px dashed var(--ink); }
.k-st-facts dt { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.k-st-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.k-st-mono { font-family: var(--font-code); font-size: 14px; }

/* The key form, folded */
.k-st-fold { border: 1px solid var(--ink); }
.k-st-foldh { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 18px; background: var(--soft); cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.k-st-foldh::-webkit-details-marker { display: none; }
.k-st-foldh::after { content: "+"; margin-left: auto; font-family: var(--font-code); font-size: 20px; font-weight: 400; }
.k-st-fold[open] > .k-st-foldh { border-bottom: 1px solid var(--ink); }
.k-st-fold[open] > .k-st-foldh::after { content: "\2212"; }
.k-st-foldh:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.k-st-foldb { padding: 20px 18px; display: flex; flex-direction: column; gap: 18px; }
.k-st-foldb .k-st-key { flex: none; width: 100%; }
/* Language strips: the chosen option is filled with ink, so the native radio dot is hidden (still focusable). */
.k-st .k-seg-opt { position: relative; }
.k-st .k-seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Profile | Comfort + Account */
.k-st-pair { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.k-st-stack { display: flex; flex-direction: column; gap: 24px; }
.k-st-card { border: 1px solid var(--ink); scroll-margin-top: 16px; }
.k-st-cardb { padding: 18px 16px; display: flex; flex-direction: column; gap: 18px; }
.k-st-link { color: var(--accent); font-weight: 700; text-underline-offset: 3px; }
.k-st-account { justify-content: space-between; }

/* Save bar: ruled, stays at the bottom of the window */
.k-st-actions { position: sticky; bottom: 0; z-index: 2; margin: 0; padding: 14px 0; border-top: 2px solid var(--ink); background: #FFFFFF; }
@media (max-width: 860px) {
  .k-st-pair { grid-template-columns: minmax(0, 1fr); }
}
/* Below 900px the main nav is a fixed bottom tab bar (60px): the save bar sits just above it. */
@media (max-width: 900px) {
  .k-st-actions { bottom: calc(59px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 720px) {
  .k-st-band { box-shadow: 4px 4px 0 var(--ink); }
  .k-st-band[data-state="bad"] { box-shadow: 4px 4px 0 var(--accent); }
  .k-st-bandb { padding: 16px; }
  .k-st-status { flex-basis: 100%; gap: 14px; }
  .k-st-mark { width: 42px; height: 42px; }
  .k-st-statush { font-size: 24px; }
  .k-st-facts > div { padding: 8px 16px; flex-basis: 100%; }
  .k-st-facts > div + div { border-left: 0; border-top: 1px dashed var(--ink); }
  .k-st-foldb { padding: 16px; }
}

/* Devanagari: a little more line height */
.k-rm :lang(hi):not(:lang(hi-Latn)), .k-st :lang(hi):not(:lang(hi-Latn)) { line-height: 1.7; }
.k-rm .k-rm-title:lang(hi), .k-st .k-st-title:lang(hi), .k-st .k-st-h:lang(hi) { line-height: 1.3; }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .page.k-rm { padding: 24px 16px 40px; gap: 32px; }
  .k-rm-title, .k-st-title { font-size: 34px; }
  .k-rm-sub { font-size: 18px; }
  .k-rm-aside { max-width: none; flex-basis: 100%; }

  /* Row: numeral | title | "⋯"; time and state under the title; the menu under that (option B of
     docs/design/mobile-fixes-options-2026-11-21.html). Grip, pencil and bin are in the menu on phones. */
  .stage-row.k-ch {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) 44px;
    grid-template-areas: "num body more" ". meta meta" "menu menu menu";
    gap: 4px 6px; align-items: center;
  }
  .k-ch-grip, .k-ch-del, .k-ch-titleline .k-ch-icon, .k-ch-move { display: none; }
  .k-ch-more { display: inline-flex; grid-area: more; align-self: start; font-size: 22px; color: var(--ink); }
  .k-ch-more[aria-expanded="true"] { color: var(--accent); }
  .k-ch-num { grid-area: num; width: auto; align-self: start; padding-top: 8px; }
  .k-ch-body { grid-area: body; }
  .k-ch-time { grid-area: meta; width: auto; }
  .k-ch-state { grid-area: meta; width: auto; justify-self: end; }
  .k-ch-menu { grid-area: menu; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 6px; }
  .k-ch-menu .btn { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .k-ch-menu .k-ch-menu-del { color: var(--accent); }
  .k-ch-title { font-size: 20px; }
  .k-ch-sum { font-size: 16px; }
  .stage-row.k-ch.is-confirm { display: flex; }

  .page.k-st { padding: 24px 16px 40px; }
  .k-st-h { font-size: 24px; }
  .k-st-intro { font-size: 17px; }
  .k-st-keyrow .k-st-key { flex-basis: 100%; }
  .k-st-spacer { display: none; }
  .k-st-account { flex-basis: 100%; }
}

/* Reading voice (Settings > Comfort): the dropdown takes the free width next to "Try it". */
.k-st-voice { padding-top: 14px; border-top: 1px dashed var(--ink); }
.k-st-voice .k-st-keyrow .k-st-select { flex: 1 1 200px; width: auto; }
