:root {
  color-scheme: light;
  --background: #f4f8ff;
  --foreground: #07152e;
  --surface: #ffffff;
  --surface-soft: #eaf2ff;
  --muted: #5e6d85;
  --border: #d9e5f5;
  --blue: #0969f0;
  --blue-strong: #004fc7;
  --blue-soft: #dcebff;
  --card: #ffffff;
  --card-foreground: #07152e;
  --popover: #ffffff;
  --popover-foreground: #07152e;
  --primary: #0969f0;
  --primary-foreground: #ffffff;
  --secondary: #eaf2ff;
  --secondary-foreground: #07152e;
  --muted-foreground: #5e6d85;
  --accent: #dcebff;
  --accent-foreground: #004fc7;
  --destructive: #dc2626;
  --input: #cbd9ed;
  --ring: #0969f0;
  --radius: 1rem;
}

.dark {
  color-scheme: dark;
  --background: #050a12;
  --foreground: #f5f8ff;
  --surface: #0c1421;
  --surface-soft: #111f33;
  --muted: #98a6bc;
  --border: #1d304a;
  --blue: #2f83ff;
  --blue-strong: #5b9cff;
  --blue-soft: #10284c;
  --card: #0c1421;
  --card-foreground: #f5f8ff;
  --popover: #0c1421;
  --popover-foreground: #f5f8ff;
  --primary: #2f83ff;
  --primary-foreground: #ffffff;
  --secondary: #111f33;
  --secondary-foreground: #f5f8ff;
  --muted-foreground: #98a6bc;
  --accent: #10284c;
  --accent-foreground: #dbeaff;
  --input: #263b57;
  --ring: #5b9cff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 180ms ease, color 180ms ease;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 0 5vw;
  background: color-mix(in srgb, var(--background) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
}
.brand strong { color: var(--blue); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--blue);
  border-radius: 10px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--blue) 30%, transparent);
}
.brand-mark svg { width: 19px; }
.topbar nav { display: flex; gap: 28px; font-size: 14px; font-weight: 700; color: var(--muted); }
.topbar nav a:hover { color: var(--foreground); }

.theme-control {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.theme-control svg { width: 15px; height: 15px; }
.theme-switch[data-state="checked"] { background: var(--blue); }

.featured {
  position: relative;
  isolation: isolate;
  min-height: 460px;
  margin: 28px 4vw 0;
  padding: clamp(36px, 6vw, 78px);
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 38%, rgba(64, 144, 255, 0.48), transparent 25%),
    linear-gradient(112deg, #061124 0%, #0b2f69 58%, #0872f6 100%);
  border-radius: 32px;
  box-shadow: 0 24px 80px rgba(10, 73, 154, 0.22);
  color: white;
}
.featured::after {
  content: "";
  position: absolute;
  inset: auto -5% -46% 38%;
  z-index: -1;
  width: 68%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255,255,255,.04), 0 0 0 90px rgba(255,255,255,.03);
}
.featured-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent, black 55%);
}
.featured-copy { max-width: 700px; }
.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
}
.featured-label svg { width: 15px; }
.featured h1 {
  margin: 24px 0 16px;
  max-width: 680px;
  font-size: clamp(46px, 7vw, 90px);
  line-height: .9;
  letter-spacing: -.065em;
}
.featured h1 strong { color: #80b7ff; }
.featured-copy > p { max-width: 600px; margin: 0; color: rgba(255,255,255,.76); font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.featured-actions { display: flex; align-items: center; gap: 18px; margin-top: 30px; }
.featured-actions > span { color: rgba(255,255,255,.62); font-size: 13px; font-weight: 700; }
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  color: #08152d;
  background: white;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 14px 35px rgba(0,0,0,.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.primary-button svg { width: 17px; }
.featured-stat {
  position: absolute;
  right: clamp(30px, 7vw, 110px);
  bottom: 48px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  gap: 0 14px;
  opacity: .92;
}
.featured-stat > span {
  grid-column: 1 / -1;
  font-size: clamp(60px, 8vw, 118px);
  font-weight: 900;
  line-height: .72;
  letter-spacing: -.09em;
  color: rgba(255,255,255,.12);
  -webkit-text-stroke: 1px rgba(255,255,255,.55);
}
.featured-stat p { margin: 14px 0 0; font-size: 14px; font-weight: 900; letter-spacing: .16em; }
.featured-stat svg { width: 26px; margin-bottom: 3px; }

.catalog { padding: 62px 0 80px; }
.library-section + .library-section { margin-top: 68px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 5vw 20px;
}
.section-heading h2 { margin: 0; font-size: clamp(24px, 3vw, 36px); line-height: 1; letter-spacing: -.04em; }
.section-heading p { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.section-heading > span { flex: none; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.library-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(262px, 310px);
  gap: 18px;
  padding: 0 5vw 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.library-card {
  display: flex;
  min-height: 545px;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  scroll-snap-align: start;
  box-shadow: 0 12px 45px rgba(17, 60, 112, .09);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.library-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--blue) 50%, var(--border)); box-shadow: 0 22px 60px rgba(17, 83, 166, .17); }
.cover-art {
  position: relative;
  isolation: isolate;
  min-height: 330px;
  padding: 18px;
  overflow: hidden;
  color: white;
  background-position: center;
  background-size: cover;
}
.art-model { background-image: url("/assets/workstation.webp"); }
.art-texture { background-image: url("/assets/textures.webp"); }
.art-technical { background-image: url("/assets/blueprint.webp"); }
.art-measure { background-image: url("/assets/tools-measure.webp"); background-position: 54% center; }
.art-budget { background-image: url("/assets/tools-budget.webp"); background-position: 48% center; }
.art-performance { background-image: url("/assets/tools-performance.webp"); background-position: 44% center; }
.cover-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(3,11,25,.04), rgba(3,11,25,.14) 35%, rgba(3,11,25,.96));
}
.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .32;
  background-image: linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, black, transparent 72%);
}
.art-texture::before { background: linear-gradient(180deg, rgba(4,11,23,.04), rgba(4,11,23,.18) 44%, rgba(4,11,23,.97)); }
.art-technical::before { background: linear-gradient(180deg, rgba(1,9,23,.02), rgba(1,9,23,.18) 42%, rgba(1,9,23,.97)); }
.cover-topline { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.cover-topline > span, .cover-topline > strong { padding: 7px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(2,12,28,.56); backdrop-filter: blur(8px); }
.cover-topline > strong { color: #d8eaff; }
.cover-copy { position: absolute; inset: auto 20px 22px; }
.cover-number { display: block; margin-bottom: 3px; color: #5ba1ff; font-size: clamp(50px, 6vw, 76px); font-weight: 950; line-height: .9; letter-spacing: -.07em; text-shadow: 0 10px 36px rgba(0,54,135,.65); }
.cover-copy h3 { margin: 0; max-width: 240px; font-size: 25px; line-height: .94; text-transform: uppercase; letter-spacing: -.055em; }
.cover-rule { display: block; width: 42px; height: 3px; margin: 14px 0 8px; background: #2c83ff; }
.cover-copy p { margin: 0; font-size: 10px; font-weight: 900; letter-spacing: .22em; }
.card-info { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: 16px; padding: 18px; }
.card-info h3 { margin: 0; font-size: 16px; line-height: 1.2; letter-spacing: -.02em; }
.card-info p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 43px;
  padding: 0 14px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  transition: background 160ms ease, transform 160ms ease;
}
.card-action:hover { background: var(--blue-strong); transform: translateY(-1px); }
.card-action svg { width: 16px; height: 16px; }
.card-action.pending { color: var(--muted); background: var(--surface-soft); cursor: not-allowed; }

.guide-dialog {
  display: block;
  width: min(760px, calc(100vw - 24px));
  max-width: 760px;
  max-height: min(820px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 26px 90px rgba(0,0,0,.28);
}
.guide-dialog [data-slot="dialog-header"] { padding: 30px 32px 22px; background: linear-gradient(135deg, var(--blue-soft), transparent); border-bottom: 1px solid var(--border); }
.guide-dialog [data-slot="dialog-title"] { font-size: clamp(25px, 4vw, 38px); line-height: 1; letter-spacing: -.045em; }
.guide-dialog [data-slot="dialog-description"] { max-width: 620px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.dialog-kicker { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.guide-content { max-height: calc(100dvh - 210px); padding: 22px 32px 34px; overflow-y: auto; }
.guide-content section + section { margin-top: 28px; }
.guide-content h3 { margin: 0 0 12px; font-size: 16px; }
.check-list { display: grid; gap: 8px; }
.check-list label { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 11px; padding: 11px 12px; color: var(--muted); background: var(--surface-soft); border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 13px; line-height: 1.45; }
.check-list label:has(input:checked) { color: var(--foreground); border-color: color-mix(in srgb, var(--blue) 36%, transparent); }
.check-list input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { display: grid; place-items: center; width: 21px; height: 21px; color: transparent; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.custom-check svg { width: 13px; }
.check-list input:checked + .custom-check { color: white; background: var(--blue); border-color: var(--blue); }

.tool-dialog {
  display: block;
  width: min(920px, calc(100vw - 24px));
  max-width: 920px;
  max-height: min(900px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 26px 90px rgba(0,0,0,.28);
}
.tool-dialog [data-slot="dialog-header"] {
  position: relative;
  padding: 28px 32px 22px 96px;
  text-align: left;
  background: linear-gradient(135deg, var(--blue-soft), transparent);
  border-bottom: 1px solid var(--border);
}
.tool-dialog [data-slot="dialog-title"] { font-size: clamp(25px, 4vw, 38px); line-height: 1; letter-spacing: -.045em; }
.tool-dialog [data-slot="dialog-description"] { color: var(--muted); font-size: 14px; line-height: 1.5; }
.tool-icon {
  position: absolute;
  left: 32px;
  top: 31px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: white;
  background: var(--blue);
  border-radius: 14px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--blue) 28%, transparent);
}
.tool-icon svg { width: 23px; }
.tool-body { display: flex; max-height: calc(100dvh - 170px); flex-direction: column; }
.tool-scroll { padding: 26px 32px; overflow-y: auto; }
.tool-note { margin: 0; padding: 13px 32px 15px; color: var(--muted); background: var(--surface-soft); border-top: 1px solid var(--border); font-size: 11px; line-height: 1.45; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-field { display: grid; gap: 7px; min-width: 0; }
.tool-field > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.tool-field input, .tool-field textarea, .input-shell {
  width: 100%;
  color: var(--foreground);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  font: inherit;
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.tool-field > input { min-height: 45px; padding: 0 12px; }
.tool-field textarea { min-height: 86px; padding: 12px; resize: vertical; }
.tool-field input:focus, .tool-field textarea:focus, .input-shell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); }
.input-shell { display: flex; align-items: center; min-height: 45px; overflow: hidden; }
.input-shell input { min-width: 0; height: 43px; padding: 0 4px 0 12px; background: transparent; border: 0; box-shadow: none; }
.input-shell input:focus { box-shadow: none; }
.input-shell em { flex: none; padding: 0 11px; color: var(--muted); font-size: 11px; font-style: normal; font-weight: 800; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.result-tile { display: grid; gap: 7px; min-height: 96px; align-content: center; padding: 16px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; }
.result-tile span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.result-tile strong { font-size: clamp(18px, 3vw, 26px); letter-spacing: -.04em; }
.result-tile.highlight { color: white; background: linear-gradient(135deg, var(--blue), var(--blue-strong)); border-color: transparent; }
.result-tile.highlight span { color: rgba(255,255,255,.72); }
.unit-toggle { display: inline-flex; gap: 4px; margin-top: 14px; padding: 4px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; }
.unit-toggle button { min-width: 52px; height: 34px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-weight: 850; }
.unit-toggle button.active { color: white; background: var(--blue); }
.scale-grid { grid-template-columns: repeat(2, minmax(0, 220px)); }
.performance-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.performance-layout .tool-grid { grid-template-columns: repeat(2, 1fr); }
.switch-list { display: grid; align-content: start; gap: 9px; }
.switch-list label { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; font-size: 12px; font-weight: 750; }
.score-panel { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 18px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 16px; }
.score-ring { --score: 270deg; position: relative; display: grid; place-items: center; flex: none; width: 92px; height: 92px; background: conic-gradient(var(--blue) var(--score), var(--border) 0); border-radius: 50%; }
.score-ring::before { content: ""; position: absolute; inset: 8px; background: var(--surface); border-radius: 50%; }
.score-ring strong, .score-ring span { position: relative; }
.score-ring strong { align-self: end; font-size: 27px; line-height: 1; }
.score-ring span { align-self: start; color: var(--muted); font-size: 10px; }
.score-panel h3 { margin: 3px 0 5px; font-size: 20px; letter-spacing: -.03em; }
.score-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.score-label { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.tool-tips { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.tool-tips li { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; }
.tool-tips svg { flex: none; width: 15px; color: var(--blue); }
.briefing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.briefing-grid .wide { grid-column: 1 / -1; }
.brief-output { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; margin-top: 20px; padding: 16px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; }
.brief-output pre { margin: 0; overflow: auto; color: var(--muted); font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.brief-output button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; color: white; background: var(--blue); border: 0; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 850; white-space: nowrap; }
.brief-output button svg { width: 15px; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 5vw; padding: 34px 0 42px; color: var(--muted); border-top: 1px solid var(--border); font-size: 12px; }
.brand.compact { color: var(--foreground); font-size: 16px; }
.brand.compact .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.brand.compact .brand-mark svg { width: 15px; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 68px; padding: 0 18px; }
  .topbar nav { display: none; }
  .featured { min-height: 500px; margin: 14px 12px 0; padding: 34px 24px; border-radius: 24px; }
  .featured-stat { right: 24px; bottom: 36px; }
  .featured-copy > p { max-width: 480px; }
  .catalog { padding-top: 48px; }
  .section-heading { margin-inline: 18px; }
  .library-row { grid-auto-columns: minmax(245px, 76vw); padding-inline: 18px; }
  .library-card { min-height: 520px; }
  footer { margin-inline: 18px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .brand { font-size: 17px; }
  .brand-mark { width: 31px; height: 31px; }
  .theme-control { gap: 6px; height: 38px; padding-inline: 9px; }
  .featured { min-height: 540px; }
  .featured h1 { margin-top: 20px; font-size: clamp(48px, 14vw, 68px); }
  .featured-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .featured-stat { bottom: 30px; }
  .featured-stat > span { font-size: 70px; }
  .section-heading { align-items: flex-start; }
  .section-heading > span { display: none; }
  .guide-dialog [data-slot="dialog-header"] { padding: 25px 22px 18px; text-align: left; }
  .guide-content { padding: 18px 16px 26px; }
  .tool-dialog [data-slot="dialog-header"] { padding: 24px 46px 18px 22px; }
  .tool-icon { position: static; width: 40px; height: 40px; margin-bottom: 4px; }
  .tool-scroll { padding: 18px 16px; }
  .tool-note { padding-inline: 16px; }
  .tool-grid, .performance-layout, .performance-layout .tool-grid, .briefing-grid { grid-template-columns: 1fr; }
  .scale-grid { grid-template-columns: 1fr 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .result-tile { min-height: 82px; }
  .briefing-grid .wide { grid-column: auto; }
  .brief-output { grid-template-columns: 1fr; }
  .brief-output button { justify-content: center; }
  footer { align-items: flex-start; flex-direction: column; }
}

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

.static-theme-button {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}
.static-theme-button svg { width: 17px; }
.static-theme-button .moon-icon { display: block; }
.static-theme-button .sun-icon { display: none; }
.dark .static-theme-button .moon-icon { display: none; }
.dark .static-theme-button .sun-icon { display: block; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 18px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(0, 6, 18, .72);
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.open { display: block; }
.modal-panel {
  position: relative;
  width: min(920px, 100%);
  margin: 0 auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(0,0,0,.4);
}
.modal-panel.guide-size { max-width: 760px; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--foreground);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.modal-header {
  position: relative;
  padding: 30px 58px 23px 32px;
  text-align: left;
  background: linear-gradient(135deg, var(--blue-soft), transparent);
  border-bottom: 1px solid var(--border);
}
.modal-header.with-icon { padding-left: 96px; }
.modal-header h2 { margin: 6px 0 8px; font-size: clamp(25px, 4vw, 38px); line-height: 1; letter-spacing: -.045em; }
.modal-header p { max-width: 680px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.modal-icon {
  position: absolute;
  left: 32px;
  top: 29px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: white;
  background: var(--blue);
  border-radius: 14px;
}
.modal-icon svg { width: 23px; }
.static-guide-content { padding: 22px 32px 34px; }
.static-guide-content section + section { margin-top: 28px; }
.static-guide-content h3 { margin: 0 0 12px; font-size: 16px; }
.tool-dialog-static .tool-body { max-height: none; }
.card-action[data-open] { border: 0; }
.cover-number { font-variant-numeric: tabular-nums; }
.brand-mark svg { height: 19px; }

@media (max-width: 560px) {
  .modal-overlay { padding: 8px; }
  .modal-panel { border-radius: 19px; }
  .modal-header, .modal-header.with-icon { padding: 24px 48px 18px 20px; }
  .modal-icon { position: static; width: 40px; height: 40px; margin-bottom: 8px; }
  .static-guide-content { padding: 18px 16px 26px; }
}
