:root {
  --accent: #cdeb5a;
  --paper: #f2f1ec;
  --ink: #111513;
  --forest: #17302a;
  --olive: #4f6b3a;
  --muted: #3b4540;
  --muted-2: #4a524e;
  --muted-dark: #c9d3cd;
  --side-muted: #a9b4ae;
  --line: #d6d6ce;
  --sand: #e6e5dd;
  --field: #c4c4ba;
  --danger: #b3261e;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--olive); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin: 0; }
.booting { padding: 48px; color: var(--muted-2); }

/* Layout */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar {
  flex: 1 1 240px; max-width: 280px; background: var(--ink); color: var(--paper);
  padding: 28px 20px; display: flex; flex-direction: column; gap: 28px;
}
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; outline: none; }

@media (max-width: 860px) {
  .sidebar { max-width: none; flex-basis: 100%; padding: 16px; gap: 14px; }
  .tabs { flex-direction: row !important; overflow-x: auto; }
  .tab { flex: 0 0 auto; gap: 8px; }
  .sidebar-foot { flex-direction: row !important; flex-wrap: wrap; align-items: center; margin-top: 0 !important; }
  .main { padding: 24px 16px 48px; }
}

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 18px;
}
.brand-name { display: block; font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; line-height: 1; }
.brand-sub { display: block; font-size: 12px; color: var(--side-muted); }

/* Sidebar nav */
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tab {
  min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--paper);
  font: inherit; font-size: 15px; font-weight: 500; text-align: left; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
.tab:hover { background: #222a26; }
.tab.active { background: var(--accent); color: var(--ink); }
.tab-count { font-size: 12px; color: var(--side-muted); }
.tab.active .tab-count { color: var(--ink); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 8px; }
.live-link { color: var(--accent); font-size: 14px; font-weight: 600; }
.signed-in { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--side-muted); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: #2a3330; color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.sidebar .link-btn { color: var(--side-muted); }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.page-head h1 { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; text-transform: uppercase; }
.page-head p { color: var(--muted-2); font-size: 15px; }
.publish-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.save-state { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.small-link { font-size: 13px; font-weight: 600; }

/* Buttons */
.btn {
  min-height: 44px; border-radius: 999px; padding: 0 18px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink);
  text-decoration: none; color: var(--ink); background: #fff;
}
.btn:disabled { cursor: not-allowed; opacity: 0.45; }
.btn-primary { background: var(--ink); color: var(--paper); font-size: 15px; padding: 0 22px; min-height: 46px; }
.btn-primary:not(:disabled):hover { background: var(--forest); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--sand); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fbeceb; }
.btn-block { width: 100%; }
.btn.is-busy { opacity: 0.6; cursor: wait; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; cursor: pointer; min-height: 24px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-size: 16px; color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* Alerts */
.alert { border-radius: 14px; padding: 14px 18px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.alert ul { margin: 6px 0 0; padding-left: 20px; flex-basis: 100%; }
.alert-error { background: #fbeceb; border: 1px solid #e8b4b0; color: #7a1a14; }
.alert-warn { background: #fff4e0; border: 1px solid #f0cf94; color: #5c3b00; }
.alert-info, .alert-ok { background: #eef5dc; border: 1px solid #c9dc95; color: #2f4a22; }

/* Cards and grids */
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { font-size: 18px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.card-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 720px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { gap: 6px; padding: 22px; border-radius: 16px; }
.stat-label { font-size: 13px; color: var(--muted-2); font-weight: 500; }
.stat-value { font-family: var(--display); font-weight: 800; font-size: 48px; line-height: 1; }
.stat-date { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; }
.todo { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-2); }
.eyebrow.on-dark { color: var(--accent); font-size: 11px; }
.hint { font-size: 13px; color: var(--muted-2); }
.empty { background: #fff; border: 1px dashed var(--field); border-radius: 18px; padding: 48px; text-align: center; color: var(--muted-2); }
.ok-text { color: #2f4a22; font-weight: 600; }

/* List + editor */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.list-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.edit-col { flex: 2 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted-2); }
.list-item { display: flex; align-items: stretch; gap: 6px; }
.list-pick {
  flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  text-align: left; font: inherit; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.list-item.selected .list-pick { border: 2px solid var(--ink); padding: 13px 15px; }
.list-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-title { font-weight: 600; font-size: 15px; }
.list-sub { font-size: 13px; color: var(--muted-2); }
.reorder { display: flex; flex-direction: column; gap: 4px; }
.reorder .icon-btn { height: 30px; width: 36px; min-height: 0; }
@media (pointer: coarse) { .reorder { flex-direction: row; } .reorder .icon-btn { height: 44px; width: 44px; } }
.chip { flex: 0 0 auto; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--sand); color: var(--ink); }
.chip-live { background: var(--accent); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row > .field { flex: 1 1 160px; }
.field label, .label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea, .login-card input {
  width: 100%; min-height: 46px; border-radius: 10px; border: 1px solid var(--field); padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.field select { padding: 0 10px; }
.field textarea { padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field [aria-invalid='true'] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-error { font-size: 13px; color: var(--danger); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.toggles { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Switch */
.switch { min-height: 44px; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 0; }
.switch-track { width: 44px; height: 26px; border-radius: 999px; background: var(--field); position: relative; display: block; transition: background 0.15s; }
.switch-track.on { background: var(--olive); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; display: block; transition: left 0.15s; }
.switch-track.on .switch-knob { left: 21px; }

/* Images */
.image-field { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.image-field:last-child { border-bottom: 0; }
.image-preview {
  height: 200px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 13px; text-align: center; padding: 0;
  background: repeating-linear-gradient(135deg, #deddd4 0 14px, #e7e6de 14px 28px);
}
.image-preview.dark { background: repeating-linear-gradient(135deg, #22403a 0 14px, #1c3832 14px 28px); color: var(--muted-dark); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Site grid + hero preview */
.site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 24px; align-items: start; }
.hero-preview { background: var(--forest); color: var(--paper); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.hero-preview-badge { align-self: flex-start; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.hero-preview-head { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 0.95; text-transform: uppercase; }
.hero-preview-sub { font-size: 14px; color: var(--muted-dark); }

/* Testimonial previews (mirror the public site) */
.preview-card { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 28px; display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.preview-card blockquote { margin: 0; font-size: 17px; }
.preview-card figcaption, .preview-featured figcaption { font-weight: 600; }
.preview-result { display: flex; align-items: baseline; gap: 10px; font-family: var(--display); font-weight: 800; text-transform: uppercase; flex-wrap: wrap; }
.preview-result .before { font-size: 28px; color: var(--muted-2); text-decoration: line-through; }
.preview-result .arrow { font-size: 20px; color: var(--muted-2); }
.preview-result .after { font-size: 56px; line-height: 1; }
.preview-result .unit { font-size: 16px; color: var(--muted-2); }
.preview-featured { margin: 0; background: var(--accent); border-radius: 22px; padding: 32px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.preview-featured > div { flex: 1 1 280px; display: flex; flex-direction: column; gap: 14px; }
.preview-featured blockquote { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 500; }
.preview-quote-mark { font-family: var(--display); font-weight: 800; font-size: 110px; line-height: 0.6; }

/* Service preview */
.preview-service { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 28px; display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.preview-service.featured { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.preview-service h3 { font-family: var(--display); font-weight: 800; font-size: 32px; text-transform: uppercase; line-height: 1; }
.preview-service p { color: var(--muted); }
.preview-service.featured p { color: var(--muted-dark); }
.preview-service ul { margin: 0; padding-left: 20px; }
.preview-tag { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.preview-service.featured .preview-tag { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.preview-price { border-top: 1px solid var(--line); padding-top: 14px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.preview-service.featured .preview-price { border-color: var(--muted); }
.preview-price > span:first-child { font-family: var(--display); font-weight: 700; font-size: 26px; }
.preview-price small { font-family: Inter, sans-serif; font-size: 13px; font-weight: 500; }

/* Login */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--forest); }
.login-card { background: #fff; border-radius: 24px; padding: 36px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.login-card .brand { padding: 0; }
.login-card .brand-sub { color: var(--muted-2); }
.login-card h1 { font-family: var(--display); font-weight: 800; font-size: 40px; text-transform: uppercase; line-height: 1; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card label { font-size: 14px; font-weight: 600; }
.login-card .btn { margin-top: 8px; }
.preview-small { font-size: 13px; }
