/* ============ Compte à Deux — ambiance chaleureuse ============ */
:root {
  --bg: #fbf3e8;
  --bg-2: #f5e6d3;
  --card: #fffaf4;
  --ink: #3b2a22;
  --muted: #8b7163;
  --line: #eedccb;
  --accent: #d4683f;
  --accent-ink: #fff;
  --accent-soft: #f9dfd0;
  --honey: #e9a23b;
  --pos: #4f8a4f;
  --neg: #c4566a;
  --shadow: 0 1px 2px rgba(120, 72, 40, .06), 0 8px 28px rgba(120, 72, 40, .09);
  --radius: 20px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1613; --bg-2: #271d18; --card: #2a201b; --ink: #f4e7db; --muted: #b9a293;
    --line: #3e3029; --accent: #e8825a; --accent-soft: #4a2d21; --pos: #8cc28c; --neg: #ec8a9b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.5; font-size: 16px;
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--honey) 16%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 90px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 1.2rem; }
h1 em, .brand em { font-style: italic; color: var(--accent); }
a { color: inherit; }
.muted { color: var(--muted); }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
small { font-size: .82em; }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 1.2rem 16px 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-2.tight { gap: .75rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem;
}
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + section, .stats + .grid-2 { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.intro { margin-top: -.4rem; }
.narrow { max-width: 460px; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: .7rem 16px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; text-decoration: none; white-space: nowrap; }
.brand-heart { display: inline-block; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 10% { transform: scale(1.18); } 20% { transform: scale(1); } }
.mainnav { display: flex; gap: .25rem; margin: 0 auto; }
.mainnav a { text-decoration: none; padding: .45rem .85rem; border-radius: 999px; font-weight: 700; color: var(--muted); transition: .15s; }
.mainnav a:hover { color: var(--ink); background: var(--bg-2); }
.mainnav a.on { color: var(--accent-ink); background: var(--accent); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; min-width: 220px; display: flex; flex-direction: column;
}
.usermenu-panel a, .usermenu-panel button {
  text-align: left; padding: .6rem .8rem; border-radius: 10px; text-decoration: none; background: none; border: 0;
  font: inherit; color: inherit; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--bg-2); }

/* ---------- bottom nav (mobile) ---------- */
.bottomnav { display: none; }
.fab {
  position: fixed; right: 22px; bottom: 26px; width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--honey)); color: #fff; font-size: 2rem; line-height: 60px;
  text-align: center; text-decoration: none; box-shadow: 0 10px 24px rgba(212, 104, 63, .45); z-index: 30; transition: transform .15s;
}
.fab:hover { transform: scale(1.07) rotate(90deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent;
  border-radius: 999px; padding: .65rem 1.2rem; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none;
  transition: transform .1s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-soft { background: var(--accent-soft); color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--neg) 50%, transparent); color: var(--neg); }
.btn-sm { padding: .4rem .85rem; font-size: .9rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: .35rem; border-radius: 8px; text-decoration: none; opacity: .55; transition: .15s; }
.icon-btn:hover { opacity: 1; background: var(--bg-2); }
.link { color: var(--accent); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- forms ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  padding: .65rem .85rem; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type="color"] { padding: .2rem; height: 46px; cursor: pointer; }
input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--accent); box-shadow: none; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field-label { font-weight: 800; font-size: .9rem; }
.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; margin: 0; }
.input-icon { position: relative; display: block; }
.input-icon > span { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; pointer-events: none; transition: transform .2s; }
.input-icon > span.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: translateY(-50%) scale(1.35); } }
.input-icon input { padding-left: 2.6rem; }
.amount-input { font-size: 1.3rem; font-weight: 800; font-family: var(--serif); }
.form-card { max-width: 760px; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
fieldset.person { border: 1.5px dashed var(--line); border-radius: 16px; padding: 1rem; margin: 0; display: flex; flex-direction: column; gap: .8rem; }
fieldset.person legend { font-weight: 800; padding: 0 .4rem; }
.more-options { border-top: 1px dashed var(--line); padding-top: .8rem; }
.more-options summary { cursor: pointer; font-weight: 800; color: var(--accent); margin-bottom: .8rem; }
.more-options[open] { display: flex; flex-direction: column; gap: 1rem; }
.danger-zone { max-width: 760px; display: flex; justify-content: flex-end; }

/* segmented radio */
.seg { display: flex; gap: .4rem; background: var(--bg-2); padding: .3rem; border-radius: 16px; }
.seg-wrap { flex-wrap: wrap; }
.seg-item { flex: 1; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span {
  display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .8rem; border-radius: 12px;
  font-weight: 700; color: var(--muted); transition: .15s; text-align: center; white-space: nowrap;
}
.seg-item input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(120, 72, 40, .12); }
.seg-item[style] input:checked + span { outline: 2px solid var(--c); outline-offset: -2px; }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); }
.seg-kind .seg-item span { padding: .75rem; font-size: 1.02rem; }

/* custom split */
.custom-share { margin-top: .6rem; padding: .8rem 1rem; border-radius: 14px; background: var(--bg-2); display: flex; flex-direction: column; gap: .5rem; }
.custom-share label { font-weight: 700; display: flex; flex-direction: column; gap: .3rem; }
.custom-share-values { display: flex; justify-content: space-between; font-weight: 800; gap: 1rem; align-items: center; }
.custom-share-values input { width: 5.2rem; display: inline-block; padding: .3rem .5rem; }

/* category chips */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .45rem; }
.cat-chip { cursor: pointer; }
.cat-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cat-chip span {
  display: flex; align-items: center; gap: .45rem; padding: .5rem .65rem; border-radius: 12px; border: 1.5px solid var(--line);
  font-size: .88rem; font-weight: 700; transition: .12s; background: var(--bg); height: 100%;
}
.cat-chip span b { font-size: 1.1rem; }
.cat-chip span small { color: var(--muted); font-weight: 600; }
.cat-chip:hover span { border-color: var(--c, var(--accent)); }
.cat-chip input:checked + span { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--card)); }
.cat-auto { grid-column: span 2; }

/* ---------- flashes ---------- */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .8rem 1rem; border-radius: 14px; font-weight: 700; border: 1px solid var(--line); background: var(--card); animation: slide .3s ease; }
.flash-success { border-color: color-mix(in srgb, var(--pos) 40%, transparent); background: color-mix(in srgb, var(--pos) 12%, var(--card)); }
.flash-error { border-color: color-mix(in srgb, var(--neg) 45%, transparent); background: color-mix(in srgb, var(--neg) 12%, var(--card)); }
.flash-info { background: color-mix(in srgb, var(--honey) 14%, var(--card)); }
@keyframes slide { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- avatars & bubbles ---------- */
.avatar {
  --c: var(--accent); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 800; font-size: .95rem; flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent);
}
.avatar.sm { width: 24px; height: 24px; font-size: .72rem; box-shadow: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.3rem; }
.bubble {
  --c: var(--accent); display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: color-mix(in srgb, var(--c) 20%, var(--card)); font-size: 1.35rem;
}
.bubble.sm { width: 34px; height: 34px; font-size: 1.05rem; border-radius: 11px; }
.bubble.lg { width: 54px; height: 54px; font-size: 1.6rem; border-radius: 16px; }
.tag { font-size: .72rem; font-weight: 800; padding: .1rem .45rem; border-radius: 999px; background: var(--bg-2); color: var(--muted); vertical-align: middle; }

/* ---------- dashboard ---------- */
.hello { margin: .3rem 0 1rem; }
.hello h1 { margin-bottom: .1rem; }
.wave { display: inline-block; animation: steam 3s ease-in-out infinite; }
@keyframes steam { 50% { transform: translateY(-3px) rotate(-6deg); } }
.balance-card {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--card)), color-mix(in srgb, var(--honey) 14%, var(--card)));
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.balance-card h2 { font-size: clamp(1.15rem, 3vw, 1.5rem); margin: 0; }
.balance-card.is-equal { background: linear-gradient(135deg, color-mix(in srgb, var(--pos) 14%, var(--card)), var(--card)); }
.balance-icon { font-size: 2.6rem; }
.balance-people { display: flex; align-items: center; gap: .5rem; }
.balance-people .arrow { font-size: 1.4rem; color: var(--muted); }
.balance-text { flex: 1; min-width: 220px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 800; color: var(--muted); margin: 0 0 .2rem; }
.amount-xl { font-size: 1.25em; color: var(--accent); white-space: nowrap; }
.settle-form { display: flex; gap: .5rem; }
.settle-form input { width: 8rem; font-weight: 800; text-align: right; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; margin: 0; position: relative; overflow: hidden; }
.stat[style]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.stat-label { font-size: .85rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.stat-value { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; }
.stat-sub { font-size: .85rem; color: var(--muted); }
.stat-sub.up { color: var(--neg); }
.stat-sub.down { color: var(--pos); }

/* donut */
.donut-wrap { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut-hole { width: 112px; height: 112px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-hole strong { font-family: var(--serif); font-size: 1.05rem; }
.donut-hole span { font-size: .75rem; color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: .35rem; }
.legend li { display: flex; align-items: center; gap: .45rem; font-size: .92rem; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.legend-val { margin-left: auto; font-weight: 700; white-space: nowrap; }
.legend-val small { color: var(--muted); font-weight: 600; margin-left: .25rem; }

.upcoming { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.upcoming li { display: flex; align-items: center; gap: .7rem; }
.up-label { flex: 1; font-weight: 700; display: flex; flex-direction: column; line-height: 1.25; }
.up-label small { color: var(--muted); font-weight: 600; }
.up-amount { font-weight: 800; }

/* ---------- operations ---------- */
.op-list { list-style: none; padding: 0; margin: 0; }
.op-list.card { padding: .35rem .8rem; }
.op { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.op:last-child { border-bottom: 0; }
.op-main { flex: 1; min-width: 0; }
.op-label { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.op-meta { font-size: .85rem; color: var(--muted); }
.op-amount { font-weight: 800; font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; }
.op-gain .op-amount { color: var(--pos); }
.op-remboursement .op-amount { color: var(--muted); }
.op-actions { display: flex; align-items: center; gap: .1rem; }
.op-actions form { margin: 0; }
.more { display: inline-block; margin-top: .6rem; }
.day-group { margin-bottom: .4rem; }
.day-title { font-family: var(--font); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem .3rem .4rem; }
.filters { display: flex; flex-direction: column; gap: .8rem; }
.filter-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filter-row input[type="search"] { flex: 2; min-width: 180px; }
.filter-row select { flex: 1; min-width: 140px; width: auto; }
.totals-bar { display: flex; gap: 1.2rem; flex-wrap: wrap; padding: 0 .3rem; color: var(--muted); font-size: .92rem; }
.totals-bar strong { color: var(--ink); }

.period-nav { display: inline-flex; align-items: center; gap: .5rem; }
.period-label { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; min-width: 9.5rem; text-align: center; }

/* ---------- charges ---------- */
.charge-list { list-style: none; padding: 0; margin: 0; }
.charge { display: flex; align-items: center; gap: 1rem; }
.charge.paused { opacity: .6; }
.charge-main { flex: 1; min-width: 0; }
.charge-title { font-weight: 800; font-size: 1.05rem; }
.charge-amount { text-align: right; display: flex; flex-direction: column; }
.charge-amount strong { font-family: var(--serif); font-size: 1.2rem; }
.charge-amount small { color: var(--muted); }

/* ---------- revenus ---------- */
.split-bar { display: flex; height: 40px; border-radius: 12px; overflow: hidden; margin: .5rem 0 .75rem; background: var(--bg-2); }
.split-bar > div { background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; min-width: 0; overflow: hidden; white-space: nowrap; transition: width .4s; }
.income-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.income-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.income-list li span:first-child { flex: 1; font-weight: 700; }
.income-amount { font-weight: 800; }
.income-list form { margin: 0; }
.inline-form { display: flex; gap: .4rem; }
.inline-form input[name="label"] { flex: 1.3; }
.inline-form input[name="amount"] { flex: 1; }
.accent-amount { font-family: var(--serif); font-size: 1.3rem; color: var(--c); }

/* ---------- récap ---------- */
.recap-user { border-top: 5px solid var(--c); }
.recap-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.recap-head h2 { margin: 0; font-size: 1.4rem; }
.recap-head p { margin: 0; }
.recap-lines { margin: 0 0 .8rem; }
.recap-lines > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.recap-lines dt { color: var(--muted); }
.recap-lines dd { margin: 0; font-weight: 800; white-space: nowrap; }
.recap-lines .strong dt { color: var(--ink); font-weight: 800; }
.recap-lines .strong dd { font-size: 1.1rem; }
.recap-lines .highlight { background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 10px; padding: .55rem .7rem; border: 0; margin-top: .4rem; }
.recap-lines .highlight dt { color: var(--ink); font-weight: 800; }
.effort { margin-bottom: .6rem; }
.effort-bar { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-bottom: .25rem; }
.effort-bar span { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.cat-bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.cat-bars li { display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto; align-items: center; gap: .6rem; font-size: .9rem; }
.cat-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.cat-bar span { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.cat-bar-val { font-weight: 800; white-space: nowrap; }
.months-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .4rem; height: 160px; align-items: end; }
.month-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; gap: .3rem; }
.month-bar { width: 100%; max-width: 42px; background: linear-gradient(to top, var(--accent), var(--honey)); border-radius: 8px 8px 4px 4px; transition: opacity .15s; }
.month-col:hover .month-bar { opacity: .75; }
.month-name { font-size: .75rem; font-weight: 800; color: var(--muted); }

/* ---------- auth ---------- */
body.auth { display: grid; place-items: center; padding: 1rem 0; }
body.auth .container { width: 100%; }
.auth-card { max-width: 420px; margin: 4vh auto; padding: 2rem; }
.auth-card.wide { max-width: 760px; }
.auth-hero { text-align: center; margin-bottom: 1.5rem; }
.auth-logo { font-size: 3.2rem; animation: beat 2.4s ease-in-out infinite; }

.empty-state { text-align: center; padding: 2rem 1rem; }
.big-emoji { font-size: 3rem; margin-bottom: .5rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .mainnav { display: none; }
  .usermenu { margin-left: auto; }
  .hide-sm { display: none; }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; justify-content: space-around;
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; font-size: .7rem; font-weight: 800; text-decoration: none; color: var(--muted); padding: .2rem .4rem; border-radius: 12px; }
  .bottomnav a span { font-size: 1.3rem; }
  .bottomnav a.on { color: var(--accent); background: var(--accent-soft); }
  .fab { bottom: calc(78px + env(safe-area-inset-bottom)); right: 16px; width: 54px; height: 54px; line-height: 54px; }
}
@media (max-width: 680px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.tight { grid-template-columns: 1fr 1fr; }
  .card { padding: 1rem; border-radius: 18px; }
  .stats { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-value { font-size: 1.3rem; }
  .stat-label { font-size: .78rem; }
  .settle-form { width: 100%; }
  .settle-form input { flex: 1; width: auto; }
  .donut-wrap { justify-content: center; }
  .op { gap: .6rem; }
  .op-actions .icon-btn { padding: .25rem; }
  .charge { flex-wrap: wrap; }
  .charge-main { flex-basis: calc(100% - 80px); }
  .charge-amount { text-align: left; flex: 1; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .cat-bars li { grid-template-columns: minmax(0, 8rem) 1fr auto; }
  .seg-item span { white-space: normal; }
  .period-label { min-width: 0; }
  .auth-card { padding: 1.4rem; }
}

/* ---------- invitation ---------- */
.invite-box { display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1rem; border-radius: 14px;
  background: color-mix(in srgb, var(--honey) 14%, var(--card)); border: 1.5px dashed color-mix(in srgb, var(--honey) 55%, var(--line)); margin-bottom: .8rem; }
.invite-box p { margin: 0; }
.copy-row { display: flex; gap: .5rem; }
.copy-row input { flex: 1; font-size: .85rem; min-width: 0; }
.reinvite { margin-bottom: .8rem; }
