:root {
  color-scheme: light;
  --background: #f5f5f5;
  --card: #ffffff;
  --elevated: #f7f7f7;
  --muted: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #1a1a1a;
  --subtext: #737373;
  --accent: #5b7c99;
  --accent-soft: rgba(91, 124, 153, 0.12);
  --accent-border: rgba(91, 124, 153, 0.34);
  --green: #7b9e87;
  --danger: #c43d38;
  --shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

html {
  background: var(--background);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

main {
  height: 100vh;
  overflow: hidden;
}

.web-app-shell {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  gap: 16px;
  width: min(1500px, 100%);
  height: 100vh;
  margin: 0 auto;
  padding: 20px 26px 24px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}

.app-body {
  display: grid;
  grid-template-columns: clamp(360px, 30vw, 420px) minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  min-height: 0;
}

.control-column {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.app-titlebar {
  display: grid;
  gap: 5px;
}

.app-titlebar strong {
  font-size: 29px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.app-titlebar h1 {
  margin: 0;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: 0;
}

.app-intro {
  max-width: 540px;
  margin: 0;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 550;
}

.language-link {
  flex: 0 0 auto;
  color: var(--subtext);
  font-size: 12px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.app-card,
.drawing-column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.mobile-workflow-toggle {
  display: none;
}

.mobile-control-stack {
  display: contents;
}

.app-card {
  padding: 15px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-toggle {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto;
  gap: 2px;
  padding: 0 22px 0 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  position: relative;
}

.card-toggle::after {
  content: "⌄";
  position: absolute;
  right: 0;
  top: 1px;
  color: var(--subtext);
  font-size: 17px;
  line-height: 1;
  transition: transform 160ms ease;
}

.app-card.is-collapsed .card-toggle::after {
  transform: rotate(-90deg);
}

.card-toggle span {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.card-toggle small {
  color: var(--subtext);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 650;
}

.card-content {
  display: block;
}

.app-card.is-collapsed {
  align-self: start;
}

.app-card.is-collapsed .card-title-row {
  margin-bottom: 0;
}

.card-content[hidden] {
  display: none;
}

h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 650;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.choice-row {
  margin-bottom: 12px;
}

.select-like {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.select-like > span,
label,
.parts-label {
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
}

.choice-note {
  color: var(--subtext);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 550;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--muted);
  border-radius: 9px;
}

.segmented button {
  min-height: 34px;
  padding: 7px 8px;
  color: var(--subtext);
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.segmented button.active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.input-unit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-height: 36px;
  padding: 0 10px 0 0;
  color: var(--subtext);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

input[type="number"]:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--text);
  cursor: pointer;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 750;
}

.primary-button {
  flex: 1;
  color: #fff;
  background: var(--accent);
}

.primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.parts-panel {
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.solve-panel {
  display: grid;
  gap: 12px;
}

.solve-panel .card-title-row {
  margin-bottom: 0;
}

.solve-copy h2 {
  margin-bottom: 4px;
}

.solve-copy p {
  margin-bottom: 0;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

.parts-content {
  display: flex;
  flex: 1;
  min-height: auto;
  flex-direction: column;
}

.parts-label {
  margin-bottom: 7px;
}

.parts-source {
  display: none;
}

.part-row-head,
.part-row {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(64px, 0.7fr) minmax(64px, 0.7fr) minmax(46px, 0.44fr) 30px;
  gap: 8px;
  align-items: center;
}

.part-row-head {
  margin-bottom: 7px;
  padding: 0 6px;
  color: var(--subtext);
  font-size: 11px;
  font-weight: 700;
}

.part-rows {
  display: grid;
  gap: 8px;
  min-height: auto;
  overflow: visible;
  padding: 1px 2px 1px 0;
}

.part-row {
  min-height: 48px;
  padding: 10px;
  background: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
}

.part-row input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 7px 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.025);
}

.part-row input[type="number"] {
  padding: 7px 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.part-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.part-remove {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--subtext);
  background: var(--muted);
  border-radius: 7px;
  font-size: 16px;
  font-weight: 800;
}

.drawing-header {
  min-height: 30px;
  display: flex;
  height: auto;
  align-items: flex-start;
  padding: 10px 18px 8px;
}

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

.drawing {
  min-height: 0;
  padding: 12px 16px 16px;
  overflow: hidden;
  touch-action: pan-y;
  background: #fff;
}

.board-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 0 12px;
}

.board-nav-status {
  min-width: 72px;
  text-align: center;
  color: var(--subtext);
  font-size: 13px;
  font-weight: 750;
}

.board-nav-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--muted);
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.board-stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawing svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

@media (max-width: 980px) {
  .web-app-shell {
    padding: 16px;
  }

  .app-body {
    grid-template-columns: 350px minmax(420px, 1fr);
    overflow-x: auto;
  }

  .drawing-column {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .web-app-shell {
    padding: 12px;
  }

  .app-titlebar strong {
    font-size: 23px;
  }

  .app-body {
    grid-template-columns: 320px minmax(380px, 1fr);
  }

  .actions {
    align-items: center;
    flex-direction: row;
  }

  .drawing-column {
    min-height: 0;
  }

  .drawing {
    padding: 12px;
  }
}

/* 0287 reference layout: one sheet, header on top, settings left, drawing right. */
html,
body,
main {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

.web-app-shell {
  width: 100% !important;
  max-width: 1500px !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  padding: 20px 26px 24px !important;
  overflow: hidden !important;
}

.app-header {
  flex: 0 0 72px !important;
  width: 100% !important;
}

.app-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px !important;
  overflow: hidden !important;
}

.control-column {
  order: 1 !important;
  flex: 0 0 clamp(360px, 30vw, 420px) !important;
  width: clamp(360px, 30vw, 420px) !important;
  min-width: 360px !important;
  max-width: 420px !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.drawing-column {
  order: 2 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: minmax(30px, auto) minmax(0, 1fr) !important;
  overflow: hidden !important;
}

.drawing {
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.board-stage {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
}

.drawing svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

.drawing-column {
  grid-template-rows: minmax(30px, auto) minmax(0, 1fr) auto !important;
}

.app-upgrade-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 16px 15px;
  padding: 12px 14px;
  color: #294235;
  background: #edf3ed;
  border: 1px solid #cad8cc;
  border-radius: 10px;
}

.app-upgrade-prompt > div {
  display: grid;
  gap: 3px;
}

.app-upgrade-prompt strong {
  font-size: 13px;
  line-height: 1.3;
}

.app-upgrade-prompt span {
  color: #587060;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 650;
}

.app-upgrade-prompt a {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #fff;
  background: #3b5b49;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background 180ms ease;
}

.app-upgrade-prompt a:hover {
  background: #294235;
}

.app-upgrade-prompt a:focus-visible {
  outline: 3px solid #d7a16b;
  outline-offset: 3px;
}

/* App download landing page ------------------------------------------------ */
html,
body {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

main {
  height: auto !important;
  overflow: visible !important;
}

.web-app-shell {
  height: 100vh !important;
  min-height: 650px;
}

.app-promo {
  --promo-ink: #18211d;
  --promo-paper: #f4f3ed;
  --promo-moss: #2f4a3c;
  --promo-clay: #d7a16b;
  width: 100%;
  color: var(--promo-ink);
  background: var(--background);
  border-top: 1px solid var(--border-strong);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  overflow: hidden;
}

.promo-hero,
.promo-features,
.promo-closing,
.promo-footer {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.promo-hero {
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.72fr);
  align-items: center;
  gap: clamp(36px, 8vw, 128px);
  padding: 92px 0 74px;
}

.promo-copy {
  position: relative;
  z-index: 1;
}

.promo-eyebrow {
  margin: 0 0 20px;
  color: #547060;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.promo-copy h2,
.section-heading h2,
.promo-closing h2 {
  margin: 0;
  color: var(--promo-ink);
  letter-spacing: -0.065em;
}

.promo-copy h2 {
  max-width: 670px;
  font-size: clamp(46px, 6vw, 80px);
  line-height: 1.06;
  font-weight: 760;
}

#promo-title span {
  display: block;
  white-space: nowrap;
}

.promo-lead {
  max-width: 550px;
  margin: 30px 0 0;
  color: #4c554f;
  font-size: 16px;
  line-height: 1.9;
  font-weight: 550;
}

.promo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 23px;
  margin-top: 34px;
}

.app-store-link {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 19px 10px 16px;
  color: #fff;
  background: var(--promo-ink);
  border: 1px solid var(--promo-ink);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(24, 33, 29, 0.16);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.app-store-link:hover {
  background: #31473b;
  box-shadow: 0 14px 28px rgba(24, 33, 29, 0.22);
  transform: translateY(-2px);
}

.app-store-link:focus-visible,
.promo-text-link:focus-visible,
.promo-footer a:focus-visible {
  outline: 3px solid #d7a16b;
  outline-offset: 4px;
}

.app-store-link svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
}

.app-store-link span {
  display: grid;
  gap: 1px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.15;
}

.app-store-link small {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.promo-text-link {
  color: var(--promo-ink);
  font-size: 14px;
  font-weight: 750;
  text-underline-offset: 5px;
}

.promo-text-link span {
  display: inline-block;
  margin-left: 5px;
}

.promo-note {
  margin: 19px 0 0;
  color: #69716c;
  font-size: 12px;
  font-weight: 650;
}

.promo-note span {
  display: block;
}

.promo-device {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 580px;
}

.device-glow {
  width: min(96%, 400px);
  aspect-ratio: 1;
  position: absolute;
  border-radius: 50%;
  background: #d7e1d6;
  filter: blur(2px);
}

.promo-device img {
  width: min(100%, 315px);
  position: relative;
  z-index: 1;
  display: block;
  border: 7px solid #1d2420;
  border-radius: 43px;
  box-shadow: 0 32px 45px rgba(22, 34, 28, 0.24), 0 3px 5px rgba(22, 34, 28, 0.25);
}

.promo-divider {
  width: min(1180px, calc(100% - 48px));
  height: 1px;
  margin: 0 auto;
  background: rgba(24, 33, 29, 0.14);
}

.promo-features {
  padding: 130px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px;
  text-align: left;
  margin-bottom: 42px;
}

.section-heading .promo-eyebrow {
  margin: 0 0 7px;
}

.section-heading h2,
.promo-closing h2 {
  font-size: clamp(33px, 4vw, 54px);
  line-height: 1.17;
  font-weight: 730;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  min-height: 372px;
  position: relative;
  padding: 34px;
  overflow: hidden;
  border-radius: 15px;
}

.feature-card h3 {
  margin: 14px 0 12px;
  font-size: 25px;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.feature-card p {
  max-width: 315px;
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 550;
}

.feature-card .feature-screen {
  display: block;
  background: #fff;
  object-fit: cover;
}

.feature-number {
  display: block;
  color: #718077;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.feature-card-wide {
  grid-column: 1 / -1;
  min-height: 402px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.7fr);
  gap: 24px;
  background: #dde5dd;
}

.feature-card-wide img {
  width: 245px;
  align-self: end;
  justify-self: center;
  margin-bottom: 0;
  border: 6px solid #202722;
  border-radius: 35px;
  box-shadow: 0 22px 35px rgba(34, 47, 38, 0.22);
}

.feature-card-dark {
  color: #f4f3ed;
  background: var(--promo-moss);
  display: flex;
  flex-direction: column;
}

.feature-card-dark .feature-number {
  color: #b3c5b7;
}

.feature-card-dark p {
  color: #d2ded5;
}

.feature-card-dark img {
  width: 180px;
  position: static;
  align-self: flex-end;
  margin: 28px 0 0;
  border: 5px solid #1b251f;
  border-radius: 24px;
  box-shadow: 0 16px 25px rgba(0, 0, 0, 0.2);
}

.feature-card-accent {
  color: var(--promo-ink);
  background: #e9cda9;
  display: flex;
  flex-direction: column;
}

.feature-card-accent img {
  width: 180px;
  position: static;
  align-self: flex-end;
  margin: 28px 0 0;
  border: 5px solid #26302a;
  border-radius: 24px;
  box-shadow: 0 16px 25px rgba(75, 51, 25, 0.2);
}

.promo-closing {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 0.7fr);
  gap: 60px;
  align-items: end;
  padding: 92px 0;
}

.closing-action p {
  margin: 0 0 25px;
  color: #536057;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 550;
}

.app-store-link-light {
  color: var(--promo-ink);
  background: transparent;
  border-color: rgba(24, 33, 29, 0.36);
  box-shadow: none;
}

.app-store-link-light:hover {
  color: #fff;
  background: var(--promo-ink);
  box-shadow: 0 12px 24px rgba(24, 33, 29, 0.17);
}

.promo-footer {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 25px 0;
  border-top: 1px solid rgba(24, 33, 29, 0.14);
  color: #677168;
  font-size: 12px;
  font-weight: 650;
}

.promo-footer strong {
  color: var(--promo-ink);
  font-size: 17px;
  letter-spacing: 0.12em;
}

.promo-footer a {
  margin-left: auto;
  color: inherit;
  text-underline-offset: 4px;
}

@media (max-width: 820px) {
  .web-app-shell {
    min-width: 0 !important;
    height: auto !important;
    min-height: 100vh;
    padding: 14px !important;
  }

  .promo-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 76px 0 70px;
  }

  .promo-device {
    min-height: 450px;
    order: -1;
  }

  .promo-device img {
    width: 250px;
  }

  .section-heading,
  .promo-closing {
    grid-template-columns: 1fr;
    gap: 27px;
  }

  .promo-features {
    padding: 86px 0;
  }
}

/* Long-form support pages -------------------------------------------------- */
.legal-followup {
  max-width: 740px;
  margin: 14px 0 0;
  color: var(--subtext);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 550;
}

.legal-card.support-prose-card {
  padding: 28px;
}

.support-prose-card p {
  margin: 0;
  color: var(--subtext);
  font-size: 14px;
  line-height: 1.8;
}

.support-prose-card p + ol,
.support-prose-card p + ul {
  margin-top: 14px;
}

.support-prose-card ol + p,
.support-prose-card ul + p {
  margin-top: 20px;
}

.support-prose-card ol,
.support-prose-card ul {
  margin-bottom: 0;
}

.support-faq-list {
  display: grid;
  gap: 12px;
}

.faq-card.support-faq-card {
  padding: 24px 26px;
}

.faq-card.support-faq-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.support-faq-card p + p,
.support-contact p + p {
  margin-top: 8px;
}

.legal-callout.support-contact {
  margin-top: 0;
}

.legal-callout.support-privacy {
  margin-top: 20px;
}

@media (max-width: 460px) {
  .legal-card.support-prose-card,
  .faq-card.support-faq-card {
    padding: 20px;
  }
}

/* Shared footer navigation ------------------------------------------------- */
.promo-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 20px;
  margin-left: auto;
}

.promo-footer-links a {
  width: auto;
  margin-left: 0;
}

@media (max-width: 560px) {
  .promo-footer-links {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .promo-footer-links a {
    width: auto;
  }
}

/* Support and privacy pages ----------------------------------------------- */
.legal-body {
  min-height: 100%;
  background: var(--background);
  color: var(--text);
}

.legal-body a {
  color: inherit;
  text-underline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #fff !important;
  background: var(--accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.legal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(245, 245, 245, 0.92);
  border-bottom: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.legal-header-inner,
.legal-footer-inner {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
}

.legal-header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.legal-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.legal-brand strong {
  font-size: 19px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.legal-brand span {
  color: var(--subtext);
  font-size: 11px;
  font-weight: 650;
}

.legal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legal-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  color: var(--subtext);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.legal-nav a:hover,
.legal-nav a.is-current {
  color: var(--accent);
  background: var(--accent-soft);
}

.legal-main {
  width: min(1040px, calc(100% - 48px)) !important;
  height: auto !important;
  min-height: calc(100vh - 75px);
  margin: 0 auto;
  padding: 0 0 96px;
  overflow: visible !important;
}

.legal-hero {
  padding: 82px 0 68px;
  border-bottom: 1px solid var(--border-strong);
}

.legal-eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.legal-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.08;
  font-weight: 780;
  letter-spacing: -0.055em;
}

.legal-lead {
  max-width: 740px;
  margin: 26px 0 0;
  color: var(--subtext);
  font-size: 16px;
  line-height: 1.9;
  font-weight: 550;
}

.legal-updated {
  margin: 22px 0 0;
  color: var(--subtext);
  font-size: 12px;
  font-weight: 700;
}

.legal-section {
  padding: 76px 0 0;
}

.legal-section-heading {
  max-width: 700px;
  margin-bottom: 28px;
}

.legal-section-heading h2,
.legal-callout h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.2;
  font-weight: 740;
  letter-spacing: -0.04em;
}

.legal-section-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--subtext);
  font-size: 14px;
  line-height: 1.75;
}

.legal-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.legal-card,
.faq-card,
.policy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.legal-card {
  padding: 26px;
}

.legal-card-number,
.policy-number {
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.legal-card h3,
.faq-card h3 {
  margin: 13px 0 12px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 730;
}

.legal-card ol,
.legal-card ul,
.policy-card ul {
  margin: 0;
  padding-left: 1.35em;
  color: var(--subtext);
  font-size: 14px;
  line-height: 1.8;
}

.legal-card li + li,
.policy-card li + li {
  margin-top: 4px;
}

.contact-details {
  margin: 0;
}

.contact-details > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.contact-details > div:first-child {
  border-top: 0;
}

.contact-details dt,
.contact-details dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.contact-details dt {
  color: var(--subtext);
  font-weight: 700;
}

.contact-details dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

.contact-details a,
.policy-card a {
  color: var(--accent);
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.faq-card {
  padding: 22px;
}

.faq-card h3 {
  margin-top: 0;
  font-size: 16px;
}

.faq-card p,
.policy-card p,
.legal-callout p {
  margin: 0;
  color: var(--subtext);
  font-size: 14px;
  line-height: 1.8;
}

.policy-list {
  display: grid;
  gap: 12px;
}

.policy-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 25px 26px;
}

.policy-number {
  padding-top: 5px;
}

.policy-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 730;
}

.policy-card ul {
  margin-top: 6px;
}

.legal-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 76px;
  padding: 32px;
  color: #294235;
  background: #edf3ed;
  border: 1px solid #cad8cc;
  border-radius: 12px;
}

.legal-callout .legal-eyebrow {
  color: #547060;
}

.legal-callout h2 {
  margin-bottom: 10px;
  color: #294235;
  font-size: clamp(23px, 3vw, 31px);
}

.legal-callout p {
  color: #587060;
}

.legal-button {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  color: #fff !important;
  background: #3b5b49;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: background 180ms ease;
}

.legal-button:hover {
  background: #294235;
}

.legal-footer {
  border-top: 1px solid var(--border-strong);
}

.legal-footer-inner {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--subtext);
  font-size: 12px;
  font-weight: 650;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
}

.legal-header a:focus-visible,
.legal-main a:focus-visible,
.legal-footer a:focus-visible {
  outline: 3px solid var(--accent-border);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .legal-header-inner,
  .legal-footer-inner,
  .legal-main {
    width: min(100% - 32px, 1040px) !important;
  }

  .legal-header-inner {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0 13px;
  }

  .legal-nav {
    width: 100%;
    overflow-x: auto;
  }

  .legal-nav a {
    flex: 0 0 auto;
  }

  .legal-hero {
    padding: 56px 0 48px;
  }

  .legal-section {
    padding-top: 56px;
  }

  .legal-card-grid,
  .faq-list {
    grid-template-columns: 1fr;
  }

  .legal-callout {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 56px;
    padding: 26px;
  }

  .legal-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 25px 0;
  }

  .legal-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .legal-brand span {
    display: none;
  }

  .legal-nav {
    gap: 3px;
  }

  .legal-nav a {
    padding-inline: 9px;
    font-size: 11px;
  }

  .legal-main {
    padding-bottom: 70px;
  }

  .legal-hero h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .legal-lead {
    font-size: 14px;
  }

  .legal-card,
  .faq-card,
  .policy-card,
  .legal-callout {
    padding: 20px;
  }

  .policy-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .contact-details > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .legal-nav a,
  .legal-button {
    transition: none;
  }
}

@media (max-width: 560px) {
  .promo-hero,
  .promo-features,
  .promo-closing,
  .promo-footer,
  .promo-divider {
    width: min(100% - 32px, 1180px);
  }

  .promo-copy h2 {
    font-size: 45px;
  }

  .promo-lead br,
  .closing-action br {
    display: none;
  }

  .promo-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .promo-device {
    min-height: 390px;
  }

  .promo-device img {
    width: 218px;
    border-radius: 31px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card-wide {
    grid-column: auto;
    grid-template-columns: 1fr;
    min-height: 510px;
  }

  .feature-card-wide img {
    width: 205px;
    margin-bottom: 0;
  }

  .feature-card {
    padding: 28px;
  }

  .promo-closing {
    padding: 66px 0;
  }

  .promo-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .promo-footer > a {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-store-link {
    transition: none;
  }
}

/* Mobile: one focused workflow — input, calculate, then inspect the layout. */
@media (max-width: 820px) {
  .web-app-shell {
    width: 100vw !important;
    max-width: 100vw !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  .app-header {
    flex: 0 0 54px !important;
    padding: 0 2px !important;
    position: relative;
  }

  .language-link {
    position: absolute;
    top: 17px;
    right: 2px;
    padding: 6px 0;
  }

  .app-titlebar strong {
    font-size: 22px;
    letter-spacing: 0.1em;
  }

  .app-body {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .control-column {
    order: 1 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    display: grid !important;
    grid-template-rows: auto auto !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .mobile-workflow-toggle {
    width: 100%;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: var(--shadow);
    text-align: left;
  }

  .mobile-workflow-toggle > span:first-child {
    display: grid;
    gap: 3px;
  }

  .mobile-workflow-toggle strong {
    font-size: 15px;
    line-height: 1.2;
  }

  .mobile-workflow-toggle small {
    color: var(--subtext);
    font-size: 11px;
    font-weight: 650;
  }

  .mobile-workflow-toggle-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 19px;
    line-height: 1;
    transition: transform 180ms ease;
  }

  .control-column.is-mobile-expanded .mobile-workflow-toggle-icon {
    transform: rotate(180deg);
  }

  .mobile-control-stack {
    display: none;
  }

  .control-column.is-mobile-expanded .mobile-control-stack {
    display: grid;
    gap: 0;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: var(--shadow);
  }

  .app-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    border-radius: 11px;
  }

  .mobile-control-stack .app-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mobile-control-stack .app-card + .app-card {
    border-top: 1px solid var(--border);
  }

  .card-title-row {
    margin-bottom: 10px;
  }

  .parts-panel {
    max-height: none;
  }

  .part-row-head,
  .part-row {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr) minmax(0, 0.62fr) minmax(0, 0.38fr) 24px;
    gap: 4px;
  }

  .part-row-head {
    padding: 0 3px;
    font-size: 10px;
  }

  .part-row {
    min-height: 43px;
    padding: 5px;
    border-radius: 8px;
  }

  .part-row input,
  .part-row input[type="number"] {
    height: 32px;
    min-width: 0;
    padding: 6px 5px;
    font-size: 13px;
  }

  .form-grid,
  .segmented,
  .select-like {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .part-remove {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }

  .solve-panel {
    position: sticky;
    z-index: 3;
    bottom: 10px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  }

  .solve-copy p {
    font-size: 11px;
  }

.primary-button {
    min-height: 44px;
  }

  .drawing-column {
    order: 2 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 480px !important;
    min-height: 480px !important;
    border-radius: 11px;
  }

  .drawing-header {
    min-height: 28px;
    height: auto;
    align-items: flex-start;
    padding: 8px 12px 7px;
  }

  .drawing {
    padding: 8px 10px 10px;
  }

  .board-nav {
    gap: 8px;
    padding-bottom: 7px;
  }

  .board-nav-button {
    width: 32px;
    height: 32px;
  }

  .app-upgrade-prompt {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin: 0 10px 10px;
  }

  .app-upgrade-prompt a {
    width: 100%;
    text-align: center;
  }
}

/* Layout and accessibility refinements. */
.app-upgrade-prompt[hidden] {
  display: none !important;
}

@media (min-width: 821px) {
  .control-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .input-panel,
  .solve-panel {
    flex: 0 0 auto;
  }

  .parts-panel:not(.is-collapsed) {
    flex: 1 0 260px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .parts-panel:not(.is-collapsed) .parts-content {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .parts-panel:not(.is-collapsed) .part-rows {
    flex: 1 1 auto;
    min-height: 160px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }

  .parts-panel.is-collapsed {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .solve-panel {
    position: relative;
    z-index: 1;
  }
}

@media (max-width: 390px) {
  .promo-copy #promo-title {
    font-size: clamp(36px, 11.5vw, 45px);
  }
}

@media (max-width: 820px) {
  .web-app-shell {
    min-height: 0;
    height: auto !important;
  }

  .app-intro {
    display: none;
  }

  .app-titlebar h1 {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-control-stack {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .solve-panel {
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .drawing-column {
    height: clamp(410px, 62svh, 560px) !important;
    min-height: 410px !important;
  }

  .feature-card-wide,
  .feature-card-dark,
  .feature-card-accent {
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .feature-card-wide img,
  .feature-card-dark img,
  .feature-card-accent img {
    width: min(100%, 230px);
    position: static;
    align-self: center;
    margin: 28px auto 0;
    border-radius: 26px;
  }
}
