
/* True Line account, access and theory UI */
.authTabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:16px 0 14px}
.authTab{border:1px solid #36444c;background:#11181c;color:#cbd5da;border-radius:10px;padding:10px 12px;font-weight:800}
.authTab.active{background:#f1f2ef;color:#111519;border-color:#f1f2ef}
.authForm[hidden]{display:none!important}
.authLinks{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;flex-wrap:wrap}
.authLink{border:0;background:transparent;color:#cfb76d;padding:4px 0;font-size:12px;text-decoration:underline;text-underline-offset:3px}
.authNote{margin-top:12px;padding:10px 11px;border:1px solid #334149;background:#101619;border-radius:10px;color:#aeb9bf;font-size:12px;line-height:1.45}
.authSuccess{color:#9ed9af}.authDanger{color:#f1aaaa}
.loginCard .loginField{margin-top:10px}
.loginCard .loginField input{width:100%;margin-top:5px}
.loginSecondary{width:100%;border:1px solid #43515a;background:#13191d;color:#e7edef;border-radius:11px;padding:11px 12px;font-weight:850;margin-top:8px}
.deviceReplace{margin-top:12px;padding:12px;border:1px solid #725c2f;background:#292316;border-radius:12px}
.deviceReplace h3{margin:0 0 7px;font-size:14px}.deviceReplace p{margin:0 0 9px;color:#c8b987;font-size:12px;line-height:1.45}
.deviceReplace button{width:100%;margin-top:6px;border:1px solid #806b38;background:#17140e;color:#efd994;border-radius:9px;padding:9px;font-weight:800}

.portalOverlay{position:fixed;inset:0;z-index:118;background:linear-gradient(180deg,rgba(7,10,12,.985),rgba(13,18,22,.985));display:none;overflow:auto;padding:18px}
.portalOverlay.show{display:grid;place-items:center}
.portalCard{width:min(980px,100%);background:linear-gradient(180deg,#171f24,#11171a);border:1px solid #314048;border-radius:22px;padding:22px;box-shadow:0 25px 70px rgba(0,0,0,.38)}
.portalCard.narrow{width:min(620px,100%)}
.portalHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.portalHeader h1{margin:10px 0 5px;font-size:clamp(29px,5vw,46px);line-height:1.02}
.portalLead{margin:0;color:#b6c2c8;line-height:1.5;max-width:700px}
.portalChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:20px}
.portalChoice{min-height:170px;text-align:left;border:1px solid #35434b;background:linear-gradient(180deg,#151d22,#11171a);border-radius:18px;padding:18px;color:#edf2f3}
.portalChoice:hover,.portalChoice:focus-visible{border-color:#b89545;background:linear-gradient(180deg,#262116,#171813)}
.portalChoice strong{display:block;font-size:24px;margin-bottom:8px}.portalChoice span{display:block;color:#aeb9bf;line-height:1.48;font-size:13px}
.portalChoice .mini{margin-top:14px;color:#e7cf88;font-size:11px;font-weight:800;letter-spacing:.03em;text-transform:uppercase}
.portalFoot{margin-top:16px;padding-top:13px;border-top:1px solid #2f3b42;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;color:#8f9ca3;font-size:12px}

.accessStatus{margin:18px 0 12px;padding:16px;border:1px solid #3a464d;background:#101619;border-radius:15px}
.accessStatus.active{border-color:#4f765c;background:#122018}.accessStatus.free{border-color:#745f31;background:#282216}
.accessStatus strong{display:block;font-size:18px;margin-bottom:4px}.accessStatus p{margin:0;color:#aeb9bf;line-height:1.45}
.accessActions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:14px}
.accessBtn{border:1px solid #445159;background:#172026;color:#edf2f3;border-radius:11px;padding:12px 14px;font-weight:850}
.accessBtn.primary{border-color:var(--gold);background:var(--gold);color:#171208}
.accessBtn.danger{border-color:#6f4444;color:#efb3b3;background:#211516}
.redeemBox{display:none;margin-top:12px;padding:13px;border:1px solid #3a464d;background:#0f1518;border-radius:13px}
.redeemBox.show{display:block}.redeemRow{display:grid;grid-template-columns:1fr auto;gap:8px}
.redeemRow input{min-width:0;border:1px solid #3d4a51;background:#0d1215;color:#f0f3f4;border-radius:10px;padding:11px 12px;text-transform:uppercase}
.statusMessage{min-height:18px;margin-top:8px;color:#aeb9bf;font-size:12px;line-height:1.4}
.statusMessage.good{color:#9dd5ac}.statusMessage.bad{color:#efaaaa}

.accountBackdrop{position:fixed;inset:0;z-index:360;background:rgba(3,5,7,.84);display:none;align-items:flex-start;justify-content:center;padding:24px 14px;overflow:auto}
.accountBackdrop.show{display:flex}
.accountModal{width:min(780px,100%);background:linear-gradient(180deg,#171f24,#0f1518);border:1px solid #35434b;border-radius:20px;padding:19px;box-shadow:0 30px 90px rgba(0,0,0,.55)}
.accountModalHeader{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.accountModalHeader h2{margin:4px 0 2px}
.iconClose{border:1px solid #3d4a51;background:#11181c;color:#e4eaed;width:38px;height:38px;border-radius:10px;font-size:20px}
.accountGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.accountSection{border:1px solid #303d44;background:#101619;border-radius:14px;padding:13px}
.accountSection.full{grid-column:1/-1}.accountSection h3{margin:0 0 9px;font-size:14px}
.accountMeta{display:grid;gap:5px;color:#aeb9bf;font-size:12px}.accountMeta b{color:#edf2f3}
.deviceList{display:grid;gap:7px}.deviceRow{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:9px;border:1px solid #2f3b42;border-radius:10px;background:#0d1316}
.deviceRow small{display:block;color:#829097;margin-top:2px}.deviceRow button{border:1px solid #56464a;background:#1b1214;color:#e9b1b1;border-radius:8px;padding:7px 9px;font-size:11px}
.inlineForm{display:grid;gap:8px}.inlineForm input,.inlineForm select{width:100%;border:1px solid #3d4a51;background:#0c1215;color:#f0f3f4;border-radius:9px;padding:10px}
.inlineForm button{border:0;background:var(--gold);color:#171208;border-radius:9px;padding:10px 12px;font-weight:850}

.adminPanel{margin-top:16px;border-top:1px solid #354148;padding-top:15px}
.adminColumns{display:grid;grid-template-columns:320px 1fr;gap:12px}
.adminBox{border:1px solid #303d44;background:#101619;border-radius:14px;padding:13px}.adminBox h3{margin:0 0 9px}
.codeList,.userList{display:grid;gap:6px;max-height:390px;overflow:auto}
.codeRow,.userRow{display:grid;grid-template-columns:1fr auto;gap:8px;padding:9px;border:1px solid #2c383e;background:#0d1316;border-radius:9px;font-size:11px}
.codeRow code{color:#efd994;font-weight:850;font-size:12px}.codeRow small,.userRow small{color:#839198}
.copyBtn,.smallBtn{border:1px solid #435159;background:#172026;color:#edf2f3;border-radius:8px;padding:7px 9px;font-size:11px;font-weight:800}
.generatedCodes{margin-top:9px;padding:10px;border:1px solid #5f512e;background:#282217;border-radius:10px;white-space:pre-wrap;color:#efd994;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;max-height:180px;overflow:auto}

.theoryScreen{position:fixed;inset:0;z-index:126;background:linear-gradient(180deg,#070a0c,#0d1216);display:none;overflow:auto}
.theoryScreen.show{display:block}
.theoryTop{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 14px;background:rgba(8,11,13,.95);border-bottom:1px solid #2e3a40;backdrop-filter:blur(12px)}
.theoryTop strong{font-size:18px}.theoryTop small{display:block;color:#8f9ca3;margin-top:2px}
.theoryBack{border:1px solid #3c4950;background:#131a1e;color:#e4eaed;border-radius:10px;padding:9px 11px;font-weight:800}
.theoryShell{max-width:1250px;margin:auto;padding:14px;display:grid;grid-template-columns:270px minmax(0,1fr);gap:12px}
.theoryMenu{display:grid;align-content:start;gap:7px}
.theoryMenu button{text-align:left;border:1px solid #334048;background:#12191d;color:#dce4e7;border-radius:11px;padding:11px 12px}
.theoryMenu button.active{border-color:#b89545;background:#292316;color:#efd994;font-weight:850}
.theoryCard{background:linear-gradient(180deg,#171f24,#101518);border:1px solid #303d44;border-radius:16px;padding:14px}
.theoryTitle{margin:0 0 5px;font-size:26px}.theoryText{margin:0 0 12px;color:#aeb9bf;line-height:1.5}
.theoryBoardWrap{border-radius:14px;overflow:hidden;background:#090d0f;padding:10px}
.theoryBoard{width:100%;height:auto;display:block}
.theoryLegend{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;color:#99a7ae;font-size:11px}
.theoryLegend span{border:1px solid #354249;border-radius:999px;padding:5px 8px}
.theoryTip{margin-top:11px;padding:10px 11px;border:1px solid #5f512e;background:#262116;color:#e1ca85;border-radius:10px;font-size:12px;line-height:1.45}

body.access-free .app,body.access-free #startScreen{display:none!important}
body.access-free .topbar{display:none!important}
body.access-free .installSheet{display:none!important}
body:not(.loggedIn) .app{filter:blur(2px);pointer-events:none}
.accountBtn{display:none;border:1px solid #3b4951;background:#11181c;color:#dce5e8;border-radius:999px;padding:7px 9px;font-size:10px;font-weight:800}
.loggedIn .accountBtn{display:inline-flex}

@media(max-width:760px){
  .portalChoices,.accessActions,.accountGrid,.adminColumns{grid-template-columns:1fr}
  .accountSection.full{grid-column:auto}
  .theoryShell{grid-template-columns:1fr}
  .theoryMenu{grid-template-columns:repeat(2,minmax(0,1fr))}
  .theoryMenu button{font-size:11px;padding:9px}
  .portalCard{padding:17px}
}
@media(max-width:430px){
  .redeemRow{grid-template-columns:1fr}
  .theoryMenu{grid-template-columns:1fr 1fr}
  .portalChoice{min-height:145px}
}


/* Central exercise bank */
.exerciseMetaAdmin{display:none;margin:12px 0;padding:13px;border:1px solid #786332;background:#211d14;border-radius:13px}
body.role-admin .exerciseMetaAdmin{display:block}
.exerciseMetaGrid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.exerciseMetaGrid .wide{grid-column:1/-1}
.exerciseMetaAdmin label{display:grid;gap:5px;color:#d9c990;font-size:11px;font-weight:800}
.exerciseMetaAdmin input,.exerciseMetaAdmin textarea,.exerciseMetaAdmin select{width:100%;border:1px solid #4b4b3e;background:#0f1417;color:#f1f3ef;border-radius:9px;padding:9px 10px;font:inherit}
.exerciseMetaAdmin textarea{min-height:72px;resize:vertical}
.exerciseMetaActions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.exerciseMetaActions button{border:1px solid #655a39;background:#171a1b;color:#f0ead6;border-radius:9px;padding:8px 10px;font-size:12px;font-weight:800}
.exerciseMetaActions .primary{background:var(--gold);border-color:var(--gold);color:#18130b}
.exerciseMetaActions .danger{border-color:#744949;color:#f0c6c6}
.exerciseCentralBadge{display:inline-flex;align-items:center;gap:6px;border:1px solid #526255;background:#122019;color:#aee0ba;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:800}
.exerciseBankBtn{display:none;border:1px solid #8e7540;background:#292316;color:#efd78f;border-radius:999px;padding:7px 9px;font-size:10px;font-weight:800}
body.role-admin.loggedIn .exerciseBankBtn{display:inline-flex}
.exerciseBankBackdrop{position:fixed;inset:0;z-index:390;background:rgba(3,5,7,.88);display:none;padding:18px;overflow:auto}
.exerciseBankBackdrop.show{display:block}
.exerciseBankModal{width:min(1100px,100%);margin:0 auto;background:linear-gradient(180deg,#171f24,#0e1417);border:1px solid #35434b;border-radius:20px;padding:18px;box-shadow:0 30px 90px rgba(0,0,0,.58)}
.exerciseBankHead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.exerciseBankHead h2{margin:5px 0 3px}
.exerciseBankFilters{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin:14px 0}
.exerciseBankFilters select,.exerciseBankFilters button{border:1px solid #3d4a51;background:#101619;color:#edf2f3;border-radius:9px;padding:10px}
.exerciseBankFilters button{background:var(--gold);border-color:var(--gold);color:#171208;font-weight:850}
.exerciseBankList{display:grid;gap:7px}
.exerciseBankRow{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:9px;align-items:center;padding:10px;border:1px solid #303d44;background:#0e1417;border-radius:11px}
.exerciseBankOrder{display:flex;gap:4px}.exerciseBankOrder button{width:24px;height:28px;border:1px solid #3c494f;background:#151d21;color:#dbe3e7;border-radius:7px;padding:0}
.exerciseBankName b{display:block}.exerciseBankName small{display:block;color:#8f9ca3;margin-top:3px;line-height:1.35}
.exerciseBankState{display:inline-flex;margin-left:7px;border:1px solid #455159;border-radius:999px;padding:2px 6px;font-size:9px;text-transform:uppercase;letter-spacing:.04em}
.exerciseBankState.published{border-color:#4e745a;color:#a9dbb5}.exerciseBankState.draft{border-color:#7b6834;color:#e5ce87}.exerciseBankState.hidden{border-color:#694848;color:#e5aaaa}
.exerciseBankActions{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.exerciseBankActions button{border:1px solid #435159;background:#172026;color:#edf2f3;border-radius:8px;padding:7px 8px;font-size:10px;font-weight:800}
.exerciseBankActions button.danger{border-color:#67464a;color:#ecb1b1;background:#1e1416}
.exerciseBankEmpty{padding:22px;border:1px dashed #435159;border-radius:12px;text-align:center;color:#93a0a8}
@media(max-width:760px){
 .exerciseMetaGrid{grid-template-columns:1fr}.exerciseMetaGrid .wide{grid-column:auto}
 .exerciseBankFilters{grid-template-columns:1fr}
 .exerciseBankRow{grid-template-columns:44px 1fr}
 .exerciseBankActions{grid-column:1/-1;justify-content:flex-start}
}


/* True Line inline editor */
.theoryAdminBtn{display:none;border:1px solid #8e7540;background:#292316;color:#efd78f;border-radius:10px;padding:9px 12px;font-weight:850}
body.role-admin .theoryAdminBtn{display:inline-flex}
.theoryTopActions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.theoryEditor{display:none;margin-bottom:12px;padding:13px;border:1px solid #6f5b2f;background:linear-gradient(180deg,#251f14,#171812);border-radius:14px}
.theoryEditor.show{display:block}
.theoryEditorGrid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.theoryEditorGrid .wide{grid-column:1/-1}
.theoryEditor label{display:grid;gap:5px;color:#decf9b;font-size:11px;font-weight:800}
.theoryEditor input,.theoryEditor textarea,.theoryEditor select{width:100%;border:1px solid #4a4b40;background:#0e1417;color:#f0f3f4;border-radius:9px;padding:9px 10px;font:inherit}
.theoryEditor textarea{min-height:68px;resize:vertical}
.theoryEditorActions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.theoryEditorActions button,.theoryTool{border:1px solid #5b543d;background:#171a1b;color:#efe8d2;border-radius:9px;padding:8px 10px;font-size:11px;font-weight:800}
.theoryEditorActions button.primary,.theoryTool.active{background:var(--gold);border-color:var(--gold);color:#18130b}
.theoryEditorActions button.danger{border-color:#704548;color:#efb8b8}
.theoryToolSection{margin-top:10px;padding-top:10px;border-top:1px solid #453e2b}
.theoryToolSection b{display:block;margin-bottom:7px;color:#d9c990;font-size:10px;text-transform:uppercase;letter-spacing:.07em}
.theoryToolRow{display:flex;gap:6px;flex-wrap:wrap}
.theoryEditorStatus{margin-top:9px;color:#b8c4c9;font-size:11px;min-height:16px}
.theoryBoard.editing{touch-action:none}
.theoryEditHandle{cursor:grab;stroke:#101315;stroke-width:2}
.theoryEditHandle.selected{stroke:#f4dc91;stroke-width:4}
.theoryEditBall{cursor:grab}
.theoryEditBall.selected{stroke:#f4dc91!important;stroke-width:4!important}
.theoryEditMarker{cursor:grab}
.theoryEditMarker.selected{stroke:#f4dc91!important;stroke-width:4!important}
.theoryEditLabel{cursor:grab;user-select:none}
.theoryMenuAdmin{display:flex;gap:4px;align-items:center}
.theoryMenuAdmin button{flex:1;text-align:left}
.theoryMenuOrder{display:none;gap:3px}
body.role-admin .theoryEditor.show~* .theoryMenuOrder{display:flex}
.theoryMenuOrder button{width:28px;padding:7px 0;text-align:center}
.theoryBoardTypeBadge{display:inline-flex;margin-left:8px;border:1px solid #455159;border-radius:999px;padding:3px 7px;color:#aeb9bf;font-size:10px}
@media(max-width:760px){
 .theoryEditorGrid{grid-template-columns:1fr}.theoryEditorGrid .wide{grid-column:auto}
 .theoryTopActions{width:100%;justify-content:flex-end}
}

.theoryBoardShell{position:relative;width:100%;overflow:hidden}.theoryBoardShell .theoryBoard{display:block;width:100%;height:auto}.theoryBoardShell #theorySponsorStage{position:absolute;inset:0;z-index:6;pointer-events:none}.theoryCard>.sponsorRow{padding:8px 0 0}
