:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --dx-bg: #f5f5f7;
  --dx-paper: #ffffff;
  --dx-text: #202024;
  --dx-muted: #76767e;
  --dx-line: #e4e4e9;
  --dx-tint: #c93460;
  --dx-plus: #d74769;
  --dx-minus: #277cbe;
  --dx-green: #21966b;
}
* { letter-spacing: 0; }
body[data-surface="settings"], body[data-surface="login"] { background: var(--dx-bg); color: var(--dx-text); color-scheme: light; }
body[data-surface="settings"] .app-shell, body[data-surface="login"] .app-shell { background: var(--dx-bg); }
body[data-surface="settings"] .main-app, body[data-surface="settings"] .screen { width: 100%; height: 100%; min-height: 0; padding: 0; overflow: hidden; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--dx-tint); outline-offset: 2px; }
button { transition: background-color .13s, opacity .13s; }
button:active:not(:disabled) { opacity: .65; }
svg.lucide { width: 22px; height: 22px; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
.dx-icon-button { display: inline-flex; justify-content: center; align-items: center; flex: none; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; }
.dx-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0; background: none; color: var(--dx-tint); font-size: 15px; font-weight: 600; white-space: nowrap; }
.dx-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; border-radius: 6px; background: #eeeeF2; color: var(--dx-text); font-size: 14px; font-weight: 600; }
.dx-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 6px; background: var(--dx-tint); color: #fff; font-size: 16px; font-weight: 650; }
.dx-primary svg { width: 20px; }
.dx-login { display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 100%; height: 100%; gap: 36px; padding: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left)); overflow-y: auto; background: var(--dx-paper); }
.dx-login-brand { display: flex; align-items: center; gap: 15px; width: min(420px, 100%); margin-inline: auto; }
.dx-login-brand img { width: 64px; height: 64px; object-fit: contain; }
.dx-login-brand h1 { margin: 0; font-size: 26px; font-weight: 700; }
.dx-login-brand b { color: var(--dx-tint); font-weight: 700; }
.dx-login-brand p { margin: 5px 0 0; color: var(--dx-muted); font-size: 13px; }
.dx-login-form { display: grid; gap: 18px; width: min(420px, 100%); margin-inline: auto; }
.dx-login-form h2 { margin: 0; font-size: 21px; font-weight: 650; }
.dx-login-input { gap: 10px; color: var(--dx-muted); font-size: 13px; }
.dx-login-input input { height: 52px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--dx-line); border-radius: 0; background: none; color: var(--dx-text); font-size: 20px; }
.dx-login-input input:focus { border-color: var(--dx-tint); box-shadow: none; }
.dx-login-form .error { min-height: 0; margin: 0; color: #c53050; }
.dx-login-form .error:empty { display: none; }
.dx-login-form .dx-primary { width: 100%; }
.dx-login-footer { width: min(420px, 100%); margin: 0 auto; color: var(--dx-muted); font-size: 12px; line-height: 1.7; }
.dx-settings.settings-screen { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-height: 0; padding: 0; gap: 0; background: var(--dx-bg); color: var(--dx-text); }
.dx-navbar { display: grid; grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr); align-items: center; min-height: 52px; padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--dx-line); background: var(--dx-paper); }
.dx-navbar strong { font-size: 17px; font-weight: 650; }
.dx-nav-trailing { display: flex; justify-content: flex-end; }
.dx-settings .dx-settings-content { min-height: 0; height: 100%; overflow: auto; overflow-x: hidden; padding: 20px max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.dx-settings-heading { padding: 3px 0 22px; }
.dx-settings-heading > span { color: var(--dx-muted); font-size: 12px; }
.dx-settings-heading > span b { color: var(--dx-tint); }
.dx-settings-heading h2 { margin: 10px 0 0; font-size: 23px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.dx-list { display: block; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--dx-line); border-bottom: 1px solid var(--dx-line); background: var(--dx-paper); }
.dx-list-row { display: flex; align-items: center; gap: 12px; min-height: 58px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--dx-line); border-radius: 0; background: transparent; color: var(--dx-text); text-decoration: none; text-align: left; font-size: 15px; font-weight: 500; }
.dx-list-row:last-child { border-bottom: 0; }
.dx-row-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; color: var(--dx-tint); }
.dx-row-label { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.dx-row-value { flex: none; max-width: 45%; color: var(--dx-muted); font-size: 13px; text-align: right; }
.dx-list-row > svg:last-child { width: 17px; height: 17px; color: #a1a1aa; }
.dx-danger, .dx-danger .dx-row-icon { color: #c83b50; }
.dx-version { padding: 5px 0; text-align: center; color: #92929a; font-size: 11px; }
.dx-fields { overflow: hidden; }
.dx-field-row { display: grid; grid-template-columns: minmax(90px, .36fr) minmax(0, 1fr); align-items: center; gap: 16px; min-height: 58px; margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--dx-line); color: var(--dx-text); font-size: 15px; font-weight: 500; }
.dx-field-row:last-child { border-bottom: 0; }
.dx-field-row input, .dx-field-row select { width: 100%; min-height: 42px; margin: 0; padding: 8px 0; border: 0; border-radius: 0; background: none; color: var(--dx-text); font-size: 16px; text-align: right; box-shadow: none; }
.dx-field-row input:focus { box-shadow: inset 0 -1px var(--dx-tint); }
.dx-field-row select { padding-right: 4px; text-overflow: ellipsis; }
.dx-field-row .color-row { justify-content: flex-end; gap: 14px; }
.dx-field-row .swatch { width: 28px; height: 28px; min-height: 28px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #e0e0e5; }
.dx-field-row .swatch.active { box-shadow: 0 0 0 2px var(--dx-text); }
.dx-segment { display: flex; gap: 2px; min-height: 36px; padding: 3px; border-radius: 6px; background: #ededf1; }
.dx-segment button { flex: 1; min-width: 0; padding: 6px 9px; border-radius: 4px; background: transparent; color: #767680; font-size: 13px; font-weight: 600; white-space: nowrap; }
.dx-segment button[aria-pressed="true"] { background: white; color: var(--dx-text); }
.dx-group-label { margin: 8px 14px 10px; color: var(--dx-muted); font-size: 12px; font-weight: 500; }
.dx-theme-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 0 24px; }
.dx-theme-option { position: relative; display: grid; gap: 10px; padding: 0; background: none; color: var(--dx-text); font-size: 13px; font-weight: 500; text-align: center; }
.dx-theme-option > svg { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--dx-tint); color: white; }
.dx-theme-sample { display: flex; align-items: center; justify-content: center; gap: 6px; height: 86px; border: 2px solid transparent; border-radius: 6px; background: #191a1e; color: #fff; overflow: hidden; }
.dx-theme-option[aria-pressed="true"] .dx-theme-sample { border-color: var(--dx-tint); }
.dx-theme-sample img { width: 40px; height: 40px; object-fit: contain; }
.dx-theme-sample > span { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.theme-kawaii .dx-theme-sample { background: #f8e8ef; color: #b92650; }
.theme-royal .dx-theme-sample { background: #241e20; color: #edca76; }
.dx-upload { position: relative; cursor: pointer; }
.dx-upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.dx-gift-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.dx-gift-toolbar > .dx-segment { width: 200px; }
.dx-view-switch { display: flex; }
.dx-view-switch .dx-icon-button { width: 40px; height: 40px; color: var(--dx-muted); }
.dx-view-switch .dx-icon-button[aria-pressed="true"] { color: var(--dx-tint); background: #f5e1e8; }
.dx-slot-stage { display: grid; grid-template-columns: minmax(130px, .25fr) minmax(0, .5fr) minmax(130px, .25fr); align-items: start; gap: 16px; }
.dx-slot-panel { min-width: 0; }
.dx-slot-panel h3 { height: 30px; margin: 0 0 8px; color: var(--dx-muted); font-size: 14px; font-weight: 650; text-align: center; }
.dx-slot-panel.plus h3 { color: var(--dx-plus); }
.dx-slot-panel.minus h3 { color: var(--dx-minus); }
.dx-slot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dx-slot { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) 22px; justify-items: center; align-items: center; min-width: 0; aspect-ratio: 1; min-height: 65px; padding: 6px 6px 3px; border: 1px solid #eccbd5; border-radius: 6px; background: white; color: var(--dx-plus); overflow: hidden; }
.dx-slot.minus { color: var(--dx-minus); border-color: #c5ddec; }
.dx-slot > small { position: absolute; top: 4px; left: 6px; font-size: 10px; color: #9999a2; z-index: 1; }
.dx-slot > .gift-img, .dx-slot > .placeholder-img { width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; object-fit: contain; box-shadow: none; }
.dx-slot > span:last-child { width: 100%; font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; }
.dx-slot.empty { border: 1px dashed #d2d2da; background: #eeeeF2; color: #a2a2ac; }
.dx-slot.empty > span { font-size: 10px; font-weight: 500; }
.dx-slot.empty > svg { width: 24px; height: 24px; }
.dx-slot-counter { display: grid; align-content: center; gap: 14px; min-height: 220px; padding: 24px 14px; text-align: center; }
.dx-slot-counter > span { color: var(--dx-muted); font-size: 16px; overflow-wrap: anywhere; }
.dx-slot-counter strong { color: var(--dx-text); font-size: 46px; font-weight: 650; line-height: 1.1; white-space: nowrap; }
.dx-preview-meter { height: 5px; width: 100%; border-radius: 3px; background: #e3e3e9; }
.dx-slot-stage.is-ipad { grid-template-columns: minmax(150px, .21fr) minmax(0, .58fr) minmax(150px, .21fr); }
.dx-slot-center .dx-slot-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.dx-slot-center .dx-slot > span:last-child { font-size: 11px; }
.dx-gift-list .gift-img { width: 44px; height: 44px; padding: 0; border: 0; background: none; object-fit: contain; }
.dx-gift-list .placeholder-img { width: 44px; height: 44px; }
.dx-live-state { display: flex; align-items: center; gap: 16px; padding: 8px 14px 26px; }
.dx-live-symbol { display: flex; align-items: center; justify-content: center; flex: none; width: 50px; height: 50px; border-radius: 50%; background: #e8e8ed; color: #8c8c97; }
.dx-live-state.connected .dx-live-symbol { background: #dbf1e6; color: var(--dx-green); }
.dx-live-state h2 { margin: 0; font-size: 22px; font-weight: 650; }
.dx-live-state p { margin: 7px 0 0; color: var(--dx-muted); font-size: 12px; line-height: 1.6; }
.dx-live-state p:empty { display: none; }
.dx-username { display: flex; align-items: center; gap: 4px; }
.dx-username > span { color: var(--dx-muted); }
.dx-username input { text-align: left; }
.dx-live-actions { display: flex; gap: 10px; margin: -8px 0 26px; }
.dx-live-actions > button { flex: 1; }
.dx-status-notice { margin: 0 14px 24px; color: #b77625; font-size: 12px; line-height: 1.7; }
body[data-surface="display"][data-theme="simple"], body[data-surface="display"][data-theme="simple"] .app-shell { background: #161719; }
body[data-surface="display"] .main-app, body[data-surface="display"] .screen { height: 100%; min-height: 0; padding: 0; }
body[data-surface="display"] .display-screen { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, .75fr); width: 100%; height: 100%; min-height: 0; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); overflow: hidden; background-image: var(--display-bg, none); background-size: cover; }
body[data-surface="display"] .side-display { grid-template-columns: minmax(112px, .205fr) minmax(0, .59fr) minmax(112px, .205fr); grid-template-rows: minmax(0, 1fr); gap: 14px; }
body[data-surface="display"] .side-gift-panel { display: grid; grid-template-rows: 25px minmax(0, 1fr); align-self: stretch; width: 100%; min-width: 0; min-height: 0; padding: 0; gap: 7px; border: 0; background: none; border-radius: 0; overflow: hidden; }
body[data-surface="display"] .side-gift-panel h2 { display: flex; align-items: center; justify-content: center; gap: 5px; height: 25px; margin: 0; padding: 0; font-size: 14px; font-weight: 650; line-height: 1.3; }
body[data-surface="display"] .side-plus h2 { color: #ed7c96; }
body[data-surface="display"] .side-minus h2 { color: #77bce9; }
body[data-surface="display"] .side-gift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; align-content: start; gap: 7px; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0; scrollbar-width: none; }
body[data-surface="display"] .side-gift-btn, body[data-surface="display"] .mini-gift-btn { display: grid; grid-template-rows: minmax(0, 1fr) 23px; align-items: center; justify-items: center; width: 100%; min-width: 0; min-height: 0; aspect-ratio: 1; height: auto; gap: 0; padding: 4px 4px 2px; border: 1px solid #733747; border-radius: 6px; background: #242126; color: #f58aa4; overflow: hidden; box-shadow: none; }
body[data-surface="display"] .side-gift-btn.gift-minus, body[data-surface="display"] .mini-gift-btn.gift-minus { border-color: #315b74; background: #1e2529; color: #83c6ed; }
body[data-surface="display"] .side-gift-btn .gift-img, body[data-surface="display"] .mini-gift-btn .gift-img { width: 100%; max-width: none; height: 100%; max-height: none; min-height: 0; margin: 0; padding: 0; border-radius: 0; background: none; object-fit: contain; box-shadow: none; }
body[data-surface="display"] .side-gift-value, body[data-surface="display"] .mini-value { position: static; width: 100%; min-width: 0; height: 23px; font-size: 13px; font-weight: 650; line-height: 23px; text-align: center; white-space: nowrap; }
body[data-surface="display"] .side-gift-btn strong { width: 100%; overflow-wrap: anywhere; font-size: 11px; }
body[data-surface="display"] .display-card { display: flex; flex-direction: column; justify-content: center; align-self: stretch; align-items: stretch; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 12px 10px; gap: 9px; border: 0; border-radius: 0; background: none; overflow: hidden; box-shadow: none; }
body[data-surface="display"] .display-card h1 { flex: none; width: 100%; margin: 0; padding: 0; font-size: 30px; font-weight: 650; line-height: 1.4; text-align: center; white-space: nowrap; overflow: hidden; }
body[data-surface="display"][data-theme="simple"] .display-card h1 { color: #f5f5f7; }
body[data-surface="display"] .display-score { display: block; flex: none; width: 100%; min-width: 0; height: auto; min-height: 0; margin: 0; padding: 0; text-align: center; line-height: 1.05; overflow: hidden; }
body[data-surface="display"] .display-score .number { display: block; width: 100%; min-width: 0; max-width: none; height: auto; font-size: 104px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
body[data-surface="display"] .display-sub { display: block; flex: none; min-height: 22px; margin: 0; text-align: center; font-size: 13px; line-height: 22px; }
body[data-surface="display"] .display-sub span { padding: 0; border: 0; background: none; color: #96969e; font-size: inherit; }
body[data-surface="display"] .display-meter { flex: none; display: block; width: 100%; height: 28px; min-height: 28px; margin: 4px 0 0; padding: 0; }
body[data-surface="display"] .display-meter .meter { height: 5px; width: 100%; }
body[data-surface="display"][data-theme="simple"] .display-meter .meter { background: #323237; }
body[data-surface="display"][data-theme="simple"] .display-meter .meter span { background: #ee7093; }
body[data-surface="display"] .display-meter-foot { display: flex; justify-content: flex-end; min-height: 18px; margin: 4px 0 0; font-size: 11px; line-height: 18px; }
body[data-surface="display"] .display-meter-foot > span:first-child { display: none; }
body[data-surface="display"] .dx-display-actions { position: static; display: flex; flex: none; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 6px; width: 100%; height: 38px; min-height: 38px; margin: 0; padding: 0; }
body[data-surface="display"] .dx-display-actions .dx-action, body[data-surface="display"] .dx-display-actions .dx-icon-button { width: auto; min-width: 0; height: 36px; min-height: 36px; margin: 0; padding: 6px 8px; border: 0; background: #2c2b30; color: #d6d6dd; font-size: 12px; font-weight: 500; }
body[data-surface="display"] .dx-display-actions .dx-action svg { width: 16px; height: 16px; }
body[data-surface="display"] .dx-display-actions .dx-icon-button { width: 34px; }
.dx-live-chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 5px 6px; background: none; color: #9999a4; font-size: 10px; white-space: nowrap; }
.dx-live-chip b { font-weight: 500; }
.dx-live-chip > span { width: 5px; height: 5px; border-radius: 50%; background: #797980; }
.dx-live-chip.connected > span { background: #58d2a0; }
.dx-live-chip.retrying > span, .dx-live-chip.connecting > span, .dx-live-chip.paused > span { background: #e6b94e; }
body[data-surface="display"] .quick-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); grid-auto-rows: auto; align-content: start; height: 100%; max-height: none; min-height: 0; gap: 8px; width: 100%; padding: 0; overflow-y: auto; overflow-x: hidden; }
body[data-surface="display"] .side-center-stack { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; min-height: 0; height: 100%; padding: 0; }
body[data-surface="display"] .center-gift-panel { display: block; width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; background: none; }
body[data-surface="display"] .center-gift-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: auto; grid-auto-rows: auto; gap: 7px; min-height: 0; }
body .modal-backdrop { background: #0006; }
body .modal { max-height: calc(100% - 32px); min-height: 0; border: 0; border-radius: 8px; background: var(--dx-paper); color: var(--dx-text); box-shadow: none; overflow: auto; }
body .modal h2 { color: var(--dx-text); font-size: 19px; }
body .modal .hint { color: var(--dx-muted); }
body .modal input { background: #f0f0f4; border-color: var(--dx-line); color: var(--dx-text); }
body .modal .ghost-btn { color: var(--dx-tint); background: transparent; border: 0; }
body .modal .danger-btn { background: #cf3551; color: white; }
.dx-sheet-backdrop { display: flex; align-items: flex-end; justify-content: center; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
body .dx-sheet { display: grid; grid-template-rows: 52px minmax(0, 1fr); gap: 0; width: min(520px, 100%); max-height: 100%; min-height: 0; padding: 0; border-radius: 8px 8px 0 0; background: var(--dx-bg); overflow: hidden; }
.dx-sheet-nav { display: flex; align-items: center; justify-content: space-between; flex: none; min-height: 52px; padding: 4px 12px 4px 20px; border-bottom: 1px solid var(--dx-line); background: var(--dx-paper); }
.dx-sheet-nav h2 { margin: 0; color: var(--dx-text); font-size: 17px; font-weight: 650; }
.dx-sheet-nav .dx-icon-button { color: var(--dx-muted); }
.dx-sheet-content { min-height: 0; padding: 20px 20px max(20px, env(safe-area-inset-bottom)); overflow: auto; }
.dx-sheet-content .dx-list:last-child { margin-bottom: 0; }
.dx-gift-identity { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.dx-gift-identity .gift-img, .dx-gift-identity .placeholder-img { width: 70px; height: 70px; padding: 0; border: 0; border-radius: 0; background: none; object-fit: contain; }
.dx-gift-identity h3 { margin: 0 0 7px; color: var(--dx-text); font-size: 20px; }
.dx-gift-identity > div > span { color: var(--dx-muted); font-size: 13px; }
.dx-editor-order { display: flex; gap: 10px; margin-bottom: 24px; }
.dx-editor-order > button { flex: 1; }
.dx-search { display: flex; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 18px; padding: 0 12px; border-radius: 6px; background: #e9e9ee; color: #92929c; }
.dx-search svg { width: 18px; height: 18px; }
.dx-search input { min-width: 0; min-height: 42px; padding: 8px 0; border: 0; border-radius: 0; background: none; color: var(--dx-text); font-size: 16px; outline: 0; box-shadow: none; }
.dx-link-list img { flex: none; width: 42px; height: 42px; object-fit: contain; }
.dx-empty-state { display: grid; justify-items: center; gap: 10px; padding: 50px 16px; color: #a1a1aa; }
.dx-empty-state svg { width: 32px; height: 32px; }
.dx-empty-state p { margin: 0; font-size: 14px; }
.dx-library-backdrop { padding: 0; }
body .dx-library { display: grid; grid-template-rows: auto 62px minmax(0, 1fr); width: 100%; height: 100%; max-height: 100%; padding: 0; gap: 0; border-radius: 0; background: var(--dx-paper); }
.dx-library .dx-sheet-nav { padding-top: max(4px, env(safe-area-inset-top)); padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
.dx-library .dx-search { margin: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); }
body .dx-library .gift-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); grid-auto-rows: auto; align-content: start; min-height: 0; height: 100%; gap: 18px 12px; padding: 12px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); overflow-y: auto; }
body .dx-library .library-gift-card { position: relative; display: grid; grid-template-rows: 76px auto 16px; justify-items: center; gap: 7px; min-width: 0; height: auto; min-height: 0; padding: 8px 4px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--dx-text); box-shadow: none; }
body .dx-library .library-gift-card.selected { border-color: var(--dx-tint); background: #fbf0f4; }
body .dx-library .library-gift-card img { width: 76px; height: 76px; padding: 0; object-fit: contain; }
body .dx-library .library-gift-card strong { display: block; width: 100%; min-height: 18px; font-size: 12px; font-weight: 550; line-height: 1.4; text-align: center; white-space: normal; overflow-wrap: anywhere; }
body .dx-library .library-gift-card > span { color: var(--dx-muted); font-size: 11px; }
body .dx-library .library-gift-card > svg { position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; color: var(--dx-tint); }
.dx-history-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: #0005; }
body .dx-history { position: static; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(480px, 100%); height: 100%; max-height: 100%; padding: 0; gap: 0; border: 0; border-radius: 0; background: var(--dx-paper); color: var(--dx-text); box-shadow: none; }
.dx-history .dx-sheet-nav { padding-top: max(4px, env(safe-area-inset-top)); }
.dx-history .tap-history-list { padding: 0 14px max(18px, env(safe-area-inset-bottom)); }
.dx-history-row { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 10px 0; border-bottom: 1px solid var(--dx-line); }
.dx-history-art { flex: none; width: 42px; height: 42px; }
.dx-history-art img { width: 100%; height: 100%; object-fit: contain; }
.dx-history-row > div { flex: 1; min-width: 0; }
.dx-history-row > div strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.dx-history-row > div span { display: block; margin-top: 5px; color: var(--dx-muted); font-size: 10px; }
.dx-history-row > b { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.dx-history-row .dx-icon-button { width: 36px; height: 36px; color: var(--dx-tint); }
.dx-history .plus, .dx-gift-list .plus { color: var(--dx-plus); }
.dx-history .minus, .dx-gift-list .minus { color: var(--dx-minus); }
.toast { background: #29292e; color: #fff; border: 0; border-radius: 6px; font-size: 12px; box-shadow: none; }
.dx-cue-mirror { position: fixed; inset: 0; z-index: 25; transform: scaleX(-1); pointer-events: none; }
@media (min-width: 1000px) {
  .dx-settings-content { max-width: none; }
  .dx-slot-stage.is-ipad { grid-template-columns: minmax(180px, .23fr) minmax(0, .54fr) minmax(180px, .23fr); }
  .dx-slot-center .dx-slot { min-height: 0; }
  body[data-surface="display"] .display-score .number { font-size: 132px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .dx-login { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; align-content: center; gap: 20px 42px; }
  .dx-login-brand { grid-row: 1 / 3; }
  .dx-login-form { gap: 12px; }
  .dx-login-footer { grid-column: 2; }
  .dx-navbar { min-height: 44px; }
  .dx-settings .dx-settings-content { padding-top: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .dx-settings-heading { padding: 0 0 16px; }
  .dx-settings-heading h2 { font-size: 20px; margin-top: 6px; }
  .dx-list { margin-bottom: 18px; }
  .dx-list-row, .dx-field-row { min-height: 52px; }
  .dx-slot-stage { gap: 14px; grid-template-columns: minmax(130px, .25fr) minmax(0, .5fr) minmax(130px, .25fr); }
  .dx-slot-counter { min-height: 180px; padding: 24px 0; }
  .dx-gift-toolbar { margin-bottom: 10px; }
  .dx-slot-panel h3 { height: 24px; margin-bottom: 6px; font-size: 12px; }
  .dx-slot { min-height: 0; }
  .dx-theme-sample { height: 76px; }
  .dx-theme-picker { gap: 14px; }
  body[data-surface="display"] .display-card { gap: 6px; padding: 6px; }
  body[data-surface="display"] .display-card h1 { font-size: 23px; }
  body[data-surface="display"] .display-score .number { font-size: 80px; }
  body[data-surface="display"] .side-display { grid-template-columns: minmax(112px, .2fr) minmax(0, .6fr) minmax(112px, .2fr); gap: 12px; }
  body[data-surface="display"] .side-gift-panel h2 { font-size: 12px; }
  body[data-surface="display"] .side-gift-value { font-size: 12px; }
  body .dx-sheet { width: min(520px, 72%); }
  .dx-sheet-content { padding-top: 14px; }
  .dx-gift-identity { margin-bottom: 14px; }
  .dx-gift-identity .gift-img { width: 54px; height: 54px; }
}
@media (orientation: portrait) and (max-width: 600px) {
  .dx-settings .dx-settings-content { padding-left: 16px; padding-right: 16px; }
  .dx-theme-picker { gap: 9px; }
  .dx-theme-sample { flex-direction: column; height: 92px; gap: 1px; }
  .dx-theme-sample img { width: 35px; height: 35px; }
  .dx-theme-sample > span { font-size: 17px; }
  .dx-field-row { grid-template-columns: 80px minmax(0, 1fr); gap: 10px; font-size: 14px; }
  .dx-segment button { padding-inline: 6px; font-size: 12px; }
  .dx-slot-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .dx-slot-center { grid-column: 1 / -1; grid-row: 1; }
  .dx-slot-counter { min-height: 100px; padding: 10px 0; gap: 8px; }
  .dx-slot-counter > span { font-size: 13px; }
  .dx-slot-counter strong { font-size: 32px; }
  .dx-slot-stage.is-ipad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-slot-center .dx-slot-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dx-slot-center .dx-slot { min-height: 0; padding: 2px; grid-template-rows: minmax(0, 1fr) 15px; }
  .dx-slot-center .dx-slot > span:last-child { font-size: 8px; line-height: 15px; }
  .dx-slot-center .dx-slot.empty > span { display: none; }
  .dx-slot-center .dx-slot.empty > svg { width: 16px; height: 16px; }
  .dx-slot-center .dx-slot > small { font-size: 8px; left: 3px; }
  body[data-surface="display"] .side-display { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr); overflow-y: auto; }
  body[data-surface="display"] .side-center-card, body[data-surface="display"] .side-center-stack { grid-column: 1 / -1; grid-row: 1; height: auto; }
  body[data-surface="display"] .display-card h1 { font-size: 23px; }
  body[data-surface="display"] .display-score .number { font-size: 70px; }
  body[data-surface="display"] .display-card { padding: 14px 0; }
  body[data-surface="display"] .side-gift-panel { min-height: 0; overflow: visible; }
  body[data-surface="display"] .side-gift-grid { overflow: visible; }
  body[data-surface="display"] .display-screen:not(.side-display) { grid-template-rows: auto minmax(0, 1fr); }
  body[data-surface="display"] .quick-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) and (orientation: landscape) {
  .dx-navbar { padding-inline: max(12px, env(safe-area-inset-left)); }
  body[data-surface="display"] .dx-display-actions { gap: 3px; }
  body[data-surface="display"] .dx-display-actions .dx-action { gap: 4px; padding-inline: 6px; font-size: 11px; }
  .dx-live-chip { padding-inline: 3px; font-size: 9px; }
  body[data-surface="display"] .display-score .number { font-size: 66px; }
  body[data-surface="display"] .side-gift-btn { grid-template-rows: minmax(0, 1fr) 18px; padding: 2px; }
  body[data-surface="display"] .side-gift-value { height: 18px; line-height: 18px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }

@media (orientation: landscape), (min-width: 601px) {
  .dx-slot-stage .dx-slot-grid { grid-template-columns: repeat(2, var(--dx-slot-size, minmax(0, 1fr))); justify-content: center; }
  .dx-slot-stage .dx-slot-center .dx-slot-grid { grid-template-columns: repeat(6, var(--dx-slot-size, minmax(0, 1fr))); gap: 8px; }
  .dx-slot-stage .dx-slot { min-height: 0; }
  .dx-slot-stage .dx-slot-center .dx-slot { grid-template-rows: minmax(0, 1fr) 22px; }
  body[data-surface="display"] .side-display { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }
  body[data-surface="display"] .side-display > .side-gift-panel { grid-column: span 2; }
  body[data-surface="display"] .side-display > .side-center-card, body[data-surface="display"] .side-display > .side-center-stack { grid-column: span 6; }
}
