/* =========================================================
   STUDIO LEDGER — monochrome weekly finance workspace
   ========================================================= */

:root {
  --bg: #f3f3ef;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #2d2d2a;
  --muted: #73736d;
  --muted-2: #9c9c94;
  --line: #d9d9d2;
  --line-strong: #b9b9b0;
  --soft: #e9e9e3;
  --black: #0a0a0a;
  --white: #ffffff;
  --sans: "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .65, .25, 1);
  --sidebar-w: 252px;
  --topbar-h: 84px;
  --radius: 10px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--white); }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; flex: 0 0 auto; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #bdbdb5; border: 3px solid var(--bg); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.micro-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.micro-label.light { color: #9a9a94; }

/* =========================================================
   Generic controls
   ========================================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}

.button svg { width: 15px; height: 15px; }
.button:hover { background: var(--ink); color: var(--white); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.button-primary { background: var(--ink); color: var(--white); }
.button-primary:hover { background: #30302c; border-color: #30302c; }

.button-quiet {
  min-height: 34px;
  padding: 0 11px;
  border-color: var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}
.button-quiet:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

.button-danger { border-color: var(--ink); }
.button-danger:hover { background: var(--ink); color: var(--white); }

.button-sm { min-height: 32px; padding: 0 11px; font-size: 10px; }

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  transition: color .15s;
}
.text-button:hover { color: var(--ink); }
.text-button svg { width: 13px; height: 13px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color .15s, background .15s, color .15s;
}
.icon-button:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }
.icon-button svg { width: 16px; height: 16px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}
.tag-light { border-color: rgba(255,255,255,.22); color: #b7b7b0; }
.tag-solid { border-color: var(--ink); background: var(--ink); color: var(--white); }
.tag-dot::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .08em;
  white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-open { border-color: var(--ink); color: var(--ink); }
.status-settled { border-color: transparent; background: var(--ink); color: var(--white); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.avatar-inverse { background: var(--ink); color: var(--white); }

.divider { height: 1px; background: var(--line); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 36px 24px;
  color: var(--muted);
}
.empty-state strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.empty-state span { font-size: 11px; }

/* =========================================================
   Login
   ========================================================= */

.login-body { background: var(--white); }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
  min-height: 100vh;
}

.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 42px 48px 28px;
  background-color: var(--black);
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--white);
}

.login-art::after {
  content: "50";
  position: absolute;
  right: -22px;
  bottom: -58px;
  color: transparent;
  font-family: var(--sans);
  font-size: min(36vw, 430px);
  font-weight: 800;
  letter-spacing: -.1em;
  line-height: .8;
  -webkit-text-stroke: 1px rgba(255,255,255,.14);
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.08em;
  white-space: nowrap;
}
.brand-mark span { color: #8d8d86; padding: 0 1px; }
.brand-mark svg { width: 14px; height: 14px; }
.brand-mark-light { background: var(--white); color: var(--ink); }
.brand-mark-light span { color: #8d8d86; }

.login-brand-copy { display: flex; flex-direction: column; }
.login-brand-copy strong { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.login-brand-copy small { margin-top: 2px; color: #8f8f89; font-family: var(--mono); font-size: 8px; letter-spacing: .16em; }

.login-art-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 66px 0;
}

.login-art-copy h1 {
  margin-top: 15px;
  color: var(--white);
  font-size: clamp(58px, 7.4vw, 116px);
  font-weight: 800;
  letter-spacing: -.075em;
  line-height: .86;
}
.login-art-copy h1 span { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.58); }
.login-art-copy > p:last-child { margin-top: 25px; color: #969690; font-size: 13px; line-height: 1.8; }

.login-art-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.15);
  color: #7f7f79;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--white);
}

.login-panel-inner { width: min(390px, 100%); }

.login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.login-index { color: var(--muted-2); font-family: var(--mono); font-size: 8px; letter-spacing: .12em; }

.login-heading { margin-top: 44px; }
.login-heading h2 { font-size: 34px; font-weight: 700; letter-spacing: -.055em; line-height: 1.05; }
.login-heading p { margin-top: 10px; color: var(--muted); font-size: 11px; }

.login-field { margin-top: 30px; }
.login-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.login-field input {
  width: 100%;
  height: 48px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  transition: border-color .16s;
}
.login-field input:focus { border-color: var(--ink); }

.login-error {
  margin-top: 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--ink);
  background: var(--soft);
  color: var(--ink);
  font-size: 10px;
  line-height: 1.6;
}

.login-submit {
  width: 100%;
  justify-content: space-between;
  min-height: 50px;
  margin-top: 28px;
  padding: 0 18px;
  font-size: 12px;
}
.login-submit svg { width: 17px; height: 17px; }

.login-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255,255,255,.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.login-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 68px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .05em;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   App frame
   ========================================================= */

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 26px 18px 18px;
  background: var(--black);
  color: var(--white);
}

.sidebar-top { padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 11px; }
.sidebar .brand-mark { background: var(--white); color: var(--ink); }
.sidebar .brand-mark span { color: #8d8d86; }
.brand-copy { display: flex; min-width: 0; flex-direction: column; }
.brand-copy strong {
  overflow: hidden;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-copy small { margin-top: 2px; color: #878781; font-family: var(--mono); font-size: 7px; letter-spacing: .17em; }
.sidebar-rule { height: 1px; margin: 24px 0 18px; background: rgba(255,255,255,.15); }
.side-note { color: #82827c; font-size: 10px; line-height: 1.8; }

.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 32px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 43px;
  padding: 0 12px;
  border-radius: 3px;
  color: #9e9e98;
  font-size: 12px;
  transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255,255,255,.07); color: var(--white); }
.side-link.is-active { background: var(--white); color: var(--ink); }
.side-index { width: 18px; color: #64645e; font-family: var(--mono); font-size: 8px; }
.side-link.is-active .side-index { color: #8b8b84; }
.side-dot { width: 4px; height: 4px; margin-left: auto; border-radius: 50%; background: currentColor; }
.side-badge {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .04em;
}
.side-link.is-active .side-badge { border-color: var(--ink); }

.sidebar-foot { margin-top: auto; }
.side-schedule {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 13px 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 3px;
  color: #7f7f79;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.7;
}
.side-schedule-dot { width: 5px; height: 5px; margin-top: 4px; border-radius: 50%; background: var(--white); }
.side-schedule em { color: #b5b5ae; font-style: normal; }

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  padding: 13px 8px 0;
  border-top: 1px solid rgba(255,255,255,.13);
}
.side-user .avatar { border-color: rgba(255,255,255,.35); background: transparent; color: var(--white); }
.side-user-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.side-user-copy strong { overflow: hidden; color: #d4d4ce; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.side-user-copy small { margin-top: 1px; color: #787872; font-family: var(--mono); font-size: 7px; }
.side-user .icon-button { width: 28px; height: 28px; border-color: rgba(255,255,255,.16); background: transparent; color: #8f8f89; }
.side-user .icon-button:hover { border-color: var(--white); background: var(--white); color: var(--ink); }
.side-user .icon-button svg { width: 13px; height: 13px; }

.sidebar-scrim {
  position: fixed;
  z-index: 35;
  inset: 0;
  background: rgba(10,10,10,.48);
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--topbar-h);
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(243,243,239,.97);
}

.menu-button { display: none; }
.topbar-title { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.topbar-title p { color: var(--muted-2); font-family: var(--mono); font-size: 8px; letter-spacing: .14em; }
.topbar-title h1 { font-size: 27px; font-weight: 700; letter-spacing: -.055em; line-height: 1.1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.today-label { color: var(--muted); font-family: var(--mono); font-size: 9px; white-space: nowrap; }

.button-add svg { width: 14px; height: 14px; }

.view {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 27px 32px 64px;
  outline: none;
}

.view-enter { animation: view-in .24s var(--ease) both; }
@keyframes view-in { from { opacity: .45; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.mobile-nav { display: none; }

/* =========================================================
   Page heading and shared sections
   ========================================================= */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head-copy { min-width: 0; }
.page-head-copy h2 {
  margin-top: 8px;
  font-size: clamp(29px, 3vw, 43px);
  font-weight: 750;
  letter-spacing: -.065em;
  line-height: 1.02;
}
.page-head-copy p:last-child { max-width: 510px; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.page-head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; padding-bottom: 2px; }

.notice-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}
.notice-strip > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 22px; border: 1px solid var(--line); border-radius: 50%; }
.notice-strip > span:first-child svg { width: 11px; height: 11px; }
.notice-strip p { flex: 1; }
.notice-strip a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: 9px; font-weight: 600; white-space: nowrap; }
.notice-strip a svg { width: 11px; height: 11px; }

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 13px;
}
.section-head h3 { font-size: 16px; font-weight: 650; letter-spacing: -.03em; }
.section-head p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.section-head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.card-pad { padding: 22px; }
.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 0;
}
.panel-head h3 { font-size: 13px; font-weight: 650; letter-spacing: -.02em; }
.panel-head p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.panel-head-actions { margin-left: auto; }
.panel-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* =========================================================
   Dashboard
   ========================================================= */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(315px, .75fr);
  gap: 12px;
}

.net-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 302px;
  overflow: hidden;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
}
.net-card::after {
  content: "50";
  position: absolute;
  right: -16px;
  bottom: -52px;
  color: transparent;
  font-size: 230px;
  font-weight: 800;
  letter-spacing: -.12em;
  line-height: 1;
  -webkit-text-stroke: 1px rgba(255,255,255,.14);
  pointer-events: none;
}
.net-card > * { position: relative; z-index: 1; }
.net-card-top { display: flex; align-items: center; gap: 9px; }
.net-card-top .status { margin-left: auto; border-color: rgba(255,255,255,.25); color: var(--white); }
.net-card-top .status-settled { background: var(--white); border-color: var(--white); color: var(--ink); }

.net-label {
  margin-top: 30px;
  color: #8d8d87;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.net-label span { margin-left: 7px; color: #5f5f5a; }
.net-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 5px;
  color: var(--white);
  font-size: clamp(46px, 5.6vw, 76px);
  font-weight: 750;
  letter-spacing: -.085em;
  line-height: .96;
  font-variant-numeric: tabular-nums;
}
.net-amount .currency { color: #989891; font-family: var(--mono); font-size: 22px; font-weight: 400; letter-spacing: -.03em; }
.net-amount .cents { color: #777770; font-size: .55em; letter-spacing: -.06em; }
.net-delta { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #b0b0a9; font-family: var(--mono); font-size: 9px; }
.net-delta .arrow { color: var(--white); }

.net-foot {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.net-metric { display: flex; flex-direction: column; gap: 2px; }
.net-metric span { color: #767670; font-family: var(--mono); font-size: 7px; letter-spacing: .1em; }
.net-metric strong { color: #e2e2db; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.net-actions { display: flex; gap: 7px; margin-left: auto; }
.net-actions .button {
  min-height: 32px;
  padding: 0 11px;
  border-color: rgba(255,255,255,.25);
  color: #d6d6cf;
  font-size: 9px;
}
.net-actions .button:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.net-actions .button-primary { border-color: var(--white); background: var(--white); color: var(--ink); }
.net-actions .button-primary:hover { background: transparent; color: var(--white); }

.split-card { display: flex; flex-direction: column; padding: 22px; }
.card-heading { display: flex; align-items: center; gap: 10px; }
.card-heading h3 { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.card-heading .tag { margin-left: auto; }
.split-list { display: flex; flex-direction: column; margin-top: 18px; }
.split-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.split-row:last-child { border-bottom: 0; }
.split-row .avatar { width: 35px; height: 35px; flex-basis: 35px; }
.split-person { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.split-person strong { font-size: 11px; font-weight: 600; }
.split-person span { margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 7px; letter-spacing: .05em; }
.split-amount { font-family: var(--mono); font-size: 16px; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; }
.split-equal { display: flex; align-items: center; gap: 7px; margin: 3px 0; color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.split-equal::before, .split-equal::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.split-card-foot { margin-top: auto; padding-top: 14px; }
.split-card-foot .button { width: 100%; min-height: 36px; }
.split-note { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; color: var(--muted); font-size: 8px; }
.split-note svg { width: 12px; height: 12px; }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-cell { padding: 17px 18px; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: 0; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { margin-top: 8px; font-size: 24px; font-weight: 650; letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value .currency { margin-right: 2px; color: var(--muted-2); font-family: var(--mono); font-size: 10px; font-weight: 400; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 8px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 8px; color: var(--ink); }
.delta svg { width: 10px; height: 10px; }
.delta-muted { color: var(--muted); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .7fr); gap: 12px; margin-top: 12px; }
.dashboard-grid.even { grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); }

.chart-card { min-height: 350px; padding-bottom: 16px; }
.chart-top { padding: 20px 22px 0; }
.chart-legend { display: flex; align-items: center; gap: 15px; margin-top: 10px; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.legend { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 1px; background: var(--ink); }
.legend.expense i { background: #a6a69e; }
.legend.net i { border: 1px solid var(--ink); background: transparent; border-radius: 50%; }
.chart-wrap { position: relative; padding: 9px 14px 0; }
.chart-svg { display: block; width: 100%; height: 238px; overflow: visible; }
.chart-svg .grid-line { stroke: #e7e7e0; stroke-width: 1; stroke-dasharray: 2 4; }
.chart-svg .axis-text { fill: #93938c; font-family: var(--mono); font-size: 8px; }
.chart-svg .axis-text.current { fill: var(--ink); font-weight: 600; }
.chart-svg .bar-income { fill: var(--ink); }
.chart-svg .bar-expense { fill: #b6b6ae; }
.chart-svg .net-line { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart-svg .net-dot { fill: var(--white); stroke: var(--ink); stroke-width: 1.3; }
.chart-svg .bar-group:hover { opacity: .7; }
.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 130px;
  padding: 9px 11px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.7;
  pointer-events: none;
  transform: translate(-50%, -108%);
  opacity: 0;
  transition: opacity .1s;
}
.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip strong { display: block; margin-bottom: 2px; font-size: 9px; font-weight: 500; }
.chart-tooltip .tooltip-row { display: flex; justify-content: space-between; gap: 14px; color: #a9a9a2; }
.chart-tooltip .tooltip-row b { color: var(--white); font-weight: 400; }
.chart-foot { display: flex; align-items: center; gap: 10px; margin: 7px 22px 0; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.chart-foot strong { color: var(--ink); font-weight: 500; }
.chart-foot .right { margin-left: auto; }

.breakdown-card { padding-bottom: 18px; }
.breakdown-total { padding: 20px 22px 0; }
.breakdown-total small { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .08em; }
.breakdown-total strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 650; letter-spacing: -.055em; }
.breakdown-bar { display: flex; height: 8px; margin: 18px 22px 0; overflow: hidden; border-radius: 1px; background: var(--soft); }
.breakdown-bar span { height: 100%; }
.breakdown-list { padding: 18px 22px 0; }
.breakdown-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 0; }
.breakdown-dot { width: 6px; height: 6px; border-radius: 1px; }
.breakdown-name { overflow: hidden; color: var(--ink-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-name small { margin-left: 5px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.breakdown-value { color: var(--ink); font-family: var(--mono); font-size: 10px; white-space: nowrap; }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 12px; margin-top: 12px; }
.list-card { overflow: hidden; }
.tx-list { margin-top: 8px; }
.tx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 22px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background .14s;
}
.tx-row:hover { background: #f8f8f4; }
.tx-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}
.tx-icon svg { width: 14px; height: 14px; }
.tx-icon.inverse { border-color: var(--ink); background: var(--ink); color: var(--white); }
.tx-main { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.tx-main strong { overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tx-main small { margin-top: 2px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.tx-side { display: flex; align-items: center; gap: 11px; }
.tx-week { color: var(--muted-2); font-family: var(--mono); font-size: 7px; white-space: nowrap; }
.tx-amount { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amount.income::before { content: "+"; }
.tx-amount.expense::before { content: "−"; }
.list-foot { padding: 10px 22px 16px; }

.week-mini-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.week-mini-table th { padding: 8px 22px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-family: var(--mono); font-size: 7px; font-weight: 500; letter-spacing: .08em; text-align: left; }
.week-mini-table th:last-child, .week-mini-table td:last-child { text-align: right; }
.week-mini-table td { padding: 10px 22px; border-bottom: 1px solid var(--line); font-size: 9px; }
.week-mini-table tbody tr { cursor: pointer; transition: background .14s; }
.week-mini-table tbody tr:hover { background: #f8f8f4; }
.week-mini-table tbody tr:last-child td { border-bottom: 0; }
.week-mini-table .week-label { display: flex; flex-direction: column; gap: 2px; }
.week-mini-table .week-label strong { font-size: 9px; font-weight: 500; }
.week-mini-table .week-label small { color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.week-mini-table .week-net { font-family: var(--mono); font-size: 10px; font-weight: 500; }

/* =========================================================
   Ledger
   ========================================================= */

.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-cell { padding: 15px 18px; border-right: 1px solid var(--line); }
.summary-cell:last-child { border-right: 0; }
.summary-label { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .08em; }
.summary-value { margin-top: 5px; font-size: 22px; font-weight: 650; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
}
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.segmented button {
  min-height: 29px;
  padding: 0 11px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  transition: background .14s, color .14s;
}
.segmented button.is-active { background: var(--ink); color: var(--white); }
.filter-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 35px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}
.filter-date svg { width: 13px; height: 13px; }
.filter-date input { width: 105px; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-size: 8px; }
.filter-search { position: relative; flex: 1; min-width: 170px; }
.filter-search svg { position: absolute; top: 50%; left: 10px; width: 13px; height: 13px; color: var(--muted-2); transform: translateY(-50%); }
.filter-search input {
  width: 100%;
  height: 35px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: var(--surface);
  font-size: 9px;
}
.filter-search input:focus, .filter-date:focus-within { border-color: var(--ink); }
.filter-reset { margin-left: 2px; }

.data-card { margin-top: 10px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 10px; vertical-align: middle; }
.data-table tbody tr { transition: background .13s; }
.data-table tbody tr:hover { background: #f8f8f4; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-date { color: var(--muted); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.data-date small { display: block; margin-top: 1px; color: var(--muted-2); font-size: 7px; }
.type-mark { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-family: var(--mono); font-size: 8px; white-space: nowrap; }
.type-mark::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.type-mark.expense::before { background: #a6a69e; }
.data-title { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.data-title .tx-icon { width: 27px; height: 27px; flex-basis: 27px; }
.data-title .tx-icon svg { width: 12px; height: 12px; }
.data-title-copy { display: flex; min-width: 0; flex-direction: column; }
.data-title-copy strong { max-width: 300px; overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.data-title-copy small { margin-top: 2px; max-width: 300px; overflow: hidden; color: var(--muted-2); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.category-chip { display: inline-flex; padding: 3px 6px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.data-amount { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.data-week { color: var(--muted); font-family: var(--mono); font-size: 8px; white-space: nowrap; }
.data-week button { display: block; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.data-week button:hover { color: var(--ink); text-decoration: underline; }
.table-footer { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.pagination { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.page-button {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
}
.page-button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.page-button.is-active { border-color: var(--ink); background: var(--ink); color: var(--white); }
.page-button:disabled { opacity: .35; cursor: default; }
.page-button svg { width: 11px; height: 11px; }

/* =========================================================
   Weeks
   ========================================================= */

.week-hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 12px; }
.week-hero {
  position: relative;
  overflow: hidden;
  min-height: 275px;
  padding: 24px 27px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
}
.week-hero::after {
  content: "";
  position: absolute;
  right: -95px;
  bottom: -150px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255,255,255,.025);
}
.week-hero > * { position: relative; z-index: 1; }
.week-hero-top { display: flex; align-items: center; gap: 9px; }
.week-hero-top h2 { font-size: 18px; font-weight: 600; letter-spacing: -.035em; }
.week-hero-top .status { margin-left: auto; border-color: rgba(255,255,255,.25); color: var(--white); }
.week-hero-top .status-settled { background: var(--white); border-color: var(--white); color: var(--ink); }
.week-hero-range { margin-top: 5px; color: #7f7f79; font-family: var(--mono); font-size: 8px; letter-spacing: .05em; }
.week-hero-label { margin-top: 32px; color: #82827c; font-family: var(--mono); font-size: 8px; letter-spacing: .1em; }
.week-hero-amount { display: flex; align-items: baseline; gap: 3px; margin-top: 5px; font-size: 52px; font-weight: 750; letter-spacing: -.08em; line-height: .95; font-variant-numeric: tabular-nums; }
.week-hero-amount .currency { color: #92928b; font-family: var(--mono); font-size: 17px; font-weight: 400; }
.week-hero-amount .cents { color: #777770; font-size: .55em; }
.week-hero-stats { display: flex; gap: 28px; margin-top: 23px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); }
.week-hero-stat { display: flex; flex-direction: column; gap: 2px; }
.week-hero-stat span { color: #777770; font-family: var(--mono); font-size: 7px; }
.week-hero-stat strong { color: #e3e3dc; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.week-hero-actions { display: flex; gap: 7px; margin-top: 18px; }
.week-hero-actions .button { min-height: 31px; border-color: rgba(255,255,255,.3); color: #e4e4dd; font-size: 9px; }
.week-hero-actions .button:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.week-hero-actions .button-primary { border-color: var(--white); background: var(--white); color: var(--ink); }
.week-hero-actions .button-primary:hover { background: transparent; color: var(--white); }

.split-panel { display: flex; flex-direction: column; padding: 22px; }
.split-panel .split-row { padding: 13px 0; }
.split-panel .avatar { width: 32px; height: 32px; flex-basis: 32px; }
.split-panel .split-amount { font-size: 14px; }
.split-panel .split-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.split-panel .split-hint { color: var(--muted); font-size: 8px; line-height: 1.7; }

.week-list-head { display: flex; align-items: flex-end; gap: 12px; margin: 26px 0 11px; }
.week-list-head h3 { font-size: 16px; font-weight: 650; letter-spacing: -.03em; }
.week-list-head p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.week-list-head .pagination { margin-left: auto; }
.week-list { border-top: 1px solid var(--line); }
.week-row {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(260px, 1.15fr) minmax(220px, .9fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background .14s;
}
.week-row:hover { background: var(--surface); }
.week-row.is-current { background: #eaeae4; }
.week-row-main { display: flex; flex-direction: column; gap: 3px; }
.week-row-title { display: flex; align-items: center; gap: 7px; }
.week-row-title strong { font-size: 11px; font-weight: 600; }
.week-row-title .tag { padding: 2px 5px; font-size: 7px; }
.week-row-main small { color: var(--muted); font-family: var(--mono); font-size: 7px; }
.week-row-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.week-number { display: flex; flex-direction: column; gap: 2px; }
.week-number span { color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.week-number strong { font-family: var(--mono); font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.week-number.net strong { font-size: 12px; }
.week-row-split { display: flex; align-items: center; gap: 12px; }
.week-mini-person { display: flex; align-items: center; gap: 5px; }
.week-mini-person .avatar { width: 19px; height: 19px; flex-basis: 19px; border: 0; background: var(--soft); font-size: 7px; }
.week-mini-person span:last-child { color: var(--muted); font-family: var(--mono); font-size: 8px; }
.week-row-end { display: flex; align-items: center; gap: 10px; }
.week-row-end .text-button { white-space: nowrap; }

/* =========================================================
   Insights
   ========================================================= */

.insights-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin-bottom: 18px; }
.period-switcher { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.period-button { display: grid; place-items: center; width: 29px; height: 27px; padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--muted); }
.period-button:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.period-button:disabled { opacity: .3; cursor: default; }
.period-button svg { width: 13px; height: 13px; }
.period-label { min-width: 125px; padding: 0 5px; font-family: var(--mono); font-size: 9px; text-align: center; }

.compare-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.compare-cell { padding: 16px 18px; border-right: 1px solid var(--line); }
.compare-cell:last-child { border-right: 0; }
.compare-label { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .06em; }
.compare-value { margin-top: 8px; font-size: 25px; font-weight: 650; letter-spacing: -.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.compare-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-family: var(--mono); font-size: 7px; }

.insights-main { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 12px; margin-top: 12px; }
.insight-note { padding: 24px; border-radius: var(--radius); background: var(--ink); color: var(--white); }
.insight-note .micro-label { color: #777770; }
.insight-note h3 { margin-top: 15px; font-size: 25px; font-weight: 650; letter-spacing: -.065em; line-height: 1.08; }
.insight-note > p { margin-top: 11px; color: #a0a099; font-size: 10px; line-height: 1.8; }
.insight-rule { height: 1px; margin: 22px 0 5px; background: rgba(255,255,255,.15); }
.insight-stat { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.insight-stat:first-of-type { border-top: 0; }
.insight-stat span { color: #85857f; font-size: 8px; }
.insight-stat strong { color: #e5e5de; font-family: var(--mono); font-size: 10px; font-weight: 400; }
.insight-stat strong small { color: #85857f; font-size: 7px; }

.comparison-card { margin-top: 12px; overflow: hidden; }
.comparison-table { width: 100%; border-collapse: collapse; }
.comparison-table th { padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-family: var(--mono); font-size: 7px; font-weight: 500; letter-spacing: .06em; text-align: right; }
.comparison-table th:first-child { text-align: left; }
.comparison-table td { padding: 11px 18px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 9px; text-align: right; }
.comparison-table td:first-child { text-align: left; font-family: var(--sans); }
.comparison-table tbody tr:last-child td { border-bottom: 0; }
.comparison-table tr.is-current { background: #eaeae4; }
.comparison-period { display: flex; align-items: center; gap: 7px; font-size: 9px; }
.comparison-period i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.comparison-period .tag { padding: 2px 5px; font-size: 7px; }
.comparison-delta { min-width: 80px; }

/* =========================================================
   Settings
   ========================================================= */

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .68fr); gap: 12px; align-items: start; }
.settings-column { display: flex; flex-direction: column; gap: 12px; }
.settings-block { padding: 22px; }
.settings-block-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; }
.settings-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); }
.settings-icon svg { width: 15px; height: 15px; }
.settings-block-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -.03em; }
.settings-block-head p { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.settings-block-head .settings-action { margin-left: auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .06em; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  transition: border-color .14s;
}
.field textarea { min-height: 74px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field .hint { color: var(--muted-2); font-size: 8px; line-height: 1.5; }
.field-row { display: flex; gap: 8px; align-items: center; margin-top: 11px; flex-wrap: wrap; }
.field-error { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--ink); background: var(--soft); font-size: 9px; }

.partner-config { padding: 15px; border: 1px solid var(--line); border-radius: 4px; background: #fafaf7; }
.partner-config + .partner-config { margin-top: 10px; }
.partner-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.partner-top .avatar { width: 33px; height: 33px; flex-basis: 33px; }
.partner-name { display: flex; flex: 1; flex-direction: column; }
.partner-name strong { font-size: 10px; font-weight: 600; }
.partner-name span { margin-top: 1px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.partner-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.partner-state::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.partner-state.missing::before { background: var(--muted-2); }
.partner-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.partner-actions .button { min-height: 30px; font-size: 9px; }

.mail-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 13px; }
.mail-mode-option { position: relative; }
.mail-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mail-mode-option span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}
.mail-mode-option span::after { content: ""; width: 7px; height: 7px; border: 1px solid var(--line-strong); border-radius: 50%; }
.mail-mode-option input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--white); }
.mail-mode-option input:checked + span::after { border-color: var(--white); background: var(--white); }

.schedule-card { padding: 22px; background: var(--ink); color: var(--white); border-radius: var(--radius); }
.schedule-card .micro-label { color: #777770; }
.schedule-time { display: flex; align-items: baseline; gap: 7px; margin-top: 17px; }
.schedule-time strong { font-size: 42px; font-weight: 700; letter-spacing: -.075em; line-height: .9; }
.schedule-time span { color: #898983; font-family: var(--mono); font-size: 8px; }
.schedule-next { margin-top: 13px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 2px; color: #92928c; font-family: var(--mono); font-size: 8px; line-height: 1.6; }
.schedule-next strong { color: #e1e1da; font-weight: 400; }
.trigger-list { margin-top: 17px; border-top: 1px solid rgba(255,255,255,.15); }
.trigger-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.09); }
.trigger-row:last-child { border-bottom: 0; }
.trigger-row i { width: 4px; height: 4px; border-radius: 50%; background: var(--white); }
.trigger-row span { flex: 1; color: #bebeb7; font-size: 9px; }
.trigger-row small { color: #70706a; font-family: var(--mono); font-size: 7px; }

.logs-block { overflow: hidden; }
.logs-wrap { overflow-x: auto; }
.logs-table { width: 100%; border-collapse: collapse; }
.logs-table th { padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-family: var(--mono); font-size: 7px; font-weight: 500; letter-spacing: .06em; text-align: left; white-space: nowrap; }
.logs-table td { padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 8px; white-space: nowrap; }
.logs-table tbody tr:last-child td { border-bottom: 0; }
.logs-table .log-subject { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.log-status { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.log-status::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.log-status.failed::before { background: var(--muted-2); }
.settings-full { grid-column: 1 / -1; }

.account-note { margin-top: 12px; padding: 10px 11px; border: 1px solid var(--line); background: #fafaf7; color: var(--muted); font-size: 8px; line-height: 1.7; }

/* =========================================================
   Modals, drawers, toast
   ========================================================= */

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10,10,10,.5);
  animation: fade-in .14s ease both;
}
.modal-backdrop.drawer-backdrop { justify-content: flex-end; align-items: stretch; padding: 0; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(620px, 100%);
  max-height: min(91vh, 900px);
  overflow-y: auto;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--surface);
  animation: modal-in .18s var(--ease) both;
}
.modal.small { width: min(450px, 100%); }
.modal.drawer { width: min(610px, 100%); height: 100%; max-height: none; border-radius: 0; animation: drawer-in .2s var(--ease) both; }
@keyframes modal-in { from { opacity: .5; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes drawer-in { from { opacity: .6; transform: translateX(18px); } to { opacity: 1; transform: none; } }

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.modal-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -.045em; line-height: 1.1; }
.modal-head p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.modal-close { margin-left: auto; }
.modal-body { padding: 20px 22px; }
.modal-foot {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.modal-foot-note { margin-right: auto; color: var(--muted); font-size: 8px; line-height: 1.5; }
.modal-foot-actions { display: flex; gap: 7px; margin-left: auto; }
.modal-foot-actions .button { min-height: 36px; }

.form-type { display: flex; gap: 4px; margin-bottom: 20px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background: #fafaf7; }
.form-type button { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-height: 35px; border: 0; border-radius: 2px; background: transparent; color: var(--muted); font-size: 10px; }
.form-type button svg { width: 14px; height: 14px; }
.form-type button.is-active { background: var(--ink); color: var(--white); }
.amount-input { padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.amount-input label { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .08em; }
.amount-input input {
  width: 100%;
  margin-top: 3px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 43px;
  font-weight: 650;
  letter-spacing: -.06em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.amount-input input::placeholder { color: #d3d3cb; }
.form-fields { margin-top: 17px; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.category-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 47px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  text-align: left;
  transition: border-color .14s, background .14s;
}
.category-option:hover { border-color: var(--line-strong); }
.category-option.is-active { border-color: var(--ink); background: var(--ink); color: var(--white); }
.category-option .cat-symbol { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid var(--line); border-radius: 50%; }
.category-option.is-active .cat-symbol { border-color: rgba(255,255,255,.4); }
.category-option .cat-symbol svg { width: 12px; height: 12px; }
.category-option .cat-copy { display: flex; min-width: 0; flex-direction: column; }
.category-option .cat-copy strong { overflow: hidden; font-size: 8px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.category-option .cat-copy small { margin-top: 2px; color: var(--muted-2); font-size: 7px; }
.category-option.is-active .cat-copy small { color: #8e8e87; }
.category-custom { margin-top: 7px; }
.form-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 14px; padding: 9px 10px; border-left: 3px solid var(--ink); background: #fafaf7; color: var(--muted); font-size: 8px; line-height: 1.7; }
.form-note svg { width: 12px; height: 12px; margin-top: 1px; }
.form-error { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--ink); background: var(--soft); color: var(--ink); font-size: 9px; }

.drawer-body { padding-bottom: 26px; }
.drawer-hero { padding: 22px; border-bottom: 1px solid var(--line); background: #fafaf7; }
.drawer-top { display: flex; align-items: center; gap: 8px; }
.drawer-top h2 { font-size: 22px; font-weight: 650; letter-spacing: -.055em; }
.drawer-top .status { margin-left: auto; }
.drawer-range { margin-top: 3px; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.drawer-net-label { margin-top: 22px; color: var(--muted); font-family: var(--mono); font-size: 8px; }
.drawer-net { margin-top: 4px; font-size: 38px; font-weight: 700; letter-spacing: -.075em; line-height: 1; font-variant-numeric: tabular-nums; }
.drawer-net .currency { margin-right: 2px; color: var(--muted); font-family: var(--mono); font-size: 14px; font-weight: 400; }
.drawer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 19px; }
.drawer-stat { padding: 9px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); }
.drawer-stat span { color: var(--muted); font-family: var(--mono); font-size: 7px; }
.drawer-stat strong { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; font-weight: 500; }
.drawer-splits { display: flex; gap: 6px; margin-top: 8px; }
.drawer-split { display: flex; align-items: center; gap: 7px; flex: 1; padding: 8px 9px; border: 1px solid var(--line); background: var(--surface); }
.drawer-split .avatar { width: 23px; height: 23px; flex-basis: 23px; border: 0; background: var(--soft); font-size: 8px; }
.drawer-split span { flex: 1; color: var(--muted); font-size: 8px; }
.drawer-split strong { font-family: var(--mono); font-size: 10px; font-weight: 500; }
.drawer-section { padding: 20px 22px 0; }
.drawer-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.drawer-section-head h3 { font-size: 10px; font-weight: 600; }
.drawer-section-head span { color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
.drawer-section-head .text-button { margin-left: auto; }
.drawer-breakdown-row { display: grid; grid-template-columns: 6px minmax(100px, 1fr) 65px 34px 68px; align-items: center; gap: 7px; padding: 5px 0; font-size: 8px; }
.drawer-breakdown-row i { width: 6px; height: 6px; border-radius: 1px; background: var(--ink); }
.drawer-breakdown-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-mini-bar { height: 3px; background: var(--soft); }
.drawer-mini-bar span { display: block; height: 100%; background: var(--ink); }
.drawer-pct { color: var(--muted); font-family: var(--mono); font-size: 7px; text-align: right; }
.drawer-amount { font-family: var(--mono); font-size: 9px; text-align: right; }
.drawer-tx { border: 1px solid var(--line); }
.drawer-tx-row { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.drawer-tx-row:last-child { border-bottom: 0; }
.drawer-tx-row .tx-icon { width: 25px; height: 25px; flex-basis: 25px; }
.drawer-tx-row .tx-icon svg { width: 11px; height: 11px; }
.drawer-tx-row .tx-main strong { font-size: 9px; }
.drawer-tx-row .tx-main small { font-size: 7px; }
.drawer-tx-row .tx-amount { font-size: 9px; }
.drawer-actions { display: flex; gap: 7px; margin-top: 20px; }
.drawer-actions .button { flex: 1; }

.confirm-summary { padding: 15px; border: 1px solid var(--line); background: #fafaf7; }
.confirm-line { display: flex; align-items: center; justify-content: space-between; }
.confirm-line span { color: var(--muted); font-size: 9px; }
.confirm-line strong { font-family: var(--mono); font-size: 21px; font-weight: 500; letter-spacing: -.04em; }
.confirm-splits { display: flex; gap: 6px; margin-top: 12px; }
.confirm-person { display: flex; align-items: center; gap: 7px; flex: 1; padding: 8px; border: 1px solid var(--line); background: var(--surface); }
.confirm-person .avatar { width: 22px; height: 22px; flex-basis: 22px; border: 0; background: var(--soft); font-size: 8px; }
.confirm-person span { flex: 1; color: var(--muted); font-size: 8px; }
.confirm-person strong { font-family: var(--mono); font-size: 9px; font-weight: 500; }
.confirm-warning { display: flex; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.confirm-warning svg { width: 13px; height: 13px; margin-top: 1px; }

.toast-stack {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--white);
  font-size: 9px;
  line-height: 1.5;
  animation: toast-in .18s var(--ease) both;
  pointer-events: auto;
}
.toast.is-out { animation: toast-out .16s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }
.toast-icon { display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 17px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.toast-icon svg { width: 9px; height: 9px; }
.toast strong { display: block; font-weight: 600; }
.toast span { color: #a8a8a1; }

/* =========================================================
   Loading / skeleton
   ========================================================= */

.skeleton-page { display: flex; flex-direction: column; gap: 12px; }
.skeleton { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #e9e9e3; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.38), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-hero { height: 302px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skeleton-box { height: 88px; }
.skeleton-wide { height: 230px; }

.spinner { width: 13px; height: 13px; border: 1.5px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }

.page-error { display: flex; flex-direction: column; align-items: flex-start; max-width: 460px; padding: 50px 0; }
.page-error h2 { margin-top: 13px; font-size: 24px; font-weight: 650; letter-spacing: -.05em; }
.page-error p { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.page-error .button { margin-top: 16px; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1180px) {
  :root { --sidebar-w: 232px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .view { padding-left: 24px; padding-right: 24px; }
  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(290px, .75fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell:nth-child(2) { border-right: 0; }
  .stat-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-full { grid-column: auto; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; --topbar-h: 74px; }
  .sidebar { width: 252px; transform: translateX(-102%); transition: transform .22s var(--ease); }
  .sidebar.is-open { transform: translateX(0); }
  .main-shell { margin-left: 0; }
  .menu-button { display: inline-grid; }
  .topbar { min-height: var(--topbar-h); }
  .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .65fr); }
  .login-shell { grid-template-columns: 1fr 430px; }
  .login-art { padding: 34px; }
  .login-panel { padding: 34px; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .split-card { min-height: 0; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .dashboard-grid.even, .lower-grid, .insights-main { grid-template-columns: 1fr; }
  .week-hero-grid { grid-template-columns: 1fr; }
  .week-row { grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.2fr) auto; }
  .week-row-split { display: none; }
  .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-cell:nth-child(2) { border-right: 0; }
  .compare-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 240px; padding: 26px 28px 22px; }
  .login-art-copy { margin: 0; padding: 28px 0 18px; }
  .login-art-copy h1 { font-size: 50px; }
  .login-art-copy > p:last-child, .login-art-foot { display: none; }
  .login-panel { align-items: flex-start; padding: 32px 24px 50px; }
  .login-panel-inner { width: min(440px, 100%); margin: 0 auto; }
  .login-heading { margin-top: 30px; }
  .login-meta { margin-top: 45px; }
}

@media (max-width: 720px) {
  body { padding-bottom: 68px; }
  .topbar { padding: 13px 16px; gap: 10px; }
  .topbar-title p { font-size: 7px; }
  .topbar-title h1 { font-size: 21px; }
  .today-label { display: none; }
  .button-add { width: 38px; min-height: 36px; padding: 0; }
  .button-add span { display: none; }
  .view { padding: 18px 16px 36px; }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: 10px;
    bottom: calc(9px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    min-height: 58px;
    padding: 5px 7px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--ink);
    color: var(--white);
  }
  .mobile-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 45px; color: #8f8f88; font-size: 8px; }
  .mobile-link svg { width: 16px; height: 16px; }
  .mobile-link.is-active { color: var(--white); }
  .mobile-add { display: grid; place-items: center; width: 42px; height: 42px; margin: -21px auto 0; padding: 0; border: 0; border-radius: 50%; background: var(--white); color: var(--ink); }
  .mobile-add svg { width: 18px; height: 18px; }
  .notice-strip { margin-bottom: 13px; font-size: 8px; }
  .notice-strip a { font-size: 8px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 17px; }
  .page-head-copy h2 { font-size: 31px; }
  .page-head-actions { width: 100%; margin-left: 0; }
  .page-head-actions .button { flex: 1; }
  .hero-grid, .dashboard-grid, .dashboard-grid.even, .lower-grid, .week-hero-grid, .insights-main, .settings-layout { gap: 9px; margin-top: 9px; }
  .net-card { min-height: 285px; padding: 19px; }
  .net-card::after { right: -28px; bottom: -35px; font-size: 176px; }
  .net-amount { font-size: 43px; }
  .net-amount .currency { font-size: 17px; }
  .net-foot { flex-wrap: wrap; gap: 17px; }
  .net-metric strong { font-size: 12px; }
  .net-actions { width: 100%; padding-top: 12px; margin-left: 0; border-top: 1px solid rgba(255,255,255,.15); }
  .net-actions .button { flex: 1; }
  .split-card, .card-pad, .settings-block, .schedule-card { padding: 17px; }
  .stats-strip { margin-top: 9px; }
  .stat-cell { padding: 13px 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 7px; }
  .stat-foot { margin-top: 7px; font-size: 7px; }
  .dashboard-grid .panel-head, .chart-top { padding: 16px 16px 0; }
  .chart-legend { padding: 0 16px; }
  .chart-wrap { padding: 5px 5px 0; }
  .chart-svg { height: 210px; }
  .chart-foot { margin: 5px 16px 0; padding-top: 8px; }
  .breakdown-total { padding: 16px 16px 0; }
  .breakdown-total strong { font-size: 22px; }
  .breakdown-bar { margin: 13px 16px 0; }
  .breakdown-list { padding: 12px 16px 0; }
  .tx-row { padding: 9px 16px; }
  .tx-week { display: none; }
  .list-foot { padding: 8px 16px 13px; }
  .week-mini-table th, .week-mini-table td { padding-left: 16px; padding-right: 16px; }
  .week-mini-table th:nth-child(3), .week-mini-table td:nth-child(3) { display: none; }
  .week-mini-table td:nth-child(2) { text-align: right; }
  .summary-cell { padding: 12px 11px; }
  .summary-value { font-size: 18px; }
  .filter-bar { gap: 6px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .filter-date { flex: 1; min-width: 0; }
  .filter-date input { width: 100%; min-width: 0; }
  .filter-search { flex-basis: 100%; order: 2; }
  .filter-reset { order: 3; }
  .data-card { margin-top: 9px; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table td { display: block; padding: 0; border: 0; }
  .data-table .data-date { display: none; }
  .data-table .type-cell, .data-table .category-cell, .data-table .week-cell, .data-table .status-cell { display: none; }
  .data-table .title-cell { grid-column: 1; grid-row: 1 / span 2; }
  .data-title { min-width: 0; }
  .data-title-copy strong, .data-title-copy small { max-width: none; }
  .data-table .amount-cell { grid-column: 2; grid-row: 1; }
  .data-table .mobile-meta { display: block; grid-column: 1 / -1; margin-top: 4px; color: var(--muted-2); font-family: var(--mono); font-size: 7px; }
  .data-table .mobile-meta button { padding: 0; border: 0; background: none; color: inherit; font: inherit; }
  .table-footer { flex-wrap: wrap; padding: 10px 14px; }
  .pagination { flex-wrap: wrap; margin-left: 0; }
  .week-hero { min-height: 0; padding: 19px; }
  .week-hero::after { right: -130px; bottom: -140px; }
  .week-hero-amount { font-size: 43px; }
  .week-hero-stats { gap: 17px; margin-top: 18px; }
  .week-hero-actions { flex-wrap: wrap; }
  .week-hero-actions .button { flex: 1; }
  .week-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 13px 14px; }
  .week-row-numbers { grid-column: 1 / -1; grid-row: 2; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line); }
  .week-row-end { grid-column: 2; grid-row: 1; }
  .week-row-end .text-button { font-size: 0; }
  .week-row-end .text-button svg { width: 14px; height: 14px; }
  .week-list-head { align-items: flex-start; flex-wrap: wrap; margin-top: 20px; }
  .week-list-head .pagination { width: 100%; margin-left: 0; }
  .insights-controls { gap: 8px; }
  .insights-controls > .segmented { width: auto; order: 1; }
  .insights-controls > .segmented button { flex: 0 0 auto; }
  .period-switcher { order: 2; margin-left: 0; }
  .compare-cell { padding: 13px 12px; }
  .compare-value { font-size: 21px; }
  .insight-note { padding: 20px; }
  .insight-note h3 { font-size: 22px; }
  .comparison-card { overflow-x: auto; }
  .comparison-table { min-width: 580px; }
  .comparison-table th, .comparison-table td { padding-left: 13px; padding-right: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .mail-mode-switch { grid-template-columns: 1fr; }
  .logs-wrap { margin: 0 -1px; }
  .logs-table { min-width: 600px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 6px 6px 0 0; }
  .modal.small { width: 100%; }
  .modal.drawer { width: 100%; height: 94vh; margin-top: auto; border-radius: 6px 6px 0 0; }
  .modal-head { padding: 17px 17px 13px; }
  .modal-body { padding: 17px; }
  .modal-foot { padding: 12px 17px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .modal-foot-note { display: none; }
  .modal-foot-actions { width: 100%; }
  .modal-foot-actions .button { flex: 1; }
  .amount-input input { font-size: 36px; }
  .category-grid { gap: 5px; }
  .category-option { min-height: 44px; padding: 7px; }
  .category-option .cat-copy strong { font-size: 7.5px; }
  .drawer-hero { padding: 18px; }
  .drawer-section { padding: 17px 18px 0; }
  .drawer-net { font-size: 34px; }
  .drawer-breakdown-row { grid-template-columns: 6px minmax(90px, 1fr) 50px 30px 62px; gap: 5px; }
  .drawer-splits { flex-direction: column; }
  .toast-stack { right: 12px; bottom: calc(77px + env(safe-area-inset-bottom, 0px)); left: 12px; width: auto; }
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
  .skeleton-hero { height: 285px; }
  .skeleton-wide { height: 200px; }
  .login-body { padding-bottom: 0; }
  .login-art { min-height: 215px; background-size: 44px 44px; }
  .login-art-copy h1 { font-size: 43px; }
  .login-art-copy h1 br:nth-child(2) { display: none; }
  .login-art-copy h1 span::before { content: " "; }
  .login-art-copy > p:last-child { display: block; margin-top: 12px; font-size: 10px; }
  .login-panel { padding: 27px 20px 38px; }
  .login-heading h2 { font-size: 29px; }
  .login-meta { margin-top: 40px; }
}

@media (max-width: 380px) {
  .net-amount { font-size: 36px; }
  .stat-value { font-size: 18px; }
  .login-art-copy h1 { font-size: 37px; }
  .login-brand-copy strong { font-size: 11px; }
  .category-grid { grid-template-columns: 1fr; }
}

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