* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

/* Шапка на всю ширину */
.site-header-bar {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
  margin-bottom: 24px;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.site-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
  line-height: 1;
  font-family: inherit;
}

.site-logo .logo-calc {
  color: #2563eb;
}

.site-logo .logo-o {
  color: #1d4ed8;
  font-weight: 800;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.breadcrumb {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 16px;
}

.breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.header {
  margin-bottom: 24px;
  text-align: center;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b, #2c3e66);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.header p {
  color: #334155;
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.95rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .header h1 {
    font-size: 1.5rem;
  }
}

.panel {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

.panel h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 18px 0;
  color: #1e293b;
  border-left: 5px solid #3b82f6;
  padding-left: 14px;
}

.panel.accent-orange h2 {
  border-left-color: #ea580c;
}

.panel.accent-concrete h2 {
  border-left-color: #475569;
}

.form-type-hint {
  display: none;
}

.form-type-hint.visible {
  display: block;
}

.concrete-shape {
  fill: #cbd5e1;
  stroke: #475569;
  stroke-width: 1.5;
}
.concrete-shape-inner {
  fill: #94a3b8;
  stroke: #334155;
  stroke-width: 1;
}

.param-row {
  margin-bottom: 16px;
}

.param-row label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #475569;
  margin-bottom: 6px;
}

.param-row input,
.param-row select {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: #fefefe;
  transition: 0.2s;
  font-weight: 500;
  color: #0f172a;
}

.param-row input:focus,
.param-row select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.param-row input[readonly] {
  background: #f8fafc;
  color: #64748b;
}

.input-hint {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 5px;
  margin-left: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 14px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  border: 1px solid #f0f2f5;
  text-align: center;
}

.stat-card span:first-child {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #5b6e8c;
  letter-spacing: 0.4px;
  display: block;
  margin-bottom: 8px;
}

.stat-card b {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f2b3d;
  line-height: 1.2;
  word-break: break-word;
}

.stat-card.highlight b {
  color: #2563eb;
}

@media (max-width: 550px) {
  .stat-card b {
    font-size: 1.15rem;
  }
}

.svg-container {
  background: #f9fafb;
  border-radius: 28px;
  width: 100%;
  overflow-x: auto;
  min-height: 240px;
}

svg {
  display: block;
  width: 100%;
  height: auto;
}

.whole-tile { fill: #bbf7d0; stroke: #2b7e3a; stroke-width: 1.2; }
.cut-tile { fill: #fed7aa; stroke: #b45309; stroke-width: 1.2; stroke-dasharray: 3 2; }
.brick-cell { fill: #fecaca; stroke: #b91c1c; stroke-width: 0.6; }
.brick-cut { fill: #fed7aa; stroke: #c2410c; stroke-width: 0.8; stroke-dasharray: 2 1; }
.mortar-gap { fill: #e2e8f0; }

.color-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding: 8px 16px;
  background: #ffffffcc;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 500;
  flex-wrap: wrap;
  justify-content: center;
}

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

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-color.whole { background: #bbf7d0; border-color: #2b7e3a; }
.legend-color.cut { background: #fed7aa; border-color: #b45309; }
.legend-color.brick { background: #fecaca; border-color: #b91c1c; }
.legend-color.brick-cut { background: #fed7aa; border-color: #c2410c; }

/* Каталог на главной */
.hero {
  text-align: center;
  padding: 28px 16px 32px;
  background: linear-gradient(160deg, #fff 0%, #e0f2fe 100%);
  border-radius: 28px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero p {
  color: #475569;
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #334155;
  margin: 24px 0 14px;
  padding-left: 12px;
  border-left: 4px solid #3b82f6;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.calc-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}

.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  border-color: #93c5fd;
}

.calc-card .icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.calc-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.calc-card p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
}

.related-block {
  margin-top: 28px;
  padding: 18px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.related-block h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: #334155;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-links a {
  font-size: 0.85rem;
  padding: 8px 14px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.related-links a:hover {
  background: #dbeafe;
}

#calco-footer {
  margin-top: 8px;
}

footer.site-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
  padding-bottom: 16px;
}

.liveinternet-counter {
  margin-top: 12px;
  line-height: 0;
}

.liveinternet-counter a {
  display: inline-block;
  opacity: 0.85;
}

.liveinternet-counter a:hover {
  opacity: 1;
}

/* SEO-тексты */
.seo-article {
  margin-top: 32px;
  background: #fff;
  padding: 24px 22px;
  border-radius: 24px;
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.65;
  border: 1px solid #e2e8f0;
}

.seo-article h2 {
  font-size: 1.15rem;
  color: #1e293b;
  margin: 28px 0 12px;
  font-weight: 700;
}

.seo-article h2:first-child {
  margin-top: 0;
}

.seo-article h3 {
  font-size: 1rem;
  color: #334155;
  margin: 20px 0 8px;
  font-weight: 600;
}

.seo-article p {
  margin-bottom: 12px;
}

.seo-article ul,
.seo-article ol {
  margin: 0 0 14px 1.25rem;
}

.seo-article li {
  margin-bottom: 6px;
}

.seo-article .formula {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  margin: 12px 0;
  border-left: 3px solid #3b82f6;
}

.mortar-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.hidden-block {
  display: none;
}

.hidden-block.visible {
  display: block;
}
