/* Middleware: clean, friendly and bright, in the spirit of parentsquare.com
   (white space, big confident headings, deep green buttons, soft pastel panels). */

:root {
  color-scheme: light;
  --ink: #0b0b0b;
  --ink-2: #33332f;
  --muted: #64635e;
  --faint: #8b8a84;
  --line: #ecebe6;
  --line-2: #dcdad3;
  --page: #ffffff;
  --soft: #f7f7f3;
  --soft-2: #f1f1ec;
  --card: #ffffff;

  --forest: #224b17;
  --forest-2: #183a10;
  --lime: #9aeb83;
  --green: #68e246;
  --mint: #e5fae0;
  --mint-2: #c9f4bc;

  --pink-bg: #fee3fa;  --pink-ink: #541d4c;  --pink: #d6409f;
  --amber-bg: #fff3db; --amber-ink: #553d0e; --amber: #e8930c;
  --sky-bg: #d7efff;   --sky-ink: #053655;   --sky: #2a78d6;
  --violet-bg: #f3e7ff; --violet-ink: #3e2655; --violet: #8a55e0;
  --red-bg: #ffe5e2;   --red-ink: #8a1414;   --red: #d03b3b;
  --orange-bg: #ffeadc; --orange-ink: #6b2a0b; --orange: #ec835a;
  --grey-bg: #f0f0ec;  --grey-ink: #3b3b37;  --grey: #9a9992;
  --green-bg: #e5fae0; --green-ink: #1d4a12; --green-dot: #3a9a2a;

  --viz-surface: #ffffff;
  --viz-grid: #ecebe5;
  --viz-base: #c9c7bf;
  --viz-axis: #84827b;

  --r-sm: 8px;
  --r: 11px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 12, 0.05);
  --shadow: 0 1px 2px rgba(17, 17, 12, 0.04), 0 10px 30px rgba(17, 17, 12, 0.08);
  --shadow-lg: 0 24px 70px rgba(17, 17, 12, 0.22);
  --focus: 0 0 0 3px rgba(104, 226, 70, 0.45);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.flip { transform: rotate(180deg); }
.logo { width: 32px; height: 32px; flex: none; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.page { padding-top: 40px; padding-bottom: 72px; outline: none; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.93em; letter-spacing: 0.01em; }
.warn { color: var(--red-ink) !important; }
.pad { padding: 16px 0; }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .icon { width: 16px; height: 16px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--forest); font-weight: 600; font-size: 13.5px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: 15px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--forest); border-color: var(--forest); color: var(--lime); }
.btn-primary:hover { background: var(--forest-2); }
.btn-secondary { background: #fff; border-color: var(--forest); color: var(--forest); }
.btn-secondary:hover { background: var(--mint); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b52f2f; }
.btn-danger-text { color: var(--red-ink); }
.btn-danger-text:hover { background: var(--red-bg); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.busy { opacity: .7; cursor: progress; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--soft); border-color: var(--faint); }
.icon-btn-sm { width: 34px; height: 34px; border-color: transparent; background: transparent; }
.icon-btn-sm:hover { background: var(--soft-2); border-color: transparent; }
.dot-count {
  position: absolute; top: -3px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--red); color: #fff; border: 2px solid #fff;
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---------- announcement bar, header */

.announce { background: var(--mint-2); color: var(--ink); font-size: 14px; }
.announce-row { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 46px; padding-top: 6px; padding-bottom: 6px; text-align: center; }
.announce-btn {
  flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: var(--r-sm); background: #fff; color: var(--forest); font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.announce-btn:hover { background: var(--mint); }

.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 24px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 500 23px/1 var(--display); letter-spacing: -0.4px; color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px;
  color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; transition: background-color .15s;
}
.nav-link:hover { background: var(--soft-2); }
.nav-link.active { background: var(--mint); color: var(--forest); }
.nav-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--forest); color: var(--lime); font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.nav-mobile { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 5px; border-radius: 21px; border: 1px solid var(--line-2); background: #fff; }
.user-btn:hover { background: var(--soft); }
.user-btn .icon { width: 16px; height: 16px; color: var(--muted); }
.user-name { font-size: 14.5px; font-weight: 500; }

.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font: 600 14px/1 var(--display); flex: none; }
.avatar-lg { width: 44px; height: 44px; font-size: 18px; }
.avatar-yen { background: var(--mint-2); color: var(--forest); }
.avatar-mariet { background: var(--violet-bg); color: var(--violet-ink); }
.avatar-bank { background: var(--sky-bg); color: var(--sky-ink); }
.avatar-ceo { background: var(--amber-bg); color: var(--amber-ink); }

.pop-wrap { position: relative; }
.pop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop-notifs { width: min(400px, calc(100vw - 32px)); }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pop-list { max-height: min(460px, 70vh); overflow-y: auto; padding: 6px; }
.pop-empty { padding: 22px 16px; color: var(--muted); font-size: 14px; }
.notif { display: flex; gap: 12px; width: 100%; padding: 11px 10px; border: 0; border-radius: 12px; background: none; text-align: left; position: relative; }
.notif:hover { background: var(--soft); }
.notif.unread::after { content: ""; position: absolute; top: 18px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--green-dot); }
.notif-text { display: grid; gap: 2px; padding-right: 14px; font-size: 14px; line-height: 1.4; }
.notif-text time { color: var(--faint); font-size: 12.5px; }
.notif-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; }
.notif-icon .icon { width: 17px; height: 17px; }
.tone-sky { background: var(--sky-bg); color: var(--sky-ink); }
.tone-green { background: var(--green-bg); color: var(--green-ink); }
.tone-red { background: var(--red-bg); color: var(--red-ink); }
.tone-violet { background: var(--violet-bg); color: var(--violet-ink); }
.tone-grey { background: var(--grey-bg); color: var(--grey-ink); }
.pop-user { width: 260px; padding: 8px; }
.pop-user-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pop-user-head div { display: grid; }
.pop-user-head span { color: var(--muted); font-size: 13px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: none; font-size: 14.5px; text-align: left; }
.menu-item:hover { background: var(--soft); }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
.foot-row span:first-child { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-2); }
.foot .logo { width: 22px; height: 22px; }

/* ---------- page head */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.display { font: 500 clamp(32px, 4.4vw, 50px)/1.08 var(--display); letter-spacing: -0.035em; }
.lead { margin-top: 12px; max-width: 640px; font-size: 17.5px; line-height: 1.5; color: var(--ink-2); }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.back:hover { color: var(--ink); }
.back .icon { width: 16px; height: 16px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page > .chips-row { margin: -16px 0 26px; }
.section-title { font: 500 24px/1.2 var(--display); letter-spacing: -0.02em; margin: 6px 0 16px; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 40px 0 16px; }
.filter-row .section-title { margin: 0; }

/* ---------- tiles */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { padding: 22px 22px 20px; border-radius: var(--r-lg); min-height: 148px; display: flex; flex-direction: column; }
.tile-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tile-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.tile-value { margin-top: auto; padding-top: 18px; font-size: clamp(28px, 2.6vw, 36px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.tile-sub { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); opacity: .85; }
.tile-link { position: relative; color: inherit; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.tile-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(20, 40, 15, .45); }
.tile-link:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.tile-go { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .7); color: var(--ink-2); opacity: .55; transition: opacity .15s, transform .15s; }
.tile-go .icon { width: 16px; height: 16px; }
.tile-link:hover .tile-go, .tile-link:focus-visible .tile-go { opacity: 1; transform: translateX(2px); }
.tile-violet { background: var(--violet-bg); }
.tile-violet .tile-dot { color: var(--violet); }
.tile-pink { background: var(--pink-bg); }
.tile-pink .tile-dot { color: var(--pink); }
.tile-amber { background: var(--amber-bg); }
.tile-amber .tile-dot { color: var(--amber); }
.tile-mint { background: var(--mint); }
.tile-mint .tile-dot { color: var(--green-dot); }
.tile-sky { background: var(--sky-bg); }
.tile-sky .tile-dot { color: var(--sky); }

/* ---------- cards */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.card-head-tabs { align-items: flex-end; padding-bottom: 0; }
.card-head-tabs .toolbar { padding-bottom: 14px; }
.card-title { font: 500 22px/1.25 var(--display); letter-spacing: -0.02em; }
.card-title.small { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 14px; }
.card-title.small .icon { color: var(--forest); }
.card-sub { margin-top: 3px; color: var(--muted); font-size: 13.5px; }

/* ---------- toolbar, search, segmented controls, tabs */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-page { margin-bottom: 20px; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search input { width: 240px; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 14px; }
.search input:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus); }
.select select {
  height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  font-size: 14px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364635e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.select select:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--soft-2); }
.seg-wrap { flex-wrap: wrap; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: #fff; color: var(--forest); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 600; }
.seg-sm .seg-btn { height: 30px; padding: 0 9px; }
.seg-sm .icon { width: 16px; height: 16px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: -1px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--forest); border-bottom-color: var(--forest); font-weight: 600; }
.tab-count { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--soft-2); color: var(--ink-2); font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; }
.tab.on .tab-count { background: var(--mint); color: var(--forest); }

/* ---------- chips and tags */

.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip .icon { width: 14px; height: 14px; stroke-width: 2.3; }
.chip-pink { background: var(--pink-bg); color: var(--pink-ink); }
.chip-pink .icon { color: var(--pink); }
.chip-amber { background: var(--amber-bg); color: var(--amber-ink); }
.chip-amber .icon { color: var(--amber); }
.chip-sky { background: var(--sky-bg); color: var(--sky-ink); }
.chip-sky .icon { color: var(--sky); }
.chip-red { background: var(--red-bg); color: var(--red-ink); }
.chip-red .icon { color: var(--red); }
.chip-orange { background: var(--orange-bg); color: var(--orange-ink); }
.chip-orange .icon { color: #d76a3c; }
.chip-grey { background: var(--grey-bg); color: var(--grey-ink); }
.chip-grey .icon { color: var(--grey); }
.chip-violet { background: var(--violet-bg); color: var(--violet-ink); }
.chip-violet .icon { color: var(--violet); }
.chip-green { background: var(--green-bg); color: var(--green-ink); }
.chip-green .icon { color: var(--green-dot); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--soft-2); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pay-info { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.receipt-mark .icon { width: 15px; height: 15px; color: var(--sky); }

/* ---------- tables */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { position: sticky; top: 0; padding: 0 16px; height: 46px; border-bottom: 1px solid var(--line); background: #fcfcfa; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num .sort-btn { margin-left: auto; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-btn .icon { width: 14px; height: 14px; opacity: .45; }
.sort-btn:hover, .sort-btn.on { color: var(--ink); }
.sort-btn.on .icon { opacity: 1; color: var(--forest); }
.row-click { cursor: pointer; transition: background-color .12s; }
.row-click:hover { background: #fafaf6; }
.row-click.is-open { background: var(--soft); }
.cell-title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; }
a.cell-title:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.cell-main { display: block; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.cell-stack { display: grid; justify-items: start; gap: 4px; }
.clamp { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-toggle { width: 56px; text-align: right; }
.table tfoot td { padding: 14px 16px; border-top: 1px solid var(--line); background: #fcfcfa; color: var(--muted); font-size: 13.5px; }
.table tfoot td.num { color: var(--ink); }
.sub-row > td { padding: 0 24px 18px !important; background: var(--soft); }
.mini-list { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.mini-row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) 1.1fr 0.9fr 1.5fr 1.3fr; gap: 12px; align-items: center;
  width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 14px;
}
.mini-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .num { text-align: right; font-variant-numeric: tabular-nums; }
button.mini-row:hover { background: #fafaf6; }
.mini-head { border-top: 0; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.sub-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; }

/* ---------- empty state */

.empty { display: grid; justify-items: center; gap: 8px; padding: 56px 24px; text-align: center; }
.empty-art { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 20px; background: var(--mint); color: var(--forest); }
.empty-art .icon { width: 28px; height: 28px; }
.empty h3 { font: 500 21px/1.3 var(--display); letter-spacing: -0.01em; }
.empty p { max-width: 420px; color: var(--muted); }
.empty .btn { margin-top: 10px; }

/* ---------- suppliers */

.supplier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.supplier-card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #fff; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.supplier-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.supplier-card-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.supplier-card h3 { font: 500 19px/1.3 var(--display); letter-spacing: -0.01em; }
.supplier-card-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.supplier-card-nums div { display: grid; gap: 2px; }
.supplier-card-nums span { color: var(--muted); font-size: 12px; }
.supplier-card-nums strong { font-size: 15px; font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.side { display: grid; gap: 16px; }
.dl { display: grid; gap: 12px; margin: 0; }
.dl div { display: grid; gap: 1px; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.dl dd a { color: var(--forest); }
.dl-inline { grid-template-columns: repeat(4, minmax(0, auto)); gap: 8px 28px; margin: 12px 0 10px; justify-content: start; }

/* ---------- bank: to pay */

.pay-group { margin-top: 34px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.group-title { display: flex; align-items: center; gap: 10px; font: 500 22px/1.2 var(--display); letter-spacing: -0.02em; }
.count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--soft-2); font: 600 13px/26px var(--font); text-align: center; color: var(--ink-2); }
.group-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-list { display: grid; gap: 12px; margin-top: 14px; }
.pay-card { display: flex; justify-content: space-between; gap: 24px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.pay-main { display: grid; gap: 6px; align-content: start; min-width: 0; }
.pay-company { font: 500 19px/1.3 var(--display); letter-spacing: -0.01em; margin-top: 4px; }
.pay-company a { text-decoration: none; }
.pay-company a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.pay-to { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; color: var(--ink-2); font-size: 13.5px; }
.pay-to .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--forest); }
.pay-side { display: grid; justify-items: end; align-content: space-between; gap: 6px; text-align: right; flex: none; }
.pay-amount { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.pay-due { color: var(--muted); font-size: 13.5px; }
.pay-actions { display: flex; gap: 8px; margin-top: 8px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--soft); color: var(--ink-2); font-size: 13.5px; }
.note .icon { width: 16px; height: 16px; margin-top: 2px; }
.note-red { background: var(--red-bg); color: var(--red-ink); }
.note-amber { background: var(--amber-bg); color: var(--amber-ink); }
.confirm-body .note { margin-top: 10px; }
.compact-list { display: grid; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.compact-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 14px 20px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.compact-row:first-child { border-top: 0; }
.compact-row:hover { background: #fafaf6; }
.compact-main { display: grid; gap: 2px; min-width: 0; }
.compact-main .muted { font-size: 13px; }
.compact-side { display: flex; align-items: center; gap: 12px; flex: none; font-variant-numeric: tabular-nums; }

/* ---------- mariet: confirm */

.confirm-list { display: grid; gap: 14px; }
.confirm-card { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 22px; align-items: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.confirm-body { min-width: 0; }
.confirm-actions { display: grid; gap: 8px; min-width: 170px; }
.receipt-thumb {
  position: relative; display: grid; place-items: center; align-content: center; gap: 6px;
  width: 150px; height: 170px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--soft); color: var(--ink-2); text-align: center; text-decoration: none; overflow: hidden;
}
.receipt-thumb .icon { width: 30px; height: 30px; color: var(--forest); }
.receipt-thumb span { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.receipt-thumb small { color: var(--muted); font-size: 11.5px; }
.receipt-thumb.none .icon { color: var(--faint); }
.receipt-thumb.img { display: block; padding: 0; }
.receipt-thumb.img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.receipt-thumb.big { width: 100%; height: 340px; }
.receipt-thumb.img.big img { object-fit: contain; background: #fff; }
.receipt-open { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; background: rgba(255, 255, 255, .92); }
.receipt-open .icon { width: 13px; height: 13px; }
a.receipt-thumb:hover { border-color: var(--forest); }
button.receipt-thumb { font: inherit; cursor: pointer; }
button.receipt-thumb.pdf { padding-bottom: 38px; }
button.receipt-thumb:hover { border-color: var(--forest); }
button.receipt-thumb:hover .receipt-open { background: var(--forest); color: var(--lime); }
.receipt-thumb.sent { border-style: dashed; opacity: .8; }
.receipt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.receipt-tiles .receipt-thumb { width: 100%; height: 132px; }
.drawer-sub { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* receipt viewer: inside the confirm window and as its own layer */
.rv { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.rv-stage { position: relative; display: grid; place-items: center; height: 420px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--soft-2); }
.rv-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.rv-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.rv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rv-meta { display: grid; gap: 2px; min-width: 0; }
.rv-meta strong { font-size: 14.5px; overflow-wrap: anywhere; }
.rv-meta span { color: var(--muted); font-size: 12.5px; }
.rv-actions { display: flex; align-items: center; gap: 8px; }
.rv-count { min-width: 52px; color: var(--ink-2); font-size: 13px; text-align: center; white-space: nowrap; }
.rv-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.rv-thumb { position: relative; display: grid; place-items: center; flex: none; width: 58px; height: 72px; padding: 0; overflow: hidden; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--forest); cursor: pointer; }
.rv-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rv-thumb .icon { width: 22px; height: 22px; }
.rv-thumb.on { border-color: var(--forest); box-shadow: var(--focus); }
.overlay-viewer { z-index: 70; background: rgba(12, 18, 10, 0.62); }
.viewer { position: fixed; z-index: 71; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 14px; width: min(1040px, calc(100vw - 32px)); height: min(92vh, 960px); padding: 18px 20px 20px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); animation: rise .18s ease-out; }
.viewer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.viewer-title { margin: 0; font: 600 18px/1.3 var(--display); }
.viewer .rv { flex: 1; }
.viewer .rv-stage { flex: 1; height: auto; min-height: 0; }

/* choosing several files */
.files { display: grid; gap: 10px; }
.file-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.file-list:empty { display: none; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.file-face { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 48px; overflow: hidden; border-radius: 8px; background: var(--soft-2); color: var(--forest); }
.file-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file-face .icon { width: 20px; height: 20px; }
.file-name { display: grid; flex: 1; min-width: 0; }
.file-name strong { overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.file-name small { color: var(--muted); font-size: 12px; }

/* ---------- insights */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.chart-card { min-width: 0; }
.grid-top { align-items: start; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.chart-head .card-title.small { margin-bottom: 0; }
.hero-stat { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr); gap: 24px; align-items: end; margin-bottom: 16px; background: linear-gradient(135deg, var(--mint) 0%, #f4fdf1 60%, #fff 100%); }
.hero-figure { margin: 10px 0 6px; font-size: clamp(36px, 5vw, 56px); font-weight: 600; letter-spacing: -0.025em; line-height: 1; overflow-wrap: anywhere; }
.hero-stat .tile-dot { color: var(--green-dot); }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-stats div { display: grid; gap: 2px; padding: 16px; border-radius: var(--r-md); background: rgba(255, 255, 255, .8); border: 1px solid var(--line); }
.hero-stats span { color: var(--muted); font-size: 13px; }
.hero-stats strong { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.hero-stats small { color: var(--muted); font-size: 12px; }
.chart-card + .grid-2 { margin-top: 16px; }

.viz { min-height: 60px; }
.viz-svg { overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-axis { fill: var(--viz-axis); font: 500 11.5px var(--font); font-variant-numeric: tabular-nums; }
.viz-end { fill: var(--ink-2); font: 600 12.5px var(--font); }
.viz-cross { stroke: var(--viz-base); stroke-width: 1; }
.viz-hit { cursor: crosshair; outline: none; }
.viz-hit:focus-visible { stroke: var(--green); stroke-width: 2; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.viz-legend li { display: inline-flex; align-items: center; gap: 8px; }
.viz-legend-top { margin: -4px 0 12px; }
.owe-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.owe-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 12px; margin: 0 -12px; border-radius: 12px; color: inherit; text-decoration: none; transition: background .12s; }
.owe-row:hover { background: var(--soft); }
.owe-row:focus-visible { box-shadow: var(--focus); }
.owe-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.owe-name strong { overflow: hidden; font-size: 14.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.owe-name .chip { flex: none; }
.owe-amount { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.owe-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 10px; }
.owe-seg { min-width: 4px; height: 100%; border-radius: 4px; }
.owe-sub { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; }
.owe-sub.warn { color: var(--red-ink); }
.owe-sub .icon { width: 14px; height: 14px; }
.owe-more { margin-top: 10px; }
.viz-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.viz-line-key { width: 16px; height: 3px; border-radius: 2px; flex: none; }
.viz-legend-name { color: var(--ink-2); }
.viz-legend-value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.viz-tip {
  position: fixed; z-index: 100; min-width: 160px; max-width: 280px; padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); pointer-events: none;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; font-size: 13px;
}
.viz-tip.show { opacity: 1; transform: none; }
.viz-tip-title { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.viz-tip-row strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.viz-tip-label { color: var(--muted); }
.viz-tip-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.viz-tip-key.box { width: 10px; height: 10px; border-radius: 3px; }

.viz-bars { display: grid; gap: 4px; }
.viz-bar-row { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 6px; border-radius: 8px; outline: none; }
.viz-bar-row:hover, .viz-bar-row:focus-visible { background: var(--soft); }
.viz-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--ink-2); }
.viz-bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.viz-bar-fill { height: 14px; border-radius: 0 4px 4px 0; flex: none; }
.viz-bar-row:hover .viz-bar-fill { filter: brightness(1.08); }
.viz-bar-value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.viz-cols { display: grid; gap: 8px; }
.viz-cols-plot, .viz-cols-names { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.viz-cols-plot { align-items: end; border-bottom: 1px solid var(--viz-base); }
.viz-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; border-radius: 8px 8px 0 0; outline: none; }
.viz-col:hover, .viz-col:focus-visible { background: var(--soft); }
.viz-col-value { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-col-bar { width: 24px; border-radius: 4px 4px 0 0; }
.viz-col:hover .viz-col-bar { filter: brightness(1.08); }
.viz-col-name { display: flex; justify-content: center; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.25; }
.viz-col-icon .icon { width: 13px; height: 13px; color: var(--red); }

.viz-seg { display: flex; gap: 2px; height: 28px; }
.viz-seg-part { display: flex; align-items: center; min-width: 3px; padding: 0; border-radius: 4px; overflow: hidden; outline: none; transition: filter .12s; }
.viz-seg-part:hover, .viz-seg-part:focus-visible { filter: brightness(1.1); }
.viz-seg-label { padding: 0 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.viz-seg-empty { display: grid; place-items: center; width: 100%; border-radius: 4px; background: var(--soft-2); color: var(--muted); font-size: 12.5px; }

.viz-table-wrap { overflow-x: auto; }
.viz-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.viz-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
.viz-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.viz-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- drawer */

.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(12, 18, 10, 0.32); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; display: flex; flex-direction: column;
  width: min(500px, 100vw); background: #fff; box-shadow: var(--shadow-lg); animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 16px 26px; border-bottom: 1px solid var(--line); }
.drawer-top .eyebrow { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 26px 32px; }
.drawer-title { font: 500 28px/1.15 var(--display); letter-spacing: -0.025em; margin-bottom: 12px; }
.drawer-title a { text-decoration: none; }
.drawer-title a:hover { color: var(--forest); }
.drawer-amount { margin: 20px 0 4px; font-size: 38px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.drawer-body > .note { margin-top: 16px; }
.drawer-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.drawer-section h3 { margin-bottom: 14px; font: 500 17px/1.3 var(--display); }
.drawer-receipt { margin-top: 16px; }
.drawer-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: #fff; }
.drawer-foot .btn-danger-text { margin-right: auto; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.tl { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child { padding-bottom: 0; }
.tl:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); flex: none; background: var(--grey); position: relative; z-index: 1; }
.tl.tone-sky .tl-dot { background: var(--sky); }
.tl.tone-green .tl-dot { background: var(--green-dot); }
.tl.tone-red .tl-dot { background: var(--red); }
.tl.tone-sky, .tl.tone-green, .tl.tone-red, .tl.tone-grey { background: none; color: inherit; }
.tl div { display: grid; gap: 2px; font-size: 14px; }
.tl time { color: var(--faint); font-size: 12.5px; }
.tl .muted { font-size: 13px; }

/* ---------- modal and forms */

.overlay-modal { z-index: 60; }
.modal {
  position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; width: min(560px, calc(100vw - 32px)); max-height: min(92vh, 900px);
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out;
}
.modal-lg { width: min(720px, calc(100vw - 32px)); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); } }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 8px; }
.modal-head .muted { margin-top: 4px; }
.modal-title { font: 500 26px/1.2 var(--display); letter-spacing: -0.025em; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 26px 8px; display: grid; gap: 16px; align-content: start; grid-auto-rows: max-content; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 16px 26px 22px; border-top: 1px solid var(--line); }
.modal-foot .form-error { margin-right: auto; flex: 1 1 100%; }
.form { display: grid; gap: 16px; }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--red-bg); color: var(--red-ink); font-size: 14px; }
.form-error[hidden] { display: none; }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field > label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input:not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364635e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus); }
.hint { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.hint .icon { width: 15px; height: 15px; }
.grid-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fs { display: grid; gap: 16px; margin: 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.fs:first-child { border-top: 0; padding-top: 4px; }
.fs legend { padding: 0; margin-bottom: 4px; font: 500 18px/1.3 var(--display); letter-spacing: -0.01em; }
.fs-tight { gap: 14px; }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip { position: relative; }
.radio-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chip span {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.radio-chip span:hover { border-color: var(--faint); }
.radio-chip input:checked + span { background: var(--mint); border-color: var(--forest); color: var(--forest); font-weight: 600; }
.radio-chip input:focus-visible + span { box-shadow: var(--focus); }
.radio-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-pink { background: var(--pink); }
.dot-amber { background: var(--amber); }
.dot-sky { background: var(--sky); }
.terms { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.terms-custom { display: none; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.terms-custom.show { display: inline-flex; }
.field .terms-custom input:not([type=radio]):not([type=file]) { width: 96px; min-height: 40px; height: 40px; }
.money { position: relative; }
.money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.field .money input:not([type=radio]):not([type=file]) { padding-left: 34px; font-variant-numeric: tabular-nums; }
.due-preview { display: flex; align-items: center; gap: 8px; margin-top: -4px; color: var(--ink-2); font-size: 14px; }
.due-preview:empty { display: none; }
.due-preview .icon { width: 16px; height: 16px; color: var(--forest); }
.paid-fields { display: grid; gap: 16px; padding: 16px; border-radius: var(--r-md); background: var(--soft); }
.paid-fields[hidden] { display: none; }
.drop {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px;
  border: 1.5px dashed var(--line-2); border-radius: var(--r-md); background: var(--soft); text-align: center; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.drop:hover, .drop.drag { border-color: var(--forest); background: var(--mint); }
.drop.has-file { border-style: solid; border-color: var(--forest); background: var(--mint); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop input:focus-visible ~ .drop-icon { box-shadow: var(--focus); }
.drop-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 4px; border-radius: 12px; background: #fff; color: var(--forest); }
.drop-text { font-size: 14.5px; overflow-wrap: anywhere; }
.drop-text strong { color: var(--forest); }
.drop-hint { color: var(--muted); font-size: 12.5px; }
.summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-md); background: var(--soft); }
.summary > div { display: grid; gap: 4px; min-width: 0; }
.summary-name { font: 500 18px/1.3 var(--display); }
.summary-amount { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.pay-to-box { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
.pay-to-box .label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pay-to-box .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- toasts */

#toast-root { position: fixed; left: 24px; bottom: 24px; z-index: 80; display: grid; gap: 10px; max-width: min(440px, calc(100vw - 48px)); }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 16px; border-radius: 14px;
  background: #142b0e; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise-t .2s ease-out;
}
.toast > .icon { color: var(--lime); }
.toast > span { flex: 1; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s; }
@keyframes rise-t { from { opacity: 0; transform: translateY(8px); } }
.toast-btn { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--lime); color: var(--forest); font-size: 13px; font-weight: 700; }
.toast-x { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: rgba(255, 255, 255, .7); }
.toast-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast-x .icon { width: 16px; height: 16px; }

/* ---------- sign in */

.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; }
.login-panel { display: flex; flex-direction: column; padding: 32px 48px; }
.login-body { width: 100%; max-width: 440px; margin: auto; padding: 48px 0; display: grid; gap: 4px; }
.login-body .lead { margin-bottom: 28px; }
.who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.who-chip { height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 500; }
.who-chip:hover { background: var(--mint); border-color: var(--forest); color: var(--forest); }
.login .btn-block { margin-top: 8px; }
.login-body > .muted { margin-top: 18px; }
.login-art { position: relative; margin: 16px; border-radius: 32px; background: var(--green); overflow: hidden; display: grid; place-items: center; min-height: 560px; }
.login-art::before { content: ""; position: absolute; width: 520px; height: 520px; right: -120px; top: -160px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.login-art::after { content: ""; position: absolute; width: 360px; height: 360px; left: -120px; bottom: -140px; border-radius: 50%; background: rgba(34, 75, 23, .12); }
.art-card { position: relative; z-index: 1; width: min(420px, 78%); padding: 22px; border-radius: 24px; background: #fff; box-shadow: 0 30px 60px rgba(20, 50, 10, .25); }
.art-head { display: flex; align-items: center; gap: 10px; font: 500 17px var(--display); }
.art-head .logo { width: 26px; height: 26px; }
.art-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.art-tiles span { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: var(--violet-bg); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.art-tiles span:last-child { background: var(--mint); }
.art-tiles em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.art-rows { display: grid; gap: 2px; }
.art-rows div { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); font-size: 13.5px; }
.art-rows b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.art-dot.pink { background: var(--pink); }
.art-dot.amber { background: var(--amber); }
.art-dot.sky { background: var(--sky); }
.float { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: 0 12px 28px rgba(20, 50, 10, .18); animation: bob 6s ease-in-out infinite; }
.float .sq { width: 14px; height: 14px; border-radius: 4px; }
.float .sq.sky { background: var(--sky); }
.float .sq.green { background: var(--green-dot); }
.float .sq.pink { background: var(--pink); }
.float .sq.amber { background: var(--amber); }
.f1 { top: 13%; left: 8%; background: var(--sky-bg); }
.f2 { top: 22%; right: 7%; background: #fff; animation-delay: -1.5s; }
.f3 { bottom: 18%; left: 6%; background: var(--pink-bg); animation-delay: -3s; }
.f4 { bottom: 11%; right: 10%; background: var(--amber-bg); animation-delay: -4.5s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- budget (Yen sets it, Mariet works within it) */

.budget { display: grid; gap: 14px; padding: 22px 24px; margin-bottom: 22px; }
.budget-empty { display: flex; align-items: center; gap: 18px; }
.budget-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--mint); color: var(--forest); }
.budget-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.budget-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.budget-label { display: flex; align-items: center; gap: 8px; font: 500 15px/1.3 var(--font); color: var(--ink-2); }
.budget-label .icon { width: 18px; height: 18px; color: var(--forest); }
.budget-note { color: var(--muted); font-weight: 400; }
.budget-big { margin-top: 6px; font-size: 15px; }
.budget-big strong { margin-right: 4px; font: 600 30px/1.1 var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.budget-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.meter { position: relative; display: flex; height: 12px; border-radius: 999px; background: var(--soft-2); overflow: hidden; }
.meter-limit { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 0 1px var(--card); }
.meter-key .key-over { width: 3px; height: 12px; border-radius: 1px; background: var(--ink); }
.meter-part { height: 100%; min-width: 4px; }
.meter-part + .meter-part { border-left: 2px solid var(--card); }
.meter-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-2); }
.meter-key li { display: inline-flex; align-items: center; gap: 7px; }
.meter-key i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.meter-key .key-left { background: var(--soft-2); box-shadow: inset 0 0 0 1px var(--viz-base); }
.meter-key strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pay-group-first { margin-top: 0; }
.pay-group-first .toolbar-page { margin: 10px 0 0; }
.note-sky { background: var(--sky-bg); color: var(--sky-ink); }
button.announce-btn { border: 0; cursor: pointer; font-family: inherit; }

/* ---------- Mariet: choose what Bank pays */

.pick-body { padding-top: 4px; padding-bottom: 10px; }
.pick-group { margin-top: 22px; }
.pick-group:first-child { margin-top: 10px; }
.pick-group-title { display: flex; align-items: center; gap: 8px; font: 500 17px/1.3 var(--display); }
.pick-list { display: grid; gap: 8px; margin-top: 10px; }
.pick-row { display: flex; align-items: center; gap: 6px; padding-right: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; transition: border-color .12s, background .12s; }
.pick-row:hover { border-color: #d6d5cc; }
.pick-row.on { border-color: var(--forest); background: #f6fdf3; }
.pick-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 12px 8px 12px 16px; cursor: pointer; }
.pick-main input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--forest); cursor: pointer; }
.pick-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.pick-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pick-side { display: grid; justify-items: end; gap: 2px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.pick-bar.show { position: sticky; bottom: 0; z-index: 2; }
.pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); background: rgba(255, 255, 255, .97); }
.pick-bar.show { background: #f3fbef; }
.pick-bar-text { display: grid; gap: 2px; font-size: 14px; }
.pick-bar-actions { display: flex; align-items: center; gap: 8px; }
.compact-row-static:hover { background: none; }
.link-btn-plain { padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.link-btn-plain:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.assign-list { display: grid; max-height: 240px; margin: 0 0 14px; padding: 0; overflow: auto; list-style: none; border: 1px solid var(--line); border-radius: var(--r-md); }
.assign-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.assign-list li:first-child { border-top: 0; }
.assign-list li > span { display: grid; gap: 2px; min-width: 0; }

/* ---------- budget periods and stacking, Bank notes, Yen and Mariet confirming, IT */

.tone-amber { background: var(--amber-bg); color: var(--amber-ink); }
.tl.tone-amber .tl-dot { background: var(--amber); }
.tl.tone-amber, .tl.tone-violet { background: none; color: inherit; }
.tl.tone-violet .tl-dot { background: var(--violet); }
.avatar-it { background: var(--grey-bg); color: var(--grey-ink); }
.budget-label { flex-wrap: wrap; }
.budget-period { color: var(--ink); font-weight: 600; }
.budget-parts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.budget-parts li { padding: 6px 12px; border-radius: 999px; background: var(--soft); font-variant-numeric: tabular-nums; }
.budget-actual { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-2); }
.budget-actual .icon { width: 16px; height: 16px; color: var(--forest); flex: none; }
.budget-actual strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-picked { background: repeating-linear-gradient(135deg, #2a78d6 0 3px, #cfe2f8 3px 7px); }
.meter-key .key-picked { background: repeating-linear-gradient(135deg, #2a78d6 0 2px, #cfe2f8 2px 4px); box-shadow: inset 0 0 0 1px #2a78d6; }
.pick-row.no-fit { border-style: dashed; }
.pick-row.no-fit .pick-side strong { color: var(--muted); }
.fit-note { display: inline-flex; align-items: center; gap: 5px; color: var(--red-ink); font-weight: 500; }
.fit-note .icon { width: 14px; height: 14px; }
.np-card { margin-top: 22px; }
.np-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; padding-top: 6px; }
.np-group .note { margin-top: 8px; }
.np-more { margin-top: 10px; font-size: 14px; }
.np-more .icon { width: 15px; height: 15px; }
.table .group-row th { position: static; height: auto; padding-top: 18px; padding-bottom: 8px; background: #fff; color: var(--ink-2); font: 600 13px/1.3 var(--font); letter-spacing: 0; text-transform: none; border-bottom: 1px solid var(--line); }
.table .group-row th > span { margin-right: 10px; }
.table .group-row .group-row-meta { color: var(--muted); font-weight: 500; }
.confirm-wrap .card-pad { padding-top: 4px; padding-bottom: 18px; }
.confirm-wrap .confirm-list { margin-top: 10px; }
.confirm-card { grid-template-columns: auto 150px minmax(0, 1fr) auto; position: relative; transition: border-color .12s, background .12s; }
.confirm-card.on { border-color: var(--forest); background: #f6fdf3; }
.confirm-check { display: grid; place-items: center; padding: 4px 0; cursor: pointer; }
.confirm-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); cursor: pointer; }
.bank-last { display: flex; align-items: center; gap: 6px; margin: -6px 0 16px; }
.bank-last .icon { width: 15px; height: 15px; }
.it-bar { background: var(--ink); color: #fff; font-size: 13.5px; }
.it-bar-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; min-height: 42px; padding-top: 6px; padding-bottom: 6px; }
.it-bar-label { display: inline-flex; align-items: center; gap: 6px; }
.it-bar-row .icon { width: 15px; height: 15px; }
.it-bar-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.it-switch { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: transparent; color: #fff; font: 600 13px/1 var(--font); cursor: pointer; }
.it-switch:hover { background: rgba(255, 255, 255, .14); }
.it-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.it-person { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; text-align: left; cursor: pointer; }
.it-person:hover { border-color: var(--forest); background: #f6fdf3; }
.it-person-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.it-person > .icon { color: var(--forest); }
.it-danger { margin-top: 22px; }
.it-counts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 16px; padding: 0; list-style: none; color: var(--ink-2); }
.it-counts strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- smaller screens */

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stat { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .top-row { height: 64px; gap: 12px; }
  .top .nav { display: none; }
  .top-actions { margin-left: auto; }
  .nav-mobile { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
  .nav-mobile::-webkit-scrollbar { display: none; }
  .nav-mobile .nav-link { height: 36px; flex: none; font-size: 14.5px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .confirm-card { grid-template-columns: 120px minmax(0, 1fr); }
  .confirm-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr auto; min-width: 0; }
  .receipt-thumb { width: 120px; height: 140px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .page { padding-top: 26px; }
  .hide-sm { display: none !important; }
  .user-name { display: none; }
  .user-btn { padding-right: 8px; }
  .page-head { margin-bottom: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .lead { font-size: 16px; }
  .tile { min-height: 120px; padding: 16px; }
  .tile-value { font-size: 26px; }
  .tiles { gap: 10px; }
  .tiles-3 { grid-template-columns: minmax(0, 1fr); }
  .tiles-3 .tile { min-height: 0; }
  .card-head { padding: 16px; }
  .card-head-tabs { padding-bottom: 0; }
  .toolbar { width: 100%; }
  .search, .search input { width: 100%; }
  .select { flex: 1; }
  .select select { width: 100%; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .announce-row { justify-content: space-between; text-align: left; font-size: 13.5px; }

  /* tables become stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tfoot { display: block; }
  .table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 16px; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 0 !important; border: 0; min-width: 0; }
  .table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
  .table td:first-child { grid-column: 1 / -1; }
  .table td:first-child::before { display: none; }
  .table .num { text-align: left; }
  .table .col-toggle { position: absolute; right: 12px; top: 12px; width: auto; }
  .table-suppliers tr { position: relative; }
  .table-suppliers td:first-child { padding-right: 40px !important; }
  .table tfoot tr { display: flex; justify-content: space-between; }
  .table tfoot td[colspan="3"]:last-child { display: none; }
  .clamp { max-width: 100%; }
  .sub-row { display: block !important; padding: 0 !important; }
  .sub-row > td { padding: 0 12px 14px !important; }
  .mini-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .mini-row > span:nth-child(3) { color: var(--muted); font-size: 13px; }
  .mini-head { display: none; }

  .budget { padding: 16px; }
  .budget-empty { flex-direction: column; align-items: flex-start; }
  .budget-actions { width: 100%; }
  .budget-actions .btn { flex: 1; }
  .budget-big strong { font-size: 26px; }
  .pick-row { flex-direction: column; align-items: stretch; gap: 0; padding: 0 0 8px; }
  .pick-row > .btn { align-self: flex-end; margin-right: 8px; height: 32px; }
  .pick-main { padding: 12px 12px 4px; gap: 12px; }
  .pick-bar { padding: 12px 16px; }
  .pick-bar-actions { width: 100%; }
  .pick-bar-actions .btn-primary { flex: 1; }
  .compact-row-static .compact-side { width: 100%; justify-content: space-between; }
  .pay-card { flex-direction: column; gap: 14px; padding: 18px; }
  .pay-side { justify-items: start; text-align: left; }
  .pay-actions { width: 100%; }
  .pay-actions .btn { flex: 1; }
  .compact-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .confirm-card { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .receipt-thumb { width: 100%; height: 160px; }
  .receipt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owe-name { flex-wrap: wrap; }
  .owe-name strong { white-space: normal; }
  .rv-stage { height: 300px; }
  .viewer { left: 0; top: 0; transform: none; width: 100vw; height: 100dvh; padding: 14px 16px 16px; border-radius: 0; animation: fade .16s ease-out; }
  .rv-bar { align-items: flex-start; }
  .rv-actions { width: 100%; }
  .rv-actions .btn { margin-left: auto; }
  .confirm-actions { grid-template-columns: 1fr 1fr; }
  .confirm-actions .btn-ghost { grid-column: 1 / -1; }
  .dl-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: minmax(0, 1fr); }
  .grid-fields { grid-template-columns: minmax(0, 1fr); }
  .pay-to-box .dl { grid-template-columns: minmax(0, 1fr); }
  .modal { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 94vh; border-radius: 24px 24px 0 0; }
  @keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot .btn { flex: 1; }
  .drawer-body { padding: 20px 18px 28px; }
  .drawer-top, .drawer-foot { padding-left: 18px; padding-right: 18px; }
  .drawer-foot .btn { flex: 1; }
  .login-panel { padding: 24px 20px; }
  .viz-bar-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .viz-col-name { font-size: 11px; }
  .viz-col-bar { width: 18px; }
  #toast-root { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .foot-row { justify-content: center; text-align: center; }
}

/* two columns of details inside the drawer */
.drawer-section .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }

@media (max-width: 760px) {
  .np-grid { grid-template-columns: minmax(0, 1fr); }
  .it-people { grid-template-columns: minmax(0, 1fr); }
  .confirm-card { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  .confirm-check { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .92); }
  .confirm-bar .pick-bar-actions { flex-wrap: wrap; }
  .confirm-bar .pick-bar-actions .btn-secondary { flex: 1; }
  .table tr.group-row { display: block; padding: 0; }
  .table .group-row th { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 14px 16px 8px; background: var(--soft); }
  .it-bar-row { justify-content: flex-start; }
}

/* ---------- ticking several at once */

.col-check { width: 48px; }
.table th.col-check, .table td.col-check { padding-right: 0; }
.check-cell { display: grid; place-items: center; width: 32px; height: 32px; margin: -6px 0; border-radius: 8px; cursor: pointer; }
.check-cell:hover { background: var(--soft); }
.check-cell input, .pay-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--forest); cursor: pointer; }
.row-click.is-picked, .row-click.is-picked:hover, .table tr.is-picked { background: #f3fbef; }
.table-check th.col-check + th, .table-check td.col-check + td { padding-left: 8px; }

.pay-card-check.on { border-color: var(--forest); background: #f6fdf3; }
.pay-pick { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; cursor: pointer; }
.pay-pick input { flex: none; margin-top: 8px; }
.group-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Bank's form for several payments: one amount per supplier */
.pay-amounts { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-md); }
.pay-amounts li { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.pay-amounts li:first-child { border-top: 0; }
.pay-amounts label { display: grid; gap: 2px; min-width: 0; font-weight: 400; }
.pay-amounts .money input { width: 100%; min-height: 42px; padding: 8px 12px 8px 34px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.pay-amounts .money input:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus); }
.pay-amounts + .summary { margin-top: 10px; }
.fs-tight .summary { display: flex; justify-content: space-between; align-items: baseline; }

/* budget: dates only when someone wants them */
.disclose { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.disclose > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary .icon { width: 16px; height: 16px; color: var(--forest); }
.disclose > summary .muted { font-weight: 400; }
.disclose-chev { margin-left: auto; transition: transform .15s; color: var(--muted) !important; }
.disclose[open] .disclose-chev { transform: rotate(180deg); }
.disclose-body { padding: 0 14px 14px; }
.stack-note { display: flex; align-items: center; gap: 6px; margin: -6px 0 0; color: var(--forest); font-size: 13.5px; font-weight: 500; }
.stack-note .icon { width: 15px; height: 15px; }

/* Bank's submission summary */
.sub-note { margin-bottom: 20px; }
.sub-note .icon { color: var(--sky); }

/* ---------- import with AI */

.imp-steps { display: flex; gap: 8px 22px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.imp-steps li { display: flex; align-items: center; gap: 8px; }
.imp-steps li > span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--soft-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.imp-steps li > span .icon { width: 14px; height: 14px; }
.imp-steps li.on { color: var(--ink); font-weight: 600; }
.imp-steps li.on > span { background: var(--forest); color: #fff; }
.imp-steps li.done > span { background: var(--mint); color: var(--forest); }
.imp-upload { display: grid; gap: 14px; }
.imp-drop { min-height: 150px; }
.imp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-import td { padding-top: 8px; padding-bottom: 8px; vertical-align: top; }
.table-import th { white-space: nowrap; }
.cell-input { width: 100%; min-width: 110px; height: 38px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.cell-input:hover { border-color: var(--line-2); background: #fff; }
.cell-input:focus { outline: none; border-color: var(--forest); background: #fff; box-shadow: var(--focus); }
.cell-input.num { min-width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.cell-days { min-width: 70px; max-width: 90px; }
.table-import .check-cell { margin: 2px 0 0; }
.table-import .col-x { width: 44px; padding-left: 0; }
.table-import td[data-label="Supplier"] .cell-input { min-width: 220px; }
.table-import td[data-label="Description"] .cell-input { min-width: 190px; }
.table-import td[data-label="Date of purchase"] .cell-input { min-width: 140px; }
.tag-new { display: inline-block; margin: 2px 0 0 10px; padding: 1px 8px; border-radius: 999px; background: var(--amber-bg); color: var(--amber-ink); font-size: 11.5px; font-weight: 600; }

@media (max-width: 760px) {
  .table-check tr { position: relative; }
  .table-check td.col-check { position: absolute; top: 12px; right: 12px; grid-column: auto; }
  .table-check td.col-check + td { grid-column: 1 / -1; padding-right: 44px !important; }
  .table-check td.col-check + td::before { display: none; }
  .table-import tr { grid-template-columns: 1fr 1fr; }
  .table-import td[data-label="Description"] { grid-column: 1 / -1; }
  .table-import .col-x { position: absolute; top: 12px; right: 52px; width: auto; }
  .table-import td.col-check + td { padding-right: 92px !important; }
  .cell-input, .table-import td[data-label] .cell-input { border-color: var(--line-2); background: #fff; min-width: 0; }
  .cell-input.num { min-width: 0; text-align: left; }
  .pay-amounts li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pay-pick input { margin-top: 4px; }
}

/* ---------- budget: deductions and allocations */

.meter-ded { background: repeating-linear-gradient(135deg, #a8a79c 0 4px, #c9c8bf 4px 8px); }
.meter-key .key-ded { background: repeating-linear-gradient(135deg, #a8a79c 0 2px, #c9c8bf 2px 4px); }
.budget-subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.budget-sub-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.budget-sub-title .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.alloc-list { display: grid; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.alloc-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); }
.alloc-list li:first-child { border-top: 0; }
.alloc-list li > span { display: grid; gap: 1px; min-width: 0; }
.alloc-list small { font-size: 12px; }
.alloc-list strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ded-list strong { color: var(--amber-ink); }

.alloc-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.alloc-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 36px; gap: 8px; align-items: center; }
.alloc-row input { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; font-size: 15px; }
.alloc-row .money input { padding-left: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.alloc-row input:focus { outline: none; border-color: var(--forest); box-shadow: var(--focus); }
.alloc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.alloc-foot .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.alloc-foot .link-btn .icon { width: 15px; height: 15px; }

/* ---------- Excel downloads */

.xl-links { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.xl-label { display: inline-flex; align-items: center; gap: 5px; margin-right: 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
.xl-label .icon { width: 15px; height: 15px; }

@media (max-width: 760px) {
  .alloc-row { grid-template-columns: minmax(0, 1fr) 120px 32px; }
  .xl-links { width: 100%; }
}
