@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Outfit;
  src: url("/fonts/outfit-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Outfit;
  src: url("/fonts/outfit-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Outfit;
  src: url("/fonts/outfit-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #221c17;
  --muted: #5e5349;
  --line: #e5d9c8;
  --paper: #fffdf9;
  --bg: #f3eee4;
  --hive: #1c1714;
  --hive-2: #2a241f;
  --honey: #e7a11a;
  --honey-deep: #c4840b;
  --cream: #f6f1e8;
  --good: #2c6b4a;
  --good-bg: #e7f3ec;
  --danger: #9c3b32;
  --danger-bg: #f8e8e5;
  --link: #8a4d0c;
  --shadow: 0 1px 2px rgba(34, 28, 23, 0.04), 0 16px 40px rgba(34, 28, 23, 0.06);
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

button, input, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

::selection { background: #f3d48a; }

:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
}

.mark { width: 28px; height: 28px; display: block; }

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
}

.loading .mark { width: 42px; height: 42px; color: var(--honey-deep); }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(231, 161, 26, 0.22), transparent 52%),
    radial-gradient(ellipse at 100% 100%, rgba(231, 161, 26, 0.1), transparent 42%),
    var(--hive);
  color: var(--cream);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -80px;
  bottom: -120px;
  background: url("/favicon.svg") center / 280px no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

.brand-lockup, .auth-copy, .brand-foot { position: relative; z-index: 1; }

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--honey);
}

.wordmark {
  font-family: Fraunces, serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--cream);
}

.auth-copy h1 {
  font-family: Fraunces, serif;
  font-weight: 500;
  font-size: clamp(40px, 4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
}

.lede {
  max-width: 460px;
  margin: 0 0 28px;
  font-size: 18px;
  color: #e6dccf;
}

.points { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.points li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start; }

.points strong { display: block; font-weight: 600; }

.points span { color: #d9cec1; font-size: 14.5px; }

.dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--honey);
  transform: rotate(45deg);
}

.brand-foot { color: #cbbba8; font-size: 14px; }

.brand-foot strong { color: var(--cream); font-weight: 600; }

.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 440px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px 26px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--honey-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-card h2 {
  font-family: Fraunces, serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.sub { margin: 0 0 22px; color: var(--muted); }

.stack { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }

.field span, .label {
  font-size: 13px;
  font-weight: 600;
}

.field input, .field textarea, .field select, .search input, .inline input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

.field textarea { min-height: 120px; resize: vertical; }

.field input:focus, .field textarea:focus, .field select:focus, .search input:focus, .inline input:focus {
  border-color: #e0a322;
  box-shadow: 0 0 0 4px rgba(231, 161, 26, 0.18);
}

.hint { color: var(--muted); font-size: 13px; }

.form-error, .banner {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.banner { margin-bottom: 16px; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  font-weight: 600;
}

.btn:hover { background: #000; }

.btn:disabled { opacity: 0.6; cursor: wait; }

.btn-primary { background: var(--honey); color: #24190a; }

.btn-primary:hover { background: #f0b12d; }

.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover { background: #fff; }

.btn-danger { background: var(--danger); color: white; }

.btn-danger:hover { background: #832f28; }

.switch-auth {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--link);
  font-weight: 600;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--hive);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  gap: 18px;
}

.side-head { display: flex; align-items: center; gap: 10px; color: var(--honey); padding: 0 6px; }

.side-head .wordmark { font-size: 22px; }

.side-head small { display: block; color: #b7aa9c; font-size: 12px; letter-spacing: 0.04em; }

.switcher { position: relative; }

.switcher-btn, .menu button, .nav-btn, .seg button, .icon-btn {
  border: 0;
  background: transparent;
  color: inherit;
}

.switcher-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: var(--hive-2);
  border-radius: 12px;
  padding: 10px 12px;
}

.switcher-btn strong { display: block; font-size: 14px; }

.switcher-btn span { color: #b7aa9c; font-size: 12px; }

.chev { color: #b7aa9c; }

.menu {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fffdf9;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.menu button, .menu .create-row {
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
}

.menu button { display: flex; justify-content: space-between; width: 100%; }

.menu button[aria-current="true"], .menu button:hover { background: #f6efe3; }

.create-row { display: flex; gap: 6px; }

.create-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.nav { display: grid; gap: 16px; }

.nav-label {
  margin: 0 8px 6px;
  color: #9c8f82;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 8px 10px;
  color: #f3ece3;
  text-align: left;
}

.nav-btn:hover, .nav-btn[aria-current="page"] { background: rgba(255, 255, 255, 0.06); }

.nav-btn[aria-current="page"] { color: var(--honey); }

.count {
  color: #b7aa9c;
  font-size: 12px;
}

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3a312a;
  color: var(--honey);
  font-weight: 600;
  font-size: 13px;
  flex: none;
}

.who { min-width: 0; }

.who strong, .who span { display: block; }

.who span {
  color: #b7aa9c;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #e7d8c6;
  font-size: 13px;
  font-weight: 600;
}

.main { min-width: 0; }

.view { padding: 32px 36px 72px; max-width: 1120px; }

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.view-head h1, .modal h2, .answer h3 {
  font-family: Fraunces, serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0;
}

.view-head h1 { font-size: 42px; line-height: 1; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--honey);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.kicker {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.summary p, .answer p { margin: 0; }

.toolbar { margin: 8px 0 14px; }

.search input { background: rgba(255, 253, 249, 0.8); }

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

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: var(--shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 196px;
}

.card:hover { border-color: #e0c48a; transform: translateY(-2px); }

.card-top, .member, .invite, .source {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.title-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.title-btn {
  flex: 1;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.title-btn:hover { color: var(--link); }

.card .btn { margin-top: auto; align-self: flex-start; }

.card p, .source p {
  margin: 0;
  color: #3f352d;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.when, .host { color: var(--muted); font-size: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-note { background: #fff1d2; color: #8a5a08; }
.pill-link { background: #e7eef8; color: #23486f; }
.pill-task { background: var(--good-bg); color: var(--good); }
.pill-document { background: #f3e7f6; color: #6a3a72; }
.pill-receipt { background: #efe7da; color: #6a4b24; }
.pill-warranty { background: #f8e7d2; color: #8a4d0c; }
.pill-recipe { background: #e7f3ec; color: #246246; }
.pill-doctor { background: #e7eef8; color: #23486f; }
.pill-local, .pill-openai { background: #241c16; color: #f6d48a; letter-spacing: 0.04em; }

.tags, .related { display: flex; flex-wrap: wrap; gap: 6px; }

.tag, .related button {
  border-radius: 999px;
  background: #f6f0e6;
  color: #4d433a;
  font-size: 12px;
  padding: 3px 8px;
}

.related button { border: 0; }

.related button:hover { background: #efe2cc; }

.card.done .title-btn { text-decoration: line-through; color: var(--muted); }

.check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid #c8b59a;
  background: white;
  flex: none;
  margin-top: 1px;
}

.check[aria-pressed="true"] {
  background: var(--good);
  border-color: var(--good);
  color: white;
}

.empty {
  border: 1px dashed #d9cbb8;
  border-radius: 16px;
  padding: 28px;
  background: rgba(255, 253, 249, 0.55);
}

.empty h2 { font-family: Fraunces, serif; font-weight: 500; margin: 0 0 6px; }

.empty p { margin: 0; color: var(--muted); }

.ask-box textarea { min-height: 92px; font-size: 18px; }

.answer {
  margin-top: 16px;
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--honey);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
}

.answer h3 { font-size: 28px; margin-bottom: 8px; }

.sources { display: grid; gap: 8px; margin-top: 14px; }

.source {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  align-items: flex-start;
}

.source strong { display: block; }

.team-list, .panel { display: grid; gap: 10px; }

.panel, .member, .invite {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.member { align-items: center; }

.role {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f6f0e6;
}

.role-owner { background: #fff1d2; color: #8a5a08; }

.inline { display: flex; gap: 8px; flex-wrap: wrap; }

.inline input { flex: 1; min-width: 180px; }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(28, 23, 20, 0.46);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal {
  width: min(640px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  background: var(--paper);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f6f0e6;
  font-size: 18px;
}

.seg { display: flex; gap: 6px; flex-wrap: wrap; }

.seg button {
  border-radius: 999px;
  padding: 6px 10px;
  background: #f6f0e6;
}

.seg button[aria-pressed="true"] { background: var(--ink); color: white; }

.modal-actions, .danger-zone { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.danger-zone { justify-content: space-between; align-items: center; margin-top: 8px; }

.prose { white-space: pre-wrap; }

.plan {
  margin-top: 28px;
  max-width: 460px;
  border: 1px solid rgba(231, 161, 26, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
}

.plan-top, .reminder, .reminder-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.plan strong { font-family: Fraunces, serif; font-size: 22px; font-weight: 500; }

.price { font-family: Fraunces, serif; font-size: 28px; color: var(--honey); letter-spacing: -0.03em; }

.plan ul { margin: 10px 0 0; padding-left: 18px; color: #e6dccf; }

.plan li { margin: 4px 0; }

.plan-page {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
  max-width: 560px;
}

.plan-page ul { color: var(--ink); }

.plan-page .price { color: var(--honey-deep); }

.dates { display: flex; flex-wrap: wrap; gap: 6px; }

.date-chip {
  border-radius: 999px;
  background: #fff4df;
  color: #8a4d0c;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
}

.reminder-strip, .snap-form, .drop {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.reminder-strip { padding: 14px 16px; margin-bottom: 14px; }

.reminder-row { flex-wrap: wrap; margin-top: 8px; }

.reminder {
  border: 0;
  background: #fff8ee;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: left;
}

.snap-form, .drop { padding: 14px; }

.drop input { margin-top: 8px; }

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px 22px; gap: 22px; }
  .auth-copy h1 { font-size: 36px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 6;
    height: auto;
    padding: 12px;
    gap: 10px;
  }
  .nav { display: flex; flex-wrap: wrap; gap: 6px; overflow: visible; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .nav-btn { width: auto; white-space: nowrap; }
  .side-head small { display: none; }
  .who { display: none; }
  .view { padding: 18px 14px 48px; }
  .view-head { align-items: flex-start; flex-direction: column; }
  .view-head h1 { font-size: 32px; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
}
