@media screen {
  :root {
    --neon-page: #070810;
    --neon-surface: #10121d;
    --neon-text: #f2f5ff;
    --neon-muted: #b7c3d9;
    --neon-border: #29324a;
    --neon-focus: #d7f8ff;
    --paper: #171b29;
    --ink: var(--neon-text);
    --line: #55658e;
    --soft: var(--neon-muted);
    --recessed: #0d101a;
    background: var(--neon-page);
    color: var(--neon-text);
    color-scheme: dark;
  }

  body,
  body.pos-authenticated {
    min-height: 100vh;
    background:
      radial-gradient(ellipse 65rem 27rem at 18% -9rem, #142d482e, transparent 72%),
      radial-gradient(ellipse 37rem 24rem at 100% 4rem, #41245a24, transparent 78%),
      repeating-linear-gradient(90deg, #9ab6ff07 0 1px, transparent 1px 3.5rem),
      var(--neon-page);
  }

  body.pos-authenticated {
    color: var(--neon-text);
    --pos-muted: var(--neon-muted);
    --pos-line: var(--neon-border);
  }

  body.pos-authenticated .masthead,
  .masthead,
  .service-header {
    background: #0c0f19;
    border-bottom: 1px solid #38425e;
    box-shadow: 0 1px 14px #72abff17;
  }

  body.pos-authenticated .masthead :is(.mode, #logout, #forget-device),
  .pos-role,
  #annual-simulation .year-mode {
    color: #e6eaff;
    background: #181d30;
    border-color: #56628d;
  }

  .pos-hero h1,
  #annual-simulation .year-hero h1 {
    font-family: system-ui, sans-serif;
    font-weight: 740;
    color: var(--neon-text);
    text-shadow: 0 0 1.35rem #92beff38;
  }

  .pos-group h2,
  #annual-simulation .year-stations-group > h2,
  #annual-stations .annual-station-header h1 {
    color: var(--neon-text);
  }

  #annual-simulation .year-period,
  #annual-simulation .year-profit-scope,
  #annual-stations :is(.annual-station-sync, .annual-station-notice),
  .annual-mode-notice {
    color: var(--neon-muted);
  }

  .annual-mode,
  #workspace .pos-nav {
    background: #0d101a;
    border-color: var(--neon-border);
    scrollbar-color: #526081 #0d101a;
  }

  .pos-home-metric {
    color: #d4f5ff;
    border-color: #438292;
    background: linear-gradient(145deg, #132731, #0e151f 68%);
  }

  #annual-stations:fullscreen { background: var(--neon-page); }

  .pos-authenticated #workspace > #modes-tutoriels,
  .pos-authenticated #connexions {
    background: #0e111c;
    border-color: var(--neon-border);
  }

  :where([data-tone="tomate"], [data-menu-art="orders"]) { --neon-line: #ff4c78; }
  :where([data-tone="menthe"], [data-menu-art="service"], [data-art="service"]) { --neon-line: #2dff9c; }
  :where([data-tone="pervenche"], [data-menu-art="preparation"], [data-art="preparation"]) { --neon-line: #888cff; }
  :where([data-tone="miel"], [data-menu-art="requests"]) { --neon-line: #ffe340; }
  :where([data-tone="rose"], [data-menu-art="notices"]) { --neon-line: #ff4fdf; }
  :where([data-tone="lagon"], [data-menu-art="accounting"], [data-art="actualiser"]) { --neon-line: #2ce9ff; }
  :where([data-tone="bleu"], [data-menu-art="connections"]) { --neon-line: #49a8ff; }
  :where([data-tone="lilas"], [data-menu-art="users"], [data-art="acces"]) { --neon-line: #c271ff; }
  :where([data-tone="sable"], [data-menu-art="bank"]) { --neon-line: #ffc857; }
  :where([data-tone="peche"], [data-menu-art="tutorials"], [data-menu-art="home"], [data-art="accueil"]) { --neon-line: #ff9251; }
  :where([data-tone="pistache"], [data-menu-art="demo"], [data-menu-art="pilotage"], [data-menu-art="stock"]) { --neon-line: #a3ff43; }

  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n + 1) { --neon-tile-default: #c271ff; }
  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n + 2) { --neon-tile-default: #2ce9ff; }
  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n + 3) { --neon-tile-default: #2dff9c; }
  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n + 4) { --neon-tile-default: #ffe340; }
  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n + 5) { --neon-tile-default: #ff4fdf; }
  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n + 6) { --neon-tile-default: #ff9251; }
  :where(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :nth-child(7n) { --neon-tile-default: #49a8ff; }

  #workspace .pos-grid .pos-tile,
  #workspace .pos-nav a,
  #workspace .pos-nav .admin-menu-tile,
  #workspace .pos-nav .pos-nav-home,
  #workspace .pos-nav a:is(:hover, [aria-current="page"]),
  #workspace .annual-mode .admin-menu-tile,
  #workspace .annual-station-menu .admin-menu-tile,
  #workspace .annual-station-header .admin-menu-tile,
  #annual-simulation .year-tile-compact,
  #annual-simulation .year-tile-compact:is(:hover, :focus-visible),
  #mode-directory .mode-card.legacy-mode-tile,
  #admin-interactive-help .legacy-guide-tile,
  #mode-tutorials .legacy-video-title,
  #workspace .legacy-access-heading,
  .pos-authenticated #admin-site-connections .admin-connections__card,
  .service-menu .service-menu-tile,
  .service-menu-grid .service-menu-tile,
  .phone-categories .admin-menu-tile,
  .phone-panel > .admin-menu-tile,
  .phone-bar > .admin-menu-tile,
  html :is(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :is(a, button):not(:where([data-mail-alert-level]:not([data-mail-alert-level="none"]))) {
    --neon-accent: var(--neon-line, var(--neon-tile-default, #bc6cff));
    color: var(--neon-text);
    border-color: var(--neon-accent);
    background:
      radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--neon-accent) 45%, #111522) 0%, transparent 78%),
      linear-gradient(145deg, color-mix(in srgb, var(--neon-accent) 21%, #111522), #090b15 95%);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--neon-accent) 65%, transparent),
      inset 0 0 17px color-mix(in srgb, var(--neon-accent) 25%, transparent),
      0 0 10px color-mix(in srgb, var(--neon-accent) 58%, transparent),
      0 0 20px color-mix(in srgb, var(--neon-accent) 33%, transparent);
    filter: none;
  }

  #workspace .pos-grid .pos-tile small,
  #annual-simulation .year-tile-compact small,
  #mode-directory .legacy-mode-tile > p,
  html :is(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :is(a, button):not(:where([data-mail-alert-level]:not([data-mail-alert-level="none"]))) small,
  .pos-authenticated #admin-site-connections .admin-connections__card :is(dt, .admin-connections__note) {
    color: #dbe5fa;
  }

  html :is(.tiles, .mailboxes, .idea-grid, #personal-boxes) > :is(a, button):focus-visible {
    outline: 2px solid var(--neon-focus);
    outline-offset: 3px;
  }

  :where(body > header, #center > header, .agenda > header) {
    color: var(--neon-text);
    border-bottom-color: #475b84;
    background-color: #101423;
  }

  :where(body > header, #center > header, .agenda > header) a { color: #d6dfff; }

  html :is(.panel, .card, .surface):not(:where([role="alert"], [data-error], [data-state], [data-status], [data-level])) {
    --line: #4f6189;
    --surface: #161c2e;
    --card: #161c2e;
    color: var(--neon-text);
    background-color: #161c2e;
    border-color: #4f6189;
  }

  #workspace .year-shell,
  #workspace .year-period,
  #workspace .year-hero .year-kicker { color: var(--neon-text); }

  .phone-bar {
    background: linear-gradient(105deg, #25113d, #101423 68%);
    box-shadow: inset 0 -1px #b36cff, 0 0 14px #b36cff66;
  }

  .phone-heading h1 { text-shadow: 0 0 1.1rem #b36cff92; }
  .phone-badge { background: #321f47; border-color: #bd79ff; color: #f4eaff; }

  .phone-panel {
    color: var(--neon-text);
    background: #161b2c;
    border-color: #546491;
  }

  .phone-state > div {
    --phone-state-accent: #2ce9ff;
    background: color-mix(in srgb, var(--phone-state-accent) 17%, #161b2c);
    box-shadow: inset .16rem 0 var(--phone-state-accent), 0 0 .75rem color-mix(in srgb, var(--phone-state-accent) 37%, transparent);
  }

  .phone-state > div:nth-child(3n + 2) { --phone-state-accent: #c271ff; }
  .phone-state > div:nth-child(3n) { --phone-state-accent: #2dff9c; }
  .phone-fields label span, .phone-field-hint { color: #dbe5fa; }
  .phone-toggle input { accent-color: #c271ff; }

  .phone-fields :is(input:not([type="checkbox"]), textarea, select), .phone-test-form > select {
    color: var(--neon-text);
    background: #0d1220;
    border-color: #7888b8;
  }

  .phone-button { background: #45256b; border-color: #bf82ff; color: #fff5ff; }
  .phone-button.secondary { background: #20293b; border-color: #8298c8; color: #f2f5ff; }
  .phone-feedback[data-error="true"], #phone-status[data-error="true"] { color: #ff9dab; }
  .phone-result { background: #1a382f; border-color: #67d9ae; color: #e0ffed; }
  .phone-shell :focus-visible, .phone-bar :focus-visible { outline-color: var(--neon-focus); }

  #workspace .annual-management a.admin-menu-tile { text-decoration: none; }

  .pos-authenticated #admin-site-connections .admin-connections__card-heading h3 { color: var(--neon-text); }
  .pos-authenticated #admin-site-connections .admin-connections__card:nth-child(1) { --neon-line: #58ffc1; }
  .pos-authenticated #admin-site-connections .admin-connections__card:nth-child(2) { --neon-line: #ff73c4; }
  .pos-authenticated #admin-site-connections .admin-connections__card:nth-child(3) { --neon-line: #4aebff; }

  :is(.pos-tile-arrow, .service-menu-arrow) {
    color: var(--neon-accent, #c5aaff);
    background: #111728;
    border-color: currentColor;
  }

  #workspace :is(.pos-tile, .admin-menu-tile, .year-tile-compact):focus-visible,
  #workspace #admin-interactive-help .legacy-guide-tile:focus-visible,
  #mode-directory .legacy-mode-tile:has(> [data-tour-mode]:focus-visible),
  .service-menu-tile:focus-visible {
    outline: 2px solid var(--neon-focus);
    outline-offset: 3px;
  }

  #workspace .pos-nav a[aria-current="page"],
  #workspace .annual-mode .admin-menu-tile[aria-pressed="true"],
  #workspace .annual-station-menu .admin-menu-tile[aria-current="page"],
  #annual-simulation .year-tile-compact:is([aria-current="page"], [aria-pressed="true"]) {
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--neon-accent),
      0 0 14px color-mix(in srgb, var(--neon-accent) 45%, transparent);
  }

  #workspace :is(.annual-mode-buttons, .annual-station-menu) .admin-menu-tile::after {
    background: var(--neon-accent);
    box-shadow: 0 0 .48rem var(--neon-accent);
  }

  .service-menu-grid .service-pickup-tile { --neon-line: #ffda62; }

  body:has(#control-content) { color: var(--neon-text); color-scheme: dark; }
  body:has(#control-content) .workspace {
    --accent: #6c51af;
    --accent-dark: #e4d9fe;
    --surface: var(--neon-surface);
    --border: #485475;
    --muted: var(--neon-muted);
  }

  body:has(#control-content) :is(input, select, textarea) {
    background: #0c1020;
    border-color: #596989;
    color: var(--neon-text);
  }

  body:has(#control-content) :is(.tabs button[aria-selected="true"], .tabs button:hover, .secondary:hover:not(:disabled)) {
    color: #fff;
    background: #27203e;
    border-color: #b285ff;
  }

  body:has(#control-content) .primary:hover:not(:disabled) { color: #191328; }
  body:has(#control-content) [data-error="true"] { color: #ff9dab; }
  body:has(#control-content) :focus-visible { outline-color: var(--neon-focus); }

  @media (hover: hover) {
    #workspace :is(.pos-tile, .admin-menu-tile, .year-tile-compact):hover,
    #workspace .pos-nav .admin-menu-tile:hover,
    #workspace .annual-mode .admin-menu-tile:hover,
    #workspace #admin-interactive-help .legacy-guide-tile:hover,
    #mode-directory .legacy-mode-tile:has(> [data-tour-mode]:hover),
    .service-menu .service-menu-tile:hover,
    .service-menu-grid .service-menu-tile:hover {
      box-shadow: inset 0 0 0 1px var(--neon-accent),
        inset 0 0 17px color-mix(in srgb, var(--neon-accent) 39%, transparent),
        0 0 20px color-mix(in srgb, var(--neon-accent) 72%, transparent);
      filter: none;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    :is(.pos-tile, .admin-menu-tile, .legacy-menu-tile, .service-menu-tile) { transition: none; }
    #workspace .pos-grid .pos-tile:hover,
    .service-menu-tile:hover { translate: none; }
  }

  @media (forced-colors: active) {
    #workspace :is(.pos-tile, .admin-menu-tile, .year-tile-compact):focus-visible,
    .service-menu-tile:focus-visible { outline-color: Highlight; }
  }
}
