/* Shared theme contract. Light keeps the existing component fallbacks exactly.
   Use --tlc-panel for surfaces, --tlc-ink for text, --tlc-on-accent on gradients.
   Do not introduce per-page theme state or invert photographs/remote desktops. */
:root { --tlc-on-accent: #ffffff; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {

  color-scheme: dark;
  --tlc-ink: #eef2ff;
  --tlc-ink-secondary: #d3dcf2;
  --tlc-muted: #b1bdd7;
  --tlc-muted-soft: #9aaac8;
  --tlc-line: #303e60;
  --tlc-line-strong: #53658e;
  --tlc-canvas: #0b1026;
  --tlc-canvas-raised: #17223d;
  --tlc-panel: #111b33;
  --tlc-action-soft: #252449;
  --tlc-brand-soft: #242341;
  --tlc-success-ink: #7ce2b5;
  --tlc-success-soft: #123b32;
  --tlc-warning-soft: #3b301c;
  --tlc-danger-ink: #ffacb5;
  --tlc-danger-soft: #432535;
  --tlc-shadow-panel: 0 18px 50px rgba(0, 0, 0, .25);
  --tlc-canvas-gradient: radial-gradient(circle at 84% 4%, rgba(109, 93, 246, .16), transparent 30rem), radial-gradient(circle at 12% 28%, rgba(56, 189, 248, .07), transparent 28rem), linear-gradient(180deg, #0b1026, #10182e);
  --tlc-theme-ink: #eef2ff;
  --tlc-theme-muted: #b1bdd7;
  --tlc-theme-link: #b6adff;
  --tlc-theme-line: #394968;
  --tlc-theme-surface: #111b33;
  --tlc-theme-surface-rgb: 17, 27, 51;
  --tlc-theme-raised: #1a2743;
  --tlc-theme-surface-success: #123b32;
  --tlc-theme-surface-warning: #3b301c;
  --tlc-theme-surface-danger: #432535;
  --tlc-theme-text-success: #7ce2b5;
  --tlc-theme-text-warning: #f4d08a;
  --tlc-theme-text-danger: #ffacb5;
  --panel: var(--tlc-panel);
  --bg: var(--tlc-canvas);
  --soft: var(--tlc-canvas-raised);
  --line: var(--tlc-line);
  --ink: var(--tlc-ink);
  --muted: var(--tlc-muted);
  --paper: #0b1026;
  --glass: rgba(17, 27, 51, .92);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {

  color-scheme: dark;
  --tlc-ink: #eef2ff;
  --tlc-ink-secondary: #d3dcf2;
  --tlc-muted: #b1bdd7;
  --tlc-muted-soft: #9aaac8;
  --tlc-line: #303e60;
  --tlc-line-strong: #53658e;
  --tlc-canvas: #0b1026;
  --tlc-canvas-raised: #17223d;
  --tlc-panel: #111b33;
  --tlc-action-soft: #252449;
  --tlc-brand-soft: #242341;
  --tlc-success-ink: #7ce2b5;
  --tlc-success-soft: #123b32;
  --tlc-warning-soft: #3b301c;
  --tlc-danger-ink: #ffacb5;
  --tlc-danger-soft: #432535;
  --tlc-shadow-panel: 0 18px 50px rgba(0, 0, 0, .25);
  --tlc-canvas-gradient: radial-gradient(circle at 84% 4%, rgba(109, 93, 246, .16), transparent 30rem), radial-gradient(circle at 12% 28%, rgba(56, 189, 248, .07), transparent 28rem), linear-gradient(180deg, #0b1026, #10182e);
  --tlc-theme-ink: #eef2ff;
  --tlc-theme-muted: #b1bdd7;
  --tlc-theme-link: #b6adff;
  --tlc-theme-line: #394968;
  --tlc-theme-surface: #111b33;
  --tlc-theme-surface-rgb: 17, 27, 51;
  --tlc-theme-raised: #1a2743;
  --tlc-theme-surface-success: #123b32;
  --tlc-theme-surface-warning: #3b301c;
  --tlc-theme-surface-danger: #432535;
  --tlc-theme-text-success: #7ce2b5;
  --tlc-theme-text-warning: #f4d08a;
  --tlc-theme-text-danger: #ffacb5;
  --panel: var(--tlc-panel);
  --bg: var(--tlc-canvas);
  --soft: var(--tlc-canvas-raised);
  --line: var(--tlc-line);
  --ink: var(--tlc-ink);
  --muted: var(--tlc-muted);
  --paper: #0b1026;
  --glass: rgba(17, 27, 51, .92);
  }
}

/* These selectors affect only the new preference control, not existing geometry. */
.tlc-theme-picker { display: flex; align-items: center; gap: .6rem; min-width: 0; margin: 0; color: var(--tlc-theme-muted, #566077); font: 700 .78rem/1.4 Inter, system-ui, sans-serif; }
.tlc-theme-picker select { box-sizing: border-box; max-width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--tlc-theme-line, #dedcf4); border-radius: 12px; padding: .6rem .7rem; background: var(--tlc-theme-surface, #fff); color: var(--tlc-theme-ink, #10162b); font: inherit; cursor: pointer; }
.tlc-theme-picker select:focus-visible { outline: 3px solid #8f85ff; outline-offset: 3px; }
.tlc-portal-navigation-panel > .tlc-theme-picker { grid-column: 1 / -1; justify-self: end; }
.tlc-auth-sidebar-footer > .tlc-theme-picker { flex-wrap: wrap; padding: .2rem; }
.tlc-auth-shell[data-collapsed="true"] .tlc-theme-picker { justify-content: center; }
.tlc-auth-shell[data-collapsed="true"] .tlc-theme-picker > span { display: none; }
.tlc-auth-shell[data-collapsed="true"] .tlc-theme-picker select { width: 100%; padding-inline: 2px; font-size: .62rem; }
#tlc-static-navigation .tlc-theme-picker { justify-content: space-between; padding: .5rem; }
@media (min-width: 1321px) {
  .tlc-portal-navigation-panel { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .tlc-portal-navigation-panel > .tlc-portal-nav { flex: 1 1 auto; }
  .tlc-portal-navigation-panel > .tlc-theme-picker > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 1320px) {
  .tlc-portal-navigation-panel > .tlc-theme-picker { width: 100%; justify-content: space-between; border-top: 1px solid var(--tlc-theme-line, #dedcf4); padding-top: .75rem; }
  .nav-links > .tlc-theme-picker { padding: .5rem; justify-content: space-between; }
}
@media (max-width: 768px) {
  .tlc-auth-shell[data-collapsed="true"] .tlc-theme-picker { justify-content: space-between; }
  .tlc-auth-shell[data-collapsed="true"] .tlc-theme-picker > span { display: inline; }
  .tlc-auth-shell[data-collapsed="true"] .tlc-theme-picker select { width: auto; padding: .6rem .7rem; font-size: .78rem; }
}
/* Native controls inherit the chosen document scheme. */
html[data-theme="dark"] :is(input, select, textarea) { color-scheme: dark; }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #9aaac8; opacity: 1; }
html[data-theme="dark"] :focus-visible { outline-color: #a59aff; }
html[data-theme="dark"] .recharts-cartesian-axis-tick-value { fill: #b1bdd7; }
html[data-theme="dark"] .recharts-default-tooltip { background: #17223d !important; border-color: #53658e !important; color: #eef2ff !important; }
html[data-theme="dark"] .recharts-tooltip-label { color: #eef2ff; }
/* Printed documents remain readable on white paper regardless of screen preference. */
@media print { .tlc-theme-picker { display: none !important; } }
/* Stronger small brand text and calendar arrows on navy, without changing action gradients. */
html[data-theme="dark"] :is(.tlc-portal-brand-copy small, .tlc-auth-brand small, #tlc-static-navigation .tlc-static-brand small, .nav .brand small) { background: none; color: #b6adff; }
html[data-theme="dark"] .nav .hero-copy > .eyebrow { color: #b6adff; }
html[data-theme="dark"] :is(.lb2-month-switch button, .lb2-calendar-month button) { color: #fff; }
@media (min-width: 769px) and (max-width: 1100px) {
  .tlc-auth-sidebar-footer .tlc-theme-picker > span { display: none; }
  .tlc-auth-sidebar-footer .tlc-theme-picker { justify-content: center; }
  .tlc-auth-sidebar-footer .tlc-theme-picker select { width: 44px; padding: .5rem 0; }
}
