/* SFEROOM Social Desk — calm warm workspace, ink sidebar, restrained copper accent. No gradients, no icons. */
:root {
  --paper: #faf7f2;
  --paper-2: #f3eee6;
  --line: #e4dcd0;
  --line-strong: #cfc4b4;
  --ink: #1f1b17;
  --ink-2: #4a433c;
  --muted: #7a7169;
  --sidebar: #1e1a17;
  --sidebar-text: #e9e2d8;
  --sidebar-muted: #a69c90;
  --accent: #b5563a;
  --accent-ink: #8f3f28;
  --accent-soft: #f4e3dc;
  --ok: #3c6e4b;
  --ok-soft: #e4efe6;
  --warn-soft: #f6ebd4;
  --err-soft: #f6dfda;
  --focus: #2f5fb3;
  --sans: "Source Sans 3", "Fira Sans", "PT Sans", "Noto Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Fira Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased;
}
code { font-family: var(--mono); font-size: 0.92em; background: var(--paper-2); padding: 0.05em 0.3em; border-radius: 3px; word-break: break-all; }
a { color: var(--accent-ink); }
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.35rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 2rem 0 0.75rem; }
p { margin: 0 0 0.9rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hint { color: var(--muted); font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: #fff; padding: 0.5rem 0.9rem; z-index: 100; }
.skip-link:focus { left: 0.5rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* buttons & forms — every control is at least 44px tall */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  padding: 0.5rem 1.1rem; border-radius: 6px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-secondary { background: var(--paper-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-ink); padding-inline: 0.6rem; }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.field { margin-bottom: 1.1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea, select {
  width: 100%; min-height: 44px; padding: 0.55rem 0.75rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 6px;
}
textarea { min-height: 7rem; resize: vertical; }
input:invalid[aria-invalid="true"], [aria-invalid="true"] { border-color: var(--accent); }
.form-error, .flash, .notice { padding: 0.75rem 0.9rem; border-radius: 6px; border: 1px solid var(--line); margin-bottom: 1rem; }
.form-error { background: var(--err-soft); border-color: #e3b7ad; color: #6d2a1b; }
.flash-ok { background: var(--ok-soft); border-color: #bcd5c3; color: var(--ok); }
.flash-warn { background: var(--warn-soft); border-color: #e4cf9d; color: #6a4b0b; }
.flash-err { background: var(--err-soft); border-color: #e3b7ad; color: #6d2a1b; }
.notice { background: var(--paper-2); color: var(--ink-2); }
.inline-form { margin-bottom: 1.25rem; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 600; margin-bottom: 0.35rem; }
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; font-weight: 400; }
.radio-row input { width: 20px; height: 20px; }

/* auth pages */
.auth-page { display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2rem; }
.brand { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; color: var(--muted); margin-bottom: 1rem; }

/* app shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.topbar { display: none; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 1.5rem 1rem; display: flex; flex-direction: column; }
.sidebar-brand { color: var(--sidebar-text); font-size: 0.9rem; line-height: 1.25; }
.sidebar-brand span { color: var(--sidebar-muted); font-weight: 400; letter-spacing: 0.08em; }
.nav { list-style: none; margin: 1rem 0 0; padding: 0; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0.5rem 0.75rem; color: var(--sidebar-text); text-decoration: none; border-radius: 6px; border-left: 3px solid transparent; }
.nav a:hover { background: #2b2521; }
.nav a[aria-current="page"] { border-left-color: var(--accent); background: #2b2521; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid #332c27; }
.sidebar-foot .who { font-size: 0.875rem; word-break: break-all; }
.sidebar-foot .muted { color: var(--sidebar-muted); }
.sidebar-foot .btn-ghost { color: var(--sidebar-text); padding-inline: 0.75rem; }
.sidebar-foot .btn-ghost:hover { background: #2b2521; }
.content { padding: 2.25rem 2.5rem 4rem; max-width: 1100px; }
.page-head { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }

/* tables & empty states */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-bottom: 1rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line-strong); }
.table tbody th { font-weight: 600; }
.table-narrow { max-width: 560px; }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline; }
.empty { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 1.5rem; max-width: 640px; background: #fff; }
.empty h2 { margin-top: 0; }
.kv { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 0.5rem 1.5rem; max-width: 820px; margin: 0 0 1rem; }
.kv dt { font-weight: 600; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.kv dd { margin: 0; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.checklist li { margin-bottom: 0.5rem; }
.thread { list-style: none; padding: 0; margin: 0 0 1.5rem; max-width: 720px; }
.thread li { padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 0.6rem; }
.thread .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.thread .text { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* mobile */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: var(--sidebar); color: var(--sidebar-text); }
  .topbar .brand { color: var(--sidebar-text); margin: 0; }
  .nav-toggle { min-height: 44px; min-width: 44px; background: transparent; color: var(--sidebar-text); border: 1px solid #4a403a; border-radius: 6px; font: inherit; padding: 0 0.9rem; }
  .sidebar { display: none; }
  .sidebar.is-open { display: flex; }
  .content { padding: 1.25rem 1rem 3rem; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line-strong); padding: 0.5rem 0; }
  .table th, .table td { display: block; border: 0; padding: 0.25rem 0; }
  .table .actions { white-space: normal; }
}
