:root {
  scrollbar-gutter: stable;
  color-scheme: dark;
  --bg: #111518;
  --panel: #1a2024;
  --line: #343e44;
  --text: #f3f4ef;
  --muted: #b5c0c1;
  --green: #cafc91;
  --green-ink: #17240d;
  --amber: #ffd797;
  font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, select, input, textarea {
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--panel);
  color: var(--text);
  padding: .48rem .77rem;
}
select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 51%, calc(100% - 12px) 51%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
button:hover { border-color: var(--muted); }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
a { color: var(--green); overflow-wrap: anywhere; }
p, h1, h2, h3 { margin: 0; }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; padding-block: .5rem; }
.brand { display: flex; align-items: center; gap: clamp(.65rem, 2vw, 1.5rem); color: #fff; font-size: clamp(2.25rem, 11vw, 6rem); font-weight: 750; line-height: 1; }
.brand img { display: block; width: clamp(5rem, 25vw, 13.75rem); height: auto; flex: none; filter: brightness(0) invert(1); }
#access, .muted { color: var(--muted); }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
#sign-in-retry { margin-top: .75rem; }
.hero {
  text-align: center;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  margin-block: .8rem;
  border: 1px solid #3d4c40;
  border-radius: 1.1rem;
  background: radial-gradient(ellipse at 90% 0%, #344733 0, transparent 68%), #1b2520;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.1; letter-spacing: -.065em; }
.hero p { margin-top: .45rem; color: #d0ddce; }
.primary { background: var(--green); color: var(--green-ink); border-color: var(--green); font-weight: 750; white-space: nowrap; }
.primary:hover { background: #dcffb5; color: var(--green-ink); }
.tabs { display: flex; gap: .55rem; flex-wrap: wrap; padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); }
.tabs [aria-pressed="true"] { color: var(--green); border-color: #859d66; background: #293223; }
.toolbar, .controls { display: flex; align-items: center; gap: 1rem; }
.toolbar { justify-content: space-between; padding-block: 1.2rem .5rem; }
.controls, .toolbar { flex-wrap: wrap; }
.archive-toggle { display: flex; align-items: center; gap: .4rem; }
.archive-toggle input { min-height: auto; accent-color: var(--green); }
#notice:not(:empty) { padding-block: .5rem; color: var(--muted); }
#board { padding-bottom: 3rem; }
.group { margin-top: 1.25rem; }
.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem 1rem;
}
.group > .group-head { margin-bottom: .55rem; }
.group-head button { font-size: .875rem; }
.panel {
  padding: 1rem;
  margin-block: .6rem 1.5rem;
  border: 1px solid #43513e;
  border-radius: .8rem;
  background: #1b2520;
  display: grid;
  gap: .65rem;
}
.panel label { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.panel summary { cursor: pointer; color: var(--green); }
.roster-rows { margin-block: .55rem; }
.roster-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .4rem 0; }
.roster-row p { overflow-wrap: anywhere; }
.empty { padding: .85rem 1rem; border: 1px dashed var(--line); border-radius: .7rem; color: var(--muted); }
.items { display: grid; gap: .5rem; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .65rem 1rem;
  padding: .9rem 1rem;
  border-radius: .7rem;
  background: var(--panel);
  border: 1px solid var(--line);
}
.item h4 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.item.procedure-card { grid-template-columns: minmax(0, 1fr) auto; }
.item p { margin-top: .22rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .meta { font-size: .875rem; color: var(--muted); }
.shift-time { color: var(--green); font-weight: 600; }
.item-side { display: grid; justify-items: end; gap: .45rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.item-actions button { font-size: .875rem; }
.status { font-size: .875rem; border: 1px solid var(--line); border-radius: 5rem; padding: .13rem .6rem; }
.status[data-status="Tentative"] { color: var(--amber); border-color: #715d46; }
.status[data-status="Confirmed"], .status[data-status="Ready"] { color: var(--green); border-color: #506548; }
dialog { width: min(34rem, 100% - 1.5rem); max-height: 92%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; }
dialog::backdrop { background: #000b; }
form, form label { display: grid; gap: .5rem; }
form { gap: .75rem; }
form input, form select, form textarea { min-width: 0; width: 100%; }
.dialog-head, .dialog-actions { display: flex; align-items: center; gap: .55rem; justify-content: space-between; }
.dialog-actions { justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row > :only-child { grid-column: 1 / -1; }
.error { color: var(--amber); }
.error:empty { display: none; }
.schedule-view .tabs { padding-bottom: .6rem; }
.schedule-view .toolbar { padding-block: .7rem .3rem; }
.schedule-view #roster { padding: .5rem .75rem; margin-block: .35rem .8rem; }
.schedule-date { margin-top: .22rem; font-size: 1.4rem; font-weight: 850; }
.timeline-section {
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--panel);
  padding: .85rem;
}
.timeline-section { margin-bottom: .75rem; }
.timeline-scroll { overflow-x: auto; padding: .25rem .1rem; }
.timeline-axis, .shift-summary, .empty-team-track { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .35rem; }
.timeline-labels { position: relative; height: 1.6rem; color: var(--muted); font-size: .875rem; }
.timeline-labels span { position: absolute; white-space: nowrap; transform: translateX(-50%); }
.timeline-labels .axis-first { transform: none; }
.timeline-labels .axis-last { transform: translateX(-100%); }
.team-lane + .team-lane { margin-top: .5rem; }
.team-lane-head { display: flex; align-items: center; justify-content: space-between; padding-block: .24rem; border-top: 1px solid var(--line); }
.team-lane-head h4 { margin: 0; }
.team-lane-head button, .team-editor button { min-height: 2rem; padding: .2rem .55rem; font-size: .875rem; }
.empty-team-track { position: relative; padding-bottom: .2rem; align-items: center; }
.empty-team-track .timeline-track { grid-column: 2; }
.empty-team-track > .muted { grid-column: 2; padding-left: .55rem; font-size: .875rem; }
.empty-team-track > * { grid-row: 1; }
.team-editor { display: grid; gap: .35rem; padding: .5rem; margin: .35rem 0; border: 1px solid var(--line); border-radius: .5rem; }
.team-editor > button { justify-self: start; }
.team-edit-row { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .65rem; font-size: .9rem; }
.team-edit-row > button { margin-left: auto; }
.timeline-shift { margin: .2rem 0; }
.shift-summary { align-items: center; list-style: none; cursor: pointer; border-radius: .4rem; }
.shift-summary::-webkit-details-marker { display: none; }
.shift-summary:hover .timeline-track { background: #293438; }
.timeline-name { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.mobile-shift-name { display: none; }
.timeline-track { display: block; position: relative; height: 2rem; background: #20292e; border-radius: .3rem; }
.track-mark { position: absolute; inset-block: 0; width: 1px; background: #3b464d; }
.shift-bar {
  display: block;
  position: absolute;
  inset-block: .14rem;
  background: #a7d87b;
  color: #12200d;
  border: 1px solid transparent;
  border-radius: .35rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.55rem;
  text-indent: .4rem;
}
.shift-bar[data-status="Tentative"] { color: #f6eddd; background: #655235; border: 1px dashed #f2c780; }
.shift-bar.crew-confirmed { color: #12200d; background: #a7d87b; border-style: solid; border-color: transparent; }
.shift-bar.my-shift { box-shadow: inset 0 0 0 2px #ecffdb; }
.shift-point {
  position: absolute;
  top: 50%;
  width: .7rem;
  height: .7rem;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--amber);
}
.timeline-detail { margin: .35rem 0 .5rem; }
.crew-waiting { margin-top: 1rem; }
.crew-waiting ul { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .45rem 0 0; list-style: none; }
.crew-waiting li { color: var(--muted); border: 1px solid var(--line); border-radius: 1rem; font-size: .875rem; padding: .15rem .65rem; }
@media (max-width: 40rem) {
  .wrap { width: calc(100% - 1.25rem); }
  .brand { font-size: clamp(2rem, 9vw, 3.5rem); }
  .brand img { width: clamp(3.75rem, 17vw, 5rem); }
  .tabs { gap: .35rem; }
  .tabs button { min-height: 44px; padding-inline: .65rem; }
  .shift-summary { min-height: 44px; }
  .timeline-axis, .shift-summary, .empty-team-track { grid-template-columns: minmax(3.75rem, 25%) minmax(0, 1fr); }
  .timeline-labels :nth-child(even):not(:last-child) { display: none; }
  .timeline-labels :nth-last-child(2):nth-child(odd):not(:first-child) { display: none; }
  .timeline-labels span { font-size: .75rem; }
  .mobile-shift-name { display: inline; }
  .shift-bar { font-size: 0; }
}
@media (max-width: 40rem) {
  .item { grid-template-columns: 1fr; }
  .item-side { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .form-row { grid-template-columns: 1fr; }
}

#bar-page {
    color-scheme: dark;
    --bar-bg: var(--bg);
    --bar-panel: var(--panel);
    --bar-line: var(--line);
    --bar-text: var(--text);
    --bar-muted: var(--muted);
    --bar-green: var(--green);
    background: var(--bar-bg);
    color: var(--bar-text);
    font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
  }
  #bar-page * { box-sizing: border-box; }
  #bar-page :where(h2, h3, h4, p) { margin: 0; }
  #bar-page .bar-title { font-size: 1.5rem; }
  #bar-page .bar-group { margin-top: 1.25rem; }
  #bar-page .bar-head, #bar-page .bar-actions {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem 1rem;
  }
  #bar-page .bar-head { margin-bottom: .55rem; }
  #bar-page button, #bar-page input, #bar-page textarea {
    font: inherit;
    min-height: 44px;
    border: 1px solid var(--bar-line);
    border-radius: .55rem;
    background: var(--bar-panel);
    color: var(--bar-text);
    padding: .48rem .77rem;
  }
  #bar-page button { font-size: .875rem; }
  #bar-page button:hover { border-color: var(--bar-muted); }
  #bar-page :focus-visible { outline: 2px solid var(--bar-green); outline-offset: 3px; }
  #bar-page .bar-shopping {
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: 1rem;
    margin-top: 1.25rem;
  }
  #bar-page .bar-shopping > section { min-width: 0; }
  #bar-page .bar-shopping .bar-head { min-height: 44px; }
  #bar-page :is(.bar-shopping, .crew-tasks) ul {
    list-style: none; padding: 0; margin: 0; background: var(--bar-panel);
    border: 1px solid var(--bar-line); border-radius: .7rem;
  }
  #bar-page :is(.bar-shopping, .crew-tasks) ul:empty { display: none; }
  #bar-page :is(.bar-shopping, .crew-tasks) li {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: center;
    padding: .25rem .65rem; overflow-wrap: anywhere;
  }
  #bar-page :is(.bar-shopping, .crew-tasks) li + li { border-top: 1px solid var(--bar-line); }
  #bar-page .bar-shopping li button:not(.bar-delete) { padding-inline: .5rem; }
  #bar-page .bar-shopping .bar-shopping-row { display: flex; flex-wrap: wrap; justify-content: space-between; }
  #bar-page .bar-shopping-row > :first-child { flex: 1 1 7rem; min-width: 0; }
  #bar-page .bar-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
  #bar-page .bar-shopping button[aria-pressed="true"] {
    background: var(--bar-green); color: #17240d; border-color: var(--bar-green);
  }
  #bar-page button.bar-delete {
    min-height: 30px; min-width: 30px; padding: 0; font-size: 1rem; background: transparent; color: var(--bar-muted);
  }
  #bar-page button.bar-delete:hover { color: var(--bar-text); }
  @media (pointer: coarse) {
    #bar-page button.bar-delete { min-height: 44px; min-width: 44px; }
  }
  #bar-page .bar-shopping .bar-description { margin-top: .15rem; font-size: .875rem; }
  #bar-page .bar-store-empty { color: var(--bar-muted); font-size: .875rem; }
  #bar-page .bar-stores { min-width: 0; }
  #bar-page .bar-stores section + section { margin-top: 1rem; }
  #bar-page .bar-stores-jump { display: none; }
  @media (max-width: 575px) {
    #bar-page .bar-shopping { grid-template-columns: 1fr; }
    #bar-page .bar-stores-jump {
      display: inline-flex; align-items: center; min-height: 44px; color: var(--bar-green);
    }
  }
  #bar-page .bar-table-wrap { border: 1px solid var(--bar-line); border-radius: .7rem; background: var(--bar-panel); }
  #bar-page table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .875rem; }
  #bar-page th, #bar-page td {
    padding: .5rem clamp(.35rem, 1.5vw, .8rem); text-align: left; vertical-align: top; overflow-wrap: anywhere;
  }
  #bar-page tr + tr, #bar-page tbody { border-top: 1px solid var(--bar-line); }
  #bar-page thead th:first-child { width: 35%; }
  #bar-page thead th:nth-child(2) { width: 25%; }
  #bar-page .bar-price { text-align: right; font-variant-numeric: tabular-nums; }
  #bar-page .bar-drink-name {
    border: 0; padding: 0; min-height: 44px; text-align: left; color: var(--bar-green); text-decoration: underline;
  }
  #bar-page .bar-description { color: var(--bar-muted); font-weight: 400; white-space: pre-wrap; }
  #bar-page dialog {
    width: min(34rem, 100% - 1.5rem); max-height: 92%; background: var(--bar-bg); color: var(--bar-text);
    border: 1px solid var(--bar-line); border-radius: 1rem; padding: 1.25rem;
  }
  #bar-page dialog::backdrop { background: #0009; }
  #bar-page form, #bar-page label { display: grid; gap: .45rem; }
  #bar-page label.crew-check { display: flex; align-items: center; min-height: 2rem; cursor: pointer; }
  #bar-page .crew-check input { flex: none; width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0 .15rem 0 0; accent-color: var(--bar-green); }
  #bar-page .crew-check input:checked + div { color: var(--bar-muted); }
  #bar-page form { gap: .85rem; }
  #bar-page .bar-add-supply {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end; gap: .5rem; margin-bottom: .65rem;
  }
  #bar-page .bar-add-supply label:first-child { grid-column: 1 / -1; }
  #bar-page .bar-add-supply input { width: 100%; min-width: 0; }
  #bar-page .bar-add-status {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  }
  #bar-page .bar-drink-fields {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem;
    min-width: 0; margin: 0; padding: 0; border: 0;
  }
  #bar-page .bar-drink-fields label:first-child { grid-column: 1 / -1; }
  #bar-page .bar-drink-fields input { width: 100%; min-width: 0; }
  #bar-page textarea { resize: vertical; min-height: 5rem; }
  #bar-page .bar-actions { justify-content: flex-end; }
  #bar-page .bar-save { background: var(--bar-green); border-color: var(--bar-green); color: #17240d; font-weight: 750; }
  @media (max-width: 575px) {
    #bar-page thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #bar-page tbody { border-top: 0; }
    #bar-page tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #bar-page tbody th { grid-column: 1 / -1; padding-bottom: 0; }
    #bar-page tbody td { text-align: left; }
    #bar-page tbody td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--bar-muted); }
  }
