:root{
 --bg:#ffffff;
 --panel:#ffffff;
 --line:#111827;
 --soft:#1f2937;
 --muted:#374151;
 --shadow:none;

 --uiFont: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
 --graphFont: "KaTeX_Main", "Latin Modern Roman", "CMU Serif", "Times New Roman", serif;
}

*{ box-sizing:border-box; }

html, body{
 height:100vh;
 margin:0;
 background:var(--bg);
 color:#0b0f17;
 font-family: var(--uiFont);
 overflow:hidden; 
}

.btn{
 appearance:none;
 border:1px solid var(--soft);
 background:#fff;
 padding:10px 12px;
 border-radius:6px;
 cursor:pointer;
 font-size:13px;
 font-weight:500;
 line-height:1;
}

.btn:hover{ border-color:#9ca3af; }
.btnPrimary{ background:#111827; color:#fff; border-color:#111827; }
.btnSmall{ padding:8px 10px; border-radius:6px; }

.app{
 height:100vh;
 display:flex;
 flex-direction:column;
 opacity:0;
 pointer-events:none;
}

.topbar{
 display:flex;
 align-items:flex-start;
 justify-content:flex-start;
 padding:10px 14px;
 border-bottom:1px solid var(--soft);
 background:#fff;
}

.topbarRight{
 display:flex;
 gap:10px;
 align-items:center;
}

.layout{
 flex:1;
 display:grid;
 grid-template-columns: 380px 1fr;
 min-height:0;
}

.sidebar{
 height:calc(100vh - 68px);
 border-right:1px solid var(--soft);
 background:#fff;
 padding:10px;
 min-height:0;
 display:flex;
 flex-direction:column;
 gap:10px;
 overflow-y:auto;
 padding-bottom:36px;
}

.tabs{
 display:flex;
 gap:8px;
}

.tab{
 flex:1;
 padding:10px 10px;
 border:1px solid var(--soft);
 border-radius:6px;
 background:#fff;
 cursor:pointer;
 font-size:12px;
 font-weight:500;
}

.tab.active{
 border-color:#111827;
 box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.tabPanel{
 display:none;
 min-height:0;
 overflow:auto;
}

.tabPanel.active{
 display:block;
}

#tab-labels{
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#tab-labels::-webkit-scrollbar{
  display:none;
}

.sectionTitle{
 font-size:11px;
 color:var(--muted);
 letter-spacing:0.12em;
 text-transform:uppercase;
 margin:10px 0 8px 2px;
 font-weight:600;
}

.field{
 display:flex;
 flex-direction:column;
 gap:6px;
 margin-bottom:10px;
}

label{
 font-size:12px;
 color:var(--muted);
 font-weight:500;
}

input[type="text"], select, input[type="color"]{
 width:100%;
 padding:10px 10px;
 border:1px solid var(--soft);
 border-radius:6px;
 outline:none;
 font-size:13px;
 background:#fff;
 font-weight:500;
}

input[type="color"]{
 padding:0;
 height:42px;
 cursor:pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper{
 padding:4px;
 border-radius:6px;
}

input[type="color"]::-webkit-color-swatch{
 border:none;
 border-radius:4px;
}

input[type="color"]::-moz-color-swatch{
 border:none;
 border-radius:4px;
}

input[type="range"]{
 width:100%;
 display:block;
 min-width:0;
 -webkit-appearance:none;
 appearance:none;
 height:20px;
 border:1.5px solid #111827;
 border-radius:0;
 background:linear-gradient(to right, #d1d5db 0%, #d1d5db var(--range-fill, 50%), #ffffff var(--range-fill, 50%), #ffffff 100%);
 padding:0;
 box-sizing:border-box;
 margin:0;
}
input[type="range"]::-webkit-slider-thumb{
 -webkit-appearance:none;
 appearance:none;
 width:18px;
 height:20px;
 background:#0b0f17;
 border:1.5px solid #0b0f17;
 border-radius:0;
 cursor:pointer;
 margin-top:0;
}
input[type="range"]::-moz-range-thumb{
 width:18px;
 height:20px;
 background:#0b0f17;
 border:1.5px solid #0b0f17;
 border-radius:0;
 cursor:pointer;
}
input[type="range"]::-moz-range-track{
 height:20px;
 border:1.5px solid #111827;
 border-radius:0;
 background:linear-gradient(to right, #d1d5db 0%, #d1d5db var(--range-fill, 50%), #ffffff var(--range-fill, 50%), #ffffff 100%);
 box-sizing:border-box;
}

.row{
 display:grid;
 grid-template-columns: 1fr 1fr;
 gap:10px;
 align-items:end;
}
.row > .field{
 min-width:0;
}

.hint{
 font-size:12px;
 color:var(--muted);
 line-height:1.35;
 margin-top:6px;
}


.toggleRow{
 margin: 6px 0 22px;
}


.toggleRow .btn{
 margin-bottom: 10px;
}

.checks{
 display:flex;
 flex-direction:column;
 gap:10px;
}

.labelGrid{
 display:grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap:8px 14px;
}

.check{
 display:flex;
 align-items:center;
 gap:10px;
 font-size:13px;
 font-weight:500;
}

 .check input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border:1.5px solid #0b0f17;
  border-radius:2px;
  background:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
  position:relative;
}
.check input[type="checkbox"]:checked{
  background:#0b0f17;
  border-color:#0b0f17;
}
.check input[type="checkbox"]:checked::after{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:8px;
  height:10px;
  box-sizing:border-box;
  border:2px solid #fff;
  border-top:0;
  border-left:0;
  transform: translate(-50%, -58%) rotate(45deg);
}

.stage{
 background:#fff;
 min-height:0;
 display:flex;
 align-items:stretch;
 justify-content:stretch;
 overflow:hidden;
}

.stageInner{
 width:100%;
 height:100%;
 padding:12px 12px;
 display:flex;
 align-items:center;
 justify-content:center;
}

svg{
 max-width: 100%;
 max-height: 100%;
}


.brandHost{
 position:relative;
 height:48px;
 display:flex;
 align-items:center;
}

.brand{
 user-select:none;
 cursor:pointer;
 color:#0b0f17;
 font-family: var(--graphFont);
 position:fixed; 
 left:50%;
 top:44%;
 transform:translate(-50%,-50%);
 transition: transform 650ms ease, left 650ms ease, top 650ms ease, opacity 300ms ease;
 text-align:center;
}

.brandTitle{
 font-size:54px;
 font-weight:400;
 letter-spacing:0.01em;
}

.brandSubtitle{
 margin-top:10px;
 font-size:18px;
 font-weight:400;
 opacity:0.85;
}

.brandLoadingGap{ height: 34px; }
.brandLoading{
 font-family: var(--uiFont);
 font-size:12px;
 color:var(--muted);
 font-weight:500;
 letter-spacing:0.02em;
}


body.ready .brand{
 position:static;
 left:auto;
 top:auto;
 transform:none;
 text-align:left;
}

body.ready .brandTitle{
 font-size:26px;
 margin:0;
}

body.ready .brandSubtitle{
 margin-top:0;
 font-size:15px;
 opacity:0.85;
}

body.ready .brandLoadingGap,
body.ready .brandLoading{
 display:none;
}


.splash{
 position:fixed;
 inset:0;
 background:#fff;
 display:flex;
 align-items:center;
 justify-content:center;
 z-index:50;
}

.splashInner{
 width:100%;
 height:100vh;
 display:flex;
 align-items:center;
 justify-content:center;
}

body.ready .splash{
 opacity:0;
 pointer-events:none;
 transition: opacity 350ms ease;
}


body.ready .app{
 opacity:1;
 pointer-events:auto;
}


.homeOverlay{
 position:fixed;
 inset:0;
 background:rgba(255,255,255,0.92);
 backdrop-filter: blur(6px);
 z-index:40;
 display:flex;
 align-items:center;
 justify-content:center;
}

.homeOverlay.hidden{
 display:none;
}

.homePanel{
 width:min(860px, 92vw);
 border:1px solid var(--soft);
 border-radius:10px;
 background:#fff;
 box-shadow: 0 18px 60px rgba(0,0,0,0.08);
 padding:18px;
 font-family: var(--uiFont);
}

.homeTitle{
 font-size:14px;
 font-weight:600;
 margin-bottom:12px;
 color:#111827;
}

.homeGrid{
 display:grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap:12px;
}

.homeCard{
 text-align:left;
 padding:14px;
 border-radius:4px;
 border:1px solid var(--soft);
 background:#fff;
 cursor:pointer;
}

.homeCard:hover{ border-color:#cbd5e1; }

.homeCard:disabled{
 opacity:0.55;
 cursor:not-allowed;
}

.homeCardTitle{
 font-size:14px;
 font-weight:600;
 margin-bottom:6px;
}

.homeCardSub{
 font-size:12px;
 color:var(--muted);
 line-height:1.35;
}

.homeCard.active{
 border-color:#111827;
 box-shadow: 0 0 0 3px rgba(17,24,39,0.08);
}

.checksCompact{
 gap:6px;
 margin: 6px 0 10px;
}

.accordion{
 border:1px solid var(--soft);
 border-radius:6px;
 background:#fff;
 overflow:hidden;
 box-shadow:none;
 margin-bottom:12px;
}

.accordionHeader{
 width:100%;
 padding:12px 12px;
 background:#f9fafb;
 border:none;
 display:flex;
 align-items:center;
 justify-content:space-between;
 cursor:pointer;
 font-size:13px;
 font-weight:600;
 color:#111827;
}

.accordionBody{
 padding:12px;
 max-height:none;
 opacity:1;
 transition: max-height 200ms ease, opacity 200ms ease;
 border-top:1px solid var(--soft);
}

.accordionBody.isClosed{
 display:none;
 max-height:0;
 opacity:0;
}

.accordionChevron{
 font-size:12px;
}

.taxToggle{
 transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.taxToggle[data-state="on"]{
 background:#111827;
 color:#fff;
 border-color:#111827;
}

@media (max-width: 920px){
 .layout{ grid-template-columns: 320px 1fr; }
 .homeGrid{ grid-template-columns: 1fr; }
}

.accordion:last-child{margin-bottom:36px;}

.versionBadge{
 position:fixed;
 right:14px;
 bottom:14px;
 padding:8px 10px;
 border:1px solid #e5e7eb;
 border-radius:6px;
 background:rgba(255,255,255,0.9);
 color:#111827;
 font-size:12px;
 font-weight:600;
 letter-spacing:0.02em;
 font-family: var(--uiFont);
 box-shadow: 0 12px 28px rgba(0,0,0,0.06);
 z-index:60;
 text-decoration: underline;
 text-underline-offset: 3px;
}
