/* ============================================================
   Twnty v1 — premium design system
   Typography: Inter (Google Fonts) with system fallbacks.
   Palette: violet/indigo brand, warm neutrals, success/warning/error.
   Mobile-first, generous whitespace, soft shadows, clear hierarchy.
   ============================================================ */

:root {
  /* Brand */
  --brand-700: #5b21b6;
  --brand-600: #6d28d9;
  --brand-500: #7c3aed;
  --brand-400: #8b5cf6;
  --indigo-600: #4f46e5;
  --brand-grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --brand-soft: #f3effe;
  --brand-ring: rgba(124, 58, 237, 0.14);

  /* Neutrals */
  --ink-900: #0f0f14;
  --ink-800: #18181b;
  --ink-600: #3f3f46;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e7e7ec;
  --line-strong: #d4d4d8;
  --bg: #fafafb;
  --card: #ffffff;
  --panel: #f7f7f9;

  /* Status */
  --danger: #dc2626;
  --danger-dark: #991b1b;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --ok: #16a34a;
  --ok-dark: #14532d;
  --ok-bg: #f0fdf4;
  --ok-line: #bbf7d0;
  --warn: #d97706;
  --warn-bg: #fffbeb;

  /* Shape & depth */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 15, 20, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 15, 20, 0.06), 0 1px 2px rgba(15, 15, 20, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 15, 20, 0.08), 0 2px 6px rgba(15, 15, 20, 0.05);
  --shadow-lg: 0 20px 48px rgba(15, 15, 20, 0.16), 0 4px 12px rgba(15, 15, 20, 0.08);
  --shadow-brand: 0 6px 16px rgba(109, 40, 217, 0.28);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink-900);
  background-color: var(--bg);
  background-image: radial-gradient(720px 340px at 50% -120px, rgba(124, 58, 237, 0.09), rgba(250, 250, 251, 0) 70%);
  background-repeat: no-repeat;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #ddd6fe; color: var(--ink-900); }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; color: var(--ink-900); }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); font-weight: 800; margin: 0.25rem 0 0.75rem; letter-spacing: -0.03em; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.5rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.4rem; }
p { margin: 0 0 0.75rem; }
.lede { color: var(--muted); font-size: 1.08rem; line-height: 1.6; max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
.req { color: var(--danger); }
.grad {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink-900);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand:hover { text-decoration: none; }
.brand-t {
  display: inline-grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 0.6rem;
  background: var(--brand-grad);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: var(--shadow-brand);
}
.tagline { margin: 0; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.nav { display: flex; gap: 0.25rem; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink-600);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--r-pill);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}
.nav a:hover { background: #f4f4f5; color: var(--ink-900); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-700); }
.nav a.nav-cta {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--shadow-brand);
  padding: 0.5rem 0.95rem;
}
.nav a.nav-cta:hover { filter: brightness(1.06); color: #fff; background: var(--brand-grad); }
.auth { display: flex; align-items: center; gap: 0.6rem; }
.auth .who { font-weight: 700; font-size: 0.92rem; color: var(--ink-800); }

/* ---------------- Layout ---------------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 2rem 20px 3rem; }
.view { margin-bottom: 2rem; animation: view-in 0.28s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
#view-browse h1 { margin-top: 0.6rem; }
#post-list > .muted, #team-list > .muted, #post-detail > .muted { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.6rem 1.05rem;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-900);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease), filter 0.15s var(--ease);
  text-decoration: none;
}
.btn:hover { border-color: var(--brand-400); box-shadow: var(--shadow-sm); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.99); }
.btn-primary {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { filter: brightness(1.07); border-color: transparent; box-shadow: 0 8px 20px rgba(109, 40, 217, 0.34); }
.btn-google { border-color: var(--line-strong); color: var(--ink-800); }
.btn-google::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23FFC107' d='M43.611 20.083H42V20H24v8h11.303C33.654 32.657 29.223 36 24 36c-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917z'/%3E%3Cpath fill='%23FF3D00' d='M6.306 14.691l6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691z'/%3E%3Cpath fill='%234CAF50' d='M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238C29.211 35.091 26.715 36 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44z'/%3E%3Cpath fill='%231976D2' d='M43.611 20.083H42V20H24v8h11.303c-.792 2.237-2.231 4.166-4.087 5.571.001-.001.002-.001.003-.002l6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-small { padding: 0.42rem 0.8rem; min-height: 34px; font-size: 0.88rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-xs); }

/* ---------------- Forms ---------------- */
select, input[type="text"], input[type="number"], textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-900);
  width: 100%;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
select:focus, input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
select::placeholder, input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 16px;
  cursor: pointer;
}
label { display: block; font-weight: 600; font-size: 0.93rem; color: var(--ink-800); margin: 1.05rem 0 0.2rem; }
label input, label select, label textarea { margin-top: 0.4rem; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); margin: 1.05rem 0; padding: 0.9rem 1rem 1rem; background: var(--panel); }
legend { font-weight: 600; font-size: 0.93rem; padding: 0 0.4rem; color: var(--ink-800); }

.partner-pick {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: #ececf0;
  padding: 4px;
  border-radius: var(--r-md);
  margin-top: 0.5rem;
}
.partner-pick button {
  flex: 1 1 0;
  min-width: 0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.6rem 0.4rem;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-600);
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.partner-pick button:hover { color: var(--ink-900); }
.partner-pick button.selected {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

/* ---------------- Filters ---------------- */
.filters { display: flex; gap: 0.6rem; align-items: center; margin: 1.4rem 0 1.25rem; flex-wrap: wrap; }
.filters label { margin: 0; font-weight: 600; color: var(--ink-600); }
.filters select { width: auto; min-width: 190px; }

/* ---------------- Cards & posts ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.post-list { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.25rem 1.3rem;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #ddd6fe;
}
.post-card h3 { font-size: 1.14rem; margin: 0.45rem 0 0.35rem; }
.post-card h3 a { color: var(--ink-900); text-decoration: none; }
.post-card h3 a:hover { color: var(--brand-600); text-decoration: none; }
.card-top { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.18rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-700);
}
.chip.full { background: var(--danger-bg); color: var(--danger-dark); }
.post-meta { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0; line-height: 1.5; }
.post-meta.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.byline { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.85rem;
}
.post-foot .post-meta { margin: 0; }
.post-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }

/* Avatars (initials, deterministic hue set inline) */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  background: var(--brand-grad);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.78rem; }
.avatar-inline { vertical-align: middle; margin-right: 0.15rem; }

/* Team-fill progress */
.fill {
  height: 6px;
  border-radius: var(--r-pill);
  background: #ececf0;
  overflow: hidden;
  margin: 0.55rem 0 0.15rem;
}
.fill > span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--brand-grad);
  transition: width 0.4s var(--ease);
}
.fill-lg { height: 8px; margin: 0.7rem 0 0.2rem; }

/* Empty states */
#browse-empty, #teams-empty {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: #fff;
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: 1rem;
  color: var(--muted);
  margin: 0.5rem 0;
}

/* ---------------- Forms (new post) ---------------- */
.form { max-width: 660px; padding: 1.6rem 1.75rem; border-radius: var(--r-xl); }
.form .btn[type="submit"] { margin-top: 1.25rem; width: 100%; min-height: 48px; font-size: 1rem; }
.form .muted.small { margin-top: 0.9rem; text-align: center; }
@media (min-width: 640px) { .form .btn[type="submit"] { width: auto; min-width: 220px; } .form .muted.small { text-align: left; } }

/* ---------------- Post detail ---------------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-600);
  padding: 0.35rem 0.7rem 0.35rem 0.55rem;
  border-radius: var(--r-pill);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.back:hover { background: #f4f4f5; color: var(--ink-900); text-decoration: none; }
.detail-card { padding: 1.6rem 1.75rem; border-radius: var(--r-xl); }
.detail-card h1 { font-size: clamp(1.5rem, 3.5vw, 1.9rem); margin: 0.55rem 0 0.5rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1.1rem 0 0.4rem; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }
.fact {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.9rem 1rem;
}
.fact-label { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.fact-value { display: block; font-size: 0.95rem; color: var(--ink-800); line-height: 1.5; }
.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.team-head h2 { margin: 0; }
.member-list { list-style: none; padding: 0; margin: 0.6rem 0 0.2rem; }
.member-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.member-list li:last-child { border-bottom: none; }
.member { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.95rem; color: var(--ink-800); }
.member .tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-soft);
  border-radius: var(--r-pill);
  padding: 0.1rem 0.5rem;
  margin-left: 0.15rem;
}
.link-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.1rem;
}
.link-btn:hover { text-decoration: underline; }

/* ---------------- Team grid: chat & tasks ---------------- */
.team-grid { display: grid; gap: 1.1rem; grid-template-columns: 1.45fr 1fr; margin-top: 1.1rem; }
@media (max-width: 780px) { .team-grid { grid-template-columns: 1fr; } }
.team-grid .card { padding: 1.25rem 1.3rem; }
.team-grid .card h2 { display: flex; align-items: center; gap: 0.5rem; }
.chat-box {
  height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.9rem;
  margin: 0.6rem 0 0.8rem;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.chat-msg { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; align-items: flex-start; }
.chat-msg .chat-body { min-width: 0; max-width: 78%; }
.chat-msg .who { font-weight: 700; font-size: 0.85rem; color: var(--ink-800); }
.chat-msg .when { color: var(--muted-2); font-size: 0.78rem; margin-left: 0.45rem; font-weight: 500; }
.chat-text {
  margin-top: 0.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.93rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  box-shadow: var(--shadow-xs);
}
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .chat-body { display: flex; flex-direction: column; align-items: flex-end; }
.chat-msg.mine .chat-text {
  background: var(--brand-grad);
  color: #fff;
  border-color: transparent;
  border-radius: var(--r-md) 4px var(--r-md) var(--r-md);
}
.chat-form, .task-form { display: flex; gap: 0.5rem; }
.chat-form input, .task-form input { flex: 1; min-width: 0; }

.task-list { list-style: none; padding: 0; margin: 0.6rem 0; }
.task-list li { display: flex; gap: 0.65rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: none; }
.task-list input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  position: relative;
}
.task-list input[type="checkbox"]:hover { border-color: var(--brand-500); }
.task-list input[type="checkbox"]:checked {
  background: var(--brand-grad);
  border-color: transparent;
}
.task-list input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.task-list li.done span { text-decoration: line-through; color: var(--muted); }
.task-list .del {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-2);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.task-list .del:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------------- Modal ---------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 40;
  animation: fade-in 0.18s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: #fff;
  border-radius: var(--r-xl);
  padding: 1.5rem 1.6rem;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.22s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.2rem; }

/* ---------------- Notice (toast) ---------------- */
.notice {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: min(480px, calc(100vw - 2rem));
  padding: 0.75rem 1.05rem;
  border-radius: var(--r-md);
  background: var(--ink-800);
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  animation: toast-in 0.25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.notice::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
}
.notice.ok::before { background: #4ade80; }

/* ---------------- Footer ---------------- */
.foot { text-align: center; color: var(--muted); padding: 2.5rem 1rem 3rem; border-top: 1px solid var(--line); }
.foot p { margin: 0.2rem 0; }
.foot strong { color: var(--ink-800); }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  .wrap { padding: 1.4rem 16px 2.5rem; }
  .topbar-inner { padding: 0.55rem 16px; gap: 0.35rem 0.75rem; }
  .tagline { display: none; }
  .nav { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.15rem; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; }
  .auth { margin-left: auto; }
  .auth .who { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .filters select { flex: 1; min-width: 0; }
  .detail-card, .form { padding: 1.2rem 1.1rem; }
  .chat-box { height: 320px; }
  .chat-msg .chat-body { max-width: 86%; }
  .modal-card { padding: 1.25rem; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
