
.tof-setup-wrap{max-width:1760px;margin:24px 24px 70px 4px;color:#17202a}
.tof-head{display:flex;justify-content:space-between;gap:24px;align-items:end;background:#fff;border:1px solid #dfe6ef;border-radius:18px;padding:22px 26px}
.tof-head h1{font-size:38px;line-height:1;margin:7px 0}.tof-head p{margin:0;color:#667085}
.tof-kicker,.tof-card-head>div>span{font-size:10px;font-weight:900;letter-spacing:.16em;color:#0877ed}
.tof-head-actions{display:flex;gap:8px;flex-wrap:wrap}.tof-head-actions .button{min-height:42px;padding:0 15px}
.tof-status{margin:13px 0;padding:10px 15px;border-radius:10px;background:#eef6ff;color:#075cae;font-weight:650}
.tof-status.err{background:#fff0f0;color:#a80000}

.tof-builder{display:grid;grid-template-columns:minmax(460px,43%) minmax(600px,57%);gap:18px;align-items:start}
.tof-visual{position:sticky;top:44px;align-self:start;background:#fff;border:1px solid #dfe6ef;border-radius:18px;padding:16px;max-height:calc(100vh - 65px);overflow:auto}
.tof-visual-head{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-bottom:10px}
.tof-visual-head span{display:block;color:#0877ed;font-size:9px;font-weight:900;letter-spacing:.12em}
.tof-visual-head h2{font-size:24px;margin:3px 0 0}
.tof-focus-stage{position:relative;width:100%;height:430px;padding:0;border:1px solid #dbe5ef;border-radius:13px;background:#f7f9fc;overflow:hidden;cursor:zoom-in}
.tof-focus-stage img{width:100%;height:100%;object-fit:contain;display:block}
.tof-zoom-hint{position:absolute;right:9px;bottom:9px;background:rgba(17,27,39,.82);color:#fff;padding:6px 9px;border-radius:7px;font-size:10px;font-weight:700}
.tof-section-nav{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:9px}
.tof-section-nav button{border:1px solid #d8e3ed;background:#fff;border-radius:8px;padding:7px 5px;color:#4b5968;font-size:9px;font-weight:750;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tof-section-nav button span{display:block;color:#98a4b2;font-size:7px;margin-bottom:1px}
.tof-section-nav button.active,.tof-section-nav button:hover{border-color:#68acf0;background:#edf6ff;color:#056ac9}
.tof-section-nav button.active span{color:#056ac9}
.tof-progress{margin-top:10px;padding:10px;border-radius:10px;background:#f6f8fb}
.tof-progress-label{display:flex;justify-content:space-between;font-size:10px;font-weight:700;color:#536171;margin-bottom:6px}
.tof-progress>div:last-child{height:6px;border-radius:99px;background:#e1e7ee;overflow:hidden}
.tof-progress i{display:block;width:0;height:100%;background:#0877ed;border-radius:99px;transition:width .2s}

.tof-fields{display:flex;flex-direction:column;gap:13px;min-width:0}
.tof-modelbar,.tof-card{background:#fff;border:1px solid #dfe6ef;border-radius:18px}
.tof-modelbar{display:grid;grid-template-columns:minmax(190px,.7fr) minmax(320px,1.5fr);gap:14px;padding:14px 18px}
.tof-modelbar>div{display:flex;align-items:center;gap:10px}.tof-modelbar label{font-weight:750;white-space:nowrap}

.tof-card{overflow:hidden;scroll-margin-top:55px}
.tof-card-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 18px;border-bottom:1px solid #e7edf4;background:#fcfdff}
.tof-card-head h2{font-size:21px;margin:3px 0 0}.tof-card-head p{margin:4px 0 0;color:#788492;font-size:11px}
.tof-card-head .button{min-height:34px}

.tof-grid{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:9px 11px;padding:15px 18px 18px}
.tof-field{display:flex;flex-direction:column;gap:5px}.tof-field span{font-weight:700;color:#354252;font-size:11px}
.tof-modelbar input,.tof-modelbar select,.tof-field input,.tof-field textarea{width:100%;box-sizing:border-box;border:1px solid #cbd7e4;border-radius:8px;padding:7px 9px;background:#fff;box-shadow:none}
.tof-modelbar input,.tof-modelbar select,.tof-field input{min-height:37px}
.tof-field textarea{min-height:110px;resize:vertical}

.tof-visual-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 10px;padding:14px 18px 4px}
.tof-visual-controls:empty{display:none}
.tof-visual-caption{grid-column:1/-1;padding:10px 12px;border-radius:9px;background:#f0f7ff;border:1px solid #d7eafd}
.tof-visual-caption span{display:block;font-size:8px;font-weight:900;letter-spacing:.13em;color:#0877ed}
.tof-visual-caption p{margin:3px 0 0;font-size:10px;color:#697889}
.tof-control-block{border:1px solid #dfe6ef;border-radius:10px;padding:10px;background:#fff}
.tof-control-block>b{display:block;margin-bottom:7px;font-size:11px;color:#263442}
.tof-choice-row{display:flex;flex-wrap:wrap;gap:5px}
.tof-choice{border:1px solid #cfdbe7;background:#f8fafc;color:#354252;border-radius:7px;min-height:31px;padding:5px 9px;font-size:10px;font-weight:750;cursor:pointer}
.tof-choice:hover{border-color:#8cbff0;color:#076bc9}
.tof-choice.selected{border-color:#0877ed;background:#0877ed;color:#fff;box-shadow:0 3px 8px rgba(8,119,237,.16)}
.tof-toggle{width:100%}

.tof-modal{position:fixed;z-index:99999;inset:0;background:rgba(8,18,30,.88);padding:32px;overflow:auto}
.tof-modal img{display:block;max-width:1450px;max-height:calc(100vh - 64px);width:auto;height:auto;margin:auto;background:#fff;border-radius:13px;box-shadow:0 20px 60px rgba(0,0,0,.38)}
.tof-close{position:fixed;right:26px;top:18px;border:0;background:#fff;width:43px;height:43px;border-radius:50%;font-size:29px;line-height:1;cursor:pointer;z-index:2}

@media(max-width:1250px){
 .tof-builder{grid-template-columns:minmax(390px,40%) minmax(520px,60%)}
 .tof-focus-stage{height:380px}
 .tof-grid{grid-template-columns:repeat(2,minmax(150px,1fr))}
}
@media(max-width:1000px){
 .tof-builder{grid-template-columns:1fr}
 .tof-visual{position:relative;top:auto;max-height:none}
 .tof-focus-stage{height:500px}
 .tof-visual-controls{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
 .tof-head{display:block}.tof-head-actions{margin-top:16px}
 .tof-modelbar{grid-template-columns:1fr}.tof-modelbar>div{display:block}.tof-modelbar label{display:block;margin-bottom:5px}
 .tof-grid,.tof-visual-controls{grid-template-columns:1fr}
 .tof-focus-stage{height:390px}.tof-section-nav{grid-template-columns:repeat(2,1fr)}
}


/* TOF Setup Builder 0.3.1 — autosave */
.tof-status-row{
 display:grid;
 grid-template-columns:minmax(0,1fr) auto;
 gap:10px;
 align-items:center;
 margin:13px 0;
}
.tof-status-row .tof-status{
 margin:0;
}
.tof-autosave-status{
 display:flex;
 align-items:center;
 min-height:40px;
 padding:0 13px;
 border-radius:10px;
 background:#f6f8fb;
 border:1px solid #dfe6ef;
 color:#687586;
 font-size:10px;
 font-weight:750;
 white-space:nowrap;
}
.tof-autosave-status.ok{
 background:#eef9f2;
 border-color:#cfead8;
 color:#26733d;
}
.tof-autosave-status.saving{
 background:#fff8e8;
 border-color:#f0dfb0;
 color:#8a6414;
}
.tof-autosave-status.err{
 background:#fff0f0;
 border-color:#f1cccc;
 color:#a80000;
}
.tof-autosave-status.idle{
 background:#eef6ff;
 border-color:#d6e8fa;
 color:#075cae;
}
@media(max-width:760px){
 .tof-status-row{grid-template-columns:1fr}
 .tof-autosave-status{justify-content:center}
}


/* 0.4.0 — clearer ARC controls + live preview state */
.tof-live-preview-badge{
 display:inline-flex;
 align-items:center;
 justify-content:center;
 margin-right:10px;
 padding:7px 10px;
 border-radius:999px;
 background:#eaf4ff;
 color:#0870d8;
 font-size:9px;
 font-weight:850;
 letter-spacing:.09em;
 vertical-align:middle;
 transition:.18s ease;
}
.tof-live-preview-badge.is-updated{
 background:#eaf8ef;
 color:#237642;
}
.tof-direct-choice .tof-help,
.tof-choice-help{
 color:#6c7888;
 font-size:11px;
 line-height:1.4;
}


/* =========================================================
   TOF Setup Builder 0.4.1 — floating save/action bar
   ========================================================= */
.tof-floating-actions{
 position:fixed;
 right:28px;
 bottom:24px;
 z-index:9990;
 display:flex;
 align-items:center;
 gap:14px;
 min-width:520px;
 max-width:calc(100vw - 240px);
 padding:12px 14px;
 border:1px solid #d8e2ec;
 border-radius:14px;
 background:rgba(255,255,255,.96);
 box-shadow:0 14px 38px rgba(25,52,78,.18);
 backdrop-filter:blur(10px);
}
.tof-floating-save-state{
 display:flex;
 align-items:center;
 gap:10px;
 min-width:190px;
}
.tof-save-dot{
 width:10px;
 height:10px;
 border-radius:50%;
 background:#2e9d56;
 box-shadow:0 0 0 4px rgba(46,157,86,.12);
 flex:0 0 auto;
}
.tof-floating-save-state small{
 display:block;
 font-size:8px;
 font-weight:900;
 letter-spacing:.14em;
 color:#8a96a3;
 line-height:1.2;
}
.tof-floating-save-state strong{
 display:block;
 margin-top:2px;
 font-size:11px;
 color:#344252;
 line-height:1.2;
 white-space:nowrap;
}
.tof-floating-buttons{
 display:flex;
 gap:7px;
 margin-left:auto;
}
.tof-floating-buttons .button{
 min-height:36px;
 padding:0 12px;
 white-space:nowrap;
}
.tof-floating-actions.is-saving .tof-save-dot{
 background:#d99a18;
 box-shadow:0 0 0 4px rgba(217,154,24,.13);
}
.tof-floating-actions.is-dirty .tof-save-dot{
 background:#e16d32;
 box-shadow:0 0 0 4px rgba(225,109,50,.13);
}
.tof-floating-actions.is-error .tof-save-dot{
 background:#c83b3b;
 box-shadow:0 0 0 4px rgba(200,59,59,.13);
}
.tof-floating-actions.is-ok .tof-save-dot{
 background:#2e9d56;
}
@media(max-width:1100px){
 .tof-floating-actions{
   left:190px;
   right:18px;
   bottom:16px;
   min-width:0;
   max-width:none;
 }
}
@media(max-width:782px){
 .tof-floating-actions{
   left:12px;
   right:12px;
   bottom:12px;
   flex-direction:column;
   align-items:stretch;
   gap:9px;
 }
 .tof-floating-save-state{
   min-width:0;
 }
 .tof-floating-buttons{
   margin-left:0;
   display:grid;
   grid-template-columns:repeat(3,1fr);
 }
 .tof-floating-buttons .button{
   width:100%;
   padding:0 6px;
   font-size:11px;
 }
}


/* 0.4.2 — robust floating actions */
.tof-floating-message{
 position:absolute;
 left:14px;
 right:14px;
 bottom:calc(100% + 8px);
 padding:9px 12px;
 border-radius:9px;
 border:1px solid #d9e3ec;
 background:#fff;
 box-shadow:0 8px 24px rgba(20,45,70,.12);
 color:#536273;
 font-size:11px;
 font-weight:650;
}
.tof-floating-message.working{
 background:#fff8e8;
 border-color:#eedba6;
 color:#856012;
}
.tof-floating-message.ok{
 background:#eef9f2;
 border-color:#cce8d5;
 color:#26733d;
}
.tof-floating-message.error{
 background:#fff0f0;
 border-color:#efcaca;
 color:#a40000;
}
.tof-floating-buttons .button:disabled,
.tof-head-actions .button:disabled{
 opacity:.65;
 cursor:wait;
}

/* 0.4.3 — corrected low-level ARC AcroForm mapping */

/* 0.4.4 — regenerated AcroForm text appearances for Firefox/Chrome PDF viewers */

/* 0.4.6 — direct text rendering into exact ARC PDF rectangles */

/* 0.4.7 — direct red check rendering in exact ARC widget rectangles */


/* =========================================================
   TOF Setup Builder 0.6.0 — front office + multi-model shell
   ========================================================= */
.tof-setup-front{
 max-width:1600px;
 margin:30px auto 90px;
 padding:0 18px;
}
.tof-setup-front .button{
 display:inline-flex;
 align-items:center;
 justify-content:center;
 text-decoration:none;
}
.tof-front-gate{
 max-width:760px;
 margin:70px auto;
 padding:36px;
 border:1px solid #dfe6ef;
 border-radius:20px;
 background:#fff;
 box-shadow:0 15px 45px rgba(20,45,70,.08);
}
.tof-front-gate h1{
 font-size:42px;
 margin:8px 0 12px;
}
.tof-front-gate p{
 color:#687586;
 font-size:16px;
 line-height:1.6;
}
.tof-front-gate-actions{
 display:flex;
 gap:10px;
 margin-top:22px;
}
.tof-model-switcher{
 display:flex;
 align-items:center;
 gap:12px;
 margin:14px 0;
 padding:12px 14px;
 border:1px solid #dfe6ef;
 border-radius:12px;
 background:#fff;
}
.tof-model-switcher select{
 min-width:220px;
 min-height:38px;
}
.tof-model-switcher small{
 color:#7b8794;
}
.tof-user-line{
 margin-top:10px;
 font-size:11px;
 color:#647181;
}
.tof-arc-driver-badge{
 display:inline-flex;
 margin-left:8px;
 padding:4px 7px;
 border-radius:999px;
 background:#eaf4ff;
 color:#0870d8;
 font-size:9px;
 font-weight:850;
 letter-spacing:.08em;
 text-transform:uppercase;
}
.tof-coming-soon{
 padding:34px;
 background:#fff;
 border:1px solid #dfe6ef;
 border-radius:18px;
}
.tof-coming-soon h2{
 margin-top:0;
}
@media(max-width:760px){
 .tof-model-switcher{
   align-items:flex-start;
   flex-direction:column;
 }
 .tof-front-gate-actions{
   flex-direction:column;
 }
}

/* 0.7.0 — model-specific selectors */
.tof-control-select{
 width:100%;
 min-height:38px;
 border:1px solid #cfdbe7;
 border-radius:8px;
 background:#fff;
 padding:6px 9px;
 font-weight:700;
 color:#354252;
}


/* =========================================================
   v1.1.0 MODERN UI
   ========================================================= */
.tof-ui-modern{
 --tof-blue:#1769ff;
 --tof-blue-2:#0d55dd;
 --tof-ink:#172033;
 --tof-muted:#6c788d;
 --tof-line:#dbe4ef;
 --tof-bg:#f4f7fb;
 --tof-card:#ffffff;
 --tof-soft:#eef4ff;
 color:var(--tof-ink);
}
.tof-ui-modern *{box-sizing:border-box}
.tof-ui-modern .button{font:inherit}

.tof-modern-topbar{
 display:flex;align-items:center;justify-content:space-between;gap:24px;
 padding:20px 24px;border:1px solid var(--tof-line);border-radius:18px;
 background:#fff;margin-bottom:16px;box-shadow:0 8px 24px rgba(37,67,98,.05);
}
.tof-modern-brandline{display:flex;align-items:center;gap:14px}
.tof-modern-brandline h1{margin:3px 0 0;font-size:27px;line-height:1.08;font-weight:850}
.tof-modern-brandline h1 span{font-weight:700;color:#344154}
.tof-version-pill{background:var(--tof-blue);color:#fff;border-radius:999px;padding:7px 12px;font-size:12px;font-weight:800}
.tof-modern-top-actions{display:flex;gap:10px}
.tof-modern-btn{min-height:42px;padding:0 18px!important;border-radius:10px!important;font-weight:800!important}
.tof-modern-btn-primary{background:var(--tof-blue)!important;border-color:var(--tof-blue)!important;color:#fff!important}
.tof-modern-btn-ghost{background:#fff!important;border-color:#ccd8e7!important;color:var(--tof-ink)!important}

.tof-modern-shell{display:grid;grid-template-columns:240px minmax(0,1fr);gap:16px;align-items:start}
.tof-modern-sidebar{
 position:sticky;top:44px;background:#fff;border:1px solid var(--tof-line);border-radius:18px;
 padding:14px;box-shadow:0 8px 24px rgba(37,67,98,.05)
}
.tof-sidebar-card label{display:block;font-size:10px;font-weight:900;letter-spacing:.1em;color:#778399;margin-bottom:7px}
.tof-model-card select{width:100%;min-height:44px;border:1px solid #cfd9e6;border-radius:10px;padding:0 10px;font-weight:800;background:#fff}
.tof-sidebar-user{margin:12px 0;padding:10px;border-radius:10px;background:var(--tof-soft);font-size:12px}
.tof-modern-nav{display:flex;flex-direction:column;gap:4px;margin:14px 0}
.tof-modern-nav button{
 width:100%;display:flex;align-items:center;gap:10px;text-align:left;border:0;background:transparent;
 color:#4f5d72;border-radius:9px;padding:10px 11px;font-weight:750;cursor:pointer
}
.tof-modern-nav button:hover,.tof-modern-nav button.is-active{background:var(--tof-soft);color:var(--tof-blue)}
.tof-nav-index{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:7px;background:#f3f6fa;font-size:9px;font-weight:900}
.tof-modern-nav button.is-active .tof-nav-index{background:#dce9ff;color:var(--tof-blue)}
.tof-sidebar-actions{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.tof-side-action{min-height:42px;border-radius:9px!important;font-weight:800!important}
.tof-side-action-primary{background:var(--tof-blue)!important;border-color:var(--tof-blue)!important;color:#fff!important}
.tof-sidebar-progress{margin-top:14px}

.tof-modern-main{min-width:0}
.tof-modern-subbar{
 display:grid;grid-template-columns:minmax(300px,560px) 1fr;gap:16px;align-items:end;
 padding:14px 16px;border:1px solid var(--tof-line);border-radius:16px;background:#fff;margin-bottom:16px
}
.tof-modern-subbar label{display:block;font-size:11px;font-weight:800;color:#536074;margin-bottom:5px}
.tof-modern-subbar input{width:100%;min-height:43px;border:1px solid #ccd8e7;border-radius:10px;padding:0 12px}
.tof-modern-status{font-size:11px;color:var(--tof-muted);text-align:right}

.tof-modern-hero{
 display:grid;grid-template-columns:1fr 370px;gap:18px;align-items:center;
 padding:18px;border:1px solid var(--tof-line);border-radius:18px;background:linear-gradient(135deg,#fff,#f8fbff);
 margin-bottom:16px
}
.tof-modern-hero-copy h2{font-size:30px;margin:4px 0 7px}
.tof-modern-hero-copy p{margin:0;color:var(--tof-muted);max-width:680px;line-height:1.5}
.tof-modern-preview-card{
 border:1px solid #d3dfed;border-radius:14px;background:#fff;padding:8px;cursor:pointer;
 display:flex;align-items:center;gap:10px;text-align:left
}
.tof-modern-preview-card img{width:150px;height:92px;object-fit:cover;border-radius:9px;background:#f2f5f8}
.tof-modern-preview-card span{font-weight:800;color:var(--tof-blue)}

.tof-modern-sections{display:flex;flex-direction:column;gap:14px}
.tof-modern-card{
 background:#fff;border:1px solid var(--tof-line);border-radius:18px;overflow:hidden;
 box-shadow:0 6px 18px rgba(35,62,91,.035)
}
.tof-modern-card-head{
 display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 18px;border-bottom:1px solid #edf1f6
}
.tof-modern-card-head h2{margin:2px 0 3px;font-size:22px}
.tof-modern-card-head p{margin:0;color:var(--tof-muted);font-size:12px}
.tof-card-number{color:var(--tof-blue);font-size:10px;font-weight:900;letter-spacing:.14em}
.tof-modern-view-btn{border-radius:9px!important;font-weight:800!important}
.tof-modern-controls{padding:14px 18px 0}
.tof-modern-grid{padding:14px 18px 18px;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:13px!important}
.tof-modern-field span{font-size:11px!important;font-weight:800!important;color:#354258!important}
.tof-modern-field input,.tof-modern-field textarea{
 width:100%;border:1px solid #cad7e6!important;border-radius:10px!important;background:#fff!important;
 min-height:42px;padding:8px 11px!important;box-shadow:none!important
}
.tof-modern-field textarea{min-height:100px}
.tof-visual-controls .tof-control-block{
 border:1px solid #dbe4ef!important;border-radius:12px!important;background:#fff!important;padding:12px!important
}
.tof-visual-controls .tof-choice-row button{
 border-radius:9px!important;min-height:39px!important;font-weight:800!important
}
.tof-visual-controls .tof-choice-row button.is-active,
.tof-visual-controls .tof-choice-row button.active{
 background:var(--tof-blue)!important;border-color:var(--tof-blue)!important;color:#fff!important
}
.tof-control-select{min-height:42px!important;border-radius:9px!important}

.tof-floating-actions{
 right:18px!important;left:auto!important;bottom:18px!important;max-width:340px!important;
 background:#fff!important;border:1px solid var(--tof-line)!important;border-radius:12px!important;
 box-shadow:0 12px 30px rgba(26,49,75,.12)!important
}
.tof-floating-buttons{display:none!important}
.tof-mobile-bottom-actions{display:none}

@media(max-width:1180px){
 .tof-modern-shell{grid-template-columns:210px minmax(0,1fr)}
 .tof-modern-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .tof-modern-hero{grid-template-columns:1fr 300px}
}
@media(max-width:900px){
 .tof-modern-topbar{align-items:flex-start;flex-direction:column}
 .tof-modern-top-actions{width:100%}
 .tof-modern-top-actions .button{flex:1}
 .tof-modern-shell{display:block}
 .tof-modern-sidebar{position:relative;top:auto;margin-bottom:14px}
 .tof-modern-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .tof-sidebar-actions{display:grid;grid-template-columns:repeat(3,1fr)}
 .tof-modern-subbar{grid-template-columns:1fr}
 .tof-modern-status{text-align:left}
 .tof-modern-hero{grid-template-columns:1fr}
 .tof-modern-preview-card{max-width:100%}
}
@media(max-width:640px){
 .tof-setup-front{padding:0 8px!important;margin-top:10px!important}
 .tof-modern-topbar{padding:14px;border-radius:14px}
 .tof-modern-brandline h1{font-size:21px}
 .tof-version-pill{display:none}
 .tof-modern-nav{grid-template-columns:1fr}
 .tof-sidebar-actions{grid-template-columns:1fr}
 .tof-modern-grid{grid-template-columns:1fr!important;padding:12px!important}
 .tof-modern-card-head{align-items:flex-start;flex-direction:column;padding:14px}
 .tof-modern-view-btn{width:100%}
 .tof-modern-preview-card{display:none}
 .tof-floating-actions{left:8px!important;right:8px!important;bottom:8px!important;max-width:none!important}
}


/* v1.2.1 — A11 contextual shim previews */
.tof-field-help{
 display:inline-block;margin-left:6px;padding:2px 6px;border-radius:999px;
 background:#e9f2ff;color:#1769ff;font-size:8px;font-style:normal;font-weight:900;
 text-transform:uppercase;letter-spacing:.05em;vertical-align:1px
}
[data-field-preview]{cursor:help}
[data-field-preview].is-field-active{
 border-color:#1769ff!important;
 box-shadow:0 0 0 3px rgba(23,105,255,.12)!important
}
.tof-field-preview{
 position:fixed;z-index:100000;
 width:min(430px,calc(100vw - 30px));
 background:#fff;border:1px solid #cbd9e8;border-radius:16px;
 padding:10px;box-shadow:0 18px 55px rgba(24,43,66,.22)
}
.tof-field-preview[hidden]{display:none!important}
.tof-field-preview-head{
 display:flex;align-items:center;justify-content:space-between;gap:10px;padding:3px 4px 9px
}
.tof-field-preview-head strong{font-size:14px;color:#1d2a3c}
.tof-field-preview-head button{
 width:30px;height:30px;border:0;border-radius:8px;background:#f0f4f8;
 font-size:20px;line-height:1;cursor:pointer
}
.tof-field-preview img{
 display:block;width:100%;max-height:330px;object-fit:contain;
 border:1px solid #e0e7ef;border-radius:10px;background:#f7f9fb
}
.tof-field-preview small{
 display:block;padding:8px 3px 2px;color:#657287;font-size:10px;line-height:1.35
}
@media(max-width:900px){
 .tof-field-preview{
   width:auto;max-height:58vh;overflow:auto
 }
 .tof-field-preview img{max-height:40vh}
}


/* v1.3.8 — dynamic popup controls / hidden technical inputs */
.tof-control-block input[type="checkbox"][hidden],
.tof-control-block input[type="radio"][hidden],
.tof-control-block input[type="hidden"]{
  display:none!important;
  visibility:hidden!important;
  width:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  position:absolute!important;
  pointer-events:none!important;
}
.tof-control-block > b{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.tof-control-block .tof-field-help{
  display:inline-block;
  padding:2px 6px;
  border-radius:999px;
  background:#e9f2ff;
  color:#1769ff;
  font-size:8px;
  font-style:normal;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  line-height:1.4;
}
.tof-control-block[data-field-preview]{cursor:help}


/* v1.4.1 — clearer model selector */
.tof-model-card{
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  border:2px solid #d8e5f5!important;
  padding:16px!important;
}
.tof-model-kicker{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:7px;
  padding:4px 8px;
  border-radius:999px;
  background:#eaf2ff;
  color:#1769ff;
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
}
.tof-model-card label{
  display:block;
  margin-bottom:4px!important;
  color:#1f2c40!important;
  font-size:15px!important;
  font-weight:900!important;
  letter-spacing:0!important;
  text-transform:none!important;
}
.tof-model-help{
  margin:0 0 11px;
  color:#6d788b;
  font-size:11px;
  line-height:1.35;
}
.tof-model-select-wrap{
  position:relative;
}
.tof-model-card select{
  width:100%;
  min-height:54px!important;
  appearance:none;
  -webkit-appearance:none;
  border:2px solid #1769ff!important;
  border-radius:14px!important;
  padding:0 44px 0 14px!important;
  background:#fff!important;
  color:#1c2636!important;
  font-size:17px!important;
  font-weight:850!important;
  box-shadow:0 0 0 3px rgba(23,105,255,.06);
  cursor:pointer;
}
.tof-model-card select:hover,
.tof-model-card select:focus{
  border-color:#0f58dd!important;
  box-shadow:0 0 0 4px rgba(23,105,255,.12)!important;
  outline:none!important;
}
.tof-model-select-arrow{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-53%);
  color:#1769ff;
  font-size:22px;
  font-weight:900;
  pointer-events:none;
}
@media(max-width:900px){
  .tof-model-card{
    padding:14px!important;
  }
  .tof-model-card select{
    min-height:52px!important;
    font-size:16px!important;
  }
}


/* v1.4.2 — model selector long-name fix */
.tof-modern-shell{
  grid-template-columns:280px minmax(0,1fr);
}
.tof-modern-sidebar{
  min-width:0;
}
.tof-model-card,
.tof-model-select-wrap{
  width:100%;
  min-width:0;
}
.tof-model-card select{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  padding-left:14px!important;
  padding-right:38px!important;
  font-size:15px!important;
  line-height:1.2!important;
  text-overflow:clip!important;
}
.tof-model-select-arrow{
  right:12px!important;
}
@media(max-width:1180px){
  .tof-modern-shell{
    grid-template-columns:250px minmax(0,1fr);
  }
  .tof-model-card select{
    font-size:14px!important;
  }
}
@media(max-width:900px){
  .tof-modern-shell{
    display:block;
  }
  .tof-modern-sidebar{
    width:100%;
  }
  .tof-model-card select{
    font-size:16px!important;
  }
}


/* v1.5.0 — persistent per-model drafts */
.tof-side-action-new{
  background:#fff!important;
  border:1px solid #f0b6b6!important;
  color:#9b2c2c!important;
}
.tof-side-action-new:hover{
  background:#fff7f7!important;
  border-color:#dc7777!important;
}
#tof-floating-restore{
  background:#eef5ff!important;
  border-color:#c8dbf5!important;
  color:#175fc7!important;
}


/* v1.5.1 — always-accessible sidebar actions */
@media(min-width:901px){
  .tof-modern-sidebar{
    position:sticky!important;
    top:44px!important;
    max-height:calc(100vh - 58px)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }

  .tof-model-card{
    flex:0 0 auto;
  }

  .tof-sidebar-user{
    flex:0 0 auto;
  }

  .tof-modern-nav{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    padding-right:4px;
    margin-bottom:10px!important;
    scrollbar-width:thin;
  }

  .tof-sidebar-actions-wrap{
    flex:0 0 auto;
    position:relative;
    z-index:5;
    padding-top:10px;
    margin-top:auto;
    background:linear-gradient(180deg,rgba(255,255,255,0),#fff 16px);
  }

  .tof-sidebar-actions{
    margin-top:0!important;
    gap:7px!important;
  }

  .tof-side-action{
    min-height:38px!important;
    padding:6px 10px!important;
    font-size:12px!important;
  }

  .tof-sidebar-progress{
    flex:0 0 auto;
    margin-top:9px!important;
  }
}

/* Restore/New are intentionally visually distinct. */
.tof-side-action-restore{
  background:#eef5ff!important;
  border-color:#c6daf7!important;
  color:#175fc7!important;
}
.tof-side-action-new{
  background:#fff!important;
  border-color:#efbcbc!important;
  color:#9b2c2c!important;
}

/* On shorter desktop screens, compress navigation/actions further. */
@media(min-width:901px) and (max-height:850px){
  .tof-modern-nav button{
    padding:7px 9px!important;
  }
  .tof-modern-nav{
    gap:2px!important;
  }
  .tof-side-action{
    min-height:34px!important;
    padding:4px 8px!important;
    font-size:11px!important;
  }
  .tof-sidebar-progress{
    display:none!important;
  }
}

/* Mobile/tablet: actions remain in normal flow and fully visible. */
@media(max-width:900px){
  .tof-sidebar-actions-wrap{
    width:100%;
  }
  .tof-sidebar-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .tof-sidebar-actions .tof-side-action-primary{
    grid-column:1 / -1;
  }
}


/* v1.5.2 — compact sidebar action panel */
@media(min-width:901px){
  .tof-sidebar-actions-wrap{
    padding-top:8px!important;
  }

  .tof-sidebar-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
  }

  .tof-sidebar-actions .tof-side-action{
    width:100%!important;
    min-width:0!important;
    min-height:36px!important;
    padding:5px 7px!important;
    font-size:10.5px!important;
    line-height:1.15!important;
    white-space:normal!important;
    text-align:center!important;
  }

  #tof-floating-generate{
    grid-column:1 / -1!important;
    min-height:42px!important;
    font-size:12px!important;
  }

  #tof-floating-save{
    grid-column:1!important;
  }

  #tof-floating-restore{
    grid-column:2!important;
  }

  #tof-floating-new{
    grid-column:1!important;
  }

  #tof-floating-preview{
    grid-column:2!important;
  }

  .tof-sidebar-progress{
    margin-top:6px!important;
  }
}

@media(min-width:901px) and (max-height:900px){
  .tof-modern-sidebar{
    top:36px!important;
    max-height:calc(100vh - 44px)!important;
  }

  .tof-model-card{
    padding:11px!important;
  }

  .tof-model-kicker{
    margin-bottom:4px!important;
    padding:3px 7px!important;
  }

  .tof-model-card label{
    font-size:13px!important;
  }

  .tof-model-help{
    margin-bottom:7px!important;
    font-size:10px!important;
  }

  .tof-model-card select{
    min-height:45px!important;
    font-size:13px!important;
  }

  .tof-modern-nav{
    margin-top:9px!important;
    margin-bottom:6px!important;
  }

  .tof-modern-nav button{
    padding:6px 8px!important;
    font-size:11px!important;
  }

  .tof-nav-index{
    width:22px!important;
    height:22px!important;
  }

  .tof-sidebar-actions .tof-side-action{
    min-height:32px!important;
    font-size:10px!important;
  }

  #tof-floating-generate{
    min-height:36px!important;
    font-size:11px!important;
  }
}

@media(min-width:901px) and (max-height:760px){
  .tof-sidebar-progress{
    display:none!important;
  }

  .tof-modern-nav button{
    padding:5px 7px!important;
  }

  .tof-sidebar-actions .tof-side-action{
    min-height:30px!important;
  }
}
