:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --bg-2: #efe7da;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: #fbf7ef;
  --primary: #1f5c4d;
  --primary-2: #2e7a67;
  --primary-soft: #cfe7dc;
  --accent: #d6a84f;
  --accent-soft: #f7e6bf;
  --warning: #f2b84b;
  --danger: #b85c5c;
  --ink: #1f2933;
  --muted: #667085;
  --border: #e7e2d8;
  --ring: rgba(31, 92, 77, 0.3);
  --shadow: 0 20px 65px rgba(61, 45, 24, 0.12);
  --shadow-soft: 0 10px 32px rgba(61, 45, 24, 0.09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --max: 1220px;
  --input-bg: var(--surface-strong);
  --input-border: var(--border);
  --input-text: var(--ink);
  --input-placeholder: var(--muted);
  --input-disabled-bg: var(--surface-muted);
  --input-disabled-text: var(--muted);
  --toast-bg: var(--ink);
  --toast-text: var(--bg);
  --modal-overlay: rgba(13, 20, 18, 0.36);
  --chip-bg: var(--surface);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101815;
  --bg-2: #14211d;
  --surface: rgba(22, 35, 31, 0.86);
  --surface-strong: #16231f;
  --surface-muted: #1b2d27;
  --primary: #98d5bf;
  --primary-2: #65b89a;
  --primary-soft: #21453a;
  --accent: #e2bd6e;
  --accent-soft: #3f321e;
  --warning: #f2b84b;
  --danger: #d47b7b;
  --ink: #edf7f2;
  --muted: #aec2ba;
  --border: #2a3c36;
  --ring: rgba(152, 213, 191, 0.35);
  --shadow: 0 20px 65px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.24);
  --input-bg: #16231f;
  --input-border: #2a3c36;
  --input-text: #edf7f2;
  --input-placeholder: #8fa89e;
  --input-disabled-bg: #1b2d27;
  --input-disabled-text: #8fa89e;
  --toast-bg: #edf7f2;
  --toast-text: #101815;
  --modal-overlay: rgba(0, 0, 0, 0.55);
  --chip-bg: #1b2d27;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(214,168,79,.18), transparent 28rem),
    radial-gradient(circle at 95% 8%, rgba(31,92,77,.13), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg-2));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 999;
  padding: .8rem 1rem;
  background: var(--primary);
  color: var(--bg);
  border-radius: 999px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

.app-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  min-height: 100vh;
  padding: 1.2rem 1rem calc(7.5rem + env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .4rem 0 1.2rem;
}
.logo-lockup {
  display: flex;
  align-items: center;
  gap: .9rem;
}
.logo-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.26), transparent);
  transform: rotate(25deg) translateX(-80%);
  animation: sheen 7s var(--ease) infinite;
}
.logo-title { font-weight: 850; letter-spacing: -0.04em; font-size: clamp(1.4rem, 2.7vw, 2.2rem); line-height: 1; }
.logo-subtitle { color: var(--muted); font-size: .9rem; margin-top: .22rem; }
.header-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.button, .icon-button, .chip-button {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--bg);
  padding: .82rem 1.05rem;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(31,92,77,.18);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  min-height: 44px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.button:hover, .icon-button:hover, .chip-button:hover { transform: translateY(-1px); box-shadow: 0 16px 28px rgba(31,92,77,.22); }
.button:active, .icon-button:active, .chip-button:active { transform: translateY(0); }
.button.secondary { background: var(--surface-strong); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); box-shadow: none; }
.button.warning { background: var(--warning); color: #3e2b00; }
.button.danger { background: var(--danger); color: #fff; }
.button-small { padding: .55rem .75rem; min-height: 36px; font-size: .9rem; }
.icon-button { width: 44px; padding: 0; border: 1px solid var(--border); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.chip-button { min-height: 36px; padding: .45rem .7rem; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: none; font-size: .88rem; }
.chip-button.active { background: var(--primary); color: var(--bg); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 1rem;
  align-items: stretch;
}
.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2vw, 1.4rem);
  animation: fadeUp .45s var(--ease) both;
}
.card.no-animate { animation: none; }
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.kicker { color: var(--primary-2); font-size: .82rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3 { margin: 0; letter-spacing: -0.04em; line-height: 1.05; }
h1 { font-size: clamp(2.3rem, 6vw, 5.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); }
h3 { font-size: 1.12rem; }
p { margin: .45rem 0 0; color: var(--muted); }
.large-copy { font-size: clamp(1.02rem, 2vw, 1.24rem); max-width: 65ch; }
.hero-title span { color: var(--primary); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.disclaimer {
  margin-top: 1rem;
  padding: .8rem .9rem;
  background: var(--surface-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: .92rem;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--primary-soft);
  color: var(--primary);
  padding: .45rem .7rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .86rem;
}
.badge-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(214,168,79,.14);
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.metric-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  min-height: 112px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: "";
  position: absolute;
  inset: auto -30% -45% 42%;
  height: 90px;
  background: radial-gradient(circle, rgba(214,168,79,.18), transparent 65%);
}
.metric-label { color: var(--muted); font-weight: 700; font-size: .84rem; }
.metric-value { font-size: clamp(1.35rem, 2.4vw, 1.9rem); font-weight: 900; letter-spacing: -0.04em; margin-top: .25rem; }
.metric-note { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
.metric-negative { color: var(--danger); }
.metric-positive { color: var(--primary-2); }

.progress-ring {
  --p: 42;
  --ring-size: clamp(152px, 42vw, 180px);
  --ring-inset: 14px;
  width: var(--ring-size);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: .3rem auto 1rem;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--border) 0);
  position: relative;
  flex-shrink: 0;
  transition: background .6s var(--ease);
}
.progress-ring.gate-unlocked { animation: gateUnlock .8s var(--ease); }
.progress-ring::after {
  content: "";
  position: absolute;
  inset: var(--ring-inset);
  border-radius: inherit;
  background: var(--surface-strong);
}
.progress-ring__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: calc(var(--ring-size) - var(--ring-inset) * 2 - 10px);
  padding: 0 4px;
  line-height: 1.1;
}
.progress-ring__score {
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 950;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.progress-ring__label {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: clamp(.62rem, 2.2vw, .75rem);
  font-weight: 800;
  line-height: 1.15;
  hyphens: auto;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(.8rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 1rem), 760px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .4rem;
  padding: .45rem;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 20px 70px rgba(32,24,12,.16);
  z-index: 40;
}
[data-theme="dark"] .bottom-nav { background: rgba(22,35,31,.82); }
.nav-item {
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  padding: .55rem .25rem;
  min-height: 54px;
  font-weight: 750;
}
.nav-item span:first-child { font-size: 1.1rem; }
.nav-item span:last-child { font-size: .72rem; }
.nav-item.active { background: var(--primary); color: var(--bg); box-shadow: 0 10px 28px rgba(31,92,77,.22); }

.section { margin-top: 1rem; }
.stack { display: grid; gap: 1rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); gap: 1rem; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

.phase-map { display: grid; grid-template-columns: repeat(8, minmax(92px, 1fr)); gap: .55rem; overflow-x: auto; padding-bottom: .4rem; }
.phase-node {
  min-width: 96px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: 18px;
  padding: .8rem;
  position: relative;
  overflow: hidden;
}
.phase-node.current { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.phase-node.done { background: var(--primary-soft); }
.phase-node strong { display: block; font-size: .86rem; line-height: 1.15; }
.phase-node small { color: var(--muted); font-weight: 800; }

.checklist { display: grid; gap: .6rem; }
.check-item {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .8rem;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  transition: transform .18s var(--ease), background .18s var(--ease), opacity .18s var(--ease);
}
.check-item:hover { transform: translateY(-1px); }
.check-item input { width: 1.2rem; height: 1.2rem; accent-color: var(--primary); flex: 0 0 auto; margin-top: .15rem; }
.check-item.done { background: var(--primary-soft); opacity: .86; }
.check-item.done strong { text-decoration: line-through; }
.check-item small { display: block; color: var(--muted); margin-top: .12rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 800; font-size: .88rem; }
.field small { color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--input-text);
  padding: .83rem .92rem;
  outline: none;
  min-height: 46px;
  font-size: 16px;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--input-placeholder); opacity: 1; }
input:disabled, select:disabled, textarea:disabled {
  background: var(--input-disabled-bg);
  color: var(--input-disabled-text);
  cursor: not-allowed;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--input-text);
  box-shadow: 0 0 0 1000px var(--input-bg) inset;
  transition: background-color 9999s ease-out 0s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-color: var(--primary);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: .75rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }

.segmented { display: inline-flex; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 999px; padding: .25rem; gap: .2rem; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--muted); font-weight: 800; padding: .5rem .8rem; border-radius: 999px; }
.segmented button.active { background: var(--primary); color: var(--bg); }

.debt-list { display: grid; gap: .7rem; }
.debt-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .9rem;
}
.debt-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-weight: 750;
  font-size: .78rem;
  color: var(--muted);
}
.pill.good { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.pill.warn { color: #744a00; background: var(--accent-soft); border-color: transparent; }
.pill.danger { color: #fff; background: var(--danger); border-color: transparent; }

.mountain {
  height: 190px;
  display: grid;
  place-items: end center;
  padding: .7rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(31,92,77,.08), transparent);
  overflow: hidden;
}
.mountain svg { width: 100%; height: 170px; }
.mountain .peak { transition: transform .7s var(--ease); transform-origin: bottom; }

.jar, .shield {
  width: min(210px, 70vw);
  aspect-ratio: 1;
  margin: 0 auto;
  position: relative;
  display: grid;
  place-items: center;
}
.jar::before, .shield::before {
  content: "";
  position: absolute;
  inset: 12%;
  background: conic-gradient(var(--accent) var(--fill, 42%), var(--border) 0);
  border-radius: 50%;
  box-shadow: inset 0 0 0 16px var(--surface-strong), var(--shadow-soft);
}
.jar span, .shield span { position: relative; font-size: 2rem; font-weight: 950; }

.calendar-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: .35rem; }
.day-dot { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-strong); display: grid; place-items: center; color: var(--muted); font-size: .78rem; font-weight: 800; }
.day-dot.done { background: var(--primary); color: var(--bg); animation: pop .28s var(--ease); }
.day-dot.today { box-shadow: 0 0 0 4px var(--ring); }

.lesson-card, .source-card, .badge-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}
.lesson-card.completed { background: var(--primary-soft); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0; }
.badge-card { display: flex; gap: .8rem; align-items: flex-start; }
.badge-icon { width: 42px; height: 42px; border-radius: 16px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.3rem; flex: 0 0 auto; }
.badge-card.locked { opacity: .55; filter: grayscale(.7); }

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(13, 20, 18, .36);
  backdrop-filter: blur(20px);
}
.onboarding-card {
  width: min(720px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 34px;
  box-shadow: 0 30px 100px rgba(0,0,0,.25);
  padding: clamp(1.1rem, 3vw, 2rem);
  animation: modalIn .35s var(--ease);
}
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; margin: 1rem 0; }
.stepper span { height: 8px; border-radius: 999px; background: var(--border); }
.stepper span.active { background: var(--primary); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(6.4rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: .85rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.install-banner {
  position: fixed;
  left: 50%;
  top: 1rem;
  transform: translateX(-50%);
  z-index: 75;
  width: min(calc(100% - 2rem), 620px);
  display: flex;
  align-items: center;
  gap: .7rem;
  justify-content: space-between;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .5rem .55rem .5rem 1rem;
  box-shadow: var(--shadow);
}
.noscript-card { margin: 2rem auto; width: min(720px, calc(100% - 2rem)); background: white; color: #1f2933; border-radius: 24px; padding: 2rem; }

.noscript-card { margin: 2rem auto; width: min(720px, calc(100% - 2rem)); background: var(--surface-strong); color: var(--ink); border-radius: 24px; padding: 2rem; border: 1px solid var(--border); }

.screen-enter { animation: fadeUp .22s var(--ease) both; }
.metric-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.daily-task { margin-top: 1rem; padding: .85rem; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--ink); }
.empty-state { text-align: center; padding: 1.5rem; }
.empty-icon { font-size: 2rem; margin-bottom: .5rem; }
.financial-map .flow-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; margin-top: .75rem; }
.flow-node { flex: 1 1 100px; background: var(--surface-strong); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .75rem; }
.flow-node small { color: var(--muted); display: block; }
.flow-arrow { align-self: center; color: var(--muted); font-weight: 900; }
.bill-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.bill-day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); font-size: .78rem; font-weight: 800; color: var(--muted); background: var(--input-bg); }
.bill-day.due { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.bar-chart { display: flex; align-items: flex-end; gap: .45rem; min-height: 120px; margin-top: .75rem; }
.bar-chart .bar { flex: 1; height: var(--h, 20%); min-height: 8px; background: var(--primary); border-radius: 8px 8px 4px 4px; position: relative; transition: height .5s var(--ease); }
.bar-chart .bar span { position: absolute; top: -1.2rem; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 800; color: var(--muted); }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.kanban-col { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .65rem; min-height: 120px; }
.kanban-card { background: var(--input-bg); border: 1px solid var(--border); border-radius: 12px; padding: .55rem; margin-top: .45rem; }
.shield-animated::before { transition: background .7s var(--ease); }
.skeleton { background: linear-gradient(90deg, var(--surface-muted), var(--surface-strong), var(--surface-muted)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 120px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.is-loading .card:not(.skeleton) { opacity: .92; }
.chip-button.warn { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }
.pulse-soft { animation: pulse 1.8s 2; }
.muted { color: var(--muted); }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes gateUnlock { 0% { transform: scale(.96); opacity: .7; } 100% { transform: scale(1); opacity: 1; } }

@media print {
  .bottom-nav, .app-header, .install-banner, .toast { display: none !important; }
  .app-shell { padding-bottom: 1rem; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: white; color: black; }
}

@media (max-width: 480px) {
  .header-actions { max-width: 100%; width: 100%; justify-content: flex-start; }
  .app-header { flex-direction: column; align-items: stretch; }
  .metric-grid-compact { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .flow-row { flex-direction: column; }
  .flow-arrow { display: none; }
  .logo-title { font-size: 1.35rem; }
  .progress-ring { --ring-size: min(148px, 44vw); }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pop { 0% { transform: scale(.92); } 65% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(184,92,92,.28); } 50% { box-shadow: 0 0 0 10px rgba(184,92,92,0); } }
@keyframes sheen { 0%, 55% { transform: rotate(25deg) translateX(-110%); } 85%,100% { transform: rotate(25deg) translateX(110%); } }

.pulse-danger { animation: pulse 1.8s infinite; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-col { grid-template-columns: 1fr; }
  .app-header { align-items: flex-start; }
  .header-actions { max-width: 52%; }
}
@media (max-width: 640px) {
  .app-shell { padding-inline: .8rem; }
  .metric-grid, .form-grid { grid-template-columns: 1fr; }
  .card { border-radius: 24px; }
  .bottom-nav { border-radius: 28px; }
  .nav-item span:last-child { font-size: .66rem; }
  .calendar-grid { grid-template-columns: repeat(6, 1fr); }
  .header-actions .button:not(.button-small), .header-actions .chip-button { padding: .55rem .7rem; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.12s !important;
}
[data-motion="minimal"] *, [data-motion="minimal"] *::before, [data-motion="minimal"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
