:root {
  --accent: #007aff;
  --ink: #000;
  --text: #1c1c1e;
  --secondary: #6e6e73;
  --line: #d1d1d6;
  --panel: #f2f2f7;
  --surface: #fff;
  --warning: #f25400;
  --danger: #d70015;
  color-scheme: light;
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--surface); overflow: hidden; }
body { height: 100dvh; display: flex; flex-direction: column; }
button { touch-action: manipulation; }
button {
  font: inherit; color: var(--accent); background: transparent; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px; cursor: pointer; white-space: nowrap;
}
button:hover:not(:disabled) { background: #f5f5f7; }
button:disabled { color: #b0b0b5; cursor: default; }
button.prominent { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
button.prominent:hover:not(:disabled) { background: #0066d6; }
button.prominent:disabled { background: #b0c9ef; color: #fff; }
button.icon { border: 0; padding: 4px 6px; display: inline-flex; }
button.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input, select, textarea { font: inherit; color: var(--text); }

.topbar {
  flex: none; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
/* The ARC IT UP mark: the launch animation's three arcs over the name (John, 2026-11-10). */
.mark { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; flex: none; color: var(--text); }
.mark svg { width: 46px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.mark span { font-weight: 600; letter-spacing: 2.4px; font-size: 9px; white-space: nowrap; margin-right: -2.4px; }
.title {
  font-weight: 600; font-size: 17px; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px;
  min-width: 120px; width: 32ch; max-width: 40vw; background: transparent; text-overflow: ellipsis;
}
.title:hover { border-color: var(--line); }
.title:focus { border-color: var(--accent); outline: none; }
.spacer { flex: 1; }
.group { display: flex; gap: 2px; }
button.app { font-weight: 600; }

.body { display: flex; flex: 1; min-height: 0; position: relative; }
.setup {
  width: 280px; flex: none; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line);
  padding: 16px 14px 24px; display: flex; flex-direction: column; gap: 14px;
}
.setup > button.prominent { border-radius: 999px; padding: 9px; font-size: 16px; }
.setup section { background: var(--surface); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.setup h3 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--secondary); }
.segmented { display: flex; background: #e3e3e8; border-radius: 8px; padding: 2px; }
.segmented button { flex: 1; border: 0; color: var(--text); padding: 4px 6px; border-radius: 6px; }
.segmented button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.switch, .pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 25px; border-radius: 999px; background: #e3e3e8; position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.switch input:checked { background: #34c759; }
.switch input:checked::after { left: 19px; }
.switch input:disabled { opacity: .5; }
.choices { display: flex; flex-direction: column; gap: 4px; }
.choices label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.choices input { accent-color: var(--accent); margin: 0; }
.note { margin: 0; font-size: 13px; color: var(--secondary); }
.sub { display: flex; flex-direction: column; gap: 8px; }
.notes { display: flex; flex-direction: column; gap: 4px; }
.notes textarea { resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--surface); max-width: 160px; }

.stage { flex: 1; position: relative; overflow: hidden; background: var(--surface); }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: none; }
#chart .hit { cursor: pointer; }
.hint { position: absolute; transform: translate(-50%, -50%); color: #737373; font-size: 15px; pointer-events: none; text-align: center; }
.warning {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--surface);
  border: 1px solid rgba(242, 84, 0, .6); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500;
  pointer-events: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.warning::before { content: "⚠ "; color: var(--warning); }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--secondary); background: var(--surface); }

.rowcontrol {
  position: absolute; display: flex; align-items: center; gap: 2px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.12);
  white-space: nowrap;
}
.rowcontrol .name { font-weight: 600; font-size: 14px; margin-right: 6px; }
.rowcontrol button { border: 0; padding: 0; width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.rowcontrol .count { width: auto; min-width: 32px; padding: 0 4px; font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.rowcontrol input { width: 46px; text-align: center; font-weight: 600; font-size: 16px; border: 0; background: rgba(0,122,255,.12); border-radius: 6px; padding: 4px 0; outline: none; }

.addrow {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.18); z-index: 20;
}
.addrow form { display: flex; align-items: center; gap: 10px; }
.addrow input { width: 90px; font-size: 22px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 3px; font-variant-numeric: tabular-nums; }
.addrow .note { margin-top: 8px; }

.menu {
  position: fixed; z-index: 30; min-width: 220px; background: rgba(250,250,250,.98); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 0; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.menu button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; color: var(--text); padding: 6px 14px; }
.menu button:hover:not(:disabled) { background: var(--accent); color: #fff; }
.menu button:disabled { color: #b0b0b5; }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { color: #fff; background: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

dialog { border: 0; border-radius: 14px; padding: 18px 20px; max-width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.25); }
.dtitle { font-weight: 600; margin: 0 0 6px; }
#dialogText { margin: 0 0 14px; color: var(--secondary); }
.dbuttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dbuttons .danger { color: var(--danger); }

/* ---- Step 2: menus, selection, the instrument strip -------------------------------------- */
.setup > button.quick { border-radius: 999px; padding: 8px; font-size: 15px; font-weight: 600; background: var(--surface); }
.setup > button.quick:disabled { color: var(--secondary); }

.bars { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; max-width: calc(100% - 24px); }
.bars > * { pointer-events: auto; }
.bars .warning { position: static; transform: none; pointer-events: none; }
.bar {
  display: flex; flex-direction: column; gap: 6px; align-items: center; background: var(--panel); border-radius: 22px;
  padding: 8px 10px 8px 16px; box-shadow: 0 2px 10px rgba(0,0,0,.14);
}
.bar .top { display: flex; align-items: center; gap: 12px; }
.bar .icon { color: var(--accent); font-size: 18px; }
.bar .words { display: flex; flex-direction: column; }
.bar .words strong { font-size: 14px; }
.bar .words span { font-size: 12px; color: var(--secondary); }
.bar .done { border-radius: 999px; }
.bar .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.bar .actions button { border-radius: 999px; font-size: 13px; font-weight: 600; padding: 4px 10px; background: var(--surface); }

.shiftpanel { background: var(--panel); border-radius: 16px; padding: 12px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 10px; }
.shiftrow { display: flex; align-items: center; gap: 10px; justify-content: center; }
.shiftpanel .segmented { width: 190px; }
.seats { min-width: 60px; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.stepper button { border: 0; border-radius: 0; padding: 3px 12px; font-size: 18px; line-height: 1.1; }
.stepper button + button { border-left: 1px solid var(--line); }

.menu .header { padding: 4px 14px 6px; font-size: 12px; color: var(--secondary); font-weight: 600; }
.menu button { display: flex; justify-content: space-between; gap: 16px; }
.menu button .check { width: 18px; display: inline-block; }
.menu button:focus-visible { outline: none; background: #e5e5ea; }
.menu button .more { color: var(--secondary); }
.menu button:hover:not(:disabled) .more { color: #fff; }
.menu button.open { background: #e5e5ea; }

.popover { position: absolute; z-index: 15; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.labelbox { display: flex; gap: 8px; align-items: center; }
.labelbox input { width: 250px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.colorbox { width: 340px; display: flex; flex-direction: column; gap: 12px; }
.colorbox h4 { margin: 0; font-size: 16px; }
.swatches { display: grid; grid-template-columns: repeat(7, 36px); gap: 8px; justify-content: space-between; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); padding: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.swatch:hover { filter: brightness(.95); }
.colorbox .nocolor { align-self: flex-start; }

.strip {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(640px, calc(100% - 32px));
  background: var(--panel); border-radius: 16px; padding: 12px; box-shadow: 0 -2px 16px rgba(0,0,0,.15);
  display: flex; flex-direction: column; gap: 8px; z-index: 10;
}
.strip .head { display: flex; justify-content: space-between; align-items: center; }
.strip .head span { font-size: 14px; font-weight: 600; color: var(--secondary); }
.strip .head button { border: 0; font-weight: 600; padding: 2px 4px; }
.strip .labelsnote { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--secondary); }
.strip .labelsnote button { border: 0; font-weight: 600; font-size: 13px; padding: 0; }
.strip .field { display: flex; gap: 8px; align-items: center; }
.strip .field .round { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(120,120,128,.15); padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.strip .field .round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.strip .field .skip { border: 0; border-radius: 999px; background: rgba(120,120,128,.15); font-weight: 600; height: 34px; }
.strip .field input { flex: 1; min-width: 0; border: 0; background: rgba(120,120,128,.12); border-radius: 10px; padding: 9px 12px; font-size: 16px; outline: none; }
.strip .field input:focus { box-shadow: 0 0 0 2px rgba(0,122,255,.4); }
.chips { display: flex; gap: 6px; overflow-x: auto; align-items: center; min-height: 36px; padding-bottom: 2px; scrollbar-width: thin; }
.chips .section { font-size: 12px; font-weight: 600; color: var(--secondary); padding: 0 2px 0 6px; white-space: nowrap; }
.chips .hintline { font-size: 13px; color: var(--secondary); }
.chip { border: 0; border-radius: 999px; background: rgba(120,120,128,.15); color: var(--text); padding: 7px 12px; font-size: 14px; flex: none; }
.chip.marked { background: var(--accent); color: #fff; font-weight: 600; }
.chip.marked:hover { background: #0066d6 !important; }
.picked { display: flex; flex-direction: column; gap: 8px; }
.picked .name { display: flex; align-items: center; gap: 8px; }
.picked .dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(120,120,128,.4); flex: none; }
.picked .name strong { font-size: 16px; }
.picked .name .parthint { font-size: 12px; color: var(--secondary); flex: 1; }
.picked .name button { border: 0; color: var(--secondary); font-size: 18px; padding: 0 4px; }
.parts { display: flex; gap: 5px; }
.parts button { flex: 1; border: 0; border-radius: 9px; background: rgba(120,120,128,.15); color: var(--text); font-weight: 600; min-height: 36px; font-variant-numeric: tabular-nums; }
.parts button.on { background: var(--accent); color: #fff; }
.strip .segmented button { font-size: 13px; }

dialog.bulk { width: min(460px, calc(100% - 32px)); max-width: none; display: none; flex-direction: column; gap: 8px; }
dialog.bulk[open] { display: flex; }
.bulkbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bulk textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #f2f2f7; resize: vertical; font-size: 15px; }
.bulk textarea:focus, .labelbox input:focus { outline: 2px solid rgba(0,122,255,.4); outline-offset: 0; }

/* ---- Step 3: files and printing -------------------------------------------------------- */
.pronote { margin: 0; font-size: 13px; color: var(--secondary); background: var(--surface); border-radius: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); }
.printscreen { position: fixed; inset: 0; z-index: 40; background: #f2f2f7; display: flex; flex-direction: column; }
.printbar { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.printbar strong { font-size: 17px; }
.printbody { flex: 1; display: flex; min-height: 0; }
.printform { width: 300px; flex: none; padding: 16px 14px; overflow-y: auto; border-right: 1px solid var(--line); }
.printform section { background: var(--surface); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.printform h3 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--secondary); }
.layer { display: flex; justify-content: space-between; }
.layer span { color: var(--secondary); }
.printpreview { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; min-width: 0; }
.printpreview svg { background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
.printout { position: fixed; left: -20000px; top: 0; width: 792px; height: 612px; }
.folderlist { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 14px; max-height: 50vh; overflow-y: auto; }
.folderlist button { text-align: left; display: flex; justify-content: space-between; gap: 16px; color: var(--text); }
.folderlist button span { color: var(--secondary); }
.drophint { position: fixed; inset: 12px; z-index: 50; border: 3px dashed var(--accent); border-radius: 18px; background: rgba(0,122,255,.08); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; color: var(--accent); pointer-events: none; }

/* Printing: Letter, landscape. Browsers that don't take the page size from here print the
   page turned a quarter turn on portrait paper instead, so it always fills the sheet. */
@page { size: 11in 8.5in; margin: 0; }
@media print and (orientation: portrait) {
  .printout { width: 8.5in !important; height: 11in !important; overflow: hidden; }
  .printout svg { transform-origin: 0 0; transform: translate(8.5in, 0) rotate(90deg); }
}
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  body > *:not(.printout) { display: none !important; }
  .printout { position: static; width: 11in; height: 8.5in; }
  .printout svg { width: 11in; height: 8.5in; display: block; }
}

/* ---- Step 4: phones (laid out like the iPhone app) and touch ----------------------------- */
.more, .sheethead, .chartbuttons { display: none; }
body.compact .topbar { height: auto; flex-wrap: wrap; padding: 8px 10px; row-gap: 6px; column-gap: 6px; }
body.compact #newChart, body.compact #openFile { display: none; }
body.compact .mark svg { width: 34px; height: 17px; }
body.compact .mark span { font-size: 7px; letter-spacing: 1.6px; margin-right: -1.6px; }
body.compact .topbar button { padding: 5px 9px; font-size: 14px; }
body.compact .topbar .more { display: inline-block; }
body.compact .title { order: 10; flex: 1 1 100%; width: auto; max-width: none; text-align: center; }
body.compact .setup {
  position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 48%; min-height: 220px; z-index: 25;
  border-right: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -3px 16px rgba(0,0,0,.15); padding-top: 0;
  transform: translateY(105%); transition: transform .3s ease; visibility: hidden;
}
body.compact.sheet .setup { transform: none; visibility: visible; }
body.compact .sheethead { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1;
  background: var(--panel); padding: 10px 2px 6px; margin: 0 -2px; }
body.compact .sheethead button { border-radius: 999px; }
body.compact .setup > #addRow, body.compact .setup > #quickAssign { display: none; }
body.compact .chartbuttons { display: flex; position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  flex-direction: column; align-items: center; gap: 12px; z-index: 5; }
body.compact.sideways .chartbuttons { left: auto; right: 16px; bottom: auto; top: 50%; transform: translateY(-50%); align-items: flex-end; }
body.compact.sideways .chartbuttons .pair { flex-direction: column; align-items: flex-end; }
body.compact.sheet .chartbuttons, body.compact.assigning .chartbuttons { display: none; }
.chartbuttons .pair { display: flex; gap: 12px; }
.chartbuttons button { border-radius: 999px; padding: 9px 16px; font-size: 16px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.chartbuttons button.quick { background: #fff; }
body.compact .labelbox { flex-wrap: wrap; width: min(340px, calc(100% - 16px)); }
body.compact .labelbox input { flex: 1 1 100%; width: auto; }
body.compact .colorbox { width: min(340px, calc(100% - 16px)); }
body.compact .swatches { grid-template-columns: repeat(7, 1fr); }
body.compact .swatch { width: 100%; height: auto; aspect-ratio: 1; }
body.compact .strip { bottom: 0; width: 100%; border-radius: 16px 16px 0 0; }
body.compact .printbody { flex-direction: column; }
body.compact .printform { width: auto; order: 2; max-height: 45%; border-right: 0; border-top: 1px solid var(--line); }
body.compact .printpreview { order: 1; padding: 12px; }
body.compact .printbar button { padding: 5px 9px; font-size: 14px; }
body.compact .bar { padding: 6px 8px 6px 12px; }
body.compact .menu { min-width: 0; max-width: calc(100vw - 16px); }
.topbar .ico { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
body.compact .topbar .ico { display: inline-block; }
body.compact .topbar .txt { display: none; }
body.compact .topbar #print, body.compact .topbar #download { padding: 4px 8px; }
body.compact.sideways .title { order: 0; flex: 1 1 auto; text-align: left; }
body.compact.sideways .topbar .spacer { display: none; }
/* Tablets held upright and other middling widths: Print and Download as icons too. */
body.narrow .topbar .ico { display: inline-block; }
body.narrow .topbar .txt { display: none; }
body.narrow .title { width: 20ch; }
/* Phones: the mark, Undo and Redo, Print, Download, Get the App and ··· on one line. */
body.compact .topbar { column-gap: 4px; padding: 8px 8px; }
body.compact .topbar .group button { padding: 4px 3px; }
body.compact .topbar #print, body.compact .topbar #download { padding: 4px 6px; }
body.compact .topbar #getApp, body.compact .topbar #more { padding: 5px 8px; }

/* ---- Keyboard shortcuts: hints on buttons and the legend (John, 2026-11-10) ------------- */
.key, .keysbutton { display: none; }
body.keys .key {
  display: inline-block; margin-left: 6px; padding: 0 4px; min-width: 16px; border: 1px solid currentColor; border-radius: 4px;
  font: 600 10px/14px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; text-transform: uppercase; opacity: .6;
  vertical-align: 1px; letter-spacing: 0; text-align: center;
}
.setup h3 .key { vertical-align: 0; }
body.keys .keysbutton {
  display: inline-flex; position: absolute; top: 10px; right: 12px; z-index: 6; width: 36px; height: 36px; padding: 0;
  align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
.keysbutton svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.keysbox { top: 54px; right: 12px; width: 320px; max-height: calc(100% - 70px); overflow-y: auto; }
.keysbox h4 { margin: 0 0 8px; font-size: 15px; }
.keysbox h5 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--secondary); }
.keysbox table { border-collapse: collapse; width: 100%; font-size: 13px; }
.keysbox td { padding: 3px 0; vertical-align: top; }
.keysbox td:first-child { width: 118px; padding-right: 8px; }
.keysbox kbd { display: inline-block; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font: 600 11px/18px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; background: #fafafa; }
