:root {
  --bg: #0e0f11; --card: #17181b; --line: #34363c; --line-strong: #555861;
  --text: #e7e7ea; --muted: #9a9ca4; --accent: #4c8dff; --fav: #e0b030; --err: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, "Segoe UI", sans-serif;
  display: flex; flex-direction: column; overflow: hidden; }
button, select, input, .btn { font: inherit; color: var(--text); background: #222429; border: 1px solid var(--line);
  border-radius: 6px; height: 30px; padding: 0 10px; }
button, .btn { cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--line-strong); }
button.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.bar .brand { font-size: 15px; white-space: nowrap; }
.bar #q { width: 230px; }
.bar .grow { flex: 1; }
.bar label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
.bar label select { height: 28px; padding: 0 4px; }

main { flex: 1; min-height: 0; padding: 8px; }
#grid { height: 100%; display: grid; gap: 14px; }
/* Each post sits on its own mat (passe-partout): tight gaps inside a post, wide dark gaps between posts. */
.card { position: relative; min-height: 0; min-width: 0; display: flex; padding: 6px;
  background: var(--frame, #5c606a); border-radius: 10px; overflow: hidden; }
#grid.frame-pink { --frame: #ff2d8a; }
#grid.frame-off { --frame: transparent; }
#grid.frame-off .card { padding: 0; }
.card.fav { background: var(--fav); }
.card .more { position: absolute; right: 12px; bottom: 12px; z-index: 1; pointer-events: none; font-size: 12px;
  color: #fff; background: rgba(0, 0, 0, .6); padding: 1px 7px; border-radius: 10px; }
.strip { flex: 1; min-height: 0; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
/* Fill the slot completely (crop, no black bars); bias towards the top where faces usually are. */
.strip img { border-radius: 4px; flex: 0 0 auto; width: calc((100% - (var(--n) - 1) * 2px) / var(--n)); min-width: 0; height: 100%;
  object-fit: cover; object-position: 50% 25%; cursor: zoom-in; }
.empty { text-align: center; color: var(--muted); margin-top: 20vh; font-size: 16px; }

.lb { position: fixed; inset: 0; background: rgba(0, 0, 0, .93); display: flex; align-items: center;
  justify-content: center; z-index: 20; cursor: zoom-out; }
.lb img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lbcount { position: absolute; top: 10px; right: 16px; color: var(--muted); }

.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; background: #141518; border-left: 1px solid var(--line);
  padding: 14px; overflow-y: auto; z-index: 10; display: flex; flex-direction: column; gap: 10px; }
.panel.wide { width: 520px; }
.panel-hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-actions { display: flex; gap: 8px; }
.panel pre { white-space: pre-wrap; word-break: break-word; font: 13px/1.5 system-ui, sans-serif; margin: 0;
  background: var(--card); padding: 10px; border-radius: 8px; }
.panel h3 { margin: 10px 0 4px; font-size: 14px; }
.panel input[type=text], .panel input[type=password], .panel input[type=search] { width: 100%; }
.tg-step { display: flex; flex-direction: column; gap: 8px; }
.tg-step p { margin: 0; color: var(--muted); }
.tg-step .err { color: var(--err); }
.ch-list { display: flex; flex-direction: column; gap: 2px; max-height: 55vh; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px; }
.ch-list label { display: flex; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.ch-list label:hover { background: #1e2024; }

body.login { align-items: center; justify-content: center; }
.login-box { display: flex; flex-direction: column; gap: 10px; width: 280px; }
.login-box h1 { margin: 0 0 6px; font-size: 20px; font-weight: 500; }
.login-box .err { color: var(--err); margin: 0; }

/* --- day tiles, shared-favourite badge, fit toggle, language flags (2026-10-03) --- */
.daytile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed var(--line-strong); border-radius: 8px; color: var(--muted); min-height: 0; text-align: center; }
.daytile span { font-size: 22px; color: var(--text); text-transform: capitalize; }
.daytile b { font-size: 15px; font-weight: 500; }
.card .favby { position: absolute; left: 12px; top: 12px; z-index: 1; pointer-events: none; font-size: 12px;
  color: #111; background: var(--fav); padding: 1px 7px; border-radius: 10px; }
#grid.fit-contain .strip img { object-fit: contain; }
button:disabled { opacity: .35; cursor: default; }
.flags { display: inline-flex; gap: 4px; }
.flags button { height: 24px; width: 34px; padding: 2px; border-radius: 4px; opacity: .45; }
.flags button.on { opacity: 1; border-color: var(--accent); }
.flags svg { width: 100%; height: 100%; display: block; }
.logout { color: var(--muted); text-decoration: none; font-size: 16px; padding: 0 4px; }
.team { width: 100%; border-collapse: collapse; font-size: 13px; }
.team th, .team td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.team th { color: var(--muted); font-weight: 500; }
