/* Lexd Beta shell: design tokens, header, navigation and footer.
   Shared by the portal and the Django admin so both use one header and one palette.
   Palette from resources/branding/2026-09-18: charcoal #141A20, ivory #F5F2EC,
   near-black #101010, teal #168E88 (light) / #45A99F (dark; #67D8CD until 20 October 2026); UI shades adjusted for
   contrast. Theme: html[data-theme] = auto | light | dark (the admin's own key and values).
   Header/footer rules are scoped so host-page styles (for example the admin's) do not leak in. */

:root {
  color-scheme: light;
  --bg: #F5F2EC;
  --surface: #FFFFFF;
  --surface-2: #FAF8F4;
  --inset: #EFEBE3;
  --ink: #101010;
  --muted: #4B5560;
  --line: #D8D2C7;
  --line-strong: #A89F91;
  --teal: #0F6E69;          /* teal darkened from #168E88 for text contrast on ivory/white */
  --teal-soft: #D7EEEC;
  --teal-mark: #168E88;
  --on-accent: #FFFFFF;
  --button-fill: #0F6E69;     /* a filled button: the teal */
  --focus: #0F6E69;
  --done: #1F7A4D; --done-soft: #DDF1E6;
  --wait: #8A5A00; --wait-soft: #FBEBC8;
  --idle: #6B7580; --idle-soft: #E8E4DC;
  --danger: #A8321F; --danger-soft: #F8E0DA;
  --auto-tint: #D7EEEC;
  --human-tint: #EFE4F7;
  --shadow: 0 1px 2px rgba(16, 16, 16, .06), 0 2px 8px rgba(16, 16, 16, .05);
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Consolas, monospace;
}

/* Dark tokens: explicit dark, or System when the device prefers dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141A20;
  --surface: #1B232B;
  --surface-2: #212B35;
  --inset: #10151A;
  --ink: #DAD6CF;              /* toned down from #F5F2EC (owner, 1 October 2026) */
  --muted: #AEB8C2;
  --line: #2F3B47;
  --line-strong: #52616F;
  --teal: #45A99F;
  --teal-soft: #173B3A;
  --teal-mark: #45A99F;
  --on-accent: #101010;
  --button-fill: #45A99F;     /* buttons, links and accents one calmer teal (owner, 20 October 2026: "less bright", "the same
                                 teal for accents and links"): 6.7:1 with button text, 6.2:1 on the page, 5.6:1 on cards; focus rings too */
  --focus: #45A99F;
  --done: #5BCB91; --done-soft: #16352A;
  --wait: #F0BE5A; --wait-soft: #3A2E14;
  --idle: #8E99A4; --idle-soft: #26303A;
  --danger: #F08A78; --danger-soft: #3D1F1A;
  --auto-tint: #173B3A;
  --human-tint: #2F2540;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #141A20;
    --surface: #1B232B;
    --surface-2: #212B35;
    --inset: #10151A;
    --ink: #DAD6CF;              /* toned down from #F5F2EC (owner, 1 October 2026) */
    --muted: #AEB8C2;
    --line: #2F3B47;
    --line-strong: #52616F;
    --teal: #45A99F;
    --teal-soft: #173B3A;
    --teal-mark: #45A99F;
    --on-accent: #101010;
    --button-fill: #45A99F;
    --focus: #45A99F;
    --done: #5BCB91; --done-soft: #16352A;
    --wait: #F0BE5A; --wait-soft: #3A2E14;
    --idle: #8E99A4; --idle-soft: #26303A;
    --danger: #F08A78; --danger-soft: #3D1F1A;
    --auto-tint: #173B3A;
    --human-tint: #2F2540;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
}

.visually-hidden {
  position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; inset-inline-start: .75rem; inset-block-start: -3rem; z-index: 50;
  background: var(--surface); color: var(--ink); padding: .5rem .75rem; border-radius: 6px;
  border: 2px solid var(--focus);
}
.skip-link:focus { inset-block-start: .5rem; }

/* Scroll bars a little wider than the browser's thin overlay ones, so they are easier to grab (owner, 4 October 2026);
   the thumb in the theme's colours. Chromium and Edge; Firefox keeps its own (``auto``, not thin). */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background-color: var(--line-strong); border: 2px solid transparent; border-radius: 8px;
  background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

/* ---------- Header: two tiers ---------- */
.shell-header, .shell-footer {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--ink);
}
.shell-header { background: var(--surface); border-block-end: 1px solid var(--line); box-shadow: var(--shadow); }

/* Top strip: always charcoal, in every theme (the brand board's dark treatment). */
.shell-strip { background: #141A20; color: #D8D2C7; color-scheme: dark; }
.shell-strip__inner {
  max-inline-size: 76rem; margin-inline: auto; box-sizing: border-box;
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  padding-block: .3rem; padding-inline: 1rem;
}
.shell-tools { margin-inline-start: auto; }

/* Demo mode (owner, 16 October 2026): the switch at the upper left; the strip construction orange while it is on,
   its text dark for contrast (#1A1A1A on #FF7A00: 8.6:1). */
.demo-switch { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.demo-switch__label { font: 600 .78rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .02em; }
.shell-strip .switch { position: relative; margin: 0; flex: none; display: inline-block; inline-size: 1.9rem; block-size: 1.05rem; cursor: pointer; }
.shell-strip .switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.shell-strip .switch__track { position: absolute; inset: 0; border-radius: 1rem; background: #3A4754; transition: background .15s; pointer-events: none; }
.shell-strip .switch__track::before { content: ""; position: absolute; inset-block-start: .15rem; inset-inline-start: .15rem; inline-size: .75rem; block-size: .75rem; border-radius: 50%; background: #F5F2EC; transition: transform .15s; }
.shell-strip .switch input:checked + .switch__track { background: #1A1A1A; }
.shell-strip .switch input:checked + .switch__track::before { transform: translateX(.85rem); }
.shell-strip .switch input:focus-visible + .switch__track { outline: 2px solid #45A99F; outline-offset: 2px; }
/* Notices to everyone (owner, 11 November 2026): under the top strip, above the main bar, dark red with cream text,
   the same in both themes and in the plugin's window (#F5EDE0 on #7A1F1F: 9.6:1). No X: it stays open. */
.site-notices { background: #7A1F1F; color: #F5EDE0; }
.site-notices__item {
  max-inline-size: 76rem; margin: 0 auto; box-sizing: border-box;
  padding-block: .55rem; padding-inline: 1rem;
  font: 500 .92rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.site-notices__item + .site-notices__item { border-block-start: 1px solid rgba(245, 237, 224, .25); }
.site-notices a { color: #F5EDE0; text-decoration: underline; text-underline-offset: .15em; font-weight: 600; }
.site-notices a:focus-visible { outline: 2px solid #F5EDE0; outline-offset: 2px; }
.shell-strip--demo { background: #FF7A00; color: #1A1A1A; }
.shell-strip--demo .identity { color: #1A1A1A; }
.shell-strip--demo .switch input:focus-visible + .switch__track { outline-color: #1A1A1A; }
.shell-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; }
.shell-strip .identity { font-size: .78rem; color: #D8D2C7; max-inline-size: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-strip a.identity { text-decoration: none; }
.shell-strip a.identity:hover, .shell-strip a.identity:focus-visible { text-decoration: underline; }
.shell-strip .pref-form, .shell-strip .inline-form { display: inline-flex; align-items: center; margin: 0; padding: 0; }
.shell-strip select, .shell-strip .shell-button {
  box-sizing: border-box; block-size: 1.6rem; margin: 0;
  font: 500 .75rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #F5F2EC; background: #1F2831; border: 1px solid #3A4754; border-radius: 5px;
}
.shell-strip select { padding-block: 0; padding-inline: .4rem 1.3rem; max-inline-size: 7.5rem; }
.shell-strip select option { color: #F5F2EC; background: #1F2831; }
.shell-strip .shell-button { padding: 0 .6rem; cursor: pointer; white-space: nowrap; }
.shell-strip .shell-button:hover, .shell-strip select:hover { background: #2A3642; }
.shell-strip select:focus-visible, .shell-strip .shell-button:focus-visible { outline: 3px solid #45A99F; outline-offset: 1px; }

/* Main bar: large wordmark and the menu; follows the light/dark theme. */
.shell-bar {
  max-inline-size: 76rem; margin-inline: auto; box-sizing: border-box;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
  padding-block: 1rem; padding-inline: 1rem;
}
.shell-header .brand, .brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); flex: none; }
.brand__mark { block-size: 64px; inline-size: auto; display: block; }
.brand__mark--on-dark { display: none; }
:root[data-theme="dark"] .brand__mark--on-light { display: none; }
:root[data-theme="dark"] .brand__mark--on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .brand__mark--on-light { display: none; }
  :root[data-theme="auto"] .brand__mark--on-dark { display: block; }
}
.brand__beta {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal); border: 1.5px solid var(--teal); border-radius: 99px;
  padding: .05rem .5rem; line-height: 1.4;
}
.shell-nav { flex: 1 1 auto; min-inline-size: 0; }
.shell-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem; }
.shell-nav li { margin: 0; padding: 0; list-style: none; }
.shell-header .shell-nav a, .shell-header .shell-nav a:link, .shell-header .shell-nav a:visited {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  padding: .45rem .8rem; border-radius: 7px; text-decoration: none; color: var(--ink);
  font-size: 1.05rem; font-weight: 600;
}
.shell-header .shell-nav a:hover { background: var(--inset); color: var(--ink); }
.shell-header .shell-nav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal); }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-inline-size: 1.3rem;
  padding: 0 .35rem; border-radius: 99px; font-size: .72rem; font-weight: 700; line-height: 1.5;
  background: var(--danger); color: var(--surface);
}
@media (max-width: 700px) {
  .brand__mark { block-size: 48px; }
  .shell-nav { flex-basis: 100%; }
  .shell-strip .identity { flex-basis: 100%; text-align: end; }
}

/* ---------- Footer ---------- */
.shell-footer {
  border-block-start: 1px solid var(--line); color: var(--muted); font-size: .8rem;
  padding-block: .75rem; padding-inline: 1rem; text-align: center; background: var(--bg);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: center;
}
.server-controls { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.server-controls form { display: inline-flex; margin: 0; }
.server-controls__label { font-weight: 600; }
.shell-footer .shell-button { box-sizing: border-box; block-size: 1.6rem; margin: 0; padding: 0 .6rem; cursor: pointer;
  font: 500 .75rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px; }
.shell-footer .shell-button:hover { background: var(--inset); }
