/* Logged-in app theme — same palette as the marketing page (pages#home). */

:root {
  --loam: #2b1d12;
  --trail: #6b4a2b;
  --moss: #3f6b3a;
  --moss-2: #2f5230;
  --lime: #c6f04a;
  --orange: #ff6a2b;
  --cream: #f6f1e7;
  --cream-2: #ece3d2;
  --ink: #1a120a;
  --muted: #7c6a55;
  --card: #fffdf8;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 22px 48px;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
h2 { margin-top: 32px; font-size: 1.25rem; }

a { color: var(--moss-2); font-weight: 600; }
a:hover { color: var(--orange); }

.muted { color: var(--muted); }
.danger { color: #b23c0e; font-weight: 700; }

code {
  background: var(--cream-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
  word-break: break-all;
}

/* Nav */
nav.topnav {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(107, 74, 43, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
}
.brand b { color: var(--moss-2); }

nav.topnav a:not(.brand) { text-decoration: none; color: var(--loam); font-weight: 600; font-size: 0.92rem; }
nav.topnav a:not(.brand):hover { color: var(--orange); }
.nav-end { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Buttons (covers button_to and form submits) */
button, input[type="submit"] {
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--cream);
  background: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
button:hover, input[type="submit"]:hover { background: var(--moss-2); }
form.button_to { display: inline; }

/* Forms */
input:not([type="submit"]), textarea, select {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid #d8ccb4;
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  max-width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
label { font-weight: 600; font-size: 0.9rem; }

fieldset {
  border: 1px solid var(--cream-2);
  border-radius: var(--radius);
  background: var(--card);
  padding: 12px 16px;
  margin: 14px 0;
  max-width: 560px;
}
legend { font-weight: 700; font-size: 0.85rem; padding: 0 6px; }

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 28px -22px rgba(26, 18, 10, 0.5);
  font-size: 0.93rem;
  margin: 12px 0;
}
th {
  background: var(--cream-2);
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
th, td { padding: 10px 12px; border-bottom: 1px solid var(--cream-2); }
tr:last-child td { border-bottom: none; }

details {
  background: var(--card);
  border: 1px solid var(--cream-2);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 12px 0;
}
summary { cursor: pointer; font-weight: 600; }

/* Flash */
.flash-notice, .flash-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  margin: 14px 0;
}
.flash-notice {
  background: rgba(198, 240, 74, 0.35);
  border: 1px solid rgba(63, 107, 58, 0.35);
  color: var(--moss-2);
}
.flash-alert {
  background: rgba(255, 106, 43, 0.12);
  border: 1px solid rgba(255, 106, 43, 0.4);
  color: #b23c0e;
}

/* Link styled as a button (CTAs) */
a.btn {
  display: inline-block; text-decoration: none;
  font-weight: 700; font-size: 0.9rem;
  color: var(--cream); background: var(--ink);
  border-radius: 999px; padding: 11px 22px;
}
a.btn:hover { background: var(--moss-2); color: var(--cream); }
a.btn-primary { background: var(--lime); color: var(--ink); box-shadow: 0 10px 24px -10px rgba(168, 217, 47, 0.9); }
a.btn-primary:hover { background: var(--lime); color: var(--ink); filter: brightness(1.04); }

/* Hunt action row — keep Edit + Pause/scan/Delete inline and same-sized */
.hunt-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.hunt-actions form.button_to { margin: 0; }
.hunt-actions .btn { padding: 8px 16px; font-size: 0.88rem; }

/* Zero-hunt activation hero (hunts#index empty state) */
.empty-hero {
  max-width: 620px; margin: 28px auto; padding: 42px 32px;
  text-align: center;
  background: var(--card);
  border: 1px solid rgba(107, 74, 43, 0.14);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgba(26, 18, 10, 0.5);
}
.empty-hero h2 { margin: 0 0 10px; font-size: 1.6rem; font-weight: 900; }
.empty-hero p { color: var(--muted); margin: 0 auto 18px; max-width: 46ch; }
.empty-hero .btn { margin: 6px 0 20px; padding: 14px 28px; font-size: 1rem; }
.empty-hero p:last-child { margin-bottom: 0; font-size: 0.85rem; }

/* Auth pages (sign in / sign up / forgot + reset password) */
.auth { max-width: 400px; margin: 48px auto; }
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 900; font-size: 1.3rem; letter-spacing: -0.03em;
  text-decoration: none; color: var(--ink); margin-bottom: 22px;
}
.auth-brand b { color: var(--moss-2); }
.auth-card {
  background: var(--card);
  border: 1px solid rgba(107, 74, 43, 0.14);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -24px rgba(26, 18, 10, 0.5);
  padding: 30px 28px;
}
.auth-card h1 { font-size: 1.5rem; font-weight: 900; margin: 0 0 6px; }
.auth-lede { color: var(--muted); font-size: 0.95rem; margin: 0 0 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 6px; }
.auth-card label { margin-top: 10px; }
.auth-card input:not([type="submit"]) { width: 100%; padding: 11px 14px; }
.auth-card input[type="submit"], .auth-card button {
  width: 100%; padding: 12px; font-size: 0.95rem; margin-top: 16px;
}
.auth-forgot { align-self: flex-end; font-size: 0.85rem; margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--muted); }
.field-errors { list-style: none; margin: 0 0 6px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255, 106, 43, 0.1); border: 1px solid rgba(255, 106, 43, 0.4); }
.field-errors li { color: #b23c0e; font-weight: 600; font-size: 0.9rem; }

footer.app-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 22px 28px;
  border-top: 1px solid rgba(107, 74, 43, 0.15);
  font-size: 0.78rem;
  color: var(--muted);
}

svg { vertical-align: middle; }

/* hunt notification prefs */
.notification-mode label { margin-right: 14px; }
.notification-mode .custom-channels { display: none; margin-top: 8px; }
.notification-mode:has(input[value="custom"]:checked) .custom-channels { display: block; }
.silent-badge { color: #b23c0e; font-weight: 600; }

/* Feedback widget (bottom-right chat bubble) */
details.feedback-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
}
details.feedback-widget > summary {
  list-style: none;
  cursor: pointer;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--moss-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(26, 18, 10, 0.25);
}
details.feedback-widget > summary::-webkit-details-marker { display: none; }
details.feedback-widget > summary:hover { background: var(--orange); }
details.feedback-widget[open] > summary { background: var(--ink); }
.feedback-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(320px, calc(100vw - 40px));
  background: var(--card);
  border: 1px solid var(--cream-2);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 12px 32px rgba(26, 18, 10, 0.2);
}
.feedback-panel form { display: grid; gap: 10px; }
.feedback-panel textarea { resize: vertical; }
.feedback-hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
