/* AlgoCademy app: the detail layer (2026-11-15). Loaded after app.css and the dark theme's rules on every page of the
   app (lib/bootstrap.php ac_detail_head). Type is app.css's, untouched: no font, size, weight or letter spacing is set
   here, and no colour of the light theme or of the dark theme changes. What it does (what the owner kept of the
   design preview: "the spacing and the calmer first lesson screen are good"):
     - a calmer lesson screen: the step card is the one tinted, lifted box; the picture under it loses its blue frame,
       the invitation to the interactive lesson is a link row, the "Start with" switch has no blue tile, Check stands
       on a ledge
     - spacing and shapes: rounder cards, buttons and tags, a soft lift under the panes; on a computer a little more
       room in the step card and the menus (where the panes stack, the app's own padding, so text fits as it did)
     - small labels brought up to AA contrast in their own hue, a darker focus ring
   Tried and taken out again: Inter ("Can you put back the original font?"), larger sizes ("not sure about font size,
   on mobile it looked off"), and a phone layout of the lesson heading (not shipped; the owner has the picture).

   Every rule starts with html:not(.design-old). That gives it the weight of one class more than app.css's rule for the
   same thing, level with the dark theme's rules (html[data-theme="dark"] ...), which this file follows in the page, so
   it wins over both without !important. The class itself is only ever set on dev, by ?design=old (lib/design-new.php),
   to compare with the app as it was; nothing sets it in production.
   The colours it needs are the --dn- variables below, in the light theme's values and the dark theme's. */

/* ==== The detail layer ============================================================================================ */
/* Its own colours, all the app's. (Named -bg, -fg and -line by what they colour.) */
html:not(.design-old) {
    --dn-accent-bg: #245bd6; --dn-accent-fg: #245bd6; --dn-ring-line: #245bd6; --dn-ring-dark-line: #86aafa;
  --dn-bar-bg: #4a7cf0; --dn-ledge-bg: #e6e9ee; --dn-shade-line: #1b2a4a;
  --dn-quiet-bg: #f6f7f9; --dn-quiet-hover-bg: #eef0f4; --dn-quiet-line: #e4e8ef;
  --dn-chip-line: #dfe5ee; --dn-chip-fg: #2a3243; --dn-soft-fg: #5f6878; --dn-icon-fg: #7d8592; --dn-tiny-fg: #687182;
  --dn-fnum-bg: #e9ecf1; --dn-fnum-fg: #49515f; --dn-seg-bg: #f0f2f5; --dn-seg-fg: #4a5568; --dn-off-fg: #586170; --dn-card-bg: #ffffff;
  --dn-gutter-fg: #8d96ab; --dn-step-bg: #3566d9; --dn-step-hover-bg: #2f62d6;
  --dn-check-bg: #3b6fe0; --dn-check-hover-bg: #3566d9; --dn-check-edge-bg: #2850b4;
  --dn-lift: 0 14px 40px -28px color-mix(in srgb, var(--dn-shade-line) 35%, transparent), 0 2px 0 var(--dn-ledge-bg);   /* under a white card */
  --dn-card-lift: 0 10px 24px -18px color-mix(in srgb, var(--dn-shade-line) 40%, transparent);
}
/* The dark theme: the same tokens in its colours, each moved as lib/dark-theme.php moves the app's own (ac_dark_value
   of the light value), so no light surface, line or shadow comes into the dark. The code pane's are the same in both. */
html:not(.design-old)[data-theme="dark"] { --dn-accent-bg: #245bd6; --dn-accent-fg: #8db3ff; --dn-ring-line: #245bd6; --dn-ledge-bg: #31343a; --dn-shade-line: #1b2a4a; --dn-quiet-bg: #282b31; --dn-quiet-hover-bg: #2c2f36; --dn-quiet-line: #454951; --dn-chip-line: #444b54; --dn-chip-fg: #d2ddf3; --dn-soft-fg: #aab4c6; --dn-icon-fg: #a9b2bf; --dn-tiny-fg: #a8b1c4; --dn-fnum-bg: #2f3238; --dn-fnum-fg: #bcc5d6; --dn-seg-bg: #2b2e34; --dn-seg-fg: #b5c2d8; --dn-off-fg: #afb9ca; --dn-card-bg: #23262c; }
/* By hand: shadows are black and the ledge under a card is darker than the page; the ring is the light one. */
html:not(.design-old)[data-theme="dark"] { --dn-shade-line: #000000; --dn-ledge-bg: #0a0c10; --dn-ring-line: #86aafa;
  --dn-lift: 0 14px 40px -26px #000000cc, 0 2px 0 var(--dn-ledge-bg); --dn-card-lift: 0 10px 24px -16px #000000b3; }
/* "Start with" in the dark: the open choice is the lighter tile (a darker one would read as pressed in). */
/* The app's ring (#7299f0) is under 3:1 on white: the accent itself instead; a light one on the dark pane. */
html:not(.design-old) button:focus-visible, html:not(.design-old) a:focus-visible, html:not(.design-old) summary:focus-visible,
html:not(.design-old) input:focus-visible, html:not(.design-old) select:focus-visible, html:not(.design-old) [tabindex]:focus-visible { outline: 3px solid var(--dn-ring-line); outline-offset: 2px; }
/* A field inside a box that shows the focus itself (the menu's search, the lesson search, the tutor's message box:
   app.css :focus-within) gets no ring of its own: it drew a square outline inside the rounded box (11-15, the owner). */
html:not(.design-old) .cm-search input:focus-visible, html:not(.design-old) .search-box input:focus-visible,
html:not(.design-old) .composer-box textarea:focus-visible, html:not(.design-old) .composer-box input:focus-visible { outline: none; }
html:not(.design-old) .code-pane :focus-visible, html:not(.design-old) .mode-switch input:focus-visible + .switch { outline-color: var(--dn-ring-dark-line); }

/* ---- Buttons, tags ---- */
html:not(.design-old) .primary, html:not(.design-old) .secondary { border-radius: 8px; }
html:not(.design-old) .primary:disabled { color: var(--dn-off-fg); }
html:not(.design-old) .icon-button { border-radius: 8px; }
html:not(.design-old) .tag { border-radius: 20px; }

/* ---- App bar and its menus ---- */
/* The language badges' letters, a shade darker in their own hue (three were under AA). */
html:not(.design-old):not([data-theme="dark"]) .course-dot.tone-orange, html:not(.design-old):not([data-theme="dark"]) .course-dot.tone-amber { color: #96590c; }
html:not(.design-old):not([data-theme="dark"]) .course-dot.tone-pink { color: #a0447a; }
html:not(.design-old):not([data-theme="dark"]) .course-dot.tone-teal { color: #1f6c75; }
html:not(.design-old) .menu { border-radius: 14px; }
html:not(.design-old) .menu a, html:not(.design-old) .menu button { border-radius: 8px; }

/* ---- The lesson pane ---- */
html:not(.design-old) .pane { border-radius: 14px; box-shadow: var(--dn-lift); }
html:not(.design-old) .pane-head { padding-top: 18px; }
/* "Start with": the open choice is a white tile, so the accent on this screen is the step and Check. */

/* ---- The step card: the one thing to read. The app's own tint and edge, lifted off the pane. ---- */
html:not(.design-old) .pane-step { border-bottom: 0; padding-bottom: 8px; }
html:not(.design-old) .step-dock { margin-top: 14px; }
html:not(.design-old) .step-dock .task-card { border-radius: 12px; }
html:not(.design-old) .step-dock .task-card:not(.solo) { box-shadow: inset 4px 0 0 var(--dn-bar-bg), var(--dn-card-lift); }
html:not(.design-old) .step-dock .task-card.done:not(.solo) { box-shadow: inset 4px 0 0 #6aa47c, var(--dn-card-lift); }
html:not(.design-old) .step-dock .task-card.stuck .task-card-tools button { border-radius: 8px; }
html:not(.design-old) .step-dock .task-meta, html:not(.design-old) .step-dock .task-link { color: var(--dn-soft-fg); }
html:not(.design-old) .task-num, html:not(.design-old) .tour-num { background: var(--dn-accent-bg); }   /* white on #4a7cf0 was 3.9:1 */
html:not(.design-old):not([data-theme="dark"]) .step-dock .hint-count { color: #7a5d14; }

/* ---- Under the card: quieter. The picture loses its frame, the invitation becomes a link row. ---- */
html:not(.design-old) .step-picture { border: 0; border-radius: 12px; background: var(--dn-quiet-bg); }
html:not(.design-old) .step-picture-toggle:hover { background: var(--dn-quiet-hover-bg); }
html:not(.design-old) .step-picture-toggle > .icon { color: var(--dn-icon-fg); }
html:not(.design-old) .step-picture-adds { padding: 0 7px; border: 1px solid var(--dn-chip-line); background: var(--dn-card-bg); color: var(--dn-chip-fg); }   /* with its line, the size it had */
html:not(.design-old) .step-picture-more, html:not(.design-old) .step-picture-toggle .chev { color: var(--dn-soft-fg); }
html:not(.design-old) .step-picture .vl-mini .v-board { border: 1px solid var(--dn-quiet-line); background: var(--dn-card-bg); }
html:not(.design-old) .vl-mini .v-mini-caption .v-fnum { background: var(--dn-fnum-bg); color: var(--dn-fnum-fg); }
html:not(.design-old) .visual-invite, html:not(.design-old) .visual-invite.compact { padding: 6px 2px; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--dn-accent-fg); }
html:not(.design-old) .visual-invite:hover { border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
html:not(.design-old) .visual-invite > .icon { margin-left: 0; color: var(--dn-accent-fg); }
html:not(.design-old) .visual-invite-art { background: none; padding: 0; }
html:not(.design-old) .visual-invite-art i, html:not(.design-old) .visual-invite-art i:nth-child(n + 3) { border-color: var(--dn-accent-fg); background: none; }

/* ---- The lesson text ---- */
html:not(.design-old) .statement pre, html:not(.design-old) .source-code { border-radius: 10px; }
html:not(.design-old) .statement [data-toggle="collapse"] { border-radius: 10px; }
html:not(.design-old) .video-chip { border-radius: 8px; }
html:not(.design-old) .video-frame { border-radius: 12px; }

/* ---- AI Tutor ---- */
html:not(.design-old) .message-avatar { border-radius: 8px; }
html:not(.design-old) .chat-message.user .message-content { border-radius: 0 10px 10px 10px; }
html:not(.design-old) .composer-box { border-radius: 12px; }
html:not(.design-old) .send-button { border-radius: 8px; }

/* ---- Interactive tab: small labels up to AA ---- */
html:not(.design-old) .uipage-url { color: var(--dn-soft-fg); }   /* the address in "Your page" was 4.4:1 */
html:not(.design-old) .vl .cell .ci, html:not(.design-old) .vl .v-count { color: var(--dn-tiny-fg); }

/* ---- The code pane ---- */
html:not(.design-old) .code-pane { border-radius: 14px; }
html:not(.design-old) .ace-algocademy .ace_gutter { color: var(--dn-gutter-fg); }                       /* line numbers were 3.4:1 (2.9:1 on the cursor's line) */
html:not(.design-old) .step-track li.current { background: var(--dn-step-bg); border-color: var(--dn-step-bg); }   /* white on #4a7cf0 was 3.9:1 */
html:not(.design-old) .step-track li.current > button:hover { background: var(--dn-step-hover-bg); }
/* Check: on a ledge, so it is the one button of the pane (its size is the app's). */
html:not(.design-old) .code-foot .primary { background: var(--dn-check-bg); border-color: var(--dn-check-bg); box-shadow: 0 3px 0 var(--dn-check-edge-bg); }
html:not(.design-old) .code-foot .primary:hover { background: var(--dn-check-hover-bg); border-color: var(--dn-check-hover-bg); }   /* hover went lighter, to 3.7:1 */
html:not(.design-old) .code-foot .primary:disabled { background: #2a3248; border-color: #2a3248; box-shadow: none; }
html:not(.design-old) .ide.flow-wait .code-foot .primary:not(:disabled) { background: transparent; border-color: #3a4662; box-shadow: none; }

/* ---- Dialogs ---- */
html:not(.design-old) .modal { border-radius: 18px; }
html:not(.design-old) .checkpoint button, html:not(.design-old) .checkpoint-link { border-radius: 8px; }
html:not(.design-old) .share-nudge, html:not(.design-old) .trial-nudge { border-radius: 12px; }
html:not(.design-old) .paywall-tick { flex: 0 0 22px; }   /* the ticks sat at different places: the circle shrank beside long lines */

/* ---- The Lessons menu (course map) ---- */
html:not(.design-old) .drawer-close { border-radius: 8px; }
html:not(.design-old) .cm3 .cm-parts.cm-tracks, html:not(.design-old) .cm-lessons, html:not(.design-old) .cm-results { border-radius: 18px; box-shadow: var(--dn-lift); }
html:not(.design-old) .cm-lessons-head { border-radius: 18px 18px 0 0; }
/* Group names and kickers: dark enough (were 3.1:1 and 3.8:1). */
html:not(.design-old) .cm3 .cm-tile-group, html:not(.design-old) .cm3 .cm-track-label { color: var(--muted); }
html:not(.design-old) .cm-lessons-kicker, html:not(.design-old) .cm-results-group { color: var(--dn-soft-fg); }

/* The chapter's "Interview on ..." link lay on the card's left edge: in line with the lessons above it. */
html:not(.design-old) .cm-lessons .cm-mock-chapter { margin: 8px 18px 16px; }

/* More small text brought up to AA in its own hue (found on the full check of the app's pages, 11-15). */
html:not(.design-old) .step-dock .task-card-text a { color: var(--dn-accent-fg); }   /* the dark pane's light blue, on the light card: 1.8:1 */
html:not(.design-old) .vl .v-bin-name .v-key { color: var(--dn-soft-fg); }
html:not(.design-old):not([data-theme="dark"]) .course-dot.tone-green { color: #4f6f33; }
html:not(.design-old):not([data-theme="dark"]) .link-paths-title { color: var(--muted); }

/* ---- Roomier, on a computer only: where the panes stack (a tablet, a phone) every box keeps the app's own padding,
   so text there fits exactly as it did. ---- */
@media (min-width: 1001px) {
  html:not(.design-old) .menu { padding: 8px; }
  html:not(.design-old) .step-dock .task-card { padding: 12px 16px 12px 18px; }
  html:not(.design-old) .step-picture-toggle { padding: 9px 12px; }
}
