:root {
  --ink: #20201d;
  --paper: #f8f7f2;
  --line: #d8d6ce;
  --muted: #73736d;
  --accent: #ce5f3e;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
main { max-width: 1180px; min-height: 100vh; padding: 28px 42px 24px; margin: auto; }
.masthead { padding: 18px 0 68px; }
.eyebrow, .brand-category, .list-header, footer, .optional { font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .055em; text-transform: uppercase; }
.eyebrow { margin: 0; color: var(--muted); }
.heading-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-top: 25px; }
h1 { margin: 0; font: 500 clamp(60px, 9vw, 128px)/.8 "Playfair Display", serif; letter-spacing: -.07em; }
h1 em { color: var(--accent); }
.intro { width: min(255px, 34vw); margin: 0 5px 2px 0; color: #565650; line-height: 1.45; }
.controls { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; padding: 15px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.search { position: relative; max-width: 260px; }
.search input { width: 100%; padding: 8px 25px 8px 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search span { position: absolute; right: 3px; top: 3px; color: var(--muted); font: 24px/1 Georgia, serif; transform: rotate(-20deg); }
.filters { display: flex; gap: 6px; overflow-x: auto; max-width: 560px; scrollbar-width: none; }
.filter { flex: 0 0 auto; padding: 6px 10px; border: 1px solid transparent; color: var(--muted); background: transparent; font: 11px "DM Mono", monospace; text-transform: uppercase; }
.filter:hover, .filter.active { border-color: var(--ink); color: var(--ink); }
.add-button { padding: 9px 13px; border: 0; color: white; background: var(--ink); font-weight: 500; white-space: nowrap; }
.add-button:hover, .save:hover { background: var(--accent); }
.list-header { display: flex; justify-content: space-between; padding: 17px 0 9px; color: var(--muted); }
.list-header p { margin: 0; }
.text-button { padding: 0; border: 0; color: var(--muted); background: none; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.text-button:hover { color: var(--accent); }
.brands { border-top: 1px solid var(--line); }
.brand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; min-height: 120px; padding: 22px 0 20px; border-bottom: 1px solid var(--line); transition: padding .18s; }
.brand:hover { padding-left: 12px; }
.brand-category { margin: 0 0 8px; color: var(--accent); }
.brand-name { margin: 0; font: 500 clamp(28px, 3.3vw, 45px)/1 "Playfair Display", serif; letter-spacing: -.04em; }
.brand-note { max-width: 540px; margin: 9px 0 0; color: #676761; line-height: 1.4; }
.brand-actions { display: flex; align-items: flex-start; gap: 18px; padding-top: 5px; }
.brand-link, .edit { color: var(--ink); font-size: 13px; text-decoration: none; }
.edit { padding: 0; border: 0; color: var(--muted); background: transparent; }
.brand-link:hover, .edit:hover { color: var(--accent); }
.empty-state { padding: 45px 0; color: var(--muted); text-align: center; }
footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 70px; color: var(--muted); }
footer p { margin: 0; }
dialog { width: min(500px, calc(100% - 28px)); padding: 0; border: 0; color: var(--ink); box-shadow: 0 20px 60px #0004; }
dialog::backdrop { background: #1b1b18aa; backdrop-filter: blur(2px); }
dialog form { padding: 25px; }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; }
.close { padding: 0 4px; border: 0; color: var(--muted); background: none; font: 28px/18px Arial; }
dialog h2 { margin: 28px 0 24px; font: 500 36px/1 "Playfair Display", serif; letter-spacing: -.04em; }
dialog label { display: block; margin-top: 16px; color: #4e4e48; font-size: 13px; }
dialog input, dialog select, dialog textarea { width: 100%; margin-top: 7px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: transparent; color: var(--ink); }
dialog textarea { resize: vertical; }
dialog input:focus, dialog select:focus, dialog textarea:focus { border-color: var(--accent); }
.optional { color: var(--muted); font-size: 9px; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
.save { margin-left: auto; padding: 10px 17px; border: 0; color: white; background: var(--ink); }
.delete { padding: 0; border: 0; color: #9e2f23; background: transparent; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
@media (max-width: 700px) {
  main { padding: 20px; }
  .masthead { padding-bottom: 44px; }
  .heading-row { display: block; }
  .intro { width: auto; margin: 25px 0 0; }
  .controls { grid-template-columns: 1fr auto; gap: 11px; }
  .filters { grid-column: 1 / -1; grid-row: 2; max-width: 100%; order: 3; }
  .brand { min-height: 110px; }
  .brand-actions { gap: 12px; }
  footer { display: block; padding-top: 50px; line-height: 1.8; }
}
