  :root{--ui-scale:0.85;color-scheme:dark light;font-family:"Inter","Noto Sans",system-ui,sans-serif;line-height:1.5;font-size:calc(16px * var(--ui-scale));background:radial-gradient(circle at top,rgba(59,130,246,0.35),transparent 55%),radial-gradient(circle at bottom,rgba(45,212,191,0.25),transparent 60%),linear-gradient(160deg,#0f172a,#1e293b 45%,#111827 100%);background-attachment:fixed;color:#e2e8f0;--primary-color:#3b82f6;--primary-color-strong:#2563eb;--neutral-gray:rgba(148,163,184,0.25);--accent-yellow:#fbbf24;--right-lobe-color:#f87171;--left-lobe-color:#60a5fa;--surface-base:rgba(15,23,42,0.82);--surface-raised:rgba(30,41,59,0.85);--surface-border:rgba(148,163,184,0.35);--surface-shadow:0 20px 60px rgba(15,23,42,0.45);--range-default-color:#38bdf8;--range-alert-color:#f87171;--range-track-shade:rgba(148,163,184,0.35)}
  ::selection{background:rgba(56,189,248,0.25);color:#f8fafc}
  body{margin:0;min-height:100vh;display:flex;justify-content:center;align-items:flex-start;padding:clamp(calc(var(--ui-scale) * 16px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 20px));background:inherit;color:inherit}
  .app-container{width:min(calc(var(--ui-scale) * 1600px),100%);max-width:calc(var(--ui-scale) * 1600px);position:relative}
  .app{width:100%;display:flex;flex-direction:column;gap:calc(var(--ui-scale) * 16px);padding:clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px));border-radius:calc(var(--ui-scale) * 20px);background:var(--surface-base);border:1px solid var(--surface-border);box-shadow:var(--surface-shadow);backdrop-filter:blur(14px);position:relative}
  @media (max-width:900px){
    body{padding:calc(var(--ui-scale) * 12px)}
    .app{padding:calc(var(--ui-scale) * 16px);border-radius:calc(var(--ui-scale) * 16px)}
  }
  .app-header{position:sticky;top:0;z-index:100;display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;width:calc(100% + 2 * clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px)));min-height:4.8em;padding:12px;gap:20px;background:var(--surface-base);border-bottom:1px solid var(--surface-border);backdrop-filter:blur(14px);margin-left:calc(-1 * clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px)));margin-right:calc(-1 * clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px)));margin-top:calc(-1 * clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px)));padding-left:clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px));padding-right:clamp(calc(var(--ui-scale) * 20px),calc(3vw * var(--ui-scale)),calc(var(--ui-scale) * 28px));border-radius:calc(var(--ui-scale) * 20px) calc(var(--ui-scale) * 20px) 0 0}
  .app-brand{display:flex;align-items:center;gap:12px;flex-shrink:0;text-decoration:none;cursor:pointer;transition:opacity 0.2s ease}
  .app-brand:hover{opacity:0.8}
  .logo-img{height:3.4em;width:auto;display:block}
  .app-header h1{flex:1 1 auto;margin:0;text-align:left;padding:0 0 0 25px}
  .help-menu-container{position:relative;display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex-shrink:0}
  .header-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
  .header-actions input[type="text"]{border-radius:10px;font-size:.9rem;padding:8px 14px;background:rgba(15,23,42,0.65);color:#f8fafc;border:1px solid rgba(148,163,184,0.35);min-width:220px;box-shadow:0 1px 2px rgba(15,23,42,0.4) inset}
  .header-actions button{padding:8px 18px;font-size:.9rem;font-weight:600;border-radius:999px;transition:all 0.2s ease;white-space:nowrap}
  .header-actions button.status-display{min-width:160px;padding:8px 20px}
  .header-actions button.status-success{background:linear-gradient(135deg,#16a34a,#15803d);color:#f8fafc;border-color:#16a34a}
  .header-actions button.status-error{background:linear-gradient(135deg,#dc2626,#b91c1c);color:#f8fafc;border-color:#dc2626}
  .header-actions button.status-success:disabled,
  .header-actions button.status-error:disabled{opacity:1;cursor:default}
  .header-divider{border-left:2px solid rgba(203,213,225,0.5);height:28px}
  .help-toggle{background:linear-gradient(135deg,rgba(59,130,246,0.95),rgba(37,99,235,0.9));color:#f8fafc;border-radius:999px;padding:6px 18px;font-size:.9rem;font-weight:600;border:1px solid rgba(148,163,184,0.35);cursor:pointer;transition:all 0.2s ease;box-shadow:0 6px 14px rgba(10,12,18,0.45)}
  .help-toggle:hover{transform:translateY(-2px);box-shadow:0 10px 20px rgba(10,12,18,0.5)}
  .help-toggle:focus-visible{outline:2px solid #38bdf8;outline-offset:2px}
  .help-menu{position:absolute;top:calc(100% + 10px);right:0;max-width:500px;width:clamp(240px,30vw,500px);padding:18px;border-radius:16px;background:rgba(15,23,42,0.96);color:#e2e8f0;box-shadow:0 20px 44px rgba(15,23,42,0.5);border:1px solid var(--surface-border);display:flex;flex-direction:column;gap:12px;z-index:20}
.help-menu[hidden]{display:none}
.help-content{display:flex;flex-direction:column;gap:10px;font-size:.9rem;color:#e2e8f0}
.help-content h3,.help-content h4,.help-content h5{margin:0;color:#f8fafc;font-weight:600}
.help-content p{margin:0;color:#cbd5f5}
.help-content ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px}
.help-content li{margin:0}
.help-close{align-self:flex-end;background:rgba(30,41,59,0.9);color:#f8fafc;border-radius:999px;padding:6px 14px;font-size:.85rem;font-weight:600;border:1px solid rgba(148,163,184,0.35);cursor:pointer;transition:all 0.2s ease;box-shadow:0 6px 14px rgba(15,23,42,0.32)}
.help-close:hover{background:rgba(37,99,235,0.2);border-color:rgba(59,130,246,0.5)}
.help-close:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
  h1{margin:0 0 12px;font-size:clamp(1.6rem,3.5vw,2.2rem);font-weight:700;text-align:center;letter-spacing:-0.01em;color:#f8fafc}
  h2{font-size:clamp(0.95rem,2vw,1.15rem);font-weight:600;letter-spacing:0.08em;text-transform:uppercase;color:rgba(226,232,240,0.85);margin:0 0 12px}
  h3{font-size:0.95rem;font-weight:600;color:#e2e8f0;margin:0}
  h4{font-size:0.9rem;font-weight:600;color:#e2e8f0;margin:0}
  .panel{background:var(--surface-raised);backdrop-filter:blur(12px);border-radius:calc(var(--ui-scale) * 16px);box-shadow:0 8px 20px rgba(15,23,42,0.33);padding:calc(var(--ui-scale) * 14px) calc(var(--ui-scale) * 16px);margin:0 0 calc(var(--ui-scale) * 16px);border:1px solid var(--surface-border);transition:transform 0.2s ease, box-shadow 0.2s ease}
  .panel:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(15,23,42,0.42)}
  .panel.tight{padding:calc(var(--ui-scale) * 12px) calc(var(--ui-scale) * 14px)}
  .app-workflow{display:grid;grid-template-columns:minmax(280px,320px) minmax(0,1fr);gap:16px;align-items:start;margin:0}
  .app-workflow>.panel{margin:0;min-width:0;height:100%;display:flex;flex-direction:column}
  .lobe-bulk-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:8px}
  #lobe-overview-panel{display:flex;flex-direction:column;gap:6px;min-width:0;align-self:stretch;height:100%;min-height:0}
  #lobe-overview-panel .lobe-overview-header{order:1;flex-direction:column;align-items:flex-start;gap:6px;margin-top:0}
  #lobe-overview-panel .lobe-overview-body{order:2;flex:1;display:flex;flex-direction:column;min-height:0}
  #lobe-overview-panel p{margin:0}
  @media (max-width:1200px){
    .app-workflow{grid-template-columns:1fr;margin:0}
    .app-workflow>.panel{margin:0}
    #lobe-overview-panel{position:static;min-height:0}
  }
  .lobe-grid{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0}
  .lobe-card{position:relative;border:1px solid var(--surface-border);border-radius:14px;padding:12px 14px;background:linear-gradient(155deg,rgba(148,163,184,0.08),rgba(15,23,42,0.9));backdrop-filter:blur(10px);box-shadow:0 6px 16px rgba(15,23,42,0.32);transition:transform 0.2s ease,box-shadow 0.2s ease,border-color 0.2s ease}
  .lobe-card:hover{transform:translateY(-2px);box-shadow:0 14px 28px rgba(15,23,42,0.4)}
  .lobe-card[data-lobe="Right"]{margin-top:2px;border-color:rgba(248,113,113,0.55);background:linear-gradient(150deg,rgba(248,113,113,0.3),rgba(248,113,113,0.2))}
  .lobe-card[data-lobe="Right"]:focus-within{border-color:var(--right-lobe-color);box-shadow:0 0 0 3px rgba(248,113,113,0.35),0 20px 40px rgba(15,23,42,0.5)}
  .lobe-card[data-lobe="Isthmus"]{border-color:rgba(196,181,253,0.45);background:linear-gradient(150deg,rgba(196,181,253,0.3),rgba(196,181,253,0.1))}
  .lobe-card[data-lobe="Isthmus"]:focus-within{border-color:#c4b5fd;box-shadow:0 0 0 3px rgba(196,181,253,0.35),0 20px 40px rgba(15,23,42,0.5)}
  .lobe-card[data-lobe="Left"]{border-color:rgba(96,165,250,0.5);background:linear-gradient(150deg,rgba(96,165,250,0.3),rgba(96,165,250,0.1))}
  .lobe-card[data-lobe="Left"]:focus-within{border-color:var(--left-lobe-color);box-shadow:0 0 0 3px rgba(96,165,250,0.35),0 20px 40px rgba(15,23,42,0.5)}
  .lobe-card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0}
  .lobe-card-header h3{margin:0;color:#f8fafc}
  #lobe-overview-panel{position:relative}
  .lobe-card-body{display:flex;flex-direction:column;gap:8px;position:relative}
  .lobe-card[data-disabled="true"]{opacity:.45;filter:grayscale(0.35)}
  .lobe-card h3{margin:0 0 8px}
  .texture-options{display:flex;flex-direction:column;gap:6px;margin-top:8px;margin-bottom:0}
  .texture-options .texture-label{font-weight:600;color:rgba(226,232,240,0.8);font-size:0.85rem}
  .texture-choices{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
  .texture-toggle{border-radius:999px;border:1px solid rgba(148,163,184,0.35);background:rgba(15,23,42,0.6);color:#e2e8f0;padding:4px 10px;font-size:.8rem;font-weight:600;cursor:pointer;transition:all 0.2s ease;line-height:1.2;box-shadow:0 2px 6px rgba(15,23,42,0.3)}
  .texture-toggle:hover{transform:translateY(-1px);box-shadow:0 6px 12px rgba(15,23,42,0.38);border-color:rgba(148,163,184,0.55)}
  .texture-toggle:focus-visible{outline:2px solid rgba(56,189,248,0.6);outline-offset:1px}
  .texture-toggle[aria-pressed="true"]{background:linear-gradient(135deg,var(--primary-color),var(--primary-color-strong));color:#f8fafc;border-color:rgba(59,130,246,0.8);box-shadow:0 4px 10px rgba(10,12,18,0.45)}
  .texture-toggle:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;background:rgba(71,85,105,0.45);color:rgba(226,232,240,0.55);border-color:rgba(148,163,184,0.25)}
  label{display:flex;flex-direction:column;gap:4px}
  label.inline{flex-direction:row;align-items:center;gap:8px}
  input[type="checkbox"]{
    width:18px;
    height:18px;
    border:1px solid rgba(148,163,184,0.4);
    border-radius:4px;
    background:rgba(15,23,42,0.65);
    appearance:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition:all 0.2s ease;
  }
  input[type="checkbox"]:hover{
    border-color:rgba(59,130,246,0.6);
    box-shadow:0 0 0 3px rgba(59,130,246,0.2);
  }
  input[type="checkbox"]:checked::after{
    content:'';
    width:6px;
    height:10px;
    border:2px solid var(--primary-color);
    border-top:none;
    border-left:none;
    transform:translateY(-1px) rotate(45deg);
  }
  input[type="checkbox"]:focus-visible{
    outline:2px solid rgba(56,189,248,0.6);
    outline-offset:1px;
  }
  input[type="checkbox"]:disabled{
    background:rgba(71,85,105,0.4);
    border-color:rgba(148,163,184,0.3);
    cursor:default;
  }
  input[type="checkbox"]:disabled::after{
    border-color:rgba(148,163,184,0.4);
  }
  .dim-grid{display:grid;gap:12px}
  .dim-control{display:flex;flex-direction:column;gap:6px}
  .dim-top{display:flex;justify-content:space-between;align-items:baseline;font-size:.9rem;color:rgba(226,232,240,0.75)}
  .dim-output{font-variant-numeric:tabular-nums;min-width:32px;text-align:center;color:rgba(226,232,240,0.85)}

  .triple-slider{display:flex;flex-direction:column;gap:8px;margin-top:6px}
  .slider-row{display:flex;align-items:center;gap:6px}
  .slider-row[data-slider-wrapper]{padding:2px 0}
  .volume-display{margin-top:4px;font-size:.85rem;color:rgba(226,232,240,0.75);font-variant-numeric:tabular-nums;display:flex;align-items:center;gap:6px;cursor:help;position:relative}
  .volume-label{font-weight:600;color:#f8fafc}
  .volume-value{font-weight:600;color:#e0f2fe}
  .volume-unit{color:rgba(226,232,240,0.6);font-weight:500}
  .volume-display[data-tooltip]::after{
    content:attr(data-tooltip);
    position:absolute;
    bottom:100%;
    left:50%;
    transform:translate(-50%,6px);
    background:rgba(15,23,42,0.95);
    color:#e2e8f0;
    font-size:.75rem;
    font-weight:500;
    padding:6px 10px;
    border-radius:8px;
    border:1px solid rgba(59,130,246,0.45);
    box-shadow:0 10px 22px rgba(15,23,42,0.45);
    opacity:0;
    pointer-events:none;
    white-space:nowrap;
    transition:opacity 0.15s ease, transform 0.15s ease;
    z-index:5;
  }
  .volume-display[data-tooltip]:hover::after{
    opacity:1;
    transform:translate(-50%,-6px);
  }
.lobe-card-body{perspective:1400px;min-height:230px;transition:min-height .25s ease}
.lobe-card[data-view="residual"] .lobe-card-body{min-height:315px}
.lobe-card[data-lobe="Isthmus"] .lobe-card-body{min-height:110px}
.lobe-card[data-lobe="Isthmus"][data-view="residual"] .lobe-card-body{min-height:200px}
  .lobe-card-inner{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1),min-height .25s ease}
.lobe-card[data-view="residual"] .lobe-card-inner{transform:rotateY(180deg)}
.lobe-card-inner.flipping{animation:cardFlip 0.8s cubic-bezier(0.4, 0.0, 0.2, 1)}
.lobe-card-inner.flipping-back{animation:cardFlipBack 0.8s cubic-bezier(0.4, 0.0, 0.2, 1)}
@keyframes cardFlip{
  0%{transform:rotateY(0deg) scale(1)}
  50%{transform:rotateY(90deg) scale(0.95)}
  100%{transform:rotateY(180deg) scale(1)}
}
@keyframes cardFlipBack{
  0%{transform:rotateY(180deg) scale(1)}
  50%{transform:rotateY(90deg) scale(0.95)}
  100%{transform:rotateY(0deg) scale(1)}
}
  .lobe-face{position:absolute;top:0;left:0;width:100%;min-height:100%;backface-visibility:hidden;display:flex;flex-direction:column;gap:12px;padding-bottom:12px}
.lobe-face.lobe-face-front{z-index:2}
.lobe-face.lobe-face-back{transform:rotateY(180deg)}
  .lobe-face-content{display:flex;flex-direction:column;gap:12px;flex:1}
.residual-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:0;background:transparent;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:5}
.residual-overlay[data-visible="true"]{opacity:1;pointer-events:auto}
.residual-overlay-panel{max-width:240px;text-align:center;color:#f8fafc;display:flex;flex-direction:column;gap:12px;padding:14px 18px;background:rgba(15,23,42,.9);border-radius:12px;box-shadow:0 12px 32px rgba(15,23,42,0.35)}
.residual-overlay-panel h4{margin:0;font-size:1.05rem}
.residual-overlay-panel p{margin:0;font-size:.9rem;color:#cbd5f5}
.residual-overlay-actions{display:flex;flex-direction:column;gap:8px}
.residual-overlay-actions .residual-choice{padding:10px 14px;border-radius:8px;border:1px solid rgba(148,163,184,0.35);cursor:pointer;font-weight:600;background:rgba(15,23,42,0.7);color:#e2e8f0;transition:all .2s ease}
.residual-overlay-actions .residual-choice.primary{background:linear-gradient(135deg,var(--primary-color),var(--primary-color-strong));color:#f8fafc;border-color:rgba(59,130,246,0.7);box-shadow:0 6px 14px rgba(10,12,18,0.45)}
.residual-overlay-actions .residual-choice:hover{transform:translateY(-1px);background:rgba(37,99,235,0.25);border-color:rgba(59,130,246,0.5)}
.residual-back{display:flex;flex-direction:column;gap:12px;height:100%}
.residual-back-header{display:flex;align-items:center;gap:12px}
.residual-back-btn{margin-left:auto;padding:4px 12px;font-size:.8rem;border:none;background:rgba(37,99,235,.18);color:#bfdbfe;border-radius:999px;cursor:pointer;font-weight:600;display:inline-flex;align-items:center;gap:4px;transition:all 0.2s ease}
.residual-back-btn:hover{background:rgba(37,99,235,.32);color:#f8fafc}
.residual-back-note{margin:0;font-size:.9rem;color:rgba(226,232,240,0.7)}
.slider-row.is-low input[type="range"].ruler{--range-color:#f97316;--range-fill-color:#f97316;--range-thumb-color:#f97316}
  .slider-row.is-high input[type="range"].ruler{--range-color:#b91c1c;--range-fill-color:#b91c1c;--range-thumb-color:#b91c1c}
  .slider-label{width:28px;font-weight:600;color:rgba(226,232,240,0.75);text-align:center;font-size:.85rem;flex-shrink:0}
  .slider-container{flex:1;display:flex;align-items:center;gap:6px}
  .slider-container input.ruler{flex:1 1 220px}
  .dim-number{width:72px;text-align:right;flex-shrink:0}
  .slider-readout{display:flex;align-items:center;gap:3px}
  .step-btn{width:22px;height:22px;border:1px solid rgba(148,163,184,0.35);border-radius:6px;background:rgba(15,23,42,0.6);color:#e2e8f0;font-weight:700;cursor:pointer;line-height:1;padding:0;font-size:.75rem;display:flex;align-items:center;justify-content:center;transition:all 0.2s ease}
  .step-btn:hover{background:rgba(37,99,235,0.18);border-color:rgba(59,130,246,0.55);transform:translateY(-1px)}
  .step-btn:active{background:rgba(37,99,235,0.28);transform:scale(0.95)}
  .dim-output{font-variant-numeric:tabular-nums;min-width:36px;text-align:center;color:rgba(226,232,240,0.85);font-size:.85rem}

  
  input[type="number"],
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea{
    background:rgba(15,23,42,0.65);
    color:#f8fafc;
    border:1px solid rgba(148,163,184,0.35);
    border-radius:10px;
    padding:6px 10px;
    transition:border-color 0.2s ease, box-shadow 0.2s ease;
  }
  select{padding-right:34px;background-image:linear-gradient(135deg,rgba(148,163,184,0.15),rgba(15,23,42,0.65));background-repeat:no-repeat;background-position:right 8px center;background-size:12px auto}
  input[type="number"]:focus,
  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="tel"]:focus,
  input[type="search"]:focus,
  select:focus,
  textarea:focus{
    border-color:rgba(59,130,246,0.8);
    box-shadow:0 0 0 2px rgba(59,130,246,0.25);
    outline:none;
  }
  input::placeholder,
  textarea::placeholder{color:rgba(148,163,184,0.6)}

input[type="range"].ruler{
  width:100%;
  height:32px;
  margin:0;
  -webkit-appearance:none;
  appearance:none;
  background:transparent;
  position:relative;
  --range-fill-percent:0%;
  --range-color:var(--range-default-color);
  --range-fill-color:var(--range-color);
  --range-thumb-color:var(--range-color);
  --range-track-color:var(--range-track-shade);
  accent-color:var(--range-color);
  transition:all 0.2s ease;
}
input[type="range"].ruler::-webkit-slider-runnable-track{
  width:100%;
  height:6px;
  background:linear-gradient(to right,
    var(--range-fill-color) 0%,
    var(--range-fill-color) var(--range-fill-percent),
    var(--range-track-color) var(--range-fill-percent),
    var(--range-track-color) 100%);
  border-radius:3px;
  position:relative;
}
input[type="range"].ruler::-moz-range-track{
  width:100%;
  height:6px;
  background:var(--range-track-color);
  border-radius:3px;
}
input[type="range"].ruler::-moz-range-progress{
  height:6px;
  background:var(--range-fill-color);
  border-radius:3px;
}
input[type="range"].ruler::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--range-thumb-color);
  cursor:pointer;
  margin-top:-5px;
  border:2px solid #fff;
  box-shadow:0 1px 3px rgba(0,0,0,0.3);
}
input[type="range"].ruler::-moz-range-thumb{
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--range-thumb-color);
  cursor:pointer;
  border:2px solid #fff;
  box-shadow:0 1px 3px rgba(0,0,0,0.3);
}
input[type="range"].ruler::-ms-fill-lower{
  background:var(--range-fill-color);
  border-radius:3px;
}
input[type="range"].ruler::-ms-fill-upper{
  background:var(--range-track-color);
  border-radius:3px;
}
  .slider-ruler-ticks{
    display:flex;
    justify-content:space-between;
    font-size:9px;
    color:rgba(148,163,184,0.6);
    margin-top:2px;
    padding:0 8px;
    user-select:none;
  }
  .slider-ruler-ticks span{font-weight:600}
  button,.button-link{cursor:pointer;border:none;border-radius:18px;background:linear-gradient(135deg,var(--primary-color),var(--primary-color-strong));color:#f8fafc;padding:10px 16px;font-size:.95rem;transition:transform 0.2s ease,box-shadow 0.2s ease,font-size 0.2s ease;font-weight:600;box-shadow:0 6px 14px rgba(10,12,18,0.45)}
  button.secondary{background:rgba(59,130,246,0.12);color:#bfdbfe;box-shadow:none;border:1px solid rgba(148,163,184,0.35)}
  button:hover{transform:translateY(-2px);box-shadow:0 10px 20px rgba(10,12,18,0.5)}
  button:active{transform:scale(0.98)}
  button.bulk-button{padding:4px 12px;font-size:.82rem;border-radius:999px;background:rgba(59,130,246,0.18);color:#bfdbfe;border:1px solid rgba(59,130,246,0.35);font-weight:600;line-height:1;box-shadow:none}
  button.bulk-button.secondary{background:rgba(15,23,42,0.65);color:rgba(226,232,240,0.75);border-color:rgba(148,163,184,0.35)}
  button.bulk-button:hover{background:rgba(59,130,246,0.26);border-color:rgba(59,130,246,0.5)}
  button.bulk-button:focus-visible{outline:2px solid rgba(56,189,248,0.6);outline-offset:1px}
  .flex{display:flex;gap:12px;flex-wrap:wrap}
  .flex>*{flex:1 1 68px}
  .thyroid-map{
    width:100%;
    max-width:var(--map-w, 560px);
    min-width:320px;
    height:auto;
    background:linear-gradient(145deg,rgba(30,41,59,0.85),rgba(15,23,42,0.75));
    backdrop-filter:blur(10px);
    border:1px solid rgba(148,163,184,0.35);
    border-radius:18px;
    box-shadow:0 18px 40px rgba(15,23,42,0.45);
    user-select:none;
    -webkit-user-select:none;
    transition:all 0.2s ease;
  }
  .thyroid-map *{user-select:none;-webkit-user-select:none}
  .thyroid-region{fill:transparent;stroke:transparent;stroke-width:1;cursor:pointer;transition:transform 0.2s ease;opacity:1;pointer-events:auto}
  .thyroid-region[data-region-value]{fill:transparent;stroke:transparent}
  .thyroid-region:hover,
  .thyroid-region.selected{fill:transparent;stroke:transparent;opacity:1}
  .map-nodule{position:relative}
  .map-nodule-circle{fill:#fbbf24;stroke:#b45309;stroke-width:2;cursor:pointer;transition:filter 0.2s ease,stroke-width 0.2s ease;filter:drop-shadow(0 2px 4px rgba(180,83,9,0.3));pointer-events:none}
  .map-nodule-circle:hover{filter:drop-shadow(0 3px 6px rgba(180,83,9,0.5));stroke-width:3}
  .map-nodule.selected .map-nodule-circle{fill:#34d399;stroke:#047857;filter:drop-shadow(0 3px 6px rgba(4,120,87,0.4));stroke-width:3}
  .map-nodule-drag-zone{fill:transparent;cursor:grab;pointer-events:all}
  .map-nodule-drag-zone:active{cursor:grabbing}
  .map-nodule-resize-ring{fill:transparent;stroke:transparent;stroke-width:8;cursor:nwse-resize;pointer-events:none}
  .map-nodule.selected .map-nodule-resize-ring{pointer-events:all;stroke:transparent}
  .map-nodule-resize-ring:hover{stroke:transparent;stroke-width:10}
  .map-nodule-label{font-size:.2rem;font-weight:700;fill:#0f172a;user-select:none;pointer-events:none;text-anchor:middle;dominant-baseline:middle;alignment-baseline:middle}
  .map-nodule-preview{fill:rgba(251,191,36,.2);stroke:#2563eb;stroke-width:2;stroke-dasharray:6 4;pointer-events:none}
  .map-nodule-preview-label{font-size:.7rem;font-weight:600;fill:#0f172a;pointer-events:none;user-select:none;-webkit-user-select:none}
  .thyroid-art{pointer-events:none}
  #svg-left-lobe.surgically-absent{opacity:0}
  #svg-right-lobe.surgically-absent{opacity:0}
  #svg-isthmus.surgically-absent{opacity:0}
  #svg-left-lobe,#svg-right-lobe,#svg-isthmus{transition:opacity 1.0s ease}
  #svg-residual-left,#svg-residual-right,#svg-residual-isthmus{opacity:0;transition:opacity 0.8s ease, transform 0.8s ease}
  #svg-residual-left.visible,#svg-residual-right.visible,#svg-residual-isthmus.visible{opacity:1!important}
  .map-location-display{
    position:absolute;
    top:12px;
    left:50%;
    transform:translateX(-50%);
    font-size:.95rem;
    font-weight:600;
    color:#f8fafc;
    background:rgba(15,23,42,.75);
    padding:4px 12px;
    border-radius:999px;
    border:1px solid rgba(148,163,184,0.35);
    box-shadow:0 12px 30px rgba(15,23,42,.45);
    pointer-events:none;
    user-select:none;
    z-index:2;
  }
  .map-location-display span{
    font-weight:700;
    color:#38bdf8;
  }
  .nodule-detail{flex:1;min-width:200px;border:1px solid var(--surface-border);border-radius:14px;padding:12px;background:rgba(15,23,42,0.75);backdrop-filter:blur(12px);box-shadow:0 8px 18px rgba(15,23,42,.4);display:flex;flex-direction:column;gap:10px;transition:transform 0.2s ease,box-shadow 0.2s ease}
  .nodule-detail[data-has-selection="false"] #nodule-detail-body{display:none}
  .nodule-detail[data-has-selection="false"] #nodule-detail-empty{display:block}
  #nodule-detail-empty{display:none;color:rgba(226,232,240,0.6);font-size:.95rem}
  #nodule-detail-body{display:flex;flex-direction:column;gap:0px}
  .detail-subhead{margin:4px 0 0;font-size:.85rem;font-weight:600;color:rgba(148,163,184,0.75)}
  .detail-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
  .detail-header button{flex:0 0 auto}
  .section-title{margin:0 0 0.5rem;font-size:clamp(0.95rem,2vw,1.15rem);font-weight:600;letter-spacing:0.08em;text-transform:uppercase;color:rgba(226,232,240,0.85)}
  .section-subtitle{margin:0 0 0.75rem;color:rgba(226,232,240,0.78);font-size:.85rem}
  .nodule-measurements,
  .nodule-descriptors,
  .nodule-prior,
  .nodule-flags-container{border:1px solid var(--surface-border);border-radius:14px;padding:12px;background:rgba(15,23,42,0.7);backdrop-filter:blur(10px);box-shadow:0 8px 18px rgba(15,23,42,.36);flex:1;display:flex;flex-direction:column;transition:transform 0.2s ease,box-shadow 0.2s ease}
  .nodule-measurements:hover,
  .nodule-descriptors:hover,
  .nodule-prior:hover,
  .nodule-flags-container:hover{transform:translateY(-1px);box-shadow:0 12px 22px rgba(15,23,42,.42)}
  .nodule-tirads-section{padding:14px;background:rgba(37,99,235,0.18);border:1px solid rgba(59,130,246,0.35);border-radius:14px}
  .nodule-basic-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
  .nodule-descriptors .descriptor-grid{display:grid;gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
  .descriptor-grid-column{display:flex;flex-direction:column;gap:10px}
  .descriptor-label{display:flex;align-items:center;justify-content:space-between;gap:6px}
  .descriptor-points{color:#38bdf8;font-weight:600;font-size:.85rem}
  .descriptor-presets{display:flex;justify-content:center;gap:2px;flex-wrap:wrap;margin:30px 0 0}
  .descriptor-presets button{
    border:1px solid rgba(148,163,184,0.35);
    background:rgba(15,23,42,0.6);
    color:rgba(226,232,240,0.85);
    font-size:.82rem;
    padding:5px 14px;
    border-radius:999px;
    cursor:pointer;
    transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease,background .2s ease;
    box-shadow:0 4px 12px rgba(15,23,42,0.32);
  }
  .descriptor-presets button:not(.is-active):hover{transform:translateY(-1px);box-shadow:0 8px 16px rgba(15,23,42,0.38);border-color:rgba(59,130,246,0.45)}
  .descriptor-presets button:not(.is-active):active{transform:scale(0.97)}
  .descriptor-presets button.is-active{
    background:linear-gradient(135deg,var(--primary-color),var(--primary-color-strong));
    border-color:rgba(59,130,246,0.7);
    color:#f8fafc;
    box-shadow:0 8px 16px rgba(10,12,18,0.5);
  }
  .descriptor-presets button.is-active:hover{
    border-color:rgba(56,189,248,0.7);
  }
  .conclusion-options-list{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
  .nodule-descriptors-cell,
  .nodule-flags-cell,
  .nodule-tirads-cell,
  .nodule-conclusion-cell{display:flex;align-items:stretch;justify-content:center}
  .nodule-descriptors,
  .nodule-flags-container,
  .nodule-detail,
  .tirads-category-card{height:100%;width:100%}
  .tirads-category-card{
    border:1px solid var(--surface-border);
    border-radius:16px;
    padding:16px;
    background:rgba(15,23,42,0.75);
    backdrop-filter:blur(12px);
    box-shadow:0 14px 28px rgba(15,23,42,.4);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:12px;
    text-align:center;
    transition:transform 0.2s ease,box-shadow 0.2s ease,border-color 0.2s ease;
  }
  .tirads-category-card:hover{transform:translateY(-2px);box-shadow:0 18px 36px rgba(15,23,42,.48)}
  .tirads-category-title{margin:0;font-size:1rem;color:#f8fafc}
  .tirads-category-badge{
    font-size:2.4rem;
    font-weight:700;
    line-height:1;
    color:#38bdf8;
    letter-spacing:0.04em;
    text-shadow:0 4px 16px rgba(56,189,248,0.35);
  }
  .tirads-category-card[data-status="none"]{background:rgba(15,23,42,0.7);border-color:rgba(148,163,184,0.3)}
  .tirads-category-card[data-status="none"] .tirads-category-badge{color:rgba(148,163,184,0.6);text-shadow:none}
  .tirads-category-card[data-status="incomplete"]{background:linear-gradient(150deg,rgba(251,191,36,0.22),rgba(15,23,42,0.8));border-color:rgba(251,191,36,0.5)}
  .tirads-category-card[data-status="incomplete"] .tirads-category-badge{color:#fbbf24;text-shadow:0 4px 18px rgba(251,191,36,0.45)}
  .tirads-category-card[data-category="TR1"]{background:linear-gradient(150deg,rgba(134,239,172,0.25),rgba(15,23,42,0.8));border-color:rgba(134,239,172,0.45)}
  .tirads-category-card[data-category="TR1"] .tirads-category-badge{color:#4ade80;text-shadow:0 4px 18px rgba(74,222,128,0.35)}
  .tirads-category-card[data-category="TR2"]{background:linear-gradient(150deg,rgba(250,204,21,0.25),rgba(15,23,42,0.8));border-color:rgba(250,204,21,0.45)}
  .tirads-category-card[data-category="TR2"] .tirads-category-badge{color:#facc15;text-shadow:0 4px 18px rgba(250,204,21,0.35)}
  .tirads-category-card[data-category="TR3"]{background:linear-gradient(150deg,rgba(249,115,22,0.22),rgba(15,23,42,0.8));border-color:rgba(249,115,22,0.45)}
  .tirads-category-card[data-category="TR3"] .tirads-category-badge{color:#fb923c;text-shadow:0 4px 18px rgba(251,146,60,0.35)}
  .tirads-category-card[data-category="TR4"]{background:linear-gradient(150deg,rgba(251,113,133,0.24),rgba(15,23,42,0.8));border-color:rgba(251,113,133,0.55)}
  .tirads-category-card[data-category="TR4"] .tirads-category-badge{color:#f97316;text-shadow:0 4px 18px rgba(249,115,22,0.4)}
  .tirads-category-card[data-category="TR5"]{background:linear-gradient(150deg,rgba(248,113,113,0.24),rgba(15,23,42,0.8));border-color:rgba(248,113,113,0.55)}
  .tirads-category-card[data-category="TR5"] .tirads-category-badge{color:#f87171;text-shadow:0 4px 18px rgba(248,113,113,0.38)}
  .tirads-category-note{margin:0;font-size:.9rem;color:rgba(226,232,240,0.7)}
  @media (max-width:900px){
    .nodule-grid{
      grid-template-columns:1fr;
      grid-template-areas:
        "unplaced"
        "map"
        "meas"
        "desc"
        "flags"
        "tirads"
        "conclusion";
    }
  }
  @media (max-width:600px){
    .nodule-descriptors .descriptor-grid{grid-template-columns:1fr}
  }
  .nodule-flags{display:grid;gap:6px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
  .nodule-detail .status{font-size:.85rem;color:rgba(226,232,240,0.7)}
  .nodule-detail .status.error{color:#b91c1c}
  .nodule-detail .status.warning{color:#b45309}
  .nodule-stats{margin-top:16px;background:linear-gradient(150deg,rgba(34,197,94,0.18),rgba(15,23,42,0.82));border:1px solid rgba(34,197,94,0.4);border-radius:14px;padding:16px 18px;box-shadow:0 10px 22px rgba(15,23,42,0.32)}
  .nodule-stats[data-has-selection="false"] .nodule-stats-body{display:none}
  .nodule-stats[data-has-selection="false"] .nodule-stats-empty{display:block}
  .nodule-stats-empty{display:none;color:rgba(190,242,100,0.85);font-size:.9rem}
  .nodule-stats-body{display:grid;gap:6px;font-size:.95rem;color:rgba(226,232,240,0.85)}
  .nodule-stats-body strong{color:#bbf7d0}
  .outputs pre{background:rgba(15,23,42,0.85);color:#e2e8f0;padding:16px;border-radius:18px;white-space:pre-wrap;border:1px solid var(--surface-border);box-shadow:0 10px 22px rgba(15,23,42,0.35)}
  .copyable-output{position:static;margin-bottom:20px}
  .copyable-output:last-child{margin-bottom:0}
  .copyable-output pre{position:relative}
  .copyable-output pre [data-copy-text]{display:block;white-space:pre-wrap;font-family:inherit;font-size:inherit;line-height:inherit}
  .copy-btn{position:absolute;top:8px;right:8px;padding:6px 12px;background:linear-gradient(135deg,var(--primary-color),var(--primary-color-strong));color:#f8fafc;border:none;border-radius:999px;cursor:pointer;font-size:.85rem;transition:transform .15s ease,box-shadow .15s ease;box-shadow:0 5px 12px rgba(10,12,18,0.45)}
  .copy-btn:hover{transform:translateY(-1px);box-shadow:0 8px 16px rgba(10,12,18,0.5)}
  .copy-btn:focus-visible{outline:2px solid rgba(56,189,248,0.6);outline-offset:2px}
  .copy-btn[data-state="copied"]{background:linear-gradient(135deg,#22c55e,#16a34a);box-shadow:0 8px 16px rgba(10,12,18,0.5)}
  .outputs-actions{display:flex;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
  .outputs-actions label{display:flex;align-items:center;gap:6px;font-size:.9rem;color:rgba(226,232,240,0.75);flex-direction:row}
  .outputs-actions input[type="text"]{padding:6px 10px;border:1px solid rgba(148,163,184,0.35);border-radius:10px;font-size:.95rem;min-width:180px;background:rgba(15,23,42,0.65);color:#f8fafc}
  .webhook-status,
  .storage-status{font-size:.9rem;color:rgba(226,232,240,0.65)}
  .webhook-status[data-status="error"],
  .storage-status[data-status="error"]{color:#b91c1c}
  .webhook-status[data-status="success"],
  .storage-status[data-status="success"]{color:#22c55e}
  .validation-list{display:flex;flex-direction:column;gap:6px;margin-top:6px}
  .validation-pill{display:flex;align-items:center;padding:6px 10px;border:1px solid rgba(148,163,184,0.35);border-radius:8px;background:linear-gradient(135deg,rgba(148,163,184,0.12),rgba(15,23,42,0.8));color:#e2e8f0;font-weight:500;font-size:0.75rem;line-height:1.3;text-align:left}
  .validation-list.has-items .validation-pill{border-color:rgba(220,38,38,0.5);background:linear-gradient(135deg,rgba(220,38,38,0.15),rgba(127,29,29,0.1));color:#fca5a5}
  .validation-list.has-items .validation-pill-nodule{border-color:rgba(251,146,60,0.5);background:linear-gradient(135deg,rgba(251,146,60,0.15),rgba(154,52,18,0.1));color:#fdba74}
  .validation-pill-empty{opacity:0.6;font-style:italic}
  .checklist-section{margin-top:16px;padding-top:16px;border-top:1px solid rgba(148,163,184,0.25)}
  .checklist-section h3{font-size:0.9rem;margin:0 0 8px 0;color:#e2e8f0}
  .checklist-group{margin-bottom:12px}
  .checklist-group:last-child{margin-bottom:0}
  .checklist-section strong{font-size:0.85rem;color:#94a3b8;display:block;margin-bottom:4px}
  .conclusion-row{display:flex;gap:20px;align-items:stretch;flex-wrap:wrap;margin:20px 0}
  .conclusion-row>.panel{flex:1 1 320px;margin:0}
  .report-row{display:grid;grid-template-columns:minmax(280px,400px) 1fr;gap:20px;align-items:start;margin-top:20px}
  .report-row>.panel{margin:0}


.nodule-grid{
  --map-height: calc(var(--ui-scale) * 445px);
  --map-width: calc(var(--map-height) * 360 / 240);

  display:grid;
  grid-template-columns:minmax(calc(var(--ui-scale) * 140px), calc(var(--ui-scale) * 160px)) minmax(0, min(var(--map-width), 100%)) minmax(calc(var(--ui-scale) * 320px), 1fr);
  grid-template-rows:minmax(var(--map-height), auto) auto auto;
  grid-template-areas:
    "unplaced map    meas"
    "unplaced desc   flags"
    "unplaced tirads conclusion";
  gap:calc(var(--ui-scale) * 12px);
  align-items:start;
  transition:grid-template-rows 0.3s ease;
}
.nodule-grid > *{
  transition:all 0.3s ease;
}


.nodule-map-cell{
  grid-area: map;
  display:flex;
  justify-content:center;
  align-items:center;
  min-width:0;
  align-self:stretch;
  position:relative;
  min-height:0;
  transition:all 0.3s ease;
}
.nodule-map-cell .thyroid-map{
  height:100%;
  width:auto;
  max-width:100%;
  max-height:100%;
  display:block;
  flex-shrink:0;
  transition:transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.nodule-unplaced-cell{
  grid-area: unplaced;
  display:flex;
  flex-direction:column;
  align-self:stretch;
  min-height:0;
}

.nodule-unplaced-container{
  flex:1;
  display:flex;
  flex-direction:column;
  border:1px solid var(--surface-border);
  border-radius:calc(var(--ui-scale) * 18px);
  padding:calc(var(--ui-scale) * 18px);
  background:rgba(15,23,42,0.7);
  backdrop-filter:blur(10px);
  box-shadow:0 12px 24px rgba(15,23,42,.36);
  min-height:0;
  overflow:hidden;
}

.nodule-unplaced-container h3{
  margin:0 0 12px 0;
  font-size:0.95rem;
  color:#e2e8f0;
}

.nodule-unplaced-list{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:6px;
  overflow-y:auto;
  min-height:0;
  padding-right:4px;
}

.nodule-list-section{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.nodule-list-section-title{
  font-size:0.8rem;
  font-weight:600;
  color:rgba(226,232,240,0.6);
  text-transform:uppercase;
  letter-spacing:0.05em;
  margin:8px 0 4px 0;
}

.nodule-list-section:first-child .nodule-list-section-title{
  margin-top:0;
}

.nodule-unplaced-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:8px 6px;
  border:2px dashed rgba(251,191,36,0.5);
  border-radius:10px;
  background:linear-gradient(135deg,rgba(251,191,36,0.15),rgba(180,83,9,0.1));
  color:#fbbf24;
  font-weight:600;
  font-size:0.75rem;
  cursor:grab;
  transition:all 0.2s ease;
  box-shadow:0 4px 8px rgba(15,23,42,0.3);
  user-select:none;
  text-align:center;
  gap:2px;
  line-height:1.2;
}

.nodule-unplaced-item-label{
  font-size:0.75rem;
  font-weight:600;
}

.nodule-unplaced-item-dims{
  font-size:0.7rem;
  font-weight:500;
  opacity:0.85;
}

.nodule-unplaced-item:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 12px rgba(15,23,42,0.4);
  border-color:rgba(251,191,36,0.7);
  background:linear-gradient(135deg,rgba(251,191,36,0.25),rgba(180,83,9,0.15));
}

.nodule-unplaced-item:active{
  cursor:grabbing;
}

.nodule-pill{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border:1px solid rgba(148,163,184,0.35);
  border-radius:8px;
  background:linear-gradient(135deg,rgba(148,163,184,0.12),rgba(15,23,42,0.8));
  color:#e2e8f0;
  font-weight:500;
  font-size:0.8rem;
  cursor:pointer;
  transition:all 0.2s ease;
  user-select:none;
  text-align:center;
}

.nodule-pill:hover{
  border-color:rgba(148,163,184,0.5);
  background:linear-gradient(135deg,rgba(148,163,184,0.18),rgba(15,23,42,0.85));
}

.nodule-pill.selected{
  border-color:rgba(52,211,153,0.6);
  background:linear-gradient(135deg,rgba(52,211,153,0.25),rgba(4,120,87,0.15));
}

.nodule-pill-label{
  font-size:0.75rem;
  line-height:1.3;
  color:#cbd5e1;
}

.nodule-pill.selected .nodule-pill-label{
  color:#f0fdf4;
  font-weight:600;
}

.nodule-unplaced-empty{
  color:rgba(226,232,240,0.5);
  font-size:0.8rem;
  text-align:center;
  padding:12px;
}


.nodule-measurements-cell{
  grid-area: meas;
  display:flex;
  flex-direction:column;
  gap:calc(var(--ui-scale) * 8px);
  align-self:start;
  min-width:calc(var(--ui-scale) * 240px);
  width:clamp(calc(var(--ui-scale) * 320px), calc(38vw * var(--ui-scale)), calc(var(--ui-scale) * 480px));
  max-width:100%;
  justify-self:start;
  justify-content:flex-start;
}


.nodule-measurements,
.nodule-prior{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  height:auto;
  width:100%;
  border:1px solid var(--surface-border);
  border-radius:calc(var(--ui-scale) * 14px);
  padding:calc(var(--ui-scale) * 12px);
  background:rgba(15,23,42,0.7);
  backdrop-filter:blur(10px);
  box-shadow:0 8px 18px rgba(15,23,42,.36);
  overflow:auto;
  transition:transform 0.2s ease,box-shadow 0.2s ease;
}
.nodule-measurements:hover,
.nodule-prior:hover{transform:translateY(-1px);box-shadow:0 12px 22px rgba(15,23,42,.42)}


.nodule-conclusion-cell{grid-area:conclusion;display:flex;justify-content:center}
.nodule-conclusion-cell .tirads-category-card{width:100%}
*,*::before,*::after{box-sizing:border-box;}

.floating-status-bar{
  display:none;
  z-index:999;
  pointer-events:none;
  background:rgba(15,23,42,0.9);
  border:1px solid rgba(148,163,184,0.3);
  border-radius:calc(var(--ui-scale) * 16px);
  padding:calc(var(--ui-scale) * 10px) calc(var(--ui-scale) * 16px);
  box-shadow:0 18px 36px rgba(15,23,42,0.45);
}
.floating-status-bar[hidden]{
  display:none !important;
}
.nodule-context-menu{
  position:absolute;
  display:none;
  flex-direction:column;
  gap:calc(var(--ui-scale) * 4px);
  background:rgba(15,23,42,0.95);
  color:#e2e8f0;
  border-radius:calc(var(--ui-scale) * 12px);
  border:1px solid var(--surface-border);
  box-shadow:0 22px 44px rgba(15,23,42,0.55);
  padding:calc(var(--ui-scale) * 8px);
  z-index:1200;
  min-width:calc(var(--ui-scale) * 180px);
}
.nodule-context-menu[aria-hidden="true"]{
  display:none;
}
.nodule-context-menu button{
  border:none;
  background:transparent;
  color:inherit;
  text-align:left;
  padding:calc(var(--ui-scale) * 8px) calc(var(--ui-scale) * 12px);
  border-radius:calc(var(--ui-scale) * 8px);
  font-size:.9rem;
  font-weight:600;
  cursor:pointer;
  transition:background .15s ease,color .15s ease;
}
.nodule-context-menu button:hover{
  background:rgba(148,163,184,0.18);
}
.nodule-context-menu button.danger{
  color:#fda4af;
}
.nodule-context-menu button.danger:hover{
  background:rgba(248,113,113,0.18);
}
.nodule-context-menu [data-menu-view]{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nodule-context-options{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nodule-context-options button.is-current{
  cursor:default;
  background:rgba(148,163,184,0.24);
  color:#f8fafc;
  opacity:0.9;
}
.nodule-context-options button[disabled]{
  opacity:0.55;
  cursor:default;
}
.nodule-context-options button[disabled]:hover{
  background:rgba(148,163,184,0.18);
}
.nodule-context-menu button.back{
  margin-top:6px;
  justify-content:center;
  background:rgba(148,163,184,0.18);
  color:#e2e8f0;
}
.nodule-context-menu button.back:hover{
  background:rgba(148,163,184,0.28);
}
.floating-status-message{
  background:rgba(255,255,255,0.95);
  backdrop-filter:blur(8px);
  padding:6px 16px;
  border-radius:20px;
  font-size:.85rem;
  font-weight:600;
  color:#1f2937;
  box-shadow:0 2px 8px rgba(0,0,0,.1);
  opacity:0;
  transition:opacity 0.2s ease;
}
.floating-status-message:not(:empty){
  opacity:1;
}
.floating-status-message[data-status="error"]{
  color:#b91c1c;
}
.floating-status-message[data-status="success"]{
  color:#166534;
}
@media (max-width:1024px){
  .app-header{
    flex-direction:column;
    align-items:stretch;
    gap:12px;
    padding:12px;
    width:calc(100% + 2 * calc(var(--ui-scale) * 16px));
    margin-left:calc(-1 * calc(var(--ui-scale) * 16px));
    margin-right:calc(-1 * calc(var(--ui-scale) * 16px));
    margin-top:calc(-1 * calc(var(--ui-scale) * 16px));
    padding-left:calc(var(--ui-scale) * 16px);
    padding-right:calc(var(--ui-scale) * 16px);
    border-radius:calc(var(--ui-scale) * 16px) calc(var(--ui-scale) * 16px) 0 0;
  }
  .app-brand{
    order:1;
  }
  .app-header h1{
    order:2;
    text-align:center;
  }
  .help-menu-container{
    order:3;
    align-items:stretch;
  }
  .header-actions{
    flex-direction:column;
    gap:8px;
  }
  .header-actions input[type="text"]{
    width:100%;
    min-width:auto;
  }
  .header-actions button{
    width:100%;
  }
  .header-divider{
    width:100%;
    height:2px;
    border-left:none;
    border-top:2px solid rgba(203,213,225,0.5);
  }
  .report-row{
    grid-template-columns:1fr;
  }
}

/* Footer styling for thyroid app */
.app-footer{
  margin-top:10px;
  text-align:center;
  font-size:0.85rem;
  color:rgba(226,232,240,0.6);
  border-radius:10px;
  background:transparent;
  user-select:none;
}
.app-footer a{color:inherit;text-decoration:underline}

/* Live Transcription Display */
.live-transcription {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 8px 16px;
  max-height: 60px;
  overflow: hidden;
}

.transcription-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.transcription-label {
  font-weight: 600;
  color: rgba(96, 165, 250, 0.9);
  flex-shrink: 0;
}

.transcription-text {
  color: rgba(226, 232, 240, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin Panel */
.admin-panel {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
}

.admin-panel[hidden] {
  display: none;
}

.admin-panel-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  width: min(600px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55);
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 16px;
}

.admin-panel-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: rgba(226, 232, 240, 0.95);
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(148, 163, 184, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.admin-section h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: rgba(226, 232, 240, 0.9);
}

.admin-description {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.7);
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.85);
}

.admin-field input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.5);
  color: rgba(226, 232, 240, 0.95);
  font-size: 0.9rem;
}

.admin-field input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.admin-status {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.85rem;
}

.admin-status.success {
  background: rgba(34, 197, 94, 0.15);
  color: rgba(134, 239, 172, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.admin-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: rgba(252, 165, 165, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-error {
  padding: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: rgba(252, 165, 165, 0.9);
  font-size: 0.85rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-db-debug {
  padding: 12px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  color: rgba(134, 239, 172, 0.95);
  font-size: 0.85rem;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-db-debug.error {
  background: rgba(239, 68, 68, 0.1);
  color: rgba(252, 165, 165, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-status-message {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 8px;
}

.admin-status-message.success {
  background: rgba(34, 197, 94, 0.15);
  color: rgba(134, 239, 172, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.admin-status-message.error {
  background: rgba(239, 68, 68, 0.15);
  color: rgba(252, 165, 165, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-status-message:empty {
  display: none;
}

.admin-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-color-strong));
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Add margin to standalone buttons not in admin-actions */
form .admin-btn:not(.admin-actions .admin-btn) {
  margin-top: 12px;
}

.admin-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-btn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
}

.admin-btn.danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

