/* The All Areas look (docs/design/direction.md): simple and familiar, light or dark with the device, Patch green.
   Patch sheets (.sheet) stay black on white paper either way. */
:root {
  --bg: #F4F5F7; --panel: #FFFFFF; --panel-2: #F0F2F4; --line: #D9DCE1;
  --text: #1D2125; --muted: #5A6068;
  --accent: #1E7A47; --accent-ink: #FFFFFF;
  --amber: #7A5100; --red: #B4231B; --green: #1B6E3A; --teal: #087C88;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121417; --panel: #1B1E22; --panel-2: #22262B; --line: #2E3338;
  --text: #E8EAED; --muted: #A7ADB5;
  --accent: #5CC48A; --accent-ink: #0B2416;
  --amber: #F0C25A; --red: #F38B82; --green: #6BCB8B; --teal: #4CC3CF;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #121417; --panel: #1B1E22; --panel-2: #22262B; --line: #2E3338;
  --text: #E8EAED; --muted: #A7ADB5;
  --accent: #5CC48A; --accent-ink: #0B2416;
  --amber: #F0C25A; --red: #F38B82; --green: #6BCB8B; --teal: #4CC3CF;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--text); }
p { margin: .25rem 0 .75rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden, [hidden] { display: none !important; }

/* ---------- top bar & tabs ---------- */

.top { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; }
.top h1.brand { margin: 0; }
.logo { display: inline-block; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: .1rem .5rem; margin-right: .35rem; font-family: "Saira Stencil One", "Arial Narrow", Impact, sans-serif; font-weight: 400; letter-spacing: .03em; vertical-align: .05em; }
.fest-picker { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; flex: 1; }
.fest-picker select { min-width: 12rem; }
.tabs { display: flex; gap: .25rem; padding: .5rem 1rem 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .6rem .9rem; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 500; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
main { padding: 1.25rem 1rem 4rem; max-width: 1400px; margin: 0 auto; }

/* ---------- controls ---------- */
a.button { text-decoration: none; }
button, .button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 7px; padding: .45rem .8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
button:disabled { opacity: .5; cursor: default; }
button.ghost, .button.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover, .button.ghost:hover { border-color: var(--accent); }
button.danger { color: var(--red); }
button.small { padding: .2rem .5rem; font-size: .85rem; }
button.icon { background: none; color: var(--muted); border: 0; padding: .2rem .4rem; }
button.icon:hover { color: var(--red); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .5rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=number] { width: 5rem; }
input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
textarea { width: 100%; min-height: 6rem; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .85rem; }
label.field input, label.field select { color: var(--text); }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row.center { align-items: center; }
label.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
label.check input { margin-top: .15rem; flex: none; }
.spacer { flex: 1; }

/* ---------- layout ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; min-width: 0; }
.card.tight { padding: .75rem; }
.stats { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; min-width: 8rem; }
.stat b { display: block; font-size: 1.4rem; font-family: var(--mono); }
.stat span { color: var(--muted); font-size: .8rem; }
.stat.bad b { color: var(--red); }
.stat.warn b { color: var(--amber); }
.stat.good b { color: var(--green); }
.note { background: var(--panel-2); border-left: 3px solid var(--accent); padding: .6rem .8rem; border-radius: 6px; margin: .5rem 0 1rem; color: var(--muted); }
.note.warn { border-color: var(--amber); }
.note.bad { border-color: var(--red); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .35rem .45rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td.num, th.num { text-align: right; font-family: var(--mono); }
td.ch { font-family: var(--mono); font-weight: 600; color: var(--accent); width: 3rem; }
table.edit td { padding: .15rem .2rem; }
table.edit.wide { min-width: 1150px; }
table.edit input:not([type=checkbox]), table.edit select { width: 100%; padding: .3rem .35rem; background: transparent; border-color: transparent; }
table.edit input:hover, table.edit select:hover { border-color: var(--line); }
table.edit td.w-ch { width: 4rem; }
table.edit td.w-ch input { font-family: var(--mono); }
tr.drag-over td { border-top: 2px solid var(--accent); }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.pill.sub { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.pill.short { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.pill.band { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, transparent); }
.pill.guest { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pill.busy { color: var(--accent); }

/* ---------- bands list ---------- */
.band-list { display: flex; flex-direction: column; gap: .4rem; }
.band-row { display: grid; grid-template-columns: 2.2rem 4.2rem 1fr auto auto auto auto; gap: .6rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.band-row.sel { border-color: var(--accent); }
.band-row .order { display: flex; flex-direction: column; }
.band-row .order button { padding: 0 .3rem; line-height: 1; }
.band-row .name { font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-row .time { font-family: var(--mono); color: var(--muted); }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.toggle button { border-radius: 0; background: transparent; color: var(--muted); font-weight: 500; padding: .25rem .6rem; font-size: .85rem; }
.toggle button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 1.25rem; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); color: var(--text); }
.drop b { color: var(--text); }

/* ---------- festival patch matrix ---------- */
.matrix { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: .25rem .4rem; }
.matrix thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--text); vertical-align: bottom; min-width: 7.5rem; }
.matrix thead th small { display: block; color: var(--muted); font-weight: 400; }
.matrix .c-ch, .matrix .c-rack, .matrix .c-split, .matrix .slot { position: sticky; background: var(--panel); z-index: 2; white-space: nowrap; }
.matrix thead .c-ch, .matrix thead .c-rack, .matrix thead .c-split, .matrix thead .slot { z-index: 3; min-width: 0; }
.matrix .c-ch { left: 0; width: 2.8rem; min-width: 2.8rem; font-family: var(--mono); font-weight: 700; color: var(--accent); }
.matrix .c-rack { left: 2.8rem; width: 3rem; min-width: 3rem; color: var(--muted); }
.matrix .c-split { left: 5.8rem; width: 3.8rem; min-width: 3.8rem; }
.matrix .slot { left: 9.6rem; font-weight: 600; }
.matrix tr.extra .slot, .matrix tr.extra .c-ch { color: var(--muted); font-weight: 400; }
.matrix td .dev { display: block; color: var(--muted); font-size: .75rem; }
.matrix td.change { background: color-mix(in srgb, var(--amber) 14%, transparent); }
.matrix td.strike { background: color-mix(in srgb, var(--red) 9%, transparent); }
.matrix td.guest { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.matrix tr.flex td.slot { color: var(--amber); }
.matrix .bandmark { color: var(--teal); font-weight: 700; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: .5rem 0; }
.legend i { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; vertical-align: -2px; margin-right: .3rem; border: 1px solid var(--line); }

/* ---------- shared bits ---------- */
.chip { display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .8rem; padding: .05rem .4rem; border-radius: 5px; line-height: 1.4; white-space: nowrap; border: 1px solid rgba(0,0,0,.15); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.guide { display: flex; gap: .8rem; align-items: center; margin: 0 0 1rem; }
.guide .step { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.guide b { display: block; font-size: 1.15rem; }
.guide span { color: var(--muted); }
.empty.big { padding: 4rem 1rem; }
.empty.big h2 { color: var(--text); }
.warn-t { color: var(--amber); font-weight: 700; }
input.time { width: 5.2rem; font-family: var(--mono); }
input.swatch { width: 2.6rem; height: 2rem; padding: 2px; }
.drop.slim { padding: .8rem 1rem; text-align: left; }
.ro { opacity: .75; cursor: default !important; }
.ro-banner { background: color-mix(in srgb, var(--amber) 14%, var(--panel)); color: var(--text); padding: .45rem 1rem; font-size: .9rem; border-bottom: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.chrome { position: sticky; top: 0; z-index: 5; background: var(--bg); }

/* more menu */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; top: calc(100% + .3rem); left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; display: flex; flex-direction: column; gap: .3rem; min-width: 14rem; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.menu-list > * { justify-content: flex-start; width: 100%; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(5, 8, 12, .7); display: grid; place-items: center; z-index: 30; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal-card.wide { width: min(820px, 100%); }
/* report a problem */
.report-kinds { border: 0; padding: 0; margin: .75rem 0; display: grid; gap: .35rem; }
.report-kinds legend { padding: 0; margin-bottom: .35rem; color: var(--muted); font-size: .85rem; }
.modal-card.report label.field { margin-bottom: .75rem; }
.modal-card.report label.field textarea { color: var(--text); min-height: 0; }
.report-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.share-list { margin-top: .5rem; }
.share-list td { padding: .4rem .3rem; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.auth[hidden] { display: none; }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.75rem; }
.brand.big { font-size: 1.6rem; margin: 0 0 .3rem; }
#authForm { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
#authForm h2 { margin: 0; }
#authForm input { width: 100%; padding: .6rem .7rem; }
.wide-btn { justify-content: center; padding: .65rem; width: 100%; }
.auth-links { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: .9rem; }
.auth-msg { margin: 0; padding: .55rem .7rem; border-radius: 8px; background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); font-size: .9rem; }
.auth-msg.err { background: color-mix(in srgb, var(--red) 11%, transparent); color: var(--red); }
.guest-btn { display: block; margin: 1.2rem auto 0; color: var(--muted); font-weight: 500; font-size: .9rem; }

/* ---------- patch sheets (laid out like the V26.7 template) ---------- */
.sheet { background: #fff; color: #111; border-radius: 10px; padding: 1.25rem 1.5rem; max-width: 1150px; margin-bottom: 1.25rem; font-size: 14px; }
.sheet.wide { max-width: none; }
.sh-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 3px solid #111; padding-bottom: .6rem; }
.sh-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #666; }
.sheet h1 { font-size: 1.7rem; margin: .1rem 0 .15rem; line-height: 1.15; }
.sheet .meta { color: #444; font-size: .9rem; }
.sh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid #ccc; border-top: 0; margin-bottom: .9rem; }
.sh-grid > div { padding: .3rem .55rem; border-right: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2; display: flex; gap: .5rem; align-items: baseline; font-size: .82rem; }
.sh-grid span { color: #777; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; min-width: 6.2rem; }
.sh-grid b { font-weight: 600; }
.sheet .mode { flex: none; display: inline-block; font-weight: 800; padding: .3rem .6rem; border-radius: 6px; background: #e3f7fa; color: #075f6b; font-size: .8rem; letter-spacing: .03em; border: 2px solid #0a8a9a; }
.sheet .mode.guest { background: #fff2dc; color: #7a4a00; border-color: #d48a14; }
.howto { background: #fff7e8; border-left: 4px solid #d48a14; padding: .45rem .7rem; margin: 0 0 .8rem; font-size: .88rem; }
.sheet table.inputs { width: 100%; border-collapse: collapse; }
.sheet table.inputs th { background: #1b1f24; color: #fff; text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; padding: .4rem .45rem; border: 1px solid #1b1f24; }
.sheet table.inputs td { border: 1px solid #d6d6d6; padding: .32rem .45rem; vertical-align: middle; }
.sheet table.inputs tbody tr:nth-child(even) td { background: #f6f7f8; }
.sheet table.inputs tr.extra td { background: #fffbe9; }
.sheet td.ch { font-family: var(--mono); font-weight: 800; font-size: 1rem; color: #0a6c7a; text-align: center; width: 2.6rem; }
.sheet td.name { font-weight: 700; }
.sheet td.mono { font-family: var(--mono); white-space: nowrap; }
.sheet td.yes { font-weight: 700; color: #0f766e; }
.sheet td.notes { font-size: .82rem; color: #444; }
.sheet .tag { font-size: .66rem; font-weight: 800; padding: .05rem .3rem; border-radius: 4px; border: 1px solid #999; color: #555; white-space: nowrap; }
.sheet .tag.sub { border-color: #b45309; color: #b45309; }
.sheet .tag.short { border-color: #b91c1c; color: #b91c1c; }
.sheet .was { display: block; font-size: .72rem; color: #777; }
.sheet .chg { color: #b45309; font-weight: 800; font-size: .78rem; }
.sheet .keep { color: #999; font-size: .78rem; }
.box-panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-top: 1rem; }
.box-panel { border: 1px solid #ccc; border-radius: 6px; overflow: hidden; break-inside: avoid; }
.bp-head { font-weight: 800; padding: .3rem .5rem; font-size: .82rem; letter-spacing: .04em; }
.box-panel table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.box-panel td { padding: .18rem .45rem; border-top: 1px solid #eee; }
.box-panel td.mono { font-family: var(--mono); width: 3rem; color: #333; }
.sheet .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem 1.5rem; margin-top: 1rem; font-size: .88rem; }
.sheet .cols h4 { margin: .2rem 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: #555; }
.sheet .cols h4.bad { color: #b91c1c; }
.sheet .cols ul { margin: 0; padding-left: 1.1rem; }
.sh-notes { margin-top: .8rem; font-size: .9rem; background: #f6f7f8; padding: .5rem .7rem; border-radius: 6px; }
.sheet .matrix { font-size: .78rem; color: #111; }
.sheet .matrix th, .sheet .matrix td { border-color: #ccc; background: #fff; color: #111; }
.sheet .matrix thead th { background: #1b1f24; color: #fff; }
.sheet .matrix thead th small { color: #bbb; }
.sheet .matrix .c-ch { color: #0a6c7a; }
.sheet .matrix td .dev { color: #666; }
.sheet .matrix td.change { background: #fde9c4; }
.sheet .matrix td.strike { background: #fbe0e0; }
.sheet .matrix td.guest { background: #e6f7fa; }
.sheet .matrix td.change.guest { background: #fde9c4; }

.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%) translateY(150%); background: var(--panel-2); border: 1px solid var(--accent); padding: .6rem 1rem; border-radius: 8px; transition: transform .2s; z-index: 40; max-width: calc(100% - 2rem); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); }

.print-area { display: none; }

@media (max-width: 760px) {
  .band-row { grid-template-columns: 2rem 1fr auto; }
  .band-row .time { grid-column: 2; }
  .band-row > :nth-child(n+4) { grid-column: 2 / -1; }
  .sh-grid { grid-template-columns: 1fr; }
  .top { gap: .5rem; }
}

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff; color: #111; }
  #app, #auth, .toast, .modal { display: none !important; }
  .print-area { display: block; }
  .print-area .sheet { max-width: none; padding: 0; border-radius: 0; margin: 0; break-after: page; font-size: 9.5pt; }
  .print-area .sheet:last-child { break-after: auto; }
  .print-area .qr { float: right; margin: 0 0 3mm 5mm; text-align: center; }
  .print-area .qr small { display: block; font-size: 7.5pt; line-height: 1.2; color: #333; }
  .print-area .sheet h1 { font-size: 17pt; }
  .print-area .matrix { font-size: 6.5pt; }
  .print-area .matrix th, .print-area .matrix td { position: static; min-width: 0; padding: .1rem .2rem; }
  .print-area .matrix thead th { min-width: 0; }
  .print-area table.inputs tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Loom view: the festival patch grouped by stage box */
.looms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .75rem; align-items: start; }
.loom-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.loom-t { width: 100%; border-collapse: collapse; font-size: .82rem; }
.loom-t td { border-top: 1px solid var(--line); padding: .28rem .35rem; vertical-align: top; }
.loom-t .sock { width: 3.2rem; font-weight: 700; }
.loom-t .dch { width: 3.8rem; color: var(--muted); }
.loom-t tr.free .what { color: var(--muted); }
.loom-t tr.flex .what { color: var(--amber); }
.loom-t tr.moves td { background: rgba(245, 185, 66, .10); }
.loom-t .chg { color: var(--amber); font-size: .76rem; margin-top: .1rem; }
.loom-t .chg summary { cursor: pointer; width: fit-content; }
.loom-t .chg div { padding-left: .9rem; line-height: 1.35; }
.tag-amber { font-size: .72rem; font-weight: 700; color: var(--amber); border: 1px solid var(--amber); border-radius: 4px; padding: 0 .3rem; white-space: nowrap; }
.sheet .loom-box { break-inside: avoid; page-break-inside: avoid; }
.sheet .loom-h { font-size: 1.05rem; margin: 1rem 0 .4rem; padding-left: .5rem; border-left: 10px solid #888; }
.sheet .loom-h small { font-weight: 400; color: #555; margin-left: .6rem; font-size: .8rem; }
.sheet td.chg { font-size: .8rem; color: #8a5300; }
.sheet tr.free td { color: #999; }

/* desk checks from the All Areas gear library */
.deskcheck { margin: .5rem 0 0; font-size: .88rem; color: var(--muted); }
.deskcheck.ok::before { content: "✓ "; color: var(--green, #3cc47c); font-weight: 700; }
.deskcheck.over { color: var(--red); }
.deskcheck.over::before { content: "✕ "; font-weight: 700; }
.deskcheck.depends { color: var(--amber); }
.deskcheck a { color: inherit; }

/* ---------- manual patching: lines and inputs moved by hand ---------- */
.pin-tag, .clash-tag { display: inline-block; font-family: var(--mono); font-size: .62rem; font-weight: 700; letter-spacing: .04em; line-height: 1.3;
  border: 1px solid currentColor; border-radius: 3px; padding: 0 .22rem; vertical-align: 1px; white-space: nowrap; }
.pin-tag { color: var(--teal); }
.clash-tag { color: var(--red); }
.matrix button.hand, .matrix button.cellbtn, .loom-t button.hand {
  display: block; width: 100%; background: none; color: inherit; border: 0; border-radius: 4px; padding: .05rem .15rem; margin: -.05rem -.15rem;
  font: inherit; font-weight: inherit; text-align: left; cursor: grab; }
.matrix button.hand:hover, .matrix button.cellbtn:hover, .loom-t button.hand:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.matrix button.hand:focus-visible, .matrix button.cellbtn:focus-visible, .loom-t button.hand:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
button.hand.on, button.cellbtn.on { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.matrix button.cellbtn.place, .loom-t tr.free button.hand { color: var(--accent); cursor: pointer; }
.matrix button.cellbtn.place { border: 1px dashed var(--accent); text-align: center; font-size: .75rem; margin: 0; }
[data-drag] { touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
body.dragging, body.dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.lifted { opacity: .4; }
.matrix tr.picked td, .loom-t tr.picked td { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.matrix tr.clash td.slot { box-shadow: inset 3px 0 0 var(--red); }
.loom-t tr.clash td.sock { box-shadow: inset 3px 0 0 var(--red); }
.matrix td.clash-cell { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--red) 55%, transparent); }
table.edit.lines tr.clash td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.drop-ok td { background: color-mix(in srgb, var(--accent) 18%, var(--panel)) !important; }
tr.drop-clash td { background: color-mix(in srgb, var(--red) 18%, var(--panel)) !important; }
tr.drop-same td { background: var(--panel-2) !important; }
.drag-ghost { position: fixed; z-index: 60; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-left-width: 4px;
  border-radius: 6px; padding: .35rem .6rem; font-size: .82rem; max-width: 22rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.drag-ghost b, .drag-ghost span { display: block; }
.drag-ghost span { color: var(--muted); }
.drag-ghost.bad { border-color: var(--red); }
.drag-ghost .warn { color: var(--red); font-weight: 600; }
.manual-row { margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); gap: .5rem; }
.mode-label { font-weight: 600; }
.note.clashes ul { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--text); }
.note.clashes .linkbtn { font-size: .85rem; margin-left: .3rem; text-decoration: underline; }
.editbar { position: sticky; bottom: .5rem; z-index: 6; background: var(--panel); border: 1px solid var(--accent); border-left-width: 4px; border-radius: 8px;
  padding: .6rem .8rem; margin-top: .75rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
.editbar .field input.w-num { width: 6rem; }
.editbar p { margin: .4rem 0 0; font-size: .85rem; }
table.edit.lines td.w-sock { width: 5.5rem; }
table.edit input::placeholder { color: var(--muted); opacity: .75; }
.sheet .pin-tag { color: #0a6c7a; }
.sheet .clash-tag { color: #b91c1c; }
.sheet .matrix tr.clash td.slot { box-shadow: inset 3px 0 0 #b91c1c; }
.sheet .matrix td.clash-cell { box-shadow: inset 0 0 0 2px #e5a3a3; }
@media (max-width: 640px) {
  .editbar .row { gap: .4rem; }
  .editbar .field input.w-num { width: 4.6rem; }
  .editbar p { display: none; }
}
.sheet .muted { color: #555; }

/* Plan & billing dialog */
.plan-lines { margin: .5rem 0 1rem; padding-left: 1.1rem; }
.plan-lines li { margin: .25rem 0; }
.plan-buttons { display: grid; gap: .5rem; margin: .5rem 0 1rem; }
.plan-buttons button { text-align: left; }

/* Band production details and contacts (editor and printed sheet) */
details.production { margin-top: 1rem; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: .6rem .9rem .9rem; }
details.production summary { cursor: pointer; padding: .2rem 0; }
.prod-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; margin-top: .7rem; }
@media (max-width: 900px) { .prod-groups { grid-template-columns: 1fr; } }
.prod-group { border: 1px solid var(--line, #ddd); border-radius: 6px; padding: .5rem .8rem .7rem; margin: 0; min-width: 0; display: grid; gap: .55rem; align-content: start; }
.prod-group legend { font-weight: 700; padding: 0 .35rem; }
.prod-group .field { margin: 0; }
.prod-group .field select, .prod-group .field textarea { width: 100%; }
.prod-ticks { gap: 1.2rem; flex-wrap: wrap; }
textarea.grow { resize: none; overflow: hidden; min-height: 2.3rem; line-height: 1.4; field-sizing: content; }
/* per-channel notes in the band's input list: a box that grows with what's typed, no scrolling */
td.w-notes { min-width: 16rem; }
/* stage plot: on screen in the band editor, and on the printed band sheet */
.plot-view { margin: .5rem 0 0; }
.plot-view img { display: block; max-width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.plot-view figcaption { margin-top: .5rem; gap: .5rem; }
.plot-sheet { break-inside: avoid; page-break-inside: avoid; margin-top: 4mm; }
.plot-sheet img { display: block; max-width: 100%; height: auto; max-height: 160mm; object-fit: contain; border: 1px solid #ccc; }
td.w-notes textarea.grow { width: 100%; min-height: 2.1rem; padding-top: .45rem; padding-bottom: .45rem; }
section.contacts { margin-top: 1rem; }
.contacts-table input { width: 100%; min-width: 8rem; }
.prod-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1.2rem; margin: .5rem 0 .6rem; font-size: .85rem; }
.prod-sheet div { display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem; }
table.contacts-sheet { width: 100%; border-collapse: collapse; margin: 0 0 .8rem; font-size: .85rem; }
table.contacts-sheet th, table.contacts-sheet td { text-align: left; padding: .2rem .5rem; border-bottom: 1px solid var(--line, #ddd); }
@media print { .prod-sheet, table.contacts-sheet { font-size: 9pt; } }

/* ---------- home: every festival you're working on ---------- */
.brand-home { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.brand-home:hover .logo { filter: brightness(1.1); }
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.5rem; }
.home-head h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
.home-head p { margin: 0; }
.home-actions { gap: .5rem; flex-wrap: wrap; }
.home-group { margin-bottom: 1.75rem; }
.home-group h2 { font-size: 1rem; margin: 0 0 .75rem; display: flex; gap: .5rem; align-items: baseline; }
.home-group h2 .muted { font-weight: 500; font-size: .9rem; }
.small-note { margin: -.4rem 0 .75rem; font-size: .88rem; }
.fest-cards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fest-cards.one { grid-template-columns: minmax(260px, 420px); }
.fest-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: .3rem; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; color: var(--text); }
.fest-card:hover { border-color: var(--accent); }
.fest-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fc-top { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.fc-name { font-size: 1.05rem; margin-right: auto; overflow-wrap: anywhere; }
.fc-when { font-weight: 600; font-size: .95rem; }
.fc-where, .fc-foot { font-size: .88rem; }
.fc-foot { margin-top: .2rem; }
