.screenSwitch {display:flex;align-items:center;gap:8px;margin:0;font:14px/1.3 var(--text-face,Onest),system-ui;color:var(--muted)}
@media screen {
  body:not(:has(.eventCover)) {background:var(--canvas);color:var(--ink);font:16px/1.5 var(--text-face,Onest),system-ui,sans-serif}
  body:not(:has(.eventCover)) header select {border:1px solid var(--line);border-radius:12px;color:var(--ink)}
  #view:not(:has(.eventCover)) {background:var(--panel);border:1px solid #d1ddd3;border-radius:24px;padding:clamp(20px,3.4vw,44px);min-width:0}
  #view:not(:has(.eventCover)) h1 {font:var(--heading-weight,400) clamp(32px,4vw,52px)/1.07 var(--display-face,Onest),system-ui;letter-spacing:var(--tracking,-.035em);overflow-wrap:anywhere}
  #view:not(:has(.eventCover)) h2 {font-size:clamp(21px,2.2vw,28px);letter-spacing:-.03em;font-weight:550}
  #view:not(:has(.eventCover)) :is(button,input,select) {font-family:inherit}
  #view:not(:has(.eventCover)) button {border-radius:14px}
  #view:not(:has(.eventCover)) :where(button:not([class])) {background:var(--panel);color:var(--accent)}
  #view:not(:has(.eventCover)) :is(form button:not([type=button]),.primaryAction,#cam) {
    background:var(--action-fill);color:var(--action-ink);border-radius:24px;min-height:44px;font-weight:600;padding:10px 18px
  }
  #view:not(:has(.eventCover)) :is(form button:not([type=button]),.primaryAction,#cam):hover {background:var(--action-hover)}
  body:not(:has(.eventCover)) main {padding-top:0}
  body:not(:has(.eventCover)) main>small {display:block;margin:0 0 9px 2px;font-size:12px;color:var(--muted)}
  #view:not(:has(.eventCover)) :is(input:not([type=radio]),select) {border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);min-height:44px}
  #view:not(:has(.eventCover)) form label {color:var(--muted)}
  #view:not(:has(.eventCover)) small {color:var(--muted)}
  #view .passcard .art:not(:has(img)) {background:var(--ticket-surface)}

  #view:not(:has(.eventCover)) button:focus-visible,#view:not(:has(.eventCover)) summary:focus-visible {outline:2px solid #375d4c;outline-offset:2px}
  #view:not(:has(.eventCover)) :is(input,select):focus-visible {outline:2px solid var(--accent);outline-offset:1px}
  body:not(.keyboardNav) #view:not(:has(.eventCover)) input:not([type=radio]):focus {outline:none}
  #view .cashMenu,#view:has(.eventCard) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  #view:has(.eventCard)>:not(.eventCard) {grid-column:1/-1;justify-self:start}
  #view:has(.eventCard)>.cabinetTop {justify-self:stretch}
  #view .cashMenu button,#view .eventCard {margin:0;position:relative;color:#1b352a;text-align:left;background:white;border:1px solid #d3e0d6;border-radius:20px;padding:24px;min-width:0}
  #view .cashMenu button:first-child,#view .eventCard:nth-child(1 of .eventCard),#view .metrics>div:first-child {
    background:var(--ticket-surface)
  }
  #view .cashMenu small,#view .eventCard small,#view .metrics>div:first-child small,#view .passcard .art small {color:var(--ink)}
  #view .cashMenu small,.cashMenu strong {display:block}
  .cashMenu strong {font-size:clamp(20px,2.4vw,30px);letter-spacing:-.035em;margin:22px 24px 0 0}
  .cashMenu span {position:absolute;right:20px;bottom:24px}
  #view .adminNav {display:flex;flex-wrap:wrap;gap:5px;padding:8px 0 14px;border-bottom:1px solid #ccd8cf}
  #view .adminNav button {font-size:14px;background:transparent;color:#345041;padding:8px 12px;border-radius:22px}
  #view .adminNav [aria-current=page] {color:white;background:var(--accent)}
  #view :is(.orderFilters,#hallTabs) button {background:var(--panel);color:var(--accent);min-height:40px;margin:0;border:0;border-radius:22px;font-size:14px;padding:8px 12px}
  #view .orderFilters {gap:5px}
  #view :is(.orderFilters,#hallTabs) :is([aria-current=page],[aria-pressed=true]) {background:var(--accent);color:white}
  #view .saleStatus {border-radius:12px}
  #view .saleStatus[data-state="Ошибка оплаты"] {background:var(--error-fill);color:var(--error-ink)}
  #view .saleStatus[data-state="Оплачен"] {background:var(--success-fill);color:var(--success-ink)}
  #view:not(:has(.eventCover)) .formProblem:not(:empty) {color:var(--error-ink)}
  #view .staffDialog {width:min(420px,calc(100% - 32px));margin:auto;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--panel);color:var(--ink)}
  .staffDialog::backdrop {background:#17272266}
  #view .staffDialog h2 {margin:0 0 18px;font-size:22px;line-height:1.2}
  .staffDialog input {width:100%}
  .staffDialog form>div {display:flex;gap:8px;justify-content:flex-end;margin-top:18px}
  #view .staffDialog button {margin:0}
  .mobileSections {display:none}
  #workspace {margin-top:20px;min-width:0}
  #view :is(.metrics>div,.hallPanel,.adminRow,.hallOccupancy,.salesToolbar) {background:var(--paper);border:1px solid var(--line);border-radius:20px;padding:16px}
  #view .metrics b {font-size:clamp(22px,2.4vw,32px);line-height:1.3;letter-spacing:-.04em}
  #view :is(.orderScroll,.salesTable) {background:white;border-radius:12px}
  #view :is(.salesList,.salesTable) th {color:#475c50}
  #view .scanLayout {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;align-items:start}
  #view .scanLayout section,#view :is(#settings,#codeForm,#batchForm) {padding:20px;border:1px solid var(--line);background:var(--paper);border-radius:20px;min-width:0}
  #view .scanLayout label {margin-top:0}
  .scanFrame {position:relative;display:grid;place-items:center;overflow:hidden;border-radius:14px;background:radial-gradient(ellipse at center,#31564d,#142d28)}
  .scanFrame .camera {display:block;background:transparent}
  .scanTarget {position:absolute;width:min(34%,150px);aspect-ratio:1;border-radius:12px;border:2px solid #dbf1de;mask:conic-gradient(at 20px 20px,transparent 25%,black 0) 0 0 / calc(100% - 20px) calc(100% - 20px)}
  #cam {margin-top:12px}
  #view .deny,#view .purchaseNotice:not(:empty),#view .formProblem {color:var(--error-ink);background:var(--error-fill);border-radius:12px;padding:9px 12px;font-weight:450}
  #view .pass {color:var(--success-ink);background:var(--success-fill)}
  #view :is(.pass,.deny):empty {display:none}
  #view .deny:not(:empty)::before,#view .formProblem::before {content:"!";display:inline-grid;place-items:center;width:17px;height:17px;margin-right:7px;background:#efd5c4;color:#703d29;border-radius:50%;font:600 12px Onest,system-ui}
  #view .formProblem {display:block;font-size:13px;margin:4px 0}
  #view .invalidEntry {position:relative}
  #view .invalidEntry input {padding-top:17px;padding-bottom:3px}
  #view .invalidEntry .fieldFeedback {position:absolute;left:12px;bottom:25px;max-width:calc(100% - 24px);margin:0;padding:0;background:transparent;color:var(--error-ink);font-size:11px;line-height:14px;pointer-events:none}
  #view .invalidEntry .fieldFeedback::before {width:13px;height:13px;font-size:10px;margin-right:4px}
  #view .formProblem:empty {display:none}
  #view .salesToolbar label {min-width:0}
  #view .salesToolbar input {max-width:100%}
  @media(max-width:720px) {
    #view .scanLayout,#view .cashMenu,#view:has(.eventCard) {grid-template-columns:minmax(0,1fr)}
    #view .adminNav {display:none}
    .mobileSections {display:grid;gap:4px;font-size:13px;color:var(--muted)}
    .mobileSections select {width:100%;font-size:16px}
    #view .adminNav button {flex:none;white-space:nowrap}
    #view .metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  }
}

@media screen {
  #workspace .reportHeading {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:0 0 18px}
  #workspace .reportHeading>* {margin:0}
  #workspace .reportPanel,#workspace #results {background:var(--paper);border:1px solid var(--line);border-radius:16px;margin:0 0 20px;overflow:hidden}
  #workspace #results {overflow:auto}
  #workspace #results:not(:has(table)) {padding:16px 20px}
  #workspace .reportPanel h3 {margin:0;padding:18px 20px 14px;font-size:18px;line-height:1.3;font-weight:600}
  #workspace .orderScroll {border-radius:0;max-width:100%}
  #workspace table {width:100%;border-spacing:0;border-collapse:collapse;font:400 15px/1.45 var(--text-face,Onest),system-ui;font-variant-numeric:tabular-nums}
  #workspace table :is(th,td) {padding:12px 16px;border:0;border-bottom:1px solid #e2e9e3}
  #workspace table :is(th,td):first-child {padding-inline-start:20px}
  #workspace table :is(th,td):last-child {padding-inline-end:20px}
  #workspace table thead th {font-size:13px;line-height:1.4;font-weight:550;background:#f5f8f4;color:#41584a;white-space:nowrap}
  #workspace table tbody th {font-weight:550;color:var(--ink)}
  #workspace tbody tr:last-child>* {border-bottom:0}
  #workspace .salesTable td {white-space:nowrap}
  #workspace .promoStats tbody th {min-width:10ch;max-width:26ch;overflow-wrap:anywhere}
  #workspace .reportNote {margin:0;padding:12px 20px 15px;border-top:1px solid #e2e9e3;color:var(--muted);font-size:13px;line-height:1.5}
  #workspace .salesList :is(td,th):nth-child(3) {text-align:right}
  #workspace .salesList td:first-child {overflow-wrap:anywhere;min-width:15ch}
  #workspace .salesList td:last-child {min-width:16ch}
  #workspace .salesList td button {margin:0}
  #workspace .salesList td button+button {margin-top:6px}
  #workspace .adminRow+.adminRow {margin-top:12px}
  @media(max-width:720px) {
    #workspace table :is(td,th) {padding:10px 12px}
    #workspace table :is(th,td):first-child {padding-inline-start:14px}
    #workspace table :is(th,td):last-child {padding-inline-end:14px}
    #workspace .reportPanel h3,#workspace .reportNote {padding-inline:14px}
  }
}

/* Organizer workspace */
@media screen {
  body:is(.liveCabinet,:has(#screen option[value=admin]:checked)) {
    --canvas:#f4f3f4;--panel:#f7f6f7;--ink:#25242a;--muted:#63616a;--accent:#343139;
    --line:#dfdde1;--action-fill:#302d36;--action-hover:#49444f;--action-ink:white;
  }
  body:is(.liveCabinet,:has(#screen option[value=admin]:checked)) #view {
    background:#faf9fa;border-color:var(--line);padding:clamp(16px,2.6vw,32px);color:var(--ink)
  }
  .cabinetTop {margin-bottom:14px}
  #view .cabinetCover {padding:clamp(18px,3vw,32px);border-radius:20px;background:linear-gradient(105deg,#ffffffad,#ffffff8a),var(--ticket-surface)}
  #view .cabinetCover .backLink {color:#403e48;margin:0;padding:0;background:none}
  #view .cabinetCover .eventHeading {margin:10px 0}
  #view .cabinetCover h1 {font:var(--heading-weight) clamp(30px,4.5vw,57px)/1.05 var(--display-face),system-ui;letter-spacing:var(--tracking);margin:0}
  #view .cabinetCover .gear {background:#ffffff8c;color:#39353f;border-radius:50%;font-size:20px}
  #view .cabinetCover .schedule {margin:12px 0 0;color:#383540}
  .cabinetLayout {display:grid;grid-template-columns:190px minmax(0,1fr);gap:clamp(18px,2.6vw,34px);margin-top:24px}
  #view .cabinetLayout .adminNav {display:flex;flex-direction:column;align-self:start;align-items:stretch;border:0;padding:0;gap:4px}
  #view .cabinetLayout .adminNav button {display:flex;align-items:center;gap:10px;text-align:left;padding:11px 12px;border-radius:12px;color:#57535d;line-height:1.25}
  #view .cabinetLayout .adminNav button svg {width:19px;height:19px;flex:none}
  #view .cabinetLayout .adminNav [aria-current=page] {background:#eae7ee;color:#25212e;font-weight:600}
  #view .cabinetLayout .adminNav button:hover {background:#f0edf2}
  .cabinetLayout #workspace {margin:0}
  .cabinetLayout #workspace>h2,.cabinetLayout #workspace .reportHeading h2 {margin:0 0 16px;font-weight:500;letter-spacing:-.035em}
  .cabinetLayout #workspace .reportHeading h2 {margin:0}
  .cabinetLayout #workspace :is(.salesToolbar,.reportPanel,#results,.hallPanel,.adminRow,.metrics>div) {border-color:var(--line)}
  .cabinetLayout #workspace .salesToolbar {background:#fff;margin:12px 0;border-radius:16px;padding:14px}
  .cabinetLayout #workspace :is(.orderFilters,#hallTabs) button {color:var(--ink);background:#efedf0}
  .cabinetLayout #workspace :is(.orderFilters,#hallTabs) :is([aria-current=page],[aria-pressed=true]) {color:white;background:#403c47}
  .cabinetLayout #workspace table thead th {background:#f4f3f5;color:#57545d;font-weight:500}
  .cabinetLayout #workspace table :is(td,th),.cabinetLayout #workspace .reportNote {border-color:#e9e7eb}
  .cabinetLayout #workspace table tbody tr:hover {background:#faf9fb}
  .cabinetLayout #workspace .managedCodes th:first-child {min-width:16ch;max-width:26ch;overflow-wrap:anywhere}
  .managedCodes tbody th small {display:block;font-size:12px;line-height:1.5;font-weight:400}
  .managedCodes th:last-child,.managedCodes td:last-child {text-align:left}
  #workspace .managedCodes td button {display:block;min-height:32px;margin:0;padding:4px 8px;background:transparent;color:var(--ink);font-size:13px}
  #workspace .managedCodes td button:hover {background:#eeecf0}
  body:is(.liveCabinet,:has(#screen option[value=admin]:checked)) #view :is(.gear,.profile summary,.salesList summary,.noteLink,.backLink) {color:var(--ink)}
  body:is(.liveCabinet,:has(#screen option[value=admin]:checked)) #view :is(.primaryAction,form button:not([type=button])):hover {background:#49444f;color:white}
  @media(max-width:900px) {
    .cabinetLayout {display:block;margin-top:16px}
    #view .cabinetLayout .adminNav {display:none}
    .cabinetLayout .mobileSections {display:grid;gap:4px;margin:0 0 18px;font-size:13px;color:var(--muted)}
    .cabinetLayout .mobileSections select {width:100%}
  }
  @media(max-width:600px) {
    #view .cabinetCover .eventHeading {align-items:flex-start}
    #view .cabinetCover .gear {width:36px;height:36px}
  }
}

@media screen and (max-width:600px) {
  #workspace :is(.managedCodes,.salesList) {display:block}
  #workspace :is(.managedCodes,.salesList) thead {position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
  #workspace :is(.managedCodes,.salesList) tbody {display:block}
  #workspace :is(.managedCodes,.salesList) tbody tr {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 12px;padding:16px;border-bottom:1px solid var(--line)}
  #workspace :is(.managedCodes,.salesList) tbody tr:last-child {border:0}
  #workspace :is(.managedCodes,.salesList) tbody :is(td,th) {display:block;min-width:0;max-width:none;margin:0;padding:0;text-align:left;border:0;white-space:normal}
  #workspace :is(.managedCodes,.salesList) tbody tr>:is(:first-child,:last-child) {grid-column:1/-1}
  #workspace .managedCodes td[data-label]::before {content:attr(data-label);display:block;font-size:12px;color:var(--muted)}
  #workspace .managedCodes td button {display:inline-block;background:var(--panel);margin-right:6px}
  #workspace .salesList td:nth-child(3) {text-align:right}
}
