/* Mwen La — Haiti colors: blue #00209F, red #D21034, white, a touch of yellow #F5C518. No purple. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --text: #0d1426;
  --muted: #5b6478;
  --line: #e1e6ef;
  --blue: #00209F;
  --blue-2: #1a3bc4;
  --red: #D21034;
  --red-2: #b00d2b;
  --yellow: #F5C518;
  --green: #12A150;
  --accent: var(--blue);
  --on-accent: #ffffff;
  --shadow: 0 10px 30px rgba(13, 20, 38, .14), 0 2px 6px rgba(13, 20, 38, .08);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151a22;
    --surface-2: #1d2430;
    --text: #f3f4f6;
    --muted: #9aa3b2;
    --line: #2a3342;
    --accent: var(--yellow);
    --on-accent: #111;
    --shadow: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--green); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.t-green { color: var(--green); }
.t-red { color: var(--red); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- brand */
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand b { color: var(--red); }
.logo { width: 30px; height: 30px; flex: none; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .12s, background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-block { display: flex; width: 100%; margin: .45rem 0; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .85rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: .75rem 1.5rem; font-size: 1.05rem; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-2); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-2); color: #fff; }
.btn-yellow { background: var(--yellow); color: #111; }
.btn-yellow:hover { background: #e3b30a; color: #111; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #0e8a44; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-ghost-red { background: transparent; color: var(--red); border-color: rgba(210, 16, 52, .35); }
.btn-ghost-red:hover { background: rgba(210, 16, 52, .08); color: var(--red); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }
.btn-ghost-light:hover { border-color: var(--yellow); color: var(--yellow); }
@media (prefers-color-scheme: dark) {
  /* Dark mode: no blue chrome; secondary actions are yellow. */
  .btn-blue { background: var(--yellow); color: #111; }
  .btn-blue:hover { background: #e3b30a; color: #111; }
}

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .85rem; min-height: 46px;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=range] { padding: 0; min-height: 30px; background: none; border: 0; accent-color: var(--red); }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--red); flex: none; margin: .15rem 0 0; }
.form label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.row { display: flex; gap: .5rem; }
.row > .btn { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.note { background: var(--surface-2); border-left: 4px solid var(--accent); padding: .7rem .9rem; border-radius: 10px; margin: .6rem 0; }
.note.ok { border-left-color: var(--green); }
.flash { padding: .75rem 1rem; border-radius: 12px; margin: .6rem 0; font-weight: 600; }
.flash-error { background: rgba(210, 16, 52, .1); color: var(--red); }
.flash-ok, .flash-info { background: rgba(18, 161, 80, .12); color: var(--green); }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 800; letter-spacing: .02em; }
.tag-danger { background: rgba(210, 16, 52, .14); color: var(--red); }
.tag-safe { background: rgba(18, 161, 80, .15); color: var(--green); }
.tag-admin { background: var(--yellow); color: #111; }
.checks { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .45rem; }
.checks li { padding-left: 1.7rem; position: relative; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--green); color: #fff; font-size: .75rem; display: grid; place-items: center; font-weight: 800; }

/* ----------------------------------------------------------- auth pages */
.auth-page { min-height: 100dvh; }
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.auth-side { height: 120px; position: relative; overflow: hidden; }
.auth-flag { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; }
.auth-flag span:first-child { background: var(--blue); }
.auth-flag span:last-child { background: var(--red); }
.auth-flag::after { content: ''; position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; transform: translate(-50%, -50%); background: #fff; border-radius: 6px; }
.auth-card { width: 100%; max-width: 460px; margin: -36px auto 2rem; background: var(--surface); border-radius: 22px 22px 0 0; padding: 1.6rem 1.25rem 2rem; position: relative; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; margin-top: 1rem; }
.auth-alt { text-align: center; margin-top: 1rem; }
.share-card { display: grid; justify-items: center; gap: .6rem; margin: 1rem 0; text-align: center; }
.avatar-xl { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: #fff; background: linear-gradient(180deg, var(--blue) 50%, var(--red) 50%); border: 4px solid #fff; box-shadow: var(--shadow); }
.share-lock { background: var(--surface-2); padding: .7rem .9rem; border-radius: 12px; font-size: .92rem; }
.btn-know { font-size: 1.1rem; min-height: 54px; }
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr 1fr; }
  .auth-side { height: auto; }
  .auth-flag::after { width: 120px; height: 80px; }
  .auth-card { margin: auto; border-radius: 22px; padding: 2.2rem; }
}

/* ------------------------------------------------------------ map page */
.map-page { overflow: hidden; height: 100dvh; overscroll-behavior: none; }
.map { position: fixed; inset: 0; background: var(--surface-2); }
.map-top {
  position: fixed; z-index: 20; top: calc(10px + var(--safe-t)); left: 10px; right: 10px;
  display: flex; gap: 8px; align-items: center;
}
.brand-mini { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.brand-mini .logo { width: 30px; height: 30px; }
.search { flex: 1; display: flex; align-items: center; gap: .4rem; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 0 .4rem 0 .8rem; min-width: 0; }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { border: 0; background: transparent; min-height: 46px; padding: 0 .3rem; box-shadow: none !important; min-width: 0; }
.icon-btn { position: relative; width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; flex: none; font: inherit; }
.icon-btn svg { width: 22px; height: 22px; fill: var(--yellow); stroke: var(--red); stroke-width: 1.2; }
.ai-btn .lock { position: absolute; bottom: -4px; right: -4px; background: var(--red); color: #fff; font-size: .62rem; font-weight: 800; border-radius: 6px; padding: 1px 4px; }
.avatar-btn span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--blue) 50%, var(--red) 50%); color: #fff; font-weight: 800; }
.badge { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }
.badge-inline { font-style: normal; background: var(--red); color: #fff; border-radius: 99px; padding: 0 .4rem; font-size: .72rem; margin-left: .2rem; }

.deps {
  position: fixed; z-index: 19; top: calc(66px + var(--safe-t)); left: 0; right: 0;
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 10px 8px; scrollbar-width: none; scroll-snap-type: x proximity;
}
.deps::-webkit-scrollbar { display: none; }
.dep {
  flex: none; scroll-snap-align: start; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem;
  background: var(--surface); color: var(--text); padding: .45rem .85rem; border-radius: 99px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); min-height: 36px;
}
.dep:hover { color: var(--green); }
.dep.on { background: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { .dep.on { background: var(--yellow); color: #111; } }

.results {
  position: fixed; z-index: 25; top: calc(64px + var(--safe-t)); left: 64px; right: 10px; max-width: 520px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); max-height: 50dvh; overflow: auto; padding: .35rem;
}
.res { display: grid; text-align: left; width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; padding: .6rem .7rem; border-radius: 10px; cursor: pointer; }
.res:hover { background: var(--surface-2); }
.res-head, .res-empty { margin: .4rem .7rem; }

.fabs { position: fixed; z-index: 18; right: 12px; bottom: calc(86px + var(--safe-b)); display: grid; gap: 10px; }
.fab { width: 52px; min-height: 52px; border-radius: 16px; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; font: inherit; font-size: .62rem; font-weight: 800; padding: 6px 0; }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab:hover { color: var(--green); }
.fab-red { background: var(--red); color: #fff; }
.fab-red:hover { color: #fff; background: var(--red-2); }
body.sat-on #btn-layer { background: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { body.sat-on #btn-layer { background: var(--yellow); color: #111; } }

/* ----------------------------------------------------------- the sheet */
.sheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: min(72dvh, 620px);
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column; transform: translateY(calc(100% - 74px - var(--safe-b))); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: translateY(0); }
.grip { border: 0; background: transparent; padding: 8px 0 2px; cursor: pointer; display: grid; place-items: center; }
.grip span { width: 44px; height: 5px; border-radius: 9px; background: var(--line); }
.tabs { display: flex; gap: 4px; padding: 4px 10px 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .9rem; padding: .55rem .8rem; border-radius: 10px; cursor: pointer; min-height: 40px; }
.tabs button.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -3px 0 var(--red); }
.sheet-body { overflow-y: auto; padding: 14px 16px 24px; flex: 1; overscroll-behavior: contain; }
.pane { display: none; }
.pane.active { display: block; animation: fadeUp .25s ease; }
.pane h4 { margin: 1.2rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.empty { text-align: center; padding: .5rem 0; }
.home-card { display: flex; gap: .8rem; align-items: center; background: var(--surface-2); border-radius: 14px; padding: .8rem; margin-bottom: .7rem; }
.home-card p { margin: 0; }
.home-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--red); display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.privacy-box { margin-top: 1.1rem; padding: .9rem; border-radius: 14px; border: 1.5px dashed var(--line); }
.privacy-box p { margin: .3rem 0 .4rem; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: .65rem; padding: .55rem; border-radius: 12px; background: var(--surface-2); }
.person .face { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--blue); flex: none; }
.person .who { display: grid; min-width: 0; flex: 1; }
.person .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.legend { display: flex; gap: 1rem; font-weight: 700; font-size: .9rem; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.red { background: var(--red); box-shadow: 0 0 0 4px rgba(210, 16, 52, .2); }
.dot.green { background: var(--green); box-shadow: 0 0 0 4px rgba(18, 161, 80, .2); }
.zone-list { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: 6px; }
.zone-item { width: 100%; display: flex; gap: .7rem; align-items: flex-start; text-align: left; border: 0; font: inherit; color: var(--text); background: var(--surface-2); padding: .7rem; border-radius: 12px; cursor: pointer; border-left: 4px solid var(--green); }
.zone-item.danger { border-left-color: var(--red); }
.zone-item .dot { margin-top: .35rem; }
.zone-item span { display: grid; }
@media (min-width: 900px) {
  .sheet { left: 14px; right: auto; top: calc(118px + var(--safe-t)); bottom: 14px; width: 380px; height: auto; border-radius: 20px; transform: none; box-shadow: var(--shadow); }
  .sheet.open, .sheet { transform: none; }
  .grip { display: none; }
  .map-top { right: auto; width: min(640px, calc(100vw - 28px)); left: 14px; }
  .deps { left: 0; right: auto; max-width: 100vw; padding-left: 14px; }
  .fabs { bottom: 34px; right: 16px; }
  .results { left: 74px; }
}

/* ------------------------------------------------------------ place mode */
.place-mode { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.crosshair { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); display: grid; justify-items: center; }
.cross-pin { width: 46px; height: 46px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); animation: bob 1.4s ease-in-out infinite; }
.crosshair .shadow { width: 14px; height: 5px; border-radius: 50%; background: rgba(0, 0, 0, .35); margin-top: -2px; }
.place-bar { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); pointer-events: auto; background: var(--surface); border-radius: 18px; padding: .9rem; box-shadow: var(--shadow); max-width: 520px; margin: 0 auto; }
.place-bar p { margin: 0 0 .6rem; font-weight: 600; }
body.placing .sheet, body.placing .fabs, body.placing .deps { display: none; }

/* ---------------------------------------------------------------- markers */
.mk { cursor: pointer; }
.mk-home { width: 44px; height: 44px; margin-bottom: 8px; background: var(--red); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, .3); }
.mk-home svg { width: 22px; height: 22px; fill: #fff; transform: rotate(45deg); }
.mk-person { display: grid; justify-items: center; cursor: pointer; }
.mk-person .face { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(180deg, var(--blue) 50%, var(--red) 50%); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.mk-person .name { margin-top: 3px; background: var(--surface); color: var(--text); font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-temp { background: var(--yellow); color: #111; font-weight: 800; font-size: .78rem; padding: .3rem .6rem; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); position: relative; margin-bottom: 8px; max-width: 180px; }
.mk-temp::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 7px solid transparent; border-bottom: 0; border-top-color: var(--yellow); }
.mk-me { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(26, 115, 232, .25); }

/* Waving zone flag (green = safe, red = danger) */
.zone-flag { --c: var(--green); position: relative; width: 40px; height: 50px; border: 0; padding: 0; background: transparent; cursor: pointer; animation: flagDrop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.zone-flag.danger { --c: var(--red); }
.zone-flag .pole { position: absolute; left: 12px; bottom: 2px; width: 3px; height: 44px; border-radius: 2px; background: linear-gradient(#f2f2f2, #6b7280); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.zone-flag .cloth {
  position: absolute; left: 15px; top: 4px; width: 25px; height: 17px; background: var(--c); border-radius: 0 3px 3px 0;
  transform-origin: left center; animation: wave 1.5s ease-in-out infinite; box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
  background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .35) 45%, rgba(255, 255, 255, 0) 70%);
  background-color: var(--c); background-size: 200% 100%;
}
.zone-flag .cloth::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .7rem; font-weight: 900; }
.zone-flag.danger .cloth::after { content: '!'; font-size: .85rem; }
.zone-flag .pulse { position: absolute; left: 13.5px; bottom: 0; width: 26px; height: 10px; border-radius: 50%; transform: translate(-50%, 50%); background: var(--c); opacity: .5; animation: pulse 2s ease-out infinite; }
.zone-flag.danger .pulse { animation-duration: 1.2s; }
.zone-flag:hover .cloth { animation-duration: .7s; }

/* Popups */
.maplibregl-popup-content { background: var(--surface) !important; color: var(--text); border-radius: 16px !important; padding: 14px 16px 12px !important; box-shadow: var(--shadow) !important; animation: popIn .32s cubic-bezier(.2, 1.3, .4, 1); }
.maplibregl-popup-close-button { font-size: 20px; width: 30px; height: 30px; color: var(--muted); right: 4px; top: 4px; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface) !important; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface) !important; }
.pop { display: grid; gap: .35rem; padding-right: 14px; }
.pop p { margin: 0; }
.pop-title { font-size: 1.05rem; }
.pop-note { background: var(--surface-2); border-radius: 10px; padding: .55rem .7rem; animation: noteIn .5s .12s ease both; white-space: pre-wrap; }
.pop-danger .maplibregl-popup-content { border-top: 5px solid var(--red); }
.pop-safe .maplibregl-popup-content { border-top: 5px solid var(--green); }
.pop-danger .pop-note { border-left: 4px solid var(--red); }
.pop-safe .pop-note { border-left: 4px solid var(--green); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ----------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; }
.modal-back { position: absolute; inset: 0; background: rgba(5, 8, 15, .55); animation: fade .2s; }
.modal-card { position: relative; background: var(--surface); border-radius: 22px 22px 0 0; padding: 1.3rem 1.1rem calc(1.3rem + var(--safe-b)); max-height: 88dvh; overflow-y: auto; animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
.modal-card h2 { padding-right: 2.2rem; font-size: 1.3rem; }
.modal-x { position: absolute; right: 12px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.5rem; cursor: pointer; line-height: 1; }
@media (min-width: 640px) {
  .modal { place-items: center; }
  .modal-card { width: min(460px, calc(100vw - 32px)); border-radius: 22px; padding: 1.6rem; animation: popIn .24s ease; }
}
.modal-premium .modal-card { border-top: 6px solid var(--red); }
.price-big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; color: var(--red); }
.price-big small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.copy-row input { font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 99px; cursor: pointer; }
.chip:hover { border-color: var(--green); color: var(--green); }
.ai-answer { display: grid; gap: 4px; }
.ai-reply { background: linear-gradient(135deg, rgba(0, 32, 159, .08), rgba(210, 16, 52, .08)); border-radius: 12px; padding: .7rem .85rem; margin: 0 0 .3rem; font-weight: 600; }
.kind-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kind { border: 2px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 800; padding: .7rem; border-radius: 12px; cursor: pointer; min-height: 48px; }
.kind.safe.on { border-color: var(--green); background: var(--green); color: #fff; }
.kind.danger.on { border-color: var(--red); background: var(--red); color: #fff; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 80; left: 50%; top: calc(118px + var(--safe-t)); transform: translateX(-50%); display: grid; gap: 6px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { background: var(--surface); color: var(--text); border-left: 5px solid var(--blue); border-radius: 12px; padding: .7rem .9rem; box-shadow: var(--shadow); font-weight: 600; animation: fadeUp .25s ease; transition: opacity .4s, transform .4s; }
.toast-ok { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-info { border-left-color: var(--yellow); }
.toast.out { opacity: 0; transform: translateY(-6px); }

/* ---------------------------------------------------------------- admin */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 5; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 1rem; }
.stat { background: var(--surface-2); border-radius: 14px; padding: .9rem; display: grid; border-top: 4px solid var(--blue); }
.stat b { font-size: 1.6rem; }
.stat-red { border-top-color: var(--red); }
.stat-green { border-top-color: var(--green); }
@media (prefers-color-scheme: dark) { .stat { border-top-color: var(--yellow); } .stat-red { border-top-color: var(--red); } .stat-green { border-top-color: var(--green); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-blocked { opacity: .55; }
.inline-search { display: flex; gap: 6px; margin-bottom: .6rem; }
.inline-search input { min-height: 40px; }

/* ------------------------------------------------------------ animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes popIn { from { transform: scale(.85) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes noteIn { from { opacity: 0; transform: translateY(6px); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes wave {
  0%, 100% { transform: perspective(60px) rotateY(0deg) skewY(0deg); background-position: 0 0; }
  25% { transform: perspective(60px) rotateY(-14deg) skewY(-4deg); }
  50% { transform: perspective(60px) rotateY(6deg) skewY(3deg); background-position: 100% 0; }
  75% { transform: perspective(60px) rotateY(-8deg) skewY(-2deg); }
}
@keyframes pulse { 0% { transform: translate(-50%, 50%) scale(.4); opacity: .7; } 100% { transform: translate(-50%, 50%) scale(2.4); opacity: 0; } }
@keyframes flagDrop { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
