
    :root{--color-accent:#2563eb;--color-accent-soft:#dbeafe;--color-accent-strong:#1d4ed8;--color-bg:#f5f7fb;--color-bg-elevated:rgba(255,255,255,.92);--color-surface:#fff;--color-surface-soft:#f8fafc;--color-border:rgba(15,23,42,.08);--color-text:#0f172a;--color-text-muted:#475569;--color-text-soft:#64748b;--color-success:#16a34a;--color-warning:#d97706;--color-danger:#dc2626;--color-overlay:rgba(255,255,255,.5);--shadow-sm:0 8px 24px rgba(15,23,42,.06);--shadow-md:0 14px 40px rgba(15,23,42,.10);--shadow-lg:0 22px 60px rgba(15,23,42,.14);--radius-lg:24px;--radius-xl:32px;--container-width:1420px;--sidebar-width:310px;--transition-fast:180ms ease;--transition-normal:260ms ease}
    body[data-theme='dark']{--color-bg:#0b1220;--color-bg-elevated:rgba(15,23,42,.72);--color-surface:#111827;--color-surface-soft:#172033;--color-border:rgba(255,255,255,.08);--color-text:#f8fafc;--color-text-muted:#cbd5e1;--color-text-soft:#94a3b8;--color-accent-soft:rgba(37,99,235,.22);--color-overlay:rgba(255,255,255,.06);--shadow-sm:0 8px 24px rgba(0,0,0,.22);--shadow-md:0 14px 40px rgba(0,0,0,.28);--shadow-lg:0 22px 60px rgba(0,0,0,.32)}
    *,*::before,*::after{box-sizing:border-box}html{direction:rtl;scroll-behavior:smooth}body,h1,h2,h3,h4,h5,h6,p,ul,ol,figure,button,input,textarea,select{margin:0;padding:0}body{min-height:100vh;font-family:Tahoma,Arial,sans-serif;background:radial-gradient(circle at top right,rgba(37,99,235,.16),transparent 28%),radial-gradient(circle at left bottom,rgba(124,58,237,.08),transparent 24%),var(--color-bg);color:var(--color-text);transition:background var(--transition-normal),color var(--transition-normal)}ul{list-style:none}button,input,textarea,select{font:inherit}button{border:none;background:none;cursor:pointer}a{text-decoration:none;color:inherit}#app{min-height:100vh}.mobile-only{display:none!important}.app-shell{min-height:100vh;display:flex;position:relative}.app-shell__main{flex:1;min-width:0;display:flex;flex-direction:column}.app-shell__content{flex:1;width:100%;max-width:var(--container-width);margin:0 auto;padding:24px 24px 110px}.header{position:sticky;top:0;z-index:45;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:var(--color-bg-elevated);border-bottom:1px solid var(--color-border);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}.header__left,.header__right,.brand{display:flex;align-items:center;gap:12px}.brand__logo{width:90px;height:90px;border-radius:16px;display:grid;place-items:center;color:#fff;background: transparent;box-shadow:var(--shadow-sm);font-weight:700;font-size:1.2rem;overflow: hidden;}.brand__text{display:flex;flex-direction:column;gap:2px}.brand__text strong{font-size:1rem}.brand__text small{color:var(--color-text-soft);font-size:.82rem;direction:ltr;text-align:left}.header__search{min-width:320px;max-width:420px;position:relative}.header__search input{width:100%;padding:13px 44px 13px 14px;border-radius:16px;border:1px solid var(--color-border);background:var(--color-surface);color:inherit;outline:none}.header__search span{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:var(--color-text-soft)}.icon-button{width:44px;height:44px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;color:var(--color-text);background:var(--color-surface);border:1px solid var(--color-border)}.theme-toggle{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:16px;background:var(--color-surface);border:1px solid var(--color-border);color:var(--color-text);box-shadow:var(--shadow-sm)}.theme-toggle__icon{width:28px;height:28px;border-radius:10px;display:grid;place-items:center;background:var(--color-accent-soft);color:var(--color-accent-strong)}.theme-toggle__text{font-size:.92rem;color:var(--color-text-muted)}.sidebar{width:var(--sidebar-width);min-width:var(--sidebar-width);padding:24px 18px;border-left:1px solid var(--color-border);background:linear-gradient(180deg,var(--color-bg-elevated),var(--color-overlay));backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);display:flex;flex-direction:column;gap:24px}.sidebar__title h1{font-size:1.4rem;margin-bottom:6px}.sidebar__title p{color:var(--color-text-soft);font-size:.92rem;line-height:1.8}.sidebar__nav{display:flex;flex-direction:column;gap:10px}.sidebar__link{display:flex;align-items:center;gap:12px;padding:14px;border-radius:18px;color:var(--color-text-muted);transition:all var(--transition-fast)}.sidebar__link:hover{background:var(--color-surface);color:var(--color-text)}.sidebar__link--active{background:linear-gradient(135deg,var(--color-accent-soft),var(--color-overlay));color:var(--color-accent-strong);border:1px solid rgba(37,99,235,.14);box-shadow:var(--shadow-sm)}.sidebar__link-icon{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:var(--color-surface);border:1px solid var(--color-border)}.sidebar__footer{margin-top:auto}.status-card,.alert-banner,.dashboard-card,.settings-card,.empty-state,.search-results,.favorites-box,.stats-panel{border-radius:var(--radius-lg);border:1px solid var(--color-border);background:var(--color-bg-elevated);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);box-shadow:var(--shadow-sm)}.status-card{display:flex;align-items:flex-start;gap:12px;padding:16px}.status-card__dot{width:12px;height:12px;border-radius:999px;margin-top:6px;background:var(--color-success);box-shadow:0 0 0 6px rgba(5,150,105,.12)}.status-card p{color:var(--color-text-soft);margin-top:4px;line-height:1.7;font-size:.86rem}.sidebar-backdrop,.mobile-nav{display:none}.page{display:flex;flex-direction:column;gap:24px}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.page-title{font-size:clamp(1.4rem,2vw,2rem);margin-bottom:8px}.page-description{max-width:760px;color:var(--color-text-muted);line-height:1.9}.alert-banner{padding:16px 18px;display:flex;gap:12px;align-items:flex-start}.alert-banner__icon{width:34px;height:34px;display:grid;place-items:center;border-radius:12px;background:rgba(245,158,11,.12);color:var(--color-warning);flex-shrink:0}.alert-banner__body strong{display:block;margin-bottom:6px}.alert-banner__body p{color:var(--color-text-muted);line-height:1.8}.hero-panel{display:grid;grid-template-columns:1.25fr .9fr;gap:24px;align-items:stretch;padding:28px;border-radius:var(--radius-xl);border:1px solid var(--color-border);background:linear-gradient(145deg,var(--color-bg-elevated),rgba(255,255,255,.58));box-shadow:var(--shadow-md);overflow:hidden;position:relative}.hero-panel__content{position:relative;z-index:1}.hero-badge,.quick-badge,.dashboard-card__badge{display:inline-flex;padding:8px 14px;border-radius:999px;background:var(--color-accent-soft);color:var(--color-accent-strong);font-weight:700;font-size:.88rem}.hero-title{font-size:clamp(1.8rem,4vw,3rem);line-height:1.4;margin:16px 0}.hero-description{color:var(--color-text-muted);line-height:2;max-width:680px;margin-bottom:24px}.hero-stats,.chip-grid,.stats-grid{display:flex;flex-wrap:wrap;gap:14px}.hero-stat,.mini-stat{min-width:130px;padding:16px 18px;border-radius:20px;background:var(--color-surface);border:1px solid var(--color-border);box-shadow:var(--shadow-sm)}.hero-stat strong,.mini-stat strong{display:block;font-size:1.2rem;margin-bottom:6px}.hero-stat span,.mini-stat span{color:var(--color-text-soft);font-size:.9rem}.hero-panel__visual{position:relative;min-height:320px;display:grid;place-items:center}.glass-card{position:absolute;border-radius:28px;background:rgba(255,255,255,.5);border:1px solid rgba(255,255,255,.4);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:var(--shadow-lg)}.glass-card--large{width:320px;height:220px;top:24px;right:32px;transform:rotate(6deg)}.glass-card--small{width:220px;min-height:140px;bottom:10px;left:24px;transform:rotate(-8deg);padding:20px}.glass-card__top{height:52px;border-bottom:1px solid rgba(255,255,255,.32);background:linear-gradient(90deg,var(--color-accent-soft),transparent);border-top-right-radius:28px;border-top-left-radius:28px}.glass-card__body{padding:18px}.glass-line{height:12px;border-radius:999px;margin-bottom:12px;background:linear-gradient(90deg,var(--color-accent),rgba(255,255,255,.36));opacity:.7}.glass-line--lg{width:82%}.glass-line--sm{width:44%}.metric-chip{display:inline-flex;padding:10px 14px;margin:6px;border-radius:14px;background:var(--color-accent-soft);color:var(--color-accent-strong);font-weight:700}.grid-cards,.quick-tools-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.dashboard-card,.settings-card,.favorites-box,.stats-panel,.search-results{padding:22px}.quick-tool{display:flex;flex-direction:column;gap:10px;padding:18px;border-radius:20px;border:1px solid var(--color-border);background:var(--color-bg-elevated);box-shadow:var(--shadow-sm);text-align:right;transition:all var(--transition-fast)}.dashboard-card__title{margin-bottom:10px;font-size:1.08rem}.dashboard-card__description,.meta-line,.search-results__empty,.tool-meta p,.settings-card__description{color:var(--color-text-muted);line-height:1.85}.workspace-grid{display:grid;grid-template-columns:320px 1fr;gap:16px;align-items:start}.workspace-sidebar,.workspace-main{min-width:0}.tool-group{border:1px solid var(--color-border);border-radius:14px;padding:10px 12px;margin-bottom:12px;background:var(--color-surface-soft)}.tool-group__title{font-size:.86rem;font-weight:700;color:var(--color-text-muted);cursor:pointer;list-style:none;padding:4px;display:flex;align-items:center;justify-content:space-between}.tool-group__title::-webkit-details-marker{display:none}.tool-group__title::after{content:'▾';margin-inline-start:8px;transition:transform .2s ease}.tool-group[open] .tool-group__title::after{transform:rotate(180deg)}.tool-group__count{color:var(--color-text-soft);font-weight:400;font-size:.78rem}.tool-group .tool-switcher{margin-top:10px}.tool-switcher{display:flex;flex-direction:column;gap:12px}.tool-switcher__button{width:100%;border:1px solid var(--color-border);background:transparent;color:inherit;border-radius:16px;padding:14px;text-align:right;cursor:pointer;transition:all .2s ease}.tool-switcher__button.is-active{border-color:var(--color-accent);box-shadow:0 0 0 1px var(--color-accent);background:var(--color-accent-soft)}.tool-switcher__title{display:block;font-weight:700;margin-bottom:4px}.tool-switcher__subtitle{display:block;font-size:12px;opacity:.75}.workspace-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.tool-meta{display:flex;flex-direction:column;gap:6px}.favorite-toggle{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:14px;border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-soft)}.favorite-toggle.is-active{color:#f59e0b;background:rgba(245,158,11,.08)}.calculator-description{margin-top:8px;margin-bottom:18px;opacity:.82;line-height:1.8}.calculator-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.calculator-field{display:flex;flex-direction:column;gap:8px}.calculator-label{font-size:14px;font-weight:600}.calculator-input{width:100%;border:1px solid var(--color-border);background:var(--color-surface);color:inherit;border-radius:14px;padding:12px 14px;outline:none;transition:all .2s ease;font:inherit}.calculator-input:focus{border-color:var(--color-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--color-accent) 16%,transparent)}.field-help{font-size:.82rem;color:var(--color-text-soft)}.calculator-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}.primary-button,.secondary-button,.ghost-button{border:none;border-radius:14px;padding:12px 18px;font:inherit;cursor:pointer;transition:all .2s ease}.primary-button{background:var(--color-accent);color:#fff;font-weight:700;box-shadow:var(--shadow-sm)}.secondary-button{background:var(--color-overlay);color:inherit;border:1px solid var(--color-border)}.ghost-button{background:transparent;color:var(--color-text-muted);border:1px dashed var(--color-border)}.result-panel,.formula-box,.warning-box,.info-box{margin-top:20px;border-radius:18px;padding:16px;border:1px solid var(--color-border);background:var(--color-surface-soft)}.result-panel.is-empty{opacity:.85}.result-panel__header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.result-panel__label{margin:0 0 6px;font-size:13px;opacity:.75}.result-panel__value{margin:0;font-size:28px;font-weight:800}.result-panel__body p{margin:8px 0;line-height:1.9}.result-placeholder{margin:0;opacity:.72}.result-error{margin:0;color:#ef4444;font-weight:700}.status-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:8px 12px;font-size:12px;font-weight:700;white-space:nowrap}.status-success{background:rgba(34,197,94,.14);color:#22c55e}.status-warning{background:rgba(245,158,11,.14);color:#f59e0b}.status-danger{background:rgba(239,68,68,.14);color:#ef4444}.status-info{background:rgba(37,99,235,.12);color:#2563eb}.search-results__item{padding:14px 16px;border-radius:16px;border:1px solid var(--color-border);background:var(--color-surface);display:block;width:100%;text-align:right}.segmented{display:flex;gap:10px;flex-wrap:wrap}.segmented button{padding:10px 14px;border-radius:14px;border:1px solid var(--color-border);background:var(--color-surface);color:inherit}.segmented button.is-active{border-color:var(--color-accent);background:var(--color-accent-soft);color:var(--color-accent-strong)}
    @media (max-width:1200px){.hero-panel,.grid-cards,.quick-tools-grid{grid-template-columns:1fr}}
@media (max-width:820px){.mobile-only{display:inline-flex!important}.header__search{display:none}.sidebar{position:fixed;top:0;right:0;bottom:0;z-index:50;transform:translateX(100%);transition:transform var(--transition-normal)}.sidebar--open{transform:translateX(0)}.sidebar-backdrop{display:block;position:fixed;inset:0;z-index:40;background:rgba(15,23,42,.45)}.mobile-nav{position:sticky;bottom:0;z-index:35;display:grid;grid-template-columns:repeat(5,1fr);gap:8px;padding:10px 14px;border-top:1px solid var(--color-border);background:var(--color-bg-elevated)}.mobile-nav__item{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 6px;border-radius:16px;color:var(--color-text-soft)}.mobile-nav__item--active{background:var(--color-accent-soft);color:var(--color-accent-strong)}.mobile-nav__label{font-size:.8rem}.app-shell__content{padding:20px 18px 100px}.workspace-grid{grid-template-columns:1fr}}
    @media (max-width:768px){.header{padding:16px 18px}.theme-toggle__text,.brand__text small{display:none}.calculator-form-grid{grid-template-columns:1fr}.page-header,.workspace-head,.result-panel__header{flex-direction:column;align-items:flex-start}}
  
.history-item { border: 1px solid rgba(120, 120, 120, 0.18); border-radius: 14px; padding: 12px; background: rgba(255, 255, 255, 0.04); }
.history-item-pinned { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18); }
.history-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.history-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-subtle { padding: 10px 12px; border-radius: 12px; background: rgba(120, 120, 120, 0.08); }
.button-like { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 10px; cursor: pointer; border: 1px solid rgba(120, 120, 120, 0.18); }

/* ============================================================
 * v38 visual direction — Clinical Signal
 * A focused, modern workspace with less chrome and more signal.
 * ============================================================ */
:root{
  --color-accent:#7cf7c4;
  --color-accent-soft:rgba(124,247,196,.12);
  --color-accent-strong:#b9ffe1;
  --color-bg:#091112;
  --color-bg-elevated:rgba(15,27,28,.86);
  --color-surface:#132021;
  --color-surface-soft:#0e191a;
  --color-border:rgba(184,255,225,.12);
  --color-text:#f1fff9;
  --color-text-muted:#a7c1b9;
  --color-text-soft:#6f8d84;
  --color-success:#79f2bd;
  --color-warning:#ffcf70;
  --color-danger:#ff827c;
  --shadow-sm:0 12px 32px rgba(0,0,0,.18);
  --shadow-md:0 24px 70px rgba(0,0,0,.28);
  --shadow-lg:0 34px 100px rgba(0,0,0,.38);
  --radius-lg:22px;
  --radius-xl:30px;
  --sidebar-width:274px;
}
body{
  background:
    radial-gradient(circle at 8% 0%,rgba(124,247,196,.11),transparent 25rem),
    radial-gradient(circle at 92% 92%,rgba(65,142,255,.12),transparent 28rem),
    var(--color-bg);
  letter-spacing:-.01em;
}
body[data-theme='dark']{
  --color-bg:#050b0c;
  --color-bg-elevated:rgba(8,18,19,.9);
  --color-surface:#102020;
  --color-surface-soft:#0b1516;
  --color-border:rgba(184,255,225,.14);
  --color-text:#f1fff9;
  --color-text-muted:#b3cbc3;
  --color-text-soft:#78958c;
  --color-accent:#7cf7c4;
  --color-accent-soft:rgba(124,247,196,.13);
  --color-accent-strong:#b9ffe1;
}
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom,black,transparent 82%);
}
.app-shell{gap:18px;padding:18px;min-height:100vh}
.sidebar{
  position:sticky;
  top:18px;
  height:calc(100vh - 36px);
  width:var(--sidebar-width);
  min-width:var(--sidebar-width);
  padding:24px 14px 16px;
  border:1px solid var(--color-border);
  border-radius:28px;
  background:linear-gradient(165deg,rgba(20,39,39,.94),rgba(9,18,19,.88));
  box-shadow:var(--shadow-md);
}
.sidebar::before{
  content:'';
  display:block;
  width:42px;
  height:4px;
  margin:0 12px 26px auto;
  border-radius:99px;
  background:var(--color-accent);
  box-shadow:0 0 22px rgba(124,247,196,.72);
}
.sidebar__title{padding:0 12px 12px}
.sidebar__title h1{font-size:1.7rem;letter-spacing:-.06em;color:var(--color-text)}
.sidebar__title p{font-size:.78rem;color:var(--color-text-soft);line-height:1.7}
.sidebar__nav{gap:6px}
.sidebar__link{
  position:relative;
  padding:12px;
  border-radius:16px;
  color:var(--color-text-muted);
  font-size:.9rem;
}
.sidebar__link:hover{background:rgba(124,247,196,.07);color:var(--color-text)}
.sidebar__link--active{
  color:var(--color-accent-strong);
  border:1px solid rgba(124,247,196,.18);
  background:linear-gradient(90deg,rgba(124,247,196,.14),rgba(124,247,196,.03));
  box-shadow:inset 3px 0 0 var(--color-accent),0 10px 24px rgba(0,0,0,.15);
}
.sidebar__link-icon{
  width:32px;height:32px;border-radius:11px;
  color:var(--color-accent);
  background:rgba(124,247,196,.08);
  border:1px solid rgba(124,247,196,.1);
}
.status-card{
  padding:13px;
  border-radius:18px;
  background:rgba(124,247,196,.06);
  border-color:rgba(124,247,196,.12);
}
.status-card p{font-size:.74rem;line-height:1.65}
.app-shell__main{min-width:0}
.app-shell__content{max-width:1440px;padding:0 18px 76px}
.header{
  top:18px;
  margin:0 0 28px;
  padding:12px 18px;
  border:1px solid var(--color-border);
  border-radius:20px;
  background:rgba(12,24,25,.78);
  box-shadow:var(--shadow-sm);
}
.brand__logo{width:54px;height:54px;border-radius:16px;background:rgba(124,247,196,.08)}
.brand__text{display:none}
.header__search{max-width:520px;min-width:260px}
.header__search input{
  padding:13px 44px 13px 16px;
  border-radius:14px;
  border-color:rgba(184,255,225,.14);
  background:rgba(255,255,255,.045);
  color:var(--color-text);
}
.header__search input::placeholder{color:var(--color-text-soft)}
.page{gap:18px}
.page-header{padding:4px 2px 2px}
.page-title{font-size:clamp(1.7rem,3vw,2.8rem);letter-spacing:-.055em}
.page-description{max-width:760px;color:var(--color-text-muted);font-size:.94rem}
.alert-banner{
  padding:10px 14px;
  gap:10px;
  border-radius:14px;
  background:rgba(255,207,112,.06);
  border-color:rgba(255,207,112,.15);
}
.alert-banner__icon{width:26px;height:26px;border-radius:9px;font-size:.8rem}
.alert-banner__body{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.alert-banner__body strong{margin:0;font-size:.78rem;color:var(--color-warning)}
.alert-banner__body p{font-size:.76rem;line-height:1.6;color:var(--color-text-soft)}
.dashboard-card,.settings-card,.favorites-box,.stats-panel,.search-results{
  padding:20px;
  border-radius:22px;
  background:linear-gradient(145deg,rgba(20,37,38,.86),rgba(12,24,25,.8));
  border-color:rgba(184,255,225,.1);
  box-shadow:var(--shadow-sm);
}
.dashboard-card:hover,.quick-tool:hover{border-color:rgba(124,247,196,.24)}
.grid-cards,.quick-tools-grid{gap:14px}
.quick-tool{
  position:relative;
  min-height:140px;
  padding:18px;
  border-radius:20px;
  background:linear-gradient(145deg,rgba(25,47,47,.88),rgba(13,26,27,.88));
  border-color:rgba(184,255,225,.1);
  box-shadow:var(--shadow-sm);
}
.quick-tool::after{
  content:'↗';
  position:absolute;
  left:16px;
  bottom:14px;
  color:var(--color-accent);
  opacity:.7;
}
.quick-tool strong{font-size:1.05rem;letter-spacing:-.025em}
.quick-tool p{font-size:.8rem;color:var(--color-text-soft);line-height:1.7;max-width:85%}
.quick-badge,.hero-badge,.dashboard-card__badge{
  padding:6px 10px;
  border-radius:8px;
  background:rgba(124,247,196,.09);
  color:var(--color-accent-strong);
  font-size:.7rem;
  letter-spacing:.01em;
}
.workspace-grid{grid-template-columns:286px 1fr;gap:14px}
.workspace-sidebar>.dashboard-card{padding:14px}
.tool-group{
  margin-bottom:8px;
  padding:8px 10px;
  border-radius:14px;
  background:rgba(255,255,255,.025);
  border-color:rgba(184,255,225,.08);
}
.tool-group__title{font-size:.78rem;color:var(--color-text-muted)}
.tool-switcher{gap:6px}
.tool-switcher__button{
  padding:11px;
  border-radius:12px;
  border-color:transparent;
  color:var(--color-text-muted);
}
.tool-switcher__button:hover{background:rgba(124,247,196,.06);color:var(--color-text)}
.tool-switcher__button.is-active{
  border-color:rgba(124,247,196,.24);
  box-shadow:inset 2px 0 0 var(--color-accent);
  background:rgba(124,247,196,.09);
}
.tool-switcher__title{font-size:.82rem}
.tool-switcher__subtitle{font-size:.69rem;color:var(--color-text-soft)}
.workspace-main>.dashboard-card{min-height:100%}
.workspace-head{margin-bottom:18px}
.dashboard-card__title{font-size:1.18rem;letter-spacing:-.03em}
.tool-meta p,.dashboard-card__description,.meta-line,.settings-card__description{font-size:.82rem;color:var(--color-text-soft);line-height:1.8}
.calculator-form-grid{gap:12px}
.calculator-field{gap:7px}
.calculator-label{font-size:.78rem;color:var(--color-text-muted)}
.calculator-input{
  padding:12px 13px;
  border-radius:12px;
  background:rgba(255,255,255,.045);
  border-color:rgba(184,255,225,.12);
  color:var(--color-text);
}
.calculator-input:focus{border-color:var(--color-accent);box-shadow:0 0 0 3px rgba(124,247,196,.1)}
.calculator-actions{gap:8px;margin-top:16px}
.primary-button,.secondary-button,.ghost-button{
  padding:11px 15px;
  border-radius:12px;
  font-size:.8rem;
}
.primary-button{
  color:#071311;
  background:var(--color-accent);
  box-shadow:0 8px 22px rgba(124,247,196,.18);
}
.secondary-button{background:rgba(255,255,255,.05);border-color:rgba(184,255,225,.12)}
.ghost-button{border-style:solid;border-color:rgba(184,255,225,.12)}
.favorite-toggle{width:38px;height:38px;border-radius:12px;background:rgba(255,255,255,.045)}
.result-panel,.formula-box,.warning-box,.info-box{
  margin-top:14px;
  padding:14px;
  border-radius:15px;
  background:rgba(255,255,255,.035);
  border-color:rgba(184,255,225,.09);
}
.result-panel__value{font-size:2rem;letter-spacing:-.06em}
.result-panel__body p{font-size:.8rem;line-height:1.8}
.formula-box p{font-size:.74rem!important;color:var(--color-text-soft)}
.warning-box{background:rgba(255,207,112,.045);border-color:rgba(255,207,112,.14)}
.warning-box p{font-size:.76rem;line-height:1.75}
.status-badge{padding:7px 10px;font-size:.7rem}
.search-results__item{background:rgba(255,255,255,.035);border-color:rgba(184,255,225,.09);font-size:.82rem}
.search-results__item:hover{background:rgba(124,247,196,.07)}
.history-item{background:rgba(255,255,255,.025);border-color:rgba(184,255,225,.08)}
@media (max-width:1100px){
  .workspace-grid{grid-template-columns:1fr}
  .workspace-sidebar{order:2}
  .workspace-main{order:1}
}
@media (max-width:820px){
  .app-shell{padding:0;display:block}
  .sidebar{top:0;height:100vh;border-radius:0 24px 24px 0}
  .header{top:0;margin:0 0 20px;border-radius:0 0 18px 18px}
  .app-shell__content{padding:0 14px 88px}
  .brand__logo{width:46px;height:46px}
}

/* ============================================================
 * v38 visual reset — NEO-EDITORIAL CLINICAL INSTRUMENT
 * An asymmetric, print-inspired command surface. No glass cards,
 * no gradient soup, no generic AI dashboard language.
 * ============================================================ */
:root{
  --color-accent:#1837f0;
  --color-accent-soft:#e7ebff;
  --color-accent-strong:#1026ad;
  --color-bg:#f4f1e9;
  --color-bg-elevated:#fffdf8;
  --color-surface:#fffdf8;
  --color-surface-soft:#eeebe3;
  --color-border:#171717;
  --color-text:#111111;
  --color-text-muted:#464646;
  --color-text-soft:#74736d;
  --color-success:#1f8d5b;
  --color-warning:#e88319;
  --color-danger:#d63b32;
  --shadow-sm:4px 4px 0 rgba(17,17,17,.14);
  --shadow-md:8px 8px 0 rgba(17,17,17,.14);
  --shadow-lg:12px 12px 0 rgba(17,17,17,.16);
  --radius-lg:8px;
  --radius-xl:10px;
}
*{scrollbar-color:#1837f0 #eeebe3;scrollbar-width:thin}
html{background:#f4f1e9}
body{
  background:#f4f1e9;
  color:#111;
  font-family:Tahoma,Arial,sans-serif;
  letter-spacing:-.018em;
}
body::before{
  opacity:.32;
  background-image:radial-gradient(#171717 .7px,transparent .7px);
  background-size:9px 9px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.22),transparent 75%);
}
.app-shell{
  display:grid;
  grid-template-columns:242px minmax(0,1fr);
  gap:0;
  padding:0;
  background:#f4f1e9;
}
.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  width:242px;
  min-width:242px;
  padding:28px 15px 18px;
  border:0;
  border-radius:0;
  background:#1837f0;
  color:#fff;
  box-shadow:none;
  overflow:hidden;
}
.sidebar::before{
  width:54px;
  height:7px;
  margin:0 9px 42px auto;
  border-radius:0;
  background:#cbff36;
  box-shadow:none;
}
.sidebar__title{padding:0 9px 32px}
.sidebar__title h1{
  font-size:2.1rem;
  line-height:1;
  letter-spacing:-.1em;
  color:#fff;
}
.sidebar__title p{
  max-width:150px;
  margin-top:12px;
  color:rgba(255,255,255,.68);
  font-size:.72rem;
  line-height:1.65;
}
.sidebar__nav{gap:4px}
.sidebar__link{
  padding:13px 9px;
  border-radius:3px;
  color:rgba(255,255,255,.74);
  font-size:.82rem;
}
.sidebar__link:hover{
  background:rgba(255,255,255,.1);
  color:#fff;
}
.sidebar__link--active{
  color:#111;
  border:0;
  background:#cbff36;
  box-shadow:4px 4px 0 rgba(0,0,0,.2);
}
.sidebar__link-icon{
  width:28px;
  height:28px;
  border-radius:2px;
  background:rgba(255,255,255,.13);
  border:1px solid rgba(255,255,255,.24);
  color:inherit;
}
.sidebar__link--active .sidebar__link-icon{
  background:#111;
  border-color:#111;
  color:#cbff36;
}
.sidebar__footer{padding:0 3px}
.status-card{
  padding:12px;
  border:1px solid rgba(255,255,255,.3);
  border-radius:3px;
  background:transparent;
  box-shadow:none;
}
.status-card__dot{width:8px;height:8px;background:#cbff36;box-shadow:none}
.status-card strong{font-size:.76rem}
.status-card p{color:rgba(255,255,255,.62);font-size:.68rem}
.app-shell__main{background:#f4f1e9}
.app-shell__content{
  width:100%;
  max-width:1480px;
  padding:0 42px 82px;
}
.header{
  position:sticky;
  top:0;
  z-index:45;
  min-height:78px;
  margin:0 -42px 36px;
  padding:13px 42px;
  border:0;
  border-bottom:2px solid #171717;
  border-radius:0;
  background:rgba(244,241,233,.94);
  box-shadow:none;
  backdrop-filter:blur(8px);
}
.brand__logo{
  width:48px;
  height:48px;
  border-radius:3px;
  background:#cbff36;
  border:2px solid #171717;
  box-shadow:3px 3px 0 #171717;
}
.brand__text{display:flex}
.brand__text strong{font-size:.96rem;letter-spacing:-.06em}
.brand__text small{display:none}
.header__search{max-width:480px;min-width:260px}
.header__search input{
  padding:11px 42px 11px 13px;
  border:2px solid #171717;
  border-radius:3px;
  background:#fffdf8;
  color:#111;
  box-shadow:3px 3px 0 #171717;
  font-size:.8rem;
}
.header__search input::placeholder{color:#85827a}
.header__search span{color:#1837f0;font-weight:900}
.page{gap:22px}
.page-header{
  position:relative;
  padding:4px 0 12px;
  border-bottom:2px solid #171717;
}
.page-header::before{
  content:'CLINICAL / TOOLKIT';
  display:block;
  margin-bottom:15px;
  color:#1837f0;
  font-family:Arial,sans-serif;
  font-size:.63rem;
  font-weight:800;
  letter-spacing:.17em;
  direction:ltr;
  text-align:right;
}
.page-title{
  font-size:clamp(2rem,4.6vw,4.2rem);
  line-height:1;
  letter-spacing:-.11em;
  color:#111;
}
.page-description{
  max-width:670px;
  margin-top:12px;
  color:#5f5d56;
  font-size:.84rem;
}
.alert-banner{
  padding:8px 12px;
  border:1px solid #171717;
  border-radius:3px;
  background:#cbff36;
  box-shadow:4px 4px 0 #171717;
}
.alert-banner__icon{
  width:24px;height:24px;
  border-radius:2px;
  background:#111;
  color:#cbff36;
}
.alert-banner__body strong{color:#111;font-size:.74rem}
.alert-banner__body p{color:#282828;font-size:.72rem}
.dashboard-card,.settings-card,.favorites-box,.stats-panel,.search-results{
  padding:22px;
  border:2px solid #171717;
  border-radius:4px;
  background:#fffdf8;
  box-shadow:6px 6px 0 rgba(17,17,17,.14);
}
.dashboard-card:hover,.quick-tool:hover{
  border-color:#1837f0;
  box-shadow:7px 7px 0 #1837f0;
}
.grid-cards,.quick-tools-grid{gap:18px}
.quick-tools-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.quick-tool{
  min-height:168px;
  padding:17px;
  border:2px solid #171717;
  border-radius:3px;
  background:#fffdf8;
  box-shadow:4px 4px 0 rgba(17,17,17,.13);
}
.quick-tool:nth-child(2n){background:#e7ebff}
.quick-tool:nth-child(3n){background:#cbff36}
.quick-tool::after{
  left:auto;
  right:16px;
  bottom:13px;
  color:#1837f0;
  font-family:Arial,sans-serif;
  font-size:1.2rem;
  font-weight:900;
}
.quick-tool strong{font-size:1.02rem;line-height:1.3}
.quick-tool p{color:#5e5d58;font-size:.75rem}
.quick-badge,.hero-badge,.dashboard-card__badge{
  padding:5px 7px;
  border-radius:2px;
  background:#1837f0;
  color:#fff;
  font-size:.63rem;
  font-weight:800;
}
.quick-tool:nth-child(3n) .quick-badge{background:#111;color:#cbff36}
.workspace-grid{grid-template-columns:286px minmax(0,1fr);gap:22px}
.workspace-sidebar>.dashboard-card{padding:14px;box-shadow:4px 4px 0 rgba(17,17,17,.12)}
.tool-group{
  margin-bottom:7px;
  padding:7px 8px;
  border:1px solid #171717;
  border-radius:2px;
  background:#eeebe3;
}
.tool-group__title{
  color:#111;
  font-size:.74rem;
  text-transform:none;
}
.tool-group__count{color:#1837f0;font-weight:800}
.tool-switcher{gap:4px;counter-reset:tool}
.tool-switcher__button{
  position:relative;
  min-height:45px;
  padding:9px 9px 9px 35px;
  border:1px solid transparent;
  border-radius:2px;
  color:#4d4b45;
  background:transparent;
}
.tool-switcher__button::before{
  counter-increment:tool;
  content:counter(tool,decimal-leading-zero);
  position:absolute;
  left:9px;
  top:10px;
  color:#9a978f;
  font-family:Arial,sans-serif;
  font-size:.62rem;
  font-weight:900;
  direction:ltr;
}
.tool-switcher__button:hover{
  color:#111;
  background:#fffdf8;
  border-color:#171717;
}
.tool-switcher__button.is-active{
  color:#fff;
  border-color:#171717;
  background:#1837f0;
  box-shadow:3px 3px 0 #171717;
}
.tool-switcher__button.is-active::before{color:#cbff36}
.tool-switcher__title{font-size:.77rem}
.tool-switcher__subtitle{font-size:.63rem;color:inherit;opacity:.68}
.workspace-main>.dashboard-card{box-shadow:8px 8px 0 #171717}
.workspace-head{margin-bottom:22px}
.dashboard-card__title{font-size:1.28rem;letter-spacing:-.06em}
.tool-meta p,.dashboard-card__description,.meta-line,.settings-card__description{
  font-size:.78rem;
  color:#6a6861;
}
.calculator-form-grid{gap:18px}
.calculator-field{gap:8px}
.calculator-label{color:#31302c;font-size:.75rem}
.calculator-input{
  padding:12px 11px;
  border:0;
  border-bottom:2px solid #171717;
  border-radius:0;
  background:#eeebe3;
  color:#111;
  font-size:.84rem;
}
.calculator-input:focus{
  border-color:#1837f0;
  box-shadow:0 3px 0 #1837f0;
  background:#e7ebff;
}
.calculator-actions{gap:10px;margin-top:21px}
.primary-button,.secondary-button,.ghost-button{
  padding:12px 17px;
  border:2px solid #171717;
  border-radius:2px;
  font-size:.76rem;
  box-shadow:3px 3px 0 #171717;
}
.primary-button{
  color:#fff;
  background:#1837f0;
}
.primary-button:hover{background:#1026ad}
.secondary-button{color:#111;background:#cbff36}
.ghost-button{background:#fffdf8;box-shadow:none}
.favorite-toggle{
  width:38px;height:38px;
  border:2px solid #171717;
  border-radius:2px;
  background:#cbff36;
  color:#111;
}
.result-panel{
  position:relative;
  margin-top:22px;
  padding:20px 20px 20px 24px;
  border:2px solid #171717;
  border-radius:3px;
  background:#e7ebff;
  box-shadow:5px 5px 0 #1837f0;
  overflow:hidden;
}
.result-panel::before{
  content:'RESULT';
  position:absolute;
  top:18px;
  left:-24px;
  padding:3px 24px;
  color:#cbff36;
  background:#111;
  font-family:Arial,sans-serif;
  font-size:.56rem;
  font-weight:900;
  letter-spacing:.16em;
  transform:rotate(-90deg);
  transform-origin:center;
}
.result-panel__label{color:#1837f0;font-size:.68rem;font-weight:800}
.result-panel__value{
  color:#111;
  font-family:Arial,Tahoma,sans-serif;
  font-size:clamp(2.2rem,5vw,4.6rem);
  line-height:.92;
  letter-spacing:-.09em;
}
.result-panel__body p{font-size:.76rem;line-height:1.85}
.formula-box,.warning-box,.info-box{
  margin-top:12px;
  padding:13px;
  border:1px solid #171717;
  border-radius:2px;
  background:#eeebe3;
}
.formula-box p{font-size:.7rem!important;color:#5f5d56}
.warning-box{background:#fff0d8;border-color:#171717}
.warning-box p{font-size:.72rem;line-height:1.75}
.status-badge{padding:6px 8px;border:1px solid #171717;border-radius:2px;font-size:.64rem}
.status-success{background:#bff0d4;color:#0d5d39}
.status-warning{background:#ffd48c;color:#743900}
.status-danger{background:#ffb0aa;color:#7d1e1a}
.status-info{background:#cbd3ff;color:#1026ad}
.search-results__item{
  border:1px solid #171717;
  border-radius:2px;
  background:#fffdf8;
}
.search-results__item:hover{background:#cbff36}
.history-item{border:1px solid #171717;border-radius:2px;background:#fffdf8}
.hero-panel{border:2px solid #171717;border-radius:4px;background:#1837f0;box-shadow:8px 8px 0 #171717}
.hero-title,.hero-description{color:#fff}
.hero-badge{background:#cbff36;color:#111}
@media (max-width:1200px){
  .quick-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1100px){
  .app-shell{display:block}
  .sidebar{position:fixed;right:0;z-index:50}
  .app-shell__content{padding:0 24px 82px}
  .header{margin:0 -24px 28px;padding-inline:24px}
}
@media (max-width:820px){
  .sidebar{border-radius:0 12px 12px 0}
  .header{min-height:68px;border-bottom-width:2px}
  .app-shell__content{padding-inline:14px}
  .header{margin-inline:-14px;padding-inline:14px}
  .quick-tools-grid{grid-template-columns:1fr}
  .quick-tool{min-height:138px}
  .page-title{font-size:2.35rem}
}

/* Theme tokens used by the settings controls */
:root{
  --neo-primary:#1837f0;
  --neo-pop:#cbff36;
  --neo-wash:#e7ebff;
}
.sidebar{background:var(--neo-primary)}
.sidebar__link--active{background:var(--neo-pop)}
.sidebar__link--active .sidebar__link-icon{color:var(--neo-pop)}
.header__search span,.page-header::before,.tool-group__count{color:var(--neo-primary)}
.primary-button{background:var(--neo-primary)}
.secondary-button,.alert-banner{background:var(--neo-pop)}
.result-panel{background:var(--neo-wash);box-shadow:5px 5px 0 var(--neo-primary)}
.quick-tool:nth-child(2n){background:var(--neo-wash)}
.quick-tool:nth-child(3n){background:var(--neo-pop)}
.quick-badge,.hero-badge,.dashboard-card__badge{background:var(--neo-primary)}
.quick-tool:nth-child(3n) .quick-badge{background:#111;color:var(--neo-pop)}
.theme-accent-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.theme-accent{
  display:flex;align-items:center;gap:10px;
  min-height:68px;padding:10px;
  border:2px solid #171717;border-radius:3px;
  background:var(--swatch-soft);
  color:#111;text-align:right;
  box-shadow:3px 3px 0 rgba(17,17,17,.12);
}
.theme-accent:hover,.theme-accent.is-active{border-color:var(--swatch);box-shadow:4px 4px 0 var(--swatch)}
.theme-accent__swatch{width:27px;height:27px;flex:0 0 27px;border:2px solid #171717;border-radius:50%;background:var(--swatch)}
.theme-accent span:last-child{display:flex;flex-direction:column;gap:3px}
.theme-accent strong{font-size:.76rem}
.theme-accent small{font-size:.63rem;color:#666}
.theme-mode-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.theme-mode-switch button{
  display:grid;grid-template-columns:auto 1fr;align-items:center;gap:2px 9px;
  padding:12px;border:2px solid #171717;border-radius:3px;
  background:#eeebe3;color:#111;text-align:right;
}
.theme-mode-switch button span{grid-row:span 2;font-size:1.5rem;color:var(--neo-primary)}
.theme-mode-switch button strong{font-size:.78rem}
.theme-mode-switch button small{font-size:.64rem;color:#6b6962}
.theme-mode-switch button.is-active{background:var(--neo-wash);border-color:var(--neo-primary);box-shadow:3px 3px 0 var(--neo-primary)}
body[data-theme='dark']{
  --color-bg:#101416;
  --color-bg-elevated:#171c1e;
  --color-surface:#1b2224;
  --color-surface-soft:#20292b;
  --color-border:#dbe8e2;
  --color-text:#f4fff9;
  --color-text-muted:#c2d3cc;
  --color-text-soft:#8fa59d;
}
body[data-theme='dark'],body[data-theme='dark'] .app-shell,body[data-theme='dark'] .app-shell__main{background:#101416}
body[data-theme='dark'] .header{background:rgba(16,20,22,.96);border-color:#dbe8e2}
body[data-theme='dark'] .page-title,
body[data-theme='dark'] .dashboard-card,
body[data-theme='dark'] .settings-card,
body[data-theme='dark'] .favorites-box,
body[data-theme='dark'] .stats-panel,
body[data-theme='dark'] .search-results,
body[data-theme='dark'] .quick-tool,
body[data-theme='dark'] .search-results__item,
body[data-theme='dark'] .history-item{color:#f4fff9;background:#1b2224;border-color:#dbe8e2}
body[data-theme='dark'] .page-description,
body[data-theme='dark'] .tool-meta p,
body[data-theme='dark'] .dashboard-card__description,
body[data-theme='dark'] .meta-line,
body[data-theme='dark'] .settings-card__description{color:#b4c8c0}
body[data-theme='dark'] .calculator-input{background:#20292b;color:#f4fff9;border-color:#dbe8e2}
body[data-theme='dark'] .calculator-label{color:#dbe8e2}
body[data-theme='dark'] .tool-group{background:#20292b;border-color:#dbe8e2}
body[data-theme='dark'] .tool-group__title{color:#f4fff9}
body[data-theme='dark'] .tool-switcher__button{color:#c2d3cc}
body[data-theme='dark'] .tool-switcher__button.is-active{background:var(--neo-primary);color:#fff;border-color:#fff}
body[data-theme='dark'] .result-panel{color:#111}
body[data-theme='dark'] .formula-box,body[data-theme='dark'] .info-box{background:#20292b;color:#f4fff9;border-color:#dbe8e2}
body[data-theme='dark'] .formula-box p{color:#b4c8c0}
body[data-theme='dark'] .theme-mode-switch button{background:#20292b;color:#f4fff9;border-color:#dbe8e2}
body[data-theme='dark'] .theme-accent{border-color:#dbe8e2}
body[data-theme='dark'] .ghost-button{background:#20292b;color:#f4fff9;border-color:#dbe8e2}
@media (max-width:700px){
  .theme-accent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .settings-top-grid{grid-template-columns:1fr!important}
}
.sidebar__brand{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.sidebar__brand>img{display:block;width:min(100%,188px);height:auto;max-height:72px;object-fit:contain;object-position:right center}
.sidebar__brand>div h1{margin:0;font-size:1.15rem}
.sidebar__brand>div p{margin:.15rem 0 0;font-size:.78rem;line-height:1.5}
.brand__logo{width:46px;height:46px;padding:4px;border-radius:3px;background:var(--neo-pop);box-shadow:3px 3px 0 #171717}
.brand__logo img{object-fit:contain}
@media (max-width:700px){.sidebar__brand>img{width:164px;max-height:62px}}

/* A single alignment system for the shell and its compact navigation. */
.app-shell__main{min-width:0}
.header{width:100%;margin:0 0 32px;padding-inline:clamp(18px,3vw,42px)}
.header__left,.header__search{min-width:0}
.header__search{width:min(100%,340px)}
.sidebar{height:100dvh;overflow-y:auto;overflow-x:hidden;gap:18px}
.sidebar::before{display:none}
.sidebar__title{padding:4px 8px 24px}
.sidebar__brand{flex-direction:column;align-items:center;gap:12px;text-align:center}
.sidebar__brand>img{width:min(100%,210px);height:180px;max-height:180px;flex:0 0 auto;padding:0;border-radius:0;background:transparent;object-fit:contain}
@media (max-width:700px){.sidebar__brand>img{width:min(100%,180px);height:148px;max-height:148px}}
.sidebar__brand>div{min-width:0}
.sidebar__brand>div h1{font-size:1.25rem;letter-spacing:0}
.sidebar__brand>div p{font-size:.68rem;line-height:1.6;color:rgba(255,255,255,.8)}
.brand__logo{width:42px;height:42px;padding:0;border:0;border-radius:10px;background:transparent;box-shadow:none}
.brand__text strong{font-size:.92rem;letter-spacing:0}
.header-wordmark{display:block;width:clamp(160px,16vw,230px);height:auto;max-height:48px;object-fit:contain}
@media (min-width:1101px){
  .header{justify-content:initial}
  .header__left{position:absolute;left:clamp(18px,3vw,42px);top:50%;transform:translateY(-50%)}
  .header__search{position:absolute;left:50%;top:50%;width:min(420px,36vw);min-width:260px;transform:translate(-50%,-50%)}
  .header__right{display:none}
}
.page-header{flex-direction:column;align-items:stretch;gap:0}
.page-header::before{margin-bottom:8px}
.page-title{font-size:clamp(1.8rem,3.3vw,3.2rem);line-height:1.35;letter-spacing:-.04em}
.workspace-grid,.calculator-form-grid{min-width:0}
.workspace-main,.workspace-sidebar,.calculator-field{min-width:0}
@media (max-width:1100px){
  .header__left,.header__search{position:static;transform:none}
  .header__search{width:auto}
  .workspace-grid{grid-template-columns:minmax(0,1fr)}
  .sidebar{top:0;bottom:0;transform:translateX(100%);transition:transform var(--transition-normal);border-radius:0;box-shadow:-10px 0 30px rgba(0,0,0,.16)}
  .sidebar--open{transform:translateX(0)}
  .sidebar-backdrop{display:block;position:fixed;inset:0;z-index:40;background:rgba(15,23,42,.45)}
  .mobile-only{display:inline-flex!important}
  .header{margin:0 0 28px;padding-inline:24px}
}
@media (max-width:820px){
  .header{margin:0 0 20px;padding:12px 14px;gap:10px;flex-wrap:wrap}
  .header__left{width:100%;justify-content:flex-start;gap:12px}
  .header__search{display:block;flex:0 0 100%;width:100%;max-width:none;min-width:0}
  .header__search input{width:100%;min-height:44px}
  .header-wordmark{width:clamp(148px,44vw,190px);max-height:40px}
  .brand__text{display:none}
  .page-title{font-size:clamp(1.7rem,6vw,2.35rem)}
  .mobile-nav{gap:2px;padding-inline:6px}
  .mobile-nav__item{min-width:0;padding:8px 3px}
  .mobile-nav__label{font-size:.65rem}
}
@media (max-width:380px){.header__search{max-width:none}}

/* Desktop sidebar collapse: keep a useful icon rail without affecting mobile drawer. */
@media (min-width:1101px){
  .sidebar__toggle{display:inline-flex;align-items:center;justify-content:center;align-self:flex-start;flex-shrink:0;width:40px;height:40px;border:1px solid rgba(255,255,255,.5);border-radius:3px;background:rgba(0,0,0,.18);color:#fff;font-size:1.25rem;line-height:1}
  .sidebar__toggle:hover,.sidebar__toggle:focus-visible{background:rgba(0,0,0,.35);outline:2px solid #fff;outline-offset:2px}
  body.sidebar-collapsed .app-shell{grid-template-columns:76px minmax(0,1fr)}
  body.sidebar-collapsed .sidebar{width:76px;min-width:76px;padding-inline:10px;overflow-x:hidden}
  body.sidebar-collapsed .sidebar__title{padding:0 0 24px}
  body.sidebar-collapsed .sidebar__brand>img{width:48px;height:48px;max-height:48px}
  body.sidebar-collapsed .sidebar__brand>div,
  body.sidebar-collapsed .sidebar__link>span:last-child,
  body.sidebar-collapsed .status-card>div{display:none}
  body.sidebar-collapsed .sidebar__link{justify-content:center;padding:10px 4px}
  body.sidebar-collapsed .sidebar__link-icon{width:38px;height:38px}
  body.sidebar-collapsed .sidebar__footer .status-card{justify-content:center;padding:12px 4px}
  body.sidebar-collapsed .sidebar__credit{padding:8px 0;text-align:center}
  body.sidebar-collapsed .sidebar__credit>*:not(.sidebar__credit-mark){display:none}
}
@media (max-width:1100px){#menuBtn{display:inline-flex!important}}
.sidebar__toggle{display:none}
@media (min-width:1101px){.sidebar__toggle{display:inline-flex}}

/* Dark mode uses quiet graphite surfaces; the selected accent remains the only vivid color. */
body[data-theme='dark']{
  --color-bg:#111315;--color-bg-elevated:#191c1f;--color-surface:#202427;
  --color-surface-soft:#272c30;--color-border:rgba(236,242,240,.13);
  --color-text:#f1f3f2;--color-text-muted:#c2c8c5;--color-text-soft:#929b97;
  --color-overlay:rgba(255,255,255,.035);
  --shadow-sm:0 5px 18px rgba(0,0,0,.18);--shadow-md:0 12px 34px rgba(0,0,0,.25);--shadow-lg:0 20px 52px rgba(0,0,0,.32);
}
body[data-theme='dark'],body[data-theme='dark'] .app-shell,body[data-theme='dark'] .app-shell__main{background:var(--color-bg)}
body[data-theme='dark'] .header{background:rgba(25,28,31,.94);border-color:var(--color-border)}
body[data-theme='dark'] .dashboard-card,body[data-theme='dark'] .settings-card,body[data-theme='dark'] .favorites-box,
body[data-theme='dark'] .stats-panel,body[data-theme='dark'] .search-results,body[data-theme='dark'] .quick-tool,
body[data-theme='dark'] .search-results__item,body[data-theme='dark'] .history-item{background:var(--color-surface);color:var(--color-text);border-color:var(--color-border);box-shadow:0 5px 18px rgba(0,0,0,.15)}
body[data-theme='dark'] .page-title{color:var(--color-text)}
body[data-theme='dark'] .page-description,body[data-theme='dark'] .tool-meta p,body[data-theme='dark'] .dashboard-card__description,
body[data-theme='dark'] .meta-line,body[data-theme='dark'] .settings-card__description{color:var(--color-text-muted)}
body[data-theme='dark'] .calculator-input,body[data-theme='dark'] .header__search input,body[data-theme='dark'] textarea,
body[data-theme='dark'] select{background:var(--color-surface-soft);color:var(--color-text);border-color:var(--color-border)}
body[data-theme='dark'] .calculator-label,body[data-theme='dark'] .tool-group__title{color:var(--color-text-muted)}
body[data-theme='dark'] .tool-group,body[data-theme='dark'] .formula-box,body[data-theme='dark'] .info-box{background:var(--color-surface-soft);color:var(--color-text);border-color:var(--color-border)}
body[data-theme='dark'] .formula-box p{color:var(--color-text-muted)}
body[data-theme='dark'] .result-panel{background:var(--color-surface);color:var(--color-text);border-color:var(--color-border);box-shadow:inset 3px 0 0 var(--neo-primary)}
body[data-theme='dark'] .theme-mode-switch button,body[data-theme='dark'] .theme-accent{background:var(--color-surface-soft);color:var(--color-text);border-color:var(--color-border);box-shadow:none}
body[data-theme='dark'] .theme-mode-switch button.is-active{background:color-mix(in srgb,var(--neo-primary) 24%,var(--color-surface));border-color:var(--neo-primary);box-shadow:inset 0 -2px 0 var(--neo-primary)}
body[data-theme='dark'] .theme-mode-switch button small,body[data-theme='dark'] .theme-accent small{color:var(--color-text-soft)}
body[data-theme='dark'] .theme-accent.is-active{border-color:var(--swatch);box-shadow:inset 0 -2px 0 var(--swatch)}
body[data-theme='dark'] .alert-banner{background:color-mix(in srgb,var(--color-warning) 14%,var(--color-surface));color:var(--color-text);border-color:color-mix(in srgb,var(--color-warning) 30%,var(--color-border))}
body[data-theme='dark'] .sidebar{background:#202326;color:var(--color-text);border-left:1px solid var(--color-border)}
body[data-theme='dark'] .sidebar__link{color:var(--color-text-muted)}
body[data-theme='dark'] .sidebar__link:hover{background:rgba(255,255,255,.06);color:var(--color-text)}
body[data-theme='dark'] .sidebar__link--active{color:var(--color-text);background:color-mix(in srgb,var(--neo-primary) 24%,#202326);box-shadow:inset -3px 0 0 var(--neo-primary)}
body[data-theme='dark'] .sidebar__link-icon{background:rgba(255,255,255,.045);border-color:var(--color-border);color:var(--color-text-muted)}
body[data-theme='dark'] .sidebar__link--active .sidebar__link-icon{background:var(--neo-primary);color:#fff;border-color:var(--neo-primary)}
body[data-theme='dark'] .status-card{background:rgba(255,255,255,.035);border-color:var(--color-border)}
.sidebar__credit{display:grid;gap:3px;margin-top:10px;padding:12px 10px;border-top:1px solid rgba(255,255,255,.22);color:rgba(255,255,255,.72);font-size:.68rem;line-height:1.6}
.sidebar__credit-mark{display:none}
.sidebar__credit strong{color:#fff;font-size:.78rem}
.sidebar__credit a{direction:ltr;justify-self:start;color:inherit;font-variant-numeric:tabular-nums}
body[data-theme='dark'] .sidebar__credit{border-color:var(--color-border);color:var(--color-text-muted)}
body[data-theme='dark'] .sidebar__credit strong{color:var(--color-text)}
@media (min-width:1101px){body.sidebar-collapsed .sidebar__credit-mark{display:block;color:var(--color-text);font-weight:700}}

/* A quieter, accent-led navigation, with room for the actual tools. */
.sidebar__brand>img{display:none}
.sidebar{background:color-mix(in srgb,var(--neo-primary) 72%,#101b22);gap:14px}
.sidebar__title{padding:4px 8px 20px;border-bottom:1px solid rgba(255,255,255,.22)}
.sidebar__brand{align-items:flex-start;text-align:right}
.sidebar__brand>div h1{font-size:1.4rem;line-height:1.35}
.sidebar__brand>div p{max-width:none;margin-top:4px;color:rgba(255,255,255,.82)}
.sidebar__link{color:rgba(255,255,255,.86);border:1px solid transparent}
.sidebar__link:hover{background:rgba(255,255,255,.12);color:#fff}
.sidebar__link--active{background:var(--neo-wash);color:#162526;border-color:transparent;box-shadow:3px 3px 0 rgba(0,0,0,.18)}
.sidebar__link--active .sidebar__link-icon{background:var(--neo-primary);border-color:var(--neo-primary);color:#fff}
.status-card__dot{background:var(--neo-pop)}
.tool-switcher__button.is-active{background:var(--neo-primary);border-color:var(--neo-primary);color:#fff}
.tool-switcher__button.is-active::before{color:var(--neo-pop)}
body:not([data-theme='dark']) .alert-banner{background:color-mix(in srgb,var(--neo-pop) 30%,#fffdf8)}
body:not([data-theme='dark']) .quick-tool:nth-child(3n){background:color-mix(in srgb,var(--neo-wash) 70%,#fffdf8)}
.quick-tool:nth-child(3n) .quick-badge{background:var(--neo-primary);color:#fff}
.quick-tool::after{color:var(--neo-primary)}
.dashboard-card:hover,.quick-tool:hover{border-color:var(--neo-primary);box-shadow:7px 7px 0 var(--neo-primary)}
body[data-theme='dark'] .sidebar{background:color-mix(in srgb,var(--neo-primary) 15%,#171c1e)}
body[data-theme='dark'] .sidebar__link--active{background:color-mix(in srgb,var(--neo-primary) 34%,#202326);color:#fff}
@media (min-width:1101px){body.sidebar-collapsed .sidebar__title{display:none}}

/* Align the compact rail and keep the collapse control understated. */
@media (min-width:1101px){
  .sidebar__toggle{width:44px;height:44px;border:1px solid transparent;border-radius:6px;background:transparent;color:rgba(255,255,255,.9)}
  .sidebar__toggle svg{display:block;width:20px;height:20px;transition:transform .2s ease}
  .sidebar__toggle:hover{background:rgba(255,255,255,.1);outline:none}
  .sidebar__toggle:focus-visible{outline:2px solid #fff;outline-offset:2px}
  body.sidebar-collapsed .sidebar{align-items:stretch;gap:12px;padding-inline:10px}
  body.sidebar-collapsed .sidebar__toggle{align-self:center}
  body.sidebar-collapsed .sidebar__toggle svg{transform:rotate(180deg)}
  body.sidebar-collapsed .sidebar__nav{align-items:center;gap:6px}
  body.sidebar-collapsed .sidebar__link{width:48px;height:48px;padding:0;gap:0;justify-content:center;box-shadow:none}
  body.sidebar-collapsed .sidebar__link-icon{width:36px;height:36px;flex:0 0 36px}
  body.sidebar-collapsed .sidebar__footer{width:100%;padding:0}
  body.sidebar-collapsed .sidebar__footer .status-card{width:48px;height:44px;margin-inline:auto;padding:0;align-items:center}
  body.sidebar-collapsed .status-card__dot{margin:0}
  body.sidebar-collapsed .sidebar__credit{display:none}
}
@media (prefers-reduced-motion:reduce){.sidebar__toggle svg{transition:none}}

