/* Nephro-Calc — NephroZayan clinical interface */
:root {
  --navy: #0b2b5e;
  --navy-2: #143f76;
  --teal: #0a7c75;
  --cyan: #1f8ea3;
  --amber: #c58b2a;
  --coral: #c85a4b;
  --violet: #6e5aa8;
  --green: #2d8a62;
  --ink: #142033;
  --ink-2: #344257;
  --muted: #657284;
  --muted-2: #8c97a6;
  --line: #d9e1e9;
  --line-2: #e9eef3;
  --bg: #f4f7fa;
  --paper: #ffffff;
  --paper-2: #f8fafc;
  --blue-soft: #eaf3f7;
  --ok: #24734f;
  --ok-bg: #e9f5ee;
  --warn: #9b6815;
  --warn-bg: #fff4dd;
  --bad: #a33a34;
  --bad-bg: #fceceb;
  --info: #176f83;
  --info-bg: #e7f3f6;
  --shadow-1: 0 1px 2px rgba(11, 43, 94, .05);
  --shadow-2: 0 10px 28px rgba(11, 43, 94, .09);
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 14px;
  --font-head: Newsreader, Georgia, "Times New Roman", serif;
  --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --bar-h: 82px;
  --drawer-w: 276px;
  --bot-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  padding-top: var(--bar-h);
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0 0 .45em; color: var(--navy); font-family: var(--font-head); font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 3vw, 3.35rem); line-height: 1.08; }
h2 { font-size: 1.45rem; line-height: 1.2; }
h3 { font-size: 1.08rem; line-height: 1.3; }
h4 { font-size: .98rem; color: var(--ink-2); }
p { margin: .45em 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: none; }
small { color: var(--muted); }
hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--line); }
code, .mono { font-family: var(--font-mono); font-size: .86em; }

/* Header */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(250px, var(--drawer-w)) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 20px;
  height: var(--bar-h);
  padding: 0 24px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); }
.brand:hover { opacity: .9; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; overflow: hidden; border-radius: 50%; background: white; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; white-space: nowrap; }
.brand-title { color: var(--navy); font-size: 1.35rem; font-weight: 750; letter-spacing: -.035em; }
.brand-sub { margin-top: 3px; color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: .01em; }
.global-search { position: relative; display: flex; align-items: center; width: 100%; max-width: 720px; justify-self: center; }
.global-search-submit {
  position: absolute; left: 9px; z-index: 1; display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.global-search-submit:hover { color: var(--teal); background: rgba(10,124,117,.08); }
.global-search-submit:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.global-search input {
  width: 100%; height: 46px; padding: 0 18px 0 46px;
  border: 1px solid #cfd9e3; border-radius: 9px; outline: 0;
  background: var(--paper); color: var(--ink); font: 500 .9rem/1 var(--font-body);
  box-shadow: var(--shadow-1); transition: border-color .18s, box-shadow .18s;
}
.global-search input::placeholder { color: #778497; }
.global-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10,124,117,.11); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.icon-btn { display: inline-grid; place-items: center; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--navy); cursor: pointer; }
.icon-btn:hover, .icon-btn:focus-visible { outline: 0; background: var(--blue-soft); }
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 13px; border: 1px solid #ced8e2; border-radius: 8px;
  background: var(--paper); color: var(--navy); font: 650 .78rem/1 var(--font-body); cursor: pointer;
}
.pill-btn:hover { border-color: #9eb6c7; background: var(--paper-2); }
.net-badge { width: 9px; height: 9px; margin-left: 5px; border-radius: 50%; background: #27a05f; box-shadow: 0 0 0 4px rgba(39,160,95,.1); }
.net-badge.off { background: var(--amber); box-shadow: 0 0 0 4px rgba(197,139,42,.12); }

/* Navigation rail */
.drawer {
  position: fixed; top: var(--bar-h); left: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column; width: var(--drawer-w);
  background: var(--paper); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .22s ease-out;
}
.drawer.open { transform: translateX(0); }
.drawer-scrim { position: fixed; inset: var(--bar-h) 0 0; z-index: 39; background: rgba(12,28,48,.4); }
.drawer-head, .drawer-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.drawer-head { border-bottom: 1px solid var(--line-2); }
.drawer-foot { border-top: 1px solid var(--line-2); }
.drawer-nav { flex: 1; overflow-y: auto; padding: 14px 12px; scrollbar-width: thin; }
.drawer-primary { padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.drawer-nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 10px; border-radius: 7px; color: var(--ink-2); font-size: .84rem; font-weight: 550; }
.drawer-nav a:hover { color: var(--navy); background: var(--paper-2); }
.drawer-nav a.active { color: var(--navy); background: #eaf0f6; box-shadow: inset 3px 0 0 var(--navy); font-weight: 700; }
.nav-icon { display: inline-flex; flex: 0 0 auto; color: currentColor; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drawer-nav .count { margin-left: auto; padding: 2px 7px; border-radius: 5px; background: var(--paper-2); color: var(--muted); font: 650 .68rem/1.5 var(--font-mono); }
.drawer-nav .domain-link { position: relative; min-height: 36px; padding-left: 14px; }
.domain-marker { width: 3px; height: 28px; flex: 0 0 3px; border-radius: 2px; background: var(--domain-color, var(--teal)); }

/* Domain palette */
.domain-renal, .domain-pediatric { --domain-color: #2366b1; }
.domain-aki, .domain-toxicology { --domain-color: var(--coral); }
.domain-ckd, .domain-glomerular { --domain-color: var(--teal); }
.domain-electrolytes, .domain-fluids { --domain-color: var(--cyan); }
.domain-acidbase, .domain-prognosis { --domain-color: var(--violet); }
.domain-hd, .domain-pd, .domain-crrt { --domain-color: var(--amber); }
.domain-transplant, .domain-procedures { --domain-color: #8a5a9d; }
.domain-dosing, .domain-cardiometabolic { --domain-color: #347d62; }
.domain-htn, .domain-stones, .domain-nutrition { --domain-color: #55738d; }

/* Main workspace */
.main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; padding: 42px 0 54px; }
.main:focus { outline: none; }
.home-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 34px; }
.home-hero h1 { max-width: 860px; }
.home-hero p { margin-top: 12px; color: var(--muted); font-size: .96rem; letter-spacing: .01em; }
.session-cta { flex: 0 0 auto; }

.quick-section { margin: 0 0 28px; }
.quick-section > h2 { margin-bottom: 12px; font-family: var(--font-body); font-size: .9rem; letter-spacing: -.01em; }
.quick-list { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.quick-item { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 11px 18px; color: var(--ink); font-size: .86rem; font-weight: 650; border-right: 1px solid var(--line); }
.quick-item:last-child { border-right: 0; }
.quick-item:hover { color: var(--navy); background: var(--paper); }
.quick-item .nav-icon { margin-left: auto; color: var(--muted); }
.quick-mark { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border: 1px solid color-mix(in srgb, var(--domain-color) 62%, white); border-radius: 8px; background: color-mix(in srgb, var(--domain-color) 8%, white); color: var(--domain-color); }
.quick-mark .nav-icon svg { width: 19px; height: 19px; stroke-width: 1.65; }

.home-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 20px; align-items: start; }
.domain-panel, .continue-panel, .workflow-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.domain-panel, .workflow-panel { padding: 18px 20px; }
.continue-panel { padding: 18px 20px; box-shadow: var(--shadow-2); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .continue-panel > h2 { margin: 0; font-size: 1.35rem; }
.panel-heading a { font-size: .77rem; font-weight: 700; }
.domain-list { display: flex; flex-direction: column; }
.domain-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto 20px; align-items: center; gap: 15px; min-height: 66px; padding: 8px 4px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.domain-row:last-child { border-bottom: 0; }
.domain-row:hover { padding-inline: 10px 4px; background: var(--paper-2); }
.domain-copy { display: flex; flex-direction: column; min-width: 0; }
.domain-copy strong { color: var(--navy); font-family: var(--font-head); font-size: 1.02rem; }
.domain-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.domain-count { color: var(--muted); font: 600 .78rem/1 var(--font-mono); }
.domain-row .nav-icon { color: var(--muted-2); }

.continue-panel > h2 { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.continue-row { display: grid; grid-template-columns: 24px 1fr 20px; align-items: center; gap: 12px; padding: 17px 2px; color: var(--ink); border-bottom: 1px solid var(--line); }
.continue-row:hover { color: var(--navy); }
.continue-copy { display: flex; flex-direction: column; }
.continue-copy strong, .continue-title strong { font-size: .83rem; }
.continue-copy small { font-size: .71rem; }
.continue-block { padding: 17px 2px; border-bottom: 1px solid var(--line); }
.continue-title { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.recent-list { display: flex; flex-direction: column; margin: 0 0 10px 36px; }
.recent-list a { padding: 6px 0; color: var(--ink-2); font-size: .75rem; border-bottom: 1px solid var(--line-2); }
.empty-note { margin: 0 0 10px 36px; color: var(--muted); font-size: .75rem; }
.text-link { margin-left: 36px; font-size: .74rem; font-weight: 700; }

.workflow-panel { margin-top: 20px; }
.workflow-list { display: grid; grid-template-columns: repeat(4, 1fr); }
.workflow-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; align-items: center; gap: 10px; min-height: 92px; padding: 15px 18px; color: var(--ink); border-right: 1px solid var(--line); }
.workflow-item:last-child { border-right: 0; }
.workflow-item:hover { background: var(--paper-2); }
.workflow-number { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--teal); border-radius: 50%; color: var(--teal); font: 650 .69rem/1 var(--font-mono); }
.workflow-copy { display: flex; flex-direction: column; min-width: 0; }
.workflow-copy strong { color: var(--navy); font-family: var(--font-head); font-size: .95rem; }
.workflow-copy small { display: -webkit-box; overflow: hidden; font-size: .68rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.workflow-item .nav-icon { color: var(--muted-2); }

/* General pages and calculator surfaces */
.card { margin: 0 0 14px; padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.card.tight { padding: 14px 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { margin-top: -2px; color: var(--muted); font-size: .82rem; }
.session-card { background: linear-gradient(135deg, #f5fbfb 0%, #fff 66%); border-color: #c9dddf; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; min-height: 92px; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { transform: translateY(-1px); border-color: #9eb9c3; box-shadow: var(--shadow-2); }
.tile-title { color: var(--navy); font-family: var(--font-head); font-size: 1.02rem; font-weight: 700; }
.tile-meta { color: var(--muted); font: 600 .69rem/1.4 var(--font-mono); }
.tile-sub { color: var(--ink-2); font-size: .78rem; }
.calc-row { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(240px, 1.5fr) auto; align-items: baseline; gap: 16px; padding: 12px 10px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.calc-row:last-child { border-bottom: 0; }
.calc-row:hover { background: var(--paper-2); }
.calc-row .name { color: var(--navy); font-weight: 700; }
.calc-row .desc { color: var(--muted); font-size: .79rem; }
.calc-row .tier { color: var(--muted-2); font: .68rem/1.4 var(--font-mono); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { color: var(--ink-2); font-size: .77rem; font-weight: 700; }
.field .hint { color: var(--muted); font-size: .69rem; }
.field input, .field select, .field textarea, .patient-bar select, .search-input {
  width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cfd9e3; border-radius: 7px;
  background: var(--paper); color: var(--ink); font: 500 .86rem/1.35 var(--font-body); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .patient-bar select:focus, .search-input:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10,124,117,.1); }
.field.autofilled input, .field.autofilled select { border-color: #9fc8ca; background: #f2fafa; }
.field input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--teal); }
.field-inline { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.field-row { display: flex; gap: 7px; }
.field-row > * { flex: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--navy); border-radius: 7px; background: var(--navy); color: #fff; font: 700 .78rem/1 var(--font-body); cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover { background: var(--navy-2); }
.btn:active { transform: translateY(1px); }
.btn .nav-icon svg { width: 18px; height: 18px; }
.btn.ghost { border-color: #cbd6e0; background: var(--paper); color: var(--navy); }
.btn.ghost:hover { border-color: #a7bbc8; background: var(--paper-2); }
.btn.danger { border-color: var(--bad); background: var(--bad); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: .72rem; }

/* Results and evidence */
.result { margin-top: 16px; padding: 15px 16px; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 8px; }
.result.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.result.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.result.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.result.info { border-left-color: var(--info); background: var(--info-bg); }
.result h3 { margin: 0 0 4px; color: var(--ink); font-family: var(--font-body); font-size: .87rem; letter-spacing: 0; }
.result .primary { margin: 5px 0; color: var(--navy); font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; }
.result .secondary { color: var(--ink-2); font-size: .84rem; }
.result .stamp { margin-top: 10px; padding-top: 8px; color: var(--muted); border-top: 1px dashed rgba(101,114,132,.35); font: .66rem/1.45 var(--font-mono); }
.result .interp { margin: 7px 0; }
.result ul { margin: 6px 0; padding-left: 20px; }
.badge, .tag { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); font-size: .67rem; font-weight: 700; }
.tag { margin: 2px 4px 2px 0; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }

.heat-table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: .77rem; }
.heat-table th, .heat-table td { padding: 8px 6px; color: #fff; border: 2px solid var(--paper); text-align: center; font-weight: 700; }
.heat-table th { background: var(--ink-2); }
.heat-low { background: #2e7d32; }
.heat-mod { background: #f9a825; color: #18200d !important; }
.heat-high { background: #ef6c00; }
.heat-vh { background: #c62828; }
.heat-active { outline: 3px solid white; outline-offset: -3px; box-shadow: 0 0 0 3px var(--navy); }

.search-input { font-size: .95rem; }
.log-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.log-row:last-child { border-bottom: 0; }
.log-row .ts { white-space: nowrap; color: var(--muted); font: .68rem/1.4 var(--font-mono); }
.log-row .calc { color: var(--navy); font-weight: 700; }
.log-row .val { color: var(--ink-2); }
.patient-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.patient-bar select { width: auto; min-width: 170px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.spacer { height: 8px; }

.bottombar { display: none; }

@media (min-width: 1060px) {
  .drawer { transform: translateX(0); }
  .drawer-scrim, #menuBtn, .drawer > .drawer-head { display: none !important; }
  .main { width: min(1120px, calc(100% - var(--drawer-w) - 48px)); margin-left: calc(var(--drawer-w) + max(24px, (100vw - var(--drawer-w) - 1120px) / 2)); margin-right: 24px; }
}

@media (max-width: 1059px) {
  :root { --bar-h: 70px; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding: 0 16px; }
  .brand { min-width: 210px; }
  .global-search { grid-column: 2; }
  .home-workspace { grid-template-columns: 1fr; }
  .continue-panel { box-shadow: var(--shadow-1); }
  .workflow-list { grid-template-columns: repeat(2, 1fr); }
  .workflow-item:nth-child(2) { border-right: 0; }
  .workflow-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(var(--bot-h) + env(safe-area-inset-bottom, 0)); font-size: 14px; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .brand { min-width: 0; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-title { font-size: 1.05rem; }
  .brand-sub, .global-search, .pill-btn-link, .net-badge { display: none; }
  .topbar-actions { justify-self: end; }
  .main { width: calc(100% - 28px); padding: 28px 0 36px; }
  .home-hero { display: block; margin-bottom: 26px; }
  .home-hero h1 { font-size: 2.15rem; }
  .home-hero p { font-size: .8rem; }
  .session-cta { margin-top: 18px; }
  .quick-list { grid-template-columns: 1fr 1fr; }
  .quick-item:nth-child(2) { border-right: 0; }
  .quick-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .domain-panel, .continue-panel, .workflow-panel { padding: 15px; }
  .panel-heading h2, .continue-panel > h2 { font-size: 1.2rem; }
  .workflow-list { grid-template-columns: 1fr; }
  .workflow-item, .workflow-item:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-item:last-child { border-bottom: 0; }
  .card-head { flex-direction: column; }
  .calc-row { grid-template-columns: 1fr; gap: 4px; }
  .calc-row .tier { display: none; }
  .bottombar { position: fixed; inset: auto 0 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--bot-h); padding-bottom: env(safe-area-inset-bottom, 0); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); }
  .bb-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .65rem; font-weight: 650; }
  .bb-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .bb-item.active { color: var(--teal); }
}

@media (max-width: 430px) {
  .topbar { padding: 0 10px; }
  .quick-list { grid-template-columns: 1fr; }
  .quick-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-item:last-child { border-bottom: 0; }
  .domain-copy small { white-space: normal; }
  .domain-row { grid-template-columns: 4px minmax(0, 1fr) auto 18px; gap: 10px; }
  .panel-heading a { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 auto; }
  .result .primary { font-size: 1.5rem; }
}

@media print {
  body { padding: 0; background: #fff; color: #000; font-size: 11pt; }
  .topbar, .bottombar, .drawer, .drawer-scrim, .actions, .btn { display: none !important; }
  .main { width: 100%; max-width: none; margin: 0; padding: 8mm; }
  .card { break-inside: avoid; box-shadow: none; border-color: #aaa; }
  h1, h2, h3 { color: #000; }
  .result { background: #fff !important; border: 1px solid #888; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
