/*
 * Elker interactive demos: shared styles.
 *
 * Two layers:
 *  - The frame (story rail, steps, outcome): follows the viewer's light/dark theme.
 *  - The replica (.app, .phone): a simplified Elker screen. Always light, because it
 *    stands in for the real product, which has no dark mode.
 */

/* ---------- Frame tokens ---------- */
:root {
  --ground: #F9F8F6;          /* Elker off-white */
  --stage: #EFECE7;           /* Elker grey-200, warm */
  --surface: #FFFFFF;
  --ink: #121826;
  --ink-2: #545963;
  --ink-3: #8A8F9A;
  --line: #E5E3DF;
  --accent: #5A6DED;          /* Elker primary */
  --accent-ink: #3F51D6;
  --accent-soft: #EEF0FD;
  /* Button purple: darker than --accent so white text passes contrast (5.4:1) in both themes. */
  --btn: #4A5CDF;
  --btn-hover: #3F51D6;
  --good: #2F6971;            /* Elker caribbean green */
  --good-soft: #E3F0F1;
  --shadow: 0 1px 2px rgba(18, 24, 38, .06), 0 12px 32px -12px rgba(18, 24, 38, .18);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #10141D;
    --stage: #181D29;
    --surface: #1C2230;
    --ink: #ECEEF3;
    --ink-2: #A9AFBD;
    --ink-3: #7A8194;
    --line: #2A3142;
    --accent: #8190F5;
    --accent-ink: #A4AFF8;
    --accent-soft: #232A45;
    --good: #7CC3C9;
    --good-soft: #1B2F33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #10141D;
  --stage: #181D29;
  --surface: #1C2230;
  --ink: #ECEEF3;
  --ink-2: #A9AFBD;
  --ink-3: #7A8194;
  --line: #2A3142;
  --accent: #8190F5;
  --accent-ink: #A4AFF8;
  --accent-soft: #232A45;
  --good: #7CC3C9;
  --good-soft: #1B2F33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -12px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--ground); }
body {
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-inline: clamp(16px, 3vw, 40px);
  padding-block: 0 48px;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.dk-top {
  display: flex; align-items: center; gap: 16px;
  padding-block: 18px; max-width: 1360px; margin-inline: auto;
}
.dk-top .dk-logo { height: 24px; width: auto; display: block; }
.dk-logo--dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dk-logo--light { display: none !important; }
  :root:not([data-theme="light"]) .dk-logo--dark { display: block !important; }
}
:root[data-theme="dark"] .dk-logo--light { display: none !important; }
:root[data-theme="dark"] .dk-logo--dark { display: block !important; }
.dk-top .dk-kind {
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.dk-top .dk-spacer { flex: 1; }
.dk-link {
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  color: var(--accent-ink); font-weight: 600; font-size: 14px;
}
.dk-link:hover { text-decoration: underline; }
.dk-embed .dk-top { display: none; }
.dk-embed body { padding-block: 16px; }

/* ---------- Layout ----------
 * One column at every width: a short title block, then the demo as one unit (the instruction
 * strip joined to the top of the stage), then the outcome. The story rail's children join the
 * page flow through display: contents. */
.dk-layout { max-width: 1360px; margin-inline: auto; display: flex; flex-direction: column; align-items: stretch; }
.dk-story { display: contents; }
.dk-intro { order: 1; display: grid; gap: 2px; margin-bottom: 16px; }
.dk-steps-wrap { order: 2; }
.dk-stage-wrap { order: 3; }
.dk-outcome { order: 4; margin-top: 26px; }
.dk-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0;
}
.dk-title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 2.3vw, 31px);
  line-height: 1.2; letter-spacing: -.01em; margin: 4px 0 0; text-wrap: balance;
}
.dk-lede { margin: 6px 0 0; color: var(--ink-2); font-size: 15.5px; max-width: 80ch; }

/* ---------- Instruction strip ----------
 * Sits on top of the stage as one unit. A thin progress bar runs along its top edge; only the
 * active step shows, as: number, instruction, "Why this matters", button. */
.dk-steps-wrap {
  position: relative; background: var(--surface); border-radius: 8px 8px 0 0;
  box-shadow: 0 0 0 1px var(--line); padding: 18px 20px 14px; z-index: 4;
}
.dk-segs { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(var(--dk-n, 5), minmax(0, 1fr)); gap: 3px; }
.dk-segs button { appearance: none; border: 0; padding: 0; height: 4px; background: var(--line); cursor: default; }
.dk-segs button:first-child { border-top-left-radius: 8px; }
.dk-segs button:last-child { border-top-right-radius: 8px; }
.dk-segs button.is-done { background: var(--good); cursor: pointer; }
.dk-segs button.is-active { background: var(--accent); }
.dk-steps { list-style: none; margin: 0; padding: 0; }
.dk-steps .dk-step:not(.is-active) { display: none; }
.dk-step.is-active {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 18px; row-gap: 2px; align-items: center;
}
.dk-step-title { grid-column: 1; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--ink); line-height: 1.4; }
.dk-step-num {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--btn); color: #fff; font-variant-numeric: tabular-nums;
}
.dk-step-body { display: contents; }
.dk-step-body > p { grid-column: 1; margin: 0 0 0 32px; color: var(--ink-2); font-size: 14.5px; }
.dk-step-body > .dk-why { grid-column: 2; grid-row: 1 / span 2; }
.dk-step-body > .dk-why[open] { grid-column: 1 / -1; grid-row: auto; margin: 8px 0 0 32px; }
.dk-step-body > .dk-actions { grid-column: 3; grid-row: 1 / span 2; }
.dk-dock-done { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.dk-dock-done > strong { font-size: 16px; }
.dk-dock-done > span { color: var(--ink-2); font-size: 14.5px; flex: 1 1 240px; }
.dk-progress { display: none; }
@media (max-width: 760px) {
  .dk-steps-wrap { padding: 16px 14px 12px; }
  .dk-step.is-active { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .dk-step-body > p { margin-left: 0; }
  .dk-step-body > .dk-why { grid-column: 1; grid-row: auto; }
  .dk-step-body > .dk-actions { grid-column: 2; grid-row: auto; }
}
.dk-why { font-size: 14px; color: var(--ink-2); }
.dk-why summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 5px 11px;
}
.dk-why summary::-webkit-details-marker { display: none; }
.dk-why summary::after { content: "+"; font-weight: 700; }
.dk-why[open] summary::after { content: "\2212"; }
.dk-why p { margin: 8px 0 0; background: var(--accent-soft); border-radius: 5px; padding: 10px 12px; color: var(--ink-2); }
.dk-why strong { color: var(--ink); font-weight: 600; }
.dk-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dk-more { justify-self: start; padding: 2px 0; font-size: 13px; }
.dk-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.dk-btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 5px;
  background: var(--btn); color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 16px; display: inline-flex; align-items: center; gap: 8px;
}
.dk-btn:hover { background: var(--btn-hover); }
.dk-btn[disabled] { opacity: .5; cursor: progress; }
.dk-btn .dk-arrow { font-size: 16px; line-height: 1; }
.dk-hint { font-size: 13px; color: var(--ink-3); }

/* ---------- Outcome ---------- */
.dk-outcome { display: grid; gap: 18px; }
.dk-outcome h2 { font-family: var(--serif); font-size: 22px; line-height: 1.25; margin: 0; font-weight: 600; text-wrap: balance; }
.dk-outcome p { margin: 0; color: var(--ink-2); }
.dk-result {
  background: var(--surface); border-radius: 6px; box-shadow: var(--shadow);
  padding: 18px; display: grid; gap: 10px;
}
.dk-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dk-facts li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; color: var(--ink-2); font-size: 14px; }
.dk-facts li::before { content: "\2713"; color: var(--good); font-weight: 700; }
.dk-facts strong { color: var(--ink); font-weight: 600; }
.dk-uses-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 0; }
.dk-uses { display: grid; gap: 10px; }
.dk-use { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.dk-use h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.dk-use p { font-size: 14px; }

/* ---------- Stage ---------- */
.dk-stage-wrap { display: grid; gap: 10px; min-width: 0; align-content: start; }
.dk-stage {
  background: var(--stage); border-radius: 0 0 8px 8px; padding: clamp(14px, 2.2vw, 28px);
  display: flex; gap: clamp(14px, 2vw, 28px); align-items: flex-start; justify-content: center;
  position: relative;
}
.dk-caption { font-size: 13px; color: var(--ink-3); text-align: center; margin: 0; }
.dk-panes-toggle { display: none; justify-self: center; background: var(--surface); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.dk-panes-toggle button {
  border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.dk-panes-toggle button[aria-pressed="true"] { background: var(--btn); color: #fff; }
.dk-pane { display: grid; gap: 8px; min-width: 0; position: relative; align-content: start; }
.dk-pane-label {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); padding-left: 4px;
}
.dk-pane[data-pane="staff"] { flex: 1 1 620px; max-width: 900px; }
.dk-pane[data-pane="reporter"] { flex: 0 0 auto; }

/* ---------- Hotspot and notes ---------- */
.dk-hot { position: relative; z-index: 2; animation: dk-pulse 1.6s ease-out infinite; cursor: pointer; }
@keyframes dk-pulse {
  0% { box-shadow: 0 0 0 0 rgba(90, 109, 237, .55); }
  70% { box-shadow: 0 0 0 10px rgba(90, 109, 237, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 109, 237, 0); }
}
.dk-note {
  position: absolute; z-index: 5; width: max-content; max-width: 230px;
  background: #121826; color: #fff; border-radius: 5px;
  font: 500 12.5px/1.45 var(--sans); padding: 8px 10px; white-space: normal; letter-spacing: normal; text-transform: none; text-align: left;
  box-shadow: 0 8px 20px -8px rgba(18, 24, 38, .5);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.dk-note.is-on { opacity: 1; transform: none; }
.dk-note::after {
  content: ""; position: absolute; width: 10px; height: 10px; background: inherit;
  transform: rotate(45deg); border-radius: 2px;
}
.dk-note[data-arrow="up"]::after { top: -4px; left: 18px; }
.dk-note[data-arrow="down"]::after { bottom: -4px; left: 18px; }
.dk-note[data-arrow="left"]::after { left: -4px; top: 12px; }
.dk-note[data-arrow="right"]::after { right: -4px; top: 12px; }

/* ---------- Replica: browser window + app ---------- */
.app, .phone {
  --a-bg: #F9F8F6; --a-card: #FFFFFF; --a-ink: #121826; --a-ink-2: #545963; --a-ink-3: #979DA9;
  --a-line: #E5E3DF; --a-soft: #F4F2EE; --a-primary: #5A6DED; --a-primary-soft: #EEF0FD;
  --a-ghost: #E9E6E1; --a-green: #2F6971; --a-green-soft: #E3F0F1; --a-amber: #92400E; --a-amber-soft: #FDF1DD;
  color: var(--a-ink); font: 13px/1.45 var(--sans); color-scheme: light;
}
.app {
  background: var(--a-card); border-radius: 8px; box-shadow: var(--shadow);
  display: grid; grid-template-rows: auto 1fr; min-height: 500px; position: relative;
}
.anchor { position: relative; }
.app-url {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #EDEAE5; border-bottom: 1px solid var(--a-line); border-radius: 8px 8px 0 0;
}
.app-url span {
  flex: 1; background: #fff; border-radius: 6px; padding: 4px 10px;
  font-size: 11.5px; color: var(--a-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-body { display: grid; grid-template-columns: 52px 1fr; min-height: 0; }
.app-rail {
  border-bottom-left-radius: 8px;
  background: var(--a-bg); border-right: 1px solid var(--a-line);
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 0;
}
.app-rail svg { width: 22px; height: 26px; }
.app-rail i { display: block; width: 22px; height: 22px; border-radius: 6px; background: var(--a-ghost); }
.app-rail i.on { background: var(--a-primary-soft); box-shadow: inset 0 0 0 1.5px var(--a-primary); }
.app-main { border-bottom-right-radius: 8px; background: var(--a-bg); display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.app-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--a-line); background: var(--a-bg);
}
.app-head h4 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.app-head .meta { width: 100%; display: flex; gap: 14px; color: var(--a-ink-3); font-size: 12px; }
.app-cols { display: grid; grid-template-columns: 1.5fr 1fr; min-height: 0; }
.app-col { padding: 14px 18px; display: grid; align-content: start; gap: 12px; min-width: 0; }
.app-col + .app-col { border-left: 1px solid var(--a-line); background: var(--a-card); border-bottom-right-radius: 8px; }
.ghost { display: block; height: 9px; border-radius: 5px; background: var(--a-ghost); }
.ghost.w40 { width: 40%; } .ghost.w60 { width: 60%; } .ghost.w80 { width: 80%; } .ghost.w30 { width: 30%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; padding: 3px 7px;
  font-size: 11.5px; font-weight: 600; background: var(--a-soft); color: var(--a-ink-2); white-space: nowrap;
}
.badge.primary { background: var(--a-primary-soft); color: #3F51D6; }
.badge.green { background: var(--a-green-soft); color: var(--a-green); }
.badge.amber { background: var(--a-amber-soft); color: var(--a-amber); }
.field { display: grid; gap: 3px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--a-ink-3); }
.field div { color: var(--a-ink); }
.field .empty { color: var(--a-ink-3); font-style: italic; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--a-ink-3); }

.a-btn {
  appearance: none; border: 0; border-radius: 5px; background: var(--a-primary); color: #fff;
  font: 600 12.5px/1 var(--sans); padding: 8px 12px; cursor: pointer; white-space: nowrap;
}
.a-btn.ghosted { background: var(--a-card); color: var(--a-ink); box-shadow: inset 0 0 0 1px var(--a-line); }

/* Chat */
.chat { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; min-height: 300px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; min-height: 180px; }
.chat-empty { color: var(--a-ink-3); font-size: 12px; text-align: center; margin: auto 0; }
.msg { max-width: 88%; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; animation: msg-in .3s ease both; }
.msg small { display: block; font-size: 10.5px; opacity: .7; margin-top: 3px; }
.msg.out { align-self: flex-end; background: var(--a-primary); color: #fff; border-bottom-right-radius: 3px; }
.msg.in { align-self: flex-start; background: var(--a-soft); color: var(--a-ink); border-bottom-left-radius: 3px; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* The message box always takes the full width, with Send under it, so it never gets squeezed
   into a narrow column beside the button. */
.composer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: flex-end; }
.composer .input {
  flex: 1 1 100%; min-width: 0; min-height: 44px; border-radius: 6px; background: var(--a-card);
  box-shadow: inset 0 0 0 1px var(--a-line); padding: 10px 12px; font-size: 13px; line-height: 1.5;
  color: var(--a-ink);
}
.composer .a-btn { flex: 0 0 auto; }
.composer .input:empty::before { content: attr(data-placeholder); color: var(--a-ink-3); }
.typing-caret::after { content: ""; display: inline-block; width: 1px; height: 1em; background: currentColor; margin-left: 1px; vertical-align: -2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Replica: phone ---------- */
.phone {
  width: 280px; height: 560px; border-radius: 38px; background: #121826; padding: 10px;
  box-shadow: var(--shadow); position: relative;
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 29px; background: var(--a-bg); overflow: hidden;
  display: grid; grid-template-rows: auto auto 1fr; position: relative;
}
.phone-status { display: flex; justify-content: space-between; padding: 12px 22px 6px; font-size: 11.5px; font-weight: 600; }
.phone-head { padding: 6px 16px 12px; border-bottom: 1px solid var(--a-line); display: grid; gap: 2px; }
.phone-head strong { font-size: 14px; }
.phone-head span { font-size: 11.5px; color: var(--a-ink-3); }
.phone-body { padding: 12px 14px; display: grid; align-content: start; gap: 10px; min-height: 0; overflow: hidden; }
.phone .chat { min-height: 0; height: 100%; }
.phone .chat-log { min-height: 0; }
.p-card { background: var(--a-card); border-radius: 6px; padding: 12px; box-shadow: 0 0 0 1px var(--a-line); display: grid; gap: 6px; }
.toast {
  position: absolute; left: 10px; right: 10px; top: 34px; z-index: 4;
  background: rgba(255, 255, 255, .96); border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 10px 30px -8px rgba(18, 24, 38, .45); display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center;
  transform: translateY(calc(-100% - 44px)); transition: transform .45s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.is-on { transform: none; }
.toast .icon { width: 30px; height: 30px; border-radius: 8px; background: var(--a-primary); display: grid; place-items: center; }
.toast .icon svg { width: 16px; height: 18px; }
.toast strong { display: block; font-size: 12px; }
.toast span { font-size: 11.5px; color: var(--a-ink-2); }

/* ---------- Timeline (used by time-based demos) ---------- */
.dk-clock {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: var(--surface); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 600; padding: 6px 14px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */
}
@media (max-width: 760px) {
  .dk-stage { min-height: 0; padding: 14px 10px; }
  .dk-stage[data-multi] .dk-pane { display: none; }
  .dk-stage[data-multi][data-view="staff"] .dk-pane[data-pane="staff"],
  .dk-stage[data-multi][data-view="reporter"] .dk-pane[data-pane="reporter"],
  .dk-stage[data-multi][data-view="external"] .dk-pane[data-pane="external"] { display: grid; }
  .dk-stage[data-multi] ~ .dk-panes-toggle,
  .dk-panes-toggle { display: inline-flex; }
  .app-cols { grid-template-columns: 1fr; }
  .app-col + .app-col { border-left: 0; border-top: 1px solid var(--a-line); }
  .app-body { grid-template-columns: 1fr; }
  .app-rail { display: none; }
  .dk-pane[data-pane="staff"] { flex-basis: 100%; }
  .dk-note { max-width: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  .dk-hot { animation: none; box-shadow: 0 0 0 3px rgba(90, 109, 237, .6); }
  .msg, .toast, .dk-note { animation: none; transition: none; }
  .typing-caret::after { animation: none; }
}

/* ---------- Shared replica parts: switch, list rows, event card, modal ---------- */
.switch {
  appearance: none; border: 0; cursor: pointer; flex: 0 0 auto;
  width: 36px; height: 20px; border-radius: 999px; background: #C8CCD3; position: relative; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--a-primary); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.row-list { display: grid; background: var(--a-card); border-radius: 6px; box-shadow: 0 0 0 1px var(--a-line); }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  padding: 10px 12px; border-top: 1px solid var(--a-line);
}
.row:first-child { border-top: 0; }
.row strong { font-size: 12.5px; font-weight: 600; }
.row .sub { grid-column: 1 / -1; font-size: 11.5px; color: var(--a-ink-3); display: flex; gap: 12px; flex-wrap: wrap; }
.row .tags { display: flex; gap: 5px; }
.row.is-new { background: var(--a-primary-soft); animation: msg-in .35s ease both; }
.row-group { display: grid; }
.row-group-head { padding: 8px 12px; font-size: 11.5px; font-weight: 600; color: #3F51D6; background: var(--a-primary-soft); border-radius: 6px 6px 0 0; }
.event-card {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(340px, 86%); background: var(--surface); color: var(--ink); border-radius: 8px;
  box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 16px 18px; display: grid; gap: 6px;
  animation: msg-in .35s ease both;
}
.event-card .when { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.event-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.event-card strong { color: var(--ink); }
.modal-veil { position: absolute; inset: 0; background: rgba(18, 24, 38, .28); border-radius: 8px; display: grid; place-items: center; z-index: 3; padding: 16px; }
.modal { background: var(--a-card); border-radius: 8px; box-shadow: 0 20px 40px -12px rgba(18, 24, 38, .4); width: min(360px, 100%); display: grid; gap: 12px; padding: 16px; }
.modal h5 { margin: 0; font-size: 14px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.check .box { width: 16px; height: 16px; border-radius: 4px; background: var(--a-primary); display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.check .box.off { background: var(--a-card); box-shadow: inset 0 0 0 1.5px #C8CCD3; }
.check.off { color: var(--a-ink-3); }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #DDE1F4; color: #3F51D6; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.person strong { display: block; font-size: 12.5px; }
.person span { font-size: 11.5px; color: var(--a-ink-3); }
.history { display: grid; gap: 6px; font-size: 11.5px; color: var(--a-ink-2); }
.history div { display: grid; grid-template-columns: 56px 1fr; gap: 8px; animation: msg-in .3s ease both; }
.history time { color: var(--a-ink-3); font-variant-numeric: tabular-nums; }
.file { display: flex; align-items: center; gap: 10px; background: var(--a-card); border-radius: 6px; box-shadow: 0 0 0 1px var(--a-line); padding: 8px 10px; font-size: 12px; animation: msg-in .3s ease both; }
.file .ext { font-size: 10px; font-weight: 700; color: #B71F2F; background: #FFF2F0; border-radius: 3px; padding: 3px 5px; }
.file > span:last-child { color: var(--a-ink-3); font-size: 11px; margin-left: auto; }
.task { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; background: var(--a-card); border-radius: 6px; box-shadow: 0 0 0 1px var(--a-line); padding: 8px 10px; font-size: 12px; animation: msg-in .3s ease both; }
.task .tick { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #C8CCD3; }
.task em { font-style: normal; color: var(--a-ink-3); font-size: 11px; }
.dk-pane[data-pane="external"] { flex: 0 1 360px; min-width: 0; }
.app.compact .app-body { grid-template-columns: 1fr; }
.app.compact .app-rail { display: none; }
.app.compact .app-main { border-bottom-left-radius: 8px; }
.gone { display: grid; place-items: center; text-align: center; gap: 6px; padding: 40px 20px; color: var(--a-ink-2); }
.gone strong { color: var(--a-ink); font-size: 14px; }

/* ---------- Pack navigation ---------- */
a.dk-link { text-decoration: none; }
.dk-hub-link { font-size: 14px; }
.dk-next { display: grid; gap: 10px; }
.dk-next-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  text-decoration: none; color: var(--ink); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent); border-radius: 8px; padding: 18px 22px;
}
.dk-next-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 320px; }
.dk-next-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.dk-next-card strong { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.dk-next-go { flex: 0 0 auto; pointer-events: none; }
.dk-next-card:hover .dk-next-go { background: var(--btn-hover); }
@media (max-width: 560px) { .dk-top .dk-hub-link { display: none; } }

/* ---------- Sequence navigation (top bar) ---------- */
.dk-logo-link { display: flex; align-items: center; gap: 0; flex: 0 0 auto; }
.dk-seq { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.dk-seq-title {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34ch;
}
.dk-seq-pos { font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dk-seq-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.dk-top .dk-spacer { flex: 0 0 4px; }
.dk-nav-btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 600 13px/1 var(--sans); color: var(--ink); background: var(--surface);
  box-shadow: 0 0 0 1px var(--line); border-radius: 5px; padding: 8px 11px;
}
.dk-nav-btn:hover { box-shadow: 0 0 0 1px var(--accent); color: var(--accent-ink); }
.dk-nav-btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.dk-nav-next { background: var(--btn); color: #fff; box-shadow: none; }
.dk-nav-next:hover { color: #fff; box-shadow: none; background: var(--btn-hover); }
@media (max-width: 900px) {
  .dk-seq-title { display: none; }
  .dk-nav-play, .dk-top [data-dk-restart] { display: none; }
}
@media (max-width: 480px) {
  .dk-top { flex-wrap: wrap; }
  .dk-seq-nav { width: 100%; margin-left: 0; }
  .dk-seq-nav .dk-nav-btn { flex: 1; text-align: center; }
}

/* ---------- Browse drawer ---------- */
.dk-drawer-veil { position: fixed; inset: 0; z-index: 50; background: rgba(18, 24, 38, .35); display: flex; justify-content: flex-end; }
.dk-drawer {
  width: min(420px, 100%); height: 100%; overflow-y: auto; background: var(--ground); color: var(--ink);
  box-shadow: -12px 0 40px -12px rgba(18, 24, 38, .4);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: grid; align-content: start; gap: 18px;
}
.dk-drawer-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -18px; background: var(--ground); padding-block: 6px; }
.dk-drawer-head strong { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.dk-drawer-sec h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.dk-drawer-sec.is-current h3 { color: var(--accent-ink); }
.dk-drawer-sec ol { margin: 0; padding-left: 22px; display: grid; gap: 2px; color: var(--ink-3); font-size: 13px; }
.dk-drawer-sec a { display: block; padding: 5px 8px; margin-left: -8px; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.4; }
.dk-drawer-sec a:hover { background: var(--surface); }
.dk-drawer-sec a.is-current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* ---------- Player (play.html) ---------- */
.pl-body { height: 100%; }
.pl { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.pl-bar { display: flex; align-items: center; gap: 14px; padding-block: 12px; flex-wrap: wrap; }
.pl-bar .dk-logo { height: 22px; }
.pl-frame-wrap { position: relative; min-height: 0; border-radius: 8px; overflow: hidden; background: var(--ground); box-shadow: 0 0 0 1px var(--line); }
.pl-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--ground); }
.pl-upnext {
  position: absolute; left: 50%; bottom: 18px; transform: translate(-50%, 140%); z-index: 3;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  background: var(--surface); color: var(--ink); border-radius: 8px; padding: 12px 14px 12px 18px;
  box-shadow: 0 0 0 2px var(--accent), 0 24px 60px -12px rgba(18, 24, 38, .6); transition: transform .35s ease;
}
.pl-upnext.is-on { transform: translate(-50%, 0); }
.pl-upnext span { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); display: block; }
.pl-upnext strong { font-size: 14px; font-weight: 600; display: block; }
.pl-upnext .dk-btn { flex: 0 0 auto; }
.pl-upnext .pl-dismiss { background: none; border: 0; color: var(--ink-2); cursor: pointer; font: 600 13px var(--sans); padding: 6px; }
.dk-nav-btn.is-ready { animation: dk-pulse 1.6s ease-out infinite; }
:fullscreen .pl { padding-inline: 16px; background: var(--ground); }
@media (prefers-reduced-motion: reduce) { .pl-upnext { transition: none; } .dk-nav-btn.is-ready { animation: none; } }

/* ---------- Outcome: one column, read top to bottom ----------
 * What changed, then other ways teams use it, then what to do next. */
.dk-outcome { display: flex; flex-direction: column; gap: 14px; }
.dk-result .dk-facts, .dk-result h2 { max-width: 80ch; }
.dk-outcome > .dk-result { order: 1; }
.dk-outcome > .dk-uses-title { order: 2; margin: 14px 0 0; }
.dk-outcome > .dk-uses { order: 3; }
.dk-outcome > .dk-next { order: 4; margin-top: 18px; }
/* Play it again is the secondary action. */
.dk-outcome .dk-btn[data-dk-restart] { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.dk-outcome .dk-btn[data-dk-restart]:hover { filter: none; box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink); }
.dk-outcome > div:has(> [data-dk-restart]) { order: 5; }
@media (min-width: 761px) {
  .dk-uses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
