@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,500;9..144,700&display=swap");

:root {
  color-scheme: light;
  --bg: #eef3f8;
  --bg-soft: #f8fbff;
  --ink: #102135;
  --ink-soft: #455a72;
  --ink-muted: #6f8198;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-warm: #f59e0b;
  --danger: #b42318;
  --card: rgba(255, 255, 255, 0.74);
  --card-solid: #fdfefe;
  --panel-border: rgba(16, 33, 53, 0.12);
  --line: rgba(13, 148, 136, 0.28);
  --shadow: 0 18px 40px rgba(18, 29, 46, 0.12);
  --hero-surface-a: rgba(255, 255, 255, 0.78);
  --hero-surface-b: rgba(223, 245, 242, 0.72);
  --hero-border: rgba(13, 148, 136, 0.24);
  --hero-title: #0f1e31;
  --hero-subtitle: #30465e;
  --picker-bg: rgba(255, 255, 255, 0.18);
  --logo-shell-bg: rgba(255, 255, 255, 0.82);
  --logo-shell-border: rgba(13, 148, 136, 0.24);
  --logo-core-a: rgba(13, 148, 136, 0.34);
  --logo-core-b: rgba(56, 189, 248, 0.32);
  --logo-wave: #0f7f76;
  --logo-v: #0d4f49;
  --logo-dot-a: #f59e0b;
  --logo-dot-b: #f59e0b;
  --theme-toggle-bg: rgba(255, 255, 255, 0.58);
  --theme-toggle-border: rgba(16, 33, 53, 0.2);
  --theme-option-ink: #27435d;
  --theme-option-active-ink: #102135;
  --theme-thumb-bg: rgba(255, 255, 255, 0.92);
  --theme-thumb-shadow: 0 7px 16px rgba(16, 33, 53, 0.2);
  --theme-label: #35516e;
  --tab-bg: rgba(255, 255, 255, 0.62);
  --tab-bg-hover: rgba(255, 255, 255, 0.82);
  --tab-active-ink: #f2fffc;
  --tab-active-bg-a: #11a89a;
  --tab-active-bg-b: #0b7b73;
  --btn-ink: #f2fffc;
  --btn-secondary-bg: rgba(13, 148, 136, 0.12);
  --btn-secondary-border: rgba(13, 148, 136, 0.28);
  --btn-secondary-ink: #0f5f59;
  --table-hover: rgba(13, 148, 136, 0.08);
  --pill-success-bg: rgba(22, 163, 74, 0.2);
  --pill-success-ink: #0f7a35;
  --pill-danger-bg: rgba(185, 28, 28, 0.2);
  --pill-danger-ink: #9b1c1c;
  --pill-neutral-bg: rgba(127, 153, 184, 0.24);
  --pill-neutral-ink: #102135;
  --chart-grid: rgba(13, 148, 136, 0.2);
  --chart-axis: #314a63;
  --chart-bg-top: rgba(13, 148, 136, 0.08);
  --chart-bg-bottom: rgba(255, 255, 255, 0.78);
  --gauge-mid: rgba(255, 255, 255, 0.84);
  --gauge-border: rgba(13, 148, 136, 0.28);
  --gauge-center-line: rgba(16, 33, 53, 0.4);
  --gauge-needle-border: rgba(16, 33, 53, 0.22);
  --gauge-needle-shadow: 0 6px 14px rgba(16, 33, 53, 0.18);
  --gauge-warm: rgba(245, 158, 11, 0.28);
  --gauge-cool: rgba(13, 148, 136, 0.28);
  --focus-outline: rgba(13, 148, 136, 0.34);
  --chart-border: rgba(13, 148, 136, 0.24);
  --simulation-border: rgba(13, 148, 136, 0.38);
  --needle-bg: #ffffff;
  --field-bg: rgba(255, 255, 255, 0.94);
  --field-border: rgba(16, 33, 53, 0.2);
  --field-text: #13273d;
  --field-placeholder: #6f8198;
  --field-focus-ring: rgba(13, 148, 136, 0.28);
  --body-grad-a: rgba(245, 158, 11, 0.12);
  --body-grad-b: rgba(13, 148, 136, 0.14);
  --body-grad-c: #f7fafc;
  --body-grad-d: #eaf0f7;
  --orb-a: rgba(13, 148, 136, 0.34);
  --orb-b: rgba(245, 158, 11, 0.28);
  --radius: 16px;
  --text-soft: #576d87;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --liquid-bar-a: rgba(255, 255, 255, 0.84);
  --liquid-bar-b: rgba(223, 245, 242, 0.72);
  --liquid-edge: rgba(13, 148, 136, 0.24);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111d;
  --bg-soft: #0f1c2d;
  --ink: #f5f9ff;
  --ink-soft: #c4d2e6;
  --ink-muted: #8ea3bf;
  --accent: #2ee0cb;
  --accent-strong: #13b8aa;
  --accent-warm: #f8b84d;
  --danger: #ff7b7b;
  --card: rgba(17, 30, 48, 0.68);
  --card-solid: #122238;
  --panel-border: rgba(151, 177, 209, 0.25);
  --line: rgba(46, 224, 203, 0.32);
  --shadow: 0 26px 56px rgba(2, 7, 16, 0.55);
  --hero-surface-a: rgba(16, 34, 52, 0.82);
  --hero-surface-b: rgba(26, 49, 72, 0.76);
  --hero-border: rgba(88, 214, 201, 0.42);
  --hero-title: #f7fbff;
  --hero-subtitle: #d6e4f7;
  --picker-bg: rgba(10, 20, 34, 0.48);
  --logo-shell-bg: rgba(17, 33, 52, 0.9);
  --logo-shell-border: rgba(88, 214, 201, 0.42);
  --logo-core-a: rgba(46, 224, 203, 0.34);
  --logo-core-b: rgba(96, 165, 250, 0.3);
  --logo-wave: #6bf3e3;
  --logo-v: #d7fbf6;
  --logo-dot-a: #f8b84d;
  --logo-dot-b: #f8b84d;
  --theme-toggle-bg: rgba(9, 18, 31, 0.78);
  --theme-toggle-border: rgba(151, 177, 209, 0.34);
  --theme-option-ink: #b7cce7;
  --theme-option-active-ink: #f6fbff;
  --theme-thumb-bg: rgba(26, 44, 67, 0.95);
  --theme-thumb-shadow: 0 10px 22px rgba(0, 0, 0, 0.48);
  --theme-label: #cddcf0;
  --tab-bg: rgba(12, 22, 37, 0.56);
  --tab-bg-hover: rgba(20, 34, 54, 0.74);
  --tab-active-ink: #03201e;
  --tab-active-bg-a: #1bd6c4;
  --tab-active-bg-b: #0fa89d;
  --btn-ink: #032422;
  --btn-secondary-bg: rgba(46, 224, 203, 0.12);
  --btn-secondary-border: rgba(46, 224, 203, 0.36);
  --btn-secondary-ink: #b6fff5;
  --table-hover: rgba(46, 224, 203, 0.08);
  --pill-success-bg: rgba(74, 222, 128, 0.24);
  --pill-success-ink: #8cffc2;
  --pill-danger-bg: rgba(248, 113, 113, 0.22);
  --pill-danger-ink: #ffd0d0;
  --pill-neutral-bg: rgba(151, 177, 209, 0.2);
  --pill-neutral-ink: #f0f6ff;
  --chart-grid: rgba(46, 224, 203, 0.26);
  --chart-axis: #d7e5f7;
  --chart-bg-top: rgba(46, 224, 203, 0.12);
  --chart-bg-bottom: rgba(7, 17, 29, 0.75);
  --gauge-mid: rgba(10, 20, 34, 0.94);
  --gauge-border: rgba(46, 224, 203, 0.34);
  --gauge-center-line: rgba(214, 230, 250, 0.44);
  --gauge-needle-border: rgba(188, 213, 242, 0.34);
  --gauge-needle-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  --gauge-warm: rgba(248, 184, 77, 0.34);
  --gauge-cool: rgba(46, 224, 203, 0.34);
  --focus-outline: rgba(46, 224, 203, 0.4);
  --chart-border: rgba(46, 224, 203, 0.34);
  --simulation-border: rgba(46, 224, 203, 0.46);
  --needle-bg: #1a2d45;
  --field-bg: rgba(10, 20, 34, 0.96);
  --field-border: rgba(151, 177, 209, 0.44);
  --field-text: #f6fbff;
  --field-placeholder: #95abca;
  --field-focus-ring: rgba(46, 224, 203, 0.35);
  --body-grad-a: rgba(248, 184, 77, 0.12);
  --body-grad-b: rgba(46, 224, 203, 0.14);
  --body-grad-c: #07111d;
  --body-grad-d: #050d18;
  --orb-a: rgba(46, 224, 203, 0.28);
  --orb-b: rgba(248, 184, 77, 0.24);
  --text-soft: #9bb0cd;
  --liquid-bar-a: rgba(12, 23, 38, 0.92);
  --liquid-bar-b: rgba(22, 40, 61, 0.84);
  --liquid-edge: rgba(88, 214, 201, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, var(--body-grad-a), transparent 40%),
    radial-gradient(circle at 80% 10%, var(--body-grad-b), transparent 45%),
    linear-gradient(170deg, var(--body-grad-c) 0%, var(--body-grad-d) 100%);
  font-family: "Manrope", "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  font-feature-settings: "salt" 1, "ss01" 1;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
}

.app-shell {
  width: min(1220px, 100%);
  margin-inline: auto;
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  font-optical-sizing: auto;
  letter-spacing: 0.02em;
  margin: 0;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.bg-orb {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
}

.orb-a {
  top: -120px;
  right: -40px;
  background: var(--orb-a);
}

.orb-b {
  bottom: -110px;
  left: -80px;
  background: var(--orb-b);
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 26px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--hero-border);
  background: linear-gradient(130deg, var(--hero-surface-a), var(--hero-surface-b));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: fade-up 420ms ease-out;
}

.hero::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -80px;
  top: -220px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(46, 224, 203, 0.24), transparent 62%);
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.16));
}

.logo-shell {
  fill: var(--logo-shell-bg);
  stroke: var(--logo-shell-border);
  stroke-width: 2;
}

.logo-core-a {
  fill: var(--logo-core-a);
}

.logo-core-b {
  fill: var(--logo-core-b);
}

.logo-wave {
  fill: none;
  stroke: var(--logo-wave);
  stroke-width: 6;
  stroke-linecap: round;
}

.logo-v {
  fill: none;
  stroke: var(--logo-v);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-dot-a,
.logo-dot-b {
  fill: var(--logo-dot-a);
}

.logo-dot-b {
  fill: var(--logo-dot-b);
}

.eyebrow {
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.hero h1 {
  color: var(--hero-title);
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 1;
  text-wrap: balance;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--hero-subtitle);
  font-weight: 540;
  font-size: clamp(1.08rem, 1.8vw, 1.32rem);
  max-width: 680px;
  text-wrap: pretty;
}

.year-picker {
  min-width: 250px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--picker-bg);
}

.theme-controls {
  border-top: 1px solid var(--panel-border);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.theme-label {
  margin: 0;
  color: var(--theme-label);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.theme-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--theme-toggle-border);
  background: var(--theme-toggle-bg);
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--theme-thumb-bg);
  box-shadow: var(--theme-thumb-shadow);
  transition: transform 180ms ease;
  pointer-events: none;
}

.theme-toggle[data-mode="light"] .theme-toggle-thumb {
  transform: translateX(0);
}

.theme-toggle[data-mode="auto"] .theme-toggle-thumb {
  transform: translateX(100%);
}

.theme-toggle[data-mode="dark"] .theme-toggle-thumb {
  transform: translateX(200%);
}

.theme-option {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--theme-option-ink);
  min-height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 720;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0 8px;
  transition: color 160ms ease;
}

.theme-option.active {
  color: var(--theme-option-active-ink);
}

.theme-option:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 1px;
}

.theme-icon {
  font-size: 0.9rem;
  line-height: 1;
}

@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .hero,
  .year-picker,
  .panel,
  .metric-card,
  .tabs,
  .tab {
    backdrop-filter: blur(12px) saturate(130%);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
  }
}

.tabs {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(135deg, var(--liquid-bar-a), var(--liquid-bar-b));
  box-shadow: 0 12px 26px rgba(10, 22, 36, 0.14);
  position: relative;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.tab {
  border: 1px solid var(--line);
  background: var(--tab-bg);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 730;
  letter-spacing: 0.01em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  position: relative;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.tab::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.32;
  transition: opacity 160ms ease, transform 160ms ease;
}

.tab:hover {
  transform: translateY(-1px);
  background: var(--tab-bg-hover);
}

.tab.active {
  color: var(--tab-active-ink);
  background: linear-gradient(120deg, var(--tab-active-bg-a), var(--tab-active-bg-b));
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(6, 49, 57, 0.28);
}

.tab.active::before {
  opacity: 1;
  transform: scale(1.12);
}

.tab:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline-offset: 2px;
}

.tab-panel {
  display: none;
  animation: fade-up 260ms ease-out;
  min-width: 0;
}

.tab-panel.active {
  display: block;
}

main {
  min-width: 0;
  padding-bottom: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.metric-card {
  border: 1px solid var(--panel-border);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric-card h3 {
  font-size: 0.96rem;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.panel-grid.two-cols {
  margin-top: 0;
}

.gauge-panel {
  margin-top: 14px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  min-width: 0;
}

.editing-focus {
  outline: 3px solid var(--focus-outline);
  transition: outline 220ms ease;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.inline-filters {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
  font-weight: 580;
  color: var(--ink-soft);
  min-width: 0;
}

input,
select,
button {
  font: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 10px 11px;
  background: var(--field-bg);
  color: var(--field-text);
  width: 100%;
  min-width: 0;
  min-height: 44px;
  line-height: 1.2;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-grid > * {
  min-width: 0;
}

input::placeholder {
  color: var(--field-placeholder);
  opacity: 1;
}

input:not([type="checkbox"]):not([type="radio"]):disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus {
  outline: 2px solid var(--field-focus-ring);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 18px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 740;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: var(--btn-ink);
  box-shadow: 0 8px 18px rgba(4, 35, 41, 0.22);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(4, 35, 41, 0.28);
}

.btn.secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-ink);
  border: 1px solid var(--btn-secondary-border);
  box-shadow: none;
}

.btn.ghost {
  background: rgba(127, 153, 184, 0.14);
  color: var(--ink-soft);
  box-shadow: none;
}

.btn.danger {
  background: rgba(185, 35, 24, 0.16);
  color: var(--danger);
  border: 1px solid rgba(185, 35, 24, 0.28);
  box-shadow: none;
}

.btn.tiny {
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.79rem;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.table-wrap > table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.9rem;
}

th {
  color: var(--ink-soft);
  font-weight: 760;
}

tr:hover td {
  background: var(--table-hover);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.balance-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.balance-pill.en_avance {
  background: var(--pill-success-bg);
  color: var(--pill-success-ink);
}

.balance-pill.en_retard {
  background: var(--pill-danger-bg);
  color: var(--pill-danger-ink);
}

.balance-pill.equilibre {
  background: var(--pill-neutral-bg);
  color: var(--pill-neutral-ink);
}

.chart {
  width: 100%;
  height: 260px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--chart-bg-top), var(--chart-bg-bottom));
  border: 1px solid var(--chart-border);
}

.simulation-result {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed var(--simulation-border);
  border-radius: 10px;
  min-height: 42px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gauge-hint {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.relative-gauge {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.gauge-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--ink-soft);
}

.gauge-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--gauge-warm) 0%,
    var(--gauge-mid) 48%,
    var(--gauge-mid) 52%,
    var(--gauge-cool) 100%
  );
  border: 1px solid var(--gauge-border);
}

.gauge-center-line {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 2px;
  height: 30px;
  transform: translateX(-50%);
  background: var(--gauge-center-line);
}

.gauge-needle {
  position: absolute;
  top: -7px;
  left: var(--needle-left, 50%);
  width: 18px;
  height: 26px;
  border-radius: 9px;
  transform: translateX(-50%);
  border: 1px solid var(--gauge-needle-border);
  background: var(--needle-bg);
  box-shadow: var(--gauge-needle-shadow);
}

.gauge-value {
  font-weight: 700;
  color: var(--accent-strong);
}

@media (hover: none) and (pointer: coarse) {
  .tab:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
    box-shadow: 0 8px 18px rgba(4, 35, 41, 0.22);
  }
}

@media (max-width: 900px) {
  body {
    padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom))
      calc(14px + var(--safe-left));
  }

  .hero {
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 72px;
    height: 72px;
  }

  .year-picker {
    width: 100%;
    min-width: 0;
  }

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

@media (max-width: 760px) {
  body {
    padding: calc(10px + var(--safe-top)) calc(10px + var(--safe-right)) calc(104px + var(--safe-bottom))
      calc(10px + var(--safe-left));
  }

  main {
    padding-bottom: calc(132px + var(--safe-bottom));
  }

  .hero {
    padding: 16px 14px;
    gap: 14px;
    margin-bottom: 12px;
    border-radius: 20px;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-logo {
    width: 62px;
    height: 62px;
  }

  .subtitle {
    font-size: 1.02rem;
  }

  .tabs {
    position: fixed;
    left: calc(10px + var(--safe-left));
    right: calc(10px + var(--safe-right));
    bottom: calc(10px + var(--safe-bottom));
    z-index: 60;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 0;
    gap: 6px;
    padding: 7px;
    border-radius: 24px;
    border-color: var(--liquid-edge);
    background: linear-gradient(140deg, var(--liquid-bar-a), var(--liquid-bar-b));
    box-shadow: 0 22px 38px rgba(4, 15, 29, 0.24);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .tab {
    flex: 0 0 auto;
    min-width: 102px;
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 0.84rem;
    scroll-snap-align: center;
  }

  .panel {
    padding: 14px;
    margin-bottom: 12px;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .inline-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .inline-filters > * {
    flex: 1 1 160px;
    min-width: 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric-card {
    padding: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-actions {
    flex-wrap: wrap;
    padding-top: 10px;
  }

  .row-actions {
    flex-wrap: wrap;
  }
}

@media (display-mode: standalone) and (max-width: 760px) {
  body {
    padding-top: calc(6px + var(--safe-top));
  }

  .bg-orb {
    opacity: 0.36;
  }
}

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

.hidden {
  display: none !important;
}

.auth-root {
  max-width: 560px;
  margin: calc(40px + var(--safe-top)) auto 20px;
  padding: 0 16px;
}

.auth-panel {
  margin-bottom: 16px;
}

.auth-message {
  margin-top: 12px;
  color: var(--text-soft);
  word-break: break-word;
}

.auth-session {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 12px;
}

.auth-session p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}
