.calculator-shell,
.calculator-shell * { box-sizing: border-box; }

.calculator-shell {
  --shell-ink: #172033;
  --shell-muted: #64748b;
  --shell-line: #e2e8f0;
  --shell-green: #16a34a;
  --shell-green-dark: #166534;
  position: relative;
  z-index: 1000;
  width: 100%;
  color: var(--shell-ink);
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--shell-line);
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.calculator-shell__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1280px;
  min-height: 80px;
  margin: 0 auto;
  padding: 10px clamp(16px, 2.5vw, 32px);
}

.calculator-shell__brand {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  color: var(--shell-ink);
  text-decoration: none;
}

.calculator-shell__brand-mark { position: relative; display: grid; width: 56px; height: 56px; place-items: center; transform: translateY(-2px); }
.calculator-shell__brand-mark::before { position: absolute; inset: 0; border-radius: 50%; background: #10b981; opacity: .18; filter: blur(12px); content: ""; }
.calculator-shell__brand img { position: relative; width: 56px; height: 56px; object-fit: contain; }
.calculator-shell__brand-copy { display: flex; height: 56px; flex-direction: column; justify-content: center; line-height: .86; }
.calculator-shell__brand strong,
.calculator-shell__brand small { font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.calculator-shell__brand small { margin-top: 3px; color: #ef4444; }

.calculator-shell__desktop { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.calculator-shell__link,
.calculator-shell__dropdown > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  color: #475569;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.calculator-shell__dropdown > summary::-webkit-details-marker { display: none; }
.calculator-shell__link:hover,
.calculator-shell__link:focus-visible,
.calculator-shell__dropdown > summary:hover,
.calculator-shell__dropdown > summary:focus-visible,
.calculator-shell__dropdown[open] > summary { color: var(--shell-green-dark); background: #f0fdf4; outline: none; }
.calculator-shell__dropdown { position: relative; }
.calculator-shell__dropdown > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.calculator-shell__dropdown[open] > summary::after { transform: rotate(225deg) translate(-2px,-1px); }
.calculator-shell__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  grid-template-columns: 1fr;
  width: min(340px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--shell-line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 24px 56px rgba(15,23,42,.18);
}
.calculator-shell__panel--wide { grid-template-columns: repeat(3, minmax(180px, 1fr)); width: min(680px, calc(100vw - 32px)); }
.calculator-shell__panel a { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 10px; border-radius: 11px; color: #334155; font-size: 13px; font-weight: 700; text-decoration: none; }
.calculator-shell__panel a:hover,
.calculator-shell__panel a:focus-visible { color: var(--shell-green-dark); background: #f0fdf4; outline: 2px solid #86efac; outline-offset: -2px; }
.calculator-shell__panel i { width: 26px; font-size: 18px; font-style: normal; text-align: center; }
.calculator-shell__mobile-toggle { display: none; margin-left: auto; width: 48px; min-width: 48px; height: 48px; padding: 8px; border: 0; border-radius: 12px; color: #475569; background: transparent; cursor: pointer; }
.calculator-shell__mobile-toggle:hover,
.calculator-shell__mobile-toggle:focus-visible { background: #f1f5f9; outline: none; }
.calculator-shell__mobile-toggle span { display: inline-grid; gap: 4px; vertical-align: middle; }
.calculator-shell__mobile-toggle i { display: block; width: 18px; height: 2px; border-radius: 3px; background: currentColor; }
.calculator-shell__drawer { display: none; }

.calculator-shell-footer { padding: 28px 18px; color: #cbd5e1; background: #172033; font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
.calculator-shell-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1200px; margin: 0 auto; }
.calculator-shell-footer a { color: white; font-weight: 700; text-decoration: none; }
.calculator-shell-footer a:hover,
.calculator-shell-footer a:focus-visible { text-decoration: underline; outline: none; }
.calculator-shell-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

@media (max-width: 1279px) {
  .calculator-shell__desktop { display: none; }
  .calculator-shell__mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .calculator-shell__drawer {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(15,23,42,.48);
    transition: opacity .18s ease, visibility .18s ease;
  }
  .calculator-shell__drawer[data-open="true"] { visibility: visible; opacity: 1; }
  .calculator-shell__drawer-panel {
    position: absolute;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    width: min(440px, 92vw);
    padding: 0 16px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: white;
    transform: translateX(100%);
    transition: transform .22s ease;
  }
  .calculator-shell__drawer[data-open="true"] .calculator-shell__drawer-panel { transform: translateX(0); }
  .calculator-shell__drawer-head { position: sticky; top: 0; z-index: 2; display: grid; min-height: 88px; grid-template-columns: 56px minmax(0,1fr) 56px; align-items: center; gap: 8px; margin: 0 -16px; padding: 10px 12px; border-bottom: 1px solid var(--shell-line); background: rgba(255,255,255,.97); }
  .calculator-shell__drawer-spacer { width: 56px; height: 56px; }
  .calculator-shell__drawer-brand { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 8px; color: #0f172a; text-decoration: none; }
  .calculator-shell__drawer-brand img { width: 56px; height: 56px; flex: 0 0 auto; object-fit: contain; }
  .calculator-shell__drawer-brand span { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.02; }
  .calculator-shell__drawer-brand strong,
  .calculator-shell__drawer-brand small { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
  .calculator-shell__drawer-brand small { margin-top: 2px; color: #ef4444; }
  .calculator-shell__drawer-close { width: 56px; height: 56px; border: 0; border-radius: 12px; color: #64748b; background: transparent; font-size: 28px; cursor: pointer; }
  .calculator-shell__drawer-close:hover,
  .calculator-shell__drawer-close:focus-visible { background: #f1f5f9; outline: none; }
  .calculator-shell__drawer-nav { display: grid; padding-top: 8px; }
  .calculator-shell__mobile-section { border-bottom: 1px solid var(--shell-line); }
  .calculator-shell__mobile-section > summary { display: flex; min-height: 55px; align-items: center; justify-content: space-between; padding: 12px 2px; color: #1e293b; font-size: 16px; font-weight: 750; cursor: pointer; list-style: none; }
  .calculator-shell__mobile-section > summary::-webkit-details-marker { display: none; }
  .calculator-shell__mobile-section > summary::after { width: 8px; height: 8px; margin-right: 8px; border: solid #94a3b8; border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg); transition: transform .18s ease; }
  .calculator-shell__mobile-section[open] > summary { color: #166534; }
  .calculator-shell__mobile-section[open] > summary::after { transform: rotate(225deg); }
  .calculator-shell__mobile-links { display: grid; padding: 0 0 12px; }
  .calculator-shell__mobile-links a { display: flex; min-height: 52px; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; color: #334155; font-size: 14px; font-weight: 650; text-decoration: none; }
  .calculator-shell__mobile-links i { width: 26px; font-size: 18px; font-style: normal; text-align: center; }
  .calculator-shell__drawer-nav a { text-decoration: none; }
  .calculator-shell__drawer-nav a:hover,
  .calculator-shell__drawer-nav a:focus-visible { color: var(--shell-green-dark); background: #f0fdf4; outline: 2px solid #86efac; outline-offset: -2px; }
  body.calculator-shell-lock { overflow: hidden; }
}

@media (max-width: 420px) {
  .calculator-shell__bar { gap: 10px; min-height: 72px; padding: 8px 12px; }
  .calculator-shell__brand-mark { width: 52px; height: 52px; }
  .calculator-shell__brand img { width: 52px; height: 52px; }
  .calculator-shell__brand-copy { height: 52px; }
  .calculator-shell__brand strong,
  .calculator-shell__brand small { font-size: 18px; }
  .calculator-shell-footer__inner { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .calculator-shell__drawer,
  .calculator-shell__drawer-panel { transition: none; }
}
