/* ============================================================
   Blokhood — app.css · "Your Block. Your People. Your App."
   Navy #1e2a5a · Gold #e6a91e · warm, neighborly, light/dark
   Self-contained (system fonts), mobile-first, RTL-safe.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light;
  --navy: #1e2a5a; --navy-2: #2c3b78; --navy-3: #141f47;
  --gold: #e6a91e; --gold-2: #b8860b; --gold-tint: rgba(230,169,30,.13);
  --bg: #faf5ea; --bg-glow: rgba(230,169,30,.10);
  --card: #ffffff; --card-2: #fffdf7; --line: #eadfca; --line-strong: #d8cbaf;
  --ink: #212c50; --muted: #6e6753; --on-primary: #ffffff;
  --primary-grad: linear-gradient(180deg,#2b3a75,#1e2a5a);
  --primary-grad-hover: linear-gradient(180deg,#33438a,#243169);
  --err: #b3372a; --ring: rgba(230,169,30,.40); --ring-strong: rgba(30,42,90,.18);
  --shadow-1: 0 1px 2px rgba(30,42,90,.05), 0 2px 6px rgba(30,42,90,.07);
  --shadow-2: 0 2px 6px rgba(30,42,90,.08), 0 10px 28px rgba(30,42,90,.12);
  --shadow-btn: 0 2px 8px rgba(30,42,90,.22);
  --radius: 14px; --radius-sm: 10px; --speed: .18s; --ease: cubic-bezier(.2,.7,.3,1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --navy: #a9b7ee; --navy-2: #c0cbf5; --navy-3: #8ea0e6;
    --gold: #f0b73f; --gold-2: #e6a91e; --gold-tint: rgba(240,183,63,.12);
    --bg: #12151f; --bg-glow: rgba(230,169,30,.07);
    --card: #1c2233; --card-2: #222941; --line: #2b3350; --line-strong: #3c4569;
    --ink: #e9e6dc; --muted: #a49e8d; --on-primary: #ffffff;
    --primary-grad: linear-gradient(180deg,#43549e,#323f7e);
    --primary-grad-hover: linear-gradient(180deg,#4d5fb0,#3a488f);
    --err: #ff9180; --ring: rgba(240,183,63,.45); --ring-strong: rgba(169,183,238,.25);
    --shadow-1: 0 1px 2px rgba(0,0,0,.30), 0 2px 8px rgba(0,0,0,.25);
    --shadow-2: 0 2px 8px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.40);
    --shadow-btn: 0 2px 10px rgba(0,0,0,.45);
  }
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  line-height: 1.5;
  background: radial-gradient(1100px 520px at 50% -8%, var(--bg-glow), transparent 62%), var(--bg);
  color: var(--ink); -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold-tint); color: inherit; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 3. Skip link ---------- */
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; background: var(--navy); color: var(--on-primary);
  padding: .6rem .9rem; border-radius: var(--radius-sm); z-index: 10; box-shadow: var(--shadow-2); text-decoration: none; font-weight: 600; }

/* ---------- 4. Screens ---------- */
.screen { display: none; min-height: 100vh; min-height: 100svh; }
.screen.active { display: block; animation: screen-in .28s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
.wrap { max-width: 520px; margin-inline: auto; padding-block: 2.25rem 3.5rem; padding-inline: 1.25rem; }

/* ---------- 5. Brand ---------- */
.logo { font-weight: 800; font-size: clamp(2.25rem,8vw,2.6rem); letter-spacing: -.035em; line-height: 1.1; text-align: center; margin-block-start: 1rem; }
.logo .a { color: var(--navy); }
.logo .b { color: var(--gold); }
:root[data-nav] .logo .a { color: var(--gold); }
.tag { text-align: center; color: var(--navy); font-weight: 600; font-size: .92rem; letter-spacing: .015em; margin-block: .3rem 1.5rem; opacity: .92; }

/* ---------- 6. Type scale ---------- */
h1 { font-size: clamp(1.45rem,5vw,1.75rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.2; text-align: center; margin-block: .5rem 1.4rem; }
h2 { display: flex; align-items: center; gap: .55rem; font-size: .8rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-block: 2.25rem .75rem; }
h2::before { content: ""; flex: none; inline-size: .55rem; block-size: .55rem; border-radius: 3px; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.sub { text-align: center; color: var(--muted); margin-block-start: -.5rem; font-size: .95rem; }

/* ---------- 7. Inputs ---------- */
.search { width: 100%; min-height: 52px; padding: .85rem 1rem; font: inherit; font-size: 1rem; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); margin-block-end: 1rem; box-shadow: var(--shadow-1);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease); }
.search::placeholder { color: var(--muted); opacity: .85; }
.search:hover { border-color: var(--line-strong); }
.search:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--ring), var(--shadow-1); }
textarea.search { resize: vertical; min-height: 72px; line-height: 1.5; }
input[type="file"].search { padding: .7rem .8rem; cursor: pointer; }
input[type="file"].search::file-selector-button { font: inherit; font-size: .85rem; font-weight: 600; color: var(--navy);
  background: var(--gold-tint); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .8rem; margin-inline-end: .75rem; cursor: pointer; transition: background var(--speed) var(--ease); }
input[type="file"].search::file-selector-button:hover { background: var(--card-2); }

/* ---------- 8. Lists & items ---------- */
.list { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .6rem; }
.item { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; min-height: 52px; padding: .8rem 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 1rem; box-shadow: var(--shadow-1);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed) var(--ease); }
.item:hover, .item:focus { border-color: var(--navy); background: var(--card-2); box-shadow: var(--shadow-2); outline: 2px solid transparent; }
.item:hover { transform: translateY(-1px); }
.item:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.item > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.item .btn { min-height: 44px; padding: .5rem .95rem; font-size: .88rem; border-radius: var(--radius-sm); flex: none; }
.flag { font-size: 1.45rem; line-height: 1; }
[dir="rtl"] .item { flex-direction: row-reverse; text-align: right; }
#notif-list .item[data-read="0"] { border-inline-start: 3px solid var(--gold); }
#notif-badge:not(:empty) { display: inline-block; min-width: 1.5em; padding: .1em .5em; border-radius: 999px; background: var(--gold); color: #1e2a5a; font-size: .72rem; font-weight: 800; text-align: center; vertical-align: middle; }
#dm-list .item { display: block; cursor: default; transform: none; }
#dashboard, #report-out { cursor: default; line-height: 1.55; white-space: pre-line; }

/* ---------- 9. Buttons ---------- */
.btn { display: block; width: 100%; min-height: 52px; margin-block: .5rem; padding: .85rem 1rem; font: inherit; font-size: 1.02rem; font-weight: 650; letter-spacing: .01em;
  border: 1.5px solid var(--navy); border-radius: var(--radius-sm); background: var(--card); color: var(--navy); cursor: pointer; box-shadow: var(--shadow-1);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform .12s var(--ease); }
.btn:hover { background: var(--gold-tint); border-color: var(--navy-2); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0) scale(.995); box-shadow: var(--shadow-1); }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--primary-grad); border-color: transparent; color: var(--on-primary); box-shadow: var(--shadow-btn); }
.btn.primary:hover { background: var(--primary-grad-hover); }
.btn.primary:active { background: var(--primary-grad); }
.btn.ghost { border-color: var(--line-strong); color: var(--muted); background: var(--card); }

/* ---------- 10. Links ---------- */
.link { display: block; margin: 1rem auto 0; padding: .55rem .75rem; background: none; border: none; font: inherit; font-size: .95rem; font-weight: 550; color: var(--navy); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; border-radius: 6px; transition: color var(--speed) var(--ease); }
.link:hover { color: var(--navy-2); text-decoration-thickness: 2px; }
.link:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 1px; }

/* ---------- 11. Forms & feedback ---------- */
form { display: flex; flex-direction: column; gap: .6rem; margin-block-end: .25rem; }
form .search { margin-block-end: 0; }
form .btn { margin-block: .15rem 0; }
.err { color: var(--err); min-height: 1.2em; text-align: center; margin-block: .5rem; font-size: .92rem; font-weight: 550; }
#join-msg:not(:empty), #assistant-answer:not(:empty) { background: var(--gold-tint); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .9rem; margin-block-start: .75rem; }

/* ---------- 12. Small screens & polish ---------- */
@media (min-width: 560px) { .wrap { padding-block-start: 3rem; } }
img { max-width: 100%; border-radius: 8px; }
