:root {
  --ink: #17213c;
  --muted: #67708a;
  --forest: #31356f;
  --green: #6557d9;
  --mint: #dff8f4;
  --cream: #f7f5ff;
  --paper: #fffefe;
  --line: #e3e1f1;
  --gold: #a88b5d;
  --blue: #547d89;
  --danger: #b84659;
  --coral: #817899;
  --cyan: #6b9991;
  --shadow: 0 22px 65px rgba(48, 45, 105, .11);
}

body {
  background:
    radial-gradient(circle at 8% 18%, rgba(218, 207, 184, .24), transparent 28rem),
    radial-gradient(circle at 92% 8%, rgba(154, 190, 181, .18), transparent 31rem),
    linear-gradient(145deg, #faf9fc 0%, #f6f5fa 48%, #faf8f3 100%);
}

.ambient-one {
  width: 36rem;
  height: 36rem;
  background: linear-gradient(145deg, rgba(125, 166, 158, .17), rgba(112, 101, 170, .14));
}

.ambient-two {
  width: 28rem;
  height: 28rem;
  background: rgba(202, 184, 151, .14);
}

.topbar {
  height: 104px;
}

.brand {
  gap: 14px;
  font-size: 21px;
  letter-spacing: -.02em;
}

.brand b {
  color: var(--green);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #292b5c, #5f579a);
  box-shadow: 0 12px 25px rgba(71, 62, 153, .26);
}

.brand-mark svg {
  width: 37px;
  stroke: #effffd;
}

.hero-copy {
  position: relative;
}

.eyebrow {
  color: #4f46b5;
}

.eyebrow span {
  width: 36px;
  height: 3px;
  border-radius: 999px;
  background: #6a619f;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(48px, 6.4vw, 82px);
}

.hero-copy h1 em {
  color: #5d5496;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.hero-copy > p {
  max-width: 650px;
  color: #5f6882;
}

.trust-row {
  gap: 10px;
  margin-top: 32px;
}

.trust-row span {
  padding: 8px 12px;
  border: 1px solid rgba(105, 87, 211, .13);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: #525c79;
  backdrop-filter: blur(10px);
}

.trust-row span::before {
  color: #6b9991;
}

.card,
.auth-card {
  border-color: rgba(116, 105, 183, .15);
  background: rgba(255, 254, 254, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #62599b;
}

.auth-tabs {
  background: #efedf8;
}

.auth-tab.active {
  color: #332d75;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7667d8;
  box-shadow: 0 0 0 3px rgba(111, 91, 211, .14);
}

.primary-button {
  background: linear-gradient(110deg, #34375f, #62599b);
  box-shadow: 0 10px 22px rgba(77, 66, 170, .23);
}

.primary-button:hover {
  background: linear-gradient(110deg, #292c55, #554b8c);
}

.text-button,
.add-device-link {
  color: #5c4fd0;
}

#logout-button {
  border: 1px solid #746b9c;
  border-radius: 10px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, .72);
  color: #51497e;
}

#logout-button:hover {
  background: #eeecf5;
}

.mobile-nav-toggle {
  display: none;
}

.schedule-row {
  grid-template-columns: 1.2fr .75fr 1.15fr auto auto;
  align-items: end;
}

.schedule-field {
  min-width: 0;
}

.schedule-field > span,
.schedule-status > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.schedule-status {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-bottom: 9px;
}

.schedule-remove {
  align-self: center;
  width: 38px;
  height: 38px;
  border-radius: 10px !important;
  background: #f6ecee !important;
}

.nav-item.active {
  color: #37307f;
  background: #e9e7f2;
}

.phase-pill,
.total-badge {
  border-color: #cfc9f1;
  color: #574bbd;
  background: rgba(240, 237, 255, .7);
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  width: 85px;
  height: 85px;
  right: -34px;
  bottom: -42px;
  border-radius: 50%;
  background: rgba(101, 87, 217, .08);
}

.metric:nth-child(2)::after {
  background: rgba(231, 162, 59, .13);
}

.metric:nth-child(3)::after {
  background: rgba(49, 137, 201, .12);
}

.metric-icon.green {
  color: #544b88;
  background: #ebe9f3;
}

.metric-icon.gold {
  color: #806942;
  background: #f3eee3;
}

.metric-icon.blue {
  color: #456d78;
  background: #e5efed;
}

.readiness {
  background:
    linear-gradient(130deg, rgba(255, 255, 255, .91), rgba(239, 236, 255, .88)),
    var(--paper);
}

.readiness-list > div > span {
  color: #493dac;
  background: #e8e4ff;
}

.strategy-card.passive::before {
  background: #6b9991;
}

.strategy-card.balanced::before {
  background: #a88b5d;
}

.strategy-card.aggressive::before {
  background: #817899;
}

@media (max-width: 850px) {
  .topbar {
    height: 82px;
  }

  .app-layout {
    gap: 20px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    margin-inline: -20px;
    padding: 10px 20px;
    background: rgba(247, 245, 255, .9);
    border-bottom: 1px solid rgba(108, 96, 177, .12);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(92, 81, 145, .17);
    border-radius: 14px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font: inherit;
    text-align: left;
    box-shadow: 0 8px 24px rgba(50, 45, 98, .08);
  }

  .mobile-nav-toggle small,
  .mobile-nav-toggle strong {
    display: block;
  }

  .mobile-nav-toggle small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .mobile-nav-toggle strong {
    margin-top: 1px;
    color: #3e3868;
    font-size: 15px;
  }

  .mobile-nav-chevron {
    font-size: 24px;
    transition: transform .2s ease;
  }

  .sidebar.open .mobile-nav-chevron {
    transform: rotate(180deg);
  }

  .sidebar nav {
    display: none;
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid rgba(92, 81, 145, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 35px rgba(50, 45, 98, .13);
  }

  .sidebar.open nav {
    display: grid;
  }

  .nav-item {
    width: 100%;
    border: 1px solid rgba(106, 94, 176, .1);
    background: rgba(255, 255, 255, .72);
  }

  .page-heading {
    margin-bottom: 22px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .brand {
    gap: 10px;
    font-size: 16px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .brand-mark svg {
    width: 31px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(250, 249, 252, .9);
    backdrop-filter: blur(16px);
  }

  .account-menu {
    margin-left: auto;
  }

  #logout-button {
    padding: 7px 11px;
    white-space: nowrap;
  }

  .auth-layout {
    gap: 28px;
  }

  .hero-copy h1 {
    margin: 16px 0;
    font-size: clamp(39px, 11.5vw, 52px);
  }

  .hero-copy > p {
    line-height: 1.6;
  }

  .trust-row span {
    width: auto;
  }

  .auth-card {
    padding: 22px;
  }

  .sidebar {
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .nav-item {
    padding: 9px 12px;
    font-size: 13px;
  }

  input,
  textarea,
  select {
    min-width: 0;
    font-size: 16px;
  }

  .page-heading h1 {
    font-size: 35px;
  }

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

  .metric-grid .metric:last-child {
    grid-column: auto;
  }

  .metric {
    display: grid;
    grid-template-columns: 42px 1fr;
    column-gap: 14px;
    padding: 17px;
  }

  .metric-icon {
    grid-row: 1 / 4;
    width: 42px;
    height: 42px;
    margin: 0;
  }

  .metric p,
  .metric strong,
  .metric small {
    grid-column: 2;
  }

  .metric strong {
    font-size: 20px;
  }

  .readiness {
    gap: 24px;
  }

  .readiness h2 {
    font-size: 24px;
  }

  .strategy-card p {
    min-height: 0;
  }

  .settings-card,
  .strategy-card,
  .readiness,
  .kill-switch {
    border-radius: 17px;
  }

  .toggle-row {
    gap: 18px;
  }

  .page-heading .secondary-button,
  .save-button {
    width: 100%;
    justify-content: center;
  }

  .schedule-list {
    gap: 14px;
  }

  .schedule-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .schedule-field,
  .schedule-field:first-child,
  .schedule-field:nth-child(3) {
    grid-column: 1;
  }

  .schedule-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 48px 3px 0;
  }

  .schedule-remove {
    position: absolute;
    right: 14px;
    bottom: 13px;
  }

  .schedule-empty {
    padding: 30px 20px;
  }

  .kill-switch {
    align-items: flex-start;
    gap: 18px;
  }

  .kill-switch > .switch {
    align-self: flex-end;
  }

  .passkey-row {
    flex-direction: column;
  }

  .user-row {
    padding: 16px;
  }

  .workspace {
    padding-bottom: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
