:root {
  color-scheme: dark;
  --bg: #07162f;
  --bg-elevated: #0c254c;
  --surface: #102f5d;
  --surface-strong: #174378;
  --surface-muted: rgba(16, 47, 93, 0.9);
  --surface-glass: rgba(11, 37, 76, 0.95);
  --text: #fff9df;
  --text-soft: #d5e8ff;
  --text-faint: #9ab8d9;
  --accent: #ffd43b;
  --accent-strong: #ffb703;
  --accent-soft: rgba(255, 212, 59, 0.16);
  --blue: #65b8ff;
  --green: #59e391;
  --amber: #ffd43b;
  --red: #ff7b7b;
  --violet: #b99cff;
  --line: rgba(224, 241, 255, 0.25);
  --line-strong: rgba(255, 212, 59, 0.66);
  --shadow: 0 7px 0 #06172c, 0 18px 38px rgba(0, 0, 0, 0.32);
  --focus: 0 0 0 4px rgba(255, 212, 59, 0.4);
  --game-surface: #102f5d;
  --game-surface-raised: #174378;
  --game-border: #06172c;
  --game-accent: #ffd43b;
  --game-glow: rgba(255, 212, 59, 0.32);
  --game-radius: 10px;
  --game-control-height: 3rem;
  --game-motion-duration: 160ms;
  --game-sky-top: #06162f;
  --game-sky-bottom: #123f73;
  --game-cloud: rgba(255, 255, 255, 0.11);
  --game-grass: #30c96b;
  --game-red: #ff4f4f;
  --game-blue: #3ca7ff;
  --game-yellow: #ffcf33;
  --game-green: #45d47a;
  --game-orange: #ff8a3d;
  --mobile-nav-height: 5.75rem;
  --sidebar-width: 17.5rem;
  --topbar-height: 5.625rem;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  /*
   * Readable type ramp: auxiliary text grows about two steps, body/control
   * text about three, and headings/actions about four from the original UI.
   * The 0.75rem floor keeps every deliberately small label at 12px when the
   * browser uses its standard 16px root size, while still honoring zoom and
   * the user's font-size preference.
   */
  --font-size-min: 0.75rem;
  --font-size-aux: 0.8125rem;
  --font-size-support: 0.875rem;
  --font-size-label: 0.9375rem;
  --font-size-content: 1rem;
  --font-size-body: 1.125rem;
  --font-size-action: 1.1875rem;
  --font-size-title-sm: 1.3125rem;
  --font-size-title-md: 1.375rem;
  --font-size-top-title: clamp(1.3125rem, 1.7vw, 1.625rem);
  --font-size-icon: 1.375rem;
  --font-size-metric: 2.0625rem;
  --font-size-page-title: clamp(1.75rem, 3vw, 2.5rem);
  --font-size-work-title: clamp(1.625rem, 3vw, 2.25rem);
  --font-size-auth-title: clamp(2.0625rem, 4vw, 2.875rem);
  --font-size-display: clamp(2.3125rem, 5vw, 4.25rem);
  --game-display-font: "Arial Rounded MT Bold", "Trebuchet MS", "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, sans-serif;
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #dff5ff;
  --bg-elevated: #bcecff;
  --surface: #fffdf2;
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 253, 242, 0.94);
  --surface-glass: rgba(255, 253, 242, 0.96);
  --text: #102548;
  --text-soft: #365a7b;
  --text-faint: #576f88;
  --accent: #0068c9;
  --accent-strong: #0056a8;
  --accent-soft: rgba(0, 104, 201, 0.12);
  --blue: #0068c9;
  --green: #08783d;
  --amber: #795000;
  --red: #b92835;
  --violet: #5f3ab4;
  --line: rgba(16, 37, 72, 0.24);
  --line-strong: rgba(16, 37, 72, 0.62);
  --shadow: 0 7px 0 #102548, 0 18px 32px rgba(19, 80, 122, 0.18);
  --focus: 0 0 0 4px rgba(0, 104, 201, 0.25);
  --game-surface: #fffdf2;
  --game-surface-raised: #ffffff;
  --game-border: #102548;
  --game-accent: #ffd43b;
  --game-glow: rgba(255, 183, 3, 0.3);
  --game-sky-top: #76d3ff;
  --game-sky-bottom: #dff7ff;
  --game-cloud: rgba(255, 255, 255, 0.78);
  --game-grass: #45d86f;
}

html[data-font-size="small"] {
  --game-control-height: 2.75rem;
  --mobile-nav-height: 5.25rem;
  --sidebar-width: 16.25rem;
  --topbar-height: 5.125rem;
  --font-size-min: 0.75rem;
  --font-size-aux: 0.75rem;
  --font-size-support: 0.8125rem;
  --font-size-label: 0.875rem;
  --font-size-content: 0.9375rem;
  --font-size-body: 1rem;
  --font-size-action: 1.0625rem;
  --font-size-title-sm: 1.1875rem;
  --font-size-title-md: 1.25rem;
  --font-size-top-title: clamp(1.1875rem, 1.7vw, 1.5rem);
  --font-size-icon: 1.25rem;
  --font-size-metric: 1.875rem;
  --font-size-page-title: clamp(1.5rem, 3vw, 2.25rem);
  --font-size-work-title: clamp(1.375rem, 3vw, 2rem);
  --font-size-auth-title: clamp(1.8125rem, 4vw, 2.625rem);
  --font-size-display: clamp(2.0625rem, 5vw, 4rem);
}

html[data-font-size="medium"] {
  --game-control-height: 3rem;
  --mobile-nav-height: 5.75rem;
  --sidebar-width: 17.5rem;
  --topbar-height: 5.625rem;
  --font-size-min: 0.75rem;
  --font-size-aux: 0.8125rem;
  --font-size-support: 0.875rem;
  --font-size-label: 0.9375rem;
  --font-size-content: 1rem;
  --font-size-body: 1.125rem;
  --font-size-action: 1.1875rem;
  --font-size-title-sm: 1.3125rem;
  --font-size-title-md: 1.375rem;
  --font-size-top-title: clamp(1.3125rem, 1.7vw, 1.625rem);
  --font-size-icon: 1.375rem;
  --font-size-metric: 2.0625rem;
  --font-size-page-title: clamp(1.75rem, 3vw, 2.5rem);
  --font-size-work-title: clamp(1.625rem, 3vw, 2.25rem);
  --font-size-auth-title: clamp(2.0625rem, 4vw, 2.875rem);
  --font-size-display: clamp(2.3125rem, 5vw, 4.25rem);
}

html[data-font-size="large"] {
  --game-control-height: 3.25rem;
  --mobile-nav-height: 6.125rem;
  --sidebar-width: 18.75rem;
  --topbar-height: 6rem;
  --font-size-min: 0.875rem;
  --font-size-aux: 0.9375rem;
  --font-size-support: 1rem;
  --font-size-label: 1.0625rem;
  --font-size-content: 1.125rem;
  --font-size-body: 1.25rem;
  --font-size-action: 1.3125rem;
  --font-size-title-sm: 1.4375rem;
  --font-size-title-md: 1.5rem;
  --font-size-top-title: clamp(1.4375rem, 1.7vw, 1.75rem);
  --font-size-icon: 1.5rem;
  --font-size-metric: 2.25rem;
  --font-size-page-title: clamp(1.875rem, 3vw, 2.75rem);
  --font-size-work-title: clamp(1.75rem, 3vw, 2.5rem);
  --font-size-auth-title: clamp(2.1875rem, 4vw, 3.125rem);
  --font-size-display: clamp(2.5rem, 5vw, 4.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 12% 9%, var(--game-cloud) 0 3.1rem, transparent 3.2rem),
    radial-gradient(ellipse at 82% 16%, var(--game-cloud) 0 4rem, transparent 4.1rem),
    linear-gradient(180deg, var(--game-sky-top), var(--game-sky-bottom) 72%, var(--bg));
  background-attachment: fixed;
  font-size: var(--font-size-body);
  line-height: 1.6;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); }
::selection { color: var(--bg); background: var(--accent); }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 17px 20px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(87, 232, 255, 0.035), transparent 30%),
    var(--surface-glass);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 12px;
  padding: 3px 9px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand__mark {
  position: relative;
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 20px rgba(87, 232, 255, 0.06);
  transform: rotate(45deg);
}
.brand__mark i { position: absolute; display: block; width: 18px; height: 2px; background: var(--accent); }
.brand__mark i:nth-child(2) { width: 12px; transform: translateY(-6px); }
.brand__mark i:nth-child(3) { width: 12px; transform: translateY(6px); }
.brand__copy { display: flex; flex-direction: column; line-height: 1.15; letter-spacing: 0.1em; }
.brand__copy strong { font-size: 15px; }
.brand__copy small { margin-top: 5px; color: var(--text-faint); font-size: 9px; letter-spacing: 0.24em; }

.side-nav { margin-top: 32px; }
.side-nav__label {
  margin: 24px 11px 8px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.side-nav__link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 9px 12px;
  color: var(--text-soft);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: 160ms ease;
}
.side-nav__link:hover { color: var(--text); background: var(--accent-soft); }
.side-nav__link.is-active {
  color: var(--accent);
  border-color: var(--line-strong);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}
.side-nav__link.is-active::before {
  position: absolute;
  inset: 10px auto 10px -18px;
  width: 3px;
  content: "";
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 18px var(--accent);
}
.nav-icon { display: grid; width: 22px; height: 22px; place-items: center; color: currentColor; font-size: 18px; }
.nav-count, .icon-button__badge {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  margin-left: auto;
  padding: 0 5px;
  color: #061019;
  background: var(--accent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.sidebar__footer { margin-top: auto; padding: 24px 8px 0; color: var(--text-faint); }
.sidebar__footer small { display: block; margin-top: 10px; font-size: 10px; letter-spacing: 0.1em; }
.environment-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 12px;
}
.environment-chip span { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px var(--green); }

.mobile-bottom-nav {
  display: none;
  color: var(--text);
  background: var(--game-surface);
}

.app-workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(22px);
}
.topbar__leading, .topbar__actions { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: clamp(17px, 1.7vw, 22px); font-weight: 650; line-height: 1.2; }
.eyebrow { margin: 0 0 4px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
.mobile-only { display: none !important; }

.top-search {
  display: flex;
  width: min(27vw, 330px);
  min-width: 230px;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}
.top-search:focus-within { border-color: var(--line-strong); box-shadow: var(--focus); }
.top-search input { min-width: 0; flex: 1; color: var(--text); background: transparent; border: 0; outline: 0; }
.top-search input::placeholder { color: var(--text-faint); }
.top-search kbd { padding: 1px 6px; color: var(--text-faint); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; }
.font-size-control {
  display: inline-flex;
  min-height: var(--game-control-height);
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.55rem;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: var(--font-size-support);
  font-weight: 800;
  white-space: nowrap;
}
.font-size-control:focus-within { border-color: var(--line-strong); box-shadow: var(--focus); }
.font-size-control select {
  min-width: 2.75rem;
  padding: 0.25rem 1.15rem 0.25rem 0.35rem;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  cursor: pointer;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.icon-button:hover { color: var(--accent); border-color: var(--line-strong); }
.icon-button__badge { position: absolute; top: -6px; right: -6px; margin: 0; border: 2px solid var(--bg); }
.notification-menu { position: relative; display: flex; }
.popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 12px);
  right: 0;
  width: min(380px, calc(100vw - 28px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.notification-popover header { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.notification-preview { display: flex; flex-direction: column; gap: 2px; padding: 12px 17px; color: var(--text); border-bottom: 1px solid var(--line); }
.notification-preview:hover { color: var(--text); background: var(--accent-soft); }
.notification-preview span { color: var(--text-soft); font-size: 13px; }
.empty-inline { margin: 0; padding: 18px; color: var(--text-faint); text-align: center; }

.profile-chip { display: flex; align-items: center; gap: 10px; margin-left: 4px; color: var(--text); }
.profile-chip:hover { color: var(--text); }
.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}
.profile-chip__copy { display: flex; flex-direction: column; line-height: 1.3; }
.profile-chip__copy strong { max-width: 120px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip__copy small { color: var(--text-faint); font-size: 10px; }

.page-content { width: 100%; max-width: 1600px; min-height: calc(100vh - 130px); margin: 0 auto; padding: clamp(24px, 3vw, 42px); }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px clamp(20px, 3vw, 42px); color: var(--text-faint); border-top: 1px solid var(--line); font-size: 11px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-header h2 { margin: 0; font-size: clamp(24px, 3vw, 36px); font-weight: 650; letter-spacing: -0.035em; }
.page-header p:not(.eyebrow) { max-width: 720px; margin: 8px 0 0; color: var(--text-soft); }
.page-header__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.page-guide { margin: -8px 0 22px; overflow: hidden; }
.page-guide__summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-soft), transparent 68%);
  cursor: pointer;
  list-style: none;
}
.page-guide__summary::-webkit-details-marker { display: none; }
.page-guide__summary::marker { display: none; content: ""; }
.page-guide__summary:focus-visible { outline: 0; box-shadow: inset var(--focus); }
.page-guide__icon { display: grid; width: 32px; height: 32px; place-items: center; color: var(--accent); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 9px; font-weight: 800; }
.page-guide__heading { display: flex; min-width: 0; flex-direction: column; line-height: 1.35; }
.page-guide__heading strong { font-size: 14px; }
.page-guide__heading small { margin-top: 3px; color: var(--text-soft); font-size: 12px; }
.page-guide__toggle { width: 9px; height: 9px; justify-self: center; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform 160ms ease; }
.page-guide[open] .page-guide__toggle { transform: rotate(225deg); }
.page-guide__body { padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.page-guide__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.page-guide__steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 10px; min-width: 0; padding: 12px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; }
.page-guide__number { display: grid; width: 28px; height: 28px; place-items: center; color: #031117; background: var(--accent); border-radius: 8px; font-size: 12px; font-weight: 800; }
.page-guide__steps strong, .page-guide__steps small { display: block; }
.page-guide__steps strong { color: var(--text); font-size: 13px; }
.page-guide__steps small { margin-top: 3px; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.page-guide__completion { display: flex; align-items: flex-start; gap: 7px; margin: 12px 0 0; padding: 9px 11px; color: var(--text-soft); background: color-mix(in srgb, var(--green) 8%, var(--surface)); border-radius: 8px; font-size: 12px; }
.page-guide__completion > span { color: var(--green); font-weight: 800; }
.page-guide__completion strong { color: var(--text); white-space: nowrap; }
:root[data-theme="light"] .page-guide__summary { background: linear-gradient(90deg, rgba(0, 103, 200, 0.1), rgba(255, 255, 255, 0)); }
:root[data-theme="light"] .page-guide__number { color: #fff; }

.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(87, 232, 255, 0.025), transparent 42%),
    var(--surface-glass);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
}
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-header h3, .card-header h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card-header p { margin: 3px 0 0; color: var(--text-faint); font-size: 12px; }
.card-body { padding: 20px; }
.card-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 128px; padding: 19px; overflow: hidden; }
.stat-card::after { position: absolute; right: -20px; bottom: -35px; width: 110px; height: 110px; content: ""; background: radial-gradient(circle, var(--accent-soft), transparent 68%); }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-soft); font-size: 12px; }
.stat-card__icon { display: grid; width: 31px; height: 31px; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; }
.stat-card strong { display: block; margin-top: 10px; font-size: 29px; font-weight: 650; line-height: 1; }
.stat-card small { display: block; margin-top: 9px; color: var(--text-faint); font-size: 11px; }
.mail-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.mail-status-grid__time { font-size: var(--font-size-title-sm) !important; line-height: 1.25 !important; }
.trend-up { color: var(--green); }
.trend-warn { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { display: flex; min-height: 74px; align-items: center; gap: 11px; padding: 12px; color: var(--text); border: 1px solid var(--line); border-radius: 11px; background: var(--surface-muted); }
.quick-action:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.quick-action span:first-child { display: grid; width: 34px; height: 34px; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action small { display: block; color: var(--text-faint); font-size: 10px; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-weight: 650;
  cursor: pointer;
  transition: 150ms ease;
}
.button:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.button--primary { color: #031117; background: var(--accent); border-color: var(--accent); box-shadow: 0 7px 18px rgba(32, 201, 232, 0.13); }
:root[data-theme="light"] .button--primary { color: #fff; }
.button--primary:hover { color: #031117; background: var(--accent-strong); border-color: var(--accent-strong); }
:root[data-theme="light"] .button--primary:hover { color: #fff; }
.button--danger { color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.button--ghost { background: transparent; }
.button--small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.button[disabled], .icon-button[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.link-button { padding: 0; color: var(--accent); background: none; border: 0; cursor: pointer; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 11px; margin-bottom: 16px; padding: 14px; }
.filter-bar .field { min-width: 150px; flex: 1 1 160px; }
.filter-bar .field--search { flex: 3 1 280px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field label, .field-label { color: var(--text-soft); font-size: 12px; font-weight: 650; }
.field-help { margin: 0; color: var(--text-faint); font-size: 11px; }
.field-optional { color: var(--text-faint); font-weight: 500; }
.required { color: var(--red); }
.input, .select, .textarea,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select, .field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--line-strong); box-shadow: var(--focus); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field select option { color: var(--text); background: var(--surface); }
.validation-summary-errors, .field-validation-error { color: var(--red); font-size: 12px; }
.validation-summary-errors ul { margin: 0; padding-left: 20px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; color: var(--text-soft); font-size: 13px; }
.checkbox-row input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--accent); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 9px; }
.segmented a, .segmented button { padding: 5px 10px; color: var(--text-soft); background: transparent; border: 0; border-radius: 6px; font-size: 12px; cursor: pointer; }
.segmented .is-active { color: var(--text); background: var(--accent-soft); }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 14px; color: var(--text-faint); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; letter-spacing: 0.09em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px; color: var(--text-soft); border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--accent-soft); }
.cell-primary { display: flex; flex-direction: column; gap: 2px; }
.cell-primary strong { color: var(--text); font-size: 13px; }
.cell-primary small { color: var(--text-faint); font-size: 11px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 7px; }

.status-badge, .type-badge, .role-badge, .priority-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  color: var(--text-soft);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge::before, .priority-badge::before { width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.status-badge--new { color: var(--blue); }
.status-badge--triaged { color: var(--violet); }
.status-badge--inprogress, .status-badge--in-progress, .status-badge--progress { color: var(--accent); }
.status-badge--waitingforcustomer, .status-badge--waiting-for-customer, .status-badge--waiting { color: var(--amber); }
.status-badge--blocked, .priority-badge--urgent { color: var(--red); }
.priority-badge--high { color: var(--amber); }
.priority-badge--low { color: var(--green); }
.status-badge--resolved { color: var(--green); }
.status-badge--closed { color: var(--text-faint); }
.type-badge--bug { color: var(--red); }
.type-badge--request { color: var(--blue); }
.type-badge--internal { color: var(--violet); }

.progress-track { width: 100%; height: 5px; overflow: hidden; background: var(--surface-strong); border-radius: 99px; }
.progress-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { position: relative; display: flex; min-height: 220px; flex-direction: column; padding: 20px; color: var(--text); overflow: hidden; }
.project-card:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-2px); }
.project-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.project-code { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; }
.project-card h3 { margin: 10px 0 5px; font-size: 18px; }
.project-card p { margin: 0; color: var(--text-soft); font-size: 12px; }
.project-card__meta { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 22px; color: var(--text-faint); font-size: 11px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 27px; height: 27px; margin-left: -6px; border: 2px solid var(--surface); border-radius: 8px; font-size: 9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.split-workspace { display: grid; grid-template-columns: minmax(320px, 0.8fr) minmax(480px, 1.4fr); min-height: 610px; overflow: hidden; }
.tree-pane { border-right: 1px solid var(--line); }
.detail-pane { min-width: 0; }
.tree-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.work-tree, .tree-branch { margin: 0; padding: 9px; list-style: none; }
.tree-branch { margin-left: 21px; padding: 0 0 0 8px; border-left: 1px dashed var(--line); }
.tree-node__row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 4px; border-radius: 8px; }
.tree-node__row:hover { background: var(--accent-soft); }
.tree-node__toggle { width: 27px; height: 27px; color: var(--text-soft); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.tree-node__toggle[disabled] { color: var(--text-faint); cursor: default; }
.tree-node__link { display: flex; min-width: 0; flex-direction: column; color: var(--text); line-height: 1.3; }
.tree-node__link:hover { color: var(--accent); }
.tree-node__link strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tree-node__key { color: var(--text-faint); font-size: 9px; letter-spacing: 0.04em; }

.work-item-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.work-item-main, .work-item-side { display: grid; gap: 18px; }
.work-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.work-item-heading h2 { margin: 8px 0; font-size: clamp(22px, 3vw, 32px); line-height: 1.25; }
.work-item-key { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.work-item-context { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; margin: 16px 0; }
.work-item-context > div { min-width: 0; padding: 12px; border: 2px solid var(--game-border); border-radius: var(--game-radius); background: var(--surface-muted); box-shadow: 0 3px 0 color-mix(in srgb, var(--game-border) 65%, transparent); }
.work-item-context dt { color: var(--text-faint); font-size: var(--font-size-label); font-weight: 800; }
.work-item-context dd { margin: 6px 0 0; color: var(--text); font-size: var(--font-size-content); font-weight: 700; overflow-wrap: anywhere; }
.work-item-description { color: var(--text-soft); }
.meta-list { margin: 0; }
.meta-list div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meta-list div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--text-faint); font-size: 11px; }
.meta-list dd { margin: 0; color: var(--text); font-size: 12px; text-align: right; }
.work-timer { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.timer-display { font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 650; letter-spacing: 0.04em; }

.comment-list { display: grid; gap: 14px; }
.comment { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 11px; }
.comment__body { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); }
.comment--internal .comment__body { border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: color-mix(in srgb, var(--amber) 6%, var(--surface-muted)); }
.comment__header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment__header strong { font-size: 12px; }
.comment__header time { margin-left: auto; color: var(--text-faint); font-size: 10px; }
.comment__content { color: var(--text-soft); font-size: 13px; }
.comment__content p:first-child { margin-top: 0; }
.comment__content p:last-child { margin-bottom: 0; }
.comment__actions { display: flex; gap: 12px; margin-top: 9px; }
.comment--depth-1 { margin-left: 45px; }
.comment--depth-2 { margin-left: 90px; }

.editor-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.editor-shell:focus-within { border-color: var(--line-strong); box-shadow: var(--focus); }
.ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); }
.ql-container.ql-snow { min-height: 160px; color: var(--text); border: 0; font: inherit; }
.ql-editor.ql-blank::before { color: var(--text-faint); font-style: normal; }
.ql-snow .ql-stroke { stroke: var(--text-soft); }
.ql-snow .ql-fill { fill: var(--text-soft); }
.ql-snow .ql-picker { color: var(--text-soft); }
.ql-snow .ql-picker-options { color: var(--text); background: var(--surface); border-color: var(--line) !important; }
.ql-snow a { color: var(--accent); }
.attachment-drop {
  display: grid;
  min-height: 118px;
  place-items: center;
  padding: 18px;
  color: var(--text-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--accent-soft);
  text-align: center;
  transition: 160ms ease;
}
.attachment-drop.is-dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); transform: scale(1.005); }
.attachment-drop > div { width: 100%; }
.attachment-drop strong { display: block; color: var(--text); }
.attachment-drop p { margin: 3px 0; font-size: 11px; }
.attachment-drop input { max-width: 100%; margin-top: 8px; color: var(--text-soft); font-size: 11px; }
.attachment-drop__lead { font-size: var(--font-size-content); }
.file-list-empty { padding: 10px; color: var(--text-faint); font-size: var(--font-size-support) !important; }
.file-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; width: 100%; margin: 12px 0 0; padding: 0; list-style: none; }
.file-chip { padding: 4px 8px; color: var(--text-soft); background: var(--surface-strong); border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.file-preview-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) 36px; align-items: center; gap: 10px; min-width: 0; padding: 9px; color: var(--text); background: var(--surface-strong); border: 2px solid var(--line); border-radius: 12px; text-align: left; }
.file-preview-card__visual { display: grid; width: 64px; height: 64px; overflow: hidden; place-items: center; color: var(--text); background: var(--accent-soft); border: 2px solid var(--line-strong); border-radius: 9px; font-size: var(--font-size-min); font-weight: 850; }
.file-preview-card__visual img { width: 100%; height: 100%; object-fit: cover; }
.file-preview-card__copy { min-width: 0; }
.file-preview-card__copy strong, .file-preview-card__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-card__copy strong { font-size: var(--font-size-label); }
.file-preview-card__copy small { margin-top: 5px; color: var(--text-soft); font-size: var(--font-size-support); }
.file-preview-card__remove { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; color: var(--text); background: color-mix(in srgb, var(--red) 16%, var(--surface)); border: 2px solid var(--red); border-radius: 50%; font: inherit; font-size: var(--font-size-title-sm); font-weight: 900; cursor: pointer; }
.file-preview-card__remove:hover { color: #fff; background: var(--red); }
.file-preview-card__remove:focus-visible { outline: none; box-shadow: var(--focus); }
.attachment-list { display: grid; gap: 8px; }
.attachment-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.attachment-row__icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 8px; }
.attachment-row strong, .attachment-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row strong { font-size: 11px; }
.attachment-row small { color: var(--text-faint); font-size: 9px; }

.tabs { display: flex; gap: 4px; padding: 4px; overflow-x: auto; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 10px; }
.tabs a, .tabs button { min-height: 34px; padding: 6px 13px; color: var(--text-soft); background: transparent; border: 0; border-radius: 7px; font-size: 12px; white-space: nowrap; cursor: pointer; }
.tabs .is-active { color: var(--text); background: var(--surface); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.09); }
.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; }
.admin-nav { display: grid; gap: 4px; align-content: start; padding: 10px; }
.admin-nav a { padding: 9px 10px; color: var(--text-soft); border-radius: 8px; }
.admin-nav a:hover, .admin-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.group-management-layout { grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.75fr); align-items: start; }
.group-members-card { min-width: 0; }
.group-member-list { display: grid; gap: 14px; }
.group-member-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 15px;
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.group-member-row.is-disabled { opacity: 0.72; background: color-mix(in srgb, var(--game-surface-raised) 72%, var(--surface-muted)); }
.group-member-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--game-border);
  background: var(--game-blue);
  border: 2px solid var(--game-border);
  border-radius: 10px;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.38), 0 3px 0 var(--game-border);
  font-size: 17px;
  font-weight: 900;
}
.group-member-main { min-width: 0; }
.group-member-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.group-member-heading > div { min-width: 0; }
.group-member-heading strong, .group-member-heading span { display: block; }
.group-member-heading strong { overflow-wrap: anywhere; color: var(--text); font-size: 14px; }
.group-member-heading > div > span { margin-top: 3px; overflow-wrap: anywhere; color: var(--text-faint); font-size: 11px; }
.group-member-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  margin-top: 12px;
  padding: 9px 10px;
  background: color-mix(in srgb, var(--game-blue) 12%, var(--game-surface));
  border: 2px solid var(--game-border);
  border-radius: 9px;
  box-shadow: 0 2px 0 var(--game-border);
}
.group-member-identity > span { align-self: center; color: var(--text-soft); font-size: 10px; font-weight: 850; }
.group-member-identity > strong { color: var(--accent); font-size: 13px; }
.group-member-identity > small, .group-member-identity > em { grid-column: 1 / -1; color: var(--text-faint); font-size: 10px; font-style: normal; }
.group-member-identity.has-conflict { background: color-mix(in srgb, var(--game-red) 12%, var(--game-surface)); }
.group-member-identity.has-conflict > em { color: var(--red); font-weight: 800; }
.member-state {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--game-border);
  background: var(--game-green);
  border: 2px solid var(--game-border);
  border-radius: 7px;
  box-shadow: 0 2px 0 var(--game-border);
  font-size: 10px;
  font-weight: 850;
}
.member-state.is-disabled { background: var(--game-orange); }
.group-member-permissions { margin-top: 12px; }
.group-member-permissions__label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 10px; font-weight: 800; letter-spacing: 0.04em; }
.group-permission-list { display: flex; flex-wrap: wrap; gap: 7px; }
.group-permission-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 7px;
  padding: 6px 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--game-yellow) 13%, var(--game-surface));
  border: 2px solid var(--game-border);
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--game-border);
  font-size: 10px;
}
.group-permission-chip strong { color: var(--text); }
.group-permission-chip > span { color: var(--text-soft); }
.group-permission-chip small { grid-column: 1 / -1; color: var(--accent); font-size: 9px; font-weight: 800; }
.group-permission-empty { color: var(--text-faint); font-size: 11px; }
.group-member-actions { display: grid; align-self: center; gap: 8px; }
.group-member-actions form { margin: 0; }
.group-member-actions .button { width: 100%; }
.group-member-empty { display: flex; min-height: 190px; align-items: center; justify-content: center; gap: 13px; color: var(--text-soft); text-align: left; }
.group-member-empty > span, .group-role-explainer > span {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  color: var(--game-border);
  background: var(--game-yellow);
  border: 2px solid var(--game-border);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--game-border);
  font-weight: 900;
}
.group-member-empty strong, .group-role-explainer strong { color: var(--text); }
.group-member-empty p, .group-role-explainer p { margin: 3px 0 0; color: var(--text-soft); font-size: 11px; line-height: 1.6; }
.group-role-explainer { display: flex; align-items: flex-start; gap: 12px; }
.group-role-scope { margin-top: 12px; }
.group-permission-summary { display: grid; gap: 12px; }
.group-permission-summary > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 9px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.group-permission-summary > div:last-child { padding-bottom: 0; border-bottom: 0; }
.group-permission-summary strong { display: block; color: var(--text); font-size: 11px; }
.group-permission-summary p { margin: 3px 0 0; color: var(--text-faint); font-size: 10px; line-height: 1.45; }
.group-permission-summary small { color: var(--accent); font-size: 9px; font-weight: 800; white-space: nowrap; }

.app-dialog {
  width: min(610px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: visible;
  color: var(--text);
  background: transparent;
  border: 0;
}
.app-dialog::backdrop { background: rgba(2, 9, 23, 0.72); backdrop-filter: blur(5px); }
.dialog-card {
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: var(--game-surface);
  border: 3px solid var(--game-border);
  border-radius: 16px;
  box-shadow: 0 8px 0 var(--game-border), 0 26px 64px rgba(0, 0, 0, 0.38);
}
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; background: color-mix(in srgb, var(--game-blue) 18%, var(--game-surface-raised)); border-bottom: 3px solid var(--game-border); }
.dialog-header h3, .dialog-header p { margin: 0; }
.dialog-header h3 { margin-top: 2px; font-size: 17px; }
.dialog-body { display: grid; gap: 16px; padding: 20px; }
.dialog-intro { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.6; }
.dialog-empty-note { margin: 0; padding: 11px 12px; color: var(--text); background: color-mix(in srgb, var(--game-yellow) 15%, var(--game-surface-raised)); border: 2px solid var(--game-border); border-radius: var(--game-radius); font-size: 12px; font-weight: 750; }
.dialog-actions { margin-top: 3px; }
.identity-current-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--game-blue) 15%, var(--game-surface-raised));
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.identity-current-card span { color: var(--text-soft); font-size: 10px; font-weight: 850; }
.identity-current-card strong { color: var(--accent); }
.identity-current-card small { grid-column: 1 / -1; color: var(--text-faint); }
.field.is-disabled { opacity: 0.62; }
.identity-switch-warning, .confirm-dialog__message { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: color-mix(in srgb, var(--game-yellow) 16%, var(--game-surface-raised)); border: 2px solid var(--game-border); border-radius: var(--game-radius); }
.identity-switch-warning > span, .confirm-dialog__message > span { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; color: var(--game-border); background: var(--game-yellow); border: 2px solid var(--game-border); border-radius: 8px; font-weight: 900; }
.identity-switch-warning p, .confirm-dialog__message p { margin: 1px 0 0; color: var(--text); font-size: 11px; line-height: 1.55; }
.identity-confirmation { padding: 11px 12px; background: var(--game-surface-raised); border: 2px solid var(--line-strong); border-radius: var(--game-radius); }
.confirm-dialog { width: min(470px, calc(100vw - 28px)); }

.notification-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; padding: 16px 18px; color: var(--text); border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { color: var(--text); background: var(--accent-soft); }
.notification-item--unread { box-shadow: inset 3px 0 var(--accent); }
.notification-item__icon { display: grid; width: 36px; height: 36px; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 9px; }
.notification-item p { margin: 2px 0 0; color: var(--text-soft); font-size: 12px; }
.notification-item time { color: var(--text-faint); font-size: 10px; white-space: nowrap; }

.report-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.report-metric { padding: 17px; }
.report-metric span { color: var(--text-faint); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; }
.report-metric strong { display: block; margin: 7px 0; font-size: 24px; }
.report-metric small { color: var(--text-soft); font-size: 10px; }
.chart-placeholder { display: flex; height: 230px; align-items: flex-end; gap: clamp(7px, 2vw, 20px); padding: 24px 18px 14px; border-bottom: 1px solid var(--line); }
.chart-bar { position: relative; flex: 1; min-width: 14px; height: var(--bar-height, 30%); background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 22%, transparent)); border-radius: 5px 5px 0 0; }
.chart-bar span { position: absolute; right: 0; bottom: -31px; left: 0; color: var(--text-faint); font-size: 9px; text-align: center; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; }
.alert span { display: inline-grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; font-weight: 800; }
.alert--success { color: var(--green); background: color-mix(in srgb, var(--green) 8%, var(--surface)); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.alert--danger { color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.empty-state { display: grid; min-height: 300px; place-items: center; padding: 36px; text-align: center; }
.empty-state__icon { display: grid; width: 64px; height: 64px; place-items: center; margin: 0 auto 15px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line-strong); border-radius: 18px; font-size: 26px; }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { max-width: 420px; margin: 0 auto 18px; color: var(--text-soft); }

.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; width: min(360px, calc(100vw - 40px)); gap: 9px; }
.toast-message { padding: 12px 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: 9px; box-shadow: var(--shadow); transition: 200ms ease; }
.toast-message--success { border-left-color: var(--green); }
.toast-message--danger { border-left-color: var(--red); }
.toast-message.is-leaving { opacity: 0; transform: translateX(20px); }

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 0.95fr) minmax(440px, 1.4fr);
  background: var(--bg);
}
.auth-panel { display: flex; min-width: 0; min-height: 100vh; align-items: center; justify-content: center; padding: clamp(26px, 6vw, 80px); background: var(--surface); }
.auth-box { width: min(100%, 430px); min-width: 0; }
.auth-box .brand { width: max-content; margin-bottom: 54px; padding: 0; }
.auth-box h1 { margin: 0; font-size: clamp(29px, 4vw, 42px); letter-spacing: -0.04em; }
.auth-box > p { margin: 9px 0 30px; color: var(--text-soft); }
.auth-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: -14px 0 24px; padding: 0; list-style: none; }
.auth-steps li { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 8px; color: var(--text-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 9px; }
.auth-steps li > span { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; color: #031117; background: var(--accent); border-radius: 7px; font-size: 10px; font-weight: 800; }
.auth-steps small { font-size: 11px; line-height: 1.4; }
:root[data-theme="light"] .auth-steps li > span { color: #fff; }
.auth-form { display: grid; gap: 16px; }
.auth-form .button { width: 100%; margin-top: 6px; }
.auth-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; color: var(--text-faint); font-size: 10px; }
.auth-visual { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 50px; overflow: hidden; background: #040713; }
.auth-visual::before, .auth-visual::after { position: absolute; content: ""; border: 1px solid rgba(87, 232, 255, 0.13); border-radius: 50%; }
.auth-visual::before { width: 690px; height: 690px; box-shadow: 0 0 90px rgba(40, 167, 208, 0.08); }
.auth-visual::after { width: 420px; height: 420px; }
.auth-grid { position: absolute; inset: 0; opacity: 0.13; background-image: linear-gradient(rgba(87,232,255,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(87,232,255,.15) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle, #000, transparent 72%); }
.auth-visual__content { position: relative; z-index: 1; max-width: 580px; color: #eef9ff; }
.auth-visual__content .eyebrow { color: #57e8ff; }
.auth-visual__content h2 { margin: 15px 0; font-size: clamp(33px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.05em; }
.auth-visual__content p { max-width: 500px; color: #91a9be; font-size: 16px; }
.auth-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 38px; }
.auth-point { padding: 13px; border: 1px solid rgba(87, 232, 255, 0.16); border-radius: 10px; background: rgba(11, 22, 42, 0.55); }
.auth-point strong { display: block; color: #57e8ff; font-size: 13px; }
.auth-point span { color: #71869c; font-size: 10px; }

/* High-color platform-game visual system. All artwork is original CSS geometry. */
body { font-weight: 500; }
h1, h2, h3, .topbar h1, .page-header h2, .stat-card strong, .report-metric strong {
  font-family: var(--game-display-font);
  font-weight: 800;
}
.project-code, .work-item-key, .timer-display, .tree-node__key { font-family: ui-monospace, "Cascadia Mono", monospace; }

.sidebar {
  border-right: 3px solid var(--game-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--game-blue) 18%, transparent), transparent 31%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, 0.025) 32px),
    var(--game-surface);
  box-shadow: 5px 0 0 var(--game-grass), 8px 0 0 var(--game-border), 18px 0 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: none;
}
.brand__mark {
  color: var(--game-border);
  background: var(--game-yellow);
  border: 3px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow:
    inset 4px 4px 0 rgba(255, 255, 255, 0.42),
    inset -4px -4px 0 rgba(6, 23, 44, 0.18),
    0 4px 0 var(--game-border);
  transform: rotate(-3deg);
}
.brand__mark i { background: var(--game-border); }
.brand__copy strong { font-family: var(--game-display-font); font-weight: 900; text-shadow: 2px 2px 0 color-mix(in srgb, var(--game-blue) 35%, transparent); }
.side-nav__label { color: var(--game-yellow); font-weight: 900; text-shadow: 1px 1px 0 var(--game-border); }
:root[data-theme="light"] .side-nav__label { color: var(--amber); text-shadow: none; }
.side-nav__link {
  border: 2px solid transparent;
  border-radius: var(--game-radius);
  font-weight: 750;
  transition: transform var(--game-motion-duration) ease, box-shadow var(--game-motion-duration) ease, background var(--game-motion-duration) ease;
}
.side-nav__link:hover {
  color: var(--text);
  background: var(--game-surface-raised);
  border-color: var(--game-border);
  box-shadow: 0 3px 0 var(--game-border);
  transform: translateY(-1px);
}
.side-nav__link.is-active {
  color: var(--game-border);
  background: var(--game-yellow);
  border-color: var(--game-border);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.38),
    inset -3px -3px 0 rgba(6, 23, 44, 0.15),
    0 4px 0 var(--game-border);
}
.side-nav__link.is-active::before {
  inset: 50% auto auto -10px;
  width: 17px;
  height: 17px;
  background: var(--game-red);
  border: 2px solid var(--game-border);
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--game-border);
  transform: translateY(-50%);
}
.nav-icon {
  color: var(--game-border);
  background: var(--game-blue);
  border: 2px solid var(--game-border);
  border-radius: 6px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), 0 2px 0 var(--game-border);
  font-weight: 900;
}
.side-nav__link.is-active .nav-icon { background: var(--game-red); }
.nav-count, .icon-button__badge {
  color: var(--game-border);
  background: var(--game-yellow);
  border: 2px solid var(--game-border);
  box-shadow: 0 2px 0 var(--game-border);
}
.environment-chip {
  color: var(--text);
  background: color-mix(in srgb, var(--game-green) 18%, var(--game-surface-raised));
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.environment-chip span { background: var(--game-green); box-shadow: 0 0 0 2px var(--game-border); }

.topbar {
  border-bottom: 3px solid var(--game-border);
  background:
    radial-gradient(circle at 18% 22%, var(--game-cloud) 0 9px, transparent 10px),
    linear-gradient(90deg, color-mix(in srgb, var(--game-blue) 32%, var(--game-surface)), var(--game-surface));
  box-shadow: 0 4px 0 var(--game-grass), 0 7px 0 var(--game-border);
  backdrop-filter: none;
}
.topbar h1 { letter-spacing: 0.01em; text-shadow: 2px 2px 0 color-mix(in srgb, var(--game-blue) 32%, transparent); }
.eyebrow { color: var(--accent); font-weight: 900; }
.top-search,
.input, .select, .textarea,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select, .field textarea {
  min-height: var(--game-control-height);
  color: var(--text);
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: inset 0 -3px 0 rgba(6, 23, 44, 0.13);
}
.top-search:focus-within,
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--game-blue);
  box-shadow: var(--focus), inset 0 -3px 0 rgba(6, 23, 44, 0.1);
}
.top-search kbd {
  color: var(--game-border);
  background: var(--game-yellow);
  border: 2px solid var(--game-border);
  box-shadow: 0 2px 0 var(--game-border);
  font-weight: 800;
}
.icon-button, .avatar {
  color: var(--game-border);
  background: var(--game-blue);
  border: 2px solid var(--game-border);
  border-radius: 9px;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--game-border);
  font-weight: 900;
  transition: transform var(--game-motion-duration) ease, box-shadow var(--game-motion-duration) ease;
}
.theme-toggle { background: var(--game-yellow); }
.icon-button:hover { color: var(--game-border); border-color: var(--game-border); transform: translateY(-2px); }
.icon-button:active { box-shadow: 0 1px 0 var(--game-border); transform: translateY(3px); }
.profile-chip:hover { transform: translateY(-1px); }
.app-footer { background: color-mix(in srgb, var(--game-surface) 86%, transparent); border-top: 3px solid var(--game-border); }

.page-header h2 { letter-spacing: -0.015em; text-shadow: 2px 2px 0 var(--game-glow); }
.page-guide, .glass-card, .popover {
  border: 2px solid var(--game-border);
  border-radius: var(--radius-lg);
  background: var(--game-surface);
  box-shadow: 0 5px 0 var(--game-border), 0 16px 30px rgba(0, 0, 0, 0.16);
  backdrop-filter: none;
}
.card-header {
  border-bottom: 2px solid var(--game-border);
  background: linear-gradient(90deg, color-mix(in srgb, var(--game-blue) 15%, var(--game-surface-raised)), var(--game-surface-raised));
}
.card-header h3, .card-header h2 { font-weight: 850; }
.card-footer { border-top: 2px solid var(--game-border); background: var(--game-surface-raised); }
.page-guide__summary {
  color: var(--text);
  background: linear-gradient(90deg, color-mix(in srgb, var(--game-blue) 22%, var(--game-surface-raised)), var(--game-surface-raised));
}
:root[data-theme="light"] .page-guide__summary {
  background: linear-gradient(90deg, color-mix(in srgb, var(--game-blue) 18%, white), var(--game-surface-raised));
}
.page-guide__icon, .page-guide__number {
  color: var(--game-border);
  background: var(--game-yellow);
  border: 2px solid var(--game-border);
  border-radius: 7px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), 0 3px 0 var(--game-border);
}
:root[data-theme="light"] .page-guide__number { color: var(--game-border); }
.page-guide__body { border-top: 2px solid var(--game-border); }
.page-guide__steps li {
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
}
.page-guide__steps li:nth-child(2) .page-guide__number { background: var(--game-blue); }
.page-guide__steps li:nth-child(3) .page-guide__number { background: var(--game-green); }
.page-guide__completion { border: 2px solid var(--game-green); background: color-mix(in srgb, var(--game-green) 12%, var(--game-surface)); }

.stat-card, .project-card, .report-metric { --game-card-tone: var(--game-blue); border-top: 8px solid var(--game-card-tone); }
.stat-card:nth-child(4n + 1), .project-card:nth-child(4n + 1), .report-metric:nth-child(4n + 1) { --game-card-tone: var(--game-red); }
.stat-card:nth-child(4n + 2), .project-card:nth-child(4n + 2), .report-metric:nth-child(4n + 2) { --game-card-tone: var(--game-yellow); }
.stat-card:nth-child(4n + 3), .project-card:nth-child(4n + 3), .report-metric:nth-child(4n + 3) { --game-card-tone: var(--game-blue); }
.stat-card:nth-child(4n), .project-card:nth-child(4n), .report-metric:nth-child(4n) { --game-card-tone: var(--game-green); }
.stat-card__icon {
  color: var(--game-border);
  background: var(--game-card-tone);
  border: 2px solid var(--game-border);
  border-radius: 7px;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), 0 3px 0 var(--game-border);
  font-weight: 900;
}
.stat-card::after { background: radial-gradient(circle, color-mix(in srgb, var(--game-card-tone) 22%, transparent), transparent 68%); }
.project-card { transition: transform var(--game-motion-duration) ease, box-shadow var(--game-motion-duration) ease; }
.project-card:hover { border-color: var(--game-border); box-shadow: 0 8px 0 var(--game-border), 0 18px 30px rgba(0, 0, 0, 0.18); transform: translateY(-3px); }
.project-code, .work-item-key { color: var(--accent); font-weight: 900; }

.quick-action {
  --quick-tone: var(--game-blue);
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
  transition: transform var(--game-motion-duration) ease, box-shadow var(--game-motion-duration) ease;
}
.quick-action:nth-child(4n + 1) { --quick-tone: var(--game-red); }
.quick-action:nth-child(4n + 2) { --quick-tone: var(--game-yellow); }
.quick-action:nth-child(4n + 3) { --quick-tone: var(--game-blue); }
.quick-action:nth-child(4n) { --quick-tone: var(--game-green); }
.quick-action span:first-child {
  color: var(--game-border);
  background: var(--quick-tone);
  border: 2px solid var(--game-border);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.38), 0 3px 0 var(--game-border);
  font-weight: 900;
}
.quick-action:hover { border-color: var(--game-border); box-shadow: 0 5px 0 var(--game-border); transform: translateY(-2px); }

.button {
  min-height: var(--game-control-height);
  color: var(--text);
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 4px 0 var(--game-border);
  font-weight: 800;
  transition: transform var(--game-motion-duration) ease, box-shadow var(--game-motion-duration) ease, filter var(--game-motion-duration) ease;
}
.button:hover { color: var(--text); border-color: var(--game-border); box-shadow: 0 6px 0 var(--game-border); transform: translateY(-2px); filter: saturate(1.08); }
.button:active { box-shadow: 0 1px 0 var(--game-border); transform: translateY(3px); }
.button--primary, :root[data-theme="light"] .button--primary {
  color: var(--game-border);
  background: var(--game-accent);
  border-color: var(--game-border);
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.38), 0 4px 0 var(--game-border);
}
.button--primary:hover, :root[data-theme="light"] .button--primary:hover { color: var(--game-border); background: #ffe05c; border-color: var(--game-border); }
.button--danger { color: var(--game-border); background: var(--game-red); border-color: var(--game-border); }
.button--ghost { color: var(--text); background: color-mix(in srgb, var(--game-surface-raised) 74%, transparent); }
.button--small { min-height: 34px; }
.button[disabled], .icon-button[disabled] { box-shadow: 0 2px 0 var(--game-border); filter: grayscale(0.35); }

.filter-bar { background: var(--game-surface); }
.field label, .field-label { color: var(--text); font-weight: 750; }
.checkbox-row input { accent-color: var(--game-yellow); }
.segmented, .tabs {
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.segmented .is-active, .tabs .is-active {
  color: var(--game-border);
  background: var(--game-yellow);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), 0 2px 0 var(--game-border);
}

.data-table th { color: var(--text); background: color-mix(in srgb, var(--game-blue) 15%, var(--game-surface-raised)); border-bottom: 2px solid var(--game-border); }
.data-table td { border-bottom: 2px solid var(--line); }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--game-yellow) 11%, var(--game-surface)); }
.status-badge, .type-badge, .role-badge, .priority-badge {
  background: var(--game-surface-raised);
  border: 2px solid currentColor;
  border-radius: 7px;
  box-shadow: 0 2px 0 color-mix(in srgb, currentColor 55%, var(--game-border));
}
.progress-track { height: 11px; background: var(--game-surface-raised); border: 2px solid var(--game-border); border-radius: 5px; }
.progress-track span { background: repeating-linear-gradient(135deg, var(--game-green) 0 9px, #81eeaa 9px 18px); box-shadow: none; }

.split-workspace { background: var(--game-surface); }
.tree-pane { border-right: 2px solid var(--game-border); }
.tree-toolbar { border-bottom: 2px solid var(--game-border); background: var(--game-surface-raised); }
.tree-branch { border-left: 2px dashed var(--game-blue); }
.tree-node__row { border: 2px solid transparent; }
.tree-node__row:hover { background: color-mix(in srgb, var(--game-yellow) 13%, var(--game-surface-raised)); border-color: var(--game-border); }
.tree-node__toggle { color: var(--game-border); background: var(--game-yellow); border: 2px solid var(--game-border); box-shadow: 0 2px 0 var(--game-border); font-weight: 900; }
.tree-node__toggle[disabled] { color: var(--text-faint); background: var(--game-surface-raised); }
.meta-list div { border-bottom: 2px solid var(--line); }
.timer-display { color: var(--accent); }

.comment__body, .editor-shell, .attachment-row {
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.comment--internal .comment__body { border-color: var(--game-orange); box-shadow: 0 3px 0 color-mix(in srgb, var(--game-orange) 55%, var(--game-border)); }
.editor-shell:focus-within { border-color: var(--game-blue); }
.ql-toolbar.ql-snow { border-bottom: 2px solid var(--game-border); background: var(--game-surface); }
.attachment-drop {
  color: var(--text);
  background: color-mix(in srgb, var(--game-blue) 12%, var(--game-surface-raised));
  border: 3px dashed var(--game-blue);
  border-radius: var(--game-radius);
}
.attachment-drop.is-dragging { border-color: var(--game-yellow); background: color-mix(in srgb, var(--game-yellow) 18%, var(--game-surface)); transform: translateY(-2px); }
.file-chip { background: var(--game-surface-raised); border: 2px solid var(--game-border); box-shadow: 0 2px 0 var(--game-border); }
.attachment-row__icon, .notification-item__icon, .empty-state__icon {
  color: var(--game-border);
  background: var(--game-blue);
  border: 2px solid var(--game-border);
  border-radius: 8px;
  box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--game-border);
  font-weight: 900;
}
.admin-nav a { border: 2px solid transparent; font-weight: 750; }
.admin-nav a:hover, .admin-nav a.is-active { color: var(--game-border); background: var(--game-yellow); border-color: var(--game-border); box-shadow: 0 3px 0 var(--game-border); }

.notification-item { border-bottom: 2px solid var(--line); }
.notification-item:hover { background: color-mix(in srgb, var(--game-yellow) 11%, var(--game-surface)); }
.notification-item--unread { box-shadow: inset 6px 0 var(--game-red); }
.notification-preview:hover { background: color-mix(in srgb, var(--game-yellow) 12%, var(--game-surface)); }
.notification-popover header { border-bottom: 2px solid var(--game-border); background: var(--game-surface-raised); }
.chart-bar { background: linear-gradient(180deg, var(--game-yellow), var(--game-orange)); border: 2px solid var(--game-border); border-bottom: 0; border-radius: 6px 6px 0 0; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.36); }
.alert { background: var(--game-surface-raised); border: 2px solid currentColor; border-radius: var(--game-radius); box-shadow: 0 3px 0 color-mix(in srgb, currentColor 55%, var(--game-border)); font-weight: 650; }
.empty-state__icon { width: 68px; height: 68px; background: var(--game-yellow); border-radius: 12px; font-size: 29px; }
.toast-message {
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-left: 8px solid var(--game-blue);
  border-radius: var(--game-radius);
  box-shadow: 0 5px 0 var(--game-border), 0 14px 26px rgba(0, 0, 0, 0.2);
}

.auth-page { background: linear-gradient(180deg, var(--game-sky-top), var(--game-sky-bottom)); }
.auth-panel {
  background:
    radial-gradient(ellipse at 15% 12%, var(--game-cloud) 0 38px, transparent 39px),
    linear-gradient(180deg, color-mix(in srgb, var(--game-sky-bottom) 36%, var(--game-surface)), var(--game-surface));
}
.auth-box {
  padding: clamp(22px, 4vw, 34px);
  background: var(--game-surface);
  border: 3px solid var(--game-border);
  border-radius: 16px;
  box-shadow: 0 8px 0 var(--game-border), 0 22px 44px rgba(0, 0, 0, 0.22);
}
.auth-brand-row { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 42px; }
.auth-utilities { display: flex; align-items: center; gap: 0.5rem; }
.auth-box .brand, .auth-box .auth-brand-row .brand { margin-bottom: 0; }
.auth-box h1 { letter-spacing: -0.015em; text-shadow: 2px 2px 0 var(--game-glow); }
.auth-steps li {
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.auth-steps li > span, :root[data-theme="light"] .auth-steps li > span {
  color: var(--game-border);
  background: var(--game-yellow);
  border: 2px solid var(--game-border);
  border-radius: 6px;
}
.auth-steps li:nth-child(2) > span { background: var(--game-blue); }
.auth-steps li:nth-child(3) > span { background: var(--game-green); }
.auth-visual {
  background:
    radial-gradient(circle at 76% 17%, #ffe45c 0 42px, #ffb703 43px 49px, transparent 50px),
    radial-gradient(circle at 19% 12%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px),
    radial-gradient(circle at 36% 24%, rgba(255, 255, 255, 0.62) 0 3px, transparent 4px),
    linear-gradient(180deg, #071b42 0 68%, #238c51 68% 75%, #5f452f 75% 100%);
  border-left: 3px solid var(--game-border);
}
:root[data-theme="light"] .auth-visual {
  background:
    radial-gradient(circle at 76% 17%, #ffe45c 0 54px, #ffb703 55px 62px, transparent 63px),
    radial-gradient(ellipse at 22% 16%, rgba(255, 255, 255, 0.72) 0 42px, transparent 43px),
    linear-gradient(180deg, #3ca7ff 0 68%, #45d47a 68% 75%, #9b6537 75% 100%);
}
.auth-visual::before { display: none; }
.auth-visual::after { width: 520px; height: 180px; border: 0; border-radius: 0; background: repeating-linear-gradient(90deg, rgba(6, 23, 44, 0.18) 0 2px, transparent 2px 52px); }
.auth-grid { opacity: 0.15; background-image: linear-gradient(rgba(255,255,255,.55) 2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,.55) 2px, transparent 2px); background-size: 52px 52px; mask-image: linear-gradient(#000, transparent 70%); }
.auth-visual__content {
  padding: clamp(24px, 4vw, 36px);
  color: #fffbe7;
  background: rgba(7, 27, 66, 0.9);
  border: 3px solid #06172c;
  border-radius: 18px;
  box-shadow: 0 8px 0 #06172c, 0 24px 44px rgba(0, 0, 0, 0.24);
  text-shadow: 2px 2px 0 #06172c;
}
.auth-visual__content .eyebrow { color: #ffe45c; }
.auth-visual__content h2 { letter-spacing: -0.02em; }
.auth-visual__content p { color: #e9f6ff; }
.auth-point { color: #fffbe7; background: rgba(16, 47, 93, 0.88); border: 2px solid #06172c; border-radius: var(--game-radius); box-shadow: 0 4px 0 #06172c; }
.auth-point:nth-child(1) { border-top: 7px solid #ff4f4f; }
.auth-point:nth-child(2) { border-top: 7px solid #ffcf33; }
.auth-point:nth-child(3) { border-top: 7px solid #45d47a; }
.auth-point strong { color: #fffbe7; }
.auth-point span { color: #d5e8ff; }
.auth-result-card { width: min(100%, 560px); }
.auth-result { text-align: center; }
.auth-result__icon {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  place-items: center;
  color: var(--game-border);
  background: var(--game-yellow);
  border: 3px solid var(--game-border);
  border-radius: 18px;
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, 0.38), 0 7px 0 var(--game-border);
  font-family: var(--game-display-font);
  font-size: calc(var(--font-size-icon) + 1rem);
  font-weight: 900;
}
.auth-result__icon--success { background: var(--game-green); }
.auth-result__icon--warning { background: var(--game-orange); }
.auth-result .eyebrow { margin-bottom: 9px; }
.auth-result__message { margin: 14px auto 0; color: var(--text-soft); font-size: var(--font-size-action); line-height: 1.75; }
.auth-result__next-step {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 15px;
  color: var(--text);
  text-align: left;
  background: color-mix(in srgb, var(--game-blue) 13%, var(--game-surface-raised));
  border: 2px solid var(--game-border);
  border-radius: var(--game-radius);
  box-shadow: 0 3px 0 var(--game-border);
}
.auth-result__next-step strong { color: var(--accent); font-size: var(--font-size-content); }
.auth-result__next-step span { color: var(--text-soft); font-size: var(--font-size-label); line-height: 1.6; }
.auth-result__actions { justify-content: center; }
.auth-result__actions .button { min-width: min(100%, 220px); }

.input-validation-error,
[aria-invalid="true"] {
  border-color: var(--red) !important;
  background: color-mix(in srgb, var(--red) 9%, var(--game-surface-raised)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 24%, transparent) !important;
}
input:disabled, select:disabled, textarea:disabled,
input[readonly], textarea[readonly] {
  color: var(--text-faint);
  background: color-mix(in srgb, var(--game-surface-raised) 70%, var(--bg));
  cursor: not-allowed;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: var(--focus), inset 0 0 0 1000px var(--game-surface-raised) !important;
  caret-color: var(--text);
}
::file-selector-button {
  min-height: 34px;
  margin-right: 9px;
  padding: 5px 10px;
  color: var(--game-border);
  background: var(--game-yellow);
  border: 2px solid var(--game-border);
  border-radius: 7px;
  box-shadow: 0 2px 0 var(--game-border);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.work-item-description h1, .work-item-description h2, .work-item-description h3,
.comment__content h1, .comment__content h2, .comment__content h3,
.ql-editor h1, .ql-editor h2, .ql-editor h3 { font-family: var(--game-display-font); color: var(--text); }
.work-item-description blockquote, .comment__content blockquote, .ql-editor blockquote {
  margin-left: 0;
  padding: 8px 13px;
  background: color-mix(in srgb, var(--game-yellow) 10%, var(--game-surface));
  border-left: 5px solid var(--game-yellow);
}
.work-item-description pre, .comment__content pre, .ql-editor pre,
.work-item-description code, .comment__content code, .ql-editor code {
  color: var(--text);
  background: color-mix(in srgb, var(--game-border) 34%, var(--game-surface));
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
}
.work-item-description pre, .comment__content pre, .ql-editor pre { padding: 12px; overflow-x: auto; border: 2px solid var(--game-border); }
.work-item-description img, .comment__content img, .ql-editor img { border: 2px solid var(--game-border); border-radius: var(--game-radius); box-shadow: 0 4px 0 var(--game-border); }
.ql-toolbar.ql-snow button:hover, .ql-toolbar.ql-snow button:focus-visible,
.ql-toolbar.ql-snow button.ql-active,
.ql-snow .ql-picker-label:hover, .ql-snow .ql-picker-label.ql-active {
  color: var(--game-border);
  background: var(--game-yellow);
  border-radius: 5px;
}
.ql-toolbar.ql-snow button:hover .ql-stroke, .ql-toolbar.ql-snow button:focus-visible .ql-stroke,
.ql-toolbar.ql-snow button.ql-active .ql-stroke { stroke: var(--game-border); }
.ql-toolbar.ql-snow button:hover .ql-fill, .ql-toolbar.ql-snow button:focus-visible .ql-fill,
.ql-toolbar.ql-snow button.ql-active .ql-fill { fill: var(--game-border); }
.ql-snow .ql-picker-options, .ql-snow .ql-tooltip {
  color: var(--text);
  background: var(--game-surface-raised);
  border: 2px solid var(--game-border) !important;
  border-radius: var(--game-radius);
  box-shadow: 0 4px 0 var(--game-border), 0 12px 22px rgba(0, 0, 0, 0.2);
}
.ql-snow .ql-tooltip input[type="text"] {
  min-height: 36px;
  color: var(--text);
  background: var(--game-surface);
  border: 2px solid var(--game-border);
}
.ql-snow .ql-tooltip a { color: var(--accent); font-weight: 800; }
.data-table tbody tr:focus-within td { background: color-mix(in srgb, var(--game-yellow) 13%, var(--game-surface)); }

/* Central type-ramp application. Keep component sizing in step with text. */
.brand__copy small,
.side-nav__label,
.eyebrow,
.nav-count,
.icon-button__badge,
.sidebar__footer small,
.top-search kbd,
.profile-chip__copy small,
.status-badge,
.type-badge,
.role-badge,
.priority-badge,
.project-code,
.avatar-stack .avatar,
.tree-node__key,
.comment__header time,
.file-chip,
.attachment-row small,
.group-member-identity > span,
.member-state,
.group-member-permissions__label,
.group-permission-chip,
.group-permission-chip small,
.group-permission-summary p,
.group-permission-summary small,
.identity-current-card span,
.notification-item time,
.report-metric span,
.report-metric small,
.chart-bar span,
.auth-steps li > span,
.auth-meta,
.auth-point span {
  font-size: var(--font-size-min);
}

.app-footer,
.stat-card small,
.project-card__meta,
.work-item-key,
.group-member-heading > div > span,
.group-member-identity > small,
.group-member-identity > em,
.group-permission-empty,
.group-member-empty p,
.group-role-explainer p,
.group-permission-summary strong,
.identity-switch-warning p,
.confirm-dialog__message p,
.auth-steps small {
  font-size: var(--font-size-aux);
}

.environment-chip,
.page-guide__heading small,
.page-guide__number,
.page-guide__steps small,
.page-guide__completion,
.card-header p,
.stat-card__top,
.quick-action small,
.field-help,
.data-table th,
.cell-primary small,
.meta-list dt,
.attachment-drop p,
.attachment-drop input,
.attachment-row strong {
  font-size: var(--font-size-support);
}

.field label,
.field-label,
.validation-summary-errors,
.field-validation-error,
.profile-chip__copy strong,
.project-card p,
.tree-node__link strong,
.meta-list dd,
.comment__header strong,
.dialog-intro,
.dialog-empty-note,
.notification-item p {
  font-size: var(--font-size-label);
}

.notification-preview span,
.page-guide__steps strong,
.cell-primary strong,
.checkbox-row,
.comment__content,
.group-member-identity > strong,
.auth-point strong,
.avatar {
  font-size: var(--font-size-content);
}

.top-search input,
.input,
.select,
.textarea,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea,
.data-table,
.work-item-description,
.ql-editor,
.toast-message {
  font-size: var(--font-size-body);
}

.side-nav__link,
.button,
.button--small,
.link-button,
.segmented a,
.segmented button,
.tabs a,
.tabs button,
.admin-nav a,
.quick-action strong,
.auth-visual__content p {
  font-size: var(--font-size-action);
}

.brand__copy strong,
.page-guide__heading strong,
.card-header h3,
.card-header h2,
.group-member-heading strong {
  font-size: var(--font-size-action);
}

.group-member-avatar,
.dialog-header h3 {
  font-size: var(--font-size-title-sm);
}

.project-card h3 { font-size: var(--font-size-title-md); }
.topbar h1 { font-size: var(--font-size-top-title); }
.page-header h2 { font-size: var(--font-size-page-title); }
.work-item-heading h2 { font-size: var(--font-size-work-title); }
.stat-card strong, .report-metric strong { font-size: var(--font-size-metric); }
.timer-display { font-size: calc(var(--font-size-title-md) + 0.1875rem); }
.empty-state__icon { font-size: calc(var(--font-size-icon) + 0.5rem); }
.auth-box h1 { font-size: var(--font-size-auth-title); }
.auth-visual__content h2 { font-size: var(--font-size-display); }
.nav-icon, .mobile-bottom-nav__icon { font-size: var(--font-size-icon); }

.side-nav__link,
.button,
.button--small,
.link-button,
.segmented a,
.segmented button,
.tabs a,
.tabs button,
.admin-nav a {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.button, .button--small { max-width: 100%; }
.topbar__leading, .topbar__actions, .page-header > *, .card-header > * { min-width: 0; }
.topbar h1, .toast-message, .notification-preview, .notification-item { overflow-wrap: anywhere; }
.top-search { height: auto; min-height: var(--game-control-height); }
.icon-button { width: var(--game-control-height); height: var(--game-control-height); flex-basis: var(--game-control-height); }
.nav-icon { width: 1.625rem; height: 1.625rem; }
.nav-count, .icon-button__badge { min-width: 1.5rem; height: auto; min-height: 1.5rem; }
.status-badge, .type-badge, .role-badge, .priority-badge { min-height: 1.75rem; }
.ql-editor { line-height: 1.65; }
.toast-message { line-height: 1.5; }
.table-wrap { -webkit-overflow-scrolling: touch; }

@media (max-height: 900px) and (min-width: 721px) {
  .auth-panel { padding: 12px clamp(26px, 6vw, 80px); }
  .auth-box { padding: 24px 30px; }
  .auth-brand-row { margin-bottom: 28px; }
  .auth-box > p { margin-bottom: 22px; }
  .auth-steps { margin-bottom: 18px; }
  .auth-form { gap: 12px; }
  .auth-meta { margin-top: 20px; }
}

@media (max-width: 1200px) {
  .stat-grid, .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, 0.8fr); }
  .profile-chip__copy { display: none; }
  .top-search { width: 230px; }
  .work-item-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 960px) {
  .mobile-only { display: inline-grid !important; }
  .sidebar { transform: translateX(-104%); transition: transform 190ms ease; }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-overlay { position: fixed; z-index: 55; inset: 0; display: block; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.58); border: 0; }
  .app-workspace { margin-left: 0; }
  .top-search { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .group-management-layout { grid-template-columns: 1fr; }
  .split-workspace { grid-template-columns: 1fr; }
  .tree-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-pane { min-height: 360px; }
  .work-item-layout { grid-template-columns: 1fr; }
  .work-item-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-page { grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.8fr); }
}

@media (max-width: 960px), (pointer: coarse) {
  body { background-attachment: scroll; }
}

@media (max-width: 720px) {
  body { background-attachment: scroll; }
  html { scroll-padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .app-workspace { padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .topbar { min-height: max(4.25rem, calc(var(--topbar-height) - 1rem)); padding: 10px 14px; }
  .topbar .eyebrow, .top-search, .profile-chip { display: none; }
  .topbar__actions { margin-left: auto; }
  .topbar__leading { min-width: 0; }
  .topbar__leading > div { min-width: 0; }
  .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar__actions { gap: 0.25rem; }
  .font-size-control { padding: 0; background: transparent; border: 0; }
  .font-size-control > span { display: none; }
  .font-size-control select { width: 3.25rem; min-width: 3.25rem; padding-left: 0.45rem; }
  .page-content { padding: 20px 14px 28px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-header__actions { width: 100%; justify-content: flex-start; }
  .page-header__actions .button { flex: 1; }
  .page-guide { margin-top: -4px; }
  .page-guide__steps { grid-template-columns: 1fr; }
  .stat-grid, .report-grid, .project-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .stat-card { min-height: 105px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { grid-auto-flow: column; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
  .mail-status-grid { grid-template-columns: 1fr; }
  .admin-layout .filter-bar + .glass-card .table-wrap { overflow: visible; }
  .admin-layout .filter-bar + .glass-card .data-table,
  .admin-layout .filter-bar + .glass-card .data-table tbody,
  .admin-layout .filter-bar + .glass-card .data-table tr,
  .admin-layout .filter-bar + .glass-card .data-table td { display: block; width: 100%; }
  .admin-layout .filter-bar + .glass-card .data-table thead { display: none; }
  .admin-layout .filter-bar + .glass-card .data-table tbody { padding: 12px; }
  .admin-layout .filter-bar + .glass-card .data-table tr {
    margin-bottom: 14px;
    overflow: hidden;
    background: var(--game-surface-raised);
    border: 2px solid var(--game-border);
    border-radius: var(--game-radius);
    box-shadow: 0 4px 0 var(--game-border);
  }
  .admin-layout .filter-bar + .glass-card .data-table tr:last-child { margin-bottom: 0; }
  .admin-layout .filter-bar + .glass-card .data-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 0.36fr) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  .admin-layout .filter-bar + .glass-card .data-table td::before {
    color: var(--text-faint);
    font-size: var(--font-size-support);
    font-weight: 800;
  }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(1)::before { content: "使用者與 Email"; }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(2)::before { content: "群組／角色"; }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(3)::before { content: "信箱驗證"; }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(4)::before { content: "帳號狀態"; }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(5)::before { content: "最近寄信"; }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(6) { display: block; border-bottom: 0; }
  .admin-layout .filter-bar + .glass-card .data-table td:nth-child(6)::before { display: block; margin-bottom: 10px; content: "管理動作"; }
  .admin-layout .filter-bar + .glass-card .cell-actions { align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; }
  .admin-layout .filter-bar + .glass-card .cell-actions details { width: 100%; }
  .admin-layout .filter-bar + .glass-card .cell-actions details > summary { width: max-content; }
  .admin-layout .filter-bar + .glass-card .cell-actions details form { width: 100%; min-width: 0 !important; }
  .work-item-side { grid-template-columns: 1fr; }
  .comment--depth-1, .comment--depth-2 { margin-left: 18px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel { min-height: 100vh; padding: 26px; }
  .auth-visual { display: none; }
  .auth-box .brand { margin-bottom: 38px; }
  .app-footer { flex-direction: column; gap: 3px; }
  .button, .button--small, .icon-button, .tabs a, .tabs button, .admin-nav a, .link-button {
    min-height: max(2.75rem, var(--game-control-height));
  }
  .segmented a, .segmented button,
  .ql-toolbar.ql-snow button,
  .ql-toolbar.ql-snow .ql-picker,
  .ql-toolbar.ql-snow .ql-picker-label,
  .ql-toolbar.ql-snow .ql-picker-item,
  .ql-snow .ql-tooltip input[type="text"],
  .ql-snow .ql-tooltip .ql-action,
  .ql-snow .ql-tooltip .ql-remove,
  ::file-selector-button {
    min-height: max(2.75rem, var(--game-control-height));
  }
  .ql-toolbar.ql-snow button { width: max(2.75rem, var(--game-control-height)); }
  .ql-toolbar.ql-snow .ql-picker-label { display: flex; align-items: center; }
  .ql-toolbar.ql-snow .ql-picker-item,
  .ql-snow .ql-tooltip .ql-action,
  .ql-snow .ql-tooltip .ql-remove { display: inline-flex; align-items: center; padding: 6px 10px; }
  .ql-snow .ql-tooltip { max-width: calc(100vw - 28px); white-space: normal; }
  .checkbox-row { min-height: 44px; align-items: center; }
  .checkbox-row input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 0; }
  .icon-button { width: max(2.75rem, var(--game-control-height)); height: max(2.75rem, var(--game-control-height)); flex-basis: max(2.75rem, var(--game-control-height)); }
  .link-button { display: inline-flex; align-items: center; }
  .tree-node__row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .tree-node__toggle { width: 44px; height: 44px; }
  .form-actions { flex-wrap: wrap; }
  .group-member-row { grid-template-columns: 44px minmax(0, 1fr); }
  .group-member-actions { grid-column: 2; justify-self: stretch; }
  .group-member-actions .button { width: 100%; }
  .group-member-heading { align-items: flex-start; flex-direction: column; }
  .group-permission-chip { width: 100%; grid-template-columns: minmax(0, auto) minmax(0, 1fr); }
  .app-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .dialog-card { max-height: calc(100dvh - 20px); }
  .dialog-body { padding: 16px; }
  .dialog-actions .button { flex: 1; }
  .mobile-bottom-nav {
    --mobile-nav-ink: var(--game-border);
    --mobile-nav-sky: color-mix(in srgb, var(--game-blue) 58%, var(--game-surface));
    --mobile-nav-ground: var(--game-grass);
    position: fixed;
    z-index: 49;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: start;
    padding: 15px max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    overflow: visible;
    border-top: 3px solid var(--mobile-nav-ink);
    background:
      radial-gradient(circle at 15% 14%, rgba(255, 255, 255, 0.22) 0 4px, transparent 5px),
      radial-gradient(circle at 77% 22%, rgba(255, 255, 255, 0.18) 0 3px, transparent 4px),
      linear-gradient(180deg, var(--mobile-nav-sky), color-mix(in srgb, var(--surface-glass) 92%, transparent));
    box-shadow:
      0 -4px 0 var(--mobile-nav-ground),
      0 -7px 0 var(--mobile-nav-ink),
      0 -18px 42px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(12px);
    transition: transform 180ms ease;
  }
  .mobile-bottom-nav__link {
    --mobile-nav-color: #38d9ff;
    position: relative;
    display: grid;
    min-width: 0;
    min-height: calc(var(--mobile-nav-height) - 1.75rem);
    grid-template-rows: calc(var(--font-size-icon) + 1rem) auto;
    place-items: center;
    gap: 2px;
    padding: 0 2px;
    color: var(--text-soft);
    border-radius: 12px;
  }
  :root[data-theme="light"] .mobile-bottom-nav {
    --mobile-nav-sky: color-mix(in srgb, var(--game-blue) 32%, var(--game-surface));
    --mobile-nav-ground: var(--game-grass);
  }
  .mobile-bottom-nav__link[data-mobile-nav-item="Home"] { --mobile-nav-color: var(--game-red); }
  .mobile-bottom-nav__link[data-mobile-nav-item="WorkItems"] { --mobile-nav-color: var(--game-yellow); }
  .mobile-bottom-nav__link[data-mobile-nav-item="Projects"] { --mobile-nav-color: var(--game-blue); }
  .mobile-bottom-nav__link[data-mobile-nav-item="Notifications"] { --mobile-nav-color: var(--game-orange); }
  .mobile-bottom-nav__link[data-mobile-nav-item="Admin"] { --mobile-nav-color: var(--game-green); }
  .mobile-bottom-nav__link:hover { color: var(--text); }
  .mobile-bottom-nav__link.is-active { color: var(--text); }
  .mobile-bottom-nav__link.is-active::before {
    position: absolute;
    top: -7px;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    content: "";
    background:
      radial-gradient(circle at 34% 30%, #fff8bd 0 2px, transparent 3px),
      var(--game-yellow);
    border: 2px solid var(--mobile-nav-ink);
    border-radius: 50%;
    box-shadow: 0 3px 0 var(--mobile-nav-ink);
    pointer-events: none;
    transform: translateY(-7px);
  }
  .mobile-bottom-nav__icon {
    position: relative;
    display: grid;
    width: calc(var(--font-size-icon) + 1rem);
    height: calc(var(--font-size-icon) + 1rem);
    place-items: center;
    color: var(--mobile-nav-ink);
    border: 2px solid var(--mobile-nav-ink);
    border-radius: 8px;
    background: var(--mobile-nav-color);
    box-shadow:
      inset 3px 3px 0 rgba(255, 255, 255, 0.38),
      inset -3px -3px 0 rgba(6, 23, 44, 0.2),
      0 4px 0 var(--mobile-nav-ink);
    font-size: var(--font-size-icon);
    font-weight: 900;
    line-height: 1;
    transform: rotate(-2deg);
    transition: transform 160ms ease, box-shadow 160ms ease;
  }
  .mobile-bottom-nav__link:nth-child(even) .mobile-bottom-nav__icon { transform: rotate(2deg); }
  .mobile-bottom-nav__link:hover .mobile-bottom-nav__icon { transform: translateY(-2px) rotate(0); }
  .mobile-bottom-nav__link.is-active .mobile-bottom-nav__icon {
    box-shadow:
      inset 3px 3px 0 rgba(255, 255, 255, 0.46),
      inset -3px -3px 0 rgba(6, 23, 44, 0.22),
      0 6px 0 var(--mobile-nav-ink),
      0 11px 18px color-mix(in srgb, var(--mobile-nav-color) 42%, transparent);
    animation: mobile-nav-jump 420ms cubic-bezier(0.2, 0.9, 0.35, 1.25) both;
  }
  .mobile-bottom-nav__label {
    max-width: 100%;
    overflow: hidden;
    font-size: var(--font-size-min);
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-bottom-nav__link.is-active .mobile-bottom-nav__label {
    padding: 0 6px;
    color: var(--mobile-nav-ink);
    background: var(--mobile-nav-color);
    border: 1px solid var(--mobile-nav-ink);
    border-radius: 5px;
    box-shadow: 0 2px 0 var(--mobile-nav-ink);
  }
  .mobile-bottom-nav__badge {
    position: absolute;
    top: 0;
    left: calc(50% + 7px);
    display: inline-grid;
    min-width: 1.375rem;
    height: 1.375rem;
    place-items: center;
    padding: 0 4px;
    color: var(--mobile-nav-ink);
    background: #ff4d8d;
    border: 2px solid var(--mobile-nav-ink);
    border-radius: 999px;
    font-size: var(--font-size-min);
    font-weight: 800;
    box-shadow: 0 2px 0 var(--mobile-nav-ink);
  }
  .notification-popover {
    max-height: calc(100dvh - var(--mobile-nav-height) - 104px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .toast-region { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px); }
}

@keyframes mobile-nav-jump {
  0% { transform: translateY(0) rotate(-2deg) scale(1); }
  55% { transform: translateY(-9px) rotate(3deg) scale(1.12); }
  100% { transform: translateY(-5px) rotate(-3deg) scale(1.08); }
}

@media (max-width: 720px) and (pointer: coarse) {
  body:has(input:focus, textarea:focus, select:focus, [contenteditable="true"]:focus) .mobile-bottom-nav {
    transform: translateY(115%);
  }
}

@media (max-width: 420px) {
  .auth-panel { padding: 14px; }
  .auth-box { padding: 20px; }
  .auth-brand-row { row-gap: 12px; }
  .auth-utilities { margin-left: auto; }
  .page-header__actions { display: grid; grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .card-body { padding: 15px; }
  .page-guide__summary { grid-template-columns: 30px minmax(0, 1fr) 18px; gap: 9px; padding: 12px; }
  .page-guide__icon { width: 30px; height: 30px; }
  .page-guide__body { padding: 12px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar .field { width: 100%; }
  .work-item-heading { flex-direction: column; }
  .tree-node__row { grid-template-columns: 44px minmax(0, 1fr); }
  .tree-node__row .status-badge { grid-column: 2; justify-self: start; }
  .notification-item { grid-template-columns: 34px minmax(0, 1fr); }
  .notification-item time { grid-column: 2; }
  .auth-meta { flex-direction: column; }
  .auth-steps { grid-template-columns: 1fr; }
  .work-timer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timer-display { grid-column: 1 / -1; }
  .meta-list dd { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  body { background-attachment: scroll !important; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
