/* ---- tokens ---------------------------------------------------------- */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --line: #e2e6ec;
  --line-strong: #cdd4de;
  --ink: #16191f;
  --ink-2: #545c69;
  --ink-3: #838d9c;
  --accent: #1f5fd8;
  --accent-ink: #ffffff;
  --ok: #0f7a4d;
  --ok-bg: #e8f6ee;
  --warn: #a8500a;
  --warn-bg: #fdf0e3;
  --danger: #b3261e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, .10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .8125rem; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: .625rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---- chrome ---------------------------------------------------------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: .75rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.brand { font-weight: 680; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.wrap.narrow { max-width: 760px; }
.wrap.tight { max-width: 460px; padding-top: 4rem; }
.crumbs { font-size: .8125rem; color: var(--ink-2); margin-bottom: .5rem; }
.crumbs a { color: var(--ink-2); }
.page-head { margin-bottom: 1.5rem; }

/* ---- surfaces -------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 1.125rem 1.25rem; }
.card + .card { margin-top: .875rem; }
.section-label {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 650; color: var(--ink-3); margin-bottom: .625rem;
}
.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-2); background: var(--surface);
}

/* ---- buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 560; font-size: .875rem;
  padding: .5rem .875rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #1a52bd; border-color: #1a52bd; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0c6741; border-color: #0c6741; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: #fdf0ef; border-color: #f0c9c6; }
.btn-lg { padding: .8rem 1.1rem; font-size: .95rem; border-radius: 10px; }
.btn-sm { padding: .3rem .55rem; font-size: .8125rem; }
.btn-block { width: 100%; }

/* ---- forms ----------------------------------------------------------- */
label.field { display: block; }
.field-label {
  display: block; font-size: .8125rem; font-weight: 600;
  color: var(--ink-2); margin-bottom: .3rem;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], textarea, select {
  width: 100%; font: inherit; font-size: .9375rem; color: var(--ink);
  padding: .55rem .7rem; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface);
}
textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 95, 216, .14);
}
.field-hint { font-size: .75rem; color: var(--ink-3); margin-top: .3rem; }
.form-grid { display: grid; gap: .875rem; }
@media (min-width: 620px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }

/* ---- status ---------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; font-weight: 620; letter-spacing: .01em;
  padding: .2rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill-approved { background: var(--ok-bg); color: var(--ok); border-color: #c6e7d5; }
.pill-changes { background: var(--warn-bg); color: var(--warn); border-color: #f3d9bb; }
.pill-pending { background: var(--surface-2); color: var(--ink-2); }
.pill-count { background: var(--accent); color: #fff; border-color: var(--accent); }

.flash {
  border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .875rem;
  margin-bottom: 1rem; border: 1px solid;
}
.flash-ok { background: var(--ok-bg); border-color: #c6e7d5; color: var(--ok); }
.flash-err { background: #fdf0ef; border-color: #f0c9c6; color: var(--danger); }

/* ---- admin lists ----------------------------------------------------- */
.list-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .875rem 1.25rem; border-top: 1px solid var(--line);
}
.list-row:first-of-type { border-top: none; }
.list-row:hover { background: #fafbfc; }
.metrics { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.metric-num { font-size: 1.5rem; font-weight: 660; letter-spacing: -.02em; }
.metric-lbl { font-size: .75rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

.linkbox {
  display: flex; gap: .5rem; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .4rem .4rem .4rem .7rem;
}
.linkbox code {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: .8125rem; color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- post cards (admin) ---------------------------------------------- */
.post-admin { display: grid; grid-template-columns: 132px 1fr; gap: 1.125rem; }
@media (max-width: 640px) { .post-admin { grid-template-columns: 1fr; } }
.thumb {
  width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--line); display: block;
}
.thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: .75rem; text-align: center; padding: .5rem;
}
.caption-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- comment threads ------------------------------------------------- */
.thread { border-top: 1px solid var(--line); margin-top: .875rem; padding-top: .875rem; }
.bubble {
  border-radius: 10px; padding: .6rem .75rem; font-size: .875rem;
  background: var(--surface-2); border: 1px solid var(--line);
}
.bubble + .bubble { margin-top: .5rem; }
.bubble-client { background: var(--warn-bg); border-color: #f3d9bb; }
.bubble-head { font-size: .75rem; font-weight: 620; color: var(--ink-2); margin-bottom: .2rem; }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- client review surface ------------------------------------------ */
body.review { background: #eef0f4; }
.review-head {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 1.25rem 1.25rem 1rem;
}
.review-head-inner { max-width: 620px; margin: 0 auto; }
.review-wrap { max-width: 620px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.progress-track {
  height: 6px; border-radius: 999px; background: var(--surface-2);
  overflow: hidden; margin-top: .75rem;
}
.progress-fill { height: 100%; background: var(--ok); transition: width .3s ease; }

.rcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 1rem;
}
.rcard-media { background: #0d1117; display: block; width: 100%; }
.rcard-media img, .rcard-media video { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }
.rcard-body { padding: 1rem 1.125rem 1.125rem; }
.rcard-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .625rem; }
.rcard-caption { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; }
.rcard-actions { display: flex; gap: .625rem; margin-top: 1rem; }
.rcard-actions .btn { flex: 1; }
.decision {
  margin-top: 1rem; border-radius: 10px; padding: .7rem .85rem; font-size: .875rem;
  border: 1px solid;
}
.decision-approved { background: var(--ok-bg); border-color: #c6e7d5; color: var(--ok); }
.decision-changes { background: var(--warn-bg); border-color: #f3d9bb; color: var(--warn); }
.changes-form { margin-top: 1rem; }
.done-banner {
  background: var(--ok-bg); border: 1px solid #c6e7d5; color: var(--ok);
  border-radius: var(--radius); padding: 1rem 1.125rem; margin-bottom: 1rem;
}
