:root {
  color-scheme: dark;
  --ink: #0c1216;
  --ink-2: #111b21;
  --zinc: #1b2a32;
  --panel: rgba(17, 27, 33, 0.72);
  --panel-strong: rgba(20, 32, 38, 0.92);
  --glass: rgba(255, 255, 255, 0.075);
  --line: rgba(232, 240, 244, 0.14);
  --line-strong: rgba(232, 240, 244, 0.25);
  --text: #f7fbfc;
  --muted: #a8b6bf;
  --muted-2: #768892;
  --accent: #f05a31;
  --accent-deep: #9c211b;
  --amber: #f6b15c;
  --ok: #4dd6a4;
  --warn: #ffd166;
  --danger: #ff6b6b;
  --blueprint: #89c7df;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.24);
  --ease: cubic-bezier(0.2, 0.82, 0.2, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(240, 90, 49, 0.18) 0%, transparent 28%),
    linear-gradient(245deg, rgba(137, 199, 223, 0.1) 0%, transparent 30%),
    linear-gradient(180deg, #111b21 0%, #0c1216 46%, #070b0e 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(120deg, transparent 0 46%, rgba(240, 90, 49, 0.055) 46% 47%, transparent 47% 100%);
  background-size: 36px 36px, 36px 36px, 420px 420px;
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
}

body::after {
  z-index: -1;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
  transform: translateX(-60%);
  animation: scanSurface 9s var(--ease) infinite;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
}

.topbar::before,
.quick-strip::before,
.tabbar::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 15, 19, 0.72);
  backdrop-filter: blur(22px) saturate(1.15);
  content: "";
}

.topbar::before {
  inset: 4px -8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, #ff7044, #9c211b),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
  box-shadow: 0 14px 34px rgba(240, 90, 49, 0.24);
  font-weight: 950;
}

.brand-mark::after {
  position: absolute;
  inset: -40% 35%;
  content: "";
  background: rgba(255, 255, 255, 0.32);
  transform: rotate(22deg) translateX(-120%);
  animation: markSweep 5.5s var(--ease) infinite;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft);
  font-size: 1.5rem;
  font-weight: 850;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(246, 177, 92, 0.65);
  background: rgba(246, 177, 92, 0.13);
  transform: translateY(-2px);
}

.workspace {
  display: grid;
  gap: 12px;
}

.hero-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr);
  align-items: center;
  min-height: 286px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(7, 11, 14, 0.96), rgba(16, 27, 34, 0.8) 52%, rgba(18, 31, 38, 0.58)),
    url("assets/roof-texture.svg");
  background-size: cover;
  box-shadow: var(--shadow);
  isolation: isolate;
  animation: riseIn 520ms var(--ease) both;
}

.hero-band::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(137, 199, 223, 0.1) 42% 42.5%, transparent 42.5% 100%),
    linear-gradient(35deg, transparent 0 58%, rgba(246, 177, 92, 0.12) 58% 58.5%, transparent 58.5% 100%);
  background-size: 320px 320px, 380px 380px;
  animation: blueprintDrift 18s linear infinite;
}

.hero-band::after {
  position: absolute;
  right: 22px;
  bottom: 0;
  left: 22px;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent), var(--amber), var(--blueprint), transparent);
  animation: edgeGlow 4s var(--ease) infinite;
}

.hero-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 28%, rgba(255, 255, 255, 0.12) 43%, transparent 58% 100%);
  transform: translateX(-70%);
  animation: heroSheen 7s var(--ease) infinite;
}

.hero-copy {
  padding: 34px 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 14px;
  font-size: 4.15rem;
  line-height: 0.94;
  font-weight: 950;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 920;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
  font-weight: 860;
}

.hero-copy p:last-child {
  max-width: 59ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.64;
}

.roof-visual {
  min-height: 230px;
  padding: 14px 18px 14px 0;
}

.roof-visual svg {
  width: 100%;
  height: 100%;
  min-height: 230px;
  filter: drop-shadow(0 28px 44px rgba(0, 0, 0, 0.45));
  animation: floatRoof 5.5s var(--ease) infinite;
}

.roof-shadow {
  fill: rgba(0, 0, 0, 0.28);
  transform: translateY(18px);
}

.roof-left {
  fill: url("#steel");
}

.roof-right {
  fill: #c6d3d9;
}

.ridge,
.beam,
.measure {
  fill: none;
  stroke-linecap: round;
}

.ridge {
  stroke: url("#copper");
  stroke-width: 7;
}

.beam {
  stroke: #f7fbfc;
  stroke-width: 10;
}

.measure {
  stroke: rgba(246, 177, 92, 0.86);
  stroke-dasharray: 8 10;
  stroke-width: 3;
}

.node {
  fill: var(--amber);
}

.draw-line {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawLine 1.1s var(--ease) 360ms forwards;
}

.delay-1 {
  animation-delay: 520ms;
}

.delay-2 {
  animation-delay: 760ms;
}

.delay-3 {
  animation-delay: 940ms;
}

.quick-strip {
  position: sticky;
  z-index: 35;
  top: 66px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  animation: riseIn 560ms var(--ease) 80ms both;
}

.quick-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.quick-card::after,
.choice-card::after,
.metric::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.09) 50%, transparent 62% 100%);
  opacity: 0;
  transform: translateX(-45%);
  transition: opacity 180ms var(--ease), transform 420ms var(--ease);
}

.quick-card:hover::after,
.choice-card:hover::after,
.metric:hover::after {
  opacity: 1;
  transform: translateX(45%);
}

.quick-strip strong,
.metric strong {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.quick-strip span {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 1.42rem;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-strip .ok span {
  color: var(--ok);
}

.quick-strip .warn span,
.quick-strip .info span {
  color: var(--warn);
}

.quick-strip .danger span {
  color: var(--danger);
}

.tabbar {
  position: sticky;
  z-index: 34;
  top: 152px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 6px;
  animation: riseIn 560ms var(--ease) 140ms both;
}

.tab {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  transition: color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.tab:hover,
.tab:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.tab.is-active {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(240, 90, 49, 0.96), rgba(156, 33, 27, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  box-shadow: 0 12px 26px rgba(240, 90, 49, 0.2);
}

.tab-panel {
  display: none;
  padding: 16px 0 0;
}

.tab-panel.is-active {
  display: block;
  animation: panelIn 260ms var(--ease);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(77, 214, 164, 0.38);
  border-radius: 999px;
  color: var(--ok);
  background: rgba(77, 214, 164, 0.09);
  box-shadow: 0 0 0 6px rgba(77, 214, 164, 0.03);
  font-size: 0.78rem;
  font-weight: 850;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.choice-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 116px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: rgba(246, 177, 92, 0.58);
  transform: translateY(-2px);
}

.choice-card.is-selected {
  border-color: rgba(240, 90, 49, 0.95);
  background:
    linear-gradient(145deg, rgba(240, 90, 49, 0.25), rgba(137, 199, 223, 0.08)),
    rgba(255, 255, 255, 0.045);
  box-shadow:
    0 16px 36px rgba(240, 90, 49, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.choice-card.is-selected::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: linear-gradient(180deg, var(--accent), var(--amber), var(--blueprint));
}

.choice-icon {
  font-family: ui-monospace, "Cascadia Code", monospace;
  color: var(--amber);
  font-size: 1.55rem;
  font-weight: 900;
}

.choice-card small,
label span {
  color: var(--muted);
}

.input-board {
  display: grid;
  gap: 10px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px) saturate(1.1);
}

legend {
  padding: 0 8px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 0.78rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(232, 240, 244, 0.13);
  border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(4, 8, 11, 0.38);
  outline: none;
  padding: 0 12px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

input,
select {
  min-height: 50px;
}

textarea {
  min-height: 160px;
  padding: 12px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(246, 177, 92, 0.86);
  box-shadow: 0 0 0 3px rgba(246, 177, 92, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: rgba(9, 15, 19, 0.72);
}

select option {
  color: #101820;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0 17px;
  font-weight: 920;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}

.primary-action {
  border: 0;
  color: #fff;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-deep)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent);
  box-shadow: 0 16px 32px rgba(240, 90, 49, 0.24);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
}

.primary-action:hover,
.secondary-action:hover,
.primary-action:focus-visible,
.secondary-action:focus-visible {
  transform: translateY(-2px);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  border-color: rgba(137, 199, 223, 0.45);
}

.secondary-action.compact {
  min-height: 38px;
  padding: 0 12px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(330px, 1.12fr);
  gap: 12px;
  align-items: start;
}

.diagram-card {
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(137, 199, 223, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

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

.metric,
.tool-card,
.saved-item,
.warning,
.assumption-list article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.metric {
  position: relative;
  min-height: 120px;
  overflow: hidden;
  padding: 15px;
  animation: riseIn 420ms var(--ease) both;
}

.metric.accent {
  border-color: rgba(240, 90, 49, 0.5);
  background:
    linear-gradient(145deg, rgba(240, 90, 49, 0.19), rgba(137, 199, 223, 0.075)),
    rgba(255, 255, 255, 0.04);
}

.metric span {
  display: block;
  color: var(--text);
  font-size: 1.78rem;
  font-weight: 950;
  line-height: 1.05;
  margin-top: 8px;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.warnings {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.warning {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.warning strong {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.warning span {
  color: var(--muted);
  line-height: 1.4;
}

.warning.ok strong {
  color: var(--ok);
}

.warning.warn strong,
.warning.info strong {
  color: var(--warn);
}

.warning.danger {
  border-color: rgba(255, 107, 107, 0.5);
}

.warning.danger strong {
  color: var(--danger);
}

.cut-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 12px;
}

.wood-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  margin-bottom: 12px;
}

.wood-photo-card,
.wood-import-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.photo-drop {
  position: relative;
}

.photo-drop input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.photo-preview {
  display: grid;
  min-height: 250px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(246, 177, 92, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(240, 90, 49, 0.12), rgba(137, 199, 223, 0.08)),
    rgba(255, 255, 255, 0.035);
  color: var(--muted);
  text-align: center;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.photo-preview strong,
.photo-preview span {
  display: block;
  padding: 0 18px;
}

.photo-preview strong {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 920;
}

.photo-preview img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.photo-preview.has-photo {
  place-items: stretch;
  border-style: solid;
}

.photo-preview.has-photo span {
  padding: 10px 12px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.photo-drop:hover .photo-preview {
  border-color: rgba(246, 177, 92, 0.7);
  transform: translateY(-2px);
}

.compact-row {
  margin-bottom: 0;
}

.wood-entry {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(4, minmax(92px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wood-summary {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0 0 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: var(--text);
}

tbody tr {
  transition: background 160ms var(--ease);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.045);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.assumption-list,
.tool-stack,
.saved-list {
  display: grid;
  gap: 10px;
}

.assumption-list article,
.tool-card,
.saved-item {
  padding: 16px;
}

.assumption-list article {
  color: var(--muted);
  line-height: 1.45;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}

output {
  min-height: 50px;
  padding: 12px;
  border: 1px solid rgba(246, 177, 92, 0.36);
  border-radius: var(--radius);
  color: var(--amber);
  background: rgba(246, 177, 92, 0.08);
  font-weight: 900;
}

.saved-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.saved-item strong,
.saved-item small {
  display: block;
}

.saved-item small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(16, 24, 32, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatRoof {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-7px) rotate(-0.5deg);
  }
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes markSweep {
  0%,
  64%,
  100% {
    transform: rotate(22deg) translateX(-120%);
  }

  78% {
    transform: rotate(22deg) translateX(120%);
  }
}

@keyframes heroSheen {
  0%,
  55%,
  100% {
    transform: translateX(-70%);
  }

  72% {
    transform: translateX(70%);
  }
}

@keyframes blueprintDrift {
  to {
    background-position: 320px 320px, -380px 380px;
  }
}

@keyframes edgeGlow {
  0%,
  100% {
    opacity: 0.72;
    transform: scaleX(0.92);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes scanSurface {
  0%,
  72%,
  100% {
    transform: translateX(-60%);
    opacity: 0;
  }

  82% {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  h1 {
    font-size: 3.2rem;
  }

  .hero-band,
  .result-layout,
  .cut-layout,
  .wood-layout {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .results-grid,
  .wood-entry {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar {
    padding-top: 8px;
  }

  .hero-band {
    min-height: auto;
  }

  .hero-copy {
    padding: 18px 16px 4px;
  }

  h1 {
    font-size: 2.05rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero-copy p:last-child {
    font-size: 0.92rem;
    line-height: 1.48;
  }

  .roof-visual {
    height: 132px;
    min-height: 0;
    padding: 0 10px 8px;
  }

  .roof-visual svg {
    height: 126px;
    min-height: 0;
  }

  .quick-strip {
    top: 64px;
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-strip span {
    font-size: 1.2rem;
  }

  .tabbar {
    top: 184px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tab {
    min-height: 42px;
    padding: 0 4px;
    font-size: 0.74rem;
  }

  .choice-grid,
  .form-grid,
  .results-grid,
  .mini-grid,
  .wood-entry {
    grid-template-columns: 1fr;
  }

  .photo-preview,
  .photo-preview img {
    min-height: 210px;
    height: 210px;
  }

  .choice-card {
    min-height: 92px;
  }

  .diagram-card {
    min-height: 300px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .metric span {
    font-size: 1.55rem;
  }

  .action-row > * {
    flex: 1 1 180px;
  }

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

  .saved-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 2rem;
  }

  .quick-strip span {
    font-size: 1rem;
  }

  .tab {
    font-size: 0.76rem;
  }
}

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