/* =========================================================
   UWASA — LLMO SaaS mockup / Design system
   Style reference: monochrome fintech dashboard (openbank)
   - White canvas, black ink, warm grays, lavender/pink/mint tints
   - Thin dark rules instead of cards, generous whitespace
   - Round outline icon buttons, black pill segmented controls
   ========================================================= */

:root {
  --bg: #ffffff;
  --ink: #141414;
  --ink-2: #2b2b2b;
  --gray-1: #8d8d8d;      /* labels, secondary text */
  --gray-2: #b7b7b7;      /* muted text, ghost chart lines */
  --gray-3: #d6d6d6;      /* light borders */
  --gray-4: #e9e9e9;      /* grid lines, dividers */
  --surface: #f3f3f3;     /* chips, square icon buttons */
  --surface-2: #e9e9e9;   /* hover surface */
  --rule: #1a1a1a;        /* column top rules */
  --ink-muted: #a8a8a8;   /* muted text on black surfaces */

  --lavender: #dcd8f8;
  --lavender-2: #e6e3fb;
  --pink: #f6d8de;
  --pink-2: #fbe6ea;
  --mint: #d3f0e1;
  --mint-2: #e3f6ec;
  --cyan: #d2e9ee;
  --amber: #f8e6c6;

  --dot-cyan: #8fd0dd;
  --dot-lavender: #a9a1ea;
  --dot-mint: #74c99a;
  --dot-pink: #ec9fb0;
  --dot-amber: #e9b95f;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 22px;

  --font: "Plus Jakarta Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --page-x: 80px;
  --col-left: 180px;
  --col-right: 470px;
  --col-gap: 72px;
  --content-max: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1, "ss01" 1;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
img { max-width: 100%; display: block; }

/* ---------- Page & grid ---------- */
.page {
  min-height: 100vh;
  padding: 0 var(--page-x) 56px;
}
.layout {
  display: grid;
  grid-template-columns: var(--col-left) minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: start;
}
.layout--two, .layout--wide { grid-template-columns: var(--col-left) minmax(0, 1fr); }
.layout--single { grid-template-columns: minmax(0, 1fr); }
.col { min-width: 0; }
.col--left { position: sticky; top: 0; }
.col--main { max-width: var(--content-max); }
/* Legacy right column (pages not yet converted): stacks under the main column */
.layout .col--right { grid-column: 2; max-width: var(--content-max); margin-top: 24px; }
.layout .col--right > hr.rule { display: none; }

/* A column starts with a dark rule, like each panel in the reference */
.rule {
  height: 2px;
  background: var(--rule);
  border: 0;
  margin: 0 0 40px;
}
.rule--thin { height: 1px; background: var(--gray-4); margin: 24px 0; }
.rule--mid { height: 1px; background: var(--gray-3); margin: 32px 0; }

/* ---------- Topbar ---------- */
.topbar {
  display: grid;
  grid-template-columns: var(--col-left) minmax(0, 1fr) auto;
  max-width: calc(var(--col-left) + var(--col-gap) + var(--content-max));
  column-gap: var(--col-gap);
  align-items: center;
  height: 150px;
  padding-top: 20px;
}
.topbar__brand { grid-column: 1; }
.topbar__kpis { grid-column: 2; }
.topbar__actions { grid-column: 3; }
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.topbar__brand svg { width: 28px; height: 28px; }
/* KPI strip in the header (filled at runtime from the page's left-column .stat blocks) */
.topbar__kpis {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 2px;
}
.topbar__kpis.is-empty { display: none; }
.topbar__kpis .stat { margin: 0; flex: none; }
.topbar__kpis .stat__label { font-size: 12px; margin-bottom: 2px; white-space: nowrap; }
.topbar__kpis .stat__value { font-size: 22px; }
.topbar__kpis .stat__value .unit { font-size: 13px; }
.topbar__kpis .stat__delta { font-size: 11px; margin-top: 2px; white-space: nowrap; }
.topbar__kpis .stat__delta a { color: inherit; }

/* Sidebar navigation (main sections) */
.sidenav { display: flex; flex-direction: column; }
.sidenav + :not(.brand-foot):not([data-brandfoot]) { margin-top: 36px; }
.sidenav__link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0;
  font-size: 15px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap;
}
.sidenav__link:hover { color: var(--ink); }
.sidenav__link.is-active { color: var(--ink); font-weight: 700; }
.sidenav__link.is-active::after {
  content: ""; width: 8px; height: 8px; flex: none; margin-right: 4px;
  border-right: 1.5px solid var(--gray-2); border-top: 1.5px solid var(--gray-2);
  transform: rotate(45deg);
}

/* Legacy horizontal nav (kept for reference / pages that opt out of the sidebar) */
.topbar__nav { display: flex; align-items: center; gap: 38px; }
.topbar__link { position: relative; font-size: 15px; font-weight: 500; color: var(--ink-2); white-space: nowrap; padding: 6px 0; }
.topbar__link.is-active { color: var(--ink); font-weight: 600; }
.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
}
.topbar__icon {
  width: 24px;
  height: 24px;
  color: var(--ink);
  position: relative;
}
.topbar__icon svg { width: 24px; height: 24px; }
.topbar__icon .dot {
  position: absolute; top: 1px; right: 2px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dot-pink); border: 1.5px solid #fff;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 30% 30%, #6a6a6a, #161616 70%);
  overflow: hidden;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.avatar--light { background: var(--surface); color: var(--ink); }
.avatar--lavender { background: var(--lavender); color: var(--ink); }
.avatar--pink { background: var(--pink); color: var(--ink); }
.avatar--mint { background: var(--mint); color: var(--ink); }

/* ---------- Typography ---------- */
.h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.h4 { font-size: 15px; font-weight: 700; line-height: 1.3; }
.sub { color: var(--gray-1); font-size: 15px; font-weight: 500; }
.small { font-size: 13px; }
.tiny { font-size: 11px; line-height: 1.5; }
.muted { color: var(--gray-1); }
.faint { color: var(--gray-2); }
.bold { font-weight: 700; }
.semibold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.link { color: var(--ink); font-weight: 600; }
.link:hover { text-decoration: underline; }
.lead { font-size: 17px; line-height: 1.6; color: var(--ink-2); }

/* Title row: heading + arrow-subtitle on the left, value / actions on the right */
.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.title-row__text { flex: none; }
.title-row__text .h1, .title-row__text .h2 { white-space: nowrap; }
.title-row__text .sub { margin-top: 6px; display: inline-block; white-space: nowrap; }
.title-row__right { display: flex; align-items: center; gap: 12px; }
.h1 .slash, .h2 .slash, .h3 .slash, .title-row .h1 .slash {
  color: var(--gray-1); font-size: 16px; font-weight: 500; margin-left: 12px; letter-spacing: 0; white-space: nowrap;
}
.h3 .slash { font-size: 14px; margin-left: 8px; }

/* ---------- Stats ---------- */
.stat { margin-bottom: 44px; }
.stat__label { color: var(--gray-1); font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.stat__value {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  display: flex; align-items: baseline; gap: 6px;
}
.stat__value .unit { font-size: 15px; font-weight: 500; color: var(--gray-1); }
.stat__value .unit--lead { font-size: 14px; }
.stat__delta { margin-top: 6px; font-size: 13px; color: var(--gray-1); }
.stat__delta.up { color: var(--ink); }
.stat--inline { display: flex; align-items: baseline; gap: 12px; margin-bottom: 0; }

/* Big value next to a heading ("₴ 12,435") */
.value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.value .unit { font-size: 15px; font-weight: 500; color: var(--gray-1); margin-right: 4px; }
.value--sm { font-size: 22px; }
.value--lg { font-size: 36px; }
.value--xl { font-size: 48px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: var(--radius-s);
  font-size: 14px; font-weight: 600;
  background: var(--ink); color: #fff;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.btn:hover { background: #000; }
.btn svg { width: 18px; height: 18px; }
.btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--soft { background: var(--surface); color: var(--ink); }
.btn--soft:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--ink); padding: 0 8px; }
.btn--ghost:hover { background: var(--surface); }
.btn--lavender { background: var(--lavender); color: var(--ink); }
.btn--lavender:hover { background: #cfcaf5; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn--lg { height: 52px; padding: 0 28px; font-size: 15px; }
.btn--pill { border-radius: 999px; }
.btn--block { width: 100%; }

/* Round outline icon buttons (gift / plane / card in the reference) */
.icon-btn {
  width: 58px; height: 58px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1.5px solid var(--ink); background: #fff; color: var(--ink);
  transition: background .15s ease;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--surface); }
.icon-btn--fill { border-color: transparent; background: var(--surface); }
.icon-btn--lavender { border-color: transparent; background: var(--lavender-2); }
.icon-btn--pink { border-color: transparent; background: var(--pink); }
.icon-btn--mint { border-color: transparent; background: var(--mint); }
.icon-btn--black { background: var(--ink); color: #fff; border-color: var(--ink); }
.icon-btn--black:hover { background: #000; }
.icon-btn--plain { border-color: transparent; background: transparent; }
.icon-btn--sm { width: 46px; height: 46px; }
.icon-btn--sm svg { width: 18px; height: 18px; }
.icon-btn--xs { width: 34px; height: 34px; }
.icon-btn--xs svg { width: 15px; height: 15px; }

/* Square light icon buttons (next to the date chip) */
.sq-btn {
  width: 44px; height: 44px; border-radius: var(--radius-s);
  display: inline-grid; place-items: center;
  background: var(--surface); color: var(--ink);
}
.sq-btn svg { width: 18px; height: 18px; }
.sq-btn:hover { background: var(--surface-2); }
.sq-btn--sm { width: 30px; height: 30px; border-radius: 8px; }
.sq-btn--sm svg { width: 14px; height: 14px; }

.icon-row { display: flex; align-items: center; gap: 14px; }

/* ---------- Chips / segmented ---------- */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chip--sm { height: 36px; padding: 0 16px; font-size: 13px; min-width: 66px; }
.chip--xs { height: 28px; padding: 0 12px; font-size: 12px; }
.chip--active, .chip.is-active { background: var(--ink); color: #fff; }
.chip--outline { background: transparent; border: 1px solid var(--gray-3); }
.chip--lavender { background: var(--lavender); }
.chip--pink { background: var(--pink); }
.chip--mint { background: var(--mint); }
.chip-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-row--spread { justify-content: space-between; }

/* Segmented control: light pill container, black active pill */
.seg {
  display: inline-flex; align-items: center;
  background: var(--surface); border-radius: var(--radius-s); padding: 3px;
}
.seg__item {
  height: 38px; padding: 0 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink);
  display: inline-flex; align-items: center; white-space: nowrap;
}
.seg__item.is-active { background: var(--ink); color: #fff; font-weight: 600; }
.seg--sm .seg__item { height: 30px; padding: 0 12px; font-size: 12px; }

/* Badges / tags */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  background: var(--surface); color: var(--ink);
  font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .01em;
}
.badge--ink { background: var(--ink); color: #fff; }
.badge--lavender { background: var(--lavender); }
.badge--pink { background: var(--pink); }
.badge--mint { background: var(--mint); }
.badge--amber { background: var(--amber); }
.badge--outline { background: transparent; border: 1px solid var(--gray-3); color: var(--gray-1); }

/* Tag: small light square with a colored dot + label (category in the list) */
.tag { display: inline-flex; align-items: center; gap: 12px; color: var(--gray-1); font-size: 14px; font-weight: 500; }
.tag__dot {
  width: 30px; height: 30px; border-radius: 8px; background: var(--surface);
  display: inline-grid; place-items: center; flex: none;
}
.tag__dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot-cyan); }
.tag__dot--cyan::after { background: var(--dot-cyan); }
.tag__dot--lavender::after { background: var(--dot-lavender); }
.tag__dot--mint::after { background: var(--dot-mint); }
.tag__dot--pink::after { background: var(--dot-pink); }
.tag__dot--amber::after { background: var(--dot-amber); }
.tag__dot--ink::after { background: var(--ink); }
.tag__dot--gray::after { background: var(--gray-2); }

/* Standalone dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }
.dot--cyan { background: var(--dot-cyan); }
.dot--lavender { background: var(--dot-lavender); }
.dot--mint { background: var(--dot-mint); }
.dot--pink { background: var(--dot-pink); }
.dot--amber { background: var(--dot-amber); }
.dot--gray { background: var(--gray-2); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { color: var(--gray-1); font-size: 13px; font-weight: 500; }
.field__hint { color: var(--gray-2); font-size: 12px; }

/* Underline input ("Categories" search) */
.uline {
  display: flex; align-items: center; gap: 12px;
  height: 44px; border-bottom: 1.5px solid var(--gray-3);
  color: var(--gray-1);
}
.uline svg { width: 16px; height: 16px; flex: none; }
.uline input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--ink);
}
.uline input::placeholder { color: var(--gray-1); }
.uline .chev { margin-left: auto; color: var(--ink); }
.uline:focus-within { border-bottom-color: var(--ink); }

/* Filled input */
.input {
  height: 44px; padding: 0 16px; border-radius: var(--radius-s);
  background: var(--surface); border: 1.5px solid transparent; outline: 0;
  font-size: 14px; width: 100%;
}
.input:focus { border-color: var(--ink); background: #fff; }
.input--lg { height: 56px; font-size: 16px; padding: 0 20px; }
textarea.input { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* Toggle switch (black knob on light pill) */
.switch {
  position: relative; display: inline-block; width: 48px; height: 26px;
  border-radius: 999px; background: var(--surface-2); cursor: pointer; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--ink);
  transition: left .15s ease;
}
.switch.is-on::after { left: 25px; }
.switch.is-on { background: var(--surface-2); }
.switch--sm { width: 38px; height: 22px; }
.switch--sm::after { width: 16px; height: 16px; }
.switch--sm.is-on::after { left: 19px; }

/* Checkbox / radio (black) */
.check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--ink);
  display: inline-grid; place-items: center; flex: none; background: #fff;
}
.check.is-on { background: var(--ink); }
.check.is-on::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-grid; place-items: center; flex: none; }
.radio.is-on::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

/* Controls row: search underline on the left, date chip + square buttons on the right */
.controls {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 44px;
}
.controls .uline { flex: 0 1 320px; }
.controls__right { display: flex; align-items: center; gap: 12px; }

/* ---------- Lists (transactions style) ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1.6fr) minmax(0, 1.2fr) 46px minmax(0, .8fr);
  align-items: center;
  column-gap: 24px;
  padding: 18px 0;
}
.list-row + .list-row { border-top: 1px solid transparent; }
.list--divided .list-row + .list-row { border-top-color: var(--gray-4); }
.list-row__logo {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 14px;
}
.list-row__logo svg { width: 22px; height: 22px; }
.list-row__logo--light { background: var(--surface); color: var(--ink); }
.list-row__logo--lavender { background: var(--lavender); color: var(--ink); }
.list-row__logo--pink { background: var(--pink); color: var(--ink); }
.list-row__logo--mint { background: var(--mint); color: var(--ink); }
.list-row__logo--outline { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.list-row__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__sub { color: var(--gray-1); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__amount { font-size: 19px; font-weight: 700; text-align: right; letter-spacing: -0.01em; white-space: nowrap; }
.list-row__amount .unit { font-size: 13px; color: var(--gray-1); font-weight: 500; margin-left: 2px; }
.list-row--compact { grid-template-columns: 34px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .6fr); padding: 12px 0; }
.list-row--compact .list-row__logo { width: 34px; height: 34px; font-size: 12px; }
.list-row--compact .list-row__title { font-size: 15px; }
.list-row--compact .list-row__amount { font-size: 16px; }
.list-row__time { color: var(--gray-1); font-size: 13px; white-space: nowrap; text-align: right; }
.list-row .tag, .list-row .status { white-space: nowrap; }

/* ---------- Tables ---------- */
.table th, .table td { padding: 14px 12px; text-align: left; vertical-align: middle; }
.table th {
  color: var(--gray-1); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  border-bottom: 1px solid var(--gray-3);
}
.table td { border-bottom: 1px solid var(--gray-4); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.strong { font-weight: 700; }
.table--tight th, .table--tight td { padding: 10px 8px; }
.table--hover tbody tr:hover td { background: #fafafa; }
.table--pricing th, .table--pricing td { text-align: center; }
.table--pricing th:first-child, .table--pricing td:first-child { text-align: left; }
.table--pricing td.is-hilite, .table--pricing th.is-hilite { background: #fafafa; }

/* ---------- Cards ---------- */
.card {
  border-radius: var(--radius-l); background: var(--surface); padding: 28px;
}
.card--white { background: #fff; border: 1.5px solid var(--gray-4); }
.card--outline { background: #fff; border: 1.5px solid var(--ink); }
.card--ink { background: var(--ink); color: #fff; }
.card--lavender { background: var(--lavender); }
.card--pink { background: var(--pink); }
.card--mint { background: var(--mint); }
.card--sm { padding: 20px; border-radius: var(--radius-m); }
.card--flat { background: transparent; padding: 0; }
.card--ink .muted, .promo--ink .muted, .plan--featured .muted, .panel--ink .muted { color: var(--ink-muted); }

/* Promo card (lavender card with geometric shape and arrow) */
.promo {
  position: relative; overflow: hidden;
  min-height: 240px; padding: 28px;
  border-radius: var(--radius-l); background: var(--lavender);
  display: flex; flex-direction: column; justify-content: space-between;
}
.promo__shape { position: absolute; right: 0; top: 0; height: 100%; width: 62%; pointer-events: none; }
.promo__shape svg { width: 100%; height: 100%; }
.promo__arrow { position: absolute; top: 24px; right: 24px; color: #fff; z-index: 2; }
.promo__arrow svg { width: 22px; height: 22px; }
.promo__text { position: relative; z-index: 2; font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.promo__text .muted { color: #5a5873; font-weight: 500; font-size: 13px; }
.promo__seal { position: relative; z-index: 2; width: 72px; height: 72px; }
.promo--sm { min-height: 200px; padding: 24px; }
.promo--sm .promo__shape { width: 46%; }
.promo--sm .promo__text { font-size: 16px; max-width: 62%; }
.promo--sm .promo__seal { width: 56px; height: 56px; }
.promo--pink { background: var(--pink); }
.promo--pink .promo__text .muted { color: #7a5c63; }
.promo--mint { background: var(--mint); }
.promo--ink { background: var(--ink); color: #fff; }

/* ---------- Progress / compare bars ---------- */
.bar {
  position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden;
}
.bar__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 999px; }
.bar__fill--gray { background: var(--gray-2); }
.bar__fill--lavender { background: var(--dot-lavender); }
.bar__fill--pink { background: var(--dot-pink); }
.bar__fill--mint { background: var(--dot-mint); }
.bar__fill--hatch {
  background-color: var(--ink);
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,.75) 3px 4.5px);
}
.bar--thick { height: 16px; }
.bar--thin { height: 6px; }

.compare { display: flex; flex-direction: column; gap: 14px; }
.compare__row { display: grid; grid-template-columns: 120px 1fr 64px; align-items: center; gap: 16px; }
.compare__label { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare__value { font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Big percentage pair (20% vs 80%) */
.pct-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.pct { display: flex; flex-direction: column; gap: 10px; }
.pct__label { color: var(--gray-1); font-size: 14px; font-weight: 500; }
.pct__value { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.pct__value .unit { font-size: 20px; font-weight: 600; color: var(--gray-1); margin-left: 2px; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 14px; }
.step {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: start; gap: 18px;
  padding: 20px 0; border-top: 1px solid var(--gray-4);
}
.step:first-child { border-top: 0; }
.step__num {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.step__num.is-done { background: var(--ink); color: #fff; }
.step__num.is-active { background: var(--lavender); border-color: transparent; }
.step__title { font-size: 16px; font-weight: 700; }
.step__desc { color: var(--gray-1); font-size: 13px; margin-top: 4px; line-height: 1.55; }
.step__kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--gray-1); text-transform: uppercase; margin-bottom: 4px; }

/* Horizontal stepper (onboarding) */
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper__item { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--gray-1); white-space: nowrap; }
.stepper__item .step__num { width: 30px; height: 30px; font-size: 12px; border-color: var(--gray-3); color: var(--gray-1); }
.stepper__item.is-active { color: var(--ink); }
.stepper__item.is-active .step__num { border-color: var(--ink); color: var(--ink); }
.stepper__item.is-done .step__num { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper__line { flex: 1; height: 1px; background: var(--gray-3); min-width: 24px; }

/* ---------- Key/value rows ---------- */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; }
.kv dt { color: var(--gray-1); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.kv--stack dt { font-size: 13px; }
.kv--stack dd { text-align: left; }
.kv--lined { gap: 0; }
.kv--lined dt, .kv--lined dd { padding: 14px 0; border-bottom: 1px solid var(--gray-4); }
.kv--lined dd { padding-left: 24px; }
.kv--lined dt:last-of-type, .kv--lined dd:last-of-type { border-bottom: 0; }

/* Row of mini stats (icon + label + value) */
.mini-stats { display: flex; flex-direction: column; gap: 14px; }
.mini-stat { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.mini-stat svg { width: 16px; height: 16px; color: var(--ink); }
.mini-stat__label { color: var(--gray-1); }
.mini-stat__value { font-weight: 600; }

/* ---------- Status pills (plain text + dot) ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--gray-1); }
.status .dot { width: 7px; height: 7px; }

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-axis { fill: var(--gray-1); font-size: 12px; font-weight: 500; font-family: var(--font); }
.chart-grid { stroke: var(--gray-4); stroke-width: 1; }
.chart-baseline { stroke: var(--gray-3); stroke-width: 1.5; }
.chart-legend { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; color: var(--gray-1); font-size: 13px; }
.chart-legend__item { display: flex; align-items: center; gap: 8px; }
.chart-legend__swatch { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
/* AIごとの色（タイルの印・円グラフ・推移の線で共通） */
[data-engine="chatgpt"] { --e: #10a37f; }
[data-engine="claude"] { --e: #d97757; }
[data-engine="gemini"] { --e: #7c5cff; }
[data-engine="aio"] { --e: #4285f4; }
[data-engine="aimode"] { --e: #f2a60c; }
[data-engine="perplexity"] { --e: #155e75; }
[data-engine="copilot"] { --e: #e0457b; }
[data-engine="grok"] { --e: #6b6b6b; }
.chart-legend__swatch[data-engine] { background: var(--e); height: 3px; }
.chart-legend__swatch--gray { background: var(--gray-1); }
.chart-legend__swatch--light { background: var(--gray-2); }
.chart-legend__swatch--pink { background: var(--dot-pink); }
.chart-legend__swatch--lavender { background: var(--dot-lavender); }
.chart-legend__swatch--mint { background: var(--dot-mint); }
.chart-legend__swatch--ink2 { background: #5c5c5c; }
.chart-legend__swatch--dash { background: repeating-linear-gradient(90deg, var(--gray-1) 0 4px, transparent 4px 7px); }
.chart-legend__swatch--dash-light { background: repeating-linear-gradient(90deg, var(--gray-2) 0 4px, transparent 4px 7px); }
.chart-legend__swatch--hatch { height: 10px; width: 14px; background-color: var(--ink); background-image: repeating-linear-gradient(135deg, transparent 0 2px, rgba(255,255,255,.75) 2px 3.5px); }
.chart-legend__swatch--solid { height: 10px; width: 14px; }

/* Bars + side stats row (Expenses / Income beside the bar chart) */
.chart-row { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: end; }
.chart-row__side { display: flex; flex-direction: column; gap: 16px; padding-bottom: 42px; }

/* ---------- Side footer brand ---------- */
.brand-foot { margin-top: 40px; }
.brand-foot .rule { margin-bottom: 44px; }
.brand-foot__name { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.brand-foot__meta { color: var(--gray-1); font-size: 11px; line-height: 1.6; margin-top: 6px; }

/* ---------- Layout helpers ---------- */
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--start { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-40 { margin-top: 40px; } .mt-56 { margin-top: 56px; } .mt-72 { margin-top: 72px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; } .mb-40 { margin-bottom: 40px; } .mb-56 { margin-bottom: 56px; }
.section { margin-top: 64px; }
.section--sm { margin-top: 40px; }

/* Section header with h1 + inline subtitle ("Latest bills / transactions") */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head .h1 { font-size: 28px; }
.section-head .h2 { font-size: 22px; }

/* Note / disclaimer */
.note { color: var(--gray-1); font-size: 12px; line-height: 1.6; }
.note--box { padding: 16px 18px; border-radius: var(--radius-m); background: var(--surface); }

/* Empty state */
.empty { text-align: center; padding: 56px 24px; color: var(--gray-1); }
.empty .icon-btn { margin: 0 auto 16px; }

/* Quote block (AI answer excerpt) */
.quote {
  position: relative; padding: 20px 24px 20px 28px; border-left: 2px solid var(--ink);
  font-size: 14px; line-height: 1.7; color: var(--ink-2); background: #fff;
}
.quote mark { background: var(--lavender); color: inherit; padding: 0 3px; border-radius: 3px; }
.quote mark.neg { background: var(--pink); }
.quote mark.pos { background: var(--mint); }
.quote mark.cite { background: var(--surface); }

/* Diff lines */
.diff { font-size: 13px; line-height: 1.7; }
.diff__line { padding: 2px 12px; border-radius: 6px; }
.diff__line.add { background: var(--mint-2); }
.diff__line.del { background: var(--pink-2); color: var(--gray-1); text-decoration: line-through; }

/* Keyboard / code */
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface); padding: 2px 6px; border-radius: 6px; }
pre.code { padding: 16px; line-height: 1.6; overflow: auto; white-space: pre; }

/* Score ring label */
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { width: 100%; height: 100%; }
.ring__value { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

/* Pricing plan column */
.plan { display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: var(--radius-l); background: var(--surface); }
.plan--featured { background: var(--ink); color: #fff; }
.plan--featured .muted { color: #a8a8a8; }
.plan--featured .btn { background: #fff; color: var(--ink); }
.plan--lavender { background: var(--lavender); }
.plan__name { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-1); }
.plan--featured .plan__name { color: #a8a8a8; }
.plan__price { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.plan__price .unit { font-size: 14px; font-weight: 500; color: var(--gray-1); margin-left: 6px; letter-spacing: 0; }
.plan__list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.plan__list li { display: flex; align-items: center; gap: 10px; }
.plan__list svg { width: 14px; height: 14px; flex: none; }

/* Modal-ish inline panel */
.panel { border-radius: var(--radius-l); border: 1.5px solid var(--gray-4); padding: 28px; background: #fff; }
.panel--ink { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Sticky action bar */
.actionbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 40px; }


/* ---------- Blocks: grouped panels (one content column) ---------- */
.block {
  background: #fff;
  border: 1.5px solid var(--gray-4);
  border-radius: var(--radius-l);
  padding: 28px 32px 32px;
}
.block + .block, .block + .promo, .promo + .block { margin-top: 24px; }
.block--soft { background: var(--surface); border-color: transparent; }
.block--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.block--ink .muted, .block--ink .sub { color: var(--ink-muted); }
.block--lavender { background: var(--lavender); border-color: transparent; }
.block--tight { padding: 22px 26px 24px; }
.block__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  margin-bottom: 22px;
}
.block__head--rule { padding-bottom: 18px; border-bottom: 1px solid var(--gray-4); }
.block__title { min-width: 0; }
.block__title .h2 { font-size: 22px; }
.block__title .sub { display: block; margin-top: 4px; font-size: 13px; }
.block__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.block__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 20px; color: var(--gray-1); font-size: 12px;
}
.block__section + .block__section { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--gray-4); }
.block__split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px 40px; align-items: start; }
.block__split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.block__split--wide { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
.block__aside { border-left: 1px solid var(--gray-4); padding-left: 36px; min-width: 0; }
.block .table th:first-child, .block .table td:first-child { padding-left: 0; }
.block .table th:last-child, .block .table td:last-child { padding-right: 0; }
.block .list-row:first-child { padding-top: 4px; }
.block .list-row:last-child { padding-bottom: 4px; }
.block .controls { margin-bottom: 24px; }
.block .chart-row { grid-template-columns: 200px 1fr; }
.block-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.block-grid > .block { margin-top: 0; }
.block-grid + .block, .block + .block-grid, .block-grid + .block-grid, .block-grid + .promo { margin-top: 24px; }

/* Page head: rule + title + tabs */
/* 期間・出力のメニューが下のブロックの後ろに回らないよう、見出しを手前に置く */
.page-head { margin-bottom: 28px; position: relative; z-index: 20; }
.page-head .title-row { margin-bottom: 20px; }
.page-head .chip-row { margin-top: 4px; }

/* Stat tiles (compact KPI boxes inside a block) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tile { padding: 18px 20px; border-radius: var(--radius-m); background: var(--surface); min-width: 0; }
.tile__label { color: var(--gray-1); font-size: 12px; font-weight: 500; white-space: nowrap; }
.tile__value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.tile__value .unit { font-size: 13px; color: var(--gray-1); font-weight: 500; margin-left: 3px; }
.tile__delta { font-size: 11px; color: var(--gray-1); margin-top: 6px; }
.tile--ink { background: var(--ink); color: #fff; }
.tile--ink .tile__label, .tile--ink .tile__delta, .tile--ink .tile__value .unit { color: var(--ink-muted); }
.tile--lavender { background: var(--lavender); }
.tile--pink { background: var(--pink); }
.tile--mint { background: var(--mint); }
.tile--outline { background: #fff; border: 1.5px solid var(--gray-4); }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
  :root { --page-x: 56px; --col-right: 430px; --col-gap: 60px; }
  .icon-btn { width: 52px; height: 52px; }
  .icon-btn svg { width: 20px; height: 20px; }
}
@media (max-width: 1420px) {
  .topbar { grid-template-columns: var(--col-left) minmax(0, 1fr) auto; }
}
@media (max-width: 1180px) {
  .chart-row, .block .chart-row { grid-template-columns: 170px 1fr; }
  .block__split, .block__split--wide { grid-template-columns: minmax(0, 1fr); }
  .block__aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--gray-4); padding-top: 20px; }
}
@media (max-width: 1080px) {
  .topbar { grid-template-columns: var(--col-left) minmax(0, 1fr); grid-template-rows: auto auto; height: auto; row-gap: 16px; padding-bottom: 24px; }
  .topbar__brand { grid-row: 1; }
  .topbar__actions { grid-column: 2; grid-row: 1; justify-self: end; }
  .topbar__kpis { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 860px) {
  :root { --page-x: 20px; }
  .layout, .layout--two, .layout--wide, .topbar { grid-template-columns: minmax(0, 1fr); }
  .layout .col--right, .topbar__kpis, .topbar__actions { grid-column: 1; }
  .block { padding: 20px 20px 22px; }
  .block__split, .block__split--even, .block__split--wide, .block-grid { grid-template-columns: minmax(0, 1fr); }
  .block__aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--gray-4); padding-top: 20px; }
  .col--left { position: static; }
  .topbar__kpis { flex-wrap: wrap; gap: 16px 28px; overflow: visible; }
  .sidenav { flex-direction: row; overflow-x: auto; gap: 22px; padding-bottom: 8px; margin-bottom: 24px; }
  .sidenav__link { padding: 6px 0; }
  .sidenav__link.is-active::after { display: none; }
  .brand-foot { display: none; }
  .controls { flex-direction: column; align-items: stretch; }
  .controls .uline { flex: none; }
  .chart-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .list-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .list-row > :nth-child(3), .list-row > :nth-child(4) { display: none; }
}

/* ---------- Shared components (consolidated from page styles) ---------- */
/* Declared after the Responsive section on purpose: where a rule below used to be written in a
   page-level <style> (which loads after style.css) it must still win over the generic rules above. */

/* -- Block header: tools wrap under the title on narrow widths / search width; footnote link that must not wrap (opt-in) -- */
.block__head--wrap { flex-wrap: wrap; }
.block__head--wrap .block__tools { margin-left: auto; flex: 0 1 auto; }
.block__tools .uline { width: 240px; }
.block__foot--nowrap .link { white-space: nowrap; flex: none; }
@media (max-width: 1180px) {
  .block__head--wrap .block__tools { flex: 1 1 100%; justify-content: space-between; }
  .block__head--wrap .block__tools .uline { margin-right: auto; }
}
/* Title row whose subtitle may wrap: the text block grows, the value / icons block keeps its size */
.title-row--wrap .title-row__text { flex: 1 1 auto; min-width: 0; }
.title-row--wrap .title-row__text .sub { white-space: normal; }
.title-row--wrap .title-row__right { flex: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -- Tables -- */
.table--nowrap th, .table--nowrap td { white-space: nowrap; }
.table--nowrap-head th { white-space: nowrap; }
.table--fixed { table-layout: fixed; }
/* Right-end cell (action button / toggle) and a button group inside it */
.table .cell-end { width: 44px; text-align: right; }
.cell-actions { display: flex; justify-content: flex-end; gap: 6px; }
/* Cell content: bold title over a gray sub line (add .nowrap / .ellipsis as needed) */
.cell-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.cell-title--sm { font-size: 13px; }
.cell-title--lg { font-size: 15px; }
.cell-title--clamp {
  font-size: inherit; font-weight: 600; letter-spacing: normal; line-height: 1.45;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.cell-sub { margin-top: 2px; color: var(--gray-1); font-size: 12px; }
.cell-sub--sm { font-size: 11px; }
.cell-sub--lg { font-size: 13px; }
/* Cell content: thin bar + number (--bar-w / --cell-gap tune the width / gap) */
.cell-bar { display: flex; align-items: center; gap: var(--cell-gap, 8px); font-variant-numeric: tabular-nums; }
.cell-bar .bar { width: var(--bar-w, 36px); flex: none; }
.cell-bar--bold { font-weight: 700; }
/* Cell content: AI logo + name */
.ai-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-cell__text { min-width: 0; }
.ai-logo {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--ink); color: #fff; display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: .01em;
}
.ai-logo--sm { width: 28px; height: 28px; font-size: 9px; letter-spacing: .03em; }
.ai-logo--light { background: var(--surface); color: var(--ink); }
.ai-logo--outline { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.badge--xs { height: 22px; padding: 0 5px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .02em; }

/* -- Rows -- */
.list--icon-sm .list-row__logo svg { width: 16px; height: 16px; }
.list-row--notice { grid-template-columns: 34px minmax(0, 1fr) 14px; column-gap: 16px; padding: 14px 0; }
.list-row--notice .list-row__logo { width: 34px; height: 34px; }
.list-row--notice .list-row__logo svg { width: 16px; height: 16px; }
.list-row--notice .list-row__title { font-size: 15px; font-weight: 600; }
.list-row--notice .dot { justify-self: center; }
/* Setting row: title + description on the left, toggle on the right */
.switch-list { display: flex; flex-direction: column; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--gray-4); }
.switch-row:last-child { border-bottom: 0; }
.switch-row__title { font-size: 14px; font-weight: 600; }
.switch-row__desc { color: var(--gray-1); font-size: 12px; margin-top: 2px; line-height: 1.5; }
/* Checkable row: check box + label (+ trailing info); --lined adds the divider */
.check-row { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check-row--lined { padding: 12px 0; border-top: 1px solid var(--gray-4); }
.check-row--lined:first-child { border-top: 0; }
.check-row .check.is-on + .check-row__label { color: var(--gray-1); }

/* -- Steps / steppers / key-value / diff / plans -- */
.steps--side { gap: 0; }
.steps--side .step { grid-template-columns: 36px 1fr; gap: 14px; padding: 18px 0; }
.steps--side .step__num { width: 36px; height: 36px; font-size: 12px; }
.steps--side .step__num svg { width: 16px; height: 16px; }
.steps--side .step__title { font-size: 15px; }
.steps--side .step__desc { font-size: 12px; margin-top: 2px; }
.steps--side .step__num.is-pending { border-color: var(--gray-3); color: var(--gray-1); }
.steps--side .step.is-pending .step__title { color: var(--gray-1); }
.steps--side a.step:hover .step__title { text-decoration: underline; text-underline-offset: 3px; }
/* Two-line stepper label: small kicker / sub line above the step name */
.stepper__label { display: flex; flex-direction: column; line-height: 1.3; }
.stepper__label .tiny { color: var(--gray-1); font-weight: 600; }
.stepper__item.is-active .stepper__label .tiny { color: var(--ink-2); }
.stepper__kicker { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--gray-1); }
.stepper__item.is-active .stepper__kicker { color: var(--ink-2); }
/* Label above value, one column (use with .kv--stack) */
.kv--col { grid-template-columns: 1fr; gap: 6px 0; align-content: start; }
.kv--col dd { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.kv--col dd.is-pending { color: var(--gray-2); font-weight: 500; }
/* Diff with section labels */
.diff--stack { display: flex; flex-direction: column; gap: 4px; }
.diff__label { color: var(--gray-1); font-size: 12px; font-weight: 500; margin: 0 0 4px 12px; }
/* Plan columns in a 4-up grid (compact) */
.plan-grid .plan__price { font-size: 28px; }
.plan-grid .plan__term { font-size: 12px; color: var(--gray-1); margin-top: -8px; }
.plan--featured .plan__term { color: #a8a8a8; }
.plan-grid .plan__list { font-size: 12px; gap: 9px; }
.plan-grid .plan__list li { align-items: flex-start; }
.plan-grid .plan > .btn { margin-top: auto; }
.plan-grid .plan .btn--soft { background: #fff; }

/* ---------- Sidebar groups (group heading + menus, collapsible) ---------- */
.sidenav { gap: 22px; }
.sidenav__head {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 0 0 8px; color: var(--gray-1);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-align: left;
}
.sidenav__head svg { width: 12px; height: 12px; transition: transform .15s ease; }
.sidenav__group.is-closed .sidenav__head svg { transform: rotate(-90deg); }
.sidenav__group.is-closed .sidenav__items { display: none; }
.sidenav__group--star .sidenav__head span::after {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--dot-lavender); margin-left: 8px; vertical-align: middle;
}
.sidenav__items { display: flex; flex-direction: column; }
.sidenav__group .sidenav__link { padding: 8px 0; font-size: 14px; }
@media (max-width: 860px) {
  .sidenav { gap: 18px; }
  .sidenav__group { flex: none; }
  .sidenav__head { padding-bottom: 2px; }
  .sidenav__items { flex-direction: row; gap: 16px; }
}

/* ---------- Heat cells (prompt x AI tables) ---------- */
.heat { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.heat--0 { background: #fff; color: var(--gray-1); }
.heat--1 { background: #f3f3f3; }
.heat--2 { background: #e2e2e2; }
.heat--3 { background: #c6c6c6; }
.heat--4 { background: #8d8d8d; color: #fff; }
.heat--5 { background: var(--ink); color: #fff; }
.table td.heat, .block .table td.heat:last-child { padding: 14px 12px; }

/* ---------- Verdict: the one-line conclusion block at the top of a page ---------- */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.verdict__mark { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.verdict__mark svg { width: 20px; height: 20px; }
.verdict__kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--gray-1); }
.verdict__text { font-size: 18px; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; margin-top: 2px; }
.verdict__sub { color: var(--gray-1); font-size: 13px; margin-top: 4px; }
@media (max-width: 860px) { .verdict { grid-template-columns: minmax(0, 1fr); } .verdict__mark { display: none; } }

/* ---------- Brand logo image ---------- */
.brand-logo { display: block; width: 121px; height: auto; }
.topbar__brand .brand-logo { max-width: 100%; }

/* ---------- Scope: project / brand switch (sidebar top) and scope note (page head) ---------- */
.scope { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; margin-bottom: 2px; border-bottom: 1px solid var(--gray-4); }
.scope__field { display: flex; flex-direction: column; gap: 4px; }
.scope__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--gray-1); }
.scope__select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 38px; padding: 0 30px 0 12px;
  border: 0; border-radius: var(--radius-s); background-color: var(--surface); outline: 0;
  font-size: 13px; font-weight: 600; text-overflow: ellipsis; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.scope-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; font-size: 13px; }
.scope-note .muted { font-size: 12px; }
@media (max-width: 860px) { .scope { flex-direction: row; } .scope__field { flex: 1; } }

/* ---------- Compact page head (menu pages): no big heading; description lives in the sidebar tooltip ---------- */
.page-head--compact { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.page-head--compact .scope-note { flex: 1 1 320px; margin-bottom: 0; }
.page-head--compact .title-row { margin: 0 0 0 auto; }
.page-head--compact .title-row__text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.page-head--compact > [data-subnav], .page-head--compact > .chip-row { flex: 1 1 auto; order: 1; }
.page-head--compact .title-row { order: 2; }
.page-head--compact > [data-subnav]:empty { display: none; }

/* ---------- Sidebar menu tooltip (feature description on hover) ---------- */
.col--left { z-index: 5; }
/* sidebar tooltip: one fixed element placed next to the hovered label by app.js
   (fixed, so the scrollable sidebar does not clip it) */
.navtip {
  position: fixed; z-index: 60; transform: translateY(-50%);
  padding: 8px 12px; border-radius: 8px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
}
.navtip.is-on { opacity: 1; }
@media (max-width: 860px) { .navtip { display: none; } }

/* ---------- Page actions: [期間] [出力] [主操作] ---------- */
.pactions { display: flex; align-items: center; gap: 14px; }
.pactions__wrap { position: relative; display: inline-flex; }
.pactions__period { font-size: 13px; font-weight: 600; color: var(--gray-1); white-space: nowrap; }
.pactions__primary { height: 58px; padding: 0 26px; }
.icon-btn[data-tip] { position: relative; }
.icon-btn[data-tip]:not([data-tip=""])::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 10px); right: 0;
  padding: 8px 12px; border-radius: 8px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 30;
}
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after { opacity: 1; }
.pactions__wrap:has(.pmenu) .icon-btn::after { display: none; }
.pmenu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; min-width: 200px; padding: 8px;
  background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius-m);
}
.pmenu__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; }
.pmenu__item:hover { background: var(--surface); }
.pmenu__item.is-active { font-weight: 700; }
.pmenu__item svg { width: 16px; height: 16px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(20, 20, 20, .45); }
.modal__box { width: min(520px, 100%); max-height: 100%; overflow: auto; background: #fff; border-radius: var(--radius-l); }
.modal__box--wide { width: min(760px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; border-bottom: 1px solid var(--gray-4); }
.modal__body { padding: 22px 28px; }
.modal__fields { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 12px; padding: 18px 28px; border-top: 1px solid var(--gray-4); }
.cal__nav { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 14px; font-size: 14px; }
.cal { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__dow span { text-align: center; font-size: 12px; color: var(--gray-1); padding-bottom: 8px; }
.cal__day { height: 40px; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal__day:hover { background: var(--surface); }
.cal__day.is-out { color: var(--gray-2); }
.cal__day.is-range { background: var(--lavender-2); }
.cal__day.is-edge { background: var(--ink); color: #fff; border-radius: 8px; font-weight: 700; }
.cal__sel { margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 12px); z-index: 120; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) { .cal { grid-template-columns: 1fr; } .pactions { flex-wrap: wrap; justify-content: flex-end; } .pactions__primary { height: 48px; } }

/* ---------- Header: scope (project / brand) on the left of the KPI strip ---------- */
.topbar__main { grid-column: 2; display: flex; align-items: center; gap: 36px; min-width: 0; }
.topbar__scope:empty { display: none; }
.topbar__scope { flex: none; padding-right: 36px; border-right: 1px solid var(--gray-4); }
.topbar__scope .scope { flex-direction: row; gap: 12px; padding: 0; margin: 0; border: 0; }
.topbar__scope .scope__field { width: 190px; }
.topbar__main .topbar__kpis { grid-column: auto; flex: 1; gap: 32px; }
@media (max-width: 1500px) { .topbar__scope .scope__field { width: 160px; } .topbar__main { gap: 24px; } .topbar__scope { padding-right: 24px; } .topbar__main .topbar__kpis { gap: 24px; } }
@media (max-width: 1280px) {
  .topbar__main { flex-direction: column; align-items: flex-start; gap: 16px; }
  .topbar__scope { border-right: 0; padding-right: 0; }
  .topbar { height: auto; padding-bottom: 24px; }
}
@media (max-width: 1080px) { .topbar__main { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 860px) { .topbar__main { grid-column: 1; } .topbar__scope .scope__field { flex: 1; width: auto; } .topbar__scope, .topbar__scope .scope { width: 100%; } }

/* Verdict block: white ground, thick ink frame, vivid turquoise mark */
.block--soft:has(.verdict) { background: #fff; border: 2px solid var(--ink); }
.verdict__mark { background: #00c4cc; }
.chart-legend__swatch--hatch { background-color: #7a7a7a; }

/* Page transition: nothing is painted until the scripts have built the chrome
   (no flash of the raw markup). The sidebar and header then appear at once,
   with no animation, so they read as fixed; only the content column fades in.
   The 2s fallback shows the page if JS fails. */
@keyframes q-fallback { to { visibility: visible; } }
@keyframes q-content { from { opacity: 0; } to { opacity: 1; } }
body { visibility: hidden; animation: q-fallback 0s 2s forwards; }
body.is-ready { visibility: visible; animation: none; }
body.is-ready .col--main > *:not(.rule) { animation: q-content .7s ease both; }
/* pages without the sidebar layout (login, onboarding): fade the whole page */
body.is-ready:not(:has(.col--main)) .page { animation: q-content .7s ease both; }
@media (prefers-reduced-motion: reduce) {
  body.is-ready .col--main > *, body.is-ready .page { animation: none; }
}

/* Fixed chrome (desktop): the header and the sidebar stay put, only the content scrolls.
   The dark rule under the header is drawn by the header itself, split like the two columns. */
@media (min-width: 1081px) {
  body:has(.sidenav) { --head-h: 132px; }
  body:has(.sidenav) .topbar {
    position: sticky; top: 0; z-index: 30; background: var(--bg);
    height: var(--head-h); padding-top: 0;
  }
  body:has(.sidenav) .topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none;
    background: linear-gradient(90deg, var(--rule) 0 var(--col-left), transparent var(--col-left) calc(var(--col-left) + var(--col-gap)), var(--rule) calc(var(--col-left) + var(--col-gap)));
  }
  body:has(.sidenav) .layout > .col > .rule:first-child { display: none; }
  body:has(.sidenav) .layout > .col { padding-top: 40px; }
  body:has(.sidenav) .col--left {
    top: var(--head-h); max-height: calc(100vh - var(--head-h)); padding-bottom: 32px;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  }
  body:has(.sidenav) .col--left::-webkit-scrollbar { display: none; }
}
