:root {
  --bg: #e9ece8;
  --bg-2: #f4f5f2;
  --surface: #fbfbfa;
  --ink: #1a221e;
  --muted: #5c675f;
  --line: #d3d8d2;
  --accent: #2f5d4a;
  --accent-2: #1e3d31;
  --warn: #8a5a2b;
  --shadow: 0 10px 30px rgba(26, 34, 30, 0.06);
  --radius: 14px;
  --font-display: "Geologica", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --container: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 93, 74, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(138, 90, 43, 0.06), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  min-height: 100vh;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-2);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.main {
  flex: 1;
  padding-bottom: 3rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(244, 245, 242, 0.86);
  border-bottom: 1px solid rgba(211, 216, 210, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 7px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-drop {
  position: relative;
}

.nav-drop-toggle {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}

.nav-drop-toggle:hover,
.nav-drop.is-current .nav-drop-toggle,
.nav-drop.open .nav-drop-toggle {
  color: var(--ink);
}

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: var(--shadow);
  z-index: 50;
}

.nav-drop.open .nav-drop-menu {
  display: flex;
}

.nav-drop-menu a {
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-drop-menu a:hover {
  background: var(--bg-2);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

/* Hero */
.hero {
  padding: 2.5rem 0 1rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title,
.calc-header h1,
.section-head h1,
.section-head h2,
.prose h1,
.prose h2,
.admin-main h1,
.admin-main h2,
.admin-login h1 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 600;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.75rem, 5.5vw, 3rem);
  line-height: 1.15;
}

.hero-lead {
  color: var(--muted);
  font-size: 1.08rem;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.lead p {
  margin: 0 0 1rem;
}

.lead p:last-child {
  margin-bottom: 0;
}

.section {
  padding-top: 1.5rem;
}

.section-head {
  margin-bottom: 1.25rem;
}

.section-head h1,
.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

/* Tiles */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.calc-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 118px;
}

.calc-tile:hover {
  transform: translateY(-2px);
  border-color: #b7c4bb;
  box-shadow: 0 14px 34px rgba(26, 34, 30, 0.09);
  color: inherit;
}

.calc-tile-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: linear-gradient(160deg, #dfe8e2, #cfdad3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  flex-shrink: 0;
}

.calc-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.calc-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calc-title-row h1 {
  margin: 0;
}

.calc-page-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: linear-gradient(160deg, #dfe8e2, #cfdad3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
  flex-shrink: 0;
}

.calc-page-icon .calc-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.calc-tile-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.calc-tile-desc {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.calc-tile-cat {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--accent-2);
  letter-spacing: 0.02em;
}

.calc-tile[hidden] {
  display: none !important;
}

/* Catalog search + category chips */
.calc-toolbar {
  position: sticky;
  top: 64px;
  z-index: 25;
  margin: 0 -0.35rem 1.1rem;
  padding: 0.55rem 0.35rem 0.7rem;
  background: rgba(244, 245, 242, 0.92);
  backdrop-filter: blur(10px);
}

.calc-search {
  display: block;
  position: relative;
  margin-bottom: 0.7rem;
}

.calc-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: inline-flex;
}

.calc-search-icon .calc-icon {
  width: 1.2rem;
  height: 1.2rem;
}

.calc-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0.85rem 0.95rem 0.85rem 2.7rem;
  min-height: 52px;
}

.calc-search input:focus {
  outline: 2px solid rgba(47, 93, 74, 0.28);
  outline-offset: 1px;
  border-color: #b7c4bb;
}

.calc-search input::-webkit-search-cancel-button {
  appearance: none;
  height: 1rem;
  width: 1rem;
  background: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='1.6' d='M4 4l8 8M12 4l-8 8'/></svg>") center / contain no-repeat;
  opacity: 0.45;
  cursor: pointer;
}

.calc-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.calc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.calc-chip:hover {
  border-color: #b7c4bb;
  color: var(--ink);
}

.calc-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #f7faf8;
}

.calc-chip.is-active:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #f7faf8;
}

.calc-filter-meta {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.calc-empty {
  margin: 1.25rem 0 0;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* Calculator page */
.calc-page {
  padding-top: 1.75rem;
}

.calc-header {
  margin-bottom: 1.5rem;
}

.calc-header .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.calc-header .eyebrow a:hover {
  color: var(--accent);
}

.calc-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

#calc-result {
  scroll-margin-top: 84px;
}

.calc-panel,
.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calc-panel {
  padding: 1.1rem;
}

.calc-form {
  display: grid;
  gap: 0.85rem;
}

.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.field .unit {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.field input,
.field select,
.field textarea,
.admin-form input,
.admin-filters input,
.admin-filters select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.85rem 0.9rem;
  min-height: 52px;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.4;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(47, 93, 74, 0.28);
  border-color: var(--accent);
}

.hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field[hidden] {
  display: none;
}

.form-actions {
  margin-top: 0.35rem;
}

.form-actions .btn {
  width: 100%;
}

.form-actions .btn.is-done {
  background: var(--accent-2);
}

.result-card {
  padding: 1.15rem 1.2rem;
  position: sticky;
  top: 84px;
}

.result-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.result-fresh {
  display: inline-block;
  margin-left: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent);
  vertical-align: middle;
}

.result-fresh[hidden] {
  display: none;
}

.result-card.is-fresh {
  animation: result-flash 0.7s ease;
  border-color: var(--accent);
}

@keyframes result-flash {
  0% {
    box-shadow: 0 0 0 3px rgba(47, 93, 74, 0.28);
    background: #f3f8f5;
  }
  100% {
    box-shadow: var(--shadow);
    background: var(--surface);
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-card.is-fresh {
    animation: none;
  }
}

.result-summary {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-2);
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.55rem 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.result-list li.highlight {
  background: rgba(47, 93, 74, 0.06);
  margin: 0 -0.5rem;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  border-bottom: none;
}

.result-list .label {
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
}

.result-list .value {
  font-weight: 600;
  text-align: right;
  flex: 0 0 auto;
  margin-left: auto;
}

.result-list .note {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}

.result-details {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent);
  color: #f7faf8;
}

.btn-primary:hover {
  background: var(--accent-2);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: #b7c4bb;
}

.disclaimer {
  margin: 1rem 0 0;
  color: var(--warn);
  font-size: 0.8rem;
}

.prose {
  margin-top: 2.5rem;
}

.feedback-hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.prose h2 {
  margin: 1.8rem 0 0.6rem;
  font-size: 1.35rem;
}

.prose p {
  color: var(--muted);
}

.howto-steps {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--muted);
}

.howto-steps li {
  margin: 0.5rem 0;
}

.howto-steps strong {
  color: var(--ink);
  font-weight: 600;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
}

.faq p {
  margin: 0.5rem 0 0;
}

.related {
  margin-top: 2rem;
}

.related h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.related-list a {
  display: inline-flex;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
}

.related-list a:hover {
  border-color: var(--accent);
}

.related-more {
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
}

/* Lifehacks / blog */
.hack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.hack-grid-related {
  grid-template-columns: repeat(2, 1fr);
}

.hack-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 1.05rem 1.15rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 8.5rem;
}

.hack-card:hover {
  transform: translateY(-2px);
  border-color: #b7c4bb;
  box-shadow: 0 14px 34px rgba(26, 34, 30, 0.09);
  color: inherit;
}

.hack-card-cat {
  font-size: 0.75rem;
  color: var(--accent-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hack-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hack-card-excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.hack-card[hidden] {
  display: none !important;
}

.hack-page {
  padding-top: 1.5rem;
  max-width: 46rem;
}

.hack-page .calc-header h1 {
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  margin: 0 0 0.75rem;
}

.hack-page .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.hack-page .eyebrow a:hover {
  color: var(--accent);
}

.hack-body {
  margin-top: 0.5rem;
}

.hack-body p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 1.05rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--ink);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  background: rgba(251, 251, 250, 0.7);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand p {
  max-width: 28rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Admin */
.admin-body {
  background: #eef1ee;
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
}

.admin-header {
  background: #1e2a24;
  color: #eef3f0;
  padding: 0.9rem 0;
}

.admin-header a {
  color: #d7e4dc;
  text-decoration: none;
  margin-left: 1rem;
}

.admin-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-main {
  padding: 1.5rem 0 3rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin: 1rem 0 1.5rem;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #f5f7f5;
  font-weight: 600;
}

.input-preview,
.json-block {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  margin: 0;
  max-width: 360px;
}

.ua {
  max-width: 180px;
  word-break: break-all;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-login {
  max-width: 420px;
  padding: 4rem 1rem;
}

.admin-form,
.admin-filters {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.admin-filters {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.form-error {
  color: #8b2e2e;
  background: #f8eaea;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
}

.muted {
  color: var(--muted);
}

.pager {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.row-unread td {
  background: rgba(47, 93, 74, 0.06);
}

/* Print */
.print-watermark {
  display: none;
}

@media print {
  @page {
    margin: 12mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    overflow: visible !important;
  }

  .site-header,
  .site-footer,
  .result-actions,
  .calc-panel,
  .related,
  .prose,
  .modal,
  .nav-toggle,
  .feedback-hint,
  .calc-page-icon {
    display: none !important;
  }

  /* Водяной знак поверх контента — его не перекрывают блоки с фоном */
  .print-watermark {
    display: block !important;
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    pointer-events: none !important;
    font-family: var(--font-display), sans-serif;
    font-size: 56pt;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1;
    color: rgba(0, 0, 0, 0.12) !important;
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(-32deg);
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .print-watermark::after {
    content: "build-helper.ru";
  }

  .page,
  .main,
  .container,
  .calc-page,
  .calc-layout,
  .calc-result,
  .result-card,
  .calc-header,
  .result-list,
  .result-list li,
  .result-summary,
  .disclaimer {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .container,
  .calc-page.container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .calc-layout {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    width: 100% !important;
  }

  .calc-result,
  .result-card {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    position: static !important;
    float: none !important;
  }

  .calc-header {
    margin: 0 0 1.2rem !important;
    padding: 0 !important;
  }

  .result-list {
    display: block !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .result-list li,
  .result-list li.highlight {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0.45rem 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid #ddd !important;
    list-style: none !important;
  }

  .result-list .label {
    flex: 1 1 auto !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .result-list .value {
    flex: 0 0 auto !important;
    text-align: right !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
  }

  .result-list .note {
    max-width: none !important;
    text-align: right !important;
  }

  .main {
    padding: 0 !important;
  }
}

/* Modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 28, 24, 0.45);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(26, 34, 30, 0.18);
  padding: 1.25rem 1.3rem 1.4rem;
}

.modal-dialog h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.modal-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.feedback-form {
  display: grid;
  gap: 0.75rem;
}

.feedback-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
  font-size: 0.92rem;
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.75rem 0.85rem;
}

.feedback-form textarea {
  resize: vertical;
  min-height: 110px;
}

.form-success {
  margin: 0;
  color: var(--accent-2);
  background: rgba(47, 93, 74, 0.08);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 960px) {
  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc-layout {
    grid-template-columns: 1fr;
  }

  .result-card {
    position: static;
  }

  .admin-stats,
  .admin-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    position: absolute;
    right: 1rem;
    top: 64px;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.4rem;
    min-width: 180px;
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.75rem 0.9rem;
  }

  .nav-drop-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.9rem;
    pointer-events: none;
  }

  .nav-drop-menu {
    position: static;
    display: flex;
    transform: none;
    left: auto;
    top: auto;
    min-width: 0;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.2rem 0.5rem;
    background: transparent;
  }

  .calc-grid,
  .hack-grid,
  .hack-grid-related {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 1.6rem;
  }

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

  .calc-tile {
    min-height: 0;
  }

  .calc-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -0.35rem;
    padding-inline: 0.35rem;
  }

  .calc-cats::-webkit-scrollbar {
    display: none;
  }

  .calc-chip {
    flex-shrink: 0;
    min-height: 44px;
  }

  .field input,
  .field select,
  .field textarea,
  .calc-search input {
    font-size: 16px; /* prevent iOS zoom */
  }
}

/* Room planner */
body.planner-body {
  overflow: hidden;
}

body.planner-body .page {
  height: 100dvh;
  min-height: 100dvh;
}

body.planner-body .site-footer,
body.planner-body .print-watermark {
  display: none;
}

body.planner-body .main {
  padding-bottom: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.planner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #dfe3dc;
}

.planner-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.2rem;
  padding: 0.7rem 1rem;
  background: rgba(251, 251, 250, 0.94);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.planner-bar-copy {
  flex: 1 1 220px;
  min-width: 0;
}

.planner-bar-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.planner-bar-copy p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.planner-bar-copy .feedback-hint {
  margin-top: 0.35rem;
}

.planner-bar-room {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
}

.planner-bar-room label,
.planner-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
}

#el-run-elev-wrap {
  display: contents;
}

#el-run-elev-wrap[hidden] {
  display: none !important;
}

.planner-bar-room input[type="number"],
.planner-bar-room select,
.planner-fields input[type="number"],
.planner-fields input[type="text"],
.planner-fields select {
  width: 5.2rem;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.45rem;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}

.planner-fields input[type="text"],
.planner-fields select {
  width: 100%;
}

.planner-bar-room input[type="color"],
.planner-fields input[type="color"] {
  width: 2.6rem;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.planner-bar-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.planner-bar-views .btn {
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.planner-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  flex: 1;
  min-height: 0;
}

.planner-stage {
  position: relative;
  min-height: 0;
  background: #c5cec4;
}

#planner-canvas,
#electro-canvas,
#tiles-canvas {
  position: absolute;
  inset: 0;
}

#planner-canvas canvas,
#electro-canvas canvas,
#tiles-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.planner-hint,
.planner-status,
.planner-fallback {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  font-size: 0.8rem;
  pointer-events: none;
}

.planner-hint {
  bottom: 2.7rem;
  color: #1a221e;
  background: rgba(251, 251, 250, 0.78);
}

.planner-status {
  bottom: 0.65rem;
  font-weight: 500;
  background: rgba(251, 251, 250, 0.9);
}

.planner-status[data-level="ok"] {
  color: var(--accent-2);
}

.planner-status[data-level="warn"] {
  color: var(--warn);
}

.planner-status[data-level="bad"] {
  color: #8a2b2b;
}

.planner-fallback {
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  background: var(--surface);
  pointer-events: auto;
}

.planner-side {
  overflow: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 0.85rem 0.9rem 1.4rem;
}

.planner-side h2 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-family: var(--font-display);
}

.planner-side section + section {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.el-back-row {
  margin: 0 0 0.5rem;
}

.el-back-row .btn {
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  font-size: 0.84rem;
}

.planner-catalog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.planner-catalog button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  text-align: center;
}

.el-cat-title {
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
}

.el-cat-hint {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.25;
}

.el-nudge-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

@keyframes el-clear-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(47, 93, 74, 0.4);
    border-color: var(--accent);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(47, 93, 74, 0);
    border-color: var(--accent-2);
  }
}

#el-btn-clear.is-pulse {
  animation: el-clear-pulse 1.7s ease-in-out infinite;
  color: var(--accent-2);
}

.el-nudge-btn {
  flex: 1;
  min-height: 40px;
  padding: 0.3rem 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.el-nudge-btn svg {
  display: block;
}

.btn-danger {
  background: #c4473a;
  border-color: #b23d32;
  color: #fff;
}

.btn-danger:hover {
  background: #a3362c;
  border-color: #a3362c;
  color: #fff;
}

.planner-fields input[type="number"] {
  width: 100%;
}

.planner-bar-room select {
  width: auto;
  min-width: 8.5rem;
}

.planner-catalog button:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.planner-catalog button.is-active {
  border-color: var(--accent);
  background: #e7eee9;
  color: var(--accent-2);
}

.planner-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.5rem;
}

.planner-fields .span-2 {
  grid-column: span 2;
}

.planner-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.planner-item-actions.el-back-row {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.planner-item-actions .btn {
  min-height: 40px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.planner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.planner-list button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f4f5f2;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink);
}

.planner-list button.is-active {
  border-color: var(--accent);
  background: #e7eee9;
}

.planner-list .muted {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.planner-teaser-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.planner-teaser-card:hover {
  border-color: #b7c4bb;
  color: inherit;
}

.planner-teaser-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.planner-teaser-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.el-note {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.planner-fields .el-note {
  margin: 0;
}

.el-bom {
  font-size: 0.82rem;
}

.el-bom-list,
.el-bom-groups {
  list-style: none;
  margin: 0;
  padding: 0;
}

.el-bom-list li,
.el-bom-groups li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.el-bom-groups li {
  flex-direction: column;
  gap: 0.15rem;
}

.el-bom-groups li span {
  color: var(--muted);
  font-size: 0.75rem;
}

.el-bom a {
  font-weight: 500;
}

.tile-surfaces {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.tile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
}

.tile-chip:has(input:checked) {
  border-color: var(--accent);
  background: #eef4f0;
}

.tile-chip input {
  margin: 0;
  accent-color: var(--accent);
}

button.tile-chip {
  font: inherit;
}

button.tile-chip.is-active {
  border-color: var(--accent);
  background: #eef4f0;
}

.planner-item-actions .btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tile-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tile-swatch {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 2px solid #c5cdc4;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.tile-swatch.is-active {
  border-color: var(--accent, #2f5d4a);
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.tile-swatch-custom {
  border-style: dashed;
}

.tile-swatch-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  border: 1px solid #c5cdc4;
  vertical-align: -0.1rem;
  margin-right: 0.35rem;
}

.planner-docs {
  padding: 0;
}

.planner-docs h2,
.planner-docs h3 {
  margin: 1.15rem 0 0.45rem;
  font-size: 1.05rem;
}

.planner-docs h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.planner-docs .related-list {
  margin-top: 0.6rem;
}

.planner-help-dialog {
  width: min(100%, 680px);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 1.2rem 1.35rem 1.5rem;
}

.planner-confirm-dialog {
  width: min(100%, 420px);
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1.05rem;
}

#planner-confirm-modal {
  z-index: 110;
}

.planner-print-sheet {
  display: none;
}

@media (max-width: 960px) {
  .planner-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(42vh, 1fr) minmax(0, 42vh);
  }

  .planner-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .planner-hint {
    display: none;
  }
}

@media (max-width: 640px) {
  body.planner-body {
    overflow: auto;
  }

  body.planner-body .page {
    height: auto;
    min-height: 100dvh;
  }

  .planner-bar-copy h1 {
    font-size: 1.05rem;
  }

  .planner-teaser-card {
    flex-direction: column;
    align-items: stretch;
  }

  .planner-help-dialog {
    max-height: 92vh;
  }
}

@media print {
  body.planner-print .site-header,
  body.planner-print .site-footer,
  body.planner-print .planner,
  body.planner-print .planner-docs,
  body.planner-print .modal {
    display: none !important;
  }

  body.planner-print .print-watermark {
    display: none !important;
  }

  body.planner-print .page,
  body.planner-print .main {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.planner-print .planner-print-sheet {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.planner-print .planner-print-sheet img {
    display: block;
    width: 100%;
    height: auto;
  }
}
