:root { --bg: #F6F7F5; --card: #fff; --ink: #14201E; --muted: #5E6B68; --line: #E1E6E3; --teal: #0F766E; --teal-2: #115E59; --soft: #E6F4F1; --warn: #B42318; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); }
.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
h1, h2 { margin: 0 0 12px; line-height: 1.2; } h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: flex; gap: 10px; align-items: center; } .brand small { display: block; color: var(--muted); font-size: .8rem; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--teal); position: relative; flex: none; }
.logo::before, .logo::after { content: ""; position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 2px; background: #fff; top: 11px; } .logo::after { top: 19px; right: 14px; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 999px; }
.tab { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 40px; }
.tab.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
main { padding: 20px 0; }
.panel-grid { display: grid; gap: 16px; } @media (min-width: 900px) { .panel-grid { grid-template-columns: 1.25fr 1fr; align-items: start; } .results { position: sticky; top: 84px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .88rem; color: var(--muted); }
input, select { font: inherit; color: var(--ink); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 10px; min-height: 42px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--soft); }
.row3 { display: grid; gap: 10px; grid-template-columns: 1fr 1.4fr .8fr; margin-bottom: 12px; } @media (max-width: 560px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 > :nth-child(2) { grid-column: 1 / -1; order: -1; } }
.total { font-size: 1rem; color: var(--ink); margin-bottom: 6px; }
.money-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding-left: 14px; background: #fff; }
.money-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--soft); }
.money-input span { font-size: 1.4rem; font-weight: 700; color: var(--muted); } .money-input input { border: 0; box-shadow: none; font-size: 1.6rem; font-weight: 700; min-height: 56px; }
.field-error { color: var(--warn); font-weight: 600; margin: 4px 0 0; }
.team-head { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.team-row { display: grid; grid-template-columns: 1.6fr 1.2fr .7fr .7fr 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.team-row.head { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
@media (max-width: 560px) {
  .team-row { grid-template-columns: 1.3fr .7fr .7fr 36px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .team-row [data-k="name"] { grid-column: 1 / -1; }
  .team-row.head { border: 0; padding: 0; } .team-row.head span:first-child { display: none; }
}
button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; border: 2px solid var(--teal); background: var(--teal); color: #fff; padding: 9px 18px; min-height: 42px; }
button:hover { background: var(--teal-2); border-color: var(--teal-2); }
button.ghost { background: transparent; color: var(--teal-2); border-color: var(--line); } button.ghost:hover { border-color: var(--teal); background: var(--soft); }
button.small { padding: 4px 12px; min-height: 34px; font-size: .88rem; }
button.icon { width: 36px; min-height: 36px; padding: 0; background: transparent; color: var(--muted); border-color: var(--line); font-size: 1.2rem; line-height: 1; } button.icon:hover { color: var(--warn); border-color: var(--warn); background: #fff; }
.hint { color: var(--muted); font-size: .88rem; margin: 10px 0 0; }
.shares { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.shares li { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.share-top { display: flex; justify-content: space-between; gap: 12px; } .amount { font-size: 1.25rem; font-weight: 800; color: var(--teal-2); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--soft); border-radius: 999px; margin: 6px 0; overflow: hidden; } .bar span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.shares small { color: var(--muted); font-variant-numeric: tabular-nums; }
.check { margin: 14px 0; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { color: var(--muted); } .warn { color: var(--warn); font-weight: 600; }
.quick { display: flex; gap: 6px; align-items: end; flex-wrap: wrap; }
.sum { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; } .sum th, .sum td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); } .sum th { font-size: .8rem; color: var(--muted); text-transform: uppercase; }
.sum td:last-child, .sum th:last-child { text-align: right; font-weight: 700; }
.history { list-style: none; padding: 0; margin: 0; } .history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); } .history small { display: block; color: var(--muted); }
.role-row { display: grid; grid-template-columns: 1fr 110px 36px; gap: 8px; margin-bottom: 8px; }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 32px; }
@media print { .top, .actions, #add-person, #use-last, .hint, .foot, button.icon { display: none !important; } .panel-grid { display: block; } .card { border: 0; } }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#roles { max-width: 560px; margin-top: 14px; }
