/* Page frame: the ORCA site header (same look as orcaai.co.il), the tool's title bar with
   its section tabs, the step bar, footer. */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.sitehead {
  position: sticky; top: 0; z-index: 6; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.sitehead .row { max-width: 1160px; margin: 0 auto; padding: 0 22px; height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.1rem; font-weight: 800; letter-spacing: .14em; }
.brand img { width: 34px; height: 34px; }
.sitenav { display: flex; gap: 6px; }
.sitenav a { text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: 15px; color: #3f5266; transition: background .2s, color .2s; }
.sitenav a:hover { background: var(--soft2); color: var(--ink); }
.sitenav a[aria-current] { color: var(--ink); font-weight: 700; }
.sitehead .demo { justify-self: end; text-decoration: none; padding: 9px 20px; font-size: 15px; white-space: nowrap; box-shadow: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  max-width: 1280px; width: 100%; margin: 0 auto; padding: 26px 28px 4px;
  display: flex; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap;
}
.topbar .titles { min-width: 0; }
.topbar .kicker { margin: 0 0 4px; color: var(--accent); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; }
.topbar h1 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.topbar .pagesub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.topbar .chips { margin-inline-start: auto; }

/* the tool's sections: a segmented control under the title */
.navlist { flex-basis: 100%; display: flex; gap: 4px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--soft2); border-radius: 12px; }
.navlist::-webkit-scrollbar { display: none; }
.navitem {
  border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: 9px; white-space: nowrap; transition: background .18s, color .18s, box-shadow .18s;
}
.navitem:hover { color: var(--ink); }
.navitem.active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(11, 31, 51, .12); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 28px; width: 100%; }

/* calculator steps: only the active step's cards are shown */
#panel-calc > [data-step] { display: none; }
#panel-calc > [data-step].is-active { display: block; animation: stepin .22s ease-out both; }
#panel-calc > [data-step].is-active + [data-step].is-active { animation-delay: .04s; }
@keyframes stepin { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { #panel-calc > [data-step].is-active { animation: none; } }

/* step bar: the step tabs + the export menu, one sticky row */
.stepbar {
  display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); position: sticky; top: var(--tb); z-index: 4;
}

.subtabs {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  flex: 1; min-width: 0; padding: 0;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  flex: none; scroll-snap-align: center; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  background: transparent; color: var(--ink); border: 0; border-radius: 12px;
  padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .18s, color .18s;
}
.subtabs button:hover { background: var(--chip); }
.subtabs .sn { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--soft2); color: var(--muted); font-size: 12px; font-weight: 800; }
.subtabs button[aria-selected=true] { background: var(--ink); color: #fff; }
.subtabs button[aria-selected=true] .sn { background: var(--accent); color: #fff; }

.exportbar { position: relative; flex: none; }
.exportbar > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 700; color: var(--teal-d); background: var(--chip); transition: background .18s;
}
.exportbar > summary::before, .exportbar[open] > summary::before { content: "⤓"; font-size: 15px; }
.exportbar > summary:hover, .exportbar[open] > summary { background: #d5ecef; }
.exportrow {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 320px; z-index: 10;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(11, 31, 51, .35);
  animation: stepin .16s ease-out both;
}
.exportrow select { flex: 1 1 100% !important; }
.exportrow .btn { flex: 1; padding-inline: 10px; }

/* prev / next at the end of each step */
.stepnav { display: flex; gap: 10px; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.stepnav .next { margin-inline-start: auto; }
.exportrow select { width: auto; min-width: 170px; flex: 1 1 170px; }
.exportrow .btn { min-height: 42px; }

.sitefoot {
  max-width: 1280px; width: 100%; margin: auto auto 0; padding: 22px 30px 34px;
  color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: space-between; border-top: 1px solid var(--line);
}
.sitefoot a { color: var(--muted); }
.sitefoot nav { display: flex; gap: 14px; flex-wrap: wrap; }

@media print {
  .sitehead, .navlist, .stepbar, .stepnav, .filebox, .actions, #settingsCard { display: none; }
  body { background: #fff; }
  .wrap { padding: 0; }
}
