/* ===== VARIABLES ===== */
:root {
  --bg: #F4F0E8;
  --bg2: #EDE8DC;
  --bg3: #E6E0D2;
  --ink: #1C1A16;
  --ink2: #4A4538;
  --ink3: #8A8070;
  --accent: #C85A2A;
  --accent2: #E8834E;
  --accent-light: #F5D4C2;
  --tile: #2D6A4F;
  --tile-light: #C8E6D8;
  --parquet: #7B4F2E;
  --parquet-light: #E8D5C4;
  --paint: #C85A2A;
  --border: rgba(28,26,22,0.12);
  --border2: rgba(28,26,22,0.06);
  --shadow: 0 1px 0 rgba(28,26,22,0.08), 0 4px 16px rgba(28,26,22,0.05);
  --radius: 3px;
  --tab-color: var(--paint);
}

:root[data-theme="dark"] {
  --bg: #11100E;
  --bg2: #1B1916;
  --bg3: #26221D;
  --ink: #F5F0E6;
  --ink2: #D3C7B8;
  --ink3: #9E9284;
  --accent: #F08A55;
  --accent2: #FFB07A;
  --accent-light: rgba(240,138,85,0.18);
  --tile: #4FA37A;
  --tile-light: rgba(79,163,122,0.18);
  --parquet: #C2895C;
  --parquet-light: rgba(194,137,92,0.18);
  --paint: #F08A55;
  --border: rgba(245,240,230,0.16);
  --border2: rgba(245,240,230,0.08);
  --shadow: 0 1px 0 rgba(255,255,255,0.04), 0 8px 28px rgba(0,0,0,0.42);
}

:root[data-theme="dark"] body::before { opacity: 0.18; }
:root[data-theme="dark"] header { background: rgba(17,16,14,0.92); }
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] select { background: var(--bg2); color: var(--ink); }
:root[data-theme="dark"] input[type="number"]:focus,
:root[data-theme="dark"] input[type="text"]:focus,
:root[data-theme="dark"] select:focus { background: #211E1A; }
:root[data-theme="dark"] .result-highlight,
:root[data-theme="dark"] .rooms-total,
:root[data-theme="dark"] .calc-btn { background: #F5F0E6; color: #11100E; }
:root[data-theme="dark"] .calc-btn:hover { color: #11100E; }


/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Syne', sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; overflow-x: hidden; }
button { cursor: pointer; }
input, select { font-family: inherit; }

/* grain */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999; opacity: 0.4;
}

/* ===== HEADER ===== */
header {
  padding: 0 clamp(16px,4vw,72px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch; gap: 0;
  position: sticky; top: 0; background: var(--bg); z-index: 100;
  backdrop-filter: blur(8px);
}

.logo-block { padding: 20px 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.logo { font-family: 'Playfair Display', serif; font-size: clamp(20px,2.5vw,30px); font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.logo span { color: var(--accent); }
.logo-sub { font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 300; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink3); margin-top: 3px; }

.header-actions {
  display: flex; align-items: center; gap: 0;
  border-left: 1px solid var(--border);
}

.hdr-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 0 20px; height: 100%;
  background: none; border: none; border-right: 1px solid var(--border);
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink3);
  transition: color 0.15s, background 0.15s;
}
.hdr-btn:hover { color: var(--ink); background: var(--bg2); }
.hdr-btn svg { width: 14px; height: 14px; opacity: 0.6; }

.projects-wrap { position: relative; height: 100%; }
.projects-dropdown {
  position: absolute; top: 100%; right: 0;
  width: 280px; background: var(--bg);
  border: 1px solid var(--border); border-top: none;
  box-shadow: var(--shadow); z-index: 200;
  display: none;
}
.projects-wrap.open .projects-dropdown { display: block; }

.projects-empty { padding: 20px; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--ink3); text-align: center; }
.project-item {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--border2);
}
.project-load {
  flex: 1; padding: 12px 16px; background: none; border: none;
  font-family: 'Syne', sans-serif; font-size: 12px; text-align: left; color: var(--ink);
  transition: background 0.1s;
}
.project-load:hover { background: var(--bg2); }
.project-load span { display: block; font-family: 'DM Mono', monospace; font-size: 9px; color: var(--ink3); letter-spacing: 0.1em; margin-top: 2px; }
.project-del { padding: 12px 14px; background: none; border: none; color: var(--ink3); font-size: 16px; transition: color 0.1s; }
.project-del:hover { color: var(--accent); }

.projects-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.projects-save-input { display: flex; gap: 8px; }
.projects-save-input input {
  flex: 1; padding: 8px 10px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: 'Syne', sans-serif; font-size: 12px; color: var(--ink); outline: none;
}
.projects-save-input button {
  padding: 8px 14px; background: var(--ink); color: var(--bg);
  border: none; border-radius: var(--radius); font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
}
.projects-save-input button:hover { background: var(--accent); }


.settings-wrap { display: flex; align-items: stretch; height: 100%; }
.lang-select {
  height: 100%; padding: 0 28px 0 14px; background: transparent; color: var(--ink3);
  border: none; border-right: 1px solid var(--border); border-radius: 0;
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  outline: none; cursor: pointer;
}
.lang-select:hover { background: var(--bg2); color: var(--ink); }
.theme-icon { font-size: 13px; line-height: 1; }
@media(max-width:760px) {
  header { flex-wrap: wrap; }
  .header-actions { width: 100%; border-left: none; border-top: 1px solid var(--border); overflow-x: auto; }
  .hdr-btn { min-height: 44px; padding: 0 14px; }
  .lang-select { min-height: 44px; }
}

/* ===== HERO ===== */
.hero {
  padding: clamp(32px,5vw,64px) clamp(16px,4vw,72px) clamp(24px,3vw,48px);
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px;
  border-bottom: 1px solid var(--border);
}
.hero-title { font-family: 'Playfair Display', serif; font-size: clamp(32px,5.5vw,64px); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; }
.hero-title em { font-style: italic; color: var(--accent); }
.hero-stats { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.stat { text-align: right; border-right: 2px solid var(--accent); padding-right: 12px; }
.stat-num { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; line-height: 1; }
.stat-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink3); margin-top: 2px; }

/* ===== TAB NAV ===== */
.tab-nav {
  display: flex; padding: 0 clamp(16px,4vw,72px);
  border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 24px; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink3);
  white-space: nowrap; transition: all 0.15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--tab-color); }
.tab-btn[data-tab="vernice"] { --tab-color: var(--paint); }
.tab-btn[data-tab="piastrelle"] { --tab-color: var(--tile); }
.tab-btn[data-tab="parquet"] { --tab-color: var(--parquet); }
.tab-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; background: var(--bg2); transition: background 0.15s; }
.tab-btn.active .tab-icon { background: var(--tab-color); }

/* ===== MAIN LAYOUT ===== */
.main { padding: clamp(24px,3vw,48px) clamp(16px,4vw,72px); }

.calc-panel { display: none; animation: fadeUp 0.25s ease; }
.calc-panel.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }

.panel-grid {
  display: grid; grid-template-columns: minmax(320px,1fr) minmax(320px,1fr);
  gap: 2px; background: var(--border);
  border: 1px solid var(--border);
}
@media(max-width:900px) { .panel-grid { grid-template-columns: 1fr; } }

.panel-inputs { background: var(--bg); padding: 32px; display: flex; flex-direction: column; gap: 0; }
.panel-results { background: var(--bg); padding: 32px; }

/* ===== SECTION LABELS ===== */
.section-label {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink3);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== ROOM MANAGER ===== */
.rooms-manager { margin-bottom: 28px; }

.rooms-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

.room-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.room-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; cursor: pointer; gap: 8px;
  transition: background 0.1s;
}
.room-card-header:hover { background: var(--bg3); }
.room-card-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.room-drag { color: var(--ink3); font-size: 12px; cursor: grab; user-select: none; }
.room-name {
  font-size: 13px; font-weight: 700; color: var(--ink); outline: none;
  border-bottom: 1px solid transparent; transition: border-color 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; max-width: 140px;
}
.room-name:focus { border-bottom-color: var(--accent); }

.room-card-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.room-shape-badge {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px;
  color: var(--ink3); cursor: pointer; transition: all 0.15s;
}
.room-shape-badge:hover { border-color: var(--accent); color: var(--accent); }
.room-area { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; color: var(--ink); min-width: 60px; text-align: right; }
.room-delete { background: none; border: none; color: var(--ink3); font-size: 18px; line-height: 1; padding: 0 2px; transition: color 0.1s; }
.room-delete:hover { color: var(--accent); }

.room-card-body { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.room-card-body.collapsed { display: none; }

.add-room-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 9px; background: none;
  border: 1px dashed var(--border); border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink3); transition: all 0.15s;
}
.add-room-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.rooms-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; margin-top: 8px;
  background: var(--ink); color: var(--bg); border-radius: var(--radius);
  font-size: 12px; font-weight: 700;
}
.rooms-total-val { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; }

.l-section-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink3); margin-bottom: 6px; margin-top: 4px; }

/* ===== FORM ELEMENTS ===== */
.field-group { margin-bottom: 20px; }
.field-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink2); margin-bottom: 7px; }
.field-hint { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--ink3); margin-top: 5px; line-height: 1.5; }

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.input-wrap { position: relative; }

input[type="number"], input[type="text"], select {
  width: 100%; padding: 10px 36px 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; color: var(--ink);
  outline: none; transition: border-color 0.15s, background 0.15s;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"]:focus, input[type="text"]:focus, select:focus { border-color: var(--accent); background: #fff; }
input[type="number"].small, input[type="text"].small { padding: 8px 32px 8px 10px; font-size: 14px; }

.input-unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.1em; color: var(--ink3); pointer-events: none; }

.seg-control { display: grid; gap: 2px; }
.seg-control.c2 { grid-template-columns: 1fr 1fr; }
.seg-control.c3 { grid-template-columns: 1fr 1fr 1fr; }

.seg-btn {
  padding: 9px 6px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-align: center; color: var(--ink3); transition: all 0.12s;
}
.seg-btn:hover { background: var(--accent-light); color: var(--ink); }
.seg-btn.active { background: var(--seg-bg, var(--accent)); color: #fff; border-color: transparent; }

.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type="range"] {
  -webkit-appearance: none; flex: 1; height: 3px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg); box-shadow: 0 1px 6px rgba(200,90,42,0.4);
}
.range-val { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; min-width: 52px; text-align: right; }

.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.check-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.check-row label { font-size: 12px; font-weight: 600; cursor: pointer; }

/* ===== COLLAPSIBLE ===== */
.collapsible { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.collapsible-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; cursor: pointer; background: var(--bg2);
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink2);
  transition: background 0.1s;
}
.collapsible-hdr:hover { background: var(--bg3); }
.collapsible-arrow { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--ink3); transition: transform 0.2s; }
.collapsible.open .collapsible-arrow { transform: rotate(90deg); }
.collapsible-body { padding: 16px 14px; display: none; }
.collapsible.open .collapsible-body { display: block; }

/* ===== CALC BUTTON ===== */
.calc-btn {
  width: 100%; padding: 15px; background: var(--ink); color: var(--bg);
  border: none; border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  transition: background 0.15s, transform 0.1s; margin-top: 8px;
}
.calc-btn:hover { background: var(--btn-hover, var(--accent)); }
.calc-btn:active { transform: scale(0.99); }

/* ===== RESULTS ===== */
.result-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--ink3); }
.result-empty-icon { font-size: 40px; opacity: 0.25; }
.result-empty-text { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.5; }

.result-block { display: none; }
.result-block.visible { display: block; }

.result-highlight {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--ink); color: var(--bg); padding: 18px 20px;
  border-radius: var(--radius); margin-bottom: 16px;
}
.result-highlight .rk { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.5; }
.result-highlight .rv { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; }
.result-highlight .rv small { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 400; opacity: 0.6; margin-left: 4px; }

.result-rows { display: flex; flex-direction: column; gap: 1px; background: var(--border); margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; background: var(--bg); padding: 10px 14px; gap: 12px; }
.rk { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink3); }
.rv { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; color: var(--ink); text-align: right; }
.rv small { font-size: 10px; color: var(--ink3); }

.sub-title { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink3); margin: 20px 0 10px; }

.note-box { background: var(--bg2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 20px; }
.note-box p { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--ink2); line-height: 1.6; }
.note-box p + p { margin-top: 6px; }

.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.action-btn {
  flex: 1; padding: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink2);
  transition: all 0.15s;
}
.action-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ===== PACK CARDS ===== */
.packs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px,1fr)); gap: 6px; margin-bottom: 20px; }
.pack-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 8px; text-align: center; }
.pack-card.best { border-color: var(--accent); background: var(--accent-light); }
.pack-qty { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; line-height: 1; }
.pack-unit { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--ink3); margin-top: 2px; }
.pack-tag { font-size: 9px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 3px; min-height: 12px; }

/* ===== OPTIONAL PRODUCT SECTION ===== */
.aff-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.aff-grid { display: flex; flex-direction: column; gap: 8px; }
.aff-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: all 0.15s;
}
.aff-card:hover { border-color: var(--accent); background: var(--accent-light); }
.aff-card-icon { font-size: 20px; flex-shrink: 0; }
.aff-card-info { flex: 1; }
.aff-card-name { font-size: 12px; font-weight: 700; }
.aff-card-qty { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--ink3); margin-top: 2px; }
.aff-card-arrow { color: var(--ink3); font-size: 14px; flex-shrink: 0; }
.aff-card:hover .aff-card-arrow { color: var(--accent); }

/* ===== ADSENSE READY SLOTS ===== */
.ad-slot {
  margin: clamp(18px,3vw,32px) clamp(16px,4vw,72px);
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  background: var(--bg2);
  color: var(--ink3);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ad-slot ins {
  display: block;
  width: min(970px,100%);
  min-height: 90px;
}



/* ===== ACCESSIBILITY + MICRO UX ===== */
.skip-link {
  position: absolute; left: 16px; top: -42px; z-index: 1000;
  padding: 10px 14px; background: var(--ink); color: var(--bg);
  border-radius: var(--radius); font-family: 'DM Mono', monospace; font-size: 11px;
  text-decoration: none; transition: top 0.15s;
}
.skip-link:focus { top: 12px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [contenteditable="true"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.save-status {
  min-height: 16px; margin-top: 8px; font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--ink3); line-height: 1.4;
}
.disclaimer-box {
  margin: 0 0 16px; padding: 10px 12px; background: var(--bg2);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  font-family: 'DM Mono', monospace; font-size: 10px; line-height: 1.6; color: var(--ink2);
}
.quick-demo {
  margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
}
.demo-btn {
  padding: 9px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; color: var(--ink2);
}
.demo-btn:hover { background: var(--accent-light); color: var(--ink); }
.aff-card.is-placeholder { opacity: .78; }
.aff-card.is-placeholder .aff-card-arrow { display: none; }
.seo-section {
  padding: clamp(40px,6vw,80px) clamp(16px,4vw,72px);
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,420px); gap: 32px;
}
.seo-section h2 { font-family: 'Playfair Display', serif; font-size: clamp(24px,3.5vw,40px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 16px; }
.seo-section p { color: var(--ink2); line-height: 1.7; font-size: 14px; margin-bottom: 14px; }
.seo-grid { display: grid; gap: 10px; }
.seo-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.seo-card h3 { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.seo-card p { font-family: 'DM Mono', monospace; font-size: 11px; margin: 0; }
.quick-answer { margin: 18px 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--bg2); color: var(--ink2); font-size: 14px; line-height: 1.7; }
.quick-answer strong { color: var(--ink); }
.value-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13px; }
.value-table th, .value-table td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.value-table th { background: var(--bg2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.formula-list { display: grid; gap: 10px; margin-top: 16px; }
.formula-list code { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); color: var(--ink); font-family: 'DM Mono', monospace; font-size: 11px; line-height: 1.6; white-space: normal; }
.guide-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.guide-links a { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-family: 'DM Mono', monospace; font-size: 11px; background: var(--bg2); }
.guide-links a:hover { border-color: var(--accent); color: var(--accent); }
@media(max-width:800px) { .seo-section { grid-template-columns: 1fr; } .quick-demo { grid-template-columns: 1fr; } }

/* ===== FAQ ===== */
.faq-section { padding: clamp(40px,6vw,80px) clamp(16px,4vw,72px); border-top: 1px solid var(--border); }
.faq-section h2 { font-family: 'Playfair Display', serif; font-size: clamp(24px,3.5vw,40px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 32px; }
.faq-list { max-width: 760px; display: flex; flex-direction: column; gap: 1px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q {
  width: 100%; border: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; cursor: pointer; background: var(--bg2);
  font-family: 'Syne', sans-serif; text-align: left;
  font-size: 14px; font-weight: 700; gap: 12px;
  transition: background 0.1s;
}
.faq-q:hover { background: var(--bg3); }
.faq-chevron { color: var(--ink3); font-size: 16px; flex-shrink: 0; transition: transform 0.2s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a { display: none; padding: 16px 20px; font-family: 'DM Mono', monospace; font-size: 12px; line-height: 1.7; color: var(--ink2); border-top: 1px solid var(--border); }
.faq-item.open .faq-a { display: block; }

/* ===== FOOTER ===== */
footer {
  padding: 24px clamp(16px,4vw,72px); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-note { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--ink3); letter-spacing: 0.08em; }
.footer-links { display: flex; gap: 20px; }
.footer-links { flex-wrap: wrap; }
.footer-links a { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--ink3); text-decoration: none; letter-spacing: 0.1em; text-transform: uppercase; transition: color 0.1s; }
.footer-links a:hover { color: var(--accent); }

/* ===== PRINT ===== */
@media print {
  body::before, .header-actions, .hero, .tab-nav, .panel-inputs,
  .faq-section, footer, .calc-panel:not(.active),
  .result-actions, .aff-section, .note-box { display: none !important; }
  header { position: static; }
  .panel-grid { grid-template-columns: 1fr !important; background: none !important; border: none !important; }
  .panel-results { padding: 0 !important; }
  .result-highlight { background: #e0e0e0 !important; color: #000 !important; }
  * { color: #000 !important; }
}

/* ===== RESPONSIVE ===== */
@media(max-width:600px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: row; flex-wrap: wrap; }
  .stat { text-align: left; border-right: none; border-left: 2px solid var(--accent); padding-right: 0; padding-left: 12px; }
}

/* Shared improvements for the calculator and its next steps. */
[hidden], .ad-slot[data-ads-status="disabled"] { display: none !important; }
.logo { text-decoration: none; color: var(--ink); }
.hero-title { text-wrap: balance; }
.room-mode { display: flex; gap: 4px; padding-bottom: 14px; }
.room-mode-btn {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--ink2); font: 600 12px 'Syne', sans-serif;
  transition: background .18s, color .18s, border-color .18s;
}
.room-mode-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.room-mode-btn:hover { border-color: var(--accent); }
.room-help { max-width: 60ch; margin: 0 0 12px; color: var(--ink2); font-size: 12px; line-height: 1.65; }
.room-help:last-child { margin-top: 10px; margin-bottom: 0; }
.calc-error { padding: 12px 0; color: var(--accent); font-size: 13px; line-height: 1.6; }
.rv, .room-area, .rooms-total-val, .pack-qty { font-variant-numeric: tabular-nums; }
.related-guides {
  margin: 0 clamp(16px,4vw,72px) clamp(24px,4vw,48px); padding: 22px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
}
.related-guides .section-label { margin: 0; }
.related-guides p { margin-top: 7px; font-size: 12px; color: var(--ink2); }
.related-guides nav { display: flex; gap: 20px; flex-wrap: wrap; }
.related-guides a { font-size: 13px; line-height: 1.6; color: var(--ink); text-decoration: none; text-underline-offset: 4px; }
.related-guides a:hover { color: var(--accent); text-decoration: underline; }
.related-guides a span { color: var(--accent); margin-left: 4px; }
@media(max-width:760px) {
  .related-guides { align-items: flex-start; flex-direction: column; gap: 14px; }
  .related-guides nav { gap: 12px 20px; }
  .panel-inputs, .panel-results { padding: 22px 18px; }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .room-card-header { gap: 8px; }
  .room-card-left { min-width: 0; }
  .room-card-right { flex-shrink: 0; }
  .room-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  input[type="number"], input[type="text"], select { font-size: 16px; }
}
@media(pointer:coarse) {
  .room-mode-btn, .room-delete, .room-shape-badge, .add-room-btn, .demo-btn, .action-btn { min-height: 44px; }
  .room-delete { min-width: 44px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .related-guides, .seo-section, .ad-slot, .calc-error { display: none !important; } }
