/* Watering Hole Gig Book: masthead, tab bar, one working pane; booking detail/form in a dialog. */
:root {
  --bg: #eef2ef; --surface: #ffffff; --surface-2: #f6f8f6; --ink: #15211d; --muted: #5a6964; --line: #d6dfda;
  --accent: #b97a0c; --accent-ink: #ffffff; --water: #1d6a64; --water-soft: #dcebe8;
  --ok: #2f7a3e; --ok-soft: #e1f0e3; --warn: #9a5b00; --warn-soft: #fbedd5; --bad: #a3332b; --bad-soft: #f7e0de;
  --f-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0e1513; --surface: #16201d; --surface-2: #1c2825; --ink: #e5ece9; --muted: #95a59f; --line: #2b3a36;
  --accent: #e2a93c; --accent-ink: #1a1306; --water: #5bb8ae; --water-soft: #1b3330;
  --ok: #7cc98a; --ok-soft: #1c3322; --warn: #f0b860; --warn-soft: #3a2c13; --bad: #ef8f86; --bad-soft: #3b1f1c;
  color-scheme: dark; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--water); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Login / setup */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login-title { font-family: var(--f-display); font-weight: 800; font-size: 2.6rem; line-height: .9; margin: 0; text-transform: uppercase; }
.login-title span { color: var(--water); }
.login-sub { margin: 4px 0 8px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; }

header.mast { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; padding-bottom: 14px; border-bottom: 3px solid var(--ink); }
.brand h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: .9; margin: 0; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.brand h1 span { color: var(--water); }
.brand p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.mast-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.who { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--water); background: var(--water-soft); padding: 4px 10px; border-radius: 999px; }
.btn { display: inline-block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: var(--r); cursor: pointer; font-weight: 600; font-size: .9rem; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: none; }
.btn.danger { color: var(--bad); }

nav.tabs { display: flex; gap: 4px; margin: 18px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.stat b { display: block; font-family: var(--f-display); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat.alert b { color: var(--warn); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-head h2 { font-family: var(--f-display); font-weight: 800; font-size: 1.9rem; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
.cal-nav { display: flex; gap: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); border-radius: var(--r); overflow: hidden; }
.dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.day.out { background: var(--surface-2); }
.day.out .num { opacity: .45; }
.day.today .num { background: var(--water); color: var(--bg); border-radius: 999px; padding: 0 7px; }
.day.weekend:not(.out) { background: color-mix(in srgb, var(--water-soft) 40%, var(--surface)); }
.num { font-family: var(--f-mono); font-size: .78rem; align-self: flex-start; font-variant-numeric: tabular-nums; }
.add-day { position: absolute; top: 3px; right: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 5px; border-radius: 4px; opacity: 0; }
.day:hover .add-day, .add-day:focus-visible { opacity: 1; }
.gig { text-align: left; border: 0; border-left: 3px solid var(--water); background: var(--water-soft); border-radius: 4px; padding: 3px 6px; cursor: pointer; font-size: .78rem; line-height: 1.25; min-width: 0; }
.gig .t { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); display: block; }
.gig .n { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gig.hold { border-left-color: var(--warn); background: var(--warn-soft); }
.gig.cancelled { border-left-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; opacity: .8; }
.gig .todo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 4px; vertical-align: middle; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legend .l-conf { background: var(--water); } .legend .l-hold { background: var(--warn); } .legend .l-can { background: var(--bad); } .legend .l-todo { background: var(--accent); border-radius: 50%; }

@media (max-width: 640px) {
  .day { min-height: 58px; padding: 3px; }
  .gig { padding: 2px 3px; }
  .gig .t { display: none; }
  .gig .n { font-size: .68rem; }
  .add-day { display: none; }
  .dow { padding: 4px; font-size: .64rem; }
}

/* List */
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; text-align: left; width: 100%; }
.row:hover { border-color: var(--muted); }
.row.compact { grid-template-columns: minmax(0, 1fr); }
.date-block { font-family: var(--f-display); text-transform: uppercase; line-height: .95; }
.date-block .d { font-size: 2rem; font-weight: 800; }
.date-block .m { font-size: .95rem; font-weight: 600; color: var(--muted); }
.row h3 { margin: 0; font-size: 1.05rem; }
.row.compact h3 { font-size: .95rem; }
.row .meta { color: var(--muted); font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row.compact .chips { justify-content: flex-start; margin-top: 6px; }
.chip { font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.chip.done { background: var(--ok-soft); color: var(--ok); }
.chip.todo { background: var(--warn-soft); color: var(--warn); }
.chip.hold { background: var(--warn-soft); color: var(--warn); }
.chip.conf { background: var(--water-soft); color: var(--water); }
.chip.cancelled { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 640px) { .row { grid-template-columns: 64px minmax(0,1fr); } .row .chips { grid-column: 1 / -1; justify-content: flex-start; } }
.empty { padding: 30px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }
.empty.error { color: var(--bad); border-color: var(--bad); }

/* Share / settings */
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel h3 { margin: 0; font-size: 1rem; }
.hint { margin: 0; color: var(--muted); font-size: .85rem; }
.note { margin: 0; font-size: .85rem; color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: 6px; }
textarea.out { width: 100%; min-height: 260px; resize: vertical; font-family: var(--f-mono); font-size: .8rem; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
select, input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="email"], input[type="tel"], input[type="number"], textarea.f { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.inline select { width: auto; }
input[readonly] { background: var(--surface-2); font-family: var(--f-mono); font-size: .8rem; }
.activity { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.activity li { padding: 5px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.activity time { font-family: var(--f-mono); color: var(--muted); font-size: .75rem; }

/* Dialog */
dialog { border: 0; padding: 0; border-radius: 12px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 18, 16, .55); }
.dlg-head { position: sticky; top: 0; background: var(--surface); padding: 16px 20px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: start; z-index: 1; }
.dlg-head h2 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; text-transform: uppercase; line-height: 1; text-wrap: balance; }
.dlg-head .sub { color: var(--muted); font-size: .9rem; margin-top: 4px; font-family: var(--f-mono); }
.dlg-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.close { border: 0; background: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 2px 6px; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
legend, .legend-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--water); font-weight: 700; margin-bottom: 8px; padding: 0; display: block; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); min-width: 0; }
label.full { grid-column: 1 / -1; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: .9rem; }
label.check input { width: 18px; height: 18px; accent-color: var(--water); }
.req { color: var(--bad); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line); }
.form-actions .right { display: flex; gap: 8px; margin-left: auto; }
.err { color: var(--bad); font-size: .85rem; margin: 0; }
.confirm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 18px; }
.kv span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kv b { font-weight: 600; word-break: break-word; }
.bio { margin: 0; max-width: 65ch; }
.tasks { display: flex; flex-wrap: wrap; gap: 8px; }
.tasks button { cursor: pointer; }
.tasks button:disabled { cursor: default; }
.copy-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.stamp { font-size: .75rem; color: var(--muted); margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: .88rem; font-weight: 600; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.bad { background: var(--bad); color: #fff; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .2s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
