:root{color-scheme:dark;--bg:#0c0b10;--panel:#17131e;--panel2:#201a28;--line:#34283b;--text:#f8f3f9;--muted:#a99caf;--pink:#ff3c99;--pink2:#ff79b8;--green:#32d9a0}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 80% -20%,#361329 0,transparent 35%),var(--bg);font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:var(--text)}button,input,select,textarea{font:inherit}button{cursor:pointer;background:#292130;border:1px solid #483348;color:#fff;border-radius:12px;padding:11px 16px;font-weight:700;transition:.15s}button:hover{border-color:var(--pink2)}button:active{transform:scale(.98)}button:disabled{opacity:.55;cursor:not-allowed}input,select,textarea{width:100%;min-width:0;padding:12px 13px;border:1px solid #433248;background:#110e17;color:white;border-radius:10px;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--pink)}label{font-size:12px;color:var(--muted);display:grid;gap:7px}header{height:74px;padding:0 26px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #2d2333;background:#110e17}.brand{display:flex;align-items:center;gap:12px}.brand b{font-size:20px;letter-spacing:.5px}.brand em{font-style:normal;color:var(--pink)}.brand small{display:block;color:var(--muted);font-size:9px;letter-spacing:1.7px;margin-top:4px}.logo{display:grid;place-items:center;background:linear-gradient(140deg,#ff72b5,#e91b77);width:42px;height:42px;border-radius:13px;font-size:26px}.badge{border:1px solid #3c2a3b;background:#241a29;border-radius:100px;padding:9px 13px;font-size:11px;color:#c9b4c9}.badge.pink{color:var(--pink2)}.shell{display:grid;grid-template-columns:235px minmax(0,1fr);min-height:calc(100dvh - 74px)}aside{border-right:1px solid #302536;padding:30px 14px;display:flex;flex-direction:column}.caption,.eyebrow{color:var(--pink2);letter-spacing:2px;font-size:10px;font-weight:900}.caption{padding:0 16px 15px}nav{display:grid;gap:5px}nav button{width:100%;text-align:left;background:transparent;border:0;color:#c7b9c9;font-weight:600;padding:14px 15px}nav button.active{background:#3a1b32;color:#ff85c2;border-left:3px solid var(--pink)}.aside-note{margin-top:auto;border-top:1px solid var(--line);padding:18px 12px;color:var(--pink2);font-size:10px;font-weight:800;line-height:1.8}.aside-note span{color:var(--muted);font-weight:400}main{padding:30px clamp(16px,3.3vw,48px);min-width:0;max-width:1500px;width:100%}.page{display:none}.page.active{display:block}.title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 22px}h1{font-size:clamp(27px,3.4vw,44px);margin:8px 0 0;letter-spacing:-1.2px}h1 span{color:var(--pink)}h2{font-size:16px;margin:0 0 20px}.hero{border:1px solid #572b47;border-radius:22px;background:linear-gradient(110deg,#32152c 0%,#211323 70%,#1a1220);padding:35px;display:flex;justify-content:space-between;align-items:center;overflow:hidden}.hero p{color:#c6b6c5;max-width:470px;line-height:1.6}.hero-icon{font-size:100px;opacity:.85}.primary{background:linear-gradient(110deg,#fa3d96,#d51e78);border:0;box-shadow:0 6px 24px #ff24822b}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:20px 0}.stat{padding:22px;background:var(--panel);border:1px solid var(--line);border-radius:16px}.stat b{display:block;font-size:32px;margin-top:10px}.stat small{color:var(--muted)}.card{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:23px;margin:0 0 18px}.quick{display:flex;flex-wrap:wrap;gap:10px}.notice,.hint{font-size:12px;color:var(--muted);line-height:1.65}.notice{border:1px solid #483046;border-radius:12px;padding:14px;margin-top:16px}.formrow{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.formrow>input,.formrow>label,.formrow>select{flex:1;min-width:150px}.formgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:end}.formgrid>button{align-self:end}.row-between{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:16px}.row-between h2{margin:0}.row-between input{max-width:270px}.tablewrap{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:13px;min-width:530px}th{text-align:left;color:#ae99ae;font-size:11px;font-weight:700;letter-spacing:.4px;background:#241b2a}td,th{padding:13px;border-bottom:1px solid #35283a}td button{padding:7px 10px;font-size:11px}tr:hover td{background:#201925}.rank{font-weight:900;color:var(--pink2)}.eventcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:12px}.eventcard{background:#211a29;border:1px solid #433047;padding:18px;border-radius:13px}.eventcard b{display:block;margin:9px 0}.eventcard small{color:var(--muted)}.eventcard .row-between{margin:10px 0 0}.filebtn{display:inline-flex;align-items:center;background:#292130;border:1px solid #483348;color:#fff;border-radius:12px;padding:11px 16px;font-size:14px;font-weight:700;cursor:pointer}.timer-config{display:flex;align-items:end;gap:10px}.timer-config label{flex:1}.timer-box{background:#110d17;border:1px solid #5c2a4a;border-radius:22px;padding:18px;max-width:760px;margin:auto}.timer-top{display:flex;justify-content:space-between;gap:8px;font-size:11px;font-weight:900;color:var(--pink2);letter-spacing:1px}.timer-sub{color:#86758a;font-size:9px}#clock{text-align:center;font-size:clamp(48px,8vw,82px);font-variant-numeric:tabular-nums;font-weight:900;letter-spacing:-3px;padding:9px 0}.start{width:100%;background:linear-gradient(120deg,#0b9c75,#25c998);border:0;font-size:18px;padding:15px}.lanes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}.lane{min-height:83px;background:linear-gradient(135deg,#50203d,#2a1a2c);border:1px solid #7a345b;border-radius:13px;padding:9px;display:flex;align-items:center;justify-content:space-between;flex-direction:column;touch-action:manipulation;user-select:none;-webkit-user-select:none}.lane b{font-size:13px}.lane span{font-size:22px;font-weight:900;font-variant-numeric:tabular-nums}.lane.done{background:linear-gradient(130deg,#123b35,#15352c);border-color:#268c70}.lane.empty{opacity:.4}.timer-actions{display:flex;gap:8px}.timer-actions button{flex:1;padding:11px 5px;font-size:12px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#39253a;border:1px solid #9e4278;border-radius:12px;padding:12px 18px;box-shadow:0 12px 45px #0008;display:none;z-index:100;font-size:13px;max-width:90vw}.focus header,.focus aside,.focus .title,.focus .timer-config,.focus #timer>.hint{display:none}.focus .shell{display:block;min-height:100dvh}.focus main{padding:0;max-width:none}.focus .page{display:none}.focus #timer{display:block}.focus .timer-box{border:0;border-radius:0;max-width:none;height:100dvh;height:100svh;display:flex;flex-direction:column;padding:env(safe-area-inset-top,8px) 10px env(safe-area-inset-bottom,8px)}.focus .lanes{flex:1;min-height:0;grid-template-rows:repeat(4,minmax(0,1fr))}.focus .lane{min-height:0}.focus #clock{font-size:clamp(38px,7vh,62px);padding:2px}.focus .start{padding:10px}.focus .timer-actions{margin-top:auto}.focus .timer-actions button{padding:10px 2px}@media(max-width:800px){header{height:64px;padding:0 12px}.shell{display:block}aside{padding:8px;border-right:0;border-bottom:1px solid var(--line)}.caption,.aside-note{display:none}nav{display:flex;overflow-x:auto;scrollbar-width:none;gap:4px}nav button{width:auto;white-space:nowrap;padding:11px 13px;font-size:12px}main{padding:18px 12px}.hero{padding:24px}.hero-icon{font-size:55px}.stats{grid-template-columns:repeat(2,1fr)}.formgrid{grid-template-columns:repeat(2,minmax(0,1fr))}.card{padding:16px}.timer-box{padding:12px}.timer-top{font-size:10px}.timer-sub{display:none}}@media(max-width:420px){.brand b{font-size:16px}.brand small{font-size:7px}.badge{font-size:9px;padding:7px}.formgrid{grid-template-columns:1fr}.timer-config{flex-wrap:wrap}.timer-config label{min-width:40%}.timer-box .lane{min-height:70px}.timer-box .lane span{font-size:19px}.timer-actions button{font-size:11px}#clock{font-size:51px}.focus .lane{min-height:0}.focus .lane span{font-size:clamp(15px,3.4vh,23px)}}

/* V2: mobile, branding and compact timer */
.owner-link{color:#ff83c2;font-weight:800;font-size:12px;text-decoration:none;margin-left:auto;margin-right:14px}.site-footer{padding:22px 16px;text-align:center;color:#ad9ab0;font-size:12px;border-top:1px solid #34283b;background:#110e17}.site-footer a,.hero a{color:#ff83c2;font-weight:800;text-decoration:none}.focus .site-footer{display:none}.focus .timer-actions{flex-wrap:wrap}.focus .timer-actions button{min-width:0}.focus .timer-box{height:100dvh;max-height:100dvh;overflow:hidden}.focus .lanes{margin:6px 0;gap:6px}.focus .timer-top{flex-shrink:0}.focus .timer-actions{flex-shrink:0}.focus .start{flex-shrink:0}.focus .lane{padding:3px 6px}.focus .lane b{font-size:clamp(10px,1.8vh,13px)}.focus .lane span{font-size:clamp(15px,3vh,22px)}
@media(max-width:600px){.owner-link{font-size:10px;margin-right:7px}.brand small{letter-spacing:.3px}.badge{display:none}.timer-actions{flex-wrap:wrap}.timer-actions button{flex:1 1 40%}.focus .timer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.focus .timer-actions button{font-size:10px;padding:7px 2px}.focus .timer-box{padding:calc(env(safe-area-inset-top) + 4px) 8px calc(env(safe-area-inset-bottom) + 4px)}.focus #clock{font-size:clamp(32px,6.2vh,54px)}.focus .start{font-size:15px;padding:9px}.focus .lanes{grid-template-rows:repeat(4,minmax(0,1fr))}}

/* V3 usability and mobile lane picker */
.picker-backdrop[hidden]{display:none!important}.picker-backdrop{position:fixed;inset:0;z-index:9999;background:rgba(5,3,9,.88);display:flex;align-items:center;justify-content:center;padding:14px}.picker-panel{width:min(100%,520px);max-height:85dvh;overflow:auto;background:#1d1426;border:1px solid #b33879;border-radius:18px;padding:16px;box-shadow:0 16px 70px #000a}.picker-panel h2{margin:0 0 10px}.picker-panel input{width:100%;margin:8px 0}.picker-list{max-height:52dvh;overflow:auto;display:grid;gap:8px;margin:12px 0}.picker-list button{text-align:left;display:flex;flex-direction:column;gap:3px;padding:12px 14px;min-height:55px;background:#2b1b33;border:1px solid #613453;border-radius:12px;color:white}.picker-list button small{color:#f0b9d4}.lane.empty{opacity:1;border-style:dashed}.lane.empty b{color:#f9a5d2}.lane{touch-action:manipulation;user-select:none;-webkit-user-select:none}.sport-group{background:#211626;border:1px solid #5c3052;border-radius:14px;margin:12px 0;padding:12px}.sport-group summary{cursor:pointer;font-weight:800;color:#ff89c3}.sport-group summary span{float:right;font-size:12px;color:#e0b3cb}.event-group{padding:10px 0;border-top:1px solid #57324c;margin-top:10px}.event-group>b{color:#ffb8d9}.podium-row{display:flex;align-items:center;gap:10px;padding:8px 4px;border-bottom:1px solid #473044}.podium-row strong{font-size:20px;min-width:28px}.podium-row span{flex:1}.podium-row small{color:#c6b5c5}.podium-row>b{color:#f8c0dd}.edit-line{display:flex;flex-direction:column;margin:9px 0}.state-chip{font-size:11px;color:#f5a8d0;white-space:nowrap}@media(max-width:600px){.picker-panel{max-height:90dvh}.timer-box .lane{min-height:0}.timer-box .lanes{gap:6px}.timer-actions{gap:5px}.timer-actions button{font-size:11px;padding:8px 6px}.sport-group{padding:9px}}

/* V4 */.enroll-box{margin:15px 0;padding:14px;border:1px solid #58334e;border-radius:13px;background:#211626}.checks{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 15px}.check-pill{display:flex;align-items:center;gap:7px;background:#2d1b30;border:1px solid #65405b;padding:9px 11px;border-radius:10px;color:#ffe1f0;font-size:12px;cursor:pointer}.check-pill input{width:16px;min-width:16px;height:16px;accent-color:#ff3c99}.formrow select#athleteSportFilter{max-width:240px}.row-between #athleteSportFilter{max-width:200px}.row-between{flex-wrap:wrap}.timer-actions button{min-height:38px}@media(max-width:600px){.row-between #athleteSportFilter{max-width:100%}.timer-box .lanes{grid-template-columns:repeat(2,minmax(0,1fr))}.focus .timer-actions button{min-height:36px}}
.progress-track{height:12px;background:#34243a;border-radius:20px;overflow:hidden;margin:12px 0}.progress-fill{height:100%;background:linear-gradient(90deg,#d92d83,#ff7cbb);transition:width .2s}.progress-events{display:grid;gap:10px}.progress-sport{background:#241b2c;border:1px solid #44304c;border-radius:12px;padding:10px}.progress-sport summary{display:flex;justify-content:space-between;cursor:pointer;gap:12px;color:#ffe5f2}.progress-sport summary span{color:#ffa8d1}.progress-item{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 3px;border-top:1px solid #403046}.progress-item>div{display:grid;gap:4px;min-width:0}.progress-item b{font-size:13px}.progress-item small{color:#c6a7bc}.progress-item label{white-space:nowrap;font-size:12px;color:#ffd0e5}.progress-item input{accent-color:#ed4a9e;width:18px;height:18px;vertical-align:middle}@media(max-width:480px){.progress-item{align-items:flex-start}.progress-item label{padding-top:3px}}

/* V4.3: homepage action and backup controls */
.home-quick,.home-backup{margin-top:18px}.home-quick h2,.home-backup h2{color:#ff9acb}.quick-grid,.backup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.quick-grid button,.backup-grid button,.backup-upload{min-height:57px;display:flex;align-items:center;justify-content:center;text-align:center}.backup-upload{width:100%;background:#39263f;border:1px solid #754366;color:#fff;font-size:14px}.backup-help{color:#f3d6e5;font-size:13px;line-height:1.7;border-left:3px solid #ef4d9e;background:#291b2c;padding:12px;border-radius:8px}.home-backup .hint{margin:9px 0}.home-backup .quick{margin-top:12px}@media(max-width:420px){.quick-grid button,.backup-grid button,.backup-upload{font-size:12px;padding:10px 6px;min-height:56px}}

.catalog-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.catalog-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.catalog-sport{border:1px solid #5c3150;background:#251a2c;border-radius:12px;padding:13px}.catalog-sport summary{cursor:pointer;font-weight:800;color:#ffc1df}.catalog-sport summary small{display:block;font-size:11px;color:#b7a3b8;margin:5px 0}.catalog-presets{display:grid;gap:7px;margin-top:12px}.catalog-preset{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;background:#1b1522;border-radius:9px}.catalog-preset span{font-size:12px}.catalog-preset small{color:#c39ab5}.catalog-preset button{padding:7px 9px;font-size:11px;white-space:nowrap}@media(max-width:650px){.catalog-toolbar{grid-template-columns:1fr 1fr}.catalog-toolbar label:first-child{grid-column:1/-1}.catalog-cards{grid-template-columns:1fr}}

/* V4.5: cấu hình cấp học, menu và điện thoại */
.setup-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:end}.setup-grid label{display:flex;flex-direction:column;gap:7px}.setup-grid button{min-height:48px}.nav-export{width:100%;margin-top:8px;border-color:#aa3973!important;color:#ffc4df!important}.setup-card{border:1px solid #713253}.setup-card h2{color:#ff8bc4}
@media(max-width:760px){.setup-grid{grid-template-columns:1fr 1fr}.setup-grid label:first-child{grid-column:1/-1}.setup-grid button{grid-column:1/-1}.setup-grid input,.setup-grid select{min-width:0;width:100%}}

/* HKPD V4.6 match engine */
#matches .formgrid{margin:12px 0}#matches input,#matches select{min-height:43px}#scoreFieldsV46{margin:16px 0;padding:14px;border:1px solid #61304f;border-radius:14px;background:#241829}#scoreFieldsV46 .v46-score-row{display:grid;grid-template-columns:1fr 46px 1fr;gap:8px;align-items:center;margin:9px 0}#scoreFieldsV46 input{text-align:center;font-size:19px;font-weight:700;min-width:0}#scoreFieldsV46 .v46-score-row span{text-align:center;font-weight:700;color:#f7a5cd}#matches .v46-teams{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}#matches .v46-teams span{background:#38233b;border-radius:10px;padding:8px;font-size:13px}#matches .v46-teams button{padding:2px 6px;margin-left:6px}#matches .v46-status{color:#f8a4d1;font-weight:700}#matches table{min-width:700px}#matches .quick{display:flex;gap:8px;flex-wrap:wrap}#matches .hint{line-height:1.5}

#judgePanelV46[hidden]{display:none!important}#judgeInputsV46{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin:10px 0}#judgeInputsV46 input{width:100%;min-height:42px}#judgePanelV46 h3{color:#ff8cbd}

/* V4.7: adaptable lane grid and prominent new heat */
.timer-config .lane-count-label{flex:0 0 118px}.timer-config #laneCount{text-align:center;font-weight:800;font-size:17px}.timer-actions .new-heat{background:#3a2945;border:1px solid #ff79b8;color:#ffd3e8}.focus .lanes{grid-template-rows:repeat(var(--lane-rows,4),minmax(0,1fr))!important}.timer-box .lanes{grid-template-rows:repeat(var(--lane-rows,4),minmax(70px,auto))}@media(max-width:600px){.timer-config .lane-count-label{flex:1 1 95px}.focus .timer-actions{grid-template-columns:repeat(3,minmax(0,1fr))}.focus .timer-actions button{font-size:10px;min-height:38px}}

/* V4.8 - timer configuration, responsive and readable */
.timer-config-responsive{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1.25fr) minmax(105px,.6fr) auto;gap:12px;align-items:end}
.timer-config-responsive label{min-width:0;width:100%;display:flex;flex-direction:column;gap:7px;flex:auto}
.timer-config-responsive select,.timer-config-responsive input{width:100%;max-width:100%;min-width:0;min-height:48px;font-size:14px;line-height:1.35}
.timer-config-responsive #timerEvent{font-size:13px;text-overflow:ellipsis}
.timer-config-responsive .lane-count-label{flex:auto;min-width:0}
.timer-config-responsive>button{min-height:48px;white-space:nowrap}
@media(max-width:700px){
 .timer-config-responsive{grid-template-columns:minmax(0,3fr) minmax(100px,2fr);gap:12px;padding:15px}
 .timer-config-responsive>label:first-child{grid-column:1/-1}
 .timer-config-responsive .lane-count-label{grid-column:2}
 .timer-config-responsive>button{grid-column:1/-1;width:100%}
 .timer-config-responsive label{min-width:0!important}
 .timer-config-responsive select,.timer-config-responsive input{min-height:48px;font-size:15px}
 .timer-config-responsive #timerEvent{font-size:14px}
 .timer-config-responsive #heatName{font-size:15px}
 .timer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .timer-actions button{width:100%;min-width:0;font-size:12px;min-height:44px;white-space:normal}
 .focus .timer-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:360px){.timer-config-responsive{grid-template-columns:minmax(0,1.65fr) minmax(100px,1fr);gap:8px;padding:12px}.timer-config-responsive select{font-size:13px}}

.v49-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-top:14px}.v49-group{padding:14px;border:1px solid #72425e;border-radius:12px;background:#211622}.v49-group h3{color:#ff8ec0}.v49-group div{padding:5px 0;border-bottom:1px solid #483041}.v49-fixture{padding:8px;border-bottom:1px solid #63435a}

/* Quick access on dashboard V4.9.3 */
.quick-competition-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) auto;gap:12px;align-items:end}
.quick-competition-grid label{display:flex;flex-direction:column;gap:8px;min-width:0}
.quick-competition-grid select{width:100%;max-width:100%;min-width:0;text-overflow:ellipsis}
.quick-competition-grid button{min-height:46px;white-space:nowrap}
@media(max-width:760px){.quick-competition-grid{grid-template-columns:minmax(0,1fr)}.quick-competition-grid button{width:100%}.quick-competition .row-between{align-items:flex-start;gap:8px}.quick-competition .badge{font-size:10px}}

.class-setup,.excel-import{margin:18px 0;padding:16px;border:1px solid #68324e;border-radius:14px;background:#1d1425}.class-setup h3,.excel-import h3{margin:0 0 10px;color:#ff8ac2}.class-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.class-chip{border:1px solid #824163;border-radius:9px;padding:6px 9px;background:#2b1a32}.class-chip small{color:#c9aec4}.class-chip button{padding:2px 7px;margin-left:4px}.xlsx-preview{margin-top:12px;max-height:420px;overflow:auto}.import-error{color:#ff9b99}.import-ok{color:#9be3c0}.class-custom{grid-column:1/-1}@media(max-width:600px){.class-setup,.excel-import{padding:12px}.excel-import .quick{display:grid;grid-template-columns:1fr;gap:9px}.excel-import .quick>*{width:100%;text-align:center}}

/* HKPD V4.9.4 */
.catalog-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0}.catalog-tools label{display:flex;align-items:center;gap:8px}.preset-done494{opacity:.58}.preset-done494 span{text-decoration:line-through}.catalog-choice494{width:18px;height:18px;accent-color:#f45caa}.picker-panel label{display:block;margin:10px 0}.picker-panel label input,.picker-panel label select{width:100%;margin-top:5px}#aRows td button{margin:2px}@media(max-width:600px){.catalog-tools button{width:100%}}

/* V4.9.5 LAP stopwatch */
.lap-select-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.lap-select-grid label{display:block;min-width:0;font-size:12px}.lap-select-grid select{width:100%;min-width:0;min-height:47px;font-size:14px}.lap-big{width:100%;background:linear-gradient(130deg,#e51b77,#a30e58);border:1px solid #ff7cb7;color:white;font-weight:900;font-size:clamp(20px,4vw,32px);padding:24px 12px;min-height:100px;border-radius:18px;touch-action:manipulation;-webkit-user-select:none;user-select:none}.lap-big:disabled{opacity:.43}.lap-progress{text-align:center;font-weight:800;color:#f8add4;padding:12px}.lap-live{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:8px 0}.lap-chip{padding:9px 12px;border:1px solid #6d375c;border-radius:10px;background:#2d1c32;font-size:13px}.lap-chip b{color:#ffabd4}.lap-assign{padding:12px;background:#211725;border-radius:14px;border:1px solid #703554;margin:12px 0}.lap-assign[hidden]{display:none}.lap-assign-row{display:grid;grid-template-columns:65px 110px minmax(0,1fr);align-items:center;gap:8px;margin:8px 0}.lap-assign-row input,.lap-assign-row select{width:100%;min-width:0;min-height:43px}.lap-assign-row strong{font-size:13px;color:#ff9dca}.lap-participants{margin-bottom:15px}.focus .lap-participants{display:none}.focus .lap-big{flex:1;min-height:90px}.focus .lap-live{max-height:20vh;overflow:auto}.focus .lap-assign{max-height:35vh;overflow:auto}.focus .timer-box{overflow-y:auto}.focus .timer-actions{margin-top:8px}.focus #clock{font-size:clamp(38px,8vh,72px)}
@media(max-width:600px){.lap-select-grid{grid-template-columns:1fr}.lap-big{min-height:110px;padding:22px 8px}.lap-assign-row{grid-template-columns:48px 90px minmax(0,1fr);gap:5px}.lap-assign-row select,.lap-assign-row input{font-size:13px;padding:8px 4px}.timer-box .lap-live{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V4.9.7 - compact overview */
#home .home-quick .quick-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
#home .home-quick .quick-grid button{background:#e9298a!important;border:1px solid #f448a0!important;color:white!important;min-height:43px;padding:9px 7px;font-size:12px;font-weight:750;border-radius:10px}
#home .home-quick .quick-grid button:hover,#home .home-quick .quick-grid button:focus-visible{background:#ff48a4!important}
#home .class-setup .formgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;align-items:end}
#home .class-setup .formgrid label{min-width:0}
#home .class-setup .formgrid input,#home .class-setup .formgrid select{min-width:0;width:100%}
#home .class-setup .class-custom{grid-column:1/-1}
#home .class-setup .quick button{min-height:37px;padding:8px 15px}
#home .home-event{margin-top:16px}
#home .home-event-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
#home .home-event-grid label{display:flex;flex-direction:column;gap:6px;min-width:0}
#home .home-event-grid select{width:100%;min-width:0}
#home .home-event-actions{display:flex;gap:9px;margin-top:12px;flex-wrap:wrap}
#home .home-event-actions button{min-height:39px}
@media(max-width:700px){#home .home-quick .quick-grid,#home .class-setup .formgrid,#home .home-event-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#home .class-setup .class-custom{grid-column:1/-1}#home .home-quick .quick-grid button{min-height:43px;font-size:12px}#home .class-setup{padding:11px}#home .home-event-actions button{flex:1 1 120px}}

/* V4.9.8 */
.schedule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}.schedule-grid label{min-width:0}.danger498{background:#9f203b;color:#fff;border:1px solid #e94a69;padding:12px 18px;border-radius:10px;cursor:pointer}.danger498:hover{background:#be2548}#homeClassSetup .formgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}#homeClassSetup .formgrid label{min-width:0}#homeClassSetup .class-custom{grid-column:1/-1}#home .home-quick .quick-grid button{background:#e9298a;color:white;border-color:#e9298a}#home .home-quick .quick-grid button:hover{background:#ff4ca7}@media(max-width:700px){#homeClassSetup .formgrid,.schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#homeClassSetup .formgrid label{min-width:0}#homeClassSetup .formgrid input,#homeClassSetup .formgrid select{width:100%;min-width:0}}

/* V4.9.9 */
.demo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.demo-grid label{min-width:0}.demo-grid input,.demo-grid select{width:100%;min-width:0}.demo-cards499{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.demo-card499{break-inside:avoid}.demo-card499 h4{margin:12px 0 4px}.demo-match499{padding:7px 10px;margin:5px 0;border:1px solid #68526c;border-radius:8px}.demo-bracket499{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.danger-inline{border-top:1px solid #6b4052;margin-top:18px;padding-top:14px}.danger-inline h2{color:#ff819b}.reset-overlay499:not([hidden]){position:fixed;inset:0;z-index:99999;background:#000b;display:grid;place-items:center;padding:16px}.reset-box499{background:#211927;color:white;width:min(440px,100%);padding:24px;border-radius:16px;border:1px solid #e9298a;box-shadow:0 16px 70px #0008}.reset-box499 input{display:block;width:100%;margin:10px 0}.reset-box499 .quick{display:flex;flex-wrap:wrap;gap:8px}.reset-box499 button:disabled{opacity:.4;cursor:not-allowed}@media(max-width:650px){.demo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.demo-cards499,.demo-bracket499{grid-template-columns:1fr}}@media print{header,aside,footer,.page:not(#schedule),#schedule>.card,.page-title, .reset-overlay499{display:none!important}#schedule{display:block!important}.demo-cards499{grid-template-columns:repeat(2,minmax(0,1fr))}.demo-card499{break-inside:avoid;box-shadow:none!important}.demo-print499{color:#111!important;break-before:auto}.demo-print499 *{color:#111!important;background:white!important;border-color:#aaa!important}body{background:white!important}main{width:100%!important;margin:0!important;padding:0!important}}

/* HKPD Final V1.0: 2x2 backup/reset controls */
.final-data-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.final-data-grid>*{width:100%;min-width:0;min-height:56px;box-sizing:border-box}
.final-delete{background:#ae243e!important;border:1px solid #d95370!important;color:white!important;border-radius:10px;padding:12px 8px;font-weight:700;cursor:pointer;text-align:center}
.final-delete:hover{background:#c92c4b!important}.final-delete:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:420px){.final-data-grid>*{font-size:12px;padding:10px 5px}}

/* Final V1.0.1 - demo presentation */
.demo-sheet101{background:#fff;color:#182032;border-radius:12px;padding:24px;margin:16px 0;box-shadow:0 5px 20px #0002}.demo-sheet101 h2{color:#182032;text-align:center;font-size:19px;margin:0 0 6px;font-weight:800}.demo-subtitle101{text-align:center;color:#475569;margin:0 0 20px;font-size:13px}.demo-cards101{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;max-width:860px;margin:0 auto}.demo-group101{border:1px solid #64748b;border-radius:3px;overflow:hidden;break-inside:avoid;page-break-inside:avoid;background:#fff}.demo-group101 h3{background:#f1f5f9;color:#172033;text-align:center;margin:0;padding:10px 5px;font-size:15px;border-bottom:1px solid #64748b}.demo-group101 small{font-size:11px;font-weight:400}.demo-group101 table{width:100%;border-collapse:collapse;color:#172033;margin:0}.demo-group101 td{padding:8px 10px;border-bottom:1px solid #cbd5e1;font-size:13px}.demo-group101 tr:last-child td{border-bottom:0}.demo-num101{width:40px;text-align:center;border-right:1px solid #cbd5e1}.demo-bracket-scroll101{overflow-x:auto;max-width:100%;border:1px solid #d6dce5;border-radius:8px;background:white;padding:8px}.demo-bracket-svg101{display:block;max-width:none}.demo-ko101{overflow:hidden}@media(max-width:600px){.demo-sheet101{padding:12px}.demo-cards101{grid-template-columns:1fr;gap:10px}.demo-sheet101 h2{font-size:16px}.demo-group101 td{padding:7px 8px}}
@page{size:A4 portrait;margin:15mm}
@media print{html,body{margin:0!important;padding:0!important;background:#fff!important}#demoOutput499{display:block!important;width:100%!important}.demo-sheet101{margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;break-after:page;page-break-after:always;color:#111!important}.demo-sheet101:last-child{break-after:auto;page-break-after:auto}.demo-cards101{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10mm!important}.demo-group101{border:1px solid #555!important;break-inside:avoid!important}.demo-group101 h3{background:#eee!important;color:#111!important}.demo-group101 td{color:#111!important}.demo-ko101 .demo-bracket-scroll101{overflow:visible!important;border:0!important;padding:0!important}.demo-ko101 .demo-bracket-svg101{width:100%!important;height:auto!important;max-height:245mm!important}.demo-print499 *{-webkit-print-color-adjust:exact;print-color-adjust:exact}#schedule{width:100%!important;max-width:none!important}}

/* V1.0.2: demo print layout and legibility */
.demo-print-options102{display:grid;grid-template-columns:repeat(2,minmax(0,220px));gap:12px;margin:15px 0}.demo-print-options102 label{display:block}.demo-print-options102 select{display:block;width:100%;margin-top:5px}.demo-ko101 .demo-bracket-scroll101{padding:18px;overflow-x:auto}.demo-ko101 .demo-bracket-svg101{margin:auto}.demo-ko101{max-width:none}@media(max-width:600px){.demo-print-options102{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{.demo-ko101 .demo-bracket-svg101{width:100%!important;height:auto!important;max-height:none!important}.demo-ko101 .demo-bracket-scroll101{padding:0!important;overflow:visible!important}.demo-sheet101{break-inside:avoid-page}.demo-ko101{overflow:visible!important}}

/* DEMO V1.0.4: dedicated screen and print layout */
.demo-sheet104{background:#fff;color:#17243a;padding:22px;border-radius:10px;margin:16px 0;box-shadow:0 3px 16px #0002}.demo-sheet104 h2{text-align:center;font-size:19px;margin:0 0 6px;color:#17243a}.demo-subtitle104{text-align:center;font-size:13px;color:#475569;margin:0 0 18px}.demo-cards104{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:900px;margin:auto}.demo-group104{border:1px solid #64748b;break-inside:avoid;border-radius:4px;overflow:hidden}.demo-group104 h3{text-align:center;margin:0;padding:10px 6px;background:#f1f5f9;color:#17243a;font-size:16px}.demo-group104 small{font-weight:400;font-size:12px}.demo-group104 table{width:100%;border-collapse:collapse;margin:0}.demo-group104 td{padding:9px 12px;border-top:1px solid #cbd5e1;font-size:14px;color:#17243a}.demo-index104{width:48px;text-align:center;border-right:1px solid #cbd5e1}.demo-bracket-scroll104{overflow-x:auto;background:white;border:1px solid #dce3ed;border-radius:6px;padding:12px}.demo-bracket-svg104{display:block;max-width:none;margin:auto}.demo-knockout-sheet104{overflow:hidden}@media(max-width:650px){.demo-cards104{grid-template-columns:1fr}.demo-sheet104{padding:12px}.demo-group104 td{padding:8px}}
@media print{#demoOutput499{display:block!important;width:100%!important}.demo-sheet104{background:white!important;color:#17243a!important;box-shadow:none!important;border:0!important;border-radius:0!important;padding:0!important;margin:0!important;break-after:page!important;page-break-after:always!important}.demo-sheet104:last-child{break-after:auto!important;page-break-after:auto!important}.demo-sheet104 h2{color:#17243a!important}.demo-cards104{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8mm!important}.demo-group104{break-inside:avoid!important}.demo-group104 h3{color:#17243a!important}.demo-group104 td{color:#17243a!important}.demo-bracket-scroll104{overflow:visible!important;padding:0!important;border:0!important}.demo-bracket-svg104{width:100%!important;height:auto!important}.demo-knockout-sheet104{break-inside:avoid!important}body{background:white!important}}

/* V1.0.5 - Two matching hero actions: guide and stopwatch */
.hkpd-hero-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:min(100%,850px);margin-top:14px}
.hkpd-hero-actions .hkpd-hero-action{display:inline-flex;align-items:center;justify-content:center;gap:9px;width:100%;min-width:0;min-height:48px;padding:12px 14px;box-sizing:border-box;border:0;border-radius:12px;background:#E9298A;color:#fff!important;font-family:inherit;font-size:14px;font-weight:600;line-height:1.3;text-align:center;text-decoration:none;white-space:normal;box-shadow:none;cursor:pointer}
.hkpd-hero-actions .hkpd-hero-action:hover{background:#f33d9c;border-color:transparent;color:#fff}
.hkpd-hero-actions .hkpd-hero-action:focus-visible{outline:2px solid #fff;outline-offset:3px}
.hkpd-hero-actions .hkpd-hero-action span{display:inline-block}
@media(max-width:560px){.hkpd-hero-actions{grid-template-columns:1fr}.hkpd-hero-actions .hkpd-hero-action{min-height:48px}}

/* HKPD V1.0.5 - printable round-robin match schedule */
.demo-rounds105{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.demo-round105{border:1px solid #cbd5e1;border-radius:7px;overflow:hidden;break-inside:avoid;page-break-inside:avoid;background:#fff}
.demo-round105 h3{font-size:15px;text-align:center;color:#17243a;background:#e9eff7;margin:0;padding:9px}
.demo-round105 table{width:100%;border-collapse:collapse;table-layout:fixed}
.demo-round105 th,.demo-round105 td{font-size:12px;color:#17243a;padding:8px 5px;border-top:1px solid #dce3eb;text-align:center;overflow-wrap:anywhere}
.demo-round105 th{background:#f8fafc;font-weight:700}
.demo-round105 th:first-child,.demo-round105 td:first-child{width:18%;font-weight:700}
.demo-round105 th:nth-child(3),.demo-round105 td:nth-child(3){width:24%}
.demo-score105{white-space:nowrap}
.demo-bye105{text-align:center;font-size:12px;color:#334155;margin:8px}
@media(max-width:700px){.demo-rounds105{grid-template-columns:1fr}.demo-round105 td,.demo-round105 th{font-size:11px;padding:7px 3px}}
@media print{
 .demo-round-sheet105{break-before:page!important;page-break-before:always!important;break-after:page!important;page-break-after:always!important}
 .demo-round-sheet105:last-child{break-after:auto!important;page-break-after:auto!important}
 .demo-rounds105{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6mm!important}
 .demo-round105{break-inside:avoid!important;page-break-inside:avoid!important;border:1px solid #777!important}
 .demo-round105 th,.demo-round105 td{font-size:10px!important;padding:4px 2px!important}
 .demo-round105 h3{font-size:12px!important;padding:5px!important}
 .demo-bye105{font-size:10px!important}
 .demo-round-sheet105 h2{font-size:16px!important}
 .demo-round-sheet105 .demo-subtitle104{margin-bottom:8px!important}
}

/* V1.0.6: full-width rounds prevent second opponent being clipped on mobile and print. */
.demo-round-sheet105 .demo-rounds105{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;max-width:950px;margin:0 auto}
.demo-round-sheet105 .demo-round105{width:100%;min-width:0;overflow:visible;background:#fff!important;color:#17243a!important}
.demo-round-sheet105 .demo-round105 table{width:100%!important;table-layout:fixed!important;background:#fff!important;border-collapse:collapse}
.demo-round-sheet105 .demo-round105 thead,.demo-round-sheet105 .demo-round105 tbody,.demo-round-sheet105 .demo-round105 tr{background:#fff!important;color:#17243a!important}
.demo-round-sheet105 .demo-round105 th,.demo-round-sheet105 .demo-round105 td{background:#fff!important;color:#17243a!important;box-sizing:border-box;overflow-wrap:normal;word-break:normal;white-space:normal;border-color:#cbd5e1!important}
.demo-round-sheet105 .demo-round105 th{background:#f1f5f9!important}
.demo-round-sheet105 .demo-round105 th:nth-child(1),.demo-round-sheet105 .demo-round105 td:nth-child(1){width:15%}
.demo-round-sheet105 .demo-round105 th:nth-child(2),.demo-round-sheet105 .demo-round105 td:nth-child(2){width:30%}
.demo-round-sheet105 .demo-round105 th:nth-child(3),.demo-round-sheet105 .demo-round105 td:nth-child(3){width:30%}
.demo-round-sheet105 .demo-round105 th:nth-child(4),.demo-round-sheet105 .demo-round105 td:nth-child(4){width:25%}
.demo-round-sheet105 .demo-round105 .demo-score105{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:480px){.demo-round-sheet105 .demo-round105 th,.demo-round-sheet105 .demo-round105 td{font-size:11px!important;padding:8px 2px!important}.demo-round-sheet105 .demo-round105 .demo-score105{font-size:10px!important}}
@media print{.demo-round-sheet105 .demo-rounds105{grid-template-columns:minmax(0,1fr)!important;gap:4mm!important}.demo-round-sheet105 .demo-round105{break-inside:avoid!important;page-break-inside:avoid!important}.demo-round-sheet105 .demo-round105 th,.demo-round-sheet105 .demo-round105 td{font-size:10px!important;padding:4px 3px!important;color:#17243a!important}.demo-round-sheet105 .demo-round105 th{background:#f1f5f9!important}}

/* V1.0.7: responsive manual/automatic BYE drawing */
.demo-bye-config106{margin:14px 0;padding:14px;border:1px solid #68445d;border-radius:12px;background:#211625}.demo-bye-config106 label{display:block}.demo-bye-config106 select{width:100%;margin-top:7px}.demo-bye-choices106{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:8px;margin:10px 0}.demo-bye-choices106 label{padding:8px;border:1px solid #60405c;border-radius:8px;display:flex;align-items:center;gap:7px}.demo-bye-choices106 input{accent-color:#e9298a}.demo-round105 td,.demo-round105 th{color:#17243a!important;background:#fff!important}.demo-round105 th{background:#f1f5f9!important}@media print{.demo-round105 td,.demo-round105 th{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

/* HKPD 2.0.8 - Quick test athlete generator */
.qa-demo208{margin:18px 0;padding:18px;border:1px solid #64415d;border-radius:16px;background:#211527}
.qa-demo208 h3{margin:0 0 6px;color:#ff76b9}
.qa-grid208{display:grid;grid-template-columns:1fr 1.4fr minmax(140px,.65fr);gap:12px;margin:12px 0}
.qa-grid208 label{display:flex;flex-direction:column;gap:7px;font-size:13px;color:#e9cfe1;min-width:0}
.qa-grid208 select,.qa-grid208 input{box-sizing:border-box;min-width:0;width:100%;min-height:44px;padding:10px;border:1px solid #63435e;border-radius:10px;background:#120e1a;color:#fff;font-size:14px}
.qa-actions208{display:flex;flex-wrap:wrap;gap:10px}
.qa-actions208 button{min-height:44px;border-radius:10px}
@media(max-width:750px){.qa-grid208{grid-template-columns:1fr}.qa-actions208{display:grid;grid-template-columns:1fr 1fr}.qa-actions208 .primary{grid-column:1/-1}.qa-demo208{padding:14px}}
@media print{.qa-demo208{display:none!important}}
