/* CalcuTools World-Class Experience v1.0 | 2026-10-07
   Global shell, accessibility, responsive navigation and visual foundations.
   Deliberately scoped under ct-wc-* to minimize interference with calculator logic. */
:root{
  --ct-wc-bg:#f7f9fc;
  --ct-wc-surface:#ffffff;
  --ct-wc-text:#0f172a;
  --ct-wc-muted:#64748b;
  --ct-wc-border:#e2e8f0;
  --ct-wc-primary:#2563eb;
  --ct-wc-primary-strong:#1d4ed8;
  --ct-wc-primary-soft:#eff6ff;
  --ct-wc-success:#15803d;
  --ct-wc-shadow:0 18px 50px rgba(15,23,42,.10);
  --ct-wc-shadow-sm:0 6px 24px rgba(15,23,42,.08);
  --ct-wc-radius:16px;
  --ct-wc-max:1240px;
}
html{scroll-behavior:smooth;scroll-padding-top:88px}
body.ct-wc-enabled{background:var(--ct-wc-bg);color:var(--ct-wc-text)}
body.ct-wc-enabled img{max-width:100%;height:auto}

/* Skip link */
.ct-wc-skip{position:fixed;left:14px;top:10px;z-index:10001;transform:translateY(-160%);padding:10px 14px;border-radius:10px;background:#0f172a;color:#fff;font-weight:800;text-decoration:none;box-shadow:var(--ct-wc-shadow-sm)}
.ct-wc-skip:focus{transform:none}

/* Universal navigation */
.ct-wc-nav{position:sticky;top:0;z-index:1200;width:100%;background:rgba(255,255,255,.94);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid rgba(226,232,240,.92);box-shadow:0 1px 10px rgba(15,23,42,.04)}
.ct-wc-nav-inner{width:min(var(--ct-wc-max),calc(100% - 32px));min-height:66px;margin:0 auto;display:flex;align-items:center;gap:10px}
.ct-wc-brand{display:inline-flex;align-items:center;gap:9px;flex:0 0 auto;color:var(--ct-wc-text);text-decoration:none;font-weight:900;letter-spacing:-.04em;font-size:19px;white-space:nowrap}
.ct-wc-mark{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:transparent;color:#fff;box-shadow:none;font-size:16px;overflow:hidden}
.ct-wc-brand span span{color:var(--ct-wc-primary)}
.ct-wc-links{display:flex;align-items:center;gap:2px;margin-left:10px}
.ct-wc-links a,.ct-wc-mobile-panel a{color:var(--ct-wc-muted);text-decoration:none;font-size:13px;font-weight:750;padding:9px 10px;border-radius:10px;transition:.15s ease}
.ct-wc-links a:hover,.ct-wc-links a:focus-visible,.ct-wc-mobile-panel a:hover,.ct-wc-mobile-panel a:focus-visible{color:var(--ct-wc-text);background:var(--ct-wc-bg)}
.ct-wc-spacer{flex:1 1 auto;min-width:8px}
.ct-wc-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.ct-wc-action{min-height:38px;border:1px solid var(--ct-wc-border);border-radius:10px;background:var(--ct-wc-surface);color:var(--ct-wc-text);padding:8px 11px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font:750 13px/1 inherit;text-decoration:none;cursor:pointer;transition:.15s ease}
.ct-wc-action:hover{border-color:#93c5fd;background:var(--ct-wc-primary-soft);color:var(--ct-wc-primary-strong)}
.ct-wc-search{min-width:170px;justify-content:flex-start;color:#475569}
.ct-wc-search-kbd{margin-left:auto;border:1px solid #cbd5e1;background:#f8fafc;border-radius:6px;padding:2px 6px;font-size:10px;color:#64748b}
.ct-wc-mobile-toggle{display:none;width:40px;min-width:40px;padding:0}
.ct-wc-mobile-panel{display:none;border-top:1px solid var(--ct-wc-border);background:rgba(255,255,255,.98)}
.ct-wc-mobile-panel.is-open{display:block}
.ct-wc-mobile-panel-inner{width:min(var(--ct-wc-max),calc(100% - 32px));margin:0 auto;padding:10px 0 14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}

/* Legacy pages get a consistent content envelope without rewriting calculator markup. */
body.ct-wc-legacy .wrap,body.ct-wc-legacy main,.ct-wc-page-shell{width:min(var(--ct-wc-max),calc(100% - 32px));margin-left:auto;margin-right:auto}
body.ct-wc-legacy .wrap{margin-top:0}
body.ct-wc-legacy main{padding-bottom:32px}
body.ct-wc-legacy .footer{margin-top:24px}

/* Trust strip */
.ct-wc-trust{width:min(var(--ct-wc-max),calc(100% - 32px));margin:16px auto 0;padding:12px 14px;border:1px solid var(--ct-wc-border);border-radius:14px;background:rgba(255,255,255,.82);display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;color:var(--ct-wc-muted);font-size:12px}
.ct-wc-trust strong{color:var(--ct-wc-text)}
.ct-wc-trust-item{display:inline-flex;align-items:center;gap:6px}
.ct-wc-dot{width:7px;height:7px;border-radius:999px;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.10)}

/* Search dialog */
.ct-wc-search-dialog{position:fixed;inset:0;z-index:1300;display:none}
.ct-wc-search-dialog.is-open{display:block}
.ct-wc-search-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.56);backdrop-filter:blur(4px)}
.ct-wc-search-card{position:relative;width:min(760px,calc(100% - 24px));max-height:min(78vh,760px);margin:7vh auto 0;background:#fff;border:1px solid #dbe3ef;border-radius:20px;box-shadow:0 30px 90px rgba(15,23,42,.28);overflow:hidden}
.ct-wc-search-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:20px 20px 14px;border-bottom:1px solid #eef2f7}
.ct-wc-search-head h2{margin:0;font-size:20px;letter-spacing:-.025em;color:#0f172a}
.ct-wc-search-head p{margin:4px 0 0;font-size:12px;color:#64748b}
.ct-wc-search-close{width:36px;height:36px;border-radius:10px;border:1px solid #e2e8f0;background:#f8fafc;color:#475569;font-size:22px;line-height:1;cursor:pointer}
.ct-wc-search-input-wrap{padding:16px 20px 8px}
.ct-wc-search-input{width:100%;height:52px;padding:0 16px;border:2px solid #cbd5e1;border-radius:14px;outline:0;font:600 15px/1.2 inherit;color:#0f172a;background:#fff}
.ct-wc-search-input:focus{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.12)}
.ct-wc-search-results{padding:8px 12px 14px;max-height:55vh;overflow:auto}
.ct-wc-search-result{display:flex;align-items:center;gap:12px;padding:12px;border-radius:12px;text-decoration:none;color:#0f172a}
.ct-wc-search-result:hover,.ct-wc-search-result:focus-visible{background:#f8fbff;outline:none}
.ct-wc-search-result-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:#eff6ff;font-size:18px;flex:0 0 auto}
.ct-wc-search-result-copy{min-width:0;flex:1}
.ct-wc-search-result-title{font-size:14px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ct-wc-search-result-meta{margin-top:2px;font-size:11px;color:#64748b}
.ct-wc-search-result-arrow{font-size:20px;color:#94a3b8}
.ct-wc-search-empty{padding:34px 20px;text-align:center;color:#64748b;font-size:13px}
.ct-wc-search-empty strong{display:block;color:#0f172a;font-size:15px;margin-bottom:5px}
.ct-wc-search-foot{padding:9px 14px;border-top:1px solid #eef2f7;display:flex;flex-wrap:wrap;gap:12px;font-size:11px;color:#94a3b8}

/* Global focus/interaction baseline */
body.ct-wc-enabled :where(a,button,input,select,textarea):focus-visible{outline:3px solid rgba(37,99,235,.28);outline-offset:2px}
body.ct-wc-enabled :where(button,input,select,textarea){font:inherit}
body.ct-wc-enabled :where(input,select,textarea){min-height:44px}

/* Shared accessibility helpers */
.ct-wc-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* Legacy-page dark-mode safety net. Keep the mature v24 pages on their existing theme rules. */
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page){
  --ct-wc-bg:#0b1220;
  --ct-wc-surface:#0f172a;
  --ct-wc-text:#e5e7eb;
  --ct-wc-muted:#94a3b8;
  --ct-wc-border:#334155;
  background:#0b1220!important;
  color:#e5e7eb!important;
  color-scheme:dark;
}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(.wrap,main,.container,.content,.page,.card,.panel,.tool-card,.calculator-card,.calculator,.calculator-box,.form-card,.result-card,.section,.article,.seo-article,article,section){
  border-color:#334155!important;
}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(.card,.panel,.tool-card,.calculator-card,.calculator,.calculator-box,.form-card,.result-card,.content-card,.article-card,.info-box,.guide-box,.section-box){
  background:#0f172a!important;
  color:#e5e7eb!important;
}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(h1,h2,h3,h4,h5,h6,label,legend,strong,b,dt){color:#f8fafc;}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(p,li,dd,small,.muted,.hint,.help-text,.description,.subtitle){color:#cbd5e1;}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(input,select,textarea){
  background:#0b1220!important;color:#f8fafc!important;border-color:#475569!important;
}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(input,select,textarea)::placeholder{color:#94a3b8!important;opacity:1;}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(table,th,td){border-color:#334155!important;}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(th){background:#172033!important;color:#f8fafc!important;}
html[data-theme="dark"] body.ct-wc-enabled:not(.ct-v24-page) :where(td){background:#0f172a!important;color:#e5e7eb!important;}

/* Dark mode */
html[data-theme="dark"] .ct-wc-nav,html.dark .ct-wc-nav{background:rgba(15,23,42,.94);border-color:#334155;box-shadow:0 1px 12px rgba(0,0,0,.22)}
html[data-theme="dark"] .ct-wc-brand,html.dark .ct-wc-brand{color:#f8fafc}
html[data-theme="dark"] .ct-wc-links a,html.dark .ct-wc-links a{color:#cbd5e1}
html[data-theme="dark"] .ct-wc-links a:hover,html.dark .ct-wc-links a:hover{color:#fff;background:#1e293b}
html[data-theme="dark"] .ct-wc-action,html.dark .ct-wc-action{background:#0f172a;border-color:#475569;color:#e2e8f0}
html[data-theme="dark"] .ct-wc-action:hover,html.dark .ct-wc-action:hover{background:#172554;border-color:#60a5fa;color:#bfdbfe}
html[data-theme="dark"] .ct-wc-mobile-panel,html.dark .ct-wc-mobile-panel{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .ct-wc-mobile-panel a,html.dark .ct-wc-mobile-panel a{color:#cbd5e1}
html[data-theme="dark"] .ct-wc-mobile-panel a:hover,html.dark .ct-wc-mobile-panel a:hover{background:#1e293b;color:#fff}
html[data-theme="dark"] .ct-wc-trust,html.dark .ct-wc-trust{background:#0f172a;border-color:#334155;color:#94a3b8}
html[data-theme="dark"] .ct-wc-trust strong,html.dark .ct-wc-trust strong{color:#f8fafc}
html[data-theme="dark"] .ct-wc-search-card,html.dark .ct-wc-search-card{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .ct-wc-search-head,html.dark .ct-wc-search-head{border-color:#334155}
html[data-theme="dark"] .ct-wc-search-head h2,html.dark .ct-wc-search-head h2{color:#f8fafc}
html[data-theme="dark"] .ct-wc-search-input,html.dark .ct-wc-search-input{background:#0b1220;border-color:#475569;color:#f8fafc}
html[data-theme="dark"] .ct-wc-search-result,html.dark .ct-wc-search-result{color:#f8fafc}
html[data-theme="dark"] .ct-wc-search-result:hover,html.dark .ct-wc-search-result:focus-visible,html.dark .ct-wc-search-result:hover{background:#111827}
html[data-theme="dark"] .ct-wc-search-result-meta,html.dark .ct-wc-search-result-meta{color:#94a3b8}
html[data-theme="dark"] .ct-wc-search-foot,html.dark .ct-wc-search-foot{border-color:#334155;color:#64748b}
html[data-theme="dark"] .ct-wc-search-close,html.dark .ct-wc-search-close{background:#111827;border-color:#475569;color:#e2e8f0}

@media(max-width:980px){
  .ct-wc-links{display:none}
  .ct-wc-mobile-toggle{display:inline-flex}
  .ct-wc-search{min-width:40px;width:40px;padding:0}
  .ct-wc-search-label,.ct-wc-search-kbd{display:none}
}
@media(max-width:640px){
  .ct-wc-nav-inner,.ct-wc-mobile-panel-inner,.ct-wc-trust{width:min(var(--ct-wc-max),calc(100% - 24px))}
  .ct-wc-nav-inner{min-height:60px}
  .ct-wc-brand{font-size:17px}
  .ct-wc-mark{width:32px;height:32px;border-radius:10px}
  .ct-wc-action{min-height:40px;width:40px;padding:0}
  .ct-wc-account{display:none}
  .ct-wc-mobile-panel-inner{grid-template-columns:1fr}
  .ct-wc-search-card{margin-top:4vh}
  .ct-wc-trust{gap:8px 12px;padding:10px 12px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.ct-wc-action,.ct-wc-links a{transition:none}}

/* Bridge styling for pages that already use the v7 navigation shell. */
.ct-wc-existing-account{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 10px;border-radius:9px;border:1px solid #dbe3ef;background:#fff;color:#334155;text-decoration:none;font-size:12px;font-weight:800;white-space:nowrap}
.ct-wc-existing-account:hover{background:#eff6ff;border-color:#93c5fd;color:#1d4ed8}
html[data-theme="dark"] .ct-wc-existing-account,html.dark .ct-wc-existing-account{background:#1e293b;border-color:#475569;color:#e2e8f0}
html[data-theme="dark"] .ct-wc-existing-account:hover,html.dark .ct-wc-existing-account:hover{background:#172554;border-color:#60a5fa;color:#bfdbfe}
@media(max-width:640px){.ct-wc-existing-account{font-size:11px;padding:6px 8px}.ct-wc-existing-account{display:none}}

/* Avoid duplicate legacy chrome after the new universal shell is installed. */
body.ct-wc-legacy .ct-v513-utility{display:none!important}
body.ct-wc-legacy .top .brand{display:none!important}
body.ct-wc-legacy .top{justify-content:flex-end!important}
