/* ============================ Digital Product Hunter ============================
   Light · warm · minimal · Apple-inspired · orange accent
   ============================================================================ */
:root {
  --bg:        #ffffff;
  --bg-2:      #faf8f6;   /* warm paper */
  --surface:   #ffffff;
  --surface-2: #f7f4f1;
  --surface-3: #f0ece8;
  --border:    #ececec;
  --border-2:  #e0dcd7;
  --text:      #1d1d1f;   /* Apple near-black */
  --muted:     #6e6a66;
  --faint:     #a8a29c;
  --accent:    #e8590c;   /* warm orange */
  --accent-2:  #cf4d05;
  --accent-soft: #fff2ea;
  --ink:       #ffffff;

  --good:      #1f8a4c;   /* muted green */
  --gold:      #e8590c;   /* goldmine = orange */
  --amber:     #c77b13;
  --red:       #c4422e;
  --blue:      #4a6cd4;

  --r-sm: 9px;
  --r:    16px;
  --r-lg: 22px;
  --shadow:    0 1px 2px rgba(20,16,12,0.04), 0 8px 30px -16px rgba(20,16,12,0.10);
  --shadow-lg: 0 2px 6px rgba(20,16,12,0.05), 0 24px 60px -24px rgba(20,16,12,0.18);
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 620px at 14% -10%, rgba(232,89,12,0.05), transparent 60%),
    radial-gradient(900px 520px at 100% -4%, rgba(232,89,12,0.03), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  min-height: 100vh;
}
::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.wrap { max-width: 1300px; margin: 0 auto; padding: 0 28px 90px; }

/* ============================== Header ============================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255,255,255,0.78);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1300px; margin: 0 auto; padding: 15px 28px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(155deg, #f97a2e, var(--accent));
  display: grid; place-items: center; position: relative;
  box-shadow: 0 6px 16px -6px rgba(232,89,12,0.5);
}
.logo svg { width: 22px; height: 22px; }
.brand h1 {
  font-family: var(--display); font-weight: 600; font-size: 19px;
  margin: 0; letter-spacing: -0.025em; line-height: 1.05; color: var(--text);
}
.brand .tag {
  font-size: 11.5px; color: var(--muted); margin-top: 2px; letter-spacing: -0.005em;
}
.topbar-spacer { flex: 1; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-size: 12px; font-weight: 600;
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--muted); white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--faint); }
.status-pill.live .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(31,138,76,0.16); animation: pulse 2s infinite; }
.status-pill.live { color: var(--good); border-color: rgba(31,138,76,0.3); background: rgba(31,138,76,0.05); }
.status-pill.sample .dot { background: var(--accent); }
.status-pill.sample { color: var(--accent); border-color: rgba(232,89,12,0.28); background: var(--accent-soft); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(31,138,76,0.16);} 50% { box-shadow: 0 0 0 5px rgba(31,138,76,0.04);} }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--body); font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-radius: 99px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); transition: all .15s ease;
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn .spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Saved trigger in header */
.saved-trigger { position: relative; }
.saved-trigger svg { color: var(--muted); }
.saved-trigger.has { border-color: rgba(232,89,12,0.35); color: var(--accent); background: var(--accent-soft); }
.saved-trigger.has svg { color: var(--accent); }
.saved-count {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0; margin-left: 1px;
}

/* ============================== Hero / KPIs ============================== */
.hero { padding: 56px 0 30px; }
.hero h2 {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.04em;
  font-size: clamp(32px, 5vw, 56px); line-height: 1.04; margin: 0 0 16px;
  max-width: 17ch; color: var(--text);
}
.hero h2 .hl { color: var(--accent); }
.hero p { color: var(--muted); font-size: 17px; max-width: 60ch; margin: 0; line-height: 1.5; letter-spacing: -0.01em; }
.hero-note {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 20px;
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--accent-2);
  background: var(--accent-soft); border: 1px solid rgba(232,89,12,0.18);
  padding: 9px 16px; border-radius: 99px;
}
.hero-note-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--good); box-shadow: 0 0 0 3px rgba(31,138,76,0.16); animation: pulse 2s infinite; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r); padding: 22px 22px 20px;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.kpi .k-label { font-size: 12px; color: var(--muted); letter-spacing: -0.005em; font-weight: 600; }
.kpi .k-val { font-family: var(--display); font-weight: 600; font-size: 38px; letter-spacing: -0.04em; margin-top: 10px; color: var(--text); }
.kpi .k-val small { font-size: 17px; color: var(--faint); font-weight: 500; letter-spacing: -0.02em; }
.kpi .k-sub { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
.kpi.accent .k-val { color: var(--accent); }

/* ============================== Controls ============================== */
.controls {
  position: sticky; top: 71px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px; margin: 30px 0 26px;
  background: rgba(255,255,255,0.82); backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow);
}
.search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 200px;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 99px; padding: 0 16px;
  transition: all .15s ease;
}
.search:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(232,89,12,0.1); }
.search svg { width: 16px; height: 16px; color: var(--faint); flex: 0 0 auto; }
.search input {
  flex: 1; background: transparent; border: 0; outline: 0; color: var(--text);
  font-family: var(--body); font-size: 14px; padding: 11px 0; letter-spacing: -0.01em;
}
.search input::placeholder { color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  cursor: pointer; font-size: 13px; font-weight: 600; padding: 9px 15px;
  border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--muted); transition: all .14s ease; white-space: nowrap; letter-spacing: -0.01em;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.ctrl-group { display: flex; align-items: center; gap: 9px; }
.ctrl-label { font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: -0.005em; }
.select {
  appearance: none; background: var(--surface); color: var(--text); cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 99px; padding: 9px 34px 9px 15px;
  font-family: var(--body); font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236e6a66' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.select:hover { border-color: var(--faint); }

.slider-wrap { display: flex; align-items: center; gap: 11px; }
.slider-val {
  font-family: var(--body); font-size: 13px; font-weight: 700; color: var(--accent);
  min-width: 50px; text-align: right; letter-spacing: -0.01em;
}
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 130px; height: 4px; border-radius: 99px;
  background: var(--surface-3); outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 99px;
  background: #fff; border: 1px solid var(--border-2); box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 99px; background: #fff; border: 1px solid var(--border-2);
}

/* ============================== Grid + Cards ============================== */
.result-meta { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.result-meta .count { font-size: 13.5px; color: var(--muted); letter-spacing: -0.01em; }
.result-meta .count b { color: var(--text); font-weight: 600; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}

.card {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 15px; cursor: pointer;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow); overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow-lg); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Save bookmark on card */
.save-btn {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 99px; cursor: pointer;
  display: grid; place-items: center; transition: all .15s ease;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--faint);
}
.save-btn svg { width: 16px; height: 16px; }
.save-btn:hover { color: var(--accent); border-color: rgba(232,89,12,0.35); background: var(--accent-soft); transform: translateY(-1px); }
.save-btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.save-btn.on:hover { color: var(--accent-2); }
.trend-metric .m-val.trend { font-family: var(--display); font-weight: 600; }
.trend-metric .m-val svg { width: 14px; height: 14px; }
.type-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  letter-spacing: -0.005em; padding: 6px 11px; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.type-badge .ico { width: 13px; height: 13px; }
.trend { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; letter-spacing: -0.005em; }
.trend svg { width: 14px; height: 14px; }
.trend.up { color: var(--good); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--faint); }

.card-body { display: flex; align-items: center; gap: 16px; }
.score-ring { position: relative; width: 80px; height: 80px; flex: 0 0 auto; }
.score-ring svg { transform: rotate(-90deg); display: block; }
.score-ring .ring-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; line-height: 1;
}
.score-ring .ring-num b { font-size: 26px; letter-spacing: -0.04em; }
.score-ring .ring-num span { font-size: 10px; color: var(--faint); font-family: var(--body); margin-top: 3px; font-weight: 500; }

.card-niche { flex: 1; min-width: 0; }
.card-niche .name {
  font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.03em;
  line-height: 1.15; margin: 0 0 7px; text-wrap: pretty; color: var(--text);
}
.card-niche .verdict { font-size: 12px; font-weight: 700; letter-spacing: 0.01em; }

.metarow { display: flex; gap: 9px; }
.metric {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px;
}
.metric .m-label { font-size: 10.5px; letter-spacing: -0.005em; color: var(--faint); font-weight: 600; }
.metric .m-val { font-family: var(--display); font-size: 16px; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 6px; letter-spacing: -0.03em; }
.comp-dot { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 auto; }
.comp-Low { color: var(--good); } .comp-Low .comp-dot { background: var(--good); }
.comp-Medium { color: var(--amber); } .comp-Medium .comp-dot { background: var(--amber); }
.comp-High { color: var(--red); } .comp-High .comp-dot { background: var(--red); }

.kw-section .kw-head { font-size: 11px; letter-spacing: -0.005em; color: var(--faint); font-weight: 600; margin-bottom: 8px; }
.kw-list { display: flex; flex-wrap: wrap; gap: 6px; }
.kw {
  font-family: var(--body); font-size: 11.5px; font-weight: 500; padding: 5px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(232,89,12,0.16);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; letter-spacing: -0.01em;
}
.kw-more { font-size: 11.5px; color: var(--faint); padding: 5px 4px; font-weight: 500; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.foot-actions { display: flex; align-items: center; gap: 8px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none;
  font-size: 12.5px; font-weight: 600; padding: 8px 13px; border-radius: 99px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  transition: all .14s ease; letter-spacing: -0.01em; white-space: nowrap;
}
.link-btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.link-btn svg { width: 13px; height: 13px; }
.tag-count { font-size: 12.5px; color: var(--muted); letter-spacing: -0.01em; }
.tag-count b { color: var(--text); font-weight: 600; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 8px 13px; border-radius: 99px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  transition: all .14s ease; letter-spacing: -0.01em;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.copy-btn.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.copy-btn svg { width: 13px; height: 13px; }

/* ============================== Saved drawer ============================== */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 85; background: rgba(40,32,26,0.32);
  backdrop-filter: blur(8px); display: flex; justify-content: flex-end;
  animation: fade .18s ease;
}
.drawer {
  width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--bg);
  border-left: 1px solid var(--border); box-shadow: -30px 0 80px -30px rgba(40,32,26,0.4);
  animation: slideIn .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: .6; } }
.drawer-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 24px 24px 18px; background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.03em; margin: 0; color: var(--text); }
.drawer-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.drawer-actions { display: flex; gap: 10px; padding: 16px 24px 6px; }
.drawer-actions .btn { flex: 1; justify-content: center; }
.btn.ghost-danger { color: var(--red); border-color: rgba(196,66,46,0.3); }
.btn.ghost-danger:hover { background: rgba(196,66,46,0.06); }
.drawer-list { display: flex; flex-direction: column; gap: 10px; padding: 14px 24px 32px; }
.saved-row {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: all .15s ease; box-shadow: var(--shadow);
}
.saved-row:hover { border-color: var(--border-2); transform: translateX(-2px); box-shadow: var(--shadow-lg); }
.saved-score {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.03em;
  border: 1.5px solid; background: var(--bg-2);
}
.saved-info { flex: 1; min-width: 0; }
.saved-name { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; color: var(--text); line-height: 1.2; }
.saved-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; letter-spacing: -0.01em; }
.saved-meta svg { width: 12px; height: 12px; flex: 0 0 auto; }
.saved-remove {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 99px; cursor: pointer;
  display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--faint);
  transition: all .14s ease;
}
.saved-remove svg { width: 15px; height: 15px; }
.saved-remove:hover { color: var(--red); background: rgba(196,66,46,0.07); border-color: rgba(196,66,46,0.2); }
.drawer-empty { text-align: center; padding: 70px 30px; color: var(--muted); }
.drawer-empty svg { width: 42px; height: 42px; color: var(--faint); margin-bottom: 14px; }
.drawer-empty h4 { font-family: var(--display); font-size: 18px; color: var(--text); margin: 0 0 6px; font-weight: 600; letter-spacing: -0.02em; }
.drawer-empty p { font-size: 13.5px; line-height: 1.5; max-width: 30ch; margin: 0 auto; }

/* ============================== Modal ============================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(40,32,26,0.32);
  backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(620px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 40px 100px -30px rgba(40,32,26,0.45); animation: rise .24s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.modal-head { padding: 26px 26px 20px; border-bottom: 1px solid var(--border); position: relative; }
.modal-head .type-badge { margin-bottom: 14px; }
.modal-head h3 { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -0.035em; margin: 0; line-height: 1.08; max-width: 88%; color: var(--text); }
.modal-close {
  position: absolute; top: 22px; right: 22px; width: 34px; height: 34px; border-radius: 99px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--muted);
  cursor: pointer; display: grid; place-items: center; transition: all .14s ease;
}
.modal-close:hover { color: var(--text); border-color: var(--faint); background: var(--surface-2); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 24px; }
.modal-link { width: 100%; justify-content: center; padding: 13px; font-size: 14px; text-decoration: none; }
.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mstat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); padding: 17px; text-align: center; }
.mstat .ms-label { font-size: 11px; letter-spacing: -0.005em; color: var(--faint); font-weight: 600; }
.mstat .ms-val { font-family: var(--display); font-weight: 600; font-size: 26px; margin-top: 7px; letter-spacing: -0.04em; }
.msec h4 { font-family: var(--display); font-size: 14px; letter-spacing: -0.02em; color: var(--text); font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.kw-list.full .kw { white-space: normal; max-width: none; }
.tag-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-pill {
  font-family: var(--body); font-size: 12.5px; font-weight: 500; padding: 7px 12px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); letter-spacing: -0.01em;
}
.copy-all {
  width: 100%; justify-content: center; margin-top: 14px; padding: 13px;
  font-size: 14px;
}
.tag-field {
  width: 100%; margin-top: 13px; resize: vertical; min-height: 56px;
  font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  padding: 12px 14px; outline: none; letter-spacing: -0.01em;
}
.tag-field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232,89,12,0.1); background: #fff; }
.tag-field-hint { font-size: 12px; color: var(--faint); margin-top: 8px; text-align: center; letter-spacing: -0.01em; }

.empty { text-align: center; padding: 90px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--faint); margin-bottom: 16px; }
.empty h3 { font-family: var(--display); font-size: 20px; color: var(--text); margin: 0 0 6px; font-weight: 600; letter-spacing: -0.02em; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 13px 22px; border-radius: 99px; z-index: 100; opacity: 0; pointer-events: none;
  transition: all .25s cubic-bezier(.2,.8,.2,1); box-shadow: 0 16px 40px -12px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; color: var(--accent); }

.footer { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 60px; line-height: 1.8; }
.footer code { font-family: var(--mono); color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); }
.footer a { color: var(--accent); }

/* ============================== Access gate (paywall) ============================== */
#auth-gate {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 600px at 18% -10%, rgba(232,89,12,0.10), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(232,89,12,0.06), transparent 55%),
    #fbf8f5;
  animation: fade .2s ease;
}
.dph-authed #auth-gate { display: none !important; }
#auth-gate.ok { animation: gateOut .45s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes gateOut { to { opacity: 0; transform: scale(1.02); visibility: hidden; } }
#auth-gate.shake .auth-card { animation: shake .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%,90% { transform: translateX(-1px); } 20%,80% { transform: translateX(3px); }
  30%,50%,70% { transform: translateX(-7px); } 40%,60% { transform: translateX(7px); }
}

.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 40px 36px 30px; text-align: center;
  box-shadow: 0 2px 8px rgba(40,32,26,0.05), 0 40px 90px -40px rgba(40,32,26,0.28);
  animation: rise .3s cubic-bezier(.2,.8,.2,1);
}
.auth-logo {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 22px;
  background: linear-gradient(155deg, #f97a2e, var(--accent)); display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px rgba(232,89,12,0.55);
}
.auth-logo svg { width: 30px; height: 30px; }
.auth-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(232,89,12,0.2); padding: 5px 12px; border-radius: 99px; margin-bottom: 16px;
}
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -0.035em; margin: 0 0 10px; color: var(--text); }
.auth-sub { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 0 26px; letter-spacing: -0.01em; }

#auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-field span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 7px; letter-spacing: -0.01em; }
.auth-field input {
  width: 100%; font-family: var(--body); font-size: 15px; color: var(--text); letter-spacing: -0.01em;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 13px 15px; outline: none;
  transition: all .15s ease;
}
.auth-field input::placeholder { color: var(--faint); }
.auth-field input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(232,89,12,0.1); }
.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 64px; }
.auth-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--body); font-size: 12.5px; font-weight: 600; padding: 7px 9px; border-radius: 8px;
}
.auth-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.auth-error {
  display: none; font-size: 13px; font-weight: 600; color: var(--red); letter-spacing: -0.01em;
  background: rgba(196,66,46,0.07); border: 1px solid rgba(196,66,46,0.2); border-radius: 10px;
  padding: 10px 13px; margin-top: -2px;
}
.auth-error.show { display: block; animation: fade .2s ease; }
.auth-submit {
  margin-top: 6px; width: 100%; cursor: pointer; font-family: var(--body); font-weight: 600; font-size: 15px;
  color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 12px; padding: 14px;
  transition: all .15s ease; letter-spacing: -0.01em;
}
.auth-submit:hover { background: var(--accent-2); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-foot { font-size: 12px; color: var(--faint); margin-top: 22px; letter-spacing: -0.01em; }

/* Sign-out link in the header */
.signout-btn { color: var(--muted); }
.signout-btn svg { width: 15px; height: 15px; }
.signout-btn:hover { color: var(--accent); }

.loading-screen { display: grid; place-items: center; min-height: 60vh; gap: 16px; color: var(--muted); }
.loading-screen .ldot { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(155deg, #f97a2e, var(--accent)); animation: bob 1.1s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(8deg); } }

@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .controls { position: static; }
  .hero { padding: 36px 0 24px; }
  .hero h2 { font-size: 34px; }
}
