:root {
  --paper: #EEF1F5;
  --surface: #FFFFFF;
  --ink: #15202C;
  --muted: #5B6878;
  --line: #D6DDE6;
  --court: #1D4F91;
  --court-ink: #FFFFFF;
  --court-soft: #E3ECF8;
  --board: #12243A;
  --board-ink: #F4F7FA;
  --board-muted: #9FB0C4;
  --yellow: #F2C230;
  --led-red: #FF6F61;
  --red: #B92D26;
  --red-soft: #FBE9E7;
  --paid: #1E7A4E;
  --paid-soft: #E1F2E8;
  --shadow: 0 1px 2px rgba(18, 36, 58, .06), 0 8px 24px rgba(18, 36, 58, .06);
  --sans: "Barlow", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1621; --surface: #162231; --ink: #E4EAF1; --muted: #95A3B3; --line: #2A3A4D;
    --court: #6EA2E8; --court-ink: #0E1621; --court-soft: #1B2F48;
    --board: #08111C; --board-ink: #F4F7FA; --board-muted: #8797AB;
    --red: #FF8A7E; --red-soft: #3A1F1E; --paid: #62D19D; --paid-soft: #15302A;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1621; --surface: #162231; --ink: #E4EAF1; --muted: #95A3B3; --line: #2A3A4D;
  --court: #6EA2E8; --court-ink: #0E1621; --court-soft: #1B2F48;
  --board: #08111C; --board-ink: #F4F7FA; --board-muted: #8797AB;
  --red: #FF8A7E; --red-soft: #3A1F1E; --paid: #62D19D; --paid-soft: #15302A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--court); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 64px; }

/* ---------- Scoreboard ---------- */
.board {
  position: relative;
  overflow: hidden;
  background: var(--board);
  color: var(--board-ink);
  border-radius: 0 0 18px 18px;
  padding: 18px 20px 20px;
  margin: 0 -16px;
}
@media (min-width: 900px) { .board { margin: 0; border-radius: 0 0 18px 18px; } }
.board .court-lines {
  position: absolute; inset: auto -40px -120px auto;
  width: 420px; height: 300px; opacity: .13; pointer-events: none;
}
.board-top {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.board h1 {
  margin: 0;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: .01em;
  line-height: 1;
}
.period {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 3px;
}
.period button {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--board-ink); cursor: pointer; font-size: 1.3rem; line-height: 1;
}
.period button:hover { background: rgba(255,255,255,.12); }
.period .month {
  min-width: 9.5em; text-align: center;
  font-family: var(--cond); font-weight: 600; font-size: 1.15rem;
}
.score {
  position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  margin-top: 18px; gap: 8px;
}
.score .side { display: flex; flex-direction: column; }
.score .side:first-child { align-items: flex-end; text-align: right; }
.score .val {
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(3rem, 13vw, 5.6rem); line-height: .9;
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(242, 194, 48, .25);
}
.score .side.unpaid .val { color: var(--led-red); text-shadow: 0 0 18px rgba(255, 111, 97, .25); }
.score .colon {
  font-family: var(--cond); font-weight: 700; font-size: clamp(3rem, 13vw, 5.6rem);
  line-height: .9; color: var(--board-muted); transform: translateY(-.04em);
}
.score .lbl { color: var(--board-muted); font-size: .95rem; margin-top: 6px; }
.board-foot {
  position: relative;
  margin: 14px 0 0; text-align: center; color: var(--board-muted); font-size: .95rem;
}
.board-foot strong { color: var(--board-ink); font-weight: 600; }

/* ---------- Status ---------- */
.status {
  margin: 14px 0 0; padding: 10px 14px; border-radius: 8px;
  background: var(--court-soft); color: var(--ink); font-size: .95rem;
}
.status.error { background: var(--red-soft); }
.status[hidden] { display: none; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px; margin: 18px 0 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  border: 0; background: none; cursor: pointer;
  padding: 10px 14px 12px;
  font-family: var(--cond); font-weight: 600; font-size: 1.15rem;
  color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
@media (max-width: 480px) { .tab { padding: 10px 9px 12px; font-size: 1.05rem; } }
.tab[aria-selected="true"] { color: var(--court); border-bottom-color: var(--court); }
.tab .count {
  display: inline-block; min-width: 1.5em; margin-left: 4px; padding: 0 6px;
  border-radius: 999px; background: var(--red-soft); color: var(--red);
  font-family: var(--sans); font-size: .8rem; font-weight: 600; line-height: 1.5; text-align: center;
}
.tab .count[hidden] { display: none; }

.panel[hidden] { display: none; }
.panel { padding-top: 20px; }

h2 {
  font-family: var(--cond); font-weight: 700; font-size: 1.45rem; line-height: 1.15;
  margin: 32px 0 10px;
}
.panel > h2:first-child, .sheet h2 { margin-top: 0; }
.hint { color: var(--muted); margin: 0 0 12px; max-width: 62ch; }

/* ---------- Form sheet ---------- */
.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(12, 1fr); }
.f { display: flex; flex-direction: column; gap: 4px; grid-column: span 12; min-width: 0; }
@media (min-width: 640px) {
  .f.w6 { grid-column: span 6; }
  .f.w4 { grid-column: span 4; }
  .f.w3 { grid-column: span 3; }
  .f.w8 { grid-column: span 8; }
  .f.w9 { grid-column: span 9; }
}
@media (max-width: 639px) {
  .f.m6 { grid-column: span 6; }
}
label.l { font-size: .9rem; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], select {
  width: 100%; min-height: 44px;
  padding: 9px 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  appearance: none; -webkit-appearance: none;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--court); box-shadow: 0 0 0 3px var(--court-soft); }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px;
}
input[type=number] { font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid transparent;
  background: var(--court); color: var(--court-ink);
  font-weight: 600; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--court); border-color: var(--line); }
.btn.ghost:hover { background: var(--court-soft); filter: none; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .92rem; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--court); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.iconbtn {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.iconbtn:hover { background: var(--paper); color: var(--ink); border-color: var(--line); }
.iconbtn.armed, .btn.armed {
  width: auto; padding: 0 10px; background: var(--red); color: #fff; border-color: var(--red); font-size: .88rem; font-weight: 600;
}
.iconbtn svg { width: 18px; height: 18px; }

.preview { color: var(--muted); font-size: .95rem; }
.preview strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.empty {
  padding: 22px 0; color: var(--muted);
}
.empty p { margin: 0 0 10px; }

/* Summary */
.sum-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: center;
  padding: 10px 2px;
}
.sum-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-row .meta { color: var(--muted); font-size: .9rem; text-align: right; white-space: nowrap; }
.sum-row .amt { font-family: var(--cond); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; text-align: right; min-width: 5.5em; }
@media (max-width: 560px) {
  .sum-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sum-row .name { grid-column: 1; grid-row: 1; }
  .sum-row .amt { grid-column: 2; grid-row: 1 / span 2; }
  .sum-row .meta { grid-column: 1; grid-row: 2; text-align: left; }
  .sum-row .bar { grid-row: 3; }
}
.bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--paper); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--court); border-radius: 2px; }
.bar i.part { background: linear-gradient(90deg, var(--court) var(--p, 0%), var(--led-red) var(--p, 0%)); }

/* Ledger */
.fine-row {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr) auto auto auto;
  gap: 2px 12px; align-items: center;
  padding: 10px 2px;
}
.fine-row .date { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .92rem; }
.fine-row .who { font-weight: 600; }
.fine-row .what { color: var(--muted); font-size: .95rem; }
.fine-row .note { color: var(--muted); font-size: .88rem; font-style: italic; }
.fine-row .amt { font-family: var(--cond); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: right; min-width: 4.8em; }
@media (max-width: 560px) {
  .fine-row { grid-template-columns: 3em minmax(0, 1fr) auto; }
  .fine-row .amt { grid-column: 3; grid-row: 1; }
  .fine-row .paytoggle { grid-column: 2; grid-row: 2; justify-self: start; }
  .fine-row .del { grid-column: 3; grid-row: 2; justify-self: end; }
}
.paytoggle {
  min-height: 32px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--red);
  font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.paytoggle::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.paytoggle[aria-pressed="true"] { color: var(--paid); background: var(--paid-soft); border-color: transparent; }
.paytoggle:hover { border-color: var(--muted); }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-head h2 { margin-bottom: 10px; }

/* Debts */
.debt { padding: 10px 2px; }
.debt-top { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 4px 14px; align-items: center; }
.debt-top .name { font-weight: 600; }
.debt-top .amt { font-family: var(--cond); font-weight: 700; font-size: 1.35rem; color: var(--red); font-variant-numeric: tabular-nums; text-align: right; }
.debt details { grid-column: 1 / -1; }
.debt summary { cursor: pointer; color: var(--muted); font-size: .9rem; width: fit-content; }
.debt ul { list-style: none; margin: 6px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.debt ul li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; padding: 2px 0; }
.debt ul li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.debt-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px 0; font-weight: 600; }
.debt-total span:last-child { font-family: var(--cond); font-size: 1.5rem; color: var(--red); }

/* Editable lists */
.item {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px 12px; align-items: center;
  padding: 8px 2px;
}
.item .main { min-width: 0; }
.item .name { font-weight: 600; overflow-wrap: anywhere; }
.item .sub { color: var(--muted); font-size: .9rem; }
.item .price { font-family: var(--cond); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.item .btns { display: flex; gap: 2px; }
.item.editing { grid-template-columns: 1fr; background: var(--court-soft); margin: 0 -10px; padding: 12px 10px; border-radius: 8px; }
.item.editing .grid { align-items: end; }
.jersey {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.2em; height: 1.9em; margin-right: 10px; padding: 0 6px;
  border-radius: 6px; background: var(--court-soft); color: var(--court);
  font-family: var(--cond); font-weight: 700; font-variant-numeric: tabular-nums;
}
.jersey.none { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  background: var(--board); color: var(--board-ink);
  padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); color: #fff; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Sisselogimine ---------- */
.board-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.authbtn {
  min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--board-ink);
  border: 1px solid rgba(255,255,255,.22); font-weight: 600; font-size: .92rem;
}
.authbtn:hover { background: rgba(255,255,255,.1); }
.role-note { color: var(--board-muted); font-size: .88rem; }

dialog.login {
  width: min(380px, calc(100% - 32px));
  border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
dialog.login::backdrop { background: rgba(8, 17, 28, .55); }
dialog.login h2 { margin-top: 0; }
.form-error { color: var(--red); font-size: .92rem; margin: 8px 0 0; min-height: 1.3em; }

.lockscreen { max-width: 420px; margin: 32px auto 0; }
.lockscreen .sheet h2 { margin-top: 0; }

.paid-badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; white-space: nowrap; color: var(--red);
}
.paid-badge::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.paid-badge.yes { color: var(--paid); background: var(--paid-soft); }
@media (max-width: 560px) {
  .fine-row .paid-badge { grid-column: 2; grid-row: 2; justify-self: start; }
}
a.btn { text-decoration: none; }
body:not(.can-edit) [data-edit-only] { display: none !important; }
body:not(.can-edit) .panel > [data-edit-only] + h2 { margin-top: 0; }

.board-top { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "title period auth"; }
.board-actions { display: contents; }
.board h1 { grid-area: title; }
.period { grid-area: period; }
.authbtn { grid-area: auth; justify-self: end; }
@media (max-width: 600px) {
  .board-top { grid-template-columns: 1fr auto; grid-template-areas: "title auth" "period period"; }
  .period { justify-self: start; }
}

/* ---------- Järjestamise lüliti ---------- */
.sortgroup { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sortlabel { color: var(--muted); font-size: .9rem; margin-right: 4px; }
.sortbtn {
  min-height: 34px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: .9rem; font-weight: 600;
}
.sortbtn:hover { border-color: var(--muted); color: var(--ink); }
.sortbtn[aria-pressed="true"] { background: var(--court-soft); border-color: transparent; color: var(--court); }

/* ---------- Reeglite väljad ---------- */
.withsuffix { display: flex; align-items: center; gap: 8px; }
.withsuffix input { max-width: 6em; }
.withsuffix span { color: var(--muted); font-size: .9rem; }
@media (min-width: 640px) { .f.w4 { grid-column: span 4; } }

/* ---------- Hilinemine ja ümardus ---------- */
.late-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--red-soft); color: var(--red); font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.was { color: var(--muted); text-decoration: line-through; font-size: .85rem; font-weight: 400; display: block; }
.rounded { color: var(--court); font-size: .85rem; font-weight: 600; display: block; }
.month-total {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px;
  padding: 12px 2px 0; font-weight: 600;
}
.month-total .sum { font-family: var(--cond); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.month-total .note { color: var(--muted); font-weight: 400; font-size: .9rem; }

/* ---------- Maksmata: kuude kaupa ---------- */
.debt > .monthlist { list-style: none; margin: 6px 0 2px; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.debt > .monthlist > .debt-month {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 14px; align-items: center;
  padding: 7px 0; font-size: 1rem;
}
.debt > .monthlist > .debt-month + .debt-month { border-top: 1px solid var(--line); }
.debt-month .mname { font-weight: 600; }
.debt-month .mamt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.debt-month > .mdetails { grid-column: 1 / -1; }
.debt-month > .mdetails > summary { cursor: pointer; color: var(--muted); font-size: .88rem; width: fit-content; }
.debt-month > .mdetails > ul { list-style: none; margin: 4px 0 0; padding: 0; border: 0; }
.debt-month > .mdetails > ul > li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--muted); padding: 1px 0; }
.debt-month > .mdetails > ul > li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) {
  .debt > .monthlist > .debt-month { grid-template-columns: minmax(0, 1fr) auto; }
  .debt-month .btn { grid-column: 2; grid-row: 2; justify-self: end; }
  .debt-month > .mdetails { grid-row: 3; }
}
.debt-month .mnote { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; }

/* ---------- Kuude ülevaade ---------- */
.ov-row {
  display: grid; align-items: center; gap: 6px 18px;
  grid-template-columns: minmax(0, 1.4fr) auto auto auto auto;
  padding: 12px 2px;
}
.ovname { font-family: var(--cond); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.ovsub { display: block; font-family: var(--sans); font-weight: 400; font-size: .85rem; color: var(--muted); }
.ovfig { display: flex; flex-direction: column; align-items: flex-end; min-width: 5.5em; }
.ovlabel { color: var(--muted); font-size: .78rem; }
.ovamt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ovamt.paid { color: var(--paid); }
.ovamt.owing { color: var(--red); }
.ov-row > .bar { grid-column: 1 / -1; }
.ov-row > .ovdetails { grid-column: 1 / -1; }
.ov-row > .ovdetails > summary { cursor: pointer; color: var(--muted); font-size: .88rem; width: fit-content; }
.ov-row > .ovdetails > ul { list-style: none; margin: 6px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.ov-row > .ovdetails > ul > li { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; padding: 2px 0; }
.ov-row > .ovdetails > ul > li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 620px) {
  .ov-row { grid-template-columns: repeat(3, 1fr); gap: 4px 10px; }
  .ovname { grid-column: 1 / -1; }
  .ovfig { align-items: flex-start; min-width: 0; }
  .ov-row > .ovopen { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
}
.duecard { margin-top: 20px; }
.duecard input[type=date], .duecard input[type=time] { max-width: 11em; }

/* ---------- Loos ---------- */
.drawstage {
  position: relative; overflow: hidden;
  background: var(--board); color: var(--board-ink);
  border-radius: 14px; padding: 26px 20px 24px; text-align: center;
}
.drawlabel { margin: 0; color: var(--board-muted); font-size: .95rem; }
.drawname {
  margin: 10px 0 4px; min-height: 1.1em;
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(2.1rem, 9vw, 3.6rem); line-height: 1.05;
  color: var(--yellow); text-shadow: 0 0 22px rgba(242, 194, 48, .22);
  overflow-wrap: anywhere;
}
.drawname.empty { color: var(--board-muted); text-shadow: none; }
.drawname.rolling { color: var(--board-ink); text-shadow: none; opacity: .75; }
.drawmeta { margin: 0 0 18px; color: var(--board-muted); font-size: .92rem; }
.btn.draw { background: var(--yellow); color: #1A1400; min-width: 10em; font-size: 1.05rem; min-height: 48px; }
.btn.draw:disabled { opacity: .6; }

.pool-row { display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: center; padding: 0; }
.pool-row label { display: contents; cursor: pointer; }
.pool-row input { width: 20px; height: 20px; margin: 12px 0; accent-color: var(--court); }
.pool-row .pname { padding: 12px 0; font-weight: 600; overflow-wrap: anywhere; }
.pool-row.off .pname { color: var(--muted); font-weight: 400; }
.pool-row .jersey { margin: 0; }

.hist-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; }
.hist-row .hname { font-weight: 600; }
.hist-row .hwhen { color: var(--muted); font-size: .88rem; white-space: nowrap; }
#avoidWrap { margin: 4px 0 14px; }
#poolList { margin-top: 0; }

/* ---------- Mängija oma vaade ---------- */
body.is-player [data-team-only],
/* Maksmata sakk on ainult haldajale */
body:not(.can-edit) #tab-debts { display: none !important; }

.mineblock { margin-bottom: 4px; }
.minecard {
  background: var(--board); color: var(--board-ink);
  border-radius: 14px; padding: 22px 20px; text-align: center;
}
.minelabel { margin: 0; color: var(--board-muted); font-size: .95rem; }
.mineamt {
  margin: 6px 0 4px;
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(2.4rem, 11vw, 3.8rem); line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--lamp-red);
}
.mineamt.clear { color: var(--lamp-green); }
.minemeta { margin: 0; color: var(--board-muted); font-size: .92rem; }
.mineblock .rows { margin-top: 2px; }

/* ---------- Isiklik link ---------- */
.item.withpanel { grid-template-areas: "main spacer btns" "panel panel panel"; }
.item.withpanel .main { grid-area: main; }
.item.withpanel .btns { grid-area: btns; }
.linkpanel {
  grid-area: panel; grid-column: 1 / -1;
  margin: 4px 0 10px; padding: 14px; border-radius: 10px;
  background: var(--court-soft);
}
.linkpanel .l { display: block; margin-bottom: 4px; }
.linkfield {
  width: 100%; min-height: 44px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font-family: var(--mono, ui-monospace, Consolas, monospace); font-size: .9rem;
}
.linkhint { margin: 10px 0 0; color: var(--muted); font-size: .88rem; }
.linkpanel .actions { margin-top: 10px; }
.iconbtn.on { color: var(--court); }
#mineMonths .debt-month {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 14px; padding: 10px 2px; align-items: center;
}
#mineMonths .mamt { justify-self: end; text-align: right; }
#mineMonths .mdetails { grid-column: 1 / -1; }
#mineMonths .mdetails > summary { cursor: pointer; color: var(--muted); font-size: .88rem; width: fit-content; }
#mineMonths .mdetails > ul { list-style: none; margin: 4px 0 0; padding: 0; }
#mineMonths .mdetails > ul > li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--muted); padding: 1px 0; }
#mineMonths .mdetails > ul > li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
#mineMonths .debt-month + .debt-month { border-top: 1px solid var(--line); }

/* ---------- Isiklik kaart jagatud vaates ---------- */
.minepick { padding: 12px 2px 14px; }
.minepick .pickrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.minepick select { max-width: 18em; }
.minecard { position: relative; }
.minechange {
  display: block; margin: 14px auto 0;
  min-height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: var(--board-ink); font-size: .85rem; font-weight: 600;
}
.minechange:hover { background: rgba(255,255,255,.16); }
@media (min-width: 620px) {
  .minechange { position: absolute; top: 14px; right: 14px; margin: 0; }
  .minecard .minelabel { padding: 0 92px; }
}
