/* Approved charcoal/coral design. Loaded after legacy layout rules. */
:root {
  color-scheme: dark;
  --ink: #f5f1ea;
  --muted: #aaa3b1;
  --paper: #0a0a0d;
  --card: #141417;
  --line: #f5f1ea1a;
  --field: #1e1e23;
  --modal: #17171c;
  --control: #ffffff08;
  --wash: #ffffff06;
  --accent: #ff947d;
  --accent-deep: #f65923;
  --accent-soft: #f659231a;
  --today: #ffa4af;
  --today-soft: #f444551a;
  --gradient: linear-gradient(135deg, #f65923, #f44455);
  --mint: #ff947d;
  --mint-deep: #e57f68;
  --coral: #f48490;
  --gold: #ff947d;
  --shadow: 0 8px 28px #00000010;
}
:root.light {
  color-scheme: light;
  --ink: #242027;
  --muted: #69616e;
  --paper: #f5f1ea;
  --card: #fffcf8;
  --line: #2420271c;
  --field: #eee8e3;
  --modal: #fffcf8;
  --control: #24202706;
  --wash: #24202706;
  --accent: #a5362c;
  --accent-deep: #b44127;
  --accent-soft: #f6592314;
  --today: #a83243;
  --today-soft: #f4445514;
  --mint: #a5362c;
  --mint-deep: #a5362c;
  --coral: #a83243;
  --gold: #a5362c;
  --shadow: 0 8px 28px #24202705;
}
body {
  background:
    radial-gradient(ellipse at 100% -12%, #f444551a, transparent 43%),
    radial-gradient(ellipse at 82% 0%, #f6592312, transparent 35%), var(--paper);
  background-attachment: fixed;
  font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
:root.light body {
  background: var(--paper);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.shell {
  max-width: 1440px;
  padding: 28px 44px 32px;
  position: relative;
}
.topbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 30px;
}
.brand .custom-logo-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
}
.brand {
  font-weight: 700;
}
h1 {
  font-size: 27px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -1px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
h3 {
  font-weight: 600;
}
.eyebrow {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 1.3px;
  font-size: 10px;
}
.hero {
  margin-bottom: 24px;
}
.hero .intro {
  font-size: 13px;
}
.primary {
  color: #170b09;
  background: var(--gradient);
  box-shadow: 0 5px 22px #f4445515;
  border-radius: 24px;
  padding: 11px 18px;
  font-weight: 600;
}
.primary:hover {
  background: linear-gradient(135deg, #ff7446, #fa6573);
  transform: none;
}
.ghost,
#manageAccounts {
  color: var(--ink);
  background: var(--control);
  border: 1px solid var(--line);
  box-shadow: none;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
}
#manageAccounts:hover {
  background: var(--wash);
}
.avatar {
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}
.card {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.stats {
  grid-template-columns: 1.65fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  min-height: 136px;
  padding: 21px 23px;
  border-radius: 18px;
}
.stats .stat:first-child {
  grid-column: auto;
  background: var(--card);
  border-color: var(--line);
  padding-right: 140px;
}
.stat-label {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.stat small,
.stat:first-child small,
.stat:first-child .stat-label {
  color: var(--muted);
}
.stat small {
  font-size: 11px;
}
.commitment-progress {
  border-left: 1px solid var(--line);
  padding-left: 15px;
  right: 20px;
  min-width: 100px;
}
.progress-item {
  grid-template-columns: 1fr;
}
.progress-icon {
  display: none;
}
.progress-copy small {
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}
.progress-copy strong {
  font-size: 12px;
  font-weight: 500;
}
.commitment-rhythm {
  font-size: 10px;
}
.layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}
.side-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.side-stack > section {
  order: initial;
}
.section {
  padding: 22px;
}
.section-head {
  gap: 12px;
  margin-bottom: 18px;
}
.section-head .eyebrow {
  margin-bottom: 5px;
}
.filters {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filters .search {
  flex: 1 1 200px;
}
.filters > select {
  flex: 1 1 130px;
  min-width: 0;
  max-width: 200px;
}
.search,
select,
label input,
label select {
  background: var(--field);
  color: var(--ink);
  font-size: 12px;
  border-color: var(--line);
}
.search {
  border-radius: 24px;
}
.payment-status-tabs {
  display: flex;
  gap: 5px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}
.payment-status-tabs button {
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 24px;
  padding: 8px 13px;
  font-size: 12px;
}
.payment-status-tabs button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.timeline:not(.month-view) {
  display: block;
}
.payment-group-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 23px 0 4px;
}
.payment-group-title span:last-child {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.timeline .payment {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 115px 95px 32px;
  gap: 12px;
  align-items: center;
  padding: 17px 0;
  min-height: 87px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
}
.timeline .payment:last-child {
  border-bottom: 0;
}
.timeline .payment:hover {
  transform: none;
  background: var(--control);
}
.timeline .payment:has(.payment-menu[open]) {
  z-index: 5;
}
.timeline .date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 44px;
  height: 48px;
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
  gap: 2px;
}
.timeline .date span {
  font-size: 20px;
  color: var(--ink);
  font-weight: 500;
}
.timeline .today .date {
  background: var(--accent-soft);
  color: var(--accent);
}
.timeline .today .date span {
  color: var(--accent);
}
.payment-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.15px;
}
.payment-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 11px;
}
.payment-account {
  display: inline;
}
.payment-meta .account-marker {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  vertical-align: 1px;
  border-radius: 50%;
}
.payment-meta .account-marker.neo-world,
.payment-meta .account-marker.neo-master {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  border-radius: 4px;
  font-size: 9px;
}
.payment-meta .reminder-bell {
  display: inline-flex;
}
.payment-meta .reminder-bell .material-symbols-outlined {
  font-size: 14px;
}
.schedule-note {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.schedule-note .completion-mark {
  margin: 0;
}
.payment-progress {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #ef887b;
  fill: none;
  stroke-width: 2.4;
}
.payment-progress.near-complete { color: #8fcbb0; }
:root.light .payment-progress { color: #b44127; }
:root.light .payment-progress.near-complete { color: #28734d; }
.payment-progress .progress-track { stroke: currentColor; opacity: .16; }
.payment-progress .progress-fill {
  stroke: currentColor;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 12px 12px;
}
.payment-progress .progress-check {
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.payment-state {
  min-width: 0;
  display: grid;
  justify-items: center;
  text-align: center;
}
.payment-status {
  display: inline-block;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--field);
  color: var(--muted);
}
.today .payment-status {
  background: var(--accent-soft);
  color: var(--accent);
}
.next .payment-status {
  background: #55bd831a;
  color: #9dd5ba;
}
.past .payment-status {
  background: #f4445520;
  color: #ff8797;
}
:root.light .next .payment-status {
  color: #286343;
}
:root.light .past .payment-status {
  color: #a83243;
}
.is-paid .payment-status {
  background: transparent;
  padding-left: 0;
}
.payment-state small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.timeline .payment > .amount {
  position: static;
  grid-column: auto;
  text-align: right;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.payment-menu {
  position: relative;
  min-width: 0;
}
.payment-menu summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 44px;
  list-style: none;
  border-radius: 12px;
  cursor: pointer;
  color: var(--muted);
}
.payment-menu summary::-webkit-details-marker {
  display: none;
}
.payment-menu summary:hover {
  background: var(--field);
  color: var(--ink);
}
.payment-menu .payment-actions {
  position: absolute;
  z-index: 10;
  right: 0;
  top: 44px;
  display: grid;
  width: 174px;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--modal);
  box-shadow: 0 10px 30px #0005;
}
.payment-menu .payment-actions button {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  height: auto;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 11px;
  font-weight: 400;
}
.payment-menu .payment-actions button::after {
  content: attr(data-label);
}
.payment-menu .payment-actions button:hover {
  background: var(--field);
}
.payment-menu .payment-actions button[data-action="delete"] {
  color: var(--today);
}
.payment-menu .payment-actions button .material-symbols-outlined {
  font-size: 17px;
}
.payment-menu .payment-actions button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.chart .bar {
  background: var(--field);
}
.bar.active,
.bar.current {
  background: var(--gradient);
}
.mini-fill {
  background: var(--gradient);
}
.mini-fill.account-colored {
  background: var(--account-color);
}
.insight-tabs {
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 0;
  gap: 15px;
}
.insight-tabs button {
  border-radius: 0;
  padding: 0 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.insight-tabs button.active {
  color: var(--accent);
  background: transparent;
  border-bottom: 2px solid var(--accent);
}
.mini-line {
  font-size: 11px;
}
.mini-track {
  height: 4px;
}
.reminder {
  border-color: var(--line);
  align-items: center;
}
.reminder-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--accent);
  line-height: 1;
}
.reminder-icon .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}
.reminder-name {
  font-size: 12px;
  font-weight: 500;
}
.reminder small {
  font-size: 10px;
}
.modal,
.terms-dialog {
  background: var(--modal);
  color: var(--ink);
  border-color: var(--line);
  border-radius: 22px;
}
.theme-switch {
  background: var(--gradient);
}
.theme-switch[aria-checked="true"] {
  background: #eee8e3;
}
.theme-switch::after {
  background: #f5f1ea;
}
.theme-switch[aria-checked="true"]::after {
  background: #69616e;
}
.day-cell {
  background: var(--control);
  border-color: var(--line);
}
.day-cell.today {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.month-view {
  margin-top: 16px;
}
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 1150px) {
  .shell {
    padding: 25px;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats .stat:first-child {
    grid-column: 1 / -1;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side-stack {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  }
  .side-stack > section:first-child {
    grid-column: auto;
  }
}
@media (max-width: 700px) {
  .shell {
    padding: 20px 14px 28px;
  }
  .hero {
    display: block;
  }
  h1 {
    font-size: 25px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stats .stat:first-child {
    grid-column: 1 / -1;
    padding: 16px 130px 16px 16px;
  }
  .stats .stat {
    min-height: 118px;
    padding: 16px;
  }
  .stats .stat:last-child {
    grid-column: 1 / -1;
    min-height: 100px;
  }
  .stats .commitment-progress {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 16px;
    grid-template-columns: 1fr;
  }
  .side-stack {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 17px 14px;
  }
  .filters > select {
    max-width: none;
  }
  .timeline .payment {
    grid-template-columns: 38px minmax(0, 1fr) 80px 28px;
    gap: 9px;
    padding: 16px 0;
  }
  .timeline .date {
    grid-column: 1;
    grid-row: 1;
    width: 38px;
  }
  .timeline .payment-copy {
    grid-column: 2;
    grid-row: 1;
  }
  .timeline .payment > .amount {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
    font-size: 14px;
  }
  .payment-menu {
    grid-column: 4;
    grid-row: 1;
  }
  .payment-menu summary {
    width: 28px;
  }
  .payment-state {
    grid-column: 2 / 4;
    grid-row: 2;
    margin-top: -4px;
  }
  .payment-state {
    justify-self: start;
  }
  .payment-state small {
    display: block;
    margin-left: 0;
  }
  .payment-name {
    font-size: 13px;
  }
  .payment-meta {
    font-size: 10px;
    gap: 4px;
  }
  .payment-status-tabs button {
    font-size: 11px;
    padding: 8px 11px;
  }
  .hero-actions > button {
    font-size: 12px;
  }
}

/* Contain year charts and long account names within the sidebar. */
.layout > *,
.side-stack > *,
.chart,
.bar-wrap {
  min-width: 0;
}
.side-stack > section:nth-child(2),
.side-stack > section:nth-child(3) {
  order: initial;
}
.chart {
  gap: 4px;
  padding-left: 0;
  padding-right: 0;
}
.bar-wrap {
  flex: 1 1 0;
  font-size: 9px;
}
.chart .bar.active,
.chart .bar:hover {
  background: var(--gradient);
}
.mini-line {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
}
.mini-line > strong {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
}
.mini-line > .mini-track {
  grid-column: 1 / -1;
  grid-row: 2;
  background: var(--field);
}
.insight-tabs button {
  border: 0;
  box-shadow: none;
}
.insight-tabs button.active {
  border-bottom: 2px solid var(--accent);
}
.auth-gate {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: row;
    align-items: center;
  }
}

/* Center the demo label independently of the brand and account controls. */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 0;
  padding-bottom: 8px;
  border-bottom: 0;
}
.topbar .brand {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}
.topbar > .top-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}
.demo-notice {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  margin: 0;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
  animation: demo-glow 3s ease-in-out 3;
}
.demo-notice span {
  color: var(--muted);
  font-size: 11px;
}
.demo-notice[hidden] {
  display: none;
}
@keyframes demo-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 5px var(--accent-soft), 0 0 22px var(--accent-soft); }
}
@media (max-width: 700px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .topbar > .top-actions {
    grid-column: 2;
  }
  .demo-notice {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(100%, 340px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo-notice { animation: none; }
}
