/* Shell styles, matched to the tool (CLAUDE.md rule 7): black bar with the green stripe, Arial. */
:root {
  --black: #000; --green: #78C142; --green-dk: #5FA32E; --lt-green: #ECF7DD;
  --lt-gray: #F1EFE8; --mid-gray: #D3D1C7; --dark-gray: #5F5E5A; --text: #1A1A18;
  --red: #C0392B; --lt-red: #FCEBEB; --amber: #BA7517; --lt-amber: #FAEEDA;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: #fff; font-size: 13px; }
button { font-family: inherit; }

.shell-bar { background: var(--black); color: #fff; display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-bottom: 3px solid var(--green); min-height: 48px; }
.shell-brand { font-weight: 600; font-size: 14px; letter-spacing: .02em; white-space: nowrap; }
.shell-brand a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.shell-logo { height: 30px; width: 30px; object-fit: contain; flex: none; }
.signin-logo { display: block; width: 64px; height: 64px; margin: 0 auto 14px; background: #000; border-radius: 8px; padding: 5px; object-fit: contain; }
.shell-brand small { display: block; color: rgba(255,255,255,.55); font-size: 10px; font-weight: 400; }
.shell-crumbs { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap; }
.shell-chip { background: rgba(255,255,255,.12); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 20px; }
.shell-chip.warn { background: var(--amber); }
.shell-chip.ok { background: var(--green-dk); }
.shell-chip.err { background: var(--red); }
.shell-user { font-size: 12px; color: rgba(255,255,255,.8); white-space: nowrap; }
.shell-btn { background: rgba(255,255,255,.08); color: #fff; font-size: 12px; padding: 5px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; cursor: pointer; }
.shell-btn:hover { background: rgba(255,255,255,.18); }
.shell-btn.primary { background: var(--green); border-color: var(--green-dk); font-weight: 600; }
.shell-btn.primary:hover { background: var(--green-dk); }
.shell-btn:disabled { opacity: .5; cursor: default; }

.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.page h1 { font-size: 20px; margin: 0 0 4px; }
.page .sub { color: var(--dark-gray); margin: 0 0 18px; }
.btn { background: #fff; color: var(--text); border: 1px solid var(--mid-gray); border-radius: 5px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.btn:hover { background: var(--lt-gray); }
.btn.primary { background: var(--green); color: #000; border-color: var(--green-dk); font-weight: 600; }
.btn.primary:hover { background: var(--green-dk); color: #fff; }
.btn.danger { color: var(--red); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--dark-gray); border-bottom: 2px solid var(--black); padding: 8px; }
table.grid td { border-bottom: 1px solid var(--mid-gray); padding: 9px 8px; vertical-align: middle; }
table.grid tr:hover td { background: var(--lt-gray); }
table.grid td.actions { white-space: nowrap; text-align: right; }
.status { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--lt-gray); }
.status.scheduled { background: var(--lt-green); }
.status.scored, .status.exported { background: var(--green); color: #000; }
.empty { padding: 40px; text-align: center; color: var(--dark-gray); border: 1px dashed var(--mid-gray); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--dark-gray); }

/* Dashboard (STR-214) */
.status { text-transform: capitalize; }
.dash-search { flex: 1 1 220px; max-width: 320px; padding: 6px 10px; border: 1px solid var(--mid-gray); border-radius: 5px; font: inherit; }
.dash-search:focus, .dash-toggle input:focus-visible, .btn:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.dash-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.dash-toggle input { accent-color: var(--green); margin: 0; }
.dash-count { color: var(--dark-gray); font-size: 12px; margin: 0 0 6px; min-height: 1em; }
.dash-grid a { color: var(--text); }
.dash-grid a:hover { color: var(--green-dk); }
.dash-grid tr.archived td { color: var(--dark-gray); background: var(--lt-gray); }
.dash-grid tr.archived .status { background: #fff; }
.tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--mid-gray); color: var(--dark-gray); vertical-align: 1px; }

/* At phone width each event becomes a card: the labels come from data-label. */
@media (max-width: 700px) {
  .page { padding: 16px 12px; }
  /* The top bar keeps one line (the editor frame sits under it), so it sheds the subtitle. */
  .shell-bar { gap: 8px; padding: 8px 12px; }
  .shell-brand small { display: none; }
  /* The logo carries the brand at phone width; the name would push the bar past the screen.
     If the logo fails to load, onerror removes it and the name shows again. */
  .shell-brand .shell-logo + span { display: none; }
  .shell-user { font-size: 11px; }
  .dash-search { max-width: none; flex-basis: 100%; }
  .dash-grid thead { display: none; }
  .dash-grid, .dash-grid tbody, .dash-grid tr, .dash-grid td { display: block; width: 100%; }
  .dash-grid tr { border: 1px solid var(--mid-gray); border-left: 4px solid var(--green); border-radius: 6px; margin-bottom: 10px; padding: 6px 10px; }
  table.dash-grid td { border: 0; padding: 4px 0; }
  .dash-grid td[data-label]:not([data-label="Event"])::before { content: attr(data-label); display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--dark-gray); }
  table.dash-grid td.actions { text-align: left; white-space: normal; padding-top: 8px; }
  .dash-grid td.actions .btn { margin: 0 4px 4px 0; }
  table.dash-grid tr:hover td, table.dash-grid tr.archived td { background: transparent; }
  table.dash-grid tr.archived { background: var(--lt-gray); border-left-color: var(--mid-gray); }
}

.notice { padding: 10px 14px; border-radius: 6px; margin: 0 0 12px; }
.notice.err { background: var(--lt-red); color: var(--red); }
.notice.warn { background: var(--lt-amber); }
.starting-notice { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 6px; background: #000; color: #fff; border-left: 4px solid #78C142; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.starting-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #78C142; animation: starting-pulse 1.2s ease-in-out infinite; }
@keyframes starting-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .starting-dot { animation: none; } }

.editor-frame { position: fixed; top: 51px; left: 0; right: 0; bottom: 0; width: 100%; height: calc(100% - 51px); border: 0; }

.signin { max-width: 380px; margin: 12vh auto; padding: 32px 36px; border-top: 4px solid var(--green); box-shadow: 0 8px 32px rgba(0,0,0,.18); border-radius: 8px; text-align: center; }
.signin h1 { font-size: 16px; margin: 4px 0 6px; }
.signin .eyebrow { color: var(--green-dk); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.signin p { color: var(--dark-gray); font-size: 12px; }
.signin .btn { width: 100%; margin-top: 8px; padding: 9px; }

dialog { border: 0; border-radius: 8px; padding: 20px 22px; box-shadow: 0 12px 48px rgba(0,0,0,.3); max-width: 520px; width: 92%; }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h2 { font-size: 15px; margin: 0 0 12px; }
dialog label { display: block; font-size: 12px; margin: 10px 0 4px; color: var(--dark-gray); }
dialog input, dialog select { width: 100%; padding: 7px 9px; border: 1px solid var(--mid-gray); border-radius: 5px; font: inherit; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
