:root {
  color-scheme: dark;
  --bg: #171b22;
  --panel: #202630;
  --panel-2: #252d39;
  --panel-3: #2e3847;
  --line: #2b3440;
  --line-2: #465160;
  --text: #edf2f8;
  --muted: #8998ac;
  --gold: #d5b16c;
  --gold-2: #e0bd70;
  --gold-dim: #352c1c;
  --green: #347a43;
  --orange: #d27621;
  --red: #b92727;
  --blue: #63b3ff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(10px + var(--safe-top)) 16px calc(7px + var(--safe-bottom)); gap: 8px; max-width: 1920px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.period-controls { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; min-width: 0; }
.nav-button { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: #f5f7fa; font-size: 26px; line-height: 24px; display: grid; place-items: center; padding: 0 0 3px; cursor: pointer; }
.period-label { color: #e7edf5; font-size: 14px; font-weight: 700; min-width: 180px; height: 32px; border: 1px solid transparent; border-radius: 6px; background: transparent; white-space: nowrap; cursor: pointer; }
.period-label:hover { background: var(--panel-2); border-color: var(--line); }
.today-btn { min-height: 30px; padding: 0 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: #e0e6ee; font-size: 11px; font-weight: 650; cursor: pointer; }
.today-btn:disabled { opacity: .42; }
.toolbar-spacer { flex: 1; }
.view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #171c24; border: 1px solid var(--line); border-radius: 9px; flex: 0 0 auto; }
.view-button { min-width: 73px; height: 32px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 0; border-radius: 6px; color: #c2ccd9; font-size: 12px; font-weight: 650; cursor: pointer; }
.view-button.active { color: #2d2619; background: var(--gold); box-shadow: inset 0 0 0 1px #e2c17d; }
.view-icon { font-size: 15px; line-height: 1; }
.icon-button { flex: 0 0 auto; width: 35px; height: 35px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); color: #dce3ec; font-size: 19px; font-weight: 700; cursor: pointer; }
.add-button { background: var(--gold); border-color: #e2c17d; color: #261f13; font-size: 25px; line-height: 1; }
.menu-button { font-size: 15px; letter-spacing: -2px; padding-right: 2px; }
.filter-strip { display: flex; flex: 0 0 auto; align-items: stretch; gap: 7px; padding: 0 0 2px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-strip::-webkit-scrollbar { display: none; }
.filter-control { appearance: none; flex: 0 0 auto; min-width: 80px; min-height: 52px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 8px; cursor: pointer; color: var(--text); }
.filter-control:hover { background: var(--panel-2); border-color: var(--line-2); }
.filter-caption { font-size: 9px; letter-spacing: .13em; color: var(--muted); font-weight: 750; }
.filter-control strong { font-size: 14px; font-weight: 750; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.filter-hint { display: none; color: #6e7b8d; font-size: 9px; }
.freerolls-pill { min-height: 52px; flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 5px 9px 5px 6px; border: 1px solid #493b19; border-radius: 7px; background: #29271f; color: #e7e2d4; font-size: 11px; font-weight: 750; cursor: pointer; }
.freerolls-pill[aria-pressed="false"] { background: var(--panel); border-color: var(--line); color: #a2aab6; }
.ticket-icon { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); }
.freerolls-pill[aria-pressed="false"] .ticket-icon { background: #555b64; }
.ticket-icon svg { width: 19px; height: 19px; fill: #201a0f; }
.ticket-icon .ticket-cut { fill: none; stroke: #201a0f; stroke-width: 1.4; stroke-dasharray: 1.8 1.8; }
.toggle-dot { width: 24px; height: 14px; border-radius: 10px; position: relative; background: #4b525e; margin-left: 2px; }
.toggle-dot::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #dfe4eb; transition: transform .15s; }
.freerolls-pill[aria-pressed="true"] .toggle-dot { background: #96731a; }
.freerolls-pill[aria-pressed="true"] .toggle-dot::after { transform: translateX(10px); background: white; }
.filter-count { flex: 0 0 auto; min-width: 54px; align-self: center; display: flex; flex-direction: column; text-align: right; padding: 0 5px; }
.filter-count strong { color: #dce4ee; font-size: 13px; font-weight: 750; }
.filter-count span { font-size: 9px; color: var(--muted); }
.status-message { flex: 0 0 auto; min-height: 0; font-size: 11px; line-height: 1.35; color: #aab7c8; padding: 0 2px; }
.status-message:empty { display: none; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; align-items: stretch; flex: 1 1 auto; min-height: 230px; overflow: hidden; }
.week-grid.day-view { display: block; overflow: auto; min-height: 0; }
.day-column { min-width: 0; min-height: 210px; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; display: flex; flex-direction: column; overflow: hidden; }
.day-column.today { border: 2px solid var(--gold); }
.day-column.selected:not(.today) { border-color: #e5e9ef; box-shadow: inset 0 0 0 1px #e5e9ef; }
.day-header { flex: 0 0 auto; padding: 7px 5px 4px; background: #1d232c; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.day-headline { display: flex; align-items: center; gap: 3px; min-width: 0; }
.day-name { color: #b4c0d0; font-size: 10px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-column.today .day-name { color: #fff; }
.day-total, .day-count { min-width: 26px; height: 20px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; white-space: nowrap; font-size: 10px; line-height: 1; font-weight: 750; }
.day-total { background: var(--gold-dim); border: 1px solid #80652f; color: var(--gold-2); }
.day-count { border: 1px solid #465365; background: #303a49; color: #dce3ec; cursor: pointer; }
.day-count:active { background: #405064; }
.day-number { color: #f3f5f7; font-size: 25px; line-height: 1.1; font-weight: 700; padding: 2px 0 3px; }
.day-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #3d4654 transparent; -webkit-overflow-scrolling: touch; }
.day-content::-webkit-scrollbar { width: 4px; }
.day-content::-webkit-scrollbar-thumb { background: #3d4654; border-radius: 5px; }
.empty-day { color: #6f7b8c; font-size: 11px; padding: 18px 7px; text-align: center; }
.tournament-row { min-width: 0; padding: 3px 3px 4px; border-bottom: 1px solid #303741; display: flex; flex-direction: column; gap: 1px; position: relative; }
.tournament-row:last-child { border-bottom: 0; }
.row-mainline { display: grid; grid-template-columns: 40px 39px minmax(0, 1fr) 23px; gap: 2px; align-items: center; min-width: 0; min-height: 23px; }
.row-subline { display: grid; grid-template-columns: 40px 39px minmax(0, 1fr) 23px; gap: 2px; align-items: center; min-width: 0; min-height: 21px; }
.row-time, .row-buyin, .row-name, .row-prize, .row-players { appearance: none; border: 0; min-width: 0; margin: 0; background: transparent; color: var(--text); padding: 1px 2px; border-radius: 3px; cursor: text; text-align: left; }
.row-time { font-size: 10px; color: var(--gold-2); font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-buyin { font-size: 10px; color: var(--gold-2); font-weight: 800; text-align: right; white-space: nowrap; }
.row-name { font-size: 10px; line-height: 1.25; font-weight: 750; color: #edf2f8; min-height: 19px; overflow: hidden; text-overflow: clip; white-space: nowrap; padding: 2px 4px; }
.row-name.speed-regular { background: var(--green); color: #fff; border-radius: 9px; }
.row-name.speed-turbo { background: var(--orange); color: #fff6e9; border-radius: 9px; }
.row-name.speed-hyper { background: var(--red); color: #fff1f1; border-radius: 9px; }
.row-name.exclusive:not(.speed-regular):not(.speed-turbo):not(.speed-hyper) { color: var(--blue); font-weight: 700; }
.row-buyin.free { color: #111; }
.row-name.free-name:not(.speed-regular):not(.speed-turbo):not(.speed-hyper) { color: #000; background: #c5cbd4; }
.row-name:active, .row-time:active, .row-buyin:active, .row-prize:active { background-color: #384354; }
.row-prize { grid-column: 3 / 4; font-size: 9px; color: #bdc5d0; font-weight: 600; line-height: 1.2; min-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-players { grid-column: 4 / 5; color: #8292a7; font-size: 9px; white-space: nowrap; cursor: default; }
.table-size-badge { grid-column: 2 / 3; width: 22px; height: 14px; display: inline-flex; justify-self: center; align-items: center; justify-content: center; border-radius: 12px; background: #000; color: #fff; font-family: Arial, sans-serif; font-size: 9px; font-weight: 800; line-height: 1; cursor: pointer; }
.table-size-badge:empty { visibility: hidden; }
.row-options { width: 22px; height: 23px; justify-self: end; align-self: center; border: 0; border-radius: 5px; background: transparent; color: #77869a; font-size: 14px; line-height: 18px; padding: 0; cursor: pointer; }
.row-options:active, .row-options:hover { color: #fff; background: #384354; }
.inline-edit { width: 100%; min-width: 0; height: 24px; border: 1px solid var(--gold); background: #151a21; color: #fff; border-radius: 4px; padding: 2px 4px; font-size: 11px; }
/* Day view mirrors the macOS table: TIME / TOURNAMENT / BUY-IN / PRIZE POOL. */
.day-view .day-column { height: auto; min-height: 260px; border-color: var(--gold); }
.day-view .day-header { padding: 8px 10px 7px; cursor: default; }
.day-view .day-headline { display: flex; }
.day-view .day-name { font-size: 11px; }
.day-view .day-number { font-size: 25px; }
.day-view .day-content { overflow: visible; }
.day-view .tournament-row { padding: 0; gap: 0; }
.day-view .row-mainline { grid-template-columns: 62px minmax(90px, 1fr) 76px 28px; gap: 7px; padding: 2px 6px; min-height: 31px; }
.day-view .row-time { font-size: 11px; }
.day-view .row-buyin { font-size: 11px; text-align: left; }
.day-view .row-name { font-size: 12px; }
.day-view .row-subline { grid-template-columns: 62px minmax(90px, 1fr) 76px 28px; gap: 7px; padding: 0 6px 4px; }
.day-view .table-size-badge { grid-column: 2 / 3; justify-self: start; width: 24px; height: 15px; }
.day-view .row-prize { grid-column: 3 / 4; font-size: 10px; }
.day-view .row-players { grid-column: 4 / 5; font-size: 10px; }
.app-footer { min-height: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 9px; color: #738196; }
#offline-status { color: #91bd99; }
/* Modal sheets: large hit targets, bottom-sheet presentation on iPhone. */
dialog.sheet-dialog { border: 1px solid #465160; border-radius: 16px; background: #202630; color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: min(88dvh, 820px); overflow-y: auto; box-shadow: 0 20px 75px #000b; }
dialog.sheet-dialog::backdrop { background: #080b10b8; backdrop-filter: blur(3px); }
.sheet-dialog form { padding: 16px; }
.sheet-grabber { display: none; width: 38px; height: 4px; border-radius: 5px; background: #647184; margin: 0 auto 13px; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.eyebrow { font-size: 9px; font-weight: 800; letter-spacing: .15em; color: var(--muted); }
.sheet-heading h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.18; letter-spacing: -.02em; }
.close-button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: #293240; color: #e5eaf1; font-size: 24px; line-height: 22px; cursor: pointer; flex: 0 0 auto; }
.sheet-help { color: #a3b0c0; font-size: 12px; line-height: 1.45; margin: -5px 0 14px; }
.control-input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #465160; border-radius: 8px; color: #f4f6fa; background: #151a21; font-size: 17px; font-weight: 650; }
.control-stepper { display: flex; gap: 9px; align-items: center; }
.control-stepper button { flex: 0 0 55px; min-height: 46px; border: 1px solid var(--line-2); border-radius: 8px; background: #2a3443; color: #f2f4f8; font-size: 24px; }
.control-stepper .control-input { text-align: center; }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.sheet-actions button, .action-row, .choice-button { min-height: 43px; padding: 9px 13px; border-radius: 8px; border: 1px solid var(--line-2); background: #2b3544; color: #e4eaf3; font-size: 12px; font-weight: 700; cursor: pointer; }
.sheet-actions .secondary-button { background: #2b3544; }
.sheet-actions .gold-button, .gold-button { background: var(--gold); border-color: #e1c17d; color: #2b2417; }
.sheet-actions .danger-button, .danger-button { background: #3f2526; border-color: #754041; color: #ffb8b3; }
.sheet-actions .action-spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #c5cfdd; font-weight: 650; }
.field input, .field select { width: 100%; min-height: 42px; border: 1px solid #465160; border-radius: 8px; background: #151a21; color: #f1f4f9; padding: 10px; font-size: 14px; }
.full-field { grid-column: 1 / -1; }
.recurrence-field small { font-size: 10px; line-height: 1.4; color: #8d9bad; font-weight: 400; }
.edit-message { font-size: 11px; color: #a7c7ac; margin-top: 10px; }
.sheet-footnote { font-size: 10px; line-height: 1.4; color: #8290a2; margin: 11px 0 0; }
.action-content { display: flex; flex-direction: column; gap: 7px; }
.action-row { display: flex; align-items: center; gap: 11px; text-align: left; width: 100%; min-height: 53px; padding: 10px 12px; }
.action-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.action-row strong { color: #eef2f7; font-size: 13px; }
.action-row small { color: #9aa8ba; font-size: 10px; font-weight: 450; line-height: 1.35; }
.action-icon { width: 31px; height: 31px; flex: 0 0 31px; border-radius: 8px; display: grid; place-items: center; background: #374253; color: var(--gold-2); font-size: 18px; }
.action-chevron { color: #8d9aab; font-size: 23px; font-weight: 400; }
.action-section-title { font-size: 10px; letter-spacing: .12em; color: #8796a9; font-weight: 800; margin: 11px 0 2px; }
.choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.choice-button { text-align: center; min-width: 0; }
.choice-button.selected { border-color: var(--gold); background: #3a3426; color: #ffe6a8; }
.choice-button.speed-regular { border-color: #347a43; background: #253d2d; }
.choice-button.speed-turbo { border-color: #d27621; background: #52351c; }
.choice-button.speed-hyper { border-color: #b92727; background: #492528; }
.copy-date-row { display: flex; flex-direction: column; gap: 7px; margin-top: 5px; }
.copy-date-row input { width: 100%; min-height: 43px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: #151a21; color: white; }
.menu-note { margin: 8px 2px 0; font-size: 10px; line-height: 1.45; color: #8796a8; }
.loading, .no-entries { padding: 28px 12px; color: var(--muted); text-align: center; }
@media (max-width: 1100px) {
  .toolbar { gap: 9px; }
  .period-label { min-width: 165px; }
  .week-grid { grid-template-columns: repeat(7,minmax(76px,1fr)); gap: 5px; }
  .day-name { font-size: 9px; }
  .day-total, .day-count { padding: 0 3px; font-size: 9px; }
  .row-mainline, .row-subline { grid-template-columns: 36px 35px minmax(0,1fr) 19px; }
  .row-name { font-size: 9px; }
}
@media (max-width: 760px) {
  .app-shell { padding: calc(7px + var(--safe-top)) 10px calc(6px + var(--safe-bottom)); gap: 7px; min-height: 100dvh; }
  .toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; grid-template-areas: "period period period period" "switch add menu spacer"; gap: 7px; align-items: center; }
  .period-controls { grid-area: period; width: 100%; gap: 5px; }
  .nav-button { width: 35px; height: 36px; border-radius: 8px; font-size: 27px; }
  .period-label { flex: 1 1 auto; min-width: 0; font-size: 15px; text-align: center; }
  .today-btn { min-height: 35px; padding: 0 10px; font-size: 11px; }
  .toolbar-spacer { display: none; }
  .view-switch { grid-area: switch; justify-self: start; }
  .view-button { min-width: 75px; height: 34px; }
  .add-button { grid-area: add; width: 39px; height: 39px; }
  .menu-button { grid-area: menu; width: 39px; height: 39px; }
  .filter-strip { gap: 6px; margin: 0 -2px; padding: 0 2px 3px; }
  .filter-control { min-width: 72px; min-height: 55px; padding: 4px 6px; }
  .filter-caption { font-size: 9px; }
  .filter-control strong { font-size: 13px; }
  .freerolls-pill { min-height: 55px; padding-right: 8px; gap: 6px; font-size: 11px; }
  .ticket-icon { width: 28px; height: 28px; flex-basis: 28px; }
  .filter-count { min-width: 48px; padding-right: 2px; }
  .filter-count strong { font-size: 12px; }
  .status-message { padding: 0 1px; font-size: 10px; }
  .week-grid { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-height: 0; height: calc(100dvh - 218px - var(--safe-top) - var(--safe-bottom)); flex: 1 1 auto; align-items: stretch; padding: 0 1px 3px; margin: 0 -1px; overscroll-behavior-x: contain; }
  .week-grid::-webkit-scrollbar { display: none; }
  .day-column { flex: 0 0 min(79vw, 335px); width: min(79vw, 335px); max-width: calc(100vw - 20px); min-height: 0; height: 100%; scroll-snap-align: start; border-radius: 9px; }
  .day-header { padding: 8px 8px 5px; }
  .day-name { font-size: 11px; }
  .day-total, .day-count { height: 22px; min-width: 35px; font-size: 10px; padding: 0 5px; }
  .day-number { font-size: 27px; padding: 4px 0 5px; }
  .tournament-row { padding: 5px 5px 6px; gap: 2px; }
  .row-mainline, .row-subline { grid-template-columns: 49px 43px minmax(0,1fr) 26px; gap: 3px; }
  .row-mainline { min-height: 28px; }
  .row-subline { min-height: 23px; }
  .row-time { font-size: 11px; }
  .row-buyin { font-size: 11px; }
  .row-name { font-size: 11px; min-height: 22px; padding: 3px 5px; }
  .row-prize { font-size: 10px; min-height: 19px; }
  .row-players { font-size: 9px; }
  .table-size-badge { width: 25px; height: 16px; font-size: 10px; }
  .row-options { width: 26px; height: 28px; font-size: 19px; }
  .week-grid.day-view { display: block; height: auto; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; padding: 0; margin: 0; }
  .day-view .day-column { display: flex; flex: 0 0 auto; width: 100%; max-width: 100%; height: auto; min-height: 0; overflow: visible; border-width: 2px; }
  .day-view .day-header { padding: 10px 10px 7px; }
  .day-view .day-content { overflow: visible; }
  .day-view .tournament-row { padding: 3px 4px; }
  .day-view .row-mainline { grid-template-columns: 48px minmax(0,1fr) 55px 26px; gap: 5px; padding: 2px 4px; min-height: 29px; }
  .day-view .row-subline { grid-template-columns: 48px minmax(0,1fr) 55px 26px; gap: 5px; padding: 0 4px 3px; min-height: 21px; }
  .day-view .row-time { font-size: 10px; }
  .day-view .row-buyin { font-size: 10px; }
  .day-view .row-name { font-size: 11px; }
  .day-view .row-prize { font-size: 10px; }
  .day-view .row-options { width: 25px; }
  .app-footer { padding-top: 0; font-size: 9px; }
  dialog.sheet-dialog { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: min(88dvh, 830px); margin: 0; border-radius: 17px 17px 0 0; border-bottom: 0; padding-bottom: var(--safe-bottom); }
  .sheet-dialog form { padding: 7px 16px 16px; }
  .sheet-grabber { display: block; }
  .sheet-heading h2 { font-size: 22px; }
  .field { font-size: 12px; }
  .field input, .field select { min-height: 44px; font-size: 16px; }
  .sheet-actions { gap: 7px; }
  .sheet-actions button { min-height: 45px; }
  .edit-actions { flex-wrap: wrap; }
  .edit-actions .action-spacer { flex-basis: 100%; }
  .edit-actions #save-btn { flex: 1 1 100%; }
  .control-sheet .sheet-actions button { flex: 1; }
}
@media (max-width: 380px) {
  .app-shell { padding-left: 8px; padding-right: 8px; }
  .period-label { font-size: 13px; }
  .today-btn { padding: 0 7px; }
  .filter-control { min-width: 68px; }
  .day-column { flex-basis: 82vw; }
  .freerolls-pill { gap: 5px; }
  .day-view .row-mainline { grid-template-columns: 44px minmax(0,1fr) 49px 24px; gap: 3px; }
  .day-view .row-subline { grid-template-columns: 44px minmax(0,1fr) 49px 24px; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; } }
/* Last-mile parity details: the app fills the screen and matches macOS name styling. */
.app-shell { height: 100dvh; min-height: 520px; overflow: hidden; }
.row-name.free-name { color: #000 !important; background: transparent !important; }
.row-name.free-name.speed-regular { color: #000 !important; background: var(--green) !important; }
.row-name.free-name.speed-turbo { color: #000 !important; background: var(--orange) !important; }
.row-name.free-name.speed-hyper { color: #000 !important; background: var(--red) !important; }
@media (max-width: 760px) {
  .app-shell { min-height: 560px; }
  .week-grid { min-height: 0; }
}
/* The Day view uses the same four aligned data columns as the macOS table. */
.day-table-heading { display: grid; grid-template-columns: 62px minmax(90px,1fr) 76px minmax(120px,1fr) 28px; gap: 7px; align-items: center; min-height: 25px; }
.table-head-group { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.column-label { min-width: 0; color: #8998ac; font-size: 10px; font-weight: 700; letter-spacing: .035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-view-header .day-count, .day-view-header .day-total { flex: 0 0 auto; height: 22px; min-width: 26px; }
.day-view .row-mainline { grid-template-columns: 62px minmax(90px,1fr) 76px minmax(120px,1fr) 28px; gap: 7px; }
.day-view .row-mainline .row-prize { grid-column: 4 / 5; min-height: 20px; font-size: 11px; }
.day-view .row-subline { grid-template-columns: 62px minmax(90px,1fr) 76px minmax(120px,1fr) 28px; gap: 7px; }
.day-view .row-subline .row-players { grid-column: 4 / 5; }
.day-view .subline-spacer { min-width: 0; }
@media (max-width: 760px) {
  .day-table-heading { grid-template-columns: 48px minmax(72px,1fr) 55px minmax(76px,1fr) 25px; gap: 5px; }
  .column-label { font-size: 9px; letter-spacing: 0; }
  .day-view-header .day-count, .day-view-header .day-total { height: 21px; min-width: 23px; padding: 0 3px; font-size: 9px; }
  .day-view .row-mainline { grid-template-columns: 48px minmax(72px,1fr) 55px minmax(76px,1fr) 25px; gap: 5px; }
  .day-view .row-subline { grid-template-columns: 48px minmax(72px,1fr) 55px minmax(76px,1fr) 25px; gap: 5px; }
  .day-view .row-mainline .row-prize { font-size: 10px; }
}
@media (max-width: 380px) {
  .day-table-heading { grid-template-columns: 44px minmax(65px,1fr) 50px minmax(64px,1fr) 24px; gap: 3px; }
  .day-view .row-mainline { grid-template-columns: 44px minmax(65px,1fr) 50px minmax(64px,1fr) 24px; gap: 3px; }
  .day-view .row-subline { grid-template-columns: 44px minmax(65px,1fr) 50px minmax(64px,1fr) 24px; gap: 3px; }
}


/* iPhone fit-and-spacing pass: preserve the Mac styling while preventing flex shrink
   from collapsing the two-row toolbar on Day view. */
.app-shell > .toolbar,
.app-shell > .filter-strip,
.app-shell > .status-message,
.app-shell > .app-footer { flex-shrink: 0; }
.day-summary-line { display: none; }

@media (max-width: 760px) {
  .app-shell {
    height: 100dvh;
    min-height: 0;
    padding-top: calc(7px + var(--safe-top));
    padding-bottom: calc(6px + var(--safe-bottom));
  }
  .toolbar { flex: 0 0 auto; min-height: 84px; }
  .period-controls, .view-switch, .add-button, .menu-button { min-width: 0; }
  .filter-strip { flex: 0 0 auto; min-height: 55px; gap: 5px; touch-action: pan-x; }
  .filter-control { min-width: 64px; padding-left: 4px; padding-right: 4px; }
  .week-grid { flex: 1 1 0; min-height: 0; }
  .row-name { text-overflow: ellipsis; }
  .day-view-header { display: flex; flex-direction: column; gap: 6px; }
  .day-view-header .day-summary-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-height: 22px;
    margin-bottom: 1px;
  }
  .day-summary-label {
    margin-right: auto;
    font-size: 9px;
    line-height: 1;
    letter-spacing: .04em;
    font-weight: 750;
    color: var(--muted);
  }
  .day-view-header .table-head-group .day-count,
  .day-view-header .table-head-group .day-total { display: none; }
  .day-table-heading {
    grid-template-columns: 44px minmax(70px, 1.15fr) 48px minmax(70px, 1fr) 26px;
    gap: 4px;
    min-height: 24px;
  }
  .day-view .row-mainline,
  .day-view .row-subline {
    grid-template-columns: 44px minmax(70px, 1.15fr) 48px minmax(70px, 1fr) 26px;
    gap: 4px;
  }
  .day-view .row-mainline { min-height: 30px; padding: 3px 4px 1px; }
  .day-view .row-subline { min-height: 23px; padding: 0 4px 5px; }
  .day-view .row-name { min-width: 0; font-size: 11px; text-overflow: ellipsis; }
  .day-view .row-time { font-size: 10px; }
  .day-view .row-buyin { font-size: 10px; }
  .day-view .row-mainline .row-prize { min-width: 0; font-size: 10px; text-overflow: ellipsis; }
  .day-view .row-players { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
  .day-view .row-options { width: 28px; height: 32px; justify-self: center; }
  .day-view .table-size-badge { width: 25px; height: 18px; }
  .inline-edit { min-height: 29px; height: 29px; font-size: 16px; }
}

/* Landscape on iPhone: do not force a portrait-sized minimum page height. */
@media (max-height: 500px) and (orientation: landscape) {
  .app-shell { height: 100dvh; min-height: 0; padding-top: calc(4px + var(--safe-top)); padding-bottom: calc(4px + var(--safe-bottom)); gap: 5px; }
  .toolbar, .filter-strip, .status-message, .app-footer { flex-shrink: 0; }
  .week-grid { min-height: 0; }
}
