:root {
  --ink: #101a33;
  --ink-2: #192545;
  --muted: #72809d;
  --line: #e4e9f2;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --cyan: #14b8c4;
  --cyan-soft: #e2f7f7;
  --amber: #f3a638;
  --amber-soft: #fff4df;
  --green: #2fa36b;
  --green-soft: #e5f6ed;
  --red: #e76063;
  --red-soft: #fff0f0;
  --shadow: 0 16px 45px rgba(20, 37, 70, 0.08);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; background: var(--canvas); }
body.auth-locked { min-width: 320px; }
body.auth-locked .app-shell { display: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.auth-screen { display: none; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #223760 0, transparent 35%), linear-gradient(145deg, #0d1730, #17284e); }
body.auth-locked .auth-screen { display: grid; }
.auth-card { width: min(430px, 100%); padding: 34px 38px 28px; border: 1px solid rgba(255,255,255,.13); border-radius: 22px; color: #f5f8ff; background: rgba(255,255,255,.095); box-shadow: 0 28px 80px rgba(0,0,0,.28); backdrop-filter: blur(16px); }
.auth-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--ink); background: linear-gradient(145deg, #8ff5ed, #20b7c5); font-weight: 900; box-shadow: 0 9px 20px rgba(20,184,196,.24); }
.auth-card h1 { margin: 20px 0 5px; font-size: 26px; letter-spacing: -.04em; }
.auth-subtitle { margin: 0; color: #a9badb; font-size: 12px; }
.auth-message { min-height: 20px; margin: 18px 0 0; padding: 0; color: #ffcf9a; font-size: 12px; line-height: 1.6; }
.auth-message.error { padding: 9px 11px; border: 1px solid rgba(255,156,156,.25); border-radius: 9px; color: #ffc1c1; background: rgba(185,61,66,.18); }
.auth-message.success { padding: 9px 11px; border: 1px solid rgba(126,239,207,.22); border-radius: 9px; color: #a7f5df; background: rgba(38,145,117,.18); }
.auth-form { display: grid; gap: 14px; margin-top: 16px; }
.auth-form.hidden { display: none; }
.auth-form h2 { margin: 0 0 2px; font-size: 18px; }
.auth-form label { display: grid; gap: 7px; }
.auth-form label span { color: #b8c8e4; font-size: 11px; }
.auth-form input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid rgba(183,205,242,.23); border-radius: 9px; outline: none; color: #f4f8ff; background: rgba(4,12,30,.36); }
.auth-form input:focus { border-color: #65d9d7; box-shadow: 0 0 0 3px rgba(101,217,215,.13); }
.auth-submit { width: 100%; min-height: 42px; margin-top: 4px; color: var(--ink); background: #8ff5ed; box-shadow: none; }
.auth-submit:hover { color: var(--ink); background: #b4fff8; }
.auth-hint { margin: 0; color: #b8c8e4; font-size: 11px; line-height: 1.7; }
.auth-footnote { display: block; margin-top: 24px; color: #8498bd; font-size: 10px; line-height: 1.6; }
.sidebar {
  width: 264px; flex: 0 0 264px; min-height: 100vh; padding: 25px 17px 18px;
  background: var(--ink); color: #dce6fa; display: flex; flex-direction: column;
}
.brand-lockup { display: flex; gap: 12px; align-items: center; padding: 0 10px 25px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); font-weight: 900; background: linear-gradient(145deg, #8ff5ed, #20b7c5); box-shadow: 0 6px 18px rgba(20, 184, 196, .25); }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 16px; letter-spacing: .08em; }
.brand-lockup span { margin-top: 3px; font-size: 8px; letter-spacing: .18em; opacity: .5; }
.event-mini-card { margin: 0 5px 24px; padding: 15px 15px 14px; border: 1px solid rgba(160, 188, 235, .17); border-radius: 15px; background: rgba(255, 255, 255, .065); }
.eyebrow { display: block; margin-bottom: 8px; color: #77e0dd; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.event-mini-title { display: flex; gap: 8px; align-items: center; }
.event-mini-logo { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; color: var(--ink); background: #8ff5ed; font-size: 8px; font-weight: 900; }
.event-mini-logo img { width: 100%; height: 100%; object-fit: cover; }
.event-mini-card strong { display: block; color: #f5f8ff; font-size: 12px; line-height: 1.45; }
.event-mini-card select { width: 100%; height: 28px; margin-top: 11px; padding: 0 7px; border: 1px solid rgba(160, 188, 235, .22); border-radius: 7px; color: #eaf1ff; background: rgba(10, 18, 38, .35); outline: none; font-size: 10px; }
.event-mini-meta { margin-top: 12px; color: #9baed0; font-size: 11px; }
.live-dot, .status-pulse { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 99px; background: #52dda0; box-shadow: 0 0 0 4px rgba(82, 221, 160, .12); }
.nav-stack { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; border-radius: 11px; color: #9daecc; background: transparent; text-align: left; padding: 12px 13px; display: flex; align-items: center; gap: 12px; font-size: 13px; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .075); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(20, 184, 196, .28), rgba(20, 184, 196, .07)); box-shadow: inset 3px 0 0 var(--cyan); }
.nav-icon { width: 18px; color: #74dfe0; font-size: 16px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 16px 8px 5px; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.operator-avatar, .topbar-avatar { display: grid; place-items: center; border-radius: 50%; background: #dae8ff; color: #315997; font-weight: 800; }
.operator-avatar { width: 32px; height: 32px; font-size: 13px; }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { color: #f0f4ff; font-size: 12px; }
.sidebar-footer span { margin-top: 3px; color: #8498bd; font-size: 10px; }
.icon-button { margin-left: auto; border: 0; background: transparent; color: #8296bc; font-size: 17px; }

.main-content { min-width: 0; flex: 1; }
.topbar { height: 76px; padding: 0 35px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb b { margin: 0 10px; color: #c5cede; font-weight: 400; }
.breadcrumb strong { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.sync-status { padding: 6px 10px; border: 1px solid #dce7f6; border-radius: 999px; color: #7588a8; background: #fff; font-size: 11px; white-space: nowrap; }
.sync-status[data-tone="remote"] { color: #16806c; border-color: #bfe9dc; background: #effbf7; }
.sync-status[data-tone="syncing"] { color: #a56b16; border-color: #f3dfb6; background: #fffaf0; }
.sync-status[data-tone="error"] { color: #b34b4d; border-color: #f0c8ca; background: #fff5f5; }
.ghost-button, .round-button, .topbar-user { border: 0; background: transparent; color: var(--muted); }
.ghost-button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.ghost-button:hover { border-color: var(--cyan); color: var(--ink); }
.round-button { position: relative; font-size: 21px; }
.round-button i { position: absolute; right: -2px; top: 1px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.topbar-avatar { width: 30px; height: 30px; }

.view-container { padding: 30px 35px 50px; max-width: 1600px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.page-head p { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; gap: 9px; align-items: center; }
.primary-button, .secondary-button, .danger-button, .filter-select { min-height: 36px; border-radius: 9px; padding: 0 14px; border: 1px solid transparent; font-size: 12px; }
.primary-button { color: #fff; background: var(--ink); box-shadow: 0 7px 16px rgba(16, 26, 51, .16); }
.primary-button:hover { background: #24355f; }
.secondary-button { color: var(--ink); background: #fff; border-color: var(--line); }
.secondary-button:hover { border-color: var(--cyan); }
.secondary-button:disabled, .primary-button:disabled { cursor: not-allowed; color: #aab5c8; background: #f1f4f8; border-color: #e5eaf2; box-shadow: none; }
.import-button { display: inline-flex; align-items: center; justify-content: center; }
.import-button input, .logo-upload-button input { display: none; }
.danger-button { color: #bf464b; background: var(--red-soft); border-color: #ffd6d8; }
.filter-select { color: var(--ink); background: #fff; border-color: var(--line); min-width: 105px; outline: none; }
.full-button { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.metric-card { padding: 18px 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: var(--cyan-soft); font-weight: 800; }
.metric-value { margin-top: 13px; font-size: 27px; font-weight: 800; letter-spacing: -.05em; }
.metric-note { margin-top: 6px; color: var(--muted); font-size: 10px; }
.metric-note em { color: var(--green); font-style: normal; font-weight: 800; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, .85fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.panel-head { padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head span { color: var(--muted); font-size: 10px; }
.panel-body { padding: 20px; }
.stage-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 6px 0 14px; }
.stage { position: relative; padding: 12px 10px 11px 17px; border-top: 3px solid var(--line); }
.stage:not(:last-child)::after { content: ""; position: absolute; top: -3px; right: -1px; width: 1px; height: 39px; background: var(--line); }
.stage.done { border-top-color: var(--cyan); }
.stage.active { border-top-color: var(--amber); }
.stage .stage-no { color: var(--muted); font-size: 10px; }
.stage strong { display: block; margin-top: 5px; font-size: 13px; }
.stage small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.current-callout { margin-top: 22px; padding: 17px; border-radius: 13px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(120deg, #f0fbfa, #f8fcff); border: 1px solid #d8f1ef; }
.current-callout .eyebrow { color: #209aa0; margin-bottom: 6px; }
.current-callout h3 { margin: 0; font-size: 16px; }
.current-callout p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.callout-mark { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 17px; color: var(--cyan); background: #dff7f5; font-size: 26px; }
.queue-list { display: grid; gap: 10px; }
.queue-item { padding: 12px 0; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: 0; padding-bottom: 0; }
.queue-badge { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; font-size: 13px; font-weight: 800; }
.queue-badge.green { color: var(--green); background: var(--green-soft); }
.queue-badge.amber { color: #bd7c18; background: var(--amber-soft); }
.queue-copy { min-width: 0; flex: 1; }
.queue-copy strong { display: block; font-size: 12px; }
.queue-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-flex; align-items: center; height: 21px; border-radius: 99px; padding: 0 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tag.green { color: #217b52; background: var(--green-soft); }
.tag.amber { color: #a86b12; background: var(--amber-soft); }
.tag.red { color: #b5494b; background: var(--red-soft); }
.tag.cyan { color: #168a93; background: var(--cyan-soft); }

.control-panel { padding: 17px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: flex; align-items: center; gap: 17px; flex-wrap: wrap; }
.control-label { color: var(--muted); font-size: 11px; }
.control-field { display: flex; align-items: center; gap: 7px; }
.control-field label { color: var(--muted); font-size: 11px; }
.control-field select { min-width: 85px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
.control-field select:focus { border-color: var(--cyan); }
.control-spacer { flex: 1; }
.freeze-pill { padding: 7px 10px; border-radius: 7px; color: #968028; background: #fff8e8; font-size: 10px; }

.draw-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 19px; }
.draw-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.group-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.group-head { padding: 11px 13px; display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; }
.group-head strong { font-size: 12px; }
.group-head span { color: #8da5d2; font-size: 10px; }
.group-player { padding: 10px 12px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #eff2f7; }
.group-player:last-child { border-bottom: 0; }
.player-slot { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: #f2f4f8; font-size: 10px; font-weight: 800; }
.player-copy { min-width: 0; flex: 1; }
.player-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.player-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-chip { width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid #e6e9ef; border-radius: 8px; font-size: 9px; font-weight: 800; }
.lane-red { border-color: #ffaaa8; color: #e25859; background: #fff2f1; }
.lane-orange { border-color: #f3bd83; color: #d86d17; background: #fff5ea; }
.lane-yellow { border-color: #f5d17b; color: #bb861c; background: #fff9e9; }
.lane-green { border-color: #9edbb8; color: #2a9862; background: #effaf4; }
.lane-cyan { border-color: #8ddfe5; color: #168a93; background: #edfcfd; }
.lane-blue { border-color: #9cc3ee; color: #3275bd; background: #f0f7ff; }
.lane-purple { border-color: #c7acef; color: #7650b4; background: #f7f1ff; }
.lane-white { border-color: #c7cdd8; color: #5e6879; background: #fff; }
.draw-side { display: grid; gap: 15px; align-content: start; }
.side-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.side-card h3 { margin: 0; font-size: 13px; }
.side-card p { margin: 7px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.draw-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.draw-stat:last-child { border-bottom: 0; }
.draw-stat span { color: var(--muted); }
.draw-stat strong { font-size: 12px; }
.big-action { padding: 14px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #14203e, #273b6a); }
.big-action strong { display: block; font-size: 13px; }
.big-action span { display: block; margin-top: 6px; color: #a7b9df; font-size: 10px; line-height: 1.5; }
.big-action button { margin-top: 14px; width: 100%; height: 34px; border: 0; border-radius: 8px; color: var(--ink); background: #91eee6; font-size: 11px; font-weight: 800; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); gap: 19px; }
.lane-setting-list { display: grid; gap: 10px; }
.lane-setting-row { padding: 13px 14px; display: grid; grid-template-columns: 30px minmax(125px, .75fr) minmax(130px, 1fr) minmax(125px, .9fr) 54px; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.lane-order { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--cyan); background: var(--cyan-soft); font-size: 11px; font-weight: 800; }
.lane-setting-name strong, .lane-setting-name span { display: block; }
.lane-setting-name strong { font-size: 12px; }
.lane-setting-name span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.lane-form-field { display: grid; gap: 5px; }
.lane-form-field > span { color: var(--muted); font-size: 10px; }
.lane-form-field input, .lane-form-field select { width: 100%; height: 33px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; font-size: 11px; }
.lane-form-field input:focus, .lane-form-field select:focus { border-color: var(--cyan); }
.lane-preview { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid; border-radius: 12px; font-size: 9px; font-weight: 800; }
.settings-save-box { margin-top: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #bfe8e8; border-radius: 10px; background: #f0fbfb; }
.settings-save-box strong, .settings-save-box span { display: block; }
.settings-save-box strong { color: #168a93; font-size: 11px; }
.settings-save-box span { margin-top: 3px; color: #54708d; font-size: 10px; }
.settings-save-box .primary-button { flex: 0 0 auto; }
.settings-tip { margin-top: 17px; padding: 13px 14px; display: grid; gap: 5px; border-radius: 10px; color: #54708d; background: #f0fafb; border: 1px solid #d7f0ef; font-size: 10px; line-height: 1.6; }
.settings-tip strong { color: #168a93; font-size: 11px; }
.settings-side { display: grid; gap: 15px; align-content: start; }
.event-profile-panel { margin-bottom: 19px; }
.event-profile-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: center; }
.event-logo-upload { display: grid; justify-items: center; gap: 9px; }
.event-logo-box { width: 100px; height: 100px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #b9c8dc; border-radius: 18px; color: var(--muted); background: #f5f8fc; font-size: 12px; font-weight: 800; }
.event-logo-box img { width: 100%; height: 100%; object-fit: cover; }
.event-logo-placeholder { color: #6a84a8; }
.logo-upload-button { min-height: 31px; padding: 0 10px; font-size: 10px; }
.event-logo-upload small { color: var(--muted); font-size: 9px; }
.event-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.event-profile-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.event-profile-actions .danger-button { margin-right: auto; }
.event-backup-box { margin-top: 18px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #d7f0ef; border-radius: 11px; background: #f3fbfb; }
.event-backup-box strong, .event-backup-box span { display: block; }
.event-backup-box strong { color: #168a93; font-size: 11px; }
.event-backup-box span { margin-top: 4px; color: #54708d; font-size: 10px; line-height: 1.55; }
.event-backup-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.event-backup-actions .secondary-button { white-space: nowrap; }
.lane-map-list { display: grid; gap: 5px; }
.lane-map-item { padding: 9px 0; display: grid; grid-template-columns: 27px 1fr 44px 38px; gap: 7px; align-items: center; border-bottom: 1px solid var(--line); }
.lane-map-item:last-child { border-bottom: 0; }
.lane-map-item strong { font-size: 11px; }
.lane-map-item em { color: var(--muted); font-size: 9px; font-style: normal; }
.lane-map-item .lane-chip { width: 42px; height: 25px; }
.device-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.device-status-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.device-status-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.device-status-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--cyan); background: var(--cyan-soft); font-size: 11px; font-weight: 900; }
.device-status-card h3 { margin: 15px 0 6px; font-size: 13px; }
.device-status-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.device-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 19px; margin-bottom: 19px; }
.device-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.device-note { margin-top: 17px; padding: 12px 13px; display: grid; gap: 5px; border: 1px solid #d7f0ef; border-radius: 10px; color: #54708d; background: #f0fafb; font-size: 10px; line-height: 1.55; }
.device-note strong { color: #168a93; font-size: 11px; }
.device-contract-list { display: grid; gap: 12px; }
.device-contract-list div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.device-contract-list strong, .device-contract-list span { display: block; }
.device-contract-list strong { font-size: 11px; }
.device-contract-list span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.device-log-panel { margin-bottom: 19px; }
.device-log-list { display: grid; gap: 0; }
.device-log-row { min-height: 37px; padding: 8px 0; display: grid; grid-template-columns: 145px 180px minmax(0, 1fr); gap: 12px; align-items: center; border-bottom: 1px solid #eff2f7; font-size: 10px; }
.device-log-row:last-child { border-bottom: 0; }
.device-log-row span { color: var(--muted); }
.device-log-row em { color: #54708d; font-style: normal; }

.score-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.score-current-round { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.score-current-round select { min-width: 145px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; font-size: 11px; }
.score-current-round select:focus { border-color: var(--cyan); }
.score-group-step { display: flex; align-items: center; gap: 8px; }
.score-group-step strong { min-width: 116px; color: var(--ink); text-align: center; font-size: 11px; }
.score-group-step .secondary-button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.timing-import-panel { margin-bottom: 17px; }
.timing-import-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border: 1px solid #d7f0ef; border-radius: 11px; background: #f0fafb; }
.timing-import-toolbar strong, .timing-import-toolbar span { display: block; }
.timing-import-toolbar strong { color: #168a93; font-size: 11px; }
.timing-import-toolbar span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.timing-import-toolbar .import-button { flex: 0 0 auto; min-height: 32px; padding: 0 12px; font-size: 10px; }
.timing-empty { display: grid; gap: 6px; padding: 19px 8px 5px; color: var(--muted); }
.timing-empty strong { color: var(--ink); font-size: 11px; }
.timing-empty span { font-size: 10px; }
.timing-error { margin-top: 13px; padding: 11px 13px; border: 1px solid #f1c8cb; border-radius: 9px; color: #a33d44; background: #fff4f4; font-size: 10px; }
.timing-import-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 13px; color: var(--muted); font-size: 9px; }
.timing-review-note { margin-top: 11px; padding: 9px 11px; border-left: 3px solid #e8aa51; color: #765a2f; background: #fff8ed; font-size: 10px; line-height: 1.5; }
.timing-table-wrap { margin-top: 12px; overflow-x: auto; }
.timing-table { width: 100%; min-width: 650px; border-collapse: collapse; }
.timing-table th { padding: 9px 8px; color: var(--muted); background: #f5f7fb; text-align: left; font-size: 9px; white-space: nowrap; }
.timing-table td { padding: 9px 8px; border-bottom: 1px solid #eff2f7; color: var(--ink); font-size: 10px; white-space: nowrap; }
.timing-table td strong, .timing-table td small { display: block; }
.timing-table td small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.timing-import-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 12px; }
.score-tabs { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: #edf1f7; }
.score-tab { padding: 8px 13px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; }
.score-tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(21,35,69,.08); font-weight: 800; }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.score-grid-single { grid-template-columns: minmax(0, 1fr); }
.score-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.score-card-head { padding: 13px 15px; display: flex; justify-content: space-between; align-items: center; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.score-card-head strong { font-size: 12px; }
.score-card-head span { color: var(--muted); font-size: 10px; }
.score-form-head { padding: 8px 14px; display: grid; grid-template-columns: 24px 25px minmax(100px, 1fr) 65px 65px 65px minmax(120px, 1.2fr); gap: 8px; align-items: center; color: var(--muted); background: #f5f7fb; border-bottom: 1px solid var(--line); font-size: 9px; }
.score-form-head-laps { grid-template-columns: 24px 25px minmax(100px, 1fr) 65px 65px 65px minmax(120px, 1.2fr); }
.score-form-head small { color: var(--muted); font-size: 8px; font-weight: 500; }
.score-row { padding: 11px 14px; display: grid; grid-template-columns: 24px 25px minmax(100px, 1fr) 65px 65px 65px minmax(120px, 1.2fr); gap: 8px; align-items: center; border-bottom: 1px solid #eff2f7; }
.score-row-elimination { grid-template-columns: 24px 25px minmax(100px, 1fr) 65px 65px 65px minmax(120px, 1.2fr); }
.score-row:last-of-type { border-bottom: 0; }
.score-row .rank-number { color: var(--muted); font-size: 11px; font-weight: 800; }
.score-player { min-width: 0; }
.score-player strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.score-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.score-input { width: 100%; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); outline: none; font-size: 11px; }
.score-input:focus { border-color: var(--cyan); }
.score-input-invalid { border-color: #e25859 !important; background: #fff2f1; }
.score-result { color: #168a93; font-size: 10px; font-weight: 800; line-height: 1.35; }
.score-row-elimination .score-result { padding: 7px 5px; border-radius: 7px; background: var(--cyan-soft); text-align: center; }
.inspection-inline { display: inline-flex; height: 17px; margin-top: 5px; padding: 0 6px; font-size: 8px; }
.score-card-foot { padding: 11px 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); background: #fbfcfe; }
.score-card-foot .secondary-button { flex: 1; height: 31px; min-height: 31px; padding: 0 8px; font-size: 10px; }
.score-card-foot .primary-button { height: 31px; min-height: 31px; padding: 0 10px; font-size: 10px; }

.bracket-board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 17px; align-items: start; }
.bracket-column { display: grid; gap: 12px; }
.bracket-column-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.bracket-column-head h3 { margin: 0; font-size: 13px; }
.bracket-column-head span { color: var(--muted); font-size: 10px; }
.bracket-match { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(20,37,70,.05); }
.bracket-match .match-meta { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.bracket-player { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid #eff2f7; font-size: 11px; }
.bracket-player strong { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.bracket-player .lane-chip { flex: 0 0 25px; width: 25px; height: 25px; }
.bracket-player em { color: var(--muted); font-style: normal; font-size: 10px; }
.bracket-match.winner { border-left: 3px solid var(--green); }
.bracket-match.loser { border-left: 3px solid var(--red); }
.bracket-match.final-match { border-left: 3px solid var(--amber); background: #fffaf0; }
.elimination-flow-list { display: grid; gap: 16px; }
.elimination-stage-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.elimination-stage-card.current { border-color: #b7e6e5; box-shadow: 0 10px 26px rgba(25,183,190,.12); }
.elimination-stage-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.elimination-stage-head h3 { margin: 3px 0 5px; font-size: 15px; }
.elimination-stage-head p { margin: 0; color: var(--muted); font-size: 10px; }
.elimination-stage-actions { display: flex; align-items: center; gap: 8px; }
.elimination-group-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.elimination-group-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.elimination-group-head { padding: 9px 10px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); background: #f5f7fb; }
.elimination-group-head strong { font-size: 11px; }
.elimination-group-head span { color: var(--muted); font-size: 9px; }
.elimination-player-row { min-width: 0; padding: 8px 9px; display: grid; grid-template-columns: 16px 26px minmax(0, 1fr) auto; gap: 6px; align-items: center; border-bottom: 1px solid #edf1f6; }
.elimination-player-row:last-child { border-bottom: 0; }
.elimination-player-row strong, .elimination-player-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elimination-player-row strong { font-size: 10px; }
.elimination-player-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.elimination-player-row .rank-number { color: var(--muted); font-size: 10px; font-weight: 800; }
.elimination-player-row .lane-chip { width: 26px; height: 24px; font-size: 8px; }
.elimination-player-row .tag { padding: 3px 5px; font-size: 8px; white-space: nowrap; }
.elimination-final-preview { margin-top: 16px; }
.elimination-final-player { padding: 10px 0; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #edf1f6; }
.elimination-final-player:last-child { border-bottom: 0; }
.elimination-final-player strong { color: var(--cyan); font-size: 15px; }
.elimination-final-player span { font-size: 12px; font-weight: 800; }
.elimination-final-player small { color: var(--muted); font-size: 9px; }
.empty-inline { padding: 15px 0; color: var(--muted); font-size: 11px; }
.playoff-alert { margin-bottom: 16px; border-color: #f0c36a; background: #fffaf0; }
.playoff-tie-list { display: grid; gap: 8px; margin: 14px 0; }
.playoff-tie-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid #f2dfb1; font-size: 11px; }
.playoff-tie-list span { color: var(--muted); text-align: right; }

.final-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.final-score-table { width: 100%; border-collapse: collapse; }
.final-score-table th { padding: 11px 10px; color: #fff; background: var(--ink); text-align: left; font-size: 10px; }
.final-score-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.final-score-table td strong { font-size: 13px; }
.score-total { font-weight: 800; color: var(--cyan); }
.score-rounds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.score-round { padding: 8px 4px; border-radius: 7px; color: var(--muted); background: #f3f5f8; text-align: center; font-size: 10px; }
.score-round strong { display: block; color: var(--ink); font-size: 12px; }
.winner-banner { padding: 20px; border-radius: 15px; color: #fff; background: linear-gradient(140deg, #172344, #2e457a); }
.winner-banner .eyebrow { color: #89eee3; }
.winner-banner h2 { margin: 0; font-size: 22px; }
.winner-banner p { margin: 8px 0 0; color: #b6c5e3; font-size: 11px; }

.print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.print-card { min-height: 185px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.print-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--cyan); background: var(--cyan-soft); font-size: 18px; }
.print-card h3 { margin: 15px 0 6px; font-size: 13px; }
.print-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.print-card p small { color: var(--cyan); font-size: 9px; }
.print-card button { margin-top: auto; align-self: flex-start; }
.print-page + .print-page { break-before: page; page-break-before: always; }
.print-context-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 12px 15px; border: 1px solid #cdebed; border-radius: 10px; color: #245b67; background: #effbfc; font-size: 11px; }
.print-context-bar span:last-child { color: var(--muted); }
.print-scope-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.print-scope-list div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.print-scope-list strong, .print-scope-list span { display: block; }
.print-scope-list strong { margin-bottom: 5px; font-size: 11px; }
.print-scope-list span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.print-sheet { display: none; }
.print-document { width: 100%; color: #111; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
.print-document-head { display: flex; align-items: center; gap: 15px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 2px solid #111; }
.print-event-logo { width: 52px; height: 52px; flex: 0 0 52px; object-fit: cover; border-radius: 9px; }
.print-event-logo-text { display: grid; place-items: center; color: #fff; background: #172344; font-size: 17px; font-weight: 800; }
.print-document-head h1, .print-document-head h2, .print-document-head p { margin: 0; }
.print-document-head h1 { font-size: 17px; }
.print-document-head h2 { margin-top: 6px; font-size: 21px; }
.print-document-head p, .print-document-head span { display: block; margin-top: 3px; color: #666; font-size: 10px; }
.print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-table th { padding: 9px 8px; border: 1px solid #999; color: #fff; background: #172344; text-align: center; font-size: 10px; }
.print-table td { padding: 8px; border: 1px solid #aaa; vertical-align: middle; text-align: center; font-size: 10px; }
.print-table td:nth-child(2) { text-align: left; }
.print-table td strong, .print-table td small { display: block; }
.print-table td small { margin-top: 3px; color: #666; font-size: 8px; }
.print-grouped-table { border-collapse: separate; border-spacing: 0; }
.print-group-body { break-inside: avoid; page-break-inside: avoid; }
.print-group-divider th { padding: 8px 10px; color: #172344; background: #e9eef6; border: 1px solid #8d98aa; text-align: left; font-size: 11px; }
.print-group-divider th span { font-weight: 800; }
.print-group-divider th small { float: right; color: #5f6f8d; font-size: 9px; font-weight: 600; }
.print-group-body + .print-group-body .print-group-divider th { border-top: 7px solid #fff; }
.print-lane { display: inline-grid; min-width: 29px; height: 22px; place-items: center; padding: 0 5px; border: 1px solid currentColor; border-radius: 5px; font-size: 9px; font-weight: 800; }
.print-empty { padding: 20px !important; color: #666; text-align: center; }
.print-sign-note { margin-top: 18px; padding-top: 12px; border-top: 1px solid #777; font-size: 10px; }
.print-section-title { margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 1px solid #777; font-size: 13px; }
.print-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.print-summary-grid > div { padding: 15px 12px; border: 1px solid #aaa; text-align: center; }
.print-summary-grid span, .print-summary-grid strong { display: block; }
.print-summary-grid span { color: #666; font-size: 10px; }
.print-summary-grid strong { margin-top: 8px; font-size: 22px; }
.print-footer-note { margin-top: 22px; color: #666; font-size: 10px; }

.public-preview { padding: 22px; border-radius: 17px; color: #fff; background: radial-gradient(circle at 82% 5%, #385c9c 0, #1e315e 34%, #101a33 72%); }
.public-preview .page-head { margin-bottom: 23px; }
.public-preview .page-head h1 { color: #fff; }
.public-preview .page-head p { color: #9eb3dc; }
.public-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.public-stat { padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.07); }
.public-stat span { display: block; color: #9eb3dc; font-size: 10px; }
.public-stat strong { display: block; margin-top: 7px; font-size: 23px; }
.public-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 10px; background: #fff; color: var(--ink); }
.public-table th { padding: 10px 12px; color: var(--muted); background: #f1f4f9; text-align: left; font-size: 10px; }
.public-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 11px; }
.public-table tr:last-child td { border-bottom: 0; }
.public-table td:first-child { font-weight: 800; }

.player-stat-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 15px; margin-bottom: 18px; }
.import-tip { padding: 18px 20px; display: grid; gap: 7px; align-content: center; border: 1px solid #d7f0ef; border-radius: 15px; background: #f0fafb; }
.import-tip strong { color: #168a93; font-size: 13px; }
.import-tip span { color: #54708d; font-size: 11px; line-height: 1.6; }
.import-tip a { color: #168a93; font-size: 11px; font-weight: 800; text-decoration: none; }
.player-table { width: 100%; border-collapse: collapse; }
.player-table th { padding: 11px 12px; color: var(--muted); background: #f5f7fb; text-align: left; font-size: 10px; }
.player-table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 11px; }
.player-table tr:last-child td { border-bottom: 0; }
.player-table td:first-child { color: var(--muted); font-weight: 800; }
.directory-toolbar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.directory-toolbar label, .directory-create-form label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.directory-toolbar input, .directory-create-form input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; font-size: 12px; }
.directory-toolbar input:focus, .directory-create-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.directory-help { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; padding: 11px 13px; border-left: 3px solid var(--cyan); color: #54708d; background: #f4fbfb; font-size: 11px; line-height: 1.6; }
.directory-help strong { color: #168a93; white-space: nowrap; }
.directory-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.directory-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cyan); }
.directory-create-form { display: flex; align-items: flex-end; gap: 12px; }
.directory-create-form label { flex: 1; }
.directory-create-form-wide { flex-wrap: wrap; }
.directory-create-form-wide label { min-width: 150px; }
.directory-player-cell { display: flex; align-items: center; gap: 9px; }
.directory-avatar { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; flex: 0 0 30px; border-radius: 9px; color: #168a93; background: var(--cyan-soft); font-size: 12px; font-weight: 800; }
.directory-avatar img { width: 100%; height: 100%; object-fit: cover; }
.text-button { display: block; margin-top: 6px; padding: 0; border: 0; color: #168a93; background: transparent; font-size: 10px; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.roster-preview-panel { margin-bottom: 18px; }
.roster-preview-stats { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.roster-preview-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }

.checkin-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr); gap: 19px; margin-bottom: 19px; }
.checkin-lower { grid-template-columns: minmax(0, 1fr); }
.identity-panel, .inspection-panel { min-width: 0; }
.rfid-read-banner { padding: 11px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #d7f0ef; border-radius: 11px; background: #f0fafb; }
.rfid-signal { width: 42px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #168a93; background: #d9f5f2; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.rfid-read-banner strong, .rfid-read-banner span { display: block; }
.rfid-read-banner strong { font-size: 11px; }
.rfid-read-banner span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.rfid-read-banner .tag { margin-left: auto; }
.identity-main { display: flex; align-items: center; gap: 14px; padding: 20px 0 18px; border-bottom: 1px solid var(--line); }
.identity-avatar { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 17px; color: #fff; background: linear-gradient(145deg, #21b7c3, #2b6b9d); font-size: 23px; font-weight: 800; }
.identity-avatar:not(.avatar-placeholder), .write-player-avatar:not(.avatar-placeholder), .confirm-player-avatar:not(.avatar-placeholder) { object-fit: cover; }
.identity-main h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.identity-main p { margin: 6px 0 9px; color: var(--muted); font-size: 11px; }
.identity-tags { display: flex; gap: 6px; }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.identity-grid > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid #eff2f7; }
.identity-grid span, .identity-grid strong { display: block; }
.identity-grid span { color: var(--muted); font-size: 9px; }
.identity-grid strong { margin-top: 5px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.inspection-summary { padding: 12px 13px; display: flex; justify-content: space-between; align-items: center; border-radius: 10px; background: #f8fafc; }
.inspection-summary span:first-child, .inspection-summary strong { display: block; }
.inspection-summary span:first-child { color: var(--muted); font-size: 9px; }
.inspection-summary strong { margin-top: 4px; font-size: 21px; }
.inspection-list { display: grid; gap: 8px; margin: 13px 0 17px; }
.inspection-item { min-height: 48px; padding: 9px 11px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.inspection-item:has(input:checked) { border-color: #bde8d1; background: #f5fcf8; }
.inspection-item input { position: absolute; opacity: 0; pointer-events: none; }
.inspection-checkmark { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #cad4e2; border-radius: 6px; color: transparent; background: #fff; font-size: 12px; font-weight: 900; }
.inspection-item input:checked + .inspection-checkmark { border-color: var(--green); color: #fff; background: var(--green); }
.inspection-item strong, .inspection-item small { display: block; }
.inspection-item strong { font-size: 11px; }
.inspection-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.battery-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.battery-heading strong { font-size: 11px; }
.battery-heading span { color: var(--muted); font-size: 9px; }
.battery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.battery-grid label { display: grid; gap: 4px; }
.battery-grid label span { color: var(--muted); font-size: 9px; }
.battery-grid input, .card-write-form input, .card-write-form select { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; outline: none; font-size: 11px; }
.battery-grid input:focus, .card-write-form input:focus, .card-write-form select:focus { border-color: var(--cyan); }
.inspection-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.card-write-form { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(220px, 1fr) minmax(150px, auto) auto auto; gap: 10px; align-items: end; }
.card-write-form .secondary-button, .card-write-form .primary-button { height: 32px; min-height: 32px; white-space: nowrap; }
.write-player-preview { min-width: 150px; height: 42px; padding: 5px 8px; display: flex; align-items: center; gap: 7px; border: 1px solid #d7f0ef; border-radius: 8px; background: #f0fafb; }
.write-player-avatar { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; flex: 0 0 30px; border-radius: 9px; color: #fff; background: linear-gradient(145deg, #21b7c3, #2b6b9d); font-size: 13px; font-weight: 800; }
.write-player-preview strong, .write-player-preview small { display: block; }
.write-player-preview strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.write-player-preview small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.hardware-note { margin: 16px 0; padding: 11px 13px; display: flex; gap: 8px; border-radius: 9px; color: #54708d; background: #f7f9fc; border: 1px solid var(--line); font-size: 9px; line-height: 1.55; }
.hardware-note strong { color: var(--ink); white-space: nowrap; }
.rfid-table { width: 100%; border-collapse: collapse; }
.rfid-table th { padding: 10px 9px; color: var(--muted); background: #f5f7fb; text-align: left; font-size: 9px; white-space: nowrap; }
.rfid-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); font-size: 10px; }
.rfid-table tr:last-child td { border-bottom: 0; }
.rfid-table code { padding: 3px 5px; border-radius: 5px; color: #315997; background: #eef4ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.rfid-table td strong, .rfid-table td small { display: block; }
.rfid-table td small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.table-action { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: #168a93; background: #fff; font-size: 9px; }
.table-action:hover { border-color: var(--cyan); }
.rfid-history { margin-top: 19px; }

.toast { position: fixed; left: 50%; bottom: 25px; z-index: 20; padding: 11px 16px; border-radius: 9px; color: #fff; background: var(--ink); box-shadow: 0 10px 25px rgba(16,26,51,.24); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s ease; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(10, 18, 38, .52); backdrop-filter: blur(5px); }
.modal-backdrop.hidden { display: none; }
.modal-card { width: min(420px, 100%); padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(4,15,43,.26); text-align: center; }
.modal-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 21px; font-weight: 800; }
.modal-card h3 { margin: 0; font-size: 17px; }
.modal-card p { margin: 10px 0 23px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: center; gap: 9px; }
.card-write-confirm-card { width: min(460px, 100%); }
.card-write-confirm-content { margin: 17px 0 21px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; text-align: left; }
.confirm-player-identity { padding: 14px; display: flex; align-items: center; gap: 11px; background: #f7fafc; }
.confirm-player-avatar { width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden; flex: 0 0 54px; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #21b7c3, #2b6b9d); font-size: 22px; font-weight: 800; }
.confirm-player-identity strong, .confirm-player-identity span { display: block; }
.confirm-player-identity strong { font-size: 15px; }
.confirm-player-identity span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.confirm-card-uid { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.confirm-card-uid span { color: var(--muted); font-size: 10px; }
.confirm-card-uid code { padding: 4px 7px; border-radius: 6px; color: #315997; background: #eef4ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }

@media (max-width: 1300px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .view-container { padding-left: 24px; padding-right: 24px; }
  .topbar { padding: 0 24px; }
  .page-head { align-items: flex-start; }
  .page-actions { flex-wrap: wrap; }
  .print-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .print-scope-list { grid-template-columns: 1fr; }
  .print-context-bar { flex-wrap: wrap; }
  .event-backup-box { align-items: flex-start; flex-direction: column; }
  .event-backup-actions { width: 100%; }
  .device-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-layout { grid-template-columns: minmax(0, 1fr); }
  .device-log-row { grid-template-columns: 125px minmax(120px, .6fr) minmax(0, 1fr); }
  .draw-groups { grid-template-columns: repeat(2, 1fr); }
  .elimination-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .print-grid { grid-template-columns: minmax(0, 1fr); }
  .device-status-grid { grid-template-columns: minmax(0, 1fr); }
  .elimination-stage-head { display: block; }
  .elimination-stage-actions { margin-top: 10px; }
  .elimination-group-grid { grid-template-columns: minmax(0, 1fr); }
  .elimination-final-player { grid-template-columns: 24px minmax(0, 1fr); }
  .elimination-final-player small { grid-column: 2; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  body { min-width: 0; background: #fff; }
  .app-shell, #toast, #confirm-modal, #event-delete-modal, #card-write-confirm-modal { display: none !important; }
  .print-sheet { display: block !important; width: 100%; padding: 14mm 15mm; }
  .sidebar, .topbar, .page-actions, .control-panel, .draw-side, .score-toolbar, .timing-import-panel, .toast, .modal-backdrop { display: none !important; }
  .main-content { width: 100%; }
  .view-container { width: 100%; padding: 12mm 14mm; max-width: none; }
  .page-head { display: block; margin: 0 0 8mm; text-align: center; }
  .page-head h1 { font-size: 21pt; }
  .page-head p { margin-top: 3mm; color: #555; font-size: 9pt; }
  .panel, .group-card, .score-card, .print-card { box-shadow: none; break-inside: avoid; }
  .score-grid { display: block; }
  .score-card { width: 100%; margin: 0; border: 1px solid #222; }
  .score-card-head { padding: 5mm 6mm; background: #f3f3f3; }
  .score-form-head { padding: 3mm 6mm; grid-template-columns: 9mm 11mm minmax(0, 1fr) 18mm 18mm 18mm 39mm; }
  .score-form-head-laps { grid-template-columns: 9mm 11mm minmax(0, 1fr) 18mm 18mm 18mm 39mm; }
  .score-row { padding: 4mm 6mm; grid-template-columns: 9mm 11mm minmax(0, 1fr) 18mm 18mm 18mm 39mm; }
  .score-row-elimination { grid-template-columns: 9mm 11mm minmax(0, 1fr) 18mm 18mm 18mm 39mm; }
  .score-input { height: 9mm; border-color: #777; }
  .score-card-foot { padding: 5mm 6mm; }
  .score-card-foot .secondary-button, .score-card-foot .primary-button { color: #111; border-color: #555; background: #fff; }
  .print-area { display: block !important; }
}
