/* ============================================================
   SUPERMAN — Christopher Reeve cinematic theme
   ============================================================ */
:root {
  /* Cosmic dark — deep space navy */
  --void:        #03060F;
  --space:       #070C1C;
  --night:       #0B1330;
  --midnight:    #111D44;
  --steel:       #1A2A5E;
  --cobalt:      #2A4490;
  --crystal:     #5B7BC4;

  /* Iconic red */
  --crimson:     #C41E3A;
  --crimson-hi:  #E62848;
  --crimson-lo:  #8A1426;
  --crimson-glow: rgba(230,40,72,0.35);

  /* Gold — film title gold */
  --gold:        #F5C518;
  --gold-hi:     #FFE066;
  --gold-lo:     #B8860B;
  --gold-glow:   rgba(245,197,24,0.35);

  /* Off-white aged-film */
  --ivory:       #F4EFE0;
  --paper:       #E8E0C8;
  --ash:         #B0AC9A;
  --smoke:       #6B6A60;
  --shadow:      #2A2820;

  --border:      rgba(91,123,196,0.18);
  --border-hi:   rgba(91,123,196,0.32);
  --hairline:    rgba(245,239,224,0.08);

  /* Type */
  --f-display:   "Anton", "Bebas Neue", sans-serif;
  --f-title:     "Cinzel", "Times New Roman", serif;
  --f-body:      "Inter", -apple-system, sans-serif;
  --f-mono:      "JetBrains Mono", monospace;

  /* Layout */
  --rail:        200px;
  --topbar:      72px;
  --content-max: 1400px;

  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.5);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.04) inset, 0 16px 48px rgba(0,0,0,0.6);
  --shadow-cinematic: 0 30px 80px -20px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.05) inset;
}

/* Theme variants applied via [data-theme] on body */
body[data-theme="krypton"] {
  --night: #0B2030; --midnight: #0F2E45; --steel: #1A4060;
  --cobalt: #2E6A8C; --crystal: #7CC2E5;
  --crimson: #C41E3A; --gold: #C7F5FF;
}
body[data-theme="phantom"] {
  --night: #0A0A0F; --midnight: #14141E; --steel: #20202E;
  --cobalt: #3A3A4F; --crystal: #888899;
  --crimson: #A8182F; --gold: #888888;
}
body[data-theme="daily-planet"] {
  --void: #07090C; --space: #0E1218; --night: #161B25;
  --midnight: #1F2530; --steel: #2A3140; --cobalt: #3F4960;
  --crystal: #8B9BB4;
  --crimson: #B71C2C; --gold: #D4A02E;
  --ivory: #EDE8DC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--void);
  color: var(--ivory);
  font-family: var(--f-body);
  font-size: calc(14px * var(--font-scale, 1));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

/* Density modifiers */
body[data-density="compact"] {
  --density-pad: 0.7;
  --density-gap: 0.7;
}
body[data-density="comfortable"] {
  --density-pad: 1;
  --density-gap: 1;
}
body[data-density="spacious"] {
  --density-pad: 1.35;
  --density-gap: 1.35;
}

body[data-density="compact"] .panel-body { padding: 14px 16px; }
body[data-density="compact"] .panel-head { padding: 10px 16px; }
body[data-density="compact"] .task-row,
body[data-density="compact"] .schedule-row { padding: 7px 0; }
body[data-density="compact"] .task-card { padding: 8px 14px; }
body[data-density="compact"] .board-card { padding: 8px; }
body[data-density="compact"] .board-card-meta { gap: 4px; }
body[data-density="compact"] .today-row { padding: 8px 14px; }
body[data-density="compact"] .ws-table td { padding: 6px 12px; }
body[data-density="compact"] .ws-table th { padding: 7px 12px; }
body[data-density="compact"] .main { padding: 14px 22px 56px; }
body[data-density="compact"] .ws-toolbar { padding: 8px 14px; gap: 10px; }

body[data-density="spacious"] .panel-body { padding: 30px; }
body[data-density="spacious"] .panel-head { padding: 22px 28px; }
body[data-density="spacious"] .task-row,
body[data-density="spacious"] .schedule-row { padding: 18px 0; }
body[data-density="spacious"] .task-card { padding: 22px 24px; margin-bottom: 14px; }
body[data-density="spacious"] .board-card { padding: 16px; }
body[data-density="spacious"] .today-row { padding: 18px 22px; }
body[data-density="spacious"] .ws-table td { padding: 14px 18px; }
body[data-density="spacious"] .ws-table th { padding: 14px 18px; }
body[data-density="spacious"] .main { padding: 28px 42px 80px; }
body[data-density="spacious"] .ws-toolbar { padding: 16px 20px; gap: 18px; }

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation: none !important;
  transition: none !important;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1200px 800px at 80% -10%, rgba(42,68,144,0.28), transparent 60%),
    radial-gradient(ellipse 800px 600px at -10% 100%, rgba(196,30,58,0.10), transparent 50%),
    linear-gradient(180deg, var(--void) 0%, var(--space) 50%, var(--void) 100%);
  background-attachment: fixed;
}

/* ============================================================
   Starfield — three layers: deep + mid + close (with shooting)
   Uses fixed-position divs at z-index 1, mix-blend-mode: screen
   so stars brighten whatever they overlap.
   ============================================================ */

.starfield {
  position: fixed; inset: 0;
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: screen;
}

.starfield-deep,
.starfield-mid,
.starfield-close {
  position: absolute; inset: 0;
}

/* Tiny dim distant stars — many */
.starfield-deep::before {
  content: "";
  position: absolute;
  width: 1px; height: 1px;
  background: white;
  border-radius: 50%;
  top: 0; left: 0;
  box-shadow:
    37vw 12vh #fff, 8vw 24vh #fff, 71vw 6vh #fff, 23vw 47vh #fff,
    62vw 31vh #fff, 14vw 78vh #fff, 89vw 18vh #fff, 5vw 56vh #fff,
    44vw 88vh #fff, 96vw 43vh #fff, 28vw 14vh #fff, 53vw 71vh #fff,
    19vw 5vh #fff, 81vw 62vh #fff, 67vw 84vh #fff, 11vw 38vh #fff,
    34vw 95vh #fff, 76vw 27vh #fff, 47vw 53vh #fff, 92vw 75vh #fff,
    2vw 11vh #fff, 58vw 41vh #fff, 86vw 89vh #fff, 31vw 23vh #fff,
    64vw 96vh #fff, 49vw 8vh #fff, 17vw 67vh #fff, 73vw 49vh #fff,
    40vw 36vh #fff, 25vw 81vh #fff, 6vw 92vh #fff, 84vw 7vh #fff,
    56vw 64vh #fff, 12vw 33vh #fff, 78vw 17vh #fff, 95vw 58vh #fff,
    42vw 73vh #fff, 21vw 19vh #fff, 69vw 39vh #fff, 88vw 81vh #fff;
  opacity: 0.6;
  animation: twinkle-fast 6.5s ease-in-out infinite;
}

/* Mid-distance stars — medium size with light blue/yellow tint */
.starfield-mid::before {
  content: "";
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  top: 0; left: 0;
  box-shadow:
    13vw 27vh 0 0 #fff,
    61vw 18vh 0 0.5px #fff,
    36vw 9vh 0 0 #B8D4FF,
    79vw 73vh 0 0.5px #fff,
    9vw 64vh 0 0 #fff,
    52vw 41vh 0 0.5px #fff,
    24vw 88vh 0 0 #FFE680,
    87vw 32vh 0 0 #fff,
    46vw 79vh 0 0.5px #fff,
    71vw 51vh 0 0 #B8D4FF,
    3vw 39vh 0 0 #fff,
    33vw 56vh 0 0 #fff,
    93vw 14vh 0 0.5px #fff,
    18vw 91vh 0 0 #fff,
    66vw 8vh 0 0 #FFE680,
    41vw 22vh 0 0 #fff,
    57vw 95vh 0 0 #fff,
    82vw 47vh 0 0 #B8D4FF,
    27vw 71vh 0 0 #fff,
    74vw 28vh 0 0 #fff,
    11vw 4vh 0 0 #fff,
    49vw 64vh 0 0 #FFE680,
    63vw 78vh 0 0 #fff,
    91vw 89vh 0 0.5px #fff,
    7vw 82vh 0 0 #fff,
    38vw 47vh 0 0 #B8D4FF,
    84vw 64vh 0 0 #fff,
    59vw 13vh 0 0 #fff;
  opacity: 0.85;
  animation: twinkle-mid 5.5s ease-in-out infinite;
}

/* Close bright stars with glow — fewer but prominent */
.starfield-close::before {
  content: "";
  position: absolute;
  width: 3px; height: 3px;
  background: #fff;
  border-radius: 50%;
  top: 0; left: 0;
  box-shadow:
    21vw 14vh 0 0.5px #fff, 21vw 14vh 8px 0 rgba(255,255,255,0.4),
    68vw 22vh 0 1px #fff, 68vw 22vh 10px 0 rgba(255,229,128,0.45),
    44vw 51vh 0 0.5px #fff, 44vw 51vh 8px 0 rgba(184,212,255,0.4),
    15vw 76vh 0 0.5px #fff, 15vw 76vh 8px 0 rgba(255,255,255,0.4),
    81vw 42vh 0 1px #fff, 81vw 42vh 10px 0 rgba(255,229,128,0.45),
    54vw 86vh 0 0.5px #fff, 54vw 86vh 8px 0 rgba(255,255,255,0.4),
    32vw 32vh 0 0.5px #fff, 32vw 32vh 8px 0 rgba(184,212,255,0.4),
    73vw 67vh 0 1px #fff, 73vw 67vh 10px 0 rgba(255,255,255,0.5),
    6vw 18vh 0 0.5px #fff, 6vw 18vh 8px 0 rgba(255,229,128,0.4),
    89vw 79vh 0 0.5px #fff, 89vw 79vh 8px 0 rgba(255,255,255,0.4),
    61vw 4vh 0 1px #fff, 61vw 4vh 12px 0 rgba(255,255,255,0.5),
    27vw 94vh 0 0.5px #fff, 27vw 94vh 8px 0 rgba(184,212,255,0.4),
    96vw 12vh 0 0.5px #fff, 96vw 12vh 8px 0 rgba(255,255,255,0.4);
  opacity: 1;
  animation: twinkle-close 4.5s ease-in-out infinite;
}

/* Sparkling decorative stars — pseudo-bright glints */
.starfield-deep::after,
.starfield-mid::after,
.starfield-close::after {
  content: "";
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  top: 0; left: 0;
}
.starfield-deep::after {
  box-shadow:
    16vw 38vh 0 0 #FFE680, 51vw 6vh 0 0 #fff, 76vw 92vh 0 0 #B8D4FF,
    4vw 71vh 0 0 #fff, 39vw 64vh 0 0 #FFE680, 88vw 56vh 0 0 #fff,
    61vw 26vh 0 0 #B8D4FF, 22vw 13vh 0 0 #fff;
  opacity: 0.7;
  animation: twinkle-fast 7s ease-in-out 1.2s infinite;
}
.starfield-mid::after {
  box-shadow:
    29vw 81vh 0 0.5px #fff, 65vw 35vh 0 0.5px #FFE680, 47vw 7vh 0 0.5px #B8D4FF,
    8vw 49vh 0 0.5px #fff, 86vw 68vh 0 0.5px #fff, 17vw 23vh 0 0.5px #FFE680;
  opacity: 0.8;
  animation: twinkle-mid 6s ease-in-out 1.8s infinite;
}
.starfield-close::after {
  width: 3px; height: 3px;
  box-shadow:
    36vw 16vh 0 1px #fff, 36vw 16vh 14px 1px rgba(255,255,255,0.55),
    77vw 58vh 0 1px #FFE680, 77vw 58vh 14px 1px rgba(255,229,128,0.55),
    13vw 41vh 0 1px #B8D4FF, 13vw 41vh 14px 1px rgba(184,212,255,0.55);
  opacity: 1;
  animation: twinkle-close 5s ease-in-out 2.2s infinite;
}

/* Shooting star across the sky */
.shooting-star {
  position: fixed;
  top: 10vh; left: -100px;
  width: 3px; height: 3px;
  background: white;
  border-radius: 50%;
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: screen;
  box-shadow:
    0 0 6px 1px #fff,
    0 0 14px 2px rgba(255,255,255,0.6);
  animation: shoot 11s linear infinite;
}
.shooting-star::before {
  content: "";
  position: absolute;
  top: 50%; right: 0;
  width: 110px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95));
  transform: translateY(-50%);
}

@keyframes star-pulse {
  0%   { opacity: 0.55; }
  100% { opacity: 1; }
}
@keyframes twinkle-fast {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.85; }
}
@keyframes twinkle-mid {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 0.9; }
}
@keyframes twinkle-close {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}
@keyframes shoot {
  0%, 75%, 100% { transform: translate(0, 0) rotate(20deg); opacity: 0; }
  77% { opacity: 0; }
  79% { opacity: 1; }
  92% { transform: translate(calc(100vw + 200px), 60vh) rotate(20deg); opacity: 0.9; }
  94% { opacity: 0; }
}

body.no-starfield .starfield,
body.no-starfield .shooting-star { display: none !important; }

/* === Twinkle intensity levels (settings: starTwinkle) === */
/* off: freeze stars at mid brightness */
body.twinkle-off .starfield-deep::before,
body.twinkle-off .starfield-mid::before,
body.twinkle-off .starfield-close::before,
body.twinkle-off .starfield-deep::after,
body.twinkle-off .starfield-mid::after,
body.twinkle-off .starfield-close::after {
  animation: none !important;
}

/* normal: medium amplitude, medium pace */
@keyframes twinkle-fast-normal {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.95; }
}
@keyframes twinkle-mid-normal {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}
@keyframes twinkle-close-normal {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
body.twinkle-normal .starfield-deep::before  { animation: twinkle-fast-normal  3.8s ease-in-out infinite; }
body.twinkle-normal .starfield-mid::before   { animation: twinkle-mid-normal   3.2s ease-in-out infinite; }
body.twinkle-normal .starfield-close::before { animation: twinkle-close-normal 2.6s ease-in-out infinite; }
body.twinkle-normal .starfield-deep::after   { animation: twinkle-fast-normal  4.2s ease-in-out 0.8s infinite; }
body.twinkle-normal .starfield-mid::after    { animation: twinkle-mid-normal   3.6s ease-in-out 1.2s infinite; }
body.twinkle-normal .starfield-close::after  { animation: twinkle-close-normal 3.0s ease-in-out 1.5s infinite; }

/* medium: more contrast & double-peak per cycle (between normal & strong) */
@keyframes twinkle-fast-medium {
  0%, 100% { opacity: 0.25; }
  30%      { opacity: 1; }
  55%      { opacity: 0.3; }
  78%      { opacity: 0.95; }
}
@keyframes twinkle-mid-medium {
  0%, 100% { opacity: 0.3; }
  28%      { opacity: 1; }
  52%      { opacity: 0.35; }
  76%      { opacity: 1; }
}
@keyframes twinkle-close-medium {
  0%, 100% { opacity: 0.4; }
  25%      { opacity: 1; }
  50%      { opacity: 0.45; }
  74%      { opacity: 1; }
}
body.twinkle-medium .starfield-deep::before  { animation: twinkle-fast-medium  3.0s ease-in-out infinite; }
body.twinkle-medium .starfield-mid::before   { animation: twinkle-mid-medium   2.6s ease-in-out infinite; }
body.twinkle-medium .starfield-close::before { animation: twinkle-close-medium 2.2s ease-in-out infinite; }
body.twinkle-medium .starfield-deep::after   { animation: twinkle-fast-medium  3.4s ease-in-out 0.6s infinite; }
body.twinkle-medium .starfield-mid::after    { animation: twinkle-mid-medium   2.9s ease-in-out 1.0s infinite; }
body.twinkle-medium .starfield-close::after  { animation: twinkle-close-medium 2.5s ease-in-out 1.3s infinite; }

/* strong: high contrast multi-peak, still smooth (between medium & vivid) */
@keyframes twinkle-fast-strong {
  0%, 100% { opacity: 0.18; }
  15%      { opacity: 1; }
  30%      { opacity: 0.22; }
  50%      { opacity: 1; }
  68%      { opacity: 0.2; }
  85%      { opacity: 0.95; }
}
@keyframes twinkle-mid-strong {
  0%, 100% { opacity: 0.22; }
  14%      { opacity: 1; }
  28%      { opacity: 0.25; }
  48%      { opacity: 1; }
  66%      { opacity: 0.28; }
  84%      { opacity: 1; }
}
@keyframes twinkle-close-strong {
  0%, 100% { opacity: 0.3; }
  12%      { opacity: 1; }
  26%      { opacity: 0.32; }
  46%      { opacity: 1; }
  64%      { opacity: 0.3; }
  82%      { opacity: 1; }
}
body.twinkle-strong .starfield-deep::before  { animation: twinkle-fast-strong  2.6s ease-in-out infinite; }
body.twinkle-strong .starfield-mid::before   { animation: twinkle-mid-strong   2.1s ease-in-out infinite; }
body.twinkle-strong .starfield-close::before { animation: twinkle-close-strong 1.7s ease-in-out infinite; }
body.twinkle-strong .starfield-deep::after   { animation: twinkle-fast-strong  2.9s ease-in-out 0.5s infinite; }
body.twinkle-strong .starfield-mid::after    { animation: twinkle-mid-strong   2.4s ease-in-out 0.9s infinite; }
body.twinkle-strong .starfield-close::after  { animation: twinkle-close-strong 2.0s ease-in-out 1.2s infinite; }

/* vivid: sharp blinking (original look) */
@keyframes twinkle-fast-vivid {
  0%, 100% { opacity: 0.15; }
  10%      { opacity: 1; }
  20%      { opacity: 0.2; }
  35%      { opacity: 0.95; }
  45%      { opacity: 0.1; }
  60%      { opacity: 0.85; }
  72%      { opacity: 0.15; }
}
@keyframes twinkle-mid-vivid {
  0%, 100% { opacity: 0.25; }
  12%      { opacity: 1; }
  24%      { opacity: 0.15; }
  40%      { opacity: 0.95; }
  55%      { opacity: 0.2; }
  68%      { opacity: 1; }
  82%      { opacity: 0.3; }
}
@keyframes twinkle-close-vivid {
  0%, 100% { opacity: 0.35; }
  8%       { opacity: 1; }
  15%      { opacity: 0.2; }
  28%      { opacity: 1; }
  40%      { opacity: 0.3; }
  52%      { opacity: 1; }
  64%      { opacity: 0.15; }
  80%      { opacity: 0.9; }
}
body.twinkle-vivid .starfield-deep::before  { animation: twinkle-fast-vivid  2.3s steps(1, end) infinite; }
body.twinkle-vivid .starfield-mid::before   { animation: twinkle-mid-vivid   1.7s steps(1, end) infinite; }
body.twinkle-vivid .starfield-close::before { animation: twinkle-close-vivid 1.3s steps(1, end) infinite; }
body.twinkle-vivid .starfield-deep::after   { animation: twinkle-fast-vivid  1.9s steps(1, end) 0.4s infinite; }
body.twinkle-vivid .starfield-mid::after    { animation: twinkle-mid-vivid   1.4s steps(1, end) 0.8s infinite; }
body.twinkle-vivid .starfield-close::after  { animation: twinkle-close-vivid 1.6s steps(1, end) 1.1s infinite; }

/* Warp mode readability overlay — very light vignette so center isn't washed out */
.warp-readability {
  position: fixed;
  inset: 0;
  z-index: 51;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(3,6,15,0.15) 0%, rgba(3,6,15,0.05) 50%, rgba(3,6,15,0) 80%);
}

.warp-canvas {
  opacity: 0.55;
}

/* When warp is active, give panels a stronger but not dark backdrop */
body:has(.warp-canvas) .panel,
body:has(.warp-canvas) .dash-hero,
body:has(.warp-canvas) .review-hero,
body:has(.warp-canvas) .ws-toolbar,
body:has(.warp-canvas) .ws-quick,
body:has(.warp-canvas) .board-col,
body:has(.warp-canvas) .ws-table-wrap,
body:has(.warp-canvas) .today-section {
  backdrop-filter: blur(8px);
}
body:has(.warp-canvas) .sidebar,
body:has(.warp-canvas) .topbar {
  backdrop-filter: blur(14px);
  background: rgba(7,12,28,0.75);
}

/* Subtle film grain — visible scratchy texture */
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.32 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 60;
  opacity: 0.55;
  mix-blend-mode: overlay;
  animation: grain-shift 0.8s steps(6) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-2%, 1%); }
  33%  { transform: translate(1%, -2%); }
  50%  { transform: translate(-1%, 2%); }
  67%  { transform: translate(2%, 1%); }
  83%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

body.no-starfield .starfield,
body.no-starfield .shooting-star { display: none !important; }
body.no-grain::after { display: none !important; }

#root { position: relative; z-index: 2; min-height: 100vh; }

/* Typography */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.title-serif {
  font-family: var(--f-title);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.eyebrow {
  font-family: var(--f-title);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.label-mono {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(91,123,196,0.18);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(91,123,196,0.32); background-clip: padding-box; border: 2px solid transparent; }

/* ============================================================
   Shell — sidebar + topbar
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  grid-template-rows: var(--topbar) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  grid-row: 1 / 3;
  background: linear-gradient(180deg, rgba(11,19,48,0.92), rgba(7,12,28,0.95));
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
}

.brand {
  padding: 18px 16px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-shield {
  width: 46px; height: 46px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px var(--crimson-glow));
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--f-display);
  font-size: 18px;
  letter-spacing: 0.14em;
  line-height: 1;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 50%, var(--gold-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 12px rgba(245,197,24,0.2);
}
.brand-sub {
  font-family: var(--f-title);
  font-size: 7px;
  letter-spacing: 0.32em;
  color: var(--crystal);
  text-transform: uppercase;
}

.nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.nav-section { margin-bottom: 14px; }
.nav-section-title {
  padding: 6px 10px 6px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--smoke);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  letter-spacing: 0.01em;
}
.nav-item:hover { background: rgba(91,123,196,0.08); color: var(--ivory); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(196,30,58,0.18), rgba(196,30,58,0.04));
  color: var(--ivory);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--crimson);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--crimson-glow);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10px;
  background: var(--crimson);
  color: var(--ivory);
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

.sidebar-foot {
  border-top: 1px solid var(--hairline);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-lo) 100%);
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 14px;
  color: var(--ivory);
  border: 1px solid var(--border-hi);
  transition: all 0.15s;
}
.avatar:hover { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(196,30,58,0.24); }
.user-name { font-size: 12px; font-weight: 600; color: var(--ivory); line-height: 1.2; }
.user-role { font-size: 10px; color: var(--smoke); margin-top: 2px; letter-spacing: 0.04em; }

/* Topbar */
.topbar {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background: rgba(7,12,28,0.65);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumb-eyebrow {
  font-family: var(--f-title);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold);
  font-weight: 600;
}
.crumb-title {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--ivory);
  margin-top: 2px;
}
.crumbs-block { display: flex; flex-direction: column; line-height: 1; }

.topbar-spacer { flex: 1; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(91,123,196,0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 320px;
  cursor: pointer;
  transition: all 0.15s;
}
.search-bar:hover { border-color: var(--border-hi); background: rgba(91,123,196,0.12); }
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  font: inherit; color: var(--ivory); font-size: 13px;
}
.search-bar input::placeholder { color: var(--smoke); }
.kbd {
  font-family: var(--f-mono); font-size: 10px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--ash);
}

.record-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(180deg, var(--crimson-hi), var(--crimson) 60%, var(--crimson-lo));
  border: 1px solid var(--crimson-hi);
  border-radius: 6px;
  font-family: var(--f-display);
  letter-spacing: 0.14em;
  font-size: 14px;
  color: var(--ivory);
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 0 0 0 var(--crimson-glow), 0 8px 24px rgba(196,30,58,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: all 0.2s;
}
.record-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(196,30,58,0.18), 0 12px 32px rgba(196,30,58,0.5), inset 0 1px 0 rgba(255,255,255,0.22);
}
.record-button.recording {
  background: linear-gradient(180deg, #FF2A2A, var(--crimson));
  animation: pulse-rec 1.2s ease-in-out infinite;
}
@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,42,42,0.6), 0 8px 24px rgba(196,30,58,0.5), inset 0 1px 0 rgba(255,255,255,0.18); }
  50% { box-shadow: 0 0 0 10px rgba(255,42,42,0.0), 0 8px 24px rgba(196,30,58,0.5), inset 0 1px 0 rgba(255,255,255,0.18); }
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: rgba(91,123,196,0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { background: rgba(91,123,196,0.16); color: var(--ivory); border-color: var(--border-hi); }

/* Main content */
.main {
  grid-column: 2;
  padding: 20px 28px 64px;
  max-width: var(--content-max);
  width: 100%;
  zoom: var(--font-scale, 1);
}

/* ============================================================
   Generic surfaces / panels
   ============================================================ */
.panel {
  background: linear-gradient(180deg, rgba(17,29,68,0.55) 0%, rgba(11,19,48,0.45) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.panel.elevated {
  box-shadow: var(--shadow-cinematic);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--hairline);
  position: relative;
}
.panel-head h3 {
  font-family: var(--f-display);
  font-size: 16px;
  letter-spacing: 0.14em;
  color: var(--ivory);
  font-weight: 400;
  text-transform: uppercase;
}
.panel-head .eyebrow { margin-bottom: 4px; display: block; }
.panel-head-meta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.panel-body { padding: 22px; }

/* Decorative film-strip top edge for hero panels */
.panel.cinematic::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0.6;
}

/* Pills / chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: rgba(91,123,196,0.08);
  color: var(--ash);
  font-weight: 500;
  white-space: nowrap;
}
.chip.gold { border-color: rgba(245,197,24,0.32); color: var(--gold); background: rgba(245,197,24,0.06); }
.chip.crimson { border-color: rgba(196,30,58,0.36); color: var(--crimson-hi); background: rgba(196,30,58,0.08); }
.chip.crystal { border-color: rgba(91,123,196,0.36); color: var(--crystal); background: rgba(91,123,196,0.10); }
.chip.solid { background: var(--crimson); color: var(--ivory); border-color: var(--crimson); }
.chip.done { background: rgba(91,123,196,0.04); color: var(--smoke); border-color: var(--hairline); text-decoration: line-through; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: rgba(91,123,196,0.08);
  color: var(--ivory);
}
.btn:hover { background: rgba(91,123,196,0.16); border-color: var(--border-hi); }
.btn.primary {
  background: linear-gradient(180deg, var(--crimson-hi), var(--crimson) 70%, var(--crimson-lo));
  border-color: var(--crimson);
  color: var(--ivory);
  box-shadow: 0 6px 16px rgba(196,30,58,0.32), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(196,30,58,0.45), inset 0 1px 0 rgba(255,255,255,0.22); }
.btn.gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  border-color: var(--gold);
  color: var(--void);
  box-shadow: 0 6px 16px rgba(245,197,24,0.24), inset 0 1px 0 rgba(255,255,255,0.32);
}
.btn.gold:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--hairline); }
.btn.ghost:hover { background: rgba(91,123,196,0.08); border-color: var(--border); }
.btn.sm { padding: 5px 11px; font-size: 11px; }
.btn.lg { padding: 12px 22px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============================================================
   Generic modal (CRUD forms)
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(7,12,28,0.82), rgba(3,6,15,0.94));
  backdrop-filter: blur(10px);
  z-index: 110;
  display: grid; place-items: center;
  padding: 40px;
  animation: fade-in 0.25s ease;
}
.modal-stage {
  width: 100%;
  max-width: 680px;
  background: linear-gradient(180deg, var(--night), var(--space));
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  box-shadow: 0 60px 120px rgba(0,0,0,0.8);
  overflow: hidden;
  animation: slide-up 0.35s cubic-bezier(.2,.7,.2,1);
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-stage::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}

.modal-head {
  padding: 18px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--hairline);
}
.modal-title {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--ivory);
  margin-top: 4px;
}

.modal-body {
  padding: 22px 26px;
  flex: 1;
  overflow-y: auto;
}

.modal-foot {
  padding: 14px 26px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0,0,0,0.3);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.span-2 { grid-column: span 2; }
.form-label {
  font-family: var(--f-title);
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
  display: flex; gap: 4px;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0,0,0,0.42);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--ivory);
  font-family: var(--f-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: var(--smoke); }
.form-textarea { min-height: 78px; resize: vertical; line-height: 1.55; }

.form-error { font-size: 11px; color: var(--crimson-hi); }
.form-hint { font-size: 11px; color: var(--smoke); }

.chip-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  padding: 6px 12px;
  background: rgba(91,123,196,0.08);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.15s;
}
.chip-btn:hover { border-color: var(--border-hi); color: var(--ivory); }
.chip-btn.active {
  background: rgba(245,197,24,0.14);
  border-color: var(--gold);
  color: var(--gold);
}
.chip-btn.active.crimson { background: rgba(196,30,58,0.16); border-color: var(--crimson); color: var(--crimson-hi); }
.chip-btn.active.gold { background: rgba(245,197,24,0.16); border-color: var(--gold); color: var(--gold); }
.chip-btn.active.crystal { background: rgba(91,123,196,0.16); border-color: var(--crystal); color: var(--crystal); }

/* Radio picker — single-select with real radio inputs */
.radio-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(91,123,196,0.08);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--smoke);
  transition: all 0.15s;
  user-select: none;
}
.radio-opt:hover { border-color: var(--border-hi); color: var(--ivory); }
.radio-opt input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--smoke);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.radio-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.15s;
}
.radio-opt.active {
  background: rgba(245,197,24,0.14);
  border-color: var(--gold);
  color: var(--gold);
}
.radio-opt.active .radio-dot { border-color: var(--gold); }
.radio-opt.active .radio-dot::after { transform: scale(1); }

/* Row actions (edit/delete buttons appearing on hover) */
.row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.task-card:hover .row-actions,
.contact-row:hover .row-actions,
.book-card:hover .row-actions,
.schedule-row:hover .row-actions,
.memo-card:hover .row-actions,
.project-card:hover .row-actions {
  opacity: 1;
}
.row-action-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.15s;
}
.row-action-btn:hover { background: rgba(91,123,196,0.14); color: var(--ivory); border-color: var(--border); }
.row-action-btn.danger:hover { background: rgba(196,30,58,0.16); color: var(--crimson-hi); border-color: rgba(196,30,58,0.32); }
.row-action-btn.copy:hover { background: rgba(245,197,24,0.10); color: var(--gold); border-color: rgba(245,197,24,0.32); }
.row-action-btn.sm { width: 22px; height: 22px; }

/* Copy-row toast (Board/Owners/Table/Today copy buttons) */
.ws-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  background: rgba(11,19,48,0.96);
  color: var(--ivory);
  border: 1px solid var(--gold);
  border-radius: 6px;
  font-family: var(--f-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,197,24,0.18);
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ws-toast[data-kind="err"] {
  border-color: var(--crimson);
  box-shadow: 0 12px 36px rgba(0,0,0,0.6), 0 0 0 1px rgba(196,30,58,0.32);
}

.project-card { position: relative; }
.project-card .row-actions { position: absolute; top: 14px; right: 14px; }

.memo-card { position: relative; }
.memo-card .row-actions { position: absolute; top: 12px; right: 12px; }
/* ============================================================
   Dashboard — condensed single-screen layout
   ============================================================ */
.dash-condensed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

/* Hero strip: one row, no big greeting */
.dash-hero-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(11,19,48,0.7), rgba(7,12,28,0.7));
  border: 1px solid var(--hairline);
  border-radius: 8px;
  flex-shrink: 0;
}
.dash-hero-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-shrink: 0; }
.dash-hero-eyebrow {
  font-family: var(--f-title);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-hero-greet {
  font-family: var(--f-display);
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--ivory);
  white-space: nowrap;
}
.dash-hero-greet .accent {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-hero-strip .dash-hero-stats {
  display: flex;
  gap: 14px;
  margin-left: auto;
}
.dash-stat {
  display: flex; flex-direction: column;
  align-items: flex-end;
  min-width: 52px;
  border-left: 1px solid var(--hairline);
  padding-left: 12px;
}
.dash-stat-label {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--ash);
  text-transform: uppercase;
}
.dash-stat-value {
  font-family: var(--f-display);
  font-size: 19px;
  color: var(--ivory);
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.dash-stat-tot {
  font-size: 11px;
  color: var(--ash);
  margin-left: 2px;
}
.dash-stat-delta {
  font-family: var(--f-mono);
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.dash-hero-actions { display: flex; gap: 8px; }

/* Alerts strip — horizontal list */
.dash-alerts-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(196,30,58,0.06);
  border: 1px solid rgba(196,30,58,0.22);
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
}
.dash-alerts-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--crimson-hi);
  flex-shrink: 0;
}
.dash-alerts-list {
  display: flex; gap: 8px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}
.dash-alert-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: rgba(11,19,48,0.6);
  border: 1px solid rgba(196,30,58,0.28);
  border-radius: 4px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--ivory);
  flex-shrink: 0;
}
.dash-alert-pill.high {
  border-color: var(--crimson);
  background: rgba(196,30,58,0.16);
}
.dash-alert-pill.more {
  background: transparent;
  border-style: dashed;
  cursor: pointer;
  color: var(--ash);
}
.dash-alert-title { color: var(--ivory); font-weight: 500; }
.dash-alert-meta { color: var(--ash); font-family: var(--f-mono); font-size: 10px; }
/* PRIORITY strip scroll nav buttons */
.dash-alerts-nav {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 4px;
  border: 1px solid rgba(196,30,58,0.28);
  background: rgba(11,19,48,0.6);
  color: var(--crimson-hi);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.dash-alerts-nav:hover {
  background: rgba(196,30,58,0.18);
  border-color: var(--crimson);
}
.dash-alerts-list { scroll-behavior: smooth; }

/* 3-column main grid */
.dash-cols {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  min-height: 0;
}
.dash-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.dash-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dash-stack .dash-panel { flex: 1 1 0; }
.dash-panel .panel-head.compact {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--hairline);
}
.dash-panel .panel-head.compact .eyebrow { font-size: 9px; letter-spacing: 0.20em; }
.dash-panel .panel-head.compact h3 {
  font-family: var(--f-display);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ivory);
  margin-top: 2px;
}
.dash-panel .panel-body {
  padding: 6px 12px 12px;
  flex: 1;
  min-height: 0;
}
.dash-scroll { overflow-y: auto; }

.dash-empty {
  text-align: center;
  padding: 28px 0;
  color: var(--ash);
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: 0.10em;
}

/* Task row — denser */
.dash-task-row {
  display: flex; align-items: flex-start;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}
.dash-task-row:last-child { border-bottom: none; }
.dash-task-row { cursor: pointer; position: relative; }
.dash-task-row:hover { background: rgba(91,123,196,0.05); }
.dash-task-row:hover { background: rgba(91,123,196,0.10); box-shadow: inset 2px 0 0 var(--crystal); }
.dash-task-row.done .dash-task-title { color: var(--smoke); text-decoration: line-through; }
.dash-task-content { flex: 1; min-width: 0; }
.dash-task-title {
  font-size: 12px;
  color: var(--ivory);
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}
.dash-task-meta { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }

/* Schedule row — denser */
.dash-schedule-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--hairline);
  align-items: center;
}
.dash-schedule-row:last-child { border-bottom: none; }
.dash-schedule-row { cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.dash-schedule-row:hover { background: rgba(91,123,196,0.10); box-shadow: inset 2px 0 0 var(--crystal); }
.dash-sched-time {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.02em;
  text-align: center;
  font-weight: 600;
}
.dash-sched-date {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--crystal);
  letter-spacing: 0.02em;
  margin-bottom: 2px;
  font-weight: 600;
}
.dash-sched-dur {
  font-size: 9px;
  color: var(--smoke);
  margin-top: 1px;
  letter-spacing: 0.06em;
}
.dash-sched-title {
  font-size: 12px;
  color: var(--ivory);
  font-weight: 500;
  line-height: 1.35;
}
.dash-sched-notes {
  font-size: 10px;
  color: var(--ash);
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Project row */
.dash-project-row { margin-bottom: 12px; }
.dash-project-row:last-child { margin-bottom: 0; }
.dash-project-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.dash-project-name {
  font-family: var(--f-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ivory);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-project-pct {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.dash-project-meta {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--ash);
  letter-spacing: 0.08em;
  margin-top: 3px;
}

/* Recording row — denser */
.dash-rec-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}
.dash-rec-row:last-child { border-bottom: none; }
.dash-rec-row:hover { background: rgba(91,123,196,0.05); }
.dash-rec-icon {
  width: 28px; height: 28px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--midnight), var(--steel));
  display: grid; place-items: center;
  color: var(--gold);
  border: 1px solid var(--border);
}
.dash-rec-content { min-width: 0; }
.dash-rec-title {
  font-size: 12px;
  color: var(--ivory);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-rec-sub {
  font-size: 10px;
  color: var(--ash);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-rec-duration {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--crystal);
  letter-spacing: 0.04em;
}

/* Group heading inside dashboard panels */
.dash-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 2px 5px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.20em;
  color: var(--gold);
  text-transform: uppercase;
  border-bottom: 1px dashed var(--hairline);
  margin-top: 4px;
}
.dash-group-head:first-child { margin-top: 0; padding-top: 0; }
.dash-group-count {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.10em;
  color: var(--ash);
}
.dash-task-date {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.04em;
  padding: 1px 5px;
  background: rgba(245,197,24,0.10);
  border-radius: 2px;
}

/* Applicant pipeline row */
.dash-appl-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 4px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}
.dash-appl-row:last-child { border-bottom: none; }
.dash-appl-row:hover { background: rgba(91,123,196,0.05); }
.dash-appl-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}
.dash-appl-content { min-width: 0; }
.dash-appl-name {
  font-size: 12px;
  color: var(--ivory);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-appl-pos {
  color: var(--ash);
  font-weight: 400;
  font-size: 11px;
}
.dash-appl-action {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.dash-appl-date {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--crystal);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Compact chip for dense layouts */
.chip.xs {
  font-size: 9px;
  padding: 2px 6px;
  letter-spacing: 0.06em;
}

/* Make main container fill height for condensed dashboard */
.main:has(.dash-condensed) {
  display: flex;
  flex-direction: column;
}
.main:has(.dash-condensed) .view-fade.dash-condensed { flex: 1; }
.dash-hero {
  position: relative;
  padding: 38px 44px;
  background:
    radial-gradient(ellipse 600px 300px at 90% 50%, rgba(196,30,58,0.20), transparent 70%),
    radial-gradient(ellipse 800px 400px at 10% 100%, rgba(42,68,144,0.32), transparent 60%),
    linear-gradient(135deg, rgba(17,29,68,0.65) 0%, rgba(11,19,48,0.85) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-cinematic);
}
.dash-hero::after {
  content: "";
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245,197,24,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.dash-hero-eyebrow {
  font-family: var(--f-title);
  font-size: 11px;
  letter-spacing: 0.36em;
  color: var(--gold);
  margin-bottom: 16px;
}
.dash-hero h1 {
  font-family: var(--f-display);
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--ivory);
  text-shadow: 0 4px 24px rgba(0,0,0,0.6);
  margin-bottom: 12px;
}
.dash-hero h1 .accent {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 60%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-hero-sub {
  font-family: var(--f-title);
  font-size: 14px;
  letter-spacing: 0.24em;
  color: var(--crystal);
  margin-bottom: 26px;
}
.dash-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.hero-stat-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ash);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero-stat-value {
  font-family: var(--f-display);
  font-size: 32px;
  color: var(--ivory);
  line-height: 1;
  letter-spacing: 0.02em;
}
.hero-stat-delta {
  font-family: var(--f-mono);
  font-size: 11px;
  margin-top: 4px;
  color: var(--crystal);
}
.hero-stat-delta.up { color: var(--gold); }
.hero-stat-delta.down { color: var(--crimson-hi); }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}

/* Tasks list */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: all 0.15s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: rgba(91,123,196,0.04); }
.task-check {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border-hi);
  flex-shrink: 0;
  margin-top: 1px;
  display: grid; place-items: center;
  transition: all 0.15s;
}
.task-check.checked {
  background: var(--gold);
  border-color: var(--gold);
}
.task-check.checked svg { color: var(--void); }
.task-row.done .task-title { color: var(--smoke); text-decoration: line-through; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 13px; color: var(--ivory); font-weight: 500; line-height: 1.4; }
.task-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.task-time { font-family: var(--f-mono); font-size: 10px; color: var(--ash); letter-spacing: 0.08em; }

.priority-mark {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--smoke);
}
.priority-mark.high { background: var(--crimson); box-shadow: 0 0 8px var(--crimson-glow); }
.priority-mark.med { background: var(--gold); }
.priority-mark.low { background: var(--crystal); opacity: 0.6; }

/* Schedule */
.schedule-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.schedule-row:last-child { border-bottom: none; }
.schedule-time {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.schedule-time-dur { font-size: 9px; color: var(--smoke); display: block; margin-top: 2px; letter-spacing: 0.12em; }
.schedule-title { font-size: 13px; color: var(--ivory); font-weight: 500; }
.schedule-sub { font-size: 11px; color: var(--ash); margin-top: 2px; }

.now-marker {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(196,30,58,0.10);
  border-left: 3px solid var(--crimson);
  margin-bottom: 8px;
  border-radius: 0 4px 4px 0;
}
.now-marker .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 0 0 var(--crimson-glow);
  animation: pulse-rec 1.2s infinite;
}
.now-marker .label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--crimson-hi);
  text-transform: uppercase;
  font-weight: 600;
}

/* KPI tiles */
.kpi-tile {
  position: relative;
  overflow: hidden;
}
.kpi-tile-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.kpi-tile-label {
  font-family: var(--f-title);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
}
.kpi-tile-value {
  font-family: var(--f-display);
  font-size: 44px;
  color: var(--ivory);
  line-height: 1;
  letter-spacing: 0.02em;
}
.kpi-tile-unit { font-size: 16px; color: var(--ash); margin-left: 4px; font-family: var(--f-body); font-weight: 500; }
.kpi-tile-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--ash);
}
.kpi-spark { height: 36px; margin-top: 14px; }

/* Important / unhandled */
.alert-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(90deg, rgba(196,30,58,0.10), rgba(196,30,58,0.02));
  border: 1px solid rgba(196,30,58,0.20);
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.alert-item:hover { border-color: rgba(196,30,58,0.38); }
.alert-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(196,30,58,0.16);
  display: grid; place-items: center;
  color: var(--crimson-hi);
  flex-shrink: 0;
}
.alert-title { font-size: 13px; color: var(--ivory); font-weight: 600; margin-bottom: 4px; }
.alert-meta { font-size: 11px; color: var(--ash); }

/* Recording cards on dashboard */
.rec-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(11,19,48,0.4);
}
.rec-card:hover { border-color: var(--border-hi); background: rgba(91,123,196,0.06); }
.rec-icon {
  width: 44px; height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--midnight), var(--steel));
  display: grid; place-items: center;
  color: var(--gold);
  border: 1px solid var(--border);
}
.rec-title { font-size: 13px; color: var(--ivory); font-weight: 600; margin-bottom: 3px; }
.rec-sub { font-size: 11px; color: var(--ash); }
.rec-duration { font-family: var(--f-mono); font-size: 11px; color: var(--crystal); }

/* ============================================================
   PROJECTS
   ============================================================ */
.project-card {
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17,29,68,0.55) 0%, rgba(11,19,48,0.45) 100%);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.project-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.project-icon {
  width: 44px; height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--steel) 0%, var(--midnight) 100%);
  border: 1px solid var(--border-hi);
  display: grid; place-items: center;
  color: var(--gold);
  flex-shrink: 0;
}
.project-name { font-family: var(--f-display); font-size: 18px; letter-spacing: 0.06em; color: var(--ivory); line-height: 1.1; }
.project-area { font-size: 10px; color: var(--gold); margin-top: 4px; font-family: var(--f-title); letter-spacing: 0.24em; }
.progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 16px;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--gold) 100%);
  border-radius: 3px;
  position: relative;
  box-shadow: 0 0 12px var(--crimson-glow);
}
.progress-bar.gold .progress-fill { background: linear-gradient(90deg, var(--gold-lo) 0%, var(--gold-hi) 100%); box-shadow: 0 0 12px var(--gold-glow);}
.progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
  font-family: var(--f-mono); font-size: 11px;
  color: var(--ash); letter-spacing: 0.08em;
}
.progress-pct { color: var(--gold); font-weight: 600; }

/* ============================================================
   Recording studio modal
   ============================================================ */
.rec-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, rgba(7,12,28,0.85), rgba(3,6,15,0.95));
  backdrop-filter: blur(12px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 40px;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.rec-stage {
  width: 100%;
  max-width: 920px;
  background: linear-gradient(180deg, var(--night), var(--space));
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  box-shadow: 0 60px 120px rgba(0,0,0,0.8);
  overflow: hidden;
  animation: slide-up 0.4s cubic-bezier(.2,.7,.2,1);
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.rec-stage::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}

.rec-stage-head {
  padding: 22px 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--hairline);
}
.rec-stage-head .eyebrow { display: block; margin-bottom: 4px; }
.rec-stage-head h2 {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: 0.10em;
  color: var(--ivory);
}
.rec-stage-body {
  padding: 32px;
  flex: 1;
  overflow-y: auto;
}

.rec-bigbutton-wrap {
  display: grid; place-items: center;
  padding: 24px 0 28px;
}
.rec-bigbutton {
  width: 144px; height: 144px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--crimson-hi), var(--crimson) 60%, var(--crimson-lo));
  border: 4px solid rgba(245,197,24,0.32);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 0 var(--crimson-glow), 0 30px 80px rgba(196,30,58,0.5), inset 0 4px 0 rgba(255,255,255,0.15);
  transition: all 0.25s;
  position: relative;
}
.rec-bigbutton:hover { transform: scale(1.04); }
.rec-bigbutton svg { width: 56px; height: 56px; color: var(--ivory); }

.rec-bigbutton.live {
  background: radial-gradient(circle at 30% 30%, #FF3E5E, var(--crimson) 60%, var(--crimson-lo));
  animation: pulse-big 1.5s ease-in-out infinite;
}
@keyframes pulse-big {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,42,42,0.6), 0 30px 80px rgba(196,30,58,0.5), inset 0 4px 0 rgba(255,255,255,0.15);}
  50% { box-shadow: 0 0 0 24px rgba(255,42,42,0.0), 0 30px 80px rgba(196,30,58,0.5), inset 0 4px 0 rgba(255,255,255,0.15);}
}

.rec-status-text {
  text-align: center;
  margin-top: 22px;
  font-family: var(--f-display);
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
}
.rec-timer {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 40px;
  color: var(--ivory);
  margin-top: 6px;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.waveform {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 14px 0 24px;
}
.waveform .bar {
  width: 3px;
  background: var(--crystal);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.transcript-stage {
  padding: 22px;
  background: rgba(0,0,0,0.32);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  min-height: 200px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ivory);
  white-space: pre-wrap;
  font-family: var(--f-body);
}
.transcript-stage:empty::before {
  content: "ここに文字起こしが表示されます…";
  color: var(--smoke);
  font-style: italic;
}
.transcript-stage .partial { color: var(--ash); font-style: italic; }

.rec-meta {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rec-meta input, .rec-meta select {
  width: 100%;
  padding: 9px 14px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ivory);
  font-family: var(--f-body);
  font-size: 13px;
  outline: none;
}
.rec-meta input:focus, .rec-meta select:focus { border-color: var(--gold); }
.rec-meta input::placeholder { color: var(--smoke); }

.summary-stage {
  margin-top: 22px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(245,197,24,0.06), rgba(245,197,24,0.02));
  border: 1px solid rgba(245,197,24,0.24);
  border-radius: 8px;
  position: relative;
}
.summary-stage::before {
  content: "";
  position: absolute; top: 0; left: 22px; right: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}
.summary-stage h4 {
  font-family: var(--f-display);
  font-size: 14px;
  letter-spacing: 0.20em;
  color: var(--gold);
  margin-bottom: 14px;
}
.summary-section { margin-bottom: 16px; }
.summary-section:last-child { margin-bottom: 0; }
.summary-section h5 {
  font-family: var(--f-title);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--crystal);
  margin-bottom: 8px;
}
.summary-section ul { list-style: none; padding: 0; }
.summary-section li {
  padding: 6px 0 6px 18px;
  position: relative;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ivory);
}
.summary-section li::before {
  content: "▸";
  position: absolute; left: 0;
  color: var(--crimson);
}

.rec-stage-foot {
  padding: 18px 32px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  background: rgba(0,0,0,0.3);
}

/* ============================================================
   Settings modal — full preferences UI
   ============================================================ */
.settings-stage { max-width: 920px; }
.settings-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  max-height: 70vh;
  overflow: hidden;
}
.settings-nav {
  border-right: 1px solid var(--hairline);
  padding: 14px 10px;
  background: rgba(0,0,0,0.18);
  overflow-y: auto;
  min-height: 0;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.settings-nav-item:hover { background: rgba(91,123,196,0.08); color: var(--ivory); }
.settings-nav-item.active {
  background: linear-gradient(90deg, rgba(196,30,58,0.18), rgba(196,30,58,0.04));
  color: var(--ivory);
  border-left: 2px solid var(--crimson);
  padding-left: 10px;
}

.settings-content { padding: 22px 26px; overflow-y: auto; min-height: 0; max-height: 70vh; }
.settings-section { margin-bottom: 30px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section-head { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.settings-section-title {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0.10em;
  color: var(--ivory);
}
.settings-section-sub { margin-top: 6px; font-size: 12px; color: var(--ash); line-height: 1.5; }
.settings-section-body { display: flex; flex-direction: column; gap: 14px; }

.settings-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
}
.settings-field-label {
  font-size: 13px;
  color: var(--ivory);
  font-weight: 500;
}
.settings-field-hint {
  font-size: 11px;
  color: var(--smoke);
  margin-top: 3px;
  line-height: 1.5;
}
.settings-field-control { width: 100%; }
.settings-field-control .form-input { width: 100%; }

.settings-toggle {
  width: 42px; height: 24px;
  background: rgba(91,123,196,0.16);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.settings-toggle.on {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  border-color: var(--gold);
}
.settings-toggle-knob {
  position: absolute;
  top: 1px; left: 1px;
  width: 20px; height: 20px;
  background: var(--ivory);
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(.5,.1,.5,1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.settings-toggle.on .settings-toggle-knob { left: 20px; background: var(--void); }

.settings-shortcut {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.settings-shortcut:last-child { border-bottom: none; }
.settings-shortcut-keys { display: flex; align-items: center; }
.kbd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--border-hi);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}
.settings-shortcut-label { font-size: 13px; color: var(--ivory); }

.settings-list-editor {
  padding: 14px;
  background: rgba(91,123,196,0.04);
  border: 1px solid var(--hairline);
  border-radius: 6px;
}
.settings-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.save-pill {
  position: absolute;
  bottom: 4px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--smoke);
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(91,123,196,0.08);
}
.save-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(245,197,24,0.6);
}
.sidebar-foot { position: relative; }

/* Toast */
.toast {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(180deg, var(--midnight), var(--night));
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ivory);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  animation: slide-up 0.25s ease;
}
.toast.ok { border-color: var(--gold); color: var(--gold); }
.toast.err { border-color: var(--crimson); color: var(--crimson-hi); }
.toast.info { border-color: var(--crystal); color: var(--crystal); }

/* TweaksPanel row wrapper */
.twk-row { padding: 4px 0; }

/* ============================================================
   Workspace — unified Notion-style tasks DB
   ============================================================ */
.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(17,29,68,0.55) 0%, rgba(11,19,48,0.45) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.ws-tabs {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.32);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 3px;
}
.ws-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--f-title);
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--ash);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  text-transform: uppercase;
  user-select: none;
}
.ws-tab.dragging { opacity: 0.35; }
.ws-tab.drop-target {
  box-shadow: inset 3px 0 0 var(--gold);
  background: rgba(245,197,24,0.08);
}
.ws-tab:hover { color: var(--ivory); }
.ws-tab.active {
  background: linear-gradient(180deg, rgba(245,197,24,0.18), rgba(245,197,24,0.04));
  color: var(--gold);
}
.ws-spacer { flex: 1; }
.ws-filters { display: flex; gap: 6px; align-items: center; }
.ws-filter {
  padding: 6px 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ivory);
  font-family: var(--f-body);
  font-size: 11px;
  outline: none;
  cursor: pointer;
}
.ws-filter:hover, .ws-filter:focus { border-color: var(--gold); }
.ws-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 180px;
}
.ws-search input {
  background: transparent; border: none; outline: none;
  font: inherit; color: var(--ivory); font-size: 11px;
  flex: 1;
  font-family: var(--f-body);
}
.ws-search input::placeholder { color: var(--smoke); }

/* Quick add bar */
.ws-quick {
  position: sticky;
  bottom: 16px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(20,30,72,0.95), rgba(11,19,48,0.95));
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  z-index: 5;
}
.ws-quick input {
  flex: 1;
  background: transparent; border: none; outline: none;
  font: inherit; color: var(--ivory); font-size: 13px;
}
.ws-quick input::placeholder { color: var(--smoke); }
.ws-quick-date {
  padding: 6px 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ivory);
  font-family: var(--f-mono);
  font-size: 11px;
  outline: none;
  color-scheme: dark;
  width: 130px;
}

/* Status pill (cycle button) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(91,123,196,0.10);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--crystal);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill:hover { transform: scale(1.03); }
.status-pill.todo { background: rgba(91,123,196,0.10); border-color: var(--border); color: var(--crystal); }
.status-pill.doing { background: rgba(245,197,24,0.14); border-color: rgba(245,197,24,0.32); color: var(--gold); }
.status-pill.done { background: rgba(91,123,196,0.06); border-color: var(--hairline); color: var(--smoke); }
.status-pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}
.status-pill.done .status-pill-dot { box-shadow: none; opacity: 0.5; }

/* Priority dot */
.prio-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 4px currentColor;
}

/* Date badge inline */
.date-badge-inline {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 2px 7px;
  background: rgba(91,123,196,0.08);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.date-badge-inline.today {
  background: rgba(196,30,58,0.16);
  border-color: rgba(196,30,58,0.40);
}
.date-badge-inline.past:not(.today) { opacity: 0.6; }

/* ====== BOARD VIEW ====== */
.board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.board-grid.owners-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.board-card.dragging { opacity: 0.4; }

/* Drop-line indicator between cards */
.kanban-drop-line {
  height: 3px;
  margin: -1px 0;
  border-radius: 3px;
  background: transparent;
  transition: background 0.1s;
}
.kanban-drop-line.active {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(245,197,24,0.55);
}
.kanban-drop-line.tail { margin-top: 6px; }
.board-col {
  background: rgba(7,12,28,0.4);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  min-height: 200px;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.board-col.dragover {
  background: rgba(245,197,24,0.08);
  border-color: var(--gold);
}
.board-col-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.board-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board-card {
  padding: 12px;
  background: linear-gradient(180deg, rgba(17,29,68,0.7) 0%, rgba(11,19,48,0.6) 100%);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  cursor: grab;
  transition: all 0.15s;
}
.board-card:hover { border-color: var(--border-hi); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
.board-card:active { cursor: grabbing; }
.board-card.done { opacity: 0.5; }
.board-card.done .board-card-title { text-decoration: line-through; }
.board-card-title {
  flex: 1;
  font-size: 13px;
  color: var(--ivory);
  font-weight: 500;
  line-height: 1.35;
}
.board-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.board-col-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--smoke);
  font-size: 12px;
  font-family: var(--f-mono);
  letter-spacing: 0.12em;
}

/* Applicants board — vertically-stacked stage lanes; each lane holds one
   flexible column per status, so most stages fit width without horizontal
   scroll. Lanes are collapsible. The page scrolls vertically (natural). */
.applicants-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}
.applicants-stage-lane {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  border-left: 3px solid var(--stage-color, var(--hairline));
  background: rgba(7,12,28,0.32);
  overflow: hidden;
}
.applicants-lane-head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.applicants-stage-lane.collapsed .applicants-lane-head {
  border-bottom: none;
}
.applicants-lane-head:hover { background: rgba(255,255,255,0.03); }
.applicants-lane-chevron {
  display: grid; place-items: center;
  color: var(--ash);
  flex-shrink: 0;
}
.applicants-stage-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--stage-color, var(--ash));
  flex-shrink: 0;
}
.applicants-stage-label {
  font-family: var(--f-title);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ivory);
  font-weight: 600;
  text-transform: uppercase;
}
.applicants-stage-count {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ash);
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 1px 9px;
  flex-shrink: 0;
}
.applicants-lane-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  align-items: flex-start;
}
.applicants-board-col {
  flex: 1 1 175px;
  min-width: 165px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  background: rgba(7,12,28,0.45);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.applicants-board-col.dragover {
  border-color: var(--gold);
  background: rgba(245,197,24,0.08);
}
.applicants-status-head {
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--hairline);
}
.applicants-status-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.applicants-status-mark {
  width: 7px; height: 7px; border-radius: 2px;
  flex-shrink: 0;
}
.applicants-status-count {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ash);
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 1px 8px;
  flex-shrink: 0;
}
.applicants-board-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.applicants-board-card {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.applicants-board-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #0B1330;
  font-family: var(--f-display);
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.applicants-board-company {
  font-size: 10px; color: var(--ash);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.applicants-board-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; margin-top: 8px;
}
.applicants-board-nextlabel {
  font-size: 10px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.applicants-board-next {
  font-family: var(--f-mono);
  font-size: 9px; color: var(--smoke);
  letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0;
}
.applicants-board-empty {
  padding: 16px 6px;
  font-size: 10px;
  text-align: center;
  color: var(--smoke);
}

/* ====== TABLE VIEW ====== */
.ws-table-wrap {
  background: rgba(7,12,28,0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ws-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
/* Applicants table: fixed column widths so cells never collapse to 1
   character per line when the font scale grows. Overflows scroll instead. */
.ws-table-wrap:has(.applicants-table) { overflow-x: auto; }
.applicants-table { table-layout: fixed; min-width: 1120px; }
.applicants-table th,
.applicants-table td { word-break: break-word; overflow-wrap: anywhere; }
.ws-table thead { background: rgba(11,19,48,0.6); }
.ws-table th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--f-title);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--hairline);
}
.ws-table th:hover { color: var(--gold-hi); }
.ws-table tbody tr {
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}
.ws-table tbody tr:hover { background: rgba(91,123,196,0.06); }
.ws-table tbody tr.done { opacity: 0.55; }
.ws-table tbody tr.done .ws-table-title { text-decoration: line-through; }
.ws-table td {
  padding: 10px 14px;
  vertical-align: middle;
}
.ws-table-title { color: var(--ivory); font-weight: 500; word-break: break-word; overflow-wrap: anywhere; white-space: normal; line-height: 1.45; }
.ws-table-title-cell { white-space: normal; }
.ws-table-notes { color: var(--smoke); font-size: 11px; margin-top: 3px; line-height: 1.4; word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.ws-table-notes-cell { white-space: normal; }
.ws-table-notes-full { color: var(--smoke); font-size: 11px; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }

/* Reorder + resize affordances */
.ws-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(11,19,48,0.4);
  font-size: 11px;
  color: var(--ash);
}
.ws-table th { position: relative; }
.ws-table th[draggable="true"]:not(:hover) span[style*="opacity:0.4"],
.ws-table th[draggable="true"]:not(:hover) span:first-child > span:first-child { opacity: 0.25; }
.ws-table th:hover span:first-child > span:first-child { opacity: 1; color: var(--gold); }
.ws-table-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  background: transparent;
  transition: background 0.12s;
}
.ws-table-resizer:hover,
.ws-table-resizer:active {
  background: linear-gradient(90deg, transparent 0, var(--gold) 40%, var(--gold) 60%, transparent 100%);
}
.ws-table td { vertical-align: top; }
.ws-table td.ws-table-title-cell,
.ws-table td.ws-table-notes-cell { vertical-align: top; }

/* ====== TODAY VIEW ====== */
.today-shell {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.today-section {
  background: rgba(7,12,28,0.4);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.today-section-head {
  padding: 12px 16px;
  background: rgba(11,19,48,0.6);
  font-family: var(--f-display);
  font-size: 13px;
  letter-spacing: 0.20em;
  border-bottom: 1px solid var(--hairline);
}
.today-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}
.today-row:last-child { border-bottom: none; }
.today-row:hover { background: rgba(91,123,196,0.06); }
.today-row-title { color: var(--ivory); font-weight: 500; font-size: 14px; line-height: 1.4; margin-bottom: 5px; }
.today-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rec-floater {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  background: linear-gradient(180deg, rgba(20,30,72,0.96), rgba(11,19,48,0.96));
  border: 1px solid var(--crimson);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(196,30,58,0.32),
    0 16px 40px rgba(196,30,58,0.32),
    0 24px 64px rgba(0,0,0,0.55);
  backdrop-filter: blur(14px);
  cursor: pointer;
  animation: slide-up 0.3s cubic-bezier(.2,.7,.2,1);
  min-width: 240px;
}
.rec-floater::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}
.rec-floater-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--crimson-hi), var(--crimson) 70%, var(--crimson-lo));
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--crimson-glow);
}
.dot-pulse {
  display: inline-block;
  width: 8px; height: 8px;
  background: white;
  border-radius: 50%;
  animation: dot-blink 1s ease-in-out infinite;
}
@keyframes dot-blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.rec-floater-content { flex: 1; min-width: 0; }
.rec-floater-label {
  font-family: var(--f-title);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--crimson-hi);
  font-weight: 600;
}
.rec-floater-time {
  font-family: var(--f-mono);
  font-size: 18px;
  color: var(--ivory);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.rec-floater-stop, .rec-floater-expand {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(91,123,196,0.10);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--ivory);
  cursor: pointer;
  transition: all 0.15s;
}
.rec-floater-stop {
  background: linear-gradient(180deg, var(--crimson-hi), var(--crimson-lo));
  border-color: var(--crimson);
}
.rec-floater-stop:hover { transform: scale(1.06); }
.rec-floater-expand:hover { background: rgba(91,123,196,0.18); border-color: var(--border-hi); }
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.tab {
  padding: 10px 18px;
  font-family: var(--f-title);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ash);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  font-weight: 600;
}
.tab:hover { color: var(--ivory); }
.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.tab-count {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--smoke);
  padding: 1px 6px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  letter-spacing: 0;
}
.tab.active .tab-count { color: var(--gold); border-color: rgba(245,197,24,0.32); }

.task-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  background: rgba(11,19,48,0.4);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  margin-bottom: 10px;
  transition: all 0.15s;
  cursor: pointer;
}
.task-card:hover { border-color: var(--border-hi); transform: translateX(2px); }
.task-card .task-content { padding-top: 1px; }
.task-card .task-title { font-size: 14px; margin-bottom: 4px; }
.task-card .task-desc { font-size: 12px; color: var(--ash); margin-top: 4px; line-height: 1.5; }

.task-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.cal-head {
  padding: 6px 6px;
  text-align: center;
  background: rgba(11,19,48,0.6);
  font-family: var(--f-title);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 600;
}
.cal-day {
  min-height: 68px;
  padding: 6px 8px;
  background: rgba(7,12,28,0.6);
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 0;
  overflow: hidden;
}
.cal-day:hover { background: rgba(91,123,196,0.06); }
.cal-day.other { opacity: 0.35; }
.cal-day.saturday { background: rgba(91,123,196,0.10); }
.cal-day.sunday { background: rgba(196,30,58,0.10); }
.cal-day.holiday { background: rgba(196,30,58,0.14); border-top: 1px solid rgba(196,30,58,0.32); }
.cal-day.selected { outline: 1px solid var(--gold); outline-offset: -1px; }
.cal-day.today { background: rgba(196,30,58,0.22); border: 1px solid var(--crimson); }
.cal-day.today .cal-num {
  background: var(--crimson);
  color: var(--ivory);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 11px;
  box-shadow: 0 0 12px var(--crimson-glow);
}
.cal-holiday-name {
  font-size: 9px;
  color: var(--crimson-hi);
  letter-spacing: 0.02em;
  font-family: var(--f-title);
  font-weight: 600;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.cal-event-more {
  font-size: 9px;
  color: var(--ash);
  font-family: var(--f-mono);
  letter-spacing: 0.08em;
  padding: 2px 4px;
}
.cal-num {
  font-family: var(--f-display);
  font-size: 13px;
  color: var(--ivory);
  margin-bottom: 2px;
  letter-spacing: 0.04em;
}
.cal-event {
  font-size: 9px;
  padding: 1px 4px;
  margin-bottom: 1px;
  border-radius: 3px;
  background: rgba(91,123,196,0.18);
  border-left: 2px solid var(--crystal);
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  max-width: 100%;
  line-height: 1.3;
}
.cal-event.crimson { background: rgba(196,30,58,0.18); border-left-color: var(--crimson); }
.cal-event.gold { background: rgba(245,197,24,0.16); border-left-color: var(--gold); color: var(--gold-hi); }

/* Week view */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  min-height: 500px;
}
.week-col {
  background: rgba(7,12,28,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.week-col.saturday { background: rgba(91,123,196,0.10); }
.week-col.sunday { background: rgba(196,30,58,0.10); }
.week-col.holiday { background: rgba(196,30,58,0.14); }
.week-col.today { background: rgba(196,30,58,0.22); border: 1px solid var(--crimson); }
.week-col-head {
  padding: 10px 8px;
  border-bottom: 1px solid var(--hairline);
  text-align: center;
  background: rgba(11,19,48,0.6);
}
.week-col-day {
  font-family: var(--f-title);
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 600;
  margin-bottom: 4px;
}
.week-col-num {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--ivory);
  letter-spacing: 0.02em;
  line-height: 1;
}
.week-col-holiday {
  font-size: 9px;
  color: var(--crimson-hi);
  font-family: var(--f-title);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.week-col-body {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
}
.week-event {
  padding: 6px 8px;
  background: rgba(91,123,196,0.10);
  border-left: 3px solid var(--crystal);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: all 0.15s;
}
.week-event:hover { background: rgba(91,123,196,0.18); }
.week-event.crimson { background: rgba(196,30,58,0.14); border-left-color: var(--crimson); }
.week-event.gold { background: rgba(245,197,24,0.12); border-left-color: var(--gold); }
.week-event-time {
  font-family: var(--f-mono); font-size: 10px;
  color: var(--gold); letter-spacing: 0.04em;
}
.week-event-title { font-size: 12px; color: var(--ivory); margin-top: 2px; font-weight: 500; line-height: 1.3; }
.week-event-sub { font-size: 10px; color: var(--ash); margin-top: 3px; }
.week-add {
  background: transparent;
  border: 1px dashed var(--hairline);
  border-radius: 4px;
  color: var(--smoke);
  padding: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  margin-top: auto;
  transition: all 0.15s;
}
.week-add:hover { border-color: var(--gold); color: var(--gold); }

/* Agenda groups */
.agenda-group { margin-bottom: 18px; }
.agenda-date {
  font-family: var(--f-display);
  font-size: 16px;
  letter-spacing: 0.06em;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

/* Date badge in modal */
.date-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(91,123,196,0.10);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--f-mono);
  font-size: 13px;
  white-space: nowrap;
  min-width: 80px;
  justify-content: center;
}

/* Hide spinner on date / time inputs */
.form-input[type="date"], .form-input[type="time"] {
  color-scheme: dark;
  font-family: var(--f-mono);
}
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.8) saturate(3) hue-rotate(0deg);
  cursor: pointer;
}

/* ============================================================
   MEMOS / NOTES library
   ============================================================ */
.memo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.memo-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(17,29,68,0.55), rgba(11,19,48,0.4));
  border: 1px solid var(--hairline);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  height: 200px;
  display: flex;
  flex-direction: column;
}
.memo-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
}
.memo-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.memo-title { font-family: var(--f-display); font-size: 14px; letter-spacing: 0.06em; color: var(--ivory); line-height: 1.3; flex: 1; }
.memo-body { font-size: 11px; color: var(--ash); line-height: 1.5; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.memo-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.memo-date { font-family: var(--f-mono); font-size: 10px; color: var(--smoke); letter-spacing: 0.08em; }
.memo-type-icon {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: rgba(245,197,24,0.10);
  display: grid; place-items: center;
  color: var(--gold);
  flex-shrink: 0;
}
.memo-type-icon.rec { background: rgba(196,30,58,0.12); color: var(--crimson-hi); }
.memo-type-icon.idea { background: rgba(91,123,196,0.14); color: var(--crystal); }

/* ============================================================
   KPI page
   ============================================================ */
.funnel-stage {
  display: grid;
  grid-template-columns: 160px 1fr 80px 80px;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background: rgba(11,19,48,0.4);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  margin-bottom: 10px;
}
.funnel-stage-label { font-family: var(--f-title); font-size: 12px; letter-spacing: 0.16em; color: var(--ivory); font-weight: 600; }
.funnel-bar-wrap { position: relative; height: 32px; background: rgba(0,0,0,0.4); border-radius: 4px; overflow: hidden; }
.funnel-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--gold) 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--ivory);
  letter-spacing: 0.04em;
  position: relative;
}
.funnel-rate { font-family: var(--f-mono); font-size: 13px; color: var(--gold); text-align: right; font-weight: 600; }
.funnel-target { font-family: var(--f-mono); font-size: 11px; color: var(--smoke); text-align: right; }

/* Applicants funnel (analytics tab) — stage-aligned with the board */
.funnel-row { margin-bottom: 14px; }
.funnel-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 6px;
}
.funnel-row-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-title); font-size: 12px; letter-spacing: 0.1em;
  color: var(--ivory); font-weight: 600; text-transform: uppercase;
}
.funnel-row-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.funnel-row-nums { display: flex; align-items: baseline; gap: 12px; flex-shrink: 0; }
.funnel-row-conv {
  font-family: var(--f-mono); font-size: 11px; color: var(--smoke);
  letter-spacing: 0.04em;
}
.funnel-row-conv::before { content: "▸ "; color: var(--ash); }
.funnel-row-count { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.funnel-row-here { font-family: var(--f-mono); font-size: 11px; color: var(--ash); }
.funnel-track {
  height: 22px; background: rgba(0,0,0,0.4);
  border-radius: 3px; overflow: hidden;
}
.funnel-fill {
  height: 100%; opacity: 0.85;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ============================================================
   CONTACTS
   ============================================================ */
.contact-row {
  display: grid;
  grid-template-columns: 44px 2fr 1.5fr 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: rgba(11,19,48,0.4);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.15s;
  cursor: pointer;
}
.contact-row:hover { border-color: var(--border-hi); }
.contact-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--steel), var(--midnight));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 0.04em;
  overflow: hidden;
}
.contact-avatar-img {
  background: #000;
  padding: 0;
  cursor: zoom-in;
}
.contact-avatar-img:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245,197,24,0.2);
}
.contact-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.contact-name { font-size: 13px; font-weight: 600; color: var(--ivory); }
.contact-role { font-size: 11px; color: var(--ash); margin-top: 2px; }
.contact-cell { font-size: 12px; color: var(--ivory); }
.contact-cell-sub { font-size: 10px; color: var(--smoke); margin-top: 2px; font-family: var(--f-mono); letter-spacing: 0.04em;}

/* ============================================================
   LEARNING
   ============================================================ */
.book-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 16px;
  background: rgba(11,19,48,0.4);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  transition: all 0.15s;
}
.book-card:hover { border-color: var(--border-hi); }
.book-cover {
  width: 80px; height: 110px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--steel), var(--midnight));
  border: 1px solid var(--border-hi);
  display: grid; place-items: center;
  padding: 10px;
  text-align: center;
  font-family: var(--f-title);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.book-title { font-family: var(--f-display); font-size: 16px; color: var(--ivory); letter-spacing: 0.04em; line-height: 1.2; }
.book-author { font-size: 11px; color: var(--gold); margin-top: 4px; font-family: var(--f-title); letter-spacing: 0.18em; text-transform: uppercase; }
.book-summary { font-size: 12px; color: var(--ash); margin-top: 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11px; color: var(--smoke); font-family: var(--f-mono); letter-spacing: 0.04em; }
.book-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(0,0,0,0.4);
  border-radius: 2px;
  overflow: hidden;
}
.book-progress-fill { height: 100%; background: var(--gold); border-radius: 2px; }

/* ============================================================
   REVIEW (weekly)
   ============================================================ */
.review-hero {
  padding: 40px 44px;
  background:
    radial-gradient(ellipse 700px 300px at 90% 50%, rgba(245,197,24,0.12), transparent 70%),
    linear-gradient(135deg, rgba(17,29,68,0.6) 0%, rgba(11,19,48,0.85) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-cinematic);
  position: relative;
  overflow: hidden;
}
.review-hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--crimson) 50%, transparent);
}

/* ============================================================
   SEARCH overlay
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(3,6,15,0.85);
  backdrop-filter: blur(16px);
  z-index: 80;
  display: flex;
  justify-content: center;
  padding-top: 100px;
  animation: fade-in 0.2s ease;
}
.search-modal {
  width: 100%;
  max-width: 720px;
  height: fit-content;
  max-height: 70vh;
  background: linear-gradient(180deg, var(--night), var(--space));
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  box-shadow: var(--shadow-cinematic);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
}
.search-input-wrap input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--f-body); font-size: 18px; color: var(--ivory);
}
.search-input-wrap input::placeholder { color: var(--smoke); }
.search-results { flex: 1; overflow-y: auto; padding: 8px; }
.search-result {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
}
.search-result:hover, .search-result.active { background: rgba(91,123,196,0.10); }
.search-result-icon {
  width: 36px; height: 36px;
  border-radius: 4px;
  background: rgba(91,123,196,0.10);
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  color: var(--gold);
}
.search-result-title { font-size: 14px; color: var(--ivory); font-weight: 500; }
.search-result-sub { font-size: 11px; color: var(--ash); margin-top: 2px; }
.search-result-type { font-family: var(--f-mono); font-size: 10px; color: var(--smoke); letter-spacing: 0.12em; text-transform: uppercase; }

/* AI sparring */
.sparring-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  height: calc(100vh - 200px);
}
.spar-side {
  background: rgba(11,19,48,0.4);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.spar-conv {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.spar-conv:hover { background: rgba(91,123,196,0.08); }
.spar-conv.active { border-left-color: var(--crimson); background: rgba(196,30,58,0.06); }
.spar-conv-body { flex: 1; min-width: 0; }
.spar-conv-title { font-size: 12px; color: var(--ivory); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spar-conv-date { font-size: 10px; color: var(--smoke); margin-top: 3px; font-family: var(--f-mono); letter-spacing: 0.04em; }
.spar-conv-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--smoke);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.spar-conv:hover .spar-conv-del { opacity: 1; }
.spar-conv-del:hover {
  color: var(--crimson);
  border-color: rgba(196,30,58,0.4);
  background: rgba(196,30,58,0.08);
}

.spar-main {
  display: flex;
  flex-direction: column;
  background: rgba(11,19,48,0.4);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}

/* Per-session AI settings header */
.spar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(11,19,48,0.5);
  flex-shrink: 0;
}
.spar-header-title { min-width: 0; flex: 1; }
.spar-header-name {
  font-size: 13px;
  color: var(--ivory);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spar-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  color: var(--smoke);
  text-transform: uppercase;
}
.spar-header-dot { color: rgba(178,184,209,0.3); }
.spar-ov-badge {
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(245,197,24,0.12);
  color: var(--gold);
  border: 1px solid rgba(245,197,24,0.3);
  font-size: 9px;
}
.spar-ov-badge.muted {
  background: transparent;
  color: var(--smoke);
  border-color: var(--hairline);
}
.spar-settings-wrap { position: relative; flex-shrink: 0; }
.spar-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--ivory);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
  position: relative;
}
.spar-settings-btn:hover {
  border-color: rgba(245,197,24,0.4);
  background: rgba(245,197,24,0.06);
  color: var(--gold);
}
.spar-settings-btn.has-ov {
  border-color: rgba(245,197,24,0.4);
  color: var(--gold);
}
.spar-settings-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(245,197,24,0.6);
}
.spar-settings-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--obsidian, #0b1330);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  padding: 14px;
  z-index: 20;
}
.spar-settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}
.spar-settings-title {
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}
.spar-settings-hint {
  font-size: 10px;
  color: var(--smoke);
  margin-top: 4px;
  line-height: 1.4;
}
.spar-settings-reset {
  background: transparent;
  border: none;
  color: var(--crimson);
  font-size: 10px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.spar-settings-reset:hover { background: rgba(196,30,58,0.08); }
.spar-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.spar-settings-row:last-child { margin-bottom: 0; }
.spar-settings-label {
  width: 64px;
  font-size: 10px;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--smoke);
  flex-shrink: 0;
}
.spar-settings-select {
  flex: 1;
  background: rgba(11,19,48,0.6);
  border: 1px solid var(--hairline);
  color: var(--ivory);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
}
.spar-settings-select:focus { border-color: var(--gold); }
.spar-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.spar-msg { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.spar-msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 11px;
  flex-shrink: 0;
}
.spar-msg-avatar.you { background: linear-gradient(135deg, var(--crimson), var(--crimson-lo)); color: var(--ivory); }
.spar-msg-avatar.ai {
  background: linear-gradient(135deg, var(--gold), var(--gold-lo));
  color: var(--void);
}
.spar-msg-name {
  font-family: var(--f-title); font-size: 10px; letter-spacing: 0.24em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 6px; font-weight: 600;
}
.spar-msg-body { font-size: 14px; line-height: 1.65; color: var(--ivory); white-space: pre-wrap;}
.spar-msg.ai .spar-msg-name { color: var(--crystal); }
.spar-input {
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
}
.spar-input textarea {
  flex: 1;
  resize: none;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--ivory);
  font: inherit;
  font-size: 14px;
  outline: none;
  min-height: 44px;
  max-height: 120px;
}
.spar-input textarea:focus { border-color: var(--gold); }

.spar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 60px 40px;
  text-align: center;
}
.spar-empty h3 {
  font-family: var(--f-display);
  font-size: 28px;
  letter-spacing: 0.10em;
  color: var(--ivory);
  margin: 18px 0 12px;
}
.spar-empty p { font-size: 13px; color: var(--ash); max-width: 420px; line-height: 1.6; }
.spar-prompts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 28px;
  width: 100%;
  max-width: 560px;
}
.spar-prompt {
  padding: 14px 16px;
  background: rgba(91,123,196,0.06);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--ivory);
  transition: all 0.15s;
}
.spar-prompt:hover { border-color: var(--gold); background: rgba(245,197,24,0.04); }
.spar-prompt-label {
  display: block;
  font-family: var(--f-title); font-size: 9px;
  letter-spacing: 0.24em; color: var(--gold);
  margin-bottom: 6px;
}

/* Misc helpers */
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.muted { color: var(--ash); }
.gold-text { color: var(--gold); }
.crimson-text { color: var(--crimson-hi); }
.center-y { display: flex; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }

hr.divider {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 22px 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ash);
}
.empty-state h4 {
  font-family: var(--f-display); font-size: 18px;
  color: var(--ivory); letter-spacing: 0.10em;
  margin-bottom: 8px;
}

/* Slight animation on view change */
.view-fade {
  animation: view-fade 0.3s ease both;
}
@keyframes view-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Title-card cinematic overlay used on view change */
.title-card-overlay {
  position: fixed; top: var(--topbar); left: var(--rail); right: 0; bottom: 0;
  display: grid; place-items: center;
  pointer-events: none;
  z-index: 5;
}
.title-card {
  font-family: var(--f-display);
  font-size: 110px;
  letter-spacing: 0.10em;
  color: rgba(91,123,196,0.10);
  text-align: center;
  user-select: none;
}

/* Tweaks panel customization */
.tweaks-panel .tw-section-title { color: var(--gold) !important; }


/* ============================================================
   Screenshots library
   ============================================================ */
.ss-dropzone {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(91,123,196,0.06), rgba(91,123,196,0.02));
  border: 1.5px dashed var(--border-hi);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  position: relative;
  overflow: hidden;
}
.ss-dropzone:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(245,197,24,0.06), rgba(245,197,24,0.02));
}
.ss-dropzone.over {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(245,197,24,0.12), rgba(245,197,24,0.04));
  transform: scale(1.005);
}
.ss-dropzone.busy {
  cursor: progress;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(245,197,24,0.08), rgba(245,197,24,0.02));
}
.ss-dropzone > div:not(.ss-spinner) {
  flex: 1;
}

.ss-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(245,197,24,0.18);
  border-top-color: var(--gold);
  animation: ss-spin 0.9s linear infinite;
  flex-shrink: 0;
}
@keyframes ss-spin {
  to { transform: rotate(360deg); }
}

.ss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.ss-card {
  background: linear-gradient(180deg, var(--night), var(--space));
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.ss-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(245,197,24,0.12) inset;
}
.ss-card.analyzing {
  border-color: rgba(245,197,24,0.32);
}

.ss-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #04060d;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}
.ss-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.ss-analyzing-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3,6,15,0.75);
  backdrop-filter: blur(4px);
}
.ss-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: rgba(3,6,15,0.7);
  border: 1px solid var(--border-hi);
  color: var(--ash);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.ss-card:hover .ss-delete { opacity: 1; }
.ss-delete:hover { background: var(--crimson); color: var(--ivory); border-color: var(--crimson); }

.ss-meta {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ss-title {
  font-family: var(--f-title);
  font-size: 14px;
  color: var(--ivory);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-date {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--smoke);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.ss-tag-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Detail overlay */
.ss-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  gap: 0;
  min-height: 460px;
}
.ss-detail-image {
  background: #02040a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-right: 1px solid var(--hairline);
  max-height: 70vh;
  overflow: auto;
}
.ss-detail-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
}
.ss-detail-side {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  max-height: 78vh;
}
.ss-detail-side > .ss-side-section:first-child {
  flex: 1 1 auto;
  min-height: 0;
}
.ss-side-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ss-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ss-memo-area {
  width: 100%;
  flex: 1 1 auto;
  min-height: 320px;
  background: rgba(91,123,196,0.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--ivory);
  font-family: var(--f-body);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  letter-spacing: 0.01em;
}
.ss-memo-area:focus {
  border-color: var(--gold);
  background: rgba(91,123,196,0.10);
}

@media (max-width: 900px) {
  .ss-detail-grid { grid-template-columns: 1fr; }
  .ss-detail-image { border-right: none; border-bottom: 1px solid var(--hairline); max-height: 50vh; }
}

/* Clickable image in detail panel */
.ss-detail-zoom-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}
.ss-detail-zoom-btn img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
}
.ss-zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(8,12,28,0.78);
  border: 1px solid var(--border-hi);
  backdrop-filter: blur(6px);
  color: var(--gold);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.ss-detail-zoom-btn:hover .ss-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

/* ── Fullscreen lightbox ── */
.ss-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(2,4,10,0.94);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  animation: ssLightFade 0.16s ease;
}
@keyframes ssLightFade { from { opacity: 0; } to { opacity: 1; } }
.ss-lightbox-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(8,12,28,0.55);
  flex-shrink: 0;
}
.ss-lightbox-bar .icon-btn { color: var(--ivory); }
.ss-zoom-pct {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ivory);
  min-width: 52px;
  text-align: center;
}
.ss-lightbox-canvas {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ss-lightbox-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  will-change: transform;
}
.ss-lightbox-canvas.zoomed img { cursor: grab; }
.ss-lightbox-canvas.zoomed.dragging img { cursor: grabbing; transition: none; }
.ss-lightbox-help {
  flex-shrink: 0;
  text-align: center;
  padding: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--smoke);
}

/* ============================================================
   Camera capture modal
   ============================================================ */
.cam-stage {
  max-width: 1100px;
}
.cam-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 68vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cam-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.cam-video.mirror {
  transform: scaleX(-1);
}
.cam-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.cam-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3,6,15,0.7);
  backdrop-filter: blur(4px);
}
.cam-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3,6,15,0.92);
  padding: 32px;
}
.cam-reticle {
  position: absolute;
  inset: 6%;
  pointer-events: none;
}
.cam-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--gold);
  opacity: 0.85;
}
.cam-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.cam-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.cam-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.cam-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.cam-device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--hairline);
  background: rgba(91,123,196,0.04);
}
.cam-device-select {
  flex: 1;
  background: rgba(91,123,196,0.08);
  border: 1px solid var(--border-hi);
  color: var(--ivory);
  padding: 7px 10px;
  border-radius: 5px;
  font-family: var(--f-body);
  font-size: 12px;
  outline: none;
}
.cam-device-select:focus {
  border-color: var(--gold);
}

.cam-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cam-shutter {
  position: relative;
  padding-left: 14px !important;
}
.cam-shutter-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ivory);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18), inset 0 0 0 2px var(--gold);
  margin-right: 2px;
}
.cam-shutter:disabled .cam-shutter-dot {
  opacity: 0.5;
}

@media (max-width: 720px) {
  .cam-viewport { aspect-ratio: 3 / 4; max-height: 60vh; }
  .cam-foot { flex-wrap: wrap; }
}

/* ── Auth gate (production login — not in the original prototype) ─────────────── */
.auth-gate {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, var(--space), var(--void) 70%);
  overflow: hidden;
}
.auth-card {
  position: relative; z-index: 2;
  width: min(380px, 88vw);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px 34px 30px;
  background: linear-gradient(180deg, rgba(11,19,48,0.92), rgba(7,12,28,0.92));
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-shadow: var(--shadow-cinematic);
  backdrop-filter: blur(6px);
}
.auth-shield { line-height: 0; filter: drop-shadow(0 4px 18px rgba(196,30,58,0.45)); }
.auth-title {
  font-family: var(--f-display); font-size: 34px; letter-spacing: 0.14em;
  color: var(--ivory); margin-top: 4px;
}
.auth-sub {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.32em;
  color: var(--gold); margin-top: -6px; margin-bottom: 6px;
}
.auth-checking { font-size: 12px; color: var(--ash); padding: 10px 0; }
.auth-input {
  width: 100%; padding: 12px 14px; box-sizing: border-box;
  background: rgba(3,6,15,0.7); border: 1px solid var(--border-hi); border-radius: 7px;
  color: var(--ivory); font-family: var(--f-body); font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.auth-err {
  width: 100%; box-sizing: border-box; font-size: 12px; color: var(--crimson-hi);
  background: rgba(196,30,58,0.08); border: 1px solid rgba(196,30,58,0.28);
  border-radius: 6px; padding: 8px 10px; text-align: center;
}
.auth-btn {
  width: 100%; padding: 12px; cursor: pointer;
  background: linear-gradient(180deg, var(--crimson-hi), var(--crimson-lo));
  border: 1px solid var(--crimson-hi); border-radius: 7px;
  color: #fff; font-family: var(--f-body); font-weight: 700; font-size: 14px;
  letter-spacing: 0.06em; transition: filter 0.15s, transform 0.05s;
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.12); }
.auth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-note {
  font-size: 10px; color: var(--smoke); line-height: 1.5; text-align: center;
  margin-top: 4px; max-width: 280px;
}

/* ── Accessibility (STEP 5 review fixes) ─────────────────────────────────────── */
/* Nav items are <button> now — neutralize UA button chrome, keep the design. */
.nav-item { appearance: none; -webkit-appearance: none; background: none; border: 0; width: 100%; text-align: left; font-family: inherit; }

/* Promote the .auth-input gold focus ring site-wide (keyboard visibility). */
.nav-item:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.record-button:focus-visible,
.chip:focus-visible,
.chip-btn:focus-visible,
.avatar:focus-visible,
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

/* Contrast: lift muted BODY text to >=4.5:1 (was --smoke #6B6A60 = 3.19:1 → --ash 7.63:1). */
.ws-table-notes, .contact-cell-sub, .book-progress, .funnel-target, .user-role, .memo-date {
  color: var(--ash);
}
/* Error text legibility (crimson-hi alone ~3.94:1). */
.auth-err, .form-error { color: #FF6B82; }

/* ── Applicant AI import modal ───────────────────────────────────────────────── */
.ai-import-card {
  width: min(640px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--night), var(--space));
  border: 1px solid var(--border-hi); border-radius: 14px;
  box-shadow: var(--shadow-cinematic); overflow: hidden;
}
.ai-import-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--hairline); }
.ai-import-head h3 { margin: 2px 0 0; font-family: var(--f-title); font-size: 19px; color: var(--ivory); }
.ai-import-body { padding: 18px 20px; overflow-y: auto; }
.ai-import-hint { font-size: 12.5px; line-height: 1.6; color: var(--ash); margin: 0 0 12px; }
.ai-import-text {
  width: 100%; box-sizing: border-box; min-height: 180px; resize: vertical;
  background: rgba(3,6,15,0.6); border: 1px solid var(--border-hi); border-radius: 8px;
  color: var(--ivory); font-family: var(--f-body); font-size: 13px; line-height: 1.6; padding: 12px 14px; outline: none;
}
.ai-import-text:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.ai-import-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ai-import-file-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ivory);
  background: rgba(91,123,196,0.10); border: 1px solid var(--border-hi); border-radius: 999px; padding: 4px 8px 4px 10px;
}
.ai-import-file-chip button { background: none; border: none; color: var(--ash); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.ai-import-file-chip button:hover { color: var(--crimson-hi); }
.ai-import-results { display: flex; flex-direction: column; gap: 8px; }
.ai-import-result {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer;
  background: rgba(3,6,15,0.4); border: 1px solid var(--border); border-radius: 9px; transition: border-color .15s, background .15s;
}
.ai-import-result.picked { border-color: var(--gold); background: rgba(245,197,24,0.06); }
.ai-import-result input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); flex: none; }
.ai-import-avatar { flex: none; width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #1a2030; }
.ai-import-result-main { min-width: 0; flex: 1; }
.ai-import-result-name { font-size: 13.5px; font-weight: 600; color: var(--ivory); }
.ai-import-result-name span { font-size: 11px; font-weight: 500; color: var(--gold); margin-left: 8px; }
.ai-import-result-sub { font-size: 11.5px; color: var(--ash); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-import-result-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.ai-import-result-tags span { font-size: 10px; color: var(--crystal); background: rgba(91,123,196,0.12); border-radius: 4px; padding: 1px 6px; }
.ai-import-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--hairline); }
