:root {
  --ink: #1d1b17;
  --ink-soft: #57534b;
  --muted: #8a8579;
  --paper: #FCFBF7;
  --panel: #F5F2EA;
  --line: #E6E1D5;
  --line-strong: #d8d2c3;
  --magenta: #C4218A;
  --magenta-dark: #9E1671;
  --magenta-tint: #FBEAF3;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; line-height: 1.15; }
.wrap { max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 0 24px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--sans); font-size: 14px; font-weight: 600; border-radius: 6px; padding: 12px 22px; cursor: pointer; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12px; gap: 4px; border-radius: 5px; line-height: 1.2; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }

.site-header { background: #000; color: #efe9dc; }
.utility { border-bottom: 1px solid #2a2824; font-size: 12.5px; color: #9c968a; }
.utility .wrap { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.utility .loc { display: flex; align-items: center; gap: 6px; letter-spacing: 0.04em; }
.utility a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #efe9dc; }
.utility a:hover { color: #fff; }
.utility svg { width: 14px; height: 14px; }
.masthead { border-bottom: 1px solid #2a2824; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; padding-bottom: 22px; min-width: 0; }
.brand { min-width: 0; }
.brand .kicker { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: #9c968a; margin-bottom: 10px; }
.brand-link { display: block; line-height: 0; }
.site-logo { display: block; height: 52px; width: auto; max-width: 340px; }
.nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.nav a.link { font-size: 14px; font-weight: 500; color: #b9b2a3; }
.nav a.link:hover { color: #fff; }
.masthead .btn-primary { padding: 10px 18px; }

.classifieds-subnav { background: var(--panel); border-bottom: 1px solid var(--line); }
.classifieds-subnav nav { display: flex; gap: 24px; padding: 12px 0; font-size: 14px; font-weight: 600; }
.classifieds-subnav a { color: var(--ink-soft); }
.classifieds-subnav a:hover, .classifieds-subnav a.active { color: var(--magenta-dark); }
.classifieds-subnav a.disabled { opacity: .45; pointer-events: none; }

.classifieds-main { padding: 40px 0 72px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
.classifieds-main .wrap > h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 24px; }

.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.alert-info { background: var(--magenta-tint); border: 1px solid #f0b8da; color: var(--magenta-dark); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }

.ads-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ads-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 12px 14px; background: var(--panel); }
.ads-table td { border-bottom: 1px solid var(--line); padding: 14px; color: var(--ink-soft); vertical-align: middle; }
.ads-table tr:last-child td { border-bottom: none; }
.ads-table .ad-title { font-weight: 600; color: var(--ink); }
.ad-title-link:hover { color: var(--magenta-dark); text-decoration: underline; }
.ads-table .col-runs { white-space: nowrap; }
.ads-table .col-actions { text-align: right; width: 1%; white-space: nowrap; }
.ads-table .row-actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.ads-table .row-actions .btn { margin: 0; flex: 0 0 auto; }
.ads-table .action-link { color: var(--magenta-dark); font-weight: 600; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.ads-table button.action-link { font-size: 14px; }
.ads-table .action-link:hover { text-decoration: underline; }
.ads-table .action-muted { color: var(--muted); font-size: 13px; }

.status-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-soft); white-space: nowrap; }
.status-pill.in_review { background: var(--magenta-tint); border-color: #f0b8da; color: var(--magenta-dark); }
.status-pill.draft { background: #f5f5f4; color: var(--muted); }
.status-pill.awaiting_payment { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.status-pill.published { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.status-pill.scheduled { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.status-pill.paused { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.status-pill.expired { background: #f5f5f4; border-color: var(--line-strong); color: var(--muted); }
.status-pill.cancelled { background: #f5f5f4; border-color: var(--line-strong); color: var(--muted); }
.schedule-skipped { text-decoration: line-through; color: var(--muted); }

.btn-danger { background: #fff; color: #991b1b; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: #991b1b; }

.empty-state { text-align: center; padding: 48px 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.empty-state p { color: var(--ink-soft); margin: 12px 0 24px; }
.card-panel { padding: 28px 24px; background: #fff; border: 1px solid var(--line); border-radius: 12px; max-width: 640px; }
.card-panel p { color: var(--ink-soft); margin: 0 0 16px; line-height: 1.55; }
.card-panel .btn { margin-top: 8px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; max-width: 100%; }
.two-col > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }

.field { margin-bottom: 18px; position: relative; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; overflow-wrap: break-word; }
.field label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.field select,
.field textarea {
  width: 100%; max-width: 100%; min-width: 0; font: inherit; font-size: 14px; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):focus,
.field select:focus, .field textarea:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--magenta-tint); }
.field-counter { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; font-family: monospace; }
.field-link { display: inline-block; max-width: 100%; font-size: 12px; color: var(--magenta-dark); cursor: pointer; border: none; background: none; padding: 0; font-family: inherit; white-space: normal; text-align: left; }
.field-link:hover { text-decoration: underline; }

.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; }
.checkline input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--magenta); flex-shrink: 0; }
.checkline a { color: var(--magenta-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.checkline a:hover { color: var(--magenta); }

.legal-doc { max-width: 760px; }
.legal-doc .legal-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--magenta-dark); margin: 0 0 10px; }
.legal-doc h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 8px; }
.legal-doc .legal-org { font-size: 15px; color: var(--ink-soft); margin: 0 0 24px; }
.legal-doc .legal-lede { font-size: 16px; color: var(--ink); margin: 0 0 32px; line-height: 1.7; }
.legal-doc section { margin-bottom: 28px; }
.legal-doc h2 { font-family: var(--sans); font-size: 16px; font-weight: 700; letter-spacing: 0; margin: 0 0 10px; }
.legal-doc p { font-size: 15px; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.7; }
.legal-doc p:last-child { margin-bottom: 0; }

.photo-box { border: 1px dashed var(--line-strong); background: var(--panel); border-radius: 8px; padding: 24px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; display: block; }
.photo-box:hover { border-color: var(--magenta); color: var(--ink-soft); }
.photo-box-title { display: block; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input.photo-input,
.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}
.photo-upload { position: relative; }
.photo-upload.is-dragover .photo-box { border-color: var(--magenta); background: var(--magenta-tint); }
.photo-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.photo-item-label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.photo-item-label.is-invalid { border-color: #fecaca; background: #fef2f2; }
.photo-item-label.is-valid { border-color: #d8d2c3; }
.photo-item-label.is-pending { border-color: var(--line); background: var(--panel); }
.photo-item-main { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.photo-item-body { flex: 1; min-width: 0; }
.photo-item-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.photo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex-shrink: 0; }
.photo-file-icon { width: 48px; height: 48px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.photo-name { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.photo-meta.is-ok { color: #065f46; }
.photo-error { display: block; color: #991b1b; font-size: 12px; margin-top: 4px; line-height: 1.45; }
.photo-help { margin: 10px 0 0; }
.photo-item.is-new .photo-item-label { border-style: dashed; }
.photo-item.is-new.is-valid .photo-item-label { border-style: solid; }
.proof-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.proof-photo-thumb { max-width: 120px; max-height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-strong); }
.proof-photo-file { font-size: 13px; color: var(--magenta-dark); font-weight: 600; }

.sidebox { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 20px; font-size: 14px; position: sticky; top: 20px; }
.sidebox h3 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; }
.priceline { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; color: var(--ink-soft); border-bottom: 1px dotted var(--line); }
.priceline.total { font-weight: 700; color: var(--ink); border-top: 2px solid var(--line-strong); border-bottom: none; margin-top: 8px; padding-top: 12px; font-size: 15px; }
.sidebox .fine { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.5; font-style: italic; }

.proof-intro { font-size: 14px; color: var(--ink-soft); margin-bottom: 18px; }
.proofbox { border: 2px solid var(--ink); background: #fdfdf8; border-radius: 8px; padding: 20px; max-width: 380px; }
.proofbox .headline { font-weight: 900; font-size: 13px; letter-spacing: 0.02em; margin-bottom: 8px; line-height: 1.3; }
.proofbox .copy { font-size: 13px; line-height: 1.55; color: var(--ink-soft); white-space: pre-wrap; }
.proofbox .photo-placeholder { margin-top: 12px; border: 1px dashed var(--line-strong); background: var(--panel); border-radius: 6px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.proof-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; align-items: center; }
.proof-actions form { display: inline-flex; margin: 0; }

.confirm-dialog { border: 1px solid var(--line); border-radius: 12px; padding: 28px; max-width: 440px; width: calc(100% - 48px); background: var(--paper); box-shadow: 0 20px 60px -20px rgba(29, 27, 23, .35); }
.confirm-dialog::backdrop { background: rgba(29, 27, 23, 0.45); }
.confirm-dialog h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 500; margin-bottom: 12px; }
.confirm-dialog p { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.6; }
.confirm-dialog p:last-of-type { margin-bottom: 0; }
.confirm-dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

.confirm-wrap { max-width: 560px; margin: 0 auto; text-align: center; padding: 40px 0 20px; }
.confirm-icon { width: 56px; height: 56px; border: 2px solid var(--magenta); border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--magenta-dark); background: var(--magenta-tint); }
.confirm-wrap h1 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: 14px; }
.confirm-wrap p { color: var(--ink-soft); font-size: 15px; line-height: 1.7; margin-bottom: 28px; }

.custom-category { display: none; margin-top: -8px; }
.custom-category.show { display: block; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .sidebox { position: static; }
  .nav .link { display: none; }
  .ads-table { display: block; overflow-x: auto; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .utility .loc { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
