:root { --ink:#1d211c; --muted:#65695f; --paper:#f4eee6; --card:#fffdf9; --line:#d9d2c8; --accent:#ec5d3b; --accent-dark:#ba3b20; --sage:#dce4d8; --shadow:0 18px 48px rgba(42,36,27,.09); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--ink); background:var(--paper); }
* { box-sizing:border-box; }
body { margin:0; min-width:320px; }
button,input,textarea { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
.site-header { height:72px; padding:0 clamp(20px,5vw,72px); display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid rgba(29,33,28,.12); position:sticky; top:0; z-index:5; background:rgba(244,238,230,.93); backdrop-filter:blur(14px); }
.brand { color:inherit; text-decoration:none; display:flex; gap:11px; align-items:center; font-weight:760; letter-spacing:-.02em; }
.brand-mark { display:grid; place-items:center; width:34px; aspect-ratio:1; color:var(--paper); background:var(--ink); border-radius:50%; font-size:.72rem; letter-spacing:.08em; }
main { width:min(1440px,100%); margin:auto; padding:0 clamp(18px,5vw,72px) 80px; }
.hero { padding:clamp(48px,8vw,104px) 0 42px; max-width:850px; }
.eyebrow { margin:0 0 12px; font-size:.75rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--accent-dark); }
h1 { font-family:Georgia,"Times New Roman",serif; font-size:clamp(2.7rem,7vw,6.5rem); font-weight:500; line-height:.94; letter-spacing:-.055em; margin:0; max-width:950px; }
.lede { color:var(--muted); font-size:clamp(1rem,2vw,1.3rem); line-height:1.55; max-width:630px; margin:28px 0 0; }
.primary-button,.secondary-button { border-radius:999px; border:1px solid var(--ink); padding:11px 18px; font-weight:750; cursor:pointer; }
.primary-button { color:white; background:var(--ink); }
.primary-button:hover { background:#343a32; }
.secondary-button { color:var(--ink); background:transparent; }
.secondary-button:hover { background:rgba(255,255,255,.5); }
.toolbar { display:grid; grid-template-columns:minmax(220px,1fr) auto; gap:12px; align-items:center; padding:20px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.search-field { position:relative; display:block; }
.search-field svg { position:absolute; left:15px; top:50%; width:19px; transform:translateY(-50%); fill:none; stroke:currentColor; stroke-width:1.7; }
.search-field input { width:100%; background:rgba(255,255,255,.58); border:1px solid transparent; border-radius:12px; padding:14px 16px 14px 45px; color:var(--ink); }
.search-field input:focus { outline:3px solid rgba(236,93,59,.18); border-color:var(--accent); background:white; }
.count-badge { display:inline-grid; place-items:center; min-width:20px; height:20px; margin-left:5px; padding:0 6px; border-radius:10px; background:var(--accent); color:white; font-size:.75rem; }
.tag-filters { display:flex; gap:8px; overflow:auto; padding:16px 0 4px; scrollbar-width:thin; }
.filter-chip,.tag { border:1px solid var(--line); border-radius:999px; padding:7px 11px; background:var(--card); color:var(--ink); white-space:nowrap; font-size:.82rem; }
.filter-chip { cursor:pointer; }
.filter-chip[aria-pressed="true"] { background:var(--ink); color:white; border-color:var(--ink); }
.filter-empty { color:var(--muted); margin:0; font-size:.9rem; }
.library-meta { display:flex; justify-content:space-between; align-items:center; padding:22px 0 15px; color:var(--muted); }
.library-meta p { margin:0; font-size:.88rem; }
.text-button { border:0; padding:4px; color:var(--muted); background:none; cursor:pointer; text-decoration:underline; text-underline-offset:4px; }
.status { position:fixed; z-index:20; left:50%; bottom:24px; transform:translateX(-50%); background:var(--ink); color:white; border-radius:10px; padding:13px 18px; box-shadow:var(--shadow); }
.status[data-kind="error"] { background:#9d2c1c; }
.library-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:clamp(14px,2vw,26px); }
.ad-card { min-width:0; border:1px solid rgba(29,33,28,.12); border-radius:18px; background:var(--card); box-shadow:0 4px 20px rgba(42,36,27,.04); overflow:hidden; transition:transform .18s ease,box-shadow .18s ease; }
.ad-card:hover { transform:translateY(-3px); box-shadow:var(--shadow); }
.media-frame { aspect-ratio:4/5; background:var(--sage); overflow:hidden; }
.media-holder,.media-holder img,.media-holder video { width:100%; height:100%; }
.media-holder img,.media-holder video { object-fit:cover; display:block; }
.missing-media { height:100%; display:grid; place-content:center; text-align:center; gap:7px; background:radial-gradient(circle at 30% 20%,#edf1e9,var(--sage)); color:#545f51; }
.missing-media span { font-family:Georgia,serif; font-size:1.3rem; }
.missing-media small { font-size:.72rem; }
.card-body { padding:19px; }
.card-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.advertiser { margin:0 0 5px; font-size:.72rem; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.card-title { font-family:Georgia,serif; font-size:1.35rem; line-height:1.12; font-weight:500; margin:0; }
.source-badge { background:#f0e3d5; color:#774732; border-radius:999px; padding:5px 8px; font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.notes { color:var(--muted); font-size:.88rem; line-height:1.5; margin:14px 0; }
.tags { display:flex; flex-wrap:wrap; gap:6px; margin:16px 0; min-height:30px; }
.removable-tag { cursor:pointer; display:inline-flex; gap:6px; align-items:center; }
.removable-tag span:last-child { color:var(--accent-dark); font-weight:800; }
.no-tags { color:#96988f; font-size:.8rem; align-self:center; }
.tag-editor { display:grid; grid-template-columns:1fr auto; gap:7px; margin:10px 0; }
.tag-editor input { min-width:0; width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:8px; }
.tag-editor button { border:0; border-radius:8px; background:var(--ink); color:white; font-weight:700; padding:0 12px; }
.card-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:15px; border-top:1px solid #ebe6de; }
.original-link { color:var(--ink); font-weight:750; font-size:.84rem; text-underline-offset:4px; }
.edit-tags { font-size:.8rem; }
.empty-state { min-height:390px; padding:60px 20px; text-align:center; border:1px dashed #bdb5aa; border-radius:18px; background:rgba(255,255,255,.34); }
.empty-icon { display:grid; place-items:center; width:54px; height:54px; margin:0 auto 18px; border-radius:50%; background:var(--sage); font-size:1.6rem; }
.empty-state h2 { margin:0; font-family:Georgia,serif; font-size:2rem; font-weight:500; }
.empty-state p { color:var(--muted); max-width:460px; margin:12px auto 24px; line-height:1.5; }
.empty-actions { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; }
.empty-state small { display:block; margin-top:18px; color:var(--muted); }
dialog { width:min(680px,calc(100% - 24px)); max-height:calc(100dvh - 24px); border:0; border-radius:20px; padding:0; color:var(--ink); background:var(--card); box-shadow:0 24px 100px rgba(0,0,0,.28); }
dialog::backdrop { background:rgba(20,23,19,.55); backdrop-filter:blur(4px); }
dialog form { padding:clamp(20px,4vw,34px); overflow:auto; }
.dialog-header { display:flex; align-items:flex-start; justify-content:space-between; }
.dialog-header h2 { font-family:Georgia,serif; font-size:2.2rem; font-weight:500; margin:0; }
.icon-button { border:0; background:#eee9e1; border-radius:50%; width:38px; height:38px; cursor:pointer; font-size:1.5rem; line-height:1; }
.boundary-note { padding:13px 15px; background:#f7ead9; border-left:3px solid var(--accent); border-radius:6px; font-size:.84rem; line-height:1.45; }
.share-guidance { padding:11px 13px; border-radius:7px; background:var(--sage); color:#3e493b; font-size:.84rem; line-height:1.45; }
dialog label { display:grid; gap:7px; margin:16px 0; font-size:.84rem; font-weight:750; }
dialog label > span { display:inline; color:var(--muted); font-weight:500; }
dialog input,dialog textarea { width:100%; border:1px solid var(--line); border-radius:9px; background:white; padding:11px 12px; color:var(--ink); }
dialog textarea { resize:vertical; }
dialog input:focus,dialog textarea:focus { outline:3px solid rgba(236,93,59,.16); border-color:var(--accent); }
dialog label small { color:var(--muted); font-weight:400; line-height:1.4; }
.two-up { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-error { color:#8d2418; background:#fae4df; padding:11px 13px; border-radius:7px; font-size:.84rem; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }
.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; }
@media (max-width:900px) { .library-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:580px) {
  .site-header { height:64px; padding:0 16px; }
  .site-header .primary-button { padding:9px 14px; }
  main { padding-inline:14px; }
  .hero { padding:42px 2px 32px; }
  h1 { font-size:clamp(2.7rem,14vw,4.3rem); }
  .toolbar { grid-template-columns:1fr auto; }
  .filter-toggle { padding-inline:13px; }
  .library-grid { grid-template-columns:1fr; gap:16px; }
  .media-frame { aspect-ratio:1/1; }
  .ad-card:hover { transform:none; }
  .two-up { grid-template-columns:1fr; gap:0; }
  dialog { width:100%; max-height:92dvh; margin:auto 0 0; border-radius:20px 20px 0 0; }
  .dialog-actions { position:sticky; bottom:-1px; background:var(--card); padding-top:12px; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; transition:none!important; } }
