:root {
  color-scheme: light dark;
  --bg: #101419;
  --bg-soft: #151a21;
  --surface: #1b222b;
  --surface-strong: #222b35;
  --surface-muted: #171d24;
  --border: #2e3945;
  --border-soft: #25303b;
  --text: #edf2f7;
  --muted: #9facbb;
  --faint: #788796;
  --teal: #4fd1c5;
  --blue: #7aa2ff;
  --coral: #ff8c6b;
  --amber: #f6c177;
  --green: #8bd17c;
  --danger: #ff6b7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --page-glow: rgba(79, 209, 197, 0.07);
  --sidebar-bg: rgba(16, 20, 25, 0.86);
  --panel-bg: rgba(27, 34, 43, 0.88);
  --input-bg: #111820;
  --track-bg: #0c1015;
  --code-bg: #0d1218;
  --modal-bg: rgba(4, 7, 10, 0.72);
  --brand-bg: linear-gradient(135deg, rgba(79, 209, 197, 0.22), rgba(122, 162, 255, 0.18));
  --mascot-shell: #eef5ff;
  --mascot-shell-shade: #b9c7dc;
  --mascot-face: #06101f;
  --mascot-glow: rgba(79, 209, 197, 0.72);
  --mascot-blue: #2b6fff;
  --mascot-shadow: rgba(0, 0, 0, 0.26);
  --aervo-blue: #2563ff;
  --auth-bg: #0f1a25;
  --auth-panel-bg: #18222f;
  --auth-panel-border: rgba(117, 142, 171, 0.24);
  --auth-text: #f7fbff;
  --auth-muted: #9fb1ce;
  --auth-input-bg: #101925;
  --auth-input-border: rgba(126, 146, 173, 0.32);
  --auth-button-bg: linear-gradient(180deg, #4384ff, #1761ff);
  --auth-button-text: #ffffff;
  --radius: 8px;
  --radius-sm: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg-soft: #edf2f7;
  --surface: #ffffff;
  --surface-strong: #edf4f7;
  --surface-muted: #f0f5f7;
  --border: #cfd9e3;
  --border-soft: #dde6ee;
  --text: #17202a;
  --muted: #536273;
  --faint: #718096;
  --teal: #087d78;
  --blue: #285fd6;
  --coral: #c84f32;
  --amber: #9d6918;
  --green: #2f7c3a;
  --danger: #b42334;
  --shadow: 0 22px 70px rgba(26, 39, 52, 0.13);
  --page-glow: rgba(8, 125, 120, 0.09);
  --sidebar-bg: rgba(247, 249, 252, 0.88);
  --panel-bg: rgba(255, 255, 255, 0.9);
  --input-bg: #ffffff;
  --track-bg: #e5edf3;
  --code-bg: #f2f6f9;
  --modal-bg: rgba(17, 25, 34, 0.38);
  --brand-bg: linear-gradient(135deg, rgba(8, 125, 120, 0.12), rgba(40, 95, 214, 0.1));
  --mascot-shell: #ffffff;
  --mascot-shell-shade: #d8e2f0;
  --mascot-face: #07132b;
  --mascot-glow: rgba(37, 99, 255, 0.58);
  --mascot-blue: #2563ff;
  --mascot-shadow: rgba(34, 60, 98, 0.18);
  --aervo-blue: #2563ff;
  --auth-bg: #f3f6fb;
  --auth-panel-bg: rgba(255, 255, 255, 0.96);
  --auth-panel-border: rgba(205, 215, 230, 0.8);
  --auth-text: #070f2d;
  --auth-muted: #7788a8;
  --auth-input-bg: rgba(255, 255, 255, 0.92);
  --auth-input-border: #d5deeb;
  --auth-button-bg: linear-gradient(180deg, #2d73ff, #1460ff);
  --auth-button-text: #ffffff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f7f9fc;
    --bg-soft: #edf2f7;
    --surface: #ffffff;
    --surface-strong: #edf4f7;
    --surface-muted: #f0f5f7;
    --border: #cfd9e3;
    --border-soft: #dde6ee;
    --text: #17202a;
    --muted: #536273;
    --faint: #718096;
    --teal: #087d78;
    --blue: #285fd6;
    --coral: #c84f32;
    --amber: #9d6918;
    --green: #2f7c3a;
    --danger: #b42334;
    --shadow: 0 22px 70px rgba(26, 39, 52, 0.13);
    --page-glow: rgba(8, 125, 120, 0.09);
    --sidebar-bg: rgba(247, 249, 252, 0.88);
    --panel-bg: rgba(255, 255, 255, 0.9);
    --input-bg: #ffffff;
    --track-bg: #e5edf3;
    --code-bg: #f2f6f9;
    --modal-bg: rgba(17, 25, 34, 0.38);
    --brand-bg: linear-gradient(135deg, rgba(8, 125, 120, 0.12), rgba(40, 95, 214, 0.1));
    --mascot-shell: #ffffff;
    --mascot-shell-shade: #d8e2f0;
    --mascot-face: #07132b;
    --mascot-glow: rgba(37, 99, 255, 0.58);
    --mascot-blue: #2563ff;
    --mascot-shadow: rgba(34, 60, 98, 0.18);
    --aervo-blue: #2563ff;
    --auth-bg: #f3f6fb;
    --auth-panel-bg: rgba(255, 255, 255, 0.96);
    --auth-panel-border: rgba(205, 215, 230, 0.8);
    --auth-text: #070f2d;
    --auth-muted: #7788a8;
    --auth-input-bg: rgba(255, 255, 255, 0.92);
    --auth-input-border: #d5deeb;
    --auth-button-bg: linear-gradient(180deg, #2d73ff, #1460ff);
    --auth-button-text: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, var(--page-glow), transparent 34rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(37, 99, 255, 0.08), transparent 28rem),
    var(--auth-bg);
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.auth-panel {
  display: grid;
  gap: 1rem;
  width: min(31rem, calc(100vw - 1.5rem));
  border: 1px solid var(--auth-panel-border);
  border-radius: 28px;
  background: var(--auth-panel-bg);
  box-shadow: 0 24px 70px rgba(12, 31, 62, 0.14);
  padding: clamp(1.35rem, 4vw, 2.55rem);
  color: var(--auth-text);
}

.auth-brand {
  display: grid;
  justify-items: center;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  column-gap: 0.9rem;
  row-gap: 0.15rem;
  text-align: center;
}

.auth-brand h1,
.auth-brand p {
  margin: 0;
}

.auth-brand h1 {
  color: var(--auth-text);
  font-size: clamp(3.4rem, 10vw, 5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
}

.auth-brand p {
  grid-column: 1 / -1;
  color: var(--auth-muted);
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  font-weight: 600;
}

.aervo-logo-mark {
  display: grid;
  place-items: center;
  width: clamp(4.15rem, 12vw, 5.35rem);
  height: clamp(4.15rem, 12vw, 5.35rem);
  color: var(--aervo-blue);
}

.aervo-logo-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: none;
}

.auth-hero {
  position: relative;
  min-height: clamp(12rem, 34vw, 17rem);
  margin: -0.45rem -0.65rem -0.4rem;
  overflow: hidden;
}

.auth-cloud {
  position: absolute;
  width: 5.1rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(214, 225, 242, 0.72);
  filter: blur(0.08rem);
  opacity: 0.55;
}

.auth-cloud::before,
.auth-cloud::after {
  content: "";
  position: absolute;
  bottom: 0.2rem;
  border-radius: 50%;
  background: inherit;
}

.auth-cloud::before {
  left: 0.55rem;
  width: 2rem;
  height: 2rem;
}

.auth-cloud::after {
  right: 0.7rem;
  width: 2.5rem;
  height: 2.5rem;
}

.auth-cloud-left {
  left: 0.25rem;
  bottom: 4.2rem;
}

.auth-cloud-right {
  right: 0.2rem;
  bottom: 2.2rem;
  transform: scale(0.82);
}

.auth-mascot {
  position: relative;
  width: min(17.5rem, 74vw);
  height: min(12rem, 48vw);
  margin: 0.2rem auto 0;
}

.mascot {
  position: absolute;
  right: 2.4rem;
  bottom: 1.25rem;
  width: 8.2rem;
  height: 7.6rem;
  animation: mascot-float 4.6s ease-in-out infinite;
  transform-origin: 50% 76%;
}

.mascot-body {
  position: absolute;
  right: 1.8rem;
  bottom: 0.72rem;
  width: 5.35rem;
  height: 5.8rem;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(145deg, var(--mascot-shell), var(--mascot-shell-shade));
  box-shadow: 0 0 1.7rem var(--mascot-glow), inset -0.75rem -0.9rem 1.15rem rgba(4, 12, 26, 0.13);
}

.mascot-face {
  position: absolute;
  right: 2rem;
  bottom: 2.68rem;
  width: 4.85rem;
  height: 2.5rem;
  border-radius: 1.75rem 1.75rem 1.45rem 1.45rem;
  background: var(--mascot-face);
  box-shadow: inset 0 0 0.9rem rgba(37, 99, 255, 0.24);
}

.mascot-eye {
  position: absolute;
  top: 0.96rem;
  width: 0.82rem;
  height: 0.48rem;
  border-radius: 999px 999px 0.15rem 0.15rem;
  border-top: 0.22rem solid #5ff6ff;
  background: transparent;
  box-shadow: 0 0 0.55rem var(--mascot-glow);
  animation: mascot-blink 6.8s ease-in-out infinite;
}

.mascot-eye-left {
  left: 1.1rem;
}

.mascot-eye-right {
  right: 1.1rem;
}

.mascot-crest {
  position: absolute;
  right: 3.98rem;
  bottom: 6rem;
  width: 1.45rem;
  height: 2.3rem;
  border-radius: 999px 999px 0.5rem 0.5rem;
  background: linear-gradient(155deg, #6aa5fa, var(--mascot-blue));
  box-shadow: 0 0.3rem 0.9rem rgba(37, 99, 255, 0.38);
  transform: rotate(18deg) skewX(-6deg);
}

.mascot-ear {
  position: absolute;
  bottom: 4.06rem;
  width: 0.82rem;
  height: 1.62rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #75a8ff, var(--mascot-blue));
  box-shadow: 0 0 0.6rem rgba(37, 99, 255, 0.42);
}

.mascot-ear-left {
  right: 6.35rem;
}

.mascot-ear-right {
  right: 1.45rem;
}

.mascot-wing {
  position: absolute;
  bottom: 2.08rem;
  width: 2.65rem;
  height: 4.3rem;
  border-radius: 80% 20% 80% 20%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(151, 168, 199, 0.52)),
    repeating-linear-gradient(170deg, transparent 0 0.66rem, rgba(37, 99, 255, 0.2) 0.68rem 0.8rem, transparent 0.82rem 1.25rem);
  opacity: 0.9;
  transform-origin: 50% 85%;
  animation: mascot-wing 4.6s ease-in-out infinite;
}

.mascot-wing-left {
  right: 6.1rem;
  transform: rotate(-31deg);
}

.mascot-wing-right {
  right: 0.45rem;
  transform: rotate(28deg) scaleX(-1);
}

.mascot-foot {
  position: absolute;
  bottom: 0.35rem;
  width: 0.95rem;
  height: 0.58rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--mascot-blue), #07132b);
}

.mascot-foot-left {
  right: 4.75rem;
}

.mascot-foot-right {
  right: 3.1rem;
}

.mascot-shadow {
  position: absolute;
  right: 4.2rem;
  bottom: 0.18rem;
  width: 5.9rem;
  height: 0.76rem;
  border-radius: 50%;
  background: var(--mascot-shadow);
  filter: blur(0.4rem);
  animation: mascot-shadow 4.6s ease-in-out infinite;
}

.mascot-trail {
  position: absolute;
  left: 1rem;
  bottom: 2.05rem;
  width: 7.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.38), rgba(37, 99, 255, 0.7));
  filter: blur(0.28rem);
  transform: rotate(-28deg);
  opacity: 0.86;
  animation: mascot-trail 4.6s ease-in-out infinite;
}

@keyframes mascot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1.2deg);
  }

  50% {
    transform: translateY(-0.26rem) rotate(1.2deg);
  }
}

@keyframes mascot-wing {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.08);
  }
}

@keyframes mascot-blink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(0.14);
  }
}

@keyframes mascot-shadow {
  0%,
  100% {
    opacity: 0.76;
    transform: scaleX(1);
  }

  50% {
    opacity: 0.52;
    transform: scaleX(0.86);
  }
}

@keyframes mascot-trail {
  0%,
  100% {
    opacity: 0.74;
    transform: rotate(-28deg) scaleX(0.94);
  }

  50% {
    opacity: 0.96;
    transform: rotate(-28deg) scaleX(1.06);
  }
}

.auth-status {
  min-height: 1.2rem;
  color: var(--auth-muted);
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

.auth-status:empty {
  display: none;
}

.auth-status[data-tone="danger"] {
  color: var(--danger);
}

.auth-actions,
.oauth-buttons,
.auth-email-form,
.auth-form-actions {
  display: grid;
  gap: 0.85rem;
}

.auth-divider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin: 0.65rem 0 0.15rem;
  color: var(--auth-muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  border-radius: 999px;
  background: var(--auth-input-border);
}

.auth-divider::before {
  grid-column: 1;
}

.auth-divider::after {
  grid-column: 3;
}

.auth-divider::selection {
  background: transparent;
}

.auth-wide {
  width: 100%;
  min-height: 3.35rem;
}

.auth-screen .primary-button {
  border: 0;
  border-radius: 8px;
  background: var(--auth-button-bg);
  color: var(--auth-button-text);
  box-shadow: 0 0.7rem 1.2rem rgba(37, 99, 255, 0.2);
  font-weight: 700;
}

.oauth-button {
  position: relative;
  justify-content: center;
  min-height: 3.1rem;
  border-color: var(--auth-input-border);
  border-radius: 8px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  box-shadow: 0 0.2rem 0.7rem rgba(23, 44, 77, 0.04);
  font-weight: 700;
}

.auth-input-row {
  position: relative;
  display: grid;
}

.auth-input-row > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.auth-input-row > svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  z-index: 1;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--auth-muted);
  transform: translateY(-50%);
}

.auth-input-row input {
  min-height: 3.25rem;
  border-color: var(--auth-input-border);
  border-radius: 8px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  padding-left: 3.1rem;
  font-weight: 600;
  box-shadow: 0 0.15rem 0.6rem rgba(23, 44, 77, 0.04);
}

.auth-input-row input::placeholder {
  color: #9aa8c3;
}

.provider-mark {
  position: absolute;
  left: 1.1rem;
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
}

.provider-google::before {
  content: "G";
  color: #4285f4;
  font-weight: 900;
  font-size: 1.2rem;
}

.provider-microsoft {
  background:
    linear-gradient(#f25022, #f25022) 0 0 / 0.58rem 0.58rem no-repeat,
    linear-gradient(#7fba00, #7fba00) 100% 0 / 0.58rem 0.58rem no-repeat,
    linear-gradient(#00a4ef, #00a4ef) 0 100% / 0.58rem 0.58rem no-repeat,
    linear-gradient(#ffb900, #ffb900) 100% 100% / 0.58rem 0.58rem no-repeat;
}

.provider-apple::before {
  content: "";
  width: 1.05rem;
  height: 1.25rem;
  border-radius: 50% 50% 46% 46%;
  background: var(--auth-text);
  clip-path: polygon(50% 0, 72% 13%, 88% 31%, 78% 58%, 90% 82%, 70% 100%, 52% 88%, 34% 100%, 14% 82%, 25% 57%, 14% 32%, 30% 13%);
}

.auth-sso-link,
.auth-footer button {
  border: 0;
  background: transparent;
  color: var(--aervo-blue);
  font: inherit;
}

.auth-sso-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  font-weight: 700;
}

.auth-sso-link svg {
  width: 1.1rem;
  height: 1.1rem;
}

.auth-sso-link[data-configured="false"] {
  opacity: 0.78;
}

.auth-footer {
  margin: 0.35rem 0 0;
  color: var(--auth-muted);
  text-align: center;
  font-size: 0.93rem;
  font-weight: 600;
}

.auth-footer button {
  padding: 0 0 0 0.35rem;
  font-weight: 800;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100vh;
  padding: 1rem;
  border-right: 1px solid var(--border-soft);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  min-height: 3.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid rgba(79, 209, 197, 0.42);
  border-radius: var(--radius);
  background: var(--brand-bg);
  color: var(--teal);
}

.brand-icon {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-button,
.mobile-nav-button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-button {
  padding: 0 0.75rem;
}

.nav-button:hover,
.mobile-nav-button:hover,
.nav-button:focus-visible,
.mobile-nav-button:focus-visible {
  border-color: var(--border);
  color: var(--text);
  outline: none;
}

.nav-button.is-active,
.mobile-nav-button.is-active {
  border-color: rgba(79, 209, 197, 0.35);
  background: rgba(79, 209, 197, 0.1);
  color: var(--text);
}

.sidebar-footer {
  display: grid;
  gap: 0.35rem;
  margin-top: auto;
  color: var(--faint);
  font-size: 0.78rem;
}

.main-panel {
  min-width: 0;
  padding: 1.25rem clamp(1rem, 2vw, 2rem) 2rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  margin-bottom: 1rem;
}

.topbar h1,
.modal-header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2rem, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions,
.form-actions,
.row-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0 0.85rem;
  color: var(--text);
  text-decoration: none;
}

.primary-button {
  background: var(--teal);
  color: #071315;
  font-weight: 800;
}

.secondary-button,
.icon-button {
  border-color: var(--border);
  background: var(--surface);
}

.ghost-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.icon-only {
  width: 2.45rem;
  padding: 0;
  border-color: var(--border);
  background: var(--surface);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.icon-only:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: none;
}

.is-hidden,
[hidden] {
  display: none !important;
}

.content-region {
  display: grid;
  gap: 1rem;
}

.app-alert {
  min-height: 0;
  margin-bottom: 0.5rem;
  color: var(--green);
  font-size: 0.9rem;
}

.view-grid {
  display: grid;
  gap: 1rem;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(21rem, 0.85fr);
  align-items: start;
}

.split-grid {
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.8fr);
  align-items: start;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.progress-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  min-height: 13rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel-bg);
  padding: clamp(1rem, 2vw, 1.35rem);
}

.progress-ring {
  --progress: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(8.5rem, 18vw, 11rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 0 57%, transparent 58%),
    conic-gradient(var(--teal) calc(var(--progress) * 1%), var(--track-bg) 0);
  box-shadow: 0 0 0 1px var(--border-soft) inset;
}

.progress-ring strong,
.progress-ring span {
  grid-area: 1 / 1;
}

.progress-ring strong {
  margin-top: -0.8rem;
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1;
}

.progress-ring span {
  margin-top: 2.85rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.progress-hero-copy {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.progress-hero-copy h2,
.progress-hero-copy p {
  margin: 0;
}

.progress-hero-copy h2 {
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.05;
}

.progress-hero-copy p:not(.eyebrow) {
  max-width: 58rem;
  color: var(--muted);
  line-height: 1.5;
}

.progress-kpis .metric-card {
  min-height: 6.25rem;
}

.panel,
.metric-card,
.list-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

.panel {
  padding: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.45rem;
  min-height: 7rem;
  padding: 0.95rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.metric-card small {
  color: var(--faint);
  line-height: 1.35;
}

.panel-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.list-stack {
  display: grid;
  gap: 0.65rem;
}

.account-grid,
.account-detail-grid {
  margin-top: 0.9rem;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.9fr);
  gap: 0.85rem;
}

.account-card {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 0.85rem;
}

.account-detail-grid h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 2.75rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.86rem;
}

.mini-row strong {
  color: var(--text);
  font-size: 0.9rem;
}

.danger-zone {
  margin-top: 1rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.85rem;
}

.list-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
}

.list-card header,
.inline-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.85rem;
}

.list-card h3,
.list-card p {
  margin: 0;
}

.list-card h3 {
  font-size: 0.98rem;
  line-height: 1.25;
}

.list-card p,
.empty-state,
.meta-line {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  text-align: center;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.pill.success {
  border-color: rgba(139, 209, 124, 0.35);
  color: var(--green);
}

.pill.warning {
  border-color: rgba(246, 193, 119, 0.35);
  color: var(--amber);
}

.pill.accent {
  border-color: rgba(79, 209, 197, 0.35);
  color: var(--teal);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.week-day {
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--faint);
}

.week-day.is-active {
  border-color: rgba(79, 209, 197, 0.4);
  background: rgba(79, 209, 197, 0.1);
  color: var(--text);
}

.week-day span {
  font-size: 0.72rem;
  text-transform: uppercase;
}

.week-day strong {
  font-size: 0.82rem;
}

.compact-goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.compact-goal-card {
  display: grid;
  gap: 0.55rem;
  min-height: 9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-muted);
  padding: 0.85rem;
  color: var(--text);
  text-align: left;
}

.compact-goal-card:hover,
.compact-goal-card:focus-visible {
  border-color: rgba(79, 209, 197, 0.45);
  outline: none;
}

.compact-goal-card span,
.compact-goal-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.compact-goal-card strong {
  line-height: 1.25;
}

.compact-form {
  margin-bottom: 0.8rem;
}

.today-task-list,
.import-inline,
.privacy-toolbar {
  margin-top: 0.85rem;
}

.api-preview {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.api-preview span {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.api-preview pre,
code {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--text);
}

.api-preview pre {
  overflow-x: auto;
  margin: 0;
  padding: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  padding: 0.12rem 0.28rem;
}

.allocation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.allocation-grid strong {
  font-size: 1.35rem;
  line-height: 1.1;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.segmented-control button {
  min-height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--muted);
}

.segmented-control button.is-active {
  border-color: rgba(79, 209, 197, 0.44);
  background: rgba(79, 209, 197, 0.12);
  color: var(--text);
}

.check-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.progress-track {
  overflow: hidden;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--track-bg);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 0.5rem;
  height: 10rem;
  padding-top: 0.5rem;
}

.bar {
  display: grid;
  align-items: end;
  height: 100%;
  min-width: 0;
}

.bar span {
  display: block;
  min-height: 0.25rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(180deg, var(--coral), var(--amber));
}

.bar label {
  margin-top: 0.4rem;
  color: var(--faint);
  font-size: 0.68rem;
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.form-grid label {
  display: grid;
  gap: 0.38rem;
}

.form-grid label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.full-span {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  padding: 0.68rem 0.75rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 2px solid rgba(79, 209, 197, 0.18);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 36rem;
}

th,
td {
  border-bottom: 1px solid var(--border-soft);
  padding: 0.75rem 0.5rem;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

td {
  color: var(--text);
  font-size: 0.9rem;
}

.complete {
  color: var(--faint);
  text-decoration: line-through;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-bg);
}

.modal-panel {
  position: relative;
  width: min(38rem, 100%);
  max-height: min(42rem, 92vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-goal-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .allocation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
    padding-bottom: calc(4.35rem + env(safe-area-inset-bottom));
  }

  .sidebar {
    display: none;
  }

  .main-panel {
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1.25rem;
  }

  .topbar {
    align-items: start;
    min-height: auto;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .progress-hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .progress-ring {
    width: min(10rem, 62vw);
  }

  .week-strip {
    grid-template-columns: repeat(7, minmax(2.3rem, 1fr));
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .week-day {
    min-height: 4.7rem;
  }

  .icon-button span {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.2rem;
    padding: 0.45rem max(0.45rem, env(safe-area-inset-left)) max(0.45rem, env(safe-area-inset-bottom)) max(0.45rem, env(safe-area-inset-right));
    border-top: 1px solid var(--border-soft);
    background: var(--sidebar-bg);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-button {
    display: grid;
    place-items: center;
    gap: 0.2rem;
    min-height: 3.25rem;
    padding: 0.25rem;
    font-size: 0.58rem;
    text-align: center;
  }

  .mobile-nav-button svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .form-grid,
  .kpi-grid,
  .allocation-grid,
  .segmented-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .list-card header,
  .inline-row,
  .topbar {
    flex-direction: column;
  }

  .topbar-actions,
  .row-actions {
    width: 100%;
  }

  .auth-mascot {
    width: min(15.5rem, 76vw);
    height: min(10.8rem, 52vw);
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .icon-button {
    min-width: 2.5rem;
  }
}

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