/* SplitBillPro — one stylesheet, no external fonts, no images. */

:root {
  --bg: #f4f6f9;
  --bg-soft: #eaeef4;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #101827;
  --ink-2: #2b3648;
  --muted: #5b6779;
  --line: #dde3ec;
  --line-2: #cbd4e1;
  --accent: #0e7c66;
  --accent-2: #0aa17f;
  --accent-soft: #e3f5ef;
  --on-accent: #ffffff;
  --pos: #0a7a58;
  --neg: #b4342a;
  --warn: #8a5300;
  --warn-soft: #fdf3e0;
  --shadow: 0 1px 2px rgba(16, 24, 39, .05), 0 10px 26px -18px rgba(16, 24, 39, .35);
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0a1120;
  --bg-soft: #0e1728;
  --panel: #111b2d;
  --panel-2: #16223a;
  --ink: #e9eff8;
  --ink-2: #cdd8e8;
  --muted: #9aa9c0;
  --line: #22304a;
  --line-2: #2c3d5c;
  --accent: #2fd6ad;
  --accent-2: #46e6bf;
  --accent-soft: #123528;
  --on-accent: #052018;
  --pos: #4fe0b6;
  --neg: #ff9d92;
  --warn: #f2c078;
  --warn-soft: #2c2313;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 32px -22px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", "Yu Gothic", "Noto Sans JP",
    "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

[hidden] { display: none !important; }

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.22; letter-spacing: -0.012em; margin: 0; }

p { margin: 0; }

code, .mono { font-family: var(--mono); font-size: .92em; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.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;
}

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 30;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-head { background: var(--bg); }
}
.head-inner {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.brand-name { font-weight: 700; font-size: 1.06rem; letter-spacing: -0.02em; }
.brand-name b { color: var(--accent); }
.brand-sub {
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 10px;
}
.langs { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.langs a {
  font-size: .8rem; text-decoration: none; color: var(--muted);
  padding: 6px 9px; border-radius: 8px; white-space: nowrap;
}
.langs a:hover { background: var(--panel); color: var(--ink); }
.langs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
[data-theme="light"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: none; }

/* -------------------------------------------------------------------- hero */
.hero { padding: 44px 20px 26px; }
.eyebrow {
  display: inline-block; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 5px 11px; border-radius: 999px;
  font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); font-weight: 760; max-width: 780px; text-wrap: balance; line-break: strict; }
:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
:lang(ko) .hero h1 { word-break: keep-all; }
:lang(ko) .sec-head h2 { word-break: keep-all; }
:lang(ja) .hero h1, :lang(zh) .hero h1, :lang(zh-Hant) .hero h1 { max-width: 100%; }
.lede { margin-top: 14px; font-size: 1.06rem; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.answer {
  margin-top: 16px; padding: 14px 16px; max-width: 72ch; text-wrap: pretty;
  border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: 0 12px 12px 0; color: var(--ink-2); font-size: .98rem;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.chip {
  font-size: .8rem; color: var(--ink-2); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}
.basis-strip {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 28px;
  font-size: .82rem; color: var(--muted);
}
.basis-strip b { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ studio */
.studio { padding-bottom: 8px; }

.strip {
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.1fr);
  align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field-end { display: flex; gap: 8px; align-items: center; min-width: 0; }
.field-end select { flex: 1 1 auto; min-width: 0; }

input, select, textarea, button { font: inherit; color: inherit; }

:where(input[type="text"], input[type="date"], select, textarea) {
  min-width: 0; width: 100%;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: .95rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: var(--on-accent);
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: .93rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-2); }
.btn.ghost { background: var(--panel-2); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-2); }
.btn.small { padding: 7px 11px; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.cols {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 396px);
  gap: 16px; margin-top: 16px; align-items: start;
}
.col-main, .col-side { display: grid; gap: 16px; min-width: 0; }
.col-side { position: sticky; top: 78px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; min-width: 0;
}
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { font-size: 1.03rem; font-weight: 700; }
.card-head .hint { margin-left: auto; }
.hint { font-size: .8rem; color: var(--muted); }

/* ------------------------------------------------------------------ people */
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.person {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 8px;
}
.pdot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.person-name { flex: 1 1 auto; border: 1px solid transparent; background: transparent; padding: 5px 6px; font-weight: 600; }
.person-name:hover { border-color: var(--line); }
.xbtn {
  flex: none; width: 28px; height: 28px; line-height: 1; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 1.1rem; cursor: pointer;
}
.xbtn:hover { color: var(--neg); background: var(--bg-soft); }
.add-person { display: flex; gap: 8px; margin-top: 10px; }
.add-person input { flex: 1 1 auto; }

/* ---------------------------------------------------------------- expenses */
.expense-list { display: grid; gap: 10px; }
.exp {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
  padding: 10px 11px; min-width: 0;
}
.exp-head { display: flex; gap: 6px; align-items: center; }
.exp-desc { flex: 1 1 auto; font-weight: 600; background: var(--panel); }
.exp-row {
  display: grid; gap: 8px; margin-top: 8px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
}
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld-l { font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.amt-wrap { display: flex; gap: 6px; min-width: 0; }
.amt-wrap input { flex: 1 1 auto; text-align: right; }
.amt-wrap select { flex: none; width: 84px; }

.who-box { margin-top: 9px; }
.who-head { font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.whos { display: flex; flex-wrap: wrap; gap: 5px; }
.who {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 8px 3px 8px; font-size: .82rem; color: var(--muted); cursor: pointer;
  background: var(--panel); min-width: 0;
}
.who.is-in { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--ink); }
.who input[type="checkbox"] { accent-color: var(--accent); margin: 0; }
.who-name { flex: 0 0 auto; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-in {
  width: 58px; min-width: 0; border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel-2); padding: 2px 5px; font-size: .8rem; text-align: right;
}
.exp-prev { margin-top: 8px; font-size: .8rem; color: var(--muted); }
.exp-prev.is-warn { color: var(--warn); background: var(--warn-soft); padding: 6px 8px; border-radius: 8px; }
.empty-line { font-size: .87rem; color: var(--muted); padding: 10px 2px; }

/* ------------------------------------------------------------------- rates */
.rate-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 6px; }
.rate {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  border: 1px solid var(--line); border-radius: 9px; padding: 5px 7px;
  background: var(--panel-2); font-size: .8rem; color: var(--muted); opacity: .72;
}
.rate.is-used { opacity: 1; border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
.rate.is-base { background: var(--accent-soft); opacity: 1; }
.rate-code { font-weight: 700; color: var(--ink); flex: none; }
.rate-one { flex: none; white-space: nowrap; }
.rate-in { flex: 1 1 40px; width: 40px; padding: 3px 5px; font-size: .78rem; text-align: right; background: var(--panel); }
.rate-base { flex: none; font-size: .72rem; }
.rate-tag { flex: none; font-size: .64rem; color: var(--accent); min-width: 0; }
.rate-tag:empty { display: none; }
.rates-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.rates-foot .hint { margin-left: auto; }

/* ----------------------------------------------------------------- results */
.result .total-line { font-size: 1.18rem; font-weight: 700; }
.totals-cur { font-size: .84rem; color: var(--muted); margin-top: 3px; word-break: break-word; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
table.bal { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.bal th, table.bal td { padding: 7px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.bal thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
table.bal th[scope="row"] { text-align: left; font-weight: 600; white-space: normal; word-break: break-word; max-width: 12ch; }
table.bal td.net { font-weight: 700; }
table.bal tr.pos td.net { color: var(--pos); }
table.bal tr.neg td.net { color: var(--neg); }
table.bal td.state { color: var(--muted); font-size: .76rem; }
table.bal tbody tr:last-child th, table.bal tbody tr:last-child td { border-bottom: 0; }

.transfers-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; font-size: .86rem; font-weight: 700;
}
.pill {
  font-size: .74rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 3px 9px;
}
ol.transfers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
ol.transfers li {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 9px; font-size: .9rem;
}
.tn {
  flex: none; width: 19px; height: 19px; border-radius: 50%; font-size: .68rem;
  background: var(--bg-soft); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.tfrom, .tto { font-weight: 600; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarrow { color: var(--muted); }
.tamt { margin-left: auto; color: var(--accent); }

.note { margin-top: 12px; display: grid; gap: 4px; font-size: .76rem; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.result-actions.is-off { opacity: .55; }
.status { font-size: .78rem; color: var(--accent); min-height: 0; }
.status.is-on { margin-top: 8px; }

/* ------------------------------------------------------------------ share */
.share textarea {
  width: 100%; resize: vertical; font-family: var(--mono); font-size: .74rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 9px; color: var(--ink-2); word-break: break-all; min-height: 62px;
}
.share-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.banner {
  margin-top: 9px; font-size: .78rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 9px; padding: 7px 9px;
}

/* --------------------------------------------------------------- sections */
.sec { padding: 46px 20px 6px; }
.sec-head { max-width: 62ch; margin-bottom: 20px; }
.sec-eyebrow { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.sec-head h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin-top: 6px; text-wrap: balance; }
.sec-sub { margin-top: 8px; color: var(--muted); font-size: .96rem; }

.features { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px;
}
.badge-mini {
  display: inline-block; font-size: .66rem; letter-spacing: .1em; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 7px;
}
.feature h3 { font-size: .98rem; margin-top: 9px; }
.feature p { margin-top: 6px; font-size: .88rem; color: var(--muted); }

.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.step-no { font-size: .72rem; font-weight: 700; color: var(--accent); font-family: var(--mono); }
.step h3 { font-size: .98rem; margin-top: 6px; }
.step p { margin-top: 6px; font-size: .88rem; color: var(--muted); }

.table-wrap.wide { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; background: var(--panel); border-radius: 12px; overflow: hidden; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: var(--panel-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data code { color: var(--accent); }
.tbl-note { margin-top: 9px; font-size: .8rem; color: var(--muted); }

.prose { max-width: 70ch; display: grid; gap: 10px; color: var(--ink-2); font-size: .96rem; }
.formula {
  margin-top: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.formula-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .84rem; color: var(--muted); }
.formula-legend b { color: var(--ink); }

.faq { display: grid; gap: 8px; max-width: 76ch; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.faq summary::marker { color: var(--accent); }
.faq p { margin-top: 8px; font-size: .9rem; color: var(--muted); }

.limits { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.limit { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.limit h3 { font-size: .95rem; }
.limit p { margin-top: 6px; font-size: .87rem; color: var(--muted); }
.basis-box { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px; }
.basis-box h3 { font-size: .95rem; }
.basis-box ul { margin: 8px 0 0; padding-left: 18px; font-size: .87rem; color: var(--muted); display: grid; gap: 5px; }

/* ----------------------------------------------------------------- footer */
.site-foot { margin-top: 52px; border-top: 1px solid var(--line); background: var(--panel); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; padding-top: 26px; padding-bottom: 10px; }
.foot-brand { font-weight: 700; }
.foot-brand .opyeb { color: var(--muted); font-weight: 500; font-size: .8rem; letter-spacing: .1em; margin-left: 6px; }
.foot-note { margin-top: 6px; font-size: .82rem; color: var(--muted); max-width: 52ch; }
.operated { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.foot-right { font-size: .84rem; color: var(--muted); }
.foot-links a, .foot-langs a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover, .foot-langs a:hover { color: var(--accent); text-decoration: underline; }
.foot-langs { margin-top: 8px; }
.foot-langs span { color: var(--muted); }
.foot-legal { font-size: .76rem; color: var(--muted); padding: 10px 0 24px; border-top: 1px solid var(--line); margin-top: 10px; }

/* ------------------------------------------------------------ policy pages */
.page-wrap { padding-top: 34px; max-width: 780px; }
.page-wrap h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.updated { margin-top: 6px; font-size: .82rem; color: var(--muted); }
.page-wrap h2 { font-size: 1.05rem; margin-top: 26px; }
.page-wrap p { margin-top: 9px; color: var(--ink-2); font-size: .94rem; }
.page-wrap .intro { margin-top: 16px; font-size: 1rem; }
.contact-card { margin-top: 26px; }
.back { display: inline-block; margin: 18px 0 30px; font-size: .88rem; text-decoration: none; }

.not-found { text-align: center; padding-top: 60px; }
.page-wrap p.nf-code { font-size: 3.2rem; font-weight: 800; color: var(--accent); font-family: var(--mono); letter-spacing: .04em; }
.not-found h1 { margin-top: 6px; }
.not-found p { margin-top: 10px; color: var(--muted); }
.nf-langs { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 6px; justify-items: center; font-size: .9rem; }
.nf-langs a { text-decoration: none; }
.not-found .btn { margin-top: 6px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; order: -1; }
  .strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .strip .field:first-child { grid-column: 1 / -1; }
  .hero { padding-top: 30px; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .wrap { padding: 0 14px; }
  .sec { padding-left: 14px; padding-right: 14px; }
  .hero { padding: 26px 14px 18px; }
  .hero h1 { font-size: 1.62rem; }
  .brand-sub { display: none; }
  .head-inner { min-height: 56px; gap: 6px; flex-wrap: nowrap; }
  .brand { gap: 7px; }
  .mark { width: 29px; height: 29px; }
  .brand-name { font-size: .97rem; }
  .langs { flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .langs::-webkit-scrollbar { display: none; }
  .langs a { padding: 4px 5px; font-size: .72rem; }
  .icon-btn { width: 34px; height: 34px; flex: none; }
  .strip { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .exp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .exp-row .fld:first-child { grid-column: 1 / -1; }
  .rate-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .card { padding: 13px; border-radius: 14px; }
  .btn { padding: 9px 12px; }
  .result .total-line { font-size: 1.05rem; }
  .foot-grid { gap: 14px; }
}

@media (max-width: 520px) {
  .rate-list { grid-template-columns: minmax(0, 1fr); }
  .rate-in { flex: 0 1 90px; width: 90px; }
  .rate { padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  .site-head, .share, .result-actions, .rate-list, .add-person, #add-expense, .skip { display: none; }
  .cols { grid-template-columns: 1fr; }
}
