:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --line: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --accent: #4f97b7;
  --accent-dark: #3f7f9d;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #166534;
  --ok-soft: #f0fdf4;
  --info-soft: #eff6ff;
  --shadow: 0 10px 25px rgba(17, 24, 39, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fafc 0, var(--bg) 180px, var(--bg) 100%);
  line-height: 1.5;
}

a { color: var(--accent-dark); }

.site-header {
  padding: 32px 0 18px;
}
.site-header.simple { padding-bottom: 8px; }
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
}
.narrow { max-width: 760px; }
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.header-inner.single { grid-template-columns: minmax(0, 1fr); }

.header-inner > *,
.grid > *,
.items-row > *,
.section-head > * {
  min-width: 0;
}

input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"] {
  min-height: 48px;
}
.brand-mark {
  margin: 0 0 18px;
}
.brand-mark img {
  display: block;
  width: min(100%, 300px);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(17, 24, 39, 0.08));
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}
h2 {
  margin: 0;
  font-size: 22px;
}
h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
p { margin: 0 0 12px; }
.lead {
  color: #374151;
  max-width: 760px;
}
.no-margin { margin: 0; }

.page-grid,
.stack-lg {
  display: grid;
  gap: 18px;
}
.stack-md { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 10px; }
.card {
  background: var(--card);
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card.compact { padding: 18px; }
.success-card {
  background: linear-gradient(180deg, #ffffff 0, var(--ok-soft) 100%);
}
.success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ok);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}
.section-head {
  display: grid;
  gap: 4px;
}
.section-head.between,
.actions.between {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.center { align-items: center; }
.small {
  font-size: 14px;
  color: var(--muted);
}
.muted { color: var(--muted); }
.success { color: var(--ok); }
.error { color: var(--danger); }
.status-line {
  min-height: 22px;
  font-weight: 700;
}

.notice {
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid transparent;
}
.notice.info {
  background: var(--info-soft);
  border-color: #bfdbfe;
}
.notice.ok {
  background: var(--ok-soft);
  border-color: #bbf7d0;
}
.notice.error {
  background: var(--danger-soft);
  border-color: #fecaca;
}
.empty-state {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.nested-grid { align-items: end; }
.full-width { grid-column: 1 / -1; }

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #9ca3af;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(29, 78, 216, 0.12);
  border-color: var(--accent);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}
button.secondary { background: #374151; }
button.danger { background: var(--danger); }
button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.items-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  align-items: end;
  padding: 14px 0;
  border-bottom: 1px solid #e5e7eb;
}
.items-row:last-child { border-bottom: none; padding-bottom: 0; }
.item-meta { display: grid; gap: 3px; }
.item-prices { color: var(--muted); font-size: 14px; }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.step-box {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 14px;
  padding: 16px;
}
.step-box span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-bottom: 12px;
}
.step-box strong { display: block; margin-bottom: 6px; }

.plain-list,
.segment-list {
  margin: 0;
  padding-left: 18px;
}
.compact-list { gap: 4px; }
.segment-card {
  background: var(--card-soft);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
}
.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.availability-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.availability-item.ok { border-color: #bbf7d0; background: var(--ok-soft); }
.availability-item.fail { border-color: #fecaca; background: var(--danger-soft); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.fail { background: #fee2e2; color: var(--danger); }
.badge.neutral { background: #e5e7eb; color: #374151; }

.summary-table {
  width: 100%;
  border-collapse: collapse;
}
.summary-table th,
.summary-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.summary-table th { background: #f9fafb; }
.right { text-align: right; }

.quote-totals {
  display: grid;
  gap: 8px;
}
.quote-total-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}
.quote-total-row.strong {
  font-weight: 700;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wrap-actions { align-items: center; }
.sticky-submit {
  position: sticky;
  bottom: 12px;
  z-index: 5;
}
.hidden { display: none !important; }

@media (max-width: 860px) {
  .header-inner { grid-template-columns: 1fr; }
  .section-head.between,
  .actions.between { flex-direction: column; align-items: stretch; }
  .sticky-submit { position: static; }
}

@media (max-width: 640px) {
  body { background: var(--bg); }
  .wrap { padding: 0 14px; }
  .card { padding: 18px; border-radius: 14px; }
  .items-row { grid-template-columns: 1fr; }
  .summary-table th:nth-child(2),
  .summary-table td:nth-child(2) { width: 80px; }
  .grid-2,
  .nested-grid,
  .availability-grid {
    grid-template-columns: 1fr;
  }
  .brand-mark img {
    width: min(100%, 230px);
  }
  button,
  .button-link {
    width: 100%;
  }
  .section-head.between button {
    width: 100%;
  }
}

.site-footer {
  margin-top:40px;
  padding:20px 0;
  text-align:center;
  font-size:14px;
  color:#6b7280;
}
.site-footer a {
  color:inherit;
  text-decoration:none;
}
.site-footer a:hover {
  text-decoration:underline;
}
