/* HH Signature Manager — themed with the Hoover's Hatchery Brand design system
   (tokens from "Our Brand: A Quick Guide", Oct 2026). Rules followed here:
   cream ground, paper cards, brown text (never black), red Oswald uppercase headings,
   yellow for rules/accents only, -deep tones for small colored text, 2px line icons. */
@import url("https://fonts.googleapis.com/css2?family=Lilita+One&family=Oswald:wght@400;500;600;700&family=Quicksand:wght@500;600;700&display=swap");

:root {
  /* Brand colors */
  --red: #CB333B; --yellow: #EAAA00; --tan: #E7DBB9; --brown: #73391D; --green: #76881D; --blue: #A4C8E1;
  /* Working colors */
  --cream: #FAF4E0; --paper: #FFFFFF; --tan-tint: #F3EBD3;
  --ink: #73391D; --ink-muted: #6B5444;
  --red-deep: #A8282F; --yellow-deep: #8A6100; --green-deep: #5E6B17; --blue-deep: #2E6A92;
  --rule: #EAAA00; --hairline: #DCCDA4; --border: #8C7F6E;
  --note-bg: #DCEAF4; --note-fg: #1F4E6E; --caution-bg: #FBF1D3; --caution-fg: #7A5300;
  --bio-bg: #EEF2D9; --bio-fg: #4F5C14; --critical-bg: #F8E4E7; --critical-fg: #8F1D2C;
  /* Type */
  --font-display: "Lilita One", "Arial Rounded MT Bold", sans-serif;
  --font-heading: Oswald, "Arial Narrow", sans-serif;
  --font-body: Quicksand, "Century Gothic", "Segoe UI", Calibri, sans-serif;
  /* Shape */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(115,57,29,.08), 0 6px 18px rgba(115,57,29,.06);
  /* Aliases used throughout this app */
  --muted: var(--ink-muted); --line: var(--hairline); --bg: var(--cream); --panel: var(--paper);
  --radius: var(--radius-lg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 500 14px/1.5 var(--font-body); color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
a { color: var(--red-deep); font-weight: 600; }
h1, h2, h3 { font-family: var(--font-heading); text-transform: uppercase; margin: 0; letter-spacing: .01em; }
h1 { font-size: 30px; line-height: 36px; font-weight: 600; color: var(--red); }
h2 { font-size: 18px; line-height: 24px; font-weight: 600; color: var(--red); }
h3 { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--brown); }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: 12px; background: var(--tan-tint); padding: 1px 5px; border-radius: var(--radius-sm); }
:focus-visible { outline: 2px solid var(--yellow-deep); outline-offset: 2px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: 68px 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--paper); border-bottom: 3px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 44px; width: auto; display: block; }
.brand-name { font-family: var(--font-heading); font-weight: 600; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; color: var(--brown); padding-left: 14px; border-left: 2px solid var(--hairline); line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px; color: var(--ink-muted); }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--red); display: grid; place-items: center; color: var(--cream); font-family: var(--font-display); }
.topbar .spacer { flex: 1; }
.who { font-size: 13px; text-align: right; line-height: 1.3; font-weight: 600; }
.who .roles { color: var(--ink-muted); font-size: 11px; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.topbar select { width: auto; }
.sidebar { background: var(--tan-tint); border-right: 1px solid var(--hairline); padding: 18px 12px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-md); color: var(--brown); text-decoration: none; margin-bottom: 2px;
  font-family: var(--font-heading); font-weight: 500; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; }
.nav a:hover { background: var(--tan); }
.nav a.active { background: var(--paper); color: var(--red-deep); box-shadow: inset 3px 0 0 var(--red); }
.nav svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-sep { height: 1px; background: var(--hairline); margin: 10px 12px; }
.main { overflow-y: auto; padding: 28px 32px 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-muted); max-width: 68ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--paper); cursor: pointer;
  font-family: var(--font-heading); font-weight: 500; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; text-decoration: none; color: var(--brown); line-height: 18px; }
.btn:hover { background: var(--tan-tint); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn.primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--tan-tint); }
.btn.danger { color: var(--critical-fg); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font-weight: 500; }
input::placeholder, textarea::placeholder { color: #9A8A7A; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow-deep); outline-offset: 1px; border-color: var(--brown); }
input:disabled, select:disabled, textarea:disabled { background: var(--tan-tint); color: var(--ink-muted); border-color: var(--hairline); }
textarea.code { font: 12.5px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; min-height: 420px; resize: vertical; white-space: pre; tab-size: 2; color: #3d2a1f; }
label.field, div.field { display: block; margin-bottom: 14px; }
label.field > span, div.field > span { display: block; font-family: var(--font-heading); font-size: 12.5px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 5px; color: var(--brown); }
.hint { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; }
.hint.src { color: var(--yellow-deep); font-weight: 600; }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; cursor: pointer; font-weight: 600; }
.check input { accent-color: var(--red); width: 17px; height: 17px; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 0 14px; }
.row { display: flex; gap: 8px; align-items: center; }

/* ---------- Cards, tiles ---------- */
.card { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); border: 1px solid #EFE6CC; }
.card-pad { padding: 22px 24px; }
.card h2, .card h3 { margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { padding: 18px 20px; text-align: left; }
.tile .k { font-family: var(--font-heading); font-size: 13px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--yellow-deep); }
.tile .v { font-family: var(--font-display); font-size: 40px; line-height: 44px; color: var(--red); margin-top: 4px; }
.tile .s { font-size: 12.5px; color: var(--ink-muted); }
.two-col { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(380px, 1.15fr); gap: 20px; align-items: start; }
.sticky { position: sticky; top: 0; }
.callout { background: var(--caution-bg); border: 1.5px solid #E9D59B; border-radius: var(--radius-md); padding: 12px 16px; font-size: 13.5px; color: var(--caution-fg); margin-bottom: 18px; }
.callout b { color: var(--caution-fg); }

/* ---------- Tables (brand DataTable: brown header, tan zebra) ---------- */
.toolbar { display: flex; gap: 10px; padding: 14px; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { max-width: 210px; }
table.list { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.list th { text-align: left; background: var(--brown); color: var(--paper); font-family: var(--font-heading); font-weight: 500; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; padding: 9px 14px; }
table.list td { padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.list tbody tr:nth-child(even) td { background: #FCF8EC; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--tan-tint); }
.card > .scroll-x:last-child, .card.scroll-x { border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.card.scroll-x { border-radius: var(--radius-lg); }
.name-cell { display: flex; align-items: center; gap: 11px; }
.name-cell b { font-weight: 700; }
.avatar { width: 34px; height: 34px; border-radius: var(--radius-pill); background: var(--brown); color: var(--cream); display: grid; place-items: center; font-family: var(--font-heading); font-weight: 600; font-size: 13px; letter-spacing: .03em; flex: none; }
.sub { color: var(--ink-muted); font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-family: var(--font-heading); font-size: 11.5px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; background: var(--tan-tint); color: var(--brown); white-space: nowrap; border: 1px solid var(--hairline); }
.badge.red { background: var(--critical-bg); color: var(--red-deep); border-color: #EFC4CA; }
.badge.gold { background: var(--caution-bg); color: var(--caution-fg); border-color: #EBD89F; }
.badge.ok { background: var(--bio-bg); color: var(--bio-fg); border-color: #D6DEAE; }
.badge.off { background: #F1EEE8; color: #6F645A; border-color: #E2DCD2; }
.empty { padding: 40px; text-align: center; color: var(--ink-muted); }

/* ---------- Email preview ---------- */
.mail { border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow-card); border: 1px solid #EFE6CC; }
.mail-chrome { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--tan-tint); border-bottom: 1px solid var(--hairline); font-family: var(--font-heading); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--brown); flex-wrap: wrap; }
.mail-chrome .seg { margin-left: auto; display: flex; border: 1.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.mail-chrome .seg + .seg { margin-left: 0; }
.mail-chrome .seg button { border: 0; background: var(--paper); padding: 4px 11px; cursor: pointer; font-family: var(--font-heading); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--brown); }
.mail-chrome .seg button.on { background: var(--brown); color: var(--paper); }
.mail-head { padding: 10px 18px; border-bottom: 1px solid #F0E8D2; font-size: 13px; font-family: "Segoe UI", Arial, sans-serif; color: #333; }
.mail-head div { padding: 2px 0; } .mail-head b { color: #777; font-weight: 500; display: inline-block; width: 64px; }
.mail-body { padding: 18px; font-family: Calibri, Arial, sans-serif; font-size: 14px; color: #222; }
.mail-body p { margin: 0 0 14px; }
.sig-frame { width: 100%; border: 0; display: block; min-height: 60px; }
.quoted { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e3e3e3; color: #888; font-size: 12.5px; }
.preview-meta { font-size: 12.5px; color: var(--ink-muted); padding: 9px 14px; border-top: 1px solid var(--hairline); background: #FCF8EC; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { color: var(--critical-fg); background: var(--critical-bg); padding: 9px 13px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; }

/* ---------- Template editor ---------- */
.tpl-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.tpl-layout > .card:first-child { overflow: hidden; }
.tpl-item { padding: 13px 16px; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.tpl-item b { font-weight: 700; }
.tpl-item:last-child { border-bottom: 0; }
.tpl-item:hover { background: var(--tan-tint); }
.tpl-item.on { background: var(--tan-tint); box-shadow: inset 3px 0 0 var(--red); }
.tabs { display: flex; gap: 2px; border-bottom: 1.5px solid var(--hairline); margin-bottom: 10px; }
.tabs button { border: 0; background: none; padding: 8px 14px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px;
  font-family: var(--font-heading); font-weight: 500; font-size: 13.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted); }
.tabs button.on { color: var(--red-deep); border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { font: 11.5px ui-monospace, Consolas, monospace; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--tan-tint); border: 1px solid var(--hairline); color: var(--brown); cursor: pointer; }
.chip:hover { background: var(--tan); }
.starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.starter { padding: 16px; cursor: pointer; }
.starter:hover { outline: 2px solid var(--red); }

/* ---------- Rules ---------- */
.rule { padding: 16px 18px; margin-bottom: 14px; }
.rule-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.rule-head .num { width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--brown); color: var(--paper); display: grid; place-items: center; font-family: var(--font-heading); font-size: 14px; font-weight: 600; flex: none; }
.rule-head input[type=text] { font-family: var(--font-heading); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; max-width: 320px; }
.rule-head .spacer { flex: 1; }
.rule .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
.rule-sub { font-family: var(--font-heading); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--yellow-deep); font-weight: 500; margin: 2px 0 10px; border-top: 1.5px solid var(--rule); padding-top: 10px; }

/* ---------- Images ---------- */
.imgfield { display: flex; gap: 8px; align-items: center; }
.imgfield input { flex: 1; min-width: 0; }
.thumb { width: 46px; height: 46px; flex: none; border: 1px solid var(--hairline); border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(var(--tan-tint) 0% 25%, var(--paper) 0% 50%) 50% / 12px 12px; }
.thumb img { max-width: 100%; max-height: 100%; }
.imgfield.mini .thumb { width: 36px; height: 36px; border-radius: var(--radius-pill); }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; background: var(--paper); cursor: pointer; color: var(--brown); }
.dropzone b { font-family: var(--font-heading); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--red); }
.dropzone:hover, .dropzone.over { border-color: var(--red); background: #FFF8F3; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 14px; }
.lib-card { overflow: hidden; }
.lib-card.pickable { cursor: pointer; } .lib-card.pickable:hover { outline: 2px solid var(--red); }
.lib-img { height: 110px; display: grid; place-items: center; padding: 10px; background: repeating-conic-gradient(var(--tan-tint) 0% 25%, var(--paper) 0% 50%) 50% / 14px 14px; border-bottom: 1px solid var(--hairline); }
.lib-img img { max-width: 100%; max-height: 100%; }
.lib-meta { padding: 9px 11px; font-size: 12.5px; }
.lib-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Misc ---------- */
.scroll-x { overflow-x: auto; }
.loc-row { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr .5fr .7fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.loc-row.head { font-family: var(--font-heading); font-size: 12px; text-transform: uppercase; color: var(--brown); font-weight: 500; letter-spacing: .05em; }
.social-row { display: grid; grid-template-columns: 1fr 1.6fr 2.6fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.social-row.sub { font-family: var(--font-heading); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--brown); }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--brown); color: var(--cream); padding: 12px 18px; border-radius: var(--radius-md); box-shadow: 0 8px 30px rgba(115,57,29,.25); z-index: 50; animation: up .2s ease-out; max-width: 420px; font-weight: 600; }
.toast.bad { background: var(--critical-fg); color: var(--paper); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(60,30,15,.45); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal { width: min(760px, 100%); max-height: 90vh; overflow: auto; padding: 24px; }
.splash { display: grid; place-items: center; height: 100vh; text-align: center; background: var(--cream); }
.splash img { width: 200px; height: auto; margin-bottom: 14px; }
.dirty-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); margin-left: 6px; vertical-align: middle; }
.back { color: var(--ink-muted); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 6px; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 10px 0; border-bottom: 1.5px solid var(--tan-tint); font-size: 13px; display: flex; gap: 12px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--ink-muted); white-space: nowrap; font-size: 12px; min-width: 110px; font-variant-numeric: tabular-nums; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin-bottom: 6px; }
.eyebrow { font-family: var(--font-heading); font-weight: 500; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; color: var(--yellow-deep); margin: 0 0 2px; }

@media (max-width: 1100px) { .two-col, .tpl-layout { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 64px auto 1fr; }
  .topbar { padding: 0 12px; } .brand img { height: 36px; } .brand-name, .hide-sm { display: none; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 6px; }
  .nav { display: flex; overflow-x: auto; } .nav-sep { display: none; } .nav a { white-space: nowrap; }
  .main { padding: 18px 16px; } .grid2, .rule .grid4, .loc-row, .social-row { grid-template-columns: 1fr; }
  .toolbar input[type=search], .toolbar select { max-width: none; }
}
