@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  --am-ink: #2b303a;
  --am-action-text: #15181e;
  --am-accent: #ffc10d;
  --am-accent-pale: #fff3cb;
  --am-muted: #536073;
  --am-line: #dce1e6;
  --am-wash: #eff2f5;
  --ink: var(--am-ink);
  --muted: var(--am-muted);
  --accent: var(--am-accent);
  --line: var(--am-line);
  --soft: var(--am-wash);
  --paper: #fff;
  --canvas: #f7f8fa;
  --round: 14px;
  --side: clamp(20px, 5vw, 76px);
  color-scheme: light;
  accent-color: var(--ink);
}
* { box-sizing: border-box }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.48 "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit }
button { background: transparent; border: 0; padding: 0; text-align: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent }
a { color: inherit }
button, a, input, select, textarea, summary { touch-action: manipulation }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid currentColor; outline-offset: 3px }
[hidden] { display: none !important }
h1, h2, h3, h4, p { margin: 0 }
svg.ui-icon { display: inline-block; vertical-align: middle; flex: none }
.skip { position: fixed; top: -80px; left: 16px; z-index: 30; color: white; background: black; padding: 10px 15px; border-radius: 6px }
.skip:focus { top: 10px }

.appbar { background: white; border-bottom: 1px solid var(--line); padding-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) }
.bar-inner, .main-wrap { width: min(calc(100% - 2 * var(--side)), 1080px); margin: auto }
.bar-inner { min-height: 68px; display: flex; align-items: center; gap: clamp(18px, 4vw, 58px) }
.brand { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; color: #111; white-space: nowrap; letter-spacing: -1.1px; font-size: 23px; line-height: 1; font-weight: 750 }
.brand em { font-style: normal; font-weight: 470 }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: black; border-radius: 6px }
.brand-mark img { width: 80%; height: auto; display: block }
#wide-nav { align-self: stretch; display: flex; gap: clamp(12px, 2vw, 28px); align-items: stretch }
.nav-item { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; white-space: nowrap; font-weight: 570; color: var(--muted); position: relative }
.nav-item[aria-current="page"] { color: var(--ink); font-weight: 720 }
#wide-nav .nav-item[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: currentColor }
.account-tools { display: flex; align-items: center; gap: 10px; margin-left: auto }
.bell-button, .account-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px }
.bell-button { position: relative }
.unread-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: black; border: 1.5px solid white; border-radius: 50% }
.account-button { gap: 8px }
.avatar { border-radius: 50%; display: grid; place-items: center; background: var(--soft); width: 34px; height: 34px; font-size: 13px; font-weight: 720 }
.identity { display: flex; flex-direction: column; text-align: left; line-height: 1.3 }
.identity strong { font-size: 13px }
.identity small { font-size: 12px; color: var(--muted) }
.login-entry { display: inline-grid; place-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 650; font-size: 14px }
#mobile-nav { display: none }
body.account-mode #wide-nav, body.account-mode #mobile-nav, body.account-mode .account-tools { display: none }
.main-wrap { padding-top: clamp(24px, 3.1vw, 42px); padding-bottom: 48px; outline: 0 }

.legacy-home { max-width: 650px; margin: 0 auto }
.page-intro { margin-bottom: 18px }
.page-intro h1 { font-size: clamp(31px, 4vw, 46px); letter-spacing: -.045em; line-height: 1.12 }
.page-intro p { font-size: 15px; color: var(--muted); margin-top: 6px }
.home-bill { border: 1px solid var(--line); background: var(--paper); border-radius: var(--round); padding: 24px }
.home-bill h2 { font-size: 17px; font-weight: 650 }
.home-bill[data-state="unpaid"] { background: #ffe9e7; border-color: #f0b7b6; color: #651e23 }
.home-bill[data-state="unpaid"] .btn.primary { background: #ae1d31; color: white }
.home-amount { font-size: clamp(38px, 5vw, 52px); font-weight: 700; line-height: 1.15; letter-spacing: -.05em; margin-top: 13px; font-variant-numeric: tabular-nums }
.home-due { color: var(--muted); font-size: 14px; margin: 5px 0 20px }
.home-shortcuts { display: grid; margin-top: 16px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--round); background: var(--paper) }
.home-shortcuts button { display: flex; align-items: center; gap: 12px; min-height: 54px; font-weight: 620 }
.home-shortcuts button + button { border-top: 1px solid var(--line) }
.home-shortcuts span { flex: 1 }
.feature-stack { display: grid; gap: 20px; max-width: 760px; margin: 0 auto }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 11px }
.section-heading h2, .section-heading h3 { font-size: 21px; letter-spacing: -.035em; line-height: 1.25; font-weight: 680 }
.surface { padding: 20px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--round) }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 6px; background: var(--soft); color: #383838; font-size: 12px; font-weight: 650; line-height: 1.3; padding: 4px 8px }
.badge.amber { color: #634908; background: var(--am-accent-pale) }
.list-row { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 60px }
.row-main { flex: 1; min-width: 0 }
.row-end { margin-left: auto; text-align: right }
.muted { color: var(--muted) }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 11px 17px; min-height: 44px; font-weight: 680; font-size: 15px; border-radius: 9px; text-decoration: none; border: 1px solid transparent }
.btn.primary { background: var(--accent); color: var(--am-action-text) }
.btn.secondary { background: white; color: var(--ink); border-color: #c5c5c5 }
.chip { border-radius: 7px; border: 1px solid var(--line); background: white; color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 14px; min-height: 44px }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: white }
.detail-title { font-size: 26px; letter-spacing: -.04em; line-height: 1.15 }
.detail-list { display: grid }
.form-field { display: grid; gap: 6px }
.empty-state { color: var(--muted); padding: 15px 0 }

body.modal-open { overflow: hidden }
.backdrop { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .5) }
.dialog { position: relative; background: var(--paper); border-radius: 16px; padding: 28px; width: min(100%, 485px); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain; outline: none }
.close-dialog { width: 44px; height: 44px; border-radius: 50%; position: absolute; right: 13px; top: 12px; background: var(--soft); display: grid; place-items: center; z-index: 2 }
.sheet-grip { display: none }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(20px, var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); transform: translateX(-50%); max-width: calc(100% - 36px); width: max-content; background: #171717; color: white; border-radius: 8px; padding: 11px 18px; font-size: 14px; pointer-events: none }
.toast:empty { display: none }
@media (hover: hover) {
  .nav-item:hover, .list-row:hover { color: var(--ink) }
  .account-button:hover .avatar, .bell-button:hover { background: var(--soft) }
  .home-shortcuts button:hover { color: var(--muted) }
  .btn.primary:hover { background: #f5b900 }
}
@media (max-width: 880px) {
  .identity { display: none }
  #wide-nav .ui-icon { display: none }
  .account-tools { gap: 4px }
}
@media (max-width: 700px) {
  :root { --side: 20px }
  .bar-inner { min-height: 56px; gap: 7px }
  .brand { font-size: 21px; gap: 7px }
  .brand-mark { width: 32px; height: 32px }
  #wide-nav { display: none }
  #mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 7; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--line); padding: 3px env(safe-area-inset-right, 0px) max(4px, env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px) }
  .nav-item { flex-direction: column; font-size: 11px; min-height: 52px; gap: 0 }
  .nav-icon { display: grid; place-items: center; width: 36px; height: 25px }
  .nav-item[aria-current="page"] .nav-icon { background: var(--soft); border-radius: 6px }
  .main-wrap { padding-top: 20px; padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) }
  .surface { padding: 16px }
  .home-bill { padding: 19px }
  .backdrop { padding: 0; align-items: end }
  .dialog { width: 100%; padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; max-height: calc(100dvh - max(20px, env(safe-area-inset-top, 0px))) }
  .sheet-grip { display: block; height: 4px; width: 34px; border-radius: 3px; margin: -12px auto 13px; background: var(--line) }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom, 0px)) }
}
@media (max-width: 360px) {
  :root { --side: 15px }
  .brand { font-size: 18px; gap: 6px }
  .brand-mark { width: 27px; height: 27px }
  .account-tools { gap: 0 }
  .login-entry { padding-inline: 8px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important }
}
