/* Product presentation. Platform structure stays shared; each product module
   chooses the palette, geometry and working-surface details that belong to its
   subject instead of inheriting a generic dashboard theme. */

.product { --product-ink: #102a43; --product-paper: #f7fafc; --product-signal: #d97706; }
.product [hidden], .workspace-nav[hidden] { display: none !important; }

.product-hero {
  position: relative;
  min-height: clamp(14rem, 26vw, 21rem);
  margin: 0 0 clamp(1.25rem, 3vw, 2.25rem);
  overflow: hidden;
  border-radius: clamp(.35rem, 1.6vw, 1.1rem);
  isolation: isolate;
  background: var(--product-ink);
  color: #fff;
  box-shadow: 0 1.5rem 4rem rgba(8, 18, 28, .22);
}

.product-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(4, 15, 25, .92) 0%, rgba(4, 15, 25, .66) 38%, rgba(4, 15, 25, .08) 72%);
}

.product-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-hero-copy {
  display: flex;
  min-height: inherit;
  width: min(40rem, 76%);
  padding: clamp(1.5rem, 4vw, 3rem);
  flex-direction: column;
  justify-content: flex-end;
}

.product-hero .hero-title {
  max-width: 16ch;
  margin: 1rem 0 .65rem;
  color: #fff;
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  line-height: 1;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.product-hero .hero-excerpt {
  max-width: 50ch;
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.55;
}

/* A focused calculator is entered to answer a question, so its image behaves
   as a masthead rather than delaying the result behind another landing page. */
.product[data-tool] .product-hero { min-height: clamp(11rem, 19vw, 15rem); }
.product[data-tool] .product-hero-copy { padding-block: 1.25rem; }
.product[data-tool] .product-hero .hero-title { font-size: clamp(1.8rem, 3.5vw, 3rem); }

.product-mark { width: 4rem; height: 4rem; border-radius: 1rem; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.25); }
.product-hero-toggle {
  width: fit-content;
  margin: 1rem 0 0;
  padding: .35rem .1rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.product-hero-toggle:focus-visible { outline: 3px solid var(--product-signal); outline-offset: .25rem; }

/* A returning planner is a work surface, not a repeated marketing page. */
.product[data-hero-compact] .product-hero { min-height: 8.5rem; }
.product[data-hero-compact] .product-hero-copy {
  min-height: 8.5rem;
  width: min(100%, 56rem);
  padding: 1rem 1.35rem;
  justify-content: center;
}
.product[data-hero-compact] .product-mark { width: 2.4rem; height: 2.4rem; border-radius: .55rem; }
.product[data-hero-compact] .hero-title {
  max-width: 28ch;
  margin: .4rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.05;
}
.product[data-hero-compact] .product-hero-details { display: none; }
.product[data-hero-compact] .product-hero-toggle { margin-top: .45rem; }

.product-hero-plain { min-height: auto; color: var(--text); background: var(--surface); box-shadow: none; }
.product-hero-plain::after { display: none; }
.product-hero-plain .product-hero-copy { width: auto; min-height: auto; padding: 1.5rem; }
.product-hero-plain .hero-title { color: var(--text); }
.product-hero-plain .hero-excerpt { color: var(--muted); }

/* The tab strip borrows the logic of dividers in a field notebook: one
   continuous rule, with the current section marked by the product's own
   signal colour. It stays visible while the working surface changes. */
.workspace-nav {
  position: sticky;
  top: .5rem;
  z-index: 20;
  margin: 0 0 1.15rem;
  padding: .25rem .35rem 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--product-ink));
  border-radius: .55rem;
  background: color-mix(in srgb, var(--bg) 94%, var(--product-paper));
  box-shadow: 0 .45rem 1.3rem rgba(8, 18, 28, .09);
}
.workspace-tabs {
  display: flex;
  gap: .15rem;
  overflow-x: auto;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}
.workspace-tabs [role="tab"] {
  flex: 0 0 auto;
  min-height: 2.8rem;
  padding: .55rem .8rem .65rem;
  border: 0;
  border-radius: .3rem .3rem 0 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.workspace-tabs [role="tab"]:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.workspace-tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  box-shadow: inset 0 -.23rem 0 var(--product-signal);
}
.workspace-tabs [role="tab"]:focus-visible { outline: 3px solid var(--product-signal); outline-offset: -3px; }
.workspace-panel { margin-top: 0; scroll-margin-top: 5rem; }
.workspace-panel:focus { outline: none; }
.workspace-panel:focus-visible { outline: 3px solid var(--product-signal); outline-offset: .35rem; }

.local-save-status {
  display: flex;
  gap: .45rem;
  align-items: baseline;
  margin: -.35rem 0 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.local-save-account {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .7rem;
}

.local-save-account .field-help {
  margin: 0;
}
.local-save-status strong { color: var(--text); }

/* Embedded calculators answer first and keep their edit controls close. */
.workspace-panel[data-calculator] .spec-table { max-width: 52rem; margin-bottom: .75rem; }
.workspace-panel[data-calculator] .pane-form { max-width: 58rem; }
.workspace-panel[data-calculator] .tool-inputs { gap: .8rem 1rem; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.tool-grid > li { min-width: 0; }
.tool-grid .tool-card {
  display: grid;
  grid-template-rows: 13rem 1fr;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: .75rem;
}
.product-card-image { width: 100%; height: 13rem; object-fit: cover; }
.product-card-body, .tool-grid .tool-card-body { position: relative; padding: 1.2rem 1.25rem 1.35rem; }
.product-card-mark { position: absolute; top: -2rem; right: 1rem; width: 3.75rem; height: 3.75rem; border-radius: .9rem; box-shadow: 0 .35rem 1rem rgba(0,0,0,.23); }
.tool-grid .tool-card-title { padding-right: 3.5rem; }
.tool-grid .tool-card-answer { margin-top: auto; }

.tool-form .input,
.tool-form select.input,
.pane .input {
  min-height: 3rem;
  padding: .72rem .85rem;
  border: 1.5px solid color-mix(in srgb, var(--border) 76%, var(--product-ink));
  border-radius: .45rem;
  background: color-mix(in srgb, var(--bg) 94%, var(--product-paper));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.tool-form .input:hover, .pane .input:hover { border-color: color-mix(in srgb, var(--border) 45%, var(--product-ink)); }
.tool-form .input:focus-visible, .pane .input:focus-visible {
  border-color: var(--product-signal);
  outline: 3px solid color-mix(in srgb, var(--product-signal) 28%, transparent);
  outline-offset: 1px;
}

.vault-backup { margin-top: 3rem; padding: 1.2rem 1.35rem; border-top: 1px solid var(--border); }

@media (max-width: 44rem) {
  .product-hero { min-height: 18rem; }
  .product-hero::after { background: linear-gradient(0deg, rgba(4,15,25,.94) 0%, rgba(4,15,25,.48) 58%, rgba(4,15,25,.08) 100%); }
  .product-hero-copy { width: auto; padding: 1.5rem; justify-content: flex-end; }
  .product-hero .hero-title { font-size: clamp(2.15rem, 12vw, 3.8rem); }
  .product[data-hero-compact] .product-hero,
  .product[data-hero-compact] .product-hero-copy { min-height: 7.75rem; }
  .product[data-hero-compact] .hero-title { font-size: clamp(1.55rem, 7vw, 2.15rem); }
  .workspace-nav { top: .25rem; margin-inline: -.25rem; }
  .workspace-tabs [role="tab"] { min-height: 2.65rem; padding-inline: .7rem; }
  .local-save-status { display: block; }
  .local-save-status span { display: block; margin-top: .2rem; }
  .tool-grid .tool-card { grid-template-rows: 11rem 1fr; }
  .product-card-image { height: 11rem; }
}

@media (prefers-reduced-motion: reduce) {
  .product * { scroll-behavior: auto !important; }
}
