:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --text: #17202a;
  --muted: #657384;
  --line: #dbe3ec;
  --primary: #1769aa;
  --primary-strong: #0f4f83;
  --accent: #18a999;
  --warning: #f6b73c;
  --danger: #c84646;
  --shadow: 0 22px 60px rgba(25, 41, 61, 0.12);
  --radius: 8px;
}

:root[data-theme="dark"] {
  --bg: #0f1720;
  --surface: #182333;
  --surface-soft: #223044;
  --text: #edf4fb;
  --muted: #a9b7c7;
  --line: #2d3d52;
  --primary: #61a8ff;
  --primary-strong: #9ecbff;
  --accent: #23c7b7;
  --warning: #f2b84b;
  --danger: #ff7777;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Heebo", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(23, 105, 170, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(24, 169, 153, 0.12), transparent 28%),
    var(--bg);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(97, 168, 255, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(35, 199, 183, 0.1), transparent 28%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-shell,
.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.login-shell {
  display: block;
  max-width: 760px;
}

.login-hero,
.login-panel,
.hero-section,
.panel,
.data-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.login-hero {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 64px);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 800;
}

.eyebrow {
  margin: 36px 0 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.lead {
  max-width: 58ch;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.google-button,
.small-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.google-button {
  width: fit-content;
  min-height: 54px;
  gap: 12px;
  padding: 0 22px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  box-shadow: 0 16px 32px rgba(23, 105, 170, 0.26);
}

.google-button:hover,
.small-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.google-button.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

.google-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  font-weight: 800;
}

.notice {
  max-width: 680px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #c9d8e6;
  border-radius: var(--radius);
  color: #254864;
  background: #edf6ff;
  line-height: 1.6;
}

.notice-error {
  border-color: #ecc5c5;
  color: #813333;
  background: #fff1f1;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 5vw, 40px);
  color: #fff;
  background:
    linear-gradient(160deg, rgba(15, 79, 131, 0.96), rgba(18, 71, 94, 0.96)),
    var(--primary-strong);
}

.status-card {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.status-card p,
.status-card small {
  color: rgba(255, 255, 255, 0.72);
}

.status-card strong {
  display: block;
  direction: ltr;
  text-align: right;
  font-size: 1.35rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(24, 169, 153, 0.16);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-grid div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.metric-grid strong,
.metric-grid span {
  display: block;
}

.metric-grid span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.7);
}

.app-shell {
  padding: 24px 16px 48px;
}

.sheet-app-shell {
  width: min(1480px, 100%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.user-menu img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.user-menu strong,
.user-menu span {
  display: block;
}

.user-menu span {
  direction: ltr;
  color: var(--muted);
  font-size: 0.9rem;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-color: var(--line);
  color: var(--primary);
  background: var(--surface);
  font-size: 1.3rem;
}

.theme-toggle {
  color: var(--warning);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  align-items: end;
  padding: clamp(24px, 5vw, 48px);
  margin-bottom: 18px;
}

.hero-section h1 {
  max-width: 13ch;
  margin-bottom: 14px;
}

.access-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.access-card strong,
.access-card small {
  display: block;
  direction: ltr;
  text-align: right;
}

.access-card small {
  margin-top: 10px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.data-card {
  padding: 22px;
}

.data-card span,
.data-card p {
  color: var(--muted);
}

.data-card strong {
  display: block;
  margin: 10px 0;
  font-size: 2rem;
}

.data-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 16px;
}

.panel {
  padding: 22px;
}

.section-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title .eyebrow {
  margin-top: 0;
}

.small-button {
  min-height: 40px;
  padding: 0 14px;
  border-color: var(--line);
  color: var(--primary);
  background: var(--surface);
  font-weight: 700;
}

.chart {
  height: 280px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.bar {
  min-height: 18px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  position: relative;
}

.bar span {
  position: absolute;
  right: 50%;
  bottom: -28px;
  transform: translateX(50%);
  color: var(--muted);
  font-size: 0.78rem;
}

.source-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.source-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.source-list li:last-child {
  border-bottom: 0;
}

.sheet-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, auto);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.sheet-toolbar .eyebrow {
  margin-top: 0;
}

.sheet-toolbar h1 {
  max-width: none;
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.dashboard-title img {
  width: clamp(150px, 22vw, 260px);
  height: auto;
  display: block;
}

.dashboard-title h1 {
  margin-bottom: 0;
}

.sheet-toolbar .lead {
  margin-bottom: 0;
}

.sheet-actions {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.access-card.compact {
  min-width: 300px;
  padding: 14px 16px;
}

.access-card.compact p {
  margin: 6px 0 2px;
}

.primary-link {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.sheet-panel {
  height: calc(100vh - 270px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.sheet-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #fff;
}

.dashboard-notice {
  max-width: none;
}

.money-mascot-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.speech-bubble {
  position: relative;
  padding: 20px;
  border: 3px solid var(--text);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 7px 7px 0 color-mix(in srgb, var(--text) 16%, transparent);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 54%;
  width: 30px;
  height: 30px;
  border-left: 3px solid var(--text);
  border-bottom: 3px solid var(--text);
  background: var(--surface);
  transform: rotate(45deg);
}

.speech-bubble .eyebrow {
  margin-top: 0;
}

.speech-bubble h2 {
  margin-bottom: 12px;
}

.speech-bubble ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.speech-bubble li {
  color: var(--muted);
  font-weight: 700;
}

.speech-bubble strong {
  direction: ltr;
  display: inline-block;
  color: var(--text);
  font-size: 1.35rem;
  margin-left: 6px;
}

.money-mascot {
  width: 180px;
  height: 210px;
  position: relative;
  justify-self: center;
}

.money-body {
  width: 132px;
  height: 154px;
  position: absolute;
  left: 24px;
  top: 14px;
  display: grid;
  place-items: center;
  border: 4px solid #0f5b36;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 8px, transparent 8px 22px),
    linear-gradient(135deg, #32d276, #0e9f55);
  box-shadow: inset 0 -14px 0 rgba(4, 92, 49, 0.22), 0 18px 24px rgba(0, 0, 0, 0.16);
  animation: mascot-bob 2.8s ease-in-out infinite;
  z-index: 3;
}

.money-symbol {
  color: #eaffcf;
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.16);
}

.money-eye {
  width: 24px;
  height: 24px;
  position: absolute;
  top: 42px;
  display: grid;
  place-items: center;
  border: 3px solid #083b25;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}

.money-eye span {
  width: 9px;
  height: 9px;
  display: block;
  border-radius: 50%;
  background: #102015;
  animation: eye-wander 3.2s ease-in-out infinite;
}

.eye-left {
  right: 31px;
}

.eye-right {
  left: 31px;
}

.money-smile {
  width: 32px;
  height: 15px;
  position: absolute;
  bottom: 38px;
  border-bottom: 4px solid #083b25;
  border-radius: 0 0 999px 999px;
}

.money-arm,
.money-leg {
  position: absolute;
  background: #0f8f51;
  border: 3px solid #0f5b36;
  border-radius: 999px;
  z-index: 2;
}

.money-arm {
  width: 18px;
  height: 70px;
  top: 70px;
}

.arm-left {
  left: 14px;
  transform-origin: top center;
  transform: rotate(24deg);
  animation: arm-wave 1.7s ease-in-out infinite;
}

.arm-right {
  right: 14px;
  transform: rotate(-24deg);
}

.money-leg {
  width: 18px;
  height: 44px;
  bottom: 12px;
}

.leg-left {
  left: 60px;
  animation: leg-tap 1.8s ease-in-out infinite;
}

.leg-right {
  right: 60px;
  animation: leg-tap 1.8s ease-in-out infinite reverse;
}

.money-shadow {
  width: 124px;
  height: 20px;
  position: absolute;
  left: 28px;
  bottom: 2px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  animation: shadow-pulse 2.8s ease-in-out infinite;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes eye-wander {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(5px, -1px); }
  55% { transform: translate(-5px, 2px); }
  75% { transform: translate(1px, 4px); }
}

@keyframes arm-wave {
  0%, 100% { transform: rotate(24deg); }
  50% { transform: rotate(48deg) translateY(-4px); }
}

@keyframes leg-tap {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@keyframes shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.16; }
  50% { transform: scaleX(0.82); opacity: 0.1; }
}

.gauge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.gauge-card,
.bar-dashboard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

.gauge-card {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 22px;
}

.gauge-card span {
  color: var(--muted);
  font-weight: 700;
}

.gauge-card strong {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

.gauge-card .small-value {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.bar-dashboard {
  padding: 24px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.compact-chart-card {
  min-width: 0;
  padding: 18px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-soft) 78%, transparent)),
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 34%);
}

.compact-chart-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.04));
}

.compact-chart-card > * {
  position: relative;
  z-index: 1;
}

.compact-chart-card .section-title {
  margin-bottom: 14px;
}

.compact-chart-card h2 {
  font-size: 1.12rem;
}

.task-bar-chart {
  height: min(58vh, 560px);
  min-height: 380px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 24px 10px 0;
  border-top: 1px solid var(--line);
  position: relative;
  background:
    linear-gradient(to top, color-mix(in srgb, var(--primary) 9%, transparent) 0 1px, transparent 1px 25%),
    radial-gradient(ellipse at center bottom, color-mix(in srgb, var(--accent) 13%, transparent), transparent 58%);
  border-radius: var(--radius);
  transform-style: preserve-3d;
}

.task-bar-chart::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 48px;
  height: 34px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(20, 38, 56, 0.16), transparent 70%);
  filter: blur(2px);
}

.compact-bar-chart {
  height: 310px;
  min-height: 310px;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 9px;
  padding-top: 16px;
}

.task-bar-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  height: 100%;
  position: relative;
  z-index: 1;
}

.task-bar-track {
  height: 100%;
  display: flex;
  align-items: end;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 18%, rgba(0, 0, 0, 0.08) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 68%, #fff), var(--surface-soft));
  box-shadow:
    inset 5px 0 10px rgba(255, 255, 255, 0.28),
    inset -6px 0 10px rgba(0, 0, 0, 0.08),
    0 12px 18px rgba(18, 38, 63, 0.12);
  overflow: visible;
  transform: perspective(560px) rotateX(2deg);
}

.combined-track {
  position: relative;
}

.task-bar-fill {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: start;
  justify-content: center;
  padding-top: 10px;
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  font-weight: 800;
  position: relative;
  transform-style: preserve-3d;
  box-shadow:
    inset 8px 0 12px rgba(255, 255, 255, 0.22),
    inset -10px 0 14px rgba(0, 0, 0, 0.18),
    0 14px 22px rgba(23, 105, 170, 0.24);
}

.task-bar-fill::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 13px;
  border-radius: var(--radius) var(--radius) 2px 2px;
  background: rgba(255, 255, 255, 0.36);
  transform: translateY(-6px) skewX(-18deg);
  transform-origin: bottom;
}

.task-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 18px;
  border-radius: 0 var(--radius) 0 0;
  background: rgba(0, 0, 0, 0.12);
}

.task-bar-fill.total-fill {
  background: linear-gradient(155deg, #45e3cf 0%, var(--accent) 32%, var(--primary) 100%);
}

.task-bar-fill.open-fill {
  background: linear-gradient(155deg, #ffe08a 0%, var(--warning) 38%, #c97917 100%);
}

.task-bar-fill.potential-fill {
  background: linear-gradient(155deg, #c5bcff 0%, #8e7dff 36%, #5d53c7 100%);
}

.overlay-fill {
  position: absolute;
  left: 18%;
  bottom: 0;
  width: 64%;
  z-index: 2;
  box-shadow:
    inset 7px 0 10px rgba(255, 255, 255, 0.24),
    inset -8px 0 12px rgba(0, 0, 0, 0.16),
    0 -8px 18px rgba(0, 0, 0, 0.16);
}

.task-bar-fill span {
  direction: ltr;
}

.task-bar-item strong {
  min-height: 42px;
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
  text-align: center;
}

.task-bar-item strong small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: -8px 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chart-legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
}

.legend-total {
  background: var(--primary);
}

.legend-open {
  background: var(--warning);
}

.legend-potential {
  background: #6f63e8;
}

.potential-dashboard {
  margin-top: 0;
}

.potential-summary {
  min-width: 180px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.potential-summary span,
.potential-summary strong {
  display: block;
}

.potential-summary span {
  color: var(--muted);
  font-weight: 700;
}

.potential-summary strong {
  direction: ltr;
  margin-top: 4px;
  font-size: 1.35rem;
}

.age-dashboard {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-soft) 76%, transparent)),
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--warning) 18%, transparent), transparent 34%);
  box-shadow: var(--shadow);
}

.age-dashboard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.04));
}

.age-dashboard > * {
  position: relative;
  z-index: 1;
}

.age-bars {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(to left, color-mix(in srgb, var(--primary) 8%, transparent) 0 1px, transparent 1px 25%),
    radial-gradient(ellipse at right center, color-mix(in srgb, var(--warning) 12%, transparent), transparent 58%);
  border-radius: var(--radius);
  padding: 18px 12px 4px;
}

.age-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
}

.age-row strong {
  color: var(--text);
  font-size: 0.95rem;
  padding: 8px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
}

.age-row b {
  direction: ltr;
  color: var(--text);
  text-align: left;
  font-size: 1.1rem;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.age-track {
  height: 28px;
  overflow: visible;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.26), transparent 20%, rgba(0, 0, 0, 0.08)),
    var(--surface-soft);
  box-shadow:
    inset 5px 0 10px rgba(255, 255, 255, 0.25),
    inset -7px 0 12px rgba(0, 0, 0, 0.1),
    0 10px 16px rgba(18, 38, 63, 0.1);
  transform: perspective(520px) rotateX(3deg);
}

.age-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  position: relative;
  background: linear-gradient(90deg, var(--accent), var(--warning));
  box-shadow:
    inset 8px 0 14px rgba(255, 255, 255, 0.22),
    inset -10px 0 14px rgba(0, 0, 0, 0.16),
    0 8px 16px color-mix(in srgb, var(--warning) 28%, transparent);
}

.age-track span::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.age-row:nth-child(1) .age-track span {
  background: linear-gradient(90deg, #20d9aa, #18a999);
}

.age-row:nth-child(2) .age-track span {
  background: linear-gradient(90deg, #65c7ff, #1769aa);
}

.age-row:nth-child(3) .age-track span {
  background: linear-gradient(90deg, #ffe08a, var(--warning));
}

.age-row:nth-child(4) .age-track span {
  background: linear-gradient(90deg, #ff8a8a, var(--danger));
}

.traffic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.traffic-card {
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-soft) 78%, transparent)),
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 35%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.traffic-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.04));
}

.traffic-card > * {
  position: relative;
  z-index: 1;
}

.traffic-card .eyebrow {
  margin-top: 0;
}

.traffic-card h2 {
  font-size: 1.35rem;
}

.traffic-light {
  width: 74px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, #000);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 42%, rgba(0, 0, 0, 0.18)),
    #182432;
  box-shadow:
    inset 5px 0 10px rgba(255, 255, 255, 0.12),
    inset -8px 0 12px rgba(0, 0, 0, 0.32),
    0 18px 24px rgba(0, 0, 0, 0.18);
}

.traffic-light span {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 50%;
  position: relative;
  box-shadow:
    inset 6px 8px 10px rgba(255, 255, 255, 0.24),
    inset -8px -10px 12px rgba(0, 0, 0, 0.22);
}

.traffic-light span::after {
  content: "";
  position: absolute;
  inset: 8px 10px auto auto;
  width: 14px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(0.3px);
}

.traffic-red {
  background: radial-gradient(circle at 34% 24%, #ffd1d1, #ff4f5f 38%, #a9192a 100%);
  box-shadow:
    0 0 22px rgba(255, 79, 95, 0.42),
    inset 6px 8px 10px rgba(255, 255, 255, 0.24),
    inset -8px -10px 12px rgba(0, 0, 0, 0.22);
}

.traffic-yellow {
  background: radial-gradient(circle at 34% 24%, #fff7bf, #ffc83d 40%, #b7750c 100%);
  box-shadow:
    0 0 22px rgba(255, 200, 61, 0.42),
    inset 6px 8px 10px rgba(255, 255, 255, 0.24),
    inset -8px -10px 12px rgba(0, 0, 0, 0.22);
}

.traffic-green {
  background: radial-gradient(circle at 34% 24%, #caffdf, #22d172 42%, #087842 100%);
  box-shadow:
    0 0 22px rgba(34, 209, 114, 0.42),
    inset 6px 8px 10px rgba(255, 255, 255, 0.24),
    inset -8px -10px 12px rgba(0, 0, 0, 0.22);
}

.traffic-light:not(.active-red) .traffic-red,
.traffic-light:not(.active-yellow) .traffic-yellow,
.traffic-light:not(.active-green) .traffic-green {
  opacity: 0.3;
  filter: saturate(0.55);
  box-shadow:
    inset 6px 8px 10px rgba(255, 255, 255, 0.16),
    inset -8px -10px 12px rgba(0, 0, 0, 0.3);
}

.traffic-light.active-green .traffic-green,
.traffic-light.active-yellow .traffic-yellow,
.traffic-light.active-red .traffic-red {
  opacity: 1;
  filter: saturate(1.2) brightness(1.08);
  transform: scale(1.08);
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.check-list {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.check-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.check-row span {
  font-weight: 800;
}

.check-row p {
  grid-column: 1 / -1;
  margin: 0;
  direction: ltr;
  color: var(--muted);
  text-align: left;
  overflow-wrap: anywhere;
}

.check-row.is-ok span {
  color: var(--accent);
}

.check-row.is-bad span {
  color: var(--danger);
}

@media (max-width: 900px) {
  .login-shell,
  .hero-section,
  .content-grid,
  .dashboard-grid,
  .sheet-toolbar,
  .gauge-grid,
  .charts-grid,
  .money-mascot-panel,
  .traffic-grid {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .sheet-actions {
    justify-items: stretch;
  }

  .access-card.compact {
    min-width: 0;
  }

  .sheet-panel {
    height: 72vh;
    min-height: 520px;
  }

  .task-bar-chart {
    min-height: 340px;
    overflow-x: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(76px, 92px);
    grid-template-columns: none;
    padding-bottom: 8px;
  }

  .compact-bar-chart {
    height: 320px;
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .app-header,
  .user-menu,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.6rem);
  }

  .google-button {
    width: 100%;
  }

  .chart {
    gap: 6px;
  }

  .sheet-toolbar {
    padding: 18px;
  }

  .sheet-panel {
    min-height: 460px;
  }

  .money-mascot-panel {
    padding: 16px;
  }

  .speech-bubble::before {
    left: 48%;
    top: auto;
    bottom: -18px;
    transform: rotate(-45deg);
  }

  .age-row {
    grid-template-columns: 1fr 40px;
  }

  .age-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
