/* =====================================================================
   quadrille.css: the Lobster Quadrille's own rules (R152). The tokens,
   the bar, day and night, and the fonts are the fleet's dress (R145:
   /lg/looking-glass.css, then /lg/roses.css). What's left here is the
   Quadrille's own: the gig cards, the roster picker, the PIN pad, the
   form, the Bandstand's tables and drawer. Every colour is a token, so
   night is right by construction.
   ===================================================================== */
:root { --hair: rgba(var(--ink-rgb), .16); --hair2: rgba(var(--ink-rgb), .3); }
body { min-height: 100vh; }
button { font: inherit; border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 14px; padding: 8px 18px; min-height: 46px; cursor: pointer; font-family: var(--sans); font-size: 16px; font-weight: 700; }
button:active { background: var(--panel2); }
button.primary { background: var(--ink); border-color: var(--ink); color: var(--cream); font-weight: 800; }
button.ghost { border-color: var(--line); color: var(--muted); background: var(--paper); }
button.danger { border-color: var(--danger); color: var(--danger); }
button.small { min-height: 36px; padding: 4px 13px; font-size: 14px; border-radius: 11px; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--field); color: var(--ink); min-height: 44px; max-width: 100%; box-sizing: border-box; }
textarea { min-height: 90px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 20px; height: 20px; accent-color: var(--gold); }
a { color: var(--info); }
.num { font-family: var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { color: var(--muted); font-family: var(--fell); font-style: italic; font-size: 16px; }
.quiet { color: var(--muted); font-family: var(--sans); font-size: 15px; margin: 4px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.err { color: var(--danger); font-family: var(--sans); font-size: 15px; min-height: 1.2em; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 20px 120px; box-sizing: border-box; }
@media (max-width: 700px) { main { padding: 14px 14px 120px; } }
.rule { display: flex; align-items: center; gap: 14px; margin: 26px 0 12px; color: var(--gold-text); font-family: var(--fellsc); font-weight: 400; font-size: 21px; letter-spacing: .1em; }
.rule::before, .rule::after { content: ""; flex: 1; border-top: 1px solid var(--hair2); }
.door { max-width: 560px; margin: 60px auto; text-align: center; padding: 0 16px; }
.door h2 { font-family: var(--fellsc); font-weight: 400; font-size: 34px; margin: 6px 0; letter-spacing: .05em; }
.door .logo { height: 54px; max-width: 100%; }
:root:not([data-theme="dark"]) .logo.night, :root[data-theme="dark"] .logo.day { display: none; }
.door blockquote { font-family: var(--fell); font-style: italic; color: var(--muted); margin: 10px 0 18px; font-size: 18px; }
.door button { margin-top: 8px; min-width: 180px; }

/* ---- the tablet: today's gigs ---- */
.dayhead { font-family: var(--fellsc); font-size: 26px; margin: 4px 0 2px; }
.gigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.gig { background: var(--paper); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.gig .when { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 15px; color: var(--muted); }
.gig .title { font-family: var(--fell); font-size: 18px; }
.gig .who { font-family: var(--fellsc); font-size: 30px; line-height: 1.1; }
.gig .act { font-family: var(--serif); font-size: 17px; color: var(--muted); }
.gig .state { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.gig.on { border-color: var(--gold); border-width: 2px; background: var(--gold-tint); }
.gig.done { border-color: var(--ok); }
.gig.done .state { color: var(--ok); }
.gig.off { opacity: .65; }
.gig button { min-height: 60px; font-size: 19px; }
.tools { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.tools button { min-height: 54px; }
.empty { background: var(--paper); border: 1.5px dashed var(--line2); border-radius: 18px; padding: 22px; font-family: var(--fell); font-style: italic; font-size: 18px; color: var(--muted); }

/* ---- the poster board ---- */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.post { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 12px 16px; }
.post h4 { margin: 0 0 4px; font-family: var(--fellsc); font-weight: 400; font-size: 20px; }
.post p { margin: 0; white-space: pre-line; font-size: 16px; }

/* ---- the roster picker ---- */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pick button { text-align: left; min-height: 72px; display: grid; gap: 2px; padding: 10px 14px; }
.pick button b { font-family: var(--fellsc); font-weight: 400; font-size: 24px; }
.pick button span { font-family: var(--serif); font-size: 15px; color: var(--muted); font-weight: 400; }
.pick button.booked { border-color: var(--gold); border-width: 3px; background: var(--gold-tint); min-height: 110px; }
.pick button.booked b { font-size: 34px; }
.search { width: 100%; font-size: 20px; margin: 6px 0 12px; }

/* ---- dialogs and the PIN pad ---- */
dialog { border: 2px solid var(--gold); border-radius: 22px; background: var(--paper); color: var(--ink); padding: 22px; max-width: 420px; width: calc(100% - 28px); box-sizing: border-box; }
dialog::backdrop { background: var(--scrim); }
dialog h2 { font-family: var(--fellsc); font-weight: 400; margin: 0 0 6px; font-size: 24px; text-align: center; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pad button { min-height: 68px; font-size: 30px; border-radius: 16px; }
.dots { display: flex; gap: 16px; justify-content: center; margin: 12px 0; }
.dots span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--gold-text); }
.dots span.on { background: var(--gold); }
.hello { text-align: center; font-family: var(--fellsc); font-size: 34px; margin: 18px 0; }
.pinerr { text-align: center; min-height: 2.6em; margin: 4px 0 0; }

/* ---- forms (the join page, the musician's page, the Bandstand) ---- */
.form { display: grid; gap: 12px; max-width: 640px; }
.form label { display: grid; gap: 4px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.form input, .form select, .form textarea { font-size: 18px; color: var(--ink); width: 100%; }
.form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form .pair { grid-template-columns: 1fr; } }
.form .choice { display: flex; gap: 18px; flex-wrap: wrap; font-size: 17px; color: var(--ink); }
.form .choice label { display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--ink); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; color: var(--ink); }
.form .hint { font-size: 13px; color: var(--muted); }
input.bad, select.bad, textarea.bad { border-color: var(--danger) !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contract { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; max-height: 420px; overflow-y: auto; }
.contract h3 { font-family: var(--fellsc); font-weight: 400; font-size: 24px; margin: 0 0 8px; }
.contract h4 { font-family: var(--sans); font-size: 15px; margin: 14px 0 2px; }
.contract p { margin: 0 0 6px; white-space: pre-line; font-size: 16px; line-height: 1.45; }
.photo-prev { max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.linkbox { font-family: var(--sans); font-size: 14px; word-break: break-all; background: var(--gold-tint); padding: 10px; border-radius: 10px; }
.card2 { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.lead { font-size: 19px; }

/* ---- the Bandstand ---- */
nav.tabs { display: flex; gap: 8px; padding: 12px 20px 0; max-width: 1280px; margin: 0 auto; flex-wrap: wrap; position: static; background: transparent; border: 0; overflow: visible; box-sizing: border-box; }
nav.tabs .tab { font-size: 15px; padding: 8px 14px; min-height: 40px; }
.bar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 8px 0 14px; }
.bar label { display: grid; gap: 3px; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.bar input, .bar select { min-height: 40px; font-size: 15px; }
.scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.list { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; }
.list th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.list td { padding: 8px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.list td.num, .list th.num { text-align: right; }
.list tr.click { cursor: pointer; }
.list tr.click:hover td { background: rgba(var(--ink-rgb), .04); }
.list tr.dim td { opacity: .5; }
.pillx { display: inline-block; border-radius: 99px; padding: 1px 9px; font-size: 12.5px; border: 1px solid var(--line2); white-space: nowrap; }
.pillx.ok { border-color: var(--ok); color: var(--ok); }
.pillx.warn { border-color: var(--amber); color: var(--amber); }
.pillx.bad { border-color: var(--danger); color: var(--danger); }
.pillx.info { border-color: var(--info); color: var(--info); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mcard { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; cursor: pointer; }
.mcard:hover { border-color: var(--gold); }
.mcard h4 { margin: 0; font-family: var(--fellsc); font-weight: 400; font-size: 22px; }
.mcard .sub { font-family: var(--serif); color: var(--muted); font-size: 15px; }
.mcard .kind { font-family: var(--sans); font-size: 14px; color: var(--ok); }
.mcard .reach { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--sans); font-size: 15px; }
.drawer { position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: flex; justify-content: flex-end; }
.drawer-in { background: var(--cream); width: min(720px, 100%); height: 100%; overflow-y: auto; padding: 22px; border-left: 2px solid var(--gold); position: relative; box-sizing: border-box; }
.closex { position: absolute; top: 14px; right: 14px; }
.drawer-in h3 { font-family: var(--fellsc); font-weight: 400; font-size: 26px; margin: 0 40px 8px 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; font-family: var(--sans); font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills button.on { border-color: var(--gold); background: var(--gold-tint); }
.rates { display: grid; grid-template-columns: 1fr 140px; gap: 6px 12px; align-items: center; font-family: var(--sans); font-size: 15px; }
.rates input { min-height: 38px; text-align: right; }
.payday { margin-bottom: 18px; }
.payday.next { outline: 2px solid var(--gold); border-radius: 16px; }
.payday h4 { font-family: var(--fellsc); font-weight: 400; font-size: 22px; margin: 0; padding: 12px 14px 4px; }
.payday .quiet { padding: 0 14px 8px; }
.tick { width: 26px !important; height: 26px !important; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .big { font-family: var(--sans); font-size: 24px; font-variant-numeric: tabular-nums; }
details.more summary { cursor: pointer; font-family: var(--sans); font-size: 15px; color: var(--info); margin: 8px 0; }
@media (max-width: 700px) {
  nav.tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  nav.tabs .tab { flex: 0 0 auto; }
  .kv { grid-template-columns: 120px 1fr; }
  .gig .who { font-size: 26px; }
}
@media print {
  nav.tabs, .bar, button, .drawer, input[type=checkbox] { display: none !important; }
  main { max-width: none; padding: 0; }
}
.form input[type=radio], .form input[type=checkbox] { width: 20px; min-width: 20px; flex: none; }
.form .check input[type=checkbox] { margin-top: 3px; }
