:root {
  color-scheme: light;
  --ink: #172b3b;
  --muted: #4b6172;
  --paper: #fff;
  --ground: #edf3f5;
  --line: #ccd8e0;
  --blue: #264ebe;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell {
  width: min(100%, 560px);
  margin-inline: auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}
.masthead { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--blue); color: #fff; border-radius: 13px; }
.mark svg { width: 26px; }
.brand { font-size: 22px; line-height: 1.12; font-weight: 750; color: var(--ink); margin: 0; }
.subtitle { font-size: 13px; margin: 3px 0 0; }
nav { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; background: #dfe9ed; border-radius: 13px; }
nav button { flex: 1; padding: 0 5px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; white-space: nowrap; font-size: 14px; }
nav [aria-current] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px #172b3b16; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: clamp(17px, 5vw, 28px); }
h1 { margin: 0; font-size: clamp(24px, 6vw, 34px); letter-spacing: -.035em; line-height: 1.13; }
h2 { margin: 22px 0 6px; font-size: 17px; }
p { color: var(--muted); line-height: 1.45; }
.panel p { margin: 8px 0 16px; }
label, legend { display: block; font-weight: 650; font-size: 15px; }
label[for] { margin: 14px 0 6px; }
input, select, textarea, button { font-family: inherit; font-size: 16px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid #a5b9c6;
  border-radius: 8px;
  background: #f8fbfc;
  color: var(--ink);
}
input:disabled { opacity: .7; }
.ticket {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 16px 0 0;
  padding: 13px 16px;
  background: #e5edfd;
  border: 1px dashed #8da9e7;
  border-radius: 10px;
  color: #223f7c;
  font-size: 13px;
}
.ticket output { display: block; color: #193a89; font-weight: 750; font-size: clamp(25px, 8vw, 38px); font-variant-numeric: tabular-nums; line-height: 1.2; }
button { min-height: 44px; font-weight: 650; cursor: pointer; }
.primary, .secondary { width: 100%; margin-top: 14px; border-radius: 8px; padding: 10px; border: 1px solid var(--blue); }
.primary { background: var(--blue); color: #fff; }
.primary:disabled { cursor: default; background: #e4e9f2; border-color: #e4e9f2; color: #586b81; }
.secondary { background: #fff; color: var(--blue); }
:focus-visible { outline: 3px solid #173c9d; outline-offset: 3px; }
.panel .message { margin: 10px 0 0; font-size: 14px; }
.message:empty { display: none; }
.message[data-kind="error"] { color: #9b263d; }
.message[data-kind="success"] { color: #1c664d; }
.rates { padding: 0; list-style: none; margin: 0; color: var(--muted); font-size: 14px; }
.rates li { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 9px 0; }
.rates strong { color: var(--ink); }
.demo { display: flex; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.demo a { color: #1f459f; }

.attendance { padding: 12px 14px; background: #edf3f5; border-radius: 10px; }
.panel .attendance p { margin: 0; }
.shift-list { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.shift-row { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.shift-row strong { color: var(--ink); }
.shift-times { white-space: pre-line; }
.shift-badge { justify-self: start; padding: 3px 8px; border-radius: 5px; background: #edf3f5; font-size: 12px; }
.active-badge { background: #d9f2e6; color: #165643; }
.shift-action { margin-top: 4px; }
.journal-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.journal-filter button { margin: 0; }
@media (max-width: 510px) {
  nav { flex-wrap: wrap; }
  nav button { flex: 1 0 auto; }
}

.operator-total { grid-template-columns: 1fr auto; }
.operator-total > :nth-child(even) { text-align: right; }
.operator-total .operator-open, .operator-total .operator-note { grid-column: 1 / -1; text-align: left; }
.operator-total .operator-open { text-align: center; }
.accounting-reports { margin-top: 18px; }
.accounting-reports summary { padding-block: 8px; cursor: pointer; font-weight: 650; }

.panel .criteria-hint { margin: 4px 0 9px; font-size: 13px; }
.criteria-check { display: flex; align-items: center; gap: 8px; }
.criteria-check input { width: 18px; min-height: 18px; margin: 0; }

.toy-fields { min-width: 0; border: 0; padding: 0; margin: 18px 0 0; }
.toy-fields legend { padding: 0; font-weight: 650; }
.toy-row { display: grid; gap: 9px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.toy-row label { display: grid; gap: 5px; }
.toy-remove { justify-self: start; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--blue); }
.toy-row:only-child .toy-remove { display: none; }

.arcade-total { border-top: 1px solid var(--line); padding: 12px 0; }
.arcade-total h3 { margin: 0 0 8px; font-size: 15px; }
.arcade-revenue { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; margin: 0; font-size: 14px; }
.arcade-revenue dd { margin: 0; font-weight: 650; }
.arcade-toys { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.arcade-toys li { display: grid; gap: 3px; padding: 5px 0; }
.arcade-toys li span, .panel .arcade-total-note { color: var(--muted); font-size: 13px; }
.panel .arcade-total-note { margin: 6px 0 0; }

.operator-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.operator-actions .secondary { width: auto; margin-top: 3px; padding-inline: 12px; font-size: 14px; }
.daily-export { margin: 20px 0; padding: 16px; background: #eef2fc; border: 1px solid #d3ddf5; border-radius: 12px; }
.daily-export h2 { margin-top: 0; }
.panel .daily-export p { font-size: 13px; }
#report-rate { white-space: pre-line; line-height: 1.5; }
.period-tabs { display: flex; gap: 5px; padding: 4px; background: #e3eaf1; border-radius: 10px; }
.period-tabs button { flex: 1; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.period-tabs [aria-pressed="true"] { color: var(--blue); background: white; }
.day-stats,.report-fields { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.3fr); gap: 10px 14px; margin: 0; }
.day-stats { background: #eef2fc; border-radius: 12px; padding: 16px; }
.day-stats dt,.report-fields dt { color: var(--muted); font-size: 13px; }
.day-stats dd,.report-fields dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.day-stats dd { font-weight: 700; }
.daily-report { padding-block: 20px; }
#accounting-delivery { margin-top: 24px; }
#history-feedback[data-kind="success"] { padding: 14px; background: #e9f5ef; border-radius: 10px; line-height: 1.6; }
.praise-dialog { width: min(400px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 26px; border: 0; border-radius: 22px; color: var(--ink); background: white; text-align: center; box-shadow: 0 20px 70px #10293840; }
.praise-dialog::backdrop { background: #10293899; }
.praise-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; color: #a66b00; background: #fff3cd; font-size: 38px; }
.praise-dialog h2 { margin: 0 0 12px; font-size: 29px; }
.praise-dialog p { margin: 12px 0; }
.praise-earnings { display: grid; gap: 8px; margin: 22px 0 12px; padding: 18px 12px; border-radius: 14px; background: #e9f5ef; color: #205c43; }
.praise-earnings span { font-size: 14px; }
.praise-earnings strong { font-size: clamp(25px, 8vw, 38px); line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.praise-dialog .primary { margin-top: 8px; }
