/* One stylesheet. No build step, no framework, no utility classes to learn.
   The palette is checked against WCAG 2.1 AA the same way the public site
   builder checks a coach's chosen colours. */

:root {
  --ink: #12161c;
  --paper: #f7f8fa;
  --card: #ffffff;
  --line: #d8dde5;
  --muted: #55606f;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --stop: #9f1239;
  --stop-bg: #ffe4e6;
  --ok: #14532d;
  --ok-bg: #dcfce7;
  --radius: .5rem;
  --radius-lg: 15px;
  --shadow-sm: 0 1px 3px rgba(16, 22, 32, .07), 0 1px 2px rgba(16, 22, 32, .04);
  --accent-2: #3b82f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf2; --paper: #10141a; --card: #171d26; --line: #2a323e;
    --muted: #9aa6b6; --accent: #7ea2ff; --accent-ink: #0b1020;
    --warn: #fcd34d; --warn-bg: #3b2f0b; --stop: #fda4af; --stop-bg: #3f1220;
    --ok: #86efac; --ok-bg: #0f2e1c;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
/* `hidden` must win over any display rule, or the sign-in screen sits above the app. */
[hidden] { display: none !important; }

body { margin: 0; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }
button { font: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--stop); }

/* --- sign in --- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.signin .card { width: min(24rem, 100%); }
form.card label { display: block; margin: .75rem 0; }
form.card input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }

/* --- chrome --- */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 6; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: .9rem; }
.menu { display: none; background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; padding: .3rem .6rem; cursor: pointer; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: .35rem; }

/* --- the left rail, generated from the module registry --- */
.shell { display: grid; grid-template-columns: 274px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 82rem; margin: 0 auto; padding: 14px 1rem 2rem; }
.shell.rail-collapsed { grid-template-columns: 1fr; }
.shell.rail-collapsed .rail { display: none; }
.shellmain { min-width: 0; }

.rail { position: sticky; top: 66px; align-self: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px; max-height: calc(100vh - 80px); overflow-y: auto; scrollbar-width: thin; }
.railtop { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.railhide { border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 8px; cursor: pointer; }
.railhide:hover { color: var(--ink); }
.railshow { display: none; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 700; padding: 8px 13px; border-radius: 10px; box-shadow: var(--shadow-sm); cursor: pointer; margin-bottom: 14px; }
.shell.rail-collapsed .railshow { display: inline-flex; }

.railsearch { position: relative; margin-bottom: 11px; }
.railsearch .mag { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; pointer-events: none; opacity: .8; }
.railsearch input { width: 100%; padding: .45rem .7rem .45rem 31px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: .55rem; background: var(--paper); color: var(--ink); }

.railgroup { margin-bottom: 2px; }
.railgh { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 7px; padding: 10px 8px 4px; cursor: pointer; }
.railgh .gl { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); opacity: .85; }
.railgh .cnt { font-size: 10px; font-weight: 700; color: var(--muted); opacity: .6; }
.railgh .cv { margin-left: auto; color: var(--muted); font-size: 9px; opacity: .7; transition: transform .18s; }
.railgroup.collapsed .cv { transform: rotate(-90deg); }
.railgroup.collapsed .railitems { display: none; }
.railitems { display: flex; flex-direction: column; gap: 1px; }

.ritem { position: relative; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 7px 9px; display: flex; align-items: center; gap: 10px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; text-decoration: none; transition: background .12s; }
.ritem:hover { background: var(--paper); }
.ritem .ic { width: 26px; height: 26px; border-radius: 7px; background: var(--paper); display: grid; place-items: center; font-size: 14px; flex: none; transition: background .12s; }
.ritem .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ritem .badge { flex: none; font-size: 10.5px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 1px 7px; }
.ritem[aria-current="page"] { background: color-mix(in srgb, var(--accent) 13%, var(--card)); }
.ritem[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: var(--accent); border-radius: 0 3px 3px 0; }
.ritem[aria-current="page"] .ic { background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.ritem[aria-current="page"] .lbl { color: color-mix(in srgb, var(--accent) 55%, var(--ink)); font-weight: 750; }
.railnone { padding: 16px 10px; text-align: center; color: var(--muted); font-size: 13px; }

main { padding: 0; max-width: none; margin: 0; }
main:focus { outline: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding-top: 10px; }
  .rail { position: static; max-height: none; }
  .shell:not(.rail-open) .rail { display: none; }
  .shell:not(.rail-open) .railshow { display: none; }
  .menu { display: inline-block; }
}

button.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); box-shadow: var(--shadow-sm); color: var(--accent-ink); border: 0; padding: .5rem .9rem; border-radius: var(--radius); cursor: pointer; }
button.quiet { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: .4rem .75rem; border-radius: var(--radius); cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a.button { display: block; text-align: center; text-decoration: none; font-weight: 600; padding: .6rem .9rem; border-radius: var(--radius);
  background: var(--card); color: var(--ink); border: 1px solid var(--line); }
a.button.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); color: var(--accent-ink); border: 0; box-shadow: var(--shadow-sm); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- the counters at the top of the inbox --- */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; text-align: left; cursor: pointer; }
.counter[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.counter .n { font-size: 1.9rem; font-weight: 650; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counter .l { color: var(--muted); font-size: .85rem; }
.counter.unknown .n { color: var(--warn); }
.counter.overdue .n { color: var(--stop); }

/* --- the handoff row: both halves, always --- */
.handoff { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .6rem; }
.handoff .title { font-weight: 600; }
.handoff .halves { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; margin: .6rem 0; }
.handoff .half { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; }
.handoff .half .who { display: block; font-size: .8rem; color: var(--muted); }
.handoff .arrow { color: var(--muted); }
.handoff .foot { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.handoff .closes { font-style: italic; }
.handoff.is-unknown { border-left: 4px solid var(--warn); }
.handoff.is-overdue { border-left: 4px solid var(--stop); }

.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; border: 1px solid transparent; }
.pill.done { background: var(--ok-bg); color: var(--ok); }
.pill.unknown { background: var(--warn-bg); color: var(--warn); }
.pill.open { background: var(--paper); color: var(--muted); border-color: var(--line); }
.pill.stop { background: var(--stop-bg); color: var(--stop); }

.caution { background: var(--warn-bg); color: var(--warn); padding: .5rem .7rem; border-radius: var(--radius); font-size: .85rem; margin: .5rem 0 0; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); }
th { background: color-mix(in srgb, var(--ink) 4%, var(--card)); font-size: .85rem; }
tr:last-child td { border-bottom: 0; }

.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }

.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* --- the calendar --- */
.calbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.navbtn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; width: 2rem; height: 2rem; cursor: pointer; }
.period { font-weight: 650; min-width: 11rem; }

.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.month + .month { margin-top: 1rem; }
.month h2 { margin: 0; padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: 1rem; }
.monthgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.monthgrid .dow { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .35rem .5rem; text-align: center; border-bottom: 1px solid var(--line); }
.monthgrid .day { min-height: 5.5rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem .35rem; }
.monthgrid .day:nth-child(7n+7) { border-right: 0; }
.monthgrid .day.other { background: color-mix(in srgb, var(--ink) 3%, var(--card)); }
.monthgrid .day.today .dnum { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 .35rem; }
.monthgrid .dnum { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev { display: block; width: 100%; text-align: left; font: inherit; font-size: .74rem; line-height: 1.25; border: 0; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--ink); border-radius: 4px; padding: .1rem .25rem; margin-top: .15rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.competition { border-left-color: var(--stop); background: var(--stop-bg); color: var(--stop); }
.ev.trip { border-left-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.ev.cancelled { text-decoration: line-through; opacity: .55; }
.dtrow { display: flex; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.dtrow .wd { flex: 0 0 2.5rem; font-weight: 700; font-size: .85rem; }
.wdays { display: flex; gap: .3rem; flex-wrap: wrap; }
.wdays label { border: 1px solid var(--line); border-radius: 8px; padding: .25rem .5rem; cursor: pointer; font-size: .85rem; }
.wdays input { margin-right: .25rem; }

/* Some depth on the surfaces that carry the brand, not everywhere. */
.card { box-shadow: var(--shadow-sm); border-radius: var(--radius-lg); }
.counter { box-shadow: var(--shadow-sm); border-radius: 12px; }
.handoff { border-radius: 12px; box-shadow: var(--shadow-sm); }

/* --- the Financial Hub: money, tables that sort, and one form dialog --- */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num, th.num { text-align: right; }
.neg { color: var(--stop); }
.pos { color: var(--ok); }
.kind-in { color: var(--ok); font-weight: 600; }
.kind-out { color: var(--ink); }
.counter .n.money { font-size: 1.45rem; }
.counter .sub { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; }
/* The roll: the name toggles the state, the small button beside it sets times. */
.markcell { display: flex; flex-direction: column; gap: .25rem; }
.markcell .mark { width: 100%; }
.markcell [data-times] { align-self: flex-end; }
#waiting { margin-bottom: 1rem; }

.meter { display: inline-block; vertical-align: middle; width: 5.5rem; height: .5rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; margin-right: .35rem; }
.meter > span { display: block; height: 100%; background: var(--ok); }
.meter.near > span { background: var(--warn); }
.meter.over > span { background: var(--stop); }
.hbar { display: inline-block; height: .55rem; border-radius: 3px; background: color-mix(in srgb, var(--accent) 55%, var(--card)); vertical-align: middle; }
.hbar.out { background: color-mix(in srgb, var(--stop) 45%, var(--card)); }

.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input:not([type=checkbox]) { font: inherit; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin: 1.4rem 0 .5rem; }
.section-h h2 { margin: 0; }

.tabletools { display: flex; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.tabletools input { flex: 1; max-width: 22rem; font: inherit; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.tablewrap { overflow-x: auto; border-radius: var(--radius); }
table.data th { padding: .5rem .7rem; }
table.data th:has(.sorter) { padding: 0; }
table.data .sorter { width: 100%; border: 0; background: transparent; font: inherit; font-weight: 650; color: inherit; text-align: inherit; padding: .5rem .7rem; cursor: pointer; }
table.data th.num .sorter { text-align: right; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
table.data tr.planned td { color: var(--muted); font-style: italic; }
table.data tr.void td { text-decoration: line-through; opacity: .6; }
.pager { margin-top: .5rem; }

dialog.formdlg { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); color: var(--ink); padding: 1.1rem 1.25rem; width: min(40rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: 0 12px 48px rgba(0,0,0,.25); }
dialog.formdlg::backdrop { background: rgba(10, 14, 20, .45); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin: .75rem 0; }
.fld { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; }
.fld.wide, .check.wide { grid-column: 1 / -1; }
.fld .lbl { font-weight: 600; }
.fld input, .fld select, .fld textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); width: 100%; box-sizing: border-box; }
.fld input[type=file] { padding: .3rem; }
.moneyin { display: flex; align-items: center; gap: .3rem; }
.moneyin input { text-align: right; font-variant-numeric: tabular-nums; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.check { display: flex; gap: .45rem; align-items: flex-start; font-size: .9rem; }
.check .hint { display: block; }
.dlgbar { margin-top: .5rem; }
.dlgbar .spacer { flex: 1; }
button.danger { color: var(--stop); border-color: color-mix(in srgb, var(--stop) 40%, var(--line)); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.statusline { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.receipt { border: 1px dashed var(--line); border-radius: var(--radius); padding: .6rem .75rem; margin: .5rem 0; }
.lineitems { display: grid; grid-template-columns: minmax(0, 2fr) 6rem minmax(0, 1.4fr) 7rem 2rem; gap: .35rem; align-items: center; }
.lineitems input, .lineitems select { font: inherit; padding: .35rem .45rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); width: 100%; box-sizing: border-box; }
.benefits label { display: block; font-size: .9rem; margin: .15rem 0; }

@media (max-width: 40rem) {
  .fields { grid-template-columns: 1fr; }
  .lineitems { grid-template-columns: 1fr 1fr; }
  .counter .n.money { font-size: 1.2rem; }
}

/* Printing the books: a treasurer's report on paper, no chrome. */
@media print {
  .tabletools, .pager, .toolbar, .noprint, dialog, .toast { display: none !important; }
  .grid { display: block; }
  .grid > * { margin-bottom: 1rem; }
  .num, .neg { color: #000 !important; }
  .meter, .hbar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-section { break-inside: avoid; }
  table.data { font-size: 10.5pt; }
}

/* Printing the season. Volunteers do it. */
@media print {
  .topbar, .rail, .railshow, .calbar, .noprint { display: none !important; }
  .shell { display: block; padding: 0; }
  body { background: #fff; }
  .card, .handoff, table, .month { box-shadow: none; }
  /* A season printed for a noticeboard: months unbroken, colour that survives
     a monochrome printer. */
  .month { break-inside: avoid; border-color: #999; }
  .ev { border-left-color: #333 !important; background: #f2f2f2 !important; color: #000 !important; white-space: normal; }
  .monthgrid .day { min-height: 4.2rem; border-color: #bbb; }
}

@media (max-width: 40rem) {
  .handoff .halves { grid-template-columns: 1fr; }
  .handoff .arrow { display: none; }
}
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }

/* A wide money table on a phone scrolls inside itself; the page never does. */
@media (max-width: 40rem) {
  table.data, .card > table { display: block; overflow-x: auto; max-width: 100%; }
  /* Already inside a scrolling wrapper: stay a table, so a narrow one still fills the width. */
  .tablewrap > table.data { display: table; }
  .toolbar label { flex: 1 1 100%; }
  .toolbar select { max-width: 100%; }
  .seg { flex-wrap: wrap; }
  .hide-sm { display: none; }
}

/* --- the dashboard: every section as a tile, as the original TeamConvene opened ---
   Ported from the original's dashboard. The team's accent (already checked
   against AA by the server) stands in for the original's two brand colours. */
:root {
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --tc: var(--brand);
  --tc2: color-mix(in srgb, var(--brand) 72%, #000);
  --tcgrad: linear-gradient(135deg, var(--tc), var(--tc2));
  --tc-wash: color-mix(in srgb, var(--accent) 10%, var(--card));
  --tc-line: color-mix(in srgb, var(--accent) 28%, var(--line));
  --tc-ink: color-mix(in srgb, var(--accent) 64%, var(--ink));
  --cond: "Oswald", "Bebas Neue", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --shadow: 0 10px 30px rgba(16, 22, 32, .10);
}
@media (prefers-color-scheme: dark) {
  :root { --tc-wash: color-mix(in srgb, var(--accent) 18%, var(--card)); --tc-ink: var(--accent); --shadow: 0 10px 30px rgba(0, 0, 0, .45); }
}

a.brandlink { color: var(--ink); font-weight: 800; text-decoration: none; }
a.brandlink:hover { color: var(--accent); }
.railtop { justify-content: space-between; align-items: center; gap: 6px; }
.railhome { font-size: 12.5px; font-weight: 700; color: var(--tc-ink); text-decoration: none; padding: 4px 6px; border-radius: 8px; }
.railhome:hover { background: var(--tc-wash); }
.shell.on-home { grid-template-columns: minmax(0, 1fr); }
.shell.on-home .rail, .shell.on-home .railshow { display: none !important; }

.tcshell { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 20px; align-items: start; }
.tcside { position: sticky; top: 66px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 11px 9px; box-shadow: var(--shadow-sm); }
.tcnav { display: flex; flex-direction: column; gap: 2px; }
.tcnav .nl { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; background: transparent; white-space: nowrap; text-align: left; }
.tcnav .nl .e { font-size: 16px; width: 20px; text-align: center; flex: none; }
.tcnav .nl.on { background: var(--tc-wash); color: var(--tc-ink); }
.tcnav .nl:hover:not(.on) { background: var(--paper); }
.tcmain { min-width: 0; }

.tchero { background: var(--tcgrad); color: var(--brand-ink); border-radius: 16px; padding: 20px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.tchero .tbadge { width: 56px; height: 56px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 29px; background: rgba(255, 255, 255, .18); }
.tchero h1 { margin: 0; font-family: var(--cond); text-transform: uppercase; letter-spacing: .01em; font-size: 30px; line-height: 1; }
.tchero .sub { margin: 4px 0 0; opacity: .93; font-size: 14px; }

.tcsplit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; margin-top: 16px; align-items: start; }
.tcsec-h { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; }
.tcsec-h .t { font-family: var(--cond); text-transform: uppercase; letter-spacing: .03em; font-size: 16px; font-weight: 700; }
.tcsec-h .rule { flex: 1; height: 2px; border-radius: 2px; background: var(--tcgrad); opacity: .5; }

.tctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 14px; margin: 0 0 18px; }
.tctile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 16px; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.tctile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--tc-line); }
.tctile .ic { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--tcgrad); margin-bottom: 11px; box-shadow: 0 4px 11px color-mix(in srgb, var(--tc) 34%, transparent); }
@media (prefers-reduced-motion: no-preference) { .tctile:hover .ic { animation: tcpop .5s ease; } }
@keyframes tcpop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.09) rotate(-4deg); } }
.tctile h3 { margin: 0 0 4px; font-family: var(--cond); text-transform: uppercase; letter-spacing: .01em; font-size: 16px; font-weight: 700; line-height: 1.1; }
.tctile p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tctile .tag { display: inline-block; margin-top: 11px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.tctile .tag.warn { background: var(--warn-bg); color: var(--warn); }

.tcboard { min-width: 0; }
.boardhead { display: flex; align-items: center; gap: 9px; margin: 0 2px 12px; }
.boardhead .t { font-family: var(--cond); text-transform: uppercase; letter-spacing: .03em; font-size: 16px; font-weight: 700; flex: 1; }
.boardempty { padding: 4px 2px 12px; }
.boardcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.boardcard .cdlabel { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.boardcard .cdbig { background: var(--tcgrad); color: var(--brand-ink); border-radius: 11px; padding: 12px; text-align: center; margin-top: 9px; }
.boardcard .cdbig .n { font-family: var(--cond); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 700; line-height: 1; }
.boardcard .cdbig .lbl { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; opacity: .92; margin-top: 3px; }
.boardcard .cdmeta { display: flex; gap: 8px; align-items: center; margin-top: 9px; min-height: 20px; }
.boardcard .cdmeta a { font-size: 12.5px; font-weight: 700; color: var(--tc-ink); text-decoration: none; }
.boardcard .cdedit { margin-left: auto; display: none; gap: 6px; }
.tcboard.editing .cdedit { display: inline-flex; }
.iconbtn { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; padding: 4px 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.iconbtn:hover { border-color: var(--tc); color: var(--tc-ink); }
.boardadds { display: flex; flex-direction: column; gap: 8px; }
.boardadd { width: 100%; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); border-radius: 12px; padding: 11px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.boardadd:hover { border-color: var(--tc); color: var(--tc-ink); }
.boardform { background: var(--card); border: 1px solid var(--tc-line); border-radius: 12px; padding: 13px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.boardform label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 9px; }
.boardform input, .boardform select { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13.5px; background: var(--paper); color: var(--ink); }
.wlist { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.witem { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.witem:first-child { border-top: 0; padding-top: 2px; }
.witem .wt { font-weight: 600; font-size: 13px; line-height: 1.3; }
.witem .wd { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.witem .evchip { flex: none; width: 40px; text-align: center; background: var(--tc-wash); border: 1px solid var(--tc-line); border-radius: 9px; padding: 4px 0; }
.witem .evchip .m { display: block; font-size: 9.5px; font-weight: 800; text-transform: uppercase; color: var(--tc-ink); letter-spacing: .03em; }
.witem .evchip .d { display: block; font-size: 16px; font-weight: 800; line-height: 1; }
.wempty { color: var(--muted); font-size: 12.5px; padding: 4px 0; }

@media (max-width: 1040px) { .tcsplit { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .tcshell { grid-template-columns: minmax(0, 1fr); }
  .tcside { position: static; }
  .tcnav { flex-direction: row; overflow-x: auto; }
}
/* A phone: exactly two tiles across, inside the viewport, copy trimmed to two lines. */
@media (max-width: 520px) {
  .tctiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tctile { padding: 12px; border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
  .tctile .ic { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; margin-bottom: 8px; }
  .tctile h3 { font-size: 14px; }
  .tctile p { font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tctile .tag { margin-top: 8px; }
  .tchero { padding: 16px 18px; }
  .tchero h1 { font-size: 23px; overflow-wrap: anywhere; }
}
@media print { .tcside, .tcboard { display: none !important; } }
