/* Is mijn poes thuis? — warm, round, a bit silly. */

:root {
  --bg: #fff6ec;
  --bg-2: #ffeedd;
  --card: #ffffff;
  --ink: #3b2a20;
  --muted: #8a7465;
  --line: #f0e0cf;
  --accent: #f28c28;
  --accent-ink: #ffffff;
  --accent-soft: #fde3c8;
  --out: #3f9e4d;
  --out-soft: #e3f3e1;
  --danger: #d64545;
  --danger-soft: #fbe3e3;
  --warn: #c7811a;
  --warn-soft: #fdf0d8;
  --ok: #3f9e4d;
  --ok-soft: #e3f3e1;
  --shadow: 0 6px 20px rgb(120 70 30 / 0.12);
  --radius: 20px;
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --hand: 'Segoe Print', 'Bradley Hand', 'Chalkboard SE', 'Comic Sans MS', cursive;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1713;
    --bg-2: #261e18;
    --card: #2b221c;
    --ink: #f7ede3;
    --muted: #b9a594;
    --line: #3d3128;
    --accent: #f5993c;
    --accent-ink: #1d1713;
    --accent-soft: #4a3220;
    --out: #6cc278;
    --out-soft: #213a25;
    --danger: #f07474;
    --danger-soft: #472525;
    --warn: #f0b24f;
    --warn-soft: #43351d;
    --ok: #6cc278;
    --ok-soft: #213a25;
    --shadow: 0 6px 20px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(circle at 20% 0%, var(--bg-2), transparent 40%);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin-top: 1.6rem; }
p { margin: 0 0 .5rem; }
a { color: var(--accent); }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ building blocks */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 44px; padding: 0 1rem; border: 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink);
  font: 600 1rem var(--font); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { color: var(--danger); }
.btn.primary.danger, .ask .btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: 0 .8rem; font-size: .9rem; }
.btn.tiny { min-height: 30px; padding: 0 .6rem; font-size: .8rem; }
.btn.big { min-height: 54px; font-size: 1.1rem; width: 100%; }
.btn.wide { width: 100%; margin-top: .75rem; }
.btn.wa { background: #25d366; color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: 600 .9rem var(--font); cursor: pointer; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--card); box-shadow: var(--shadow); font-size: 1.25rem; color: var(--ink);
}

.card { background: var(--card); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin: .75rem 0; }
.card.soft { box-shadow: none; background: var(--bg-2); }
.card.hint { border-left: 5px solid var(--accent); }

.row { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.row input { flex: 1; min-width: 0; }

input, textarea, select {
  width: 100%; font: 1rem var(--font); color: var(--ink);
  background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: .65rem .8rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }
.form label, .book.edit label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
.form label input, .form label textarea, .book.edit label input, .book.edit label textarea { margin-top: .3rem; font-weight: 400; }
fieldset { border: 0; padding: 0; margin: .8rem 0 0; }
legend { font-weight: 600; padding: 0; margin-bottom: .3rem; }
.error { color: var(--danger); font-weight: 600; margin-top: .6rem; }
.label { font-weight: 700; margin-top: .9rem; }
.tag { font-size: .72rem; background: var(--accent-soft); border-radius: 999px; padding: .1rem .5rem; margin-left: .25rem; vertical-align: middle; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; font: 700 .85rem var(--font); color: var(--muted); padding: .45rem .9rem; border-radius: 999px; cursor: pointer; min-height: 36px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.look { position: relative; }
.look input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; }
.look span { display: flex; flex-direction: column; align-items: center; padding: .35rem .2rem; border-radius: 14px; border: 2px solid transparent; cursor: pointer; }
.look small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.look input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.look input:focus-visible + span { outline: 3px solid var(--accent); }

.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; }
.avatar.initials {
  display: inline-grid; place-items: center; font-weight: 800; color: #fff;
  background: hsl(var(--h) 55% 55%);
}
.catphoto { border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 3px 10px rgb(0 0 0 / .18); display: block; }

/* ------------------------------------------------------------ pages without the app shell */

.center-page { max-width: 460px; margin: 0 auto; padding: 2.5rem 16px 2rem; text-align: center; }
.center-page .card { text-align: left; }
.center-page h1 { font-size: 1.6rem; }
.brand-title { font-size: 2rem !important; }
.tagline { color: var(--muted); font-size: 1.05rem; }
.hero { display: flex; justify-content: center; margin-bottom: .5rem; }
.lang-bottom { margin-top: 1.5rem; }

/* ------------------------------------------------------------ the app shell */

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: calc(env(safe-area-inset-top) + .6rem) 16px .6rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.brand h1 { font-size: 1.15rem; margin: 0; }
.brand .sub { margin: 0; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn { font-size: .75rem; color: var(--muted); }
.conn.on { color: var(--ok); }
.wrap { max-width: 600px; margin: 0 auto; padding: 0 16px calc(env(safe-area-inset-bottom) + 2rem); }
.footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 2rem; }

.alert { border-radius: var(--radius); padding: .8rem 1rem; font-weight: 700; margin: .75rem 0; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); animation: shake .5s ease 2; }

/* ------------------------------------------------------------ cat cards */

.cat-card { background: var(--card); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); margin: .75rem 0 1rem; }
.scene { position: relative; height: 170px; overflow: hidden; cursor: pointer; }
.cat-card.out .scene { background: linear-gradient(#aee0ff 0%, #dff3ff 62%, #9ad17a 62%, #7cbf5c 100%); }
.cat-card.out.night .scene { background: linear-gradient(#1b2850 0%, #38497d 62%, #2d5732 62%, #22452a 100%); }
.cat-card.in .scene { background: linear-gradient(#fde8d3 0%, #f9dcc2 68%, #e4b184 68%, #d49d6c 100%); }
.cat-card.in.night .scene { background: linear-gradient(#5a4436 0%, #6c5242 68%, #8a6040 68%, #7a5436 100%); }
.cat-wrap { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); }
.cat-card.out .cat-wrap { animation: bob 2.6s ease-in-out infinite; }
.cat-card.in .cat-wrap { animation: breathe 4s ease-in-out infinite; }
.cat-card.in .cat-wrap::after {
  content: ''; position: absolute; left: -18px; right: -18px; bottom: -10px; height: 26px; z-index: -1;
  background: #d9534f; border-radius: 50%; box-shadow: inset 0 -6px 0 rgb(0 0 0 / .15);
}
.scene .d { position: absolute; font-size: 1.7rem; line-height: 1; user-select: none; }
.scene .sky { top: 12px; right: 18px; font-size: 2rem; }
.scene .star { top: 30px; left: 30%; font-size: 1.1rem; animation: twinkle 2s ease-in-out infinite; }
.scene .tree { bottom: 34px; left: 14px; font-size: 3.4rem; }
.scene .owl { bottom: 86px; left: 34px; font-size: 1.2rem; }
.scene .fly { top: 38px; left: 28%; animation: flutter 5s ease-in-out infinite; }
.scene .flower { bottom: 10px; right: 26px; }
.scene .frame { top: 16px; left: 22px; font-size: 2rem; }
.scene .plant { bottom: 40px; right: 16px; font-size: 2.6rem; }
.scene .yarn { bottom: 10px; left: 26px; animation: roll 6s ease-in-out infinite; }
.zzz { position: absolute; left: calc(50% + 50px); bottom: 100px; font-weight: 800; color: var(--muted); }
.zzz span { position: absolute; animation: zzz 3s ease-in infinite; opacity: 0; }
.zzz span:nth-child(2) { animation-delay: 1s; }
.zzz span:nth-child(3) { animation-delay: 2s; }
.party { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 1.6rem; animation: bob 1.4s ease-in-out infinite; }

.cat-body { padding: .9rem 1.1rem 1.1rem; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.cat-head h3 { font-size: 1.4rem; margin: 0; }
.fun { color: var(--muted); font-style: italic; margin: .15rem 0 .35rem; }
.meta { font-weight: 600; margin-bottom: .3rem; }
.warn { color: var(--danger); font-weight: 700; }
.bday { color: var(--accent); font-weight: 800; }
.stats { color: var(--muted); font-size: .88rem; }
.big-btn {
  width: 100%; min-height: 60px; margin-top: .6rem; border: 0; border-radius: 18px; cursor: pointer;
  font: 800 1.15rem var(--font); color: #fff; box-shadow: 0 5px 0 rgb(0 0 0 / .18);
  transition: transform .1s ease, box-shadow .1s ease;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgb(0 0 0 / .18); }
.big-btn.go-out { background: var(--out); }
.big-btn.go-in { background: var(--accent); }
.big-btn:disabled { opacity: .7; }

/* ------------------------------------------------------------ the neighbourhood */

.hood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.hood-cat {
  display: flex; align-items: center; gap: .6rem; text-align: left; width: 100%;
  background: var(--card); border: 0; border-radius: 18px; padding: .6rem; box-shadow: var(--shadow);
  color: var(--ink); font: inherit; cursor: pointer;
}
.hood-cat.out { background: linear-gradient(135deg, var(--out-soft), var(--card) 70%); }
.hood-cat.enemy { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }
.hood-cat.enemy.out { animation: pulse 1.8s ease-in-out infinite; }
.hood-cat.ghost { opacity: .7; cursor: default; }
.hood-cat .mini { position: relative; flex: none; width: 56px; height: 56px; display: grid; place-items: center; font-size: 2rem; }
.hood-cat .mini .catphoto { width: 56px; height: 56px; border-width: 3px; }
.hood-cat .badge { position: absolute; right: -4px; bottom: -4px; font-size: 1rem; background: var(--card); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; box-shadow: var(--shadow); }
.hc-text { display: flex; flex-direction: column; min-width: 0; }
.hc-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ the feed */

.composer { display: flex; gap: .5rem; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 46px; max-height: 160px; resize: none; border-radius: 22px; }
.composer .btn { width: 46px; height: 46px; padding: 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; border-radius: 999px; padding: .45rem .8rem; min-height: 36px;
  background: var(--card); color: var(--ink); font: 600 .88rem var(--font); cursor: pointer; box-shadow: var(--shadow);
}
.chip.small { padding: .3rem .65rem; min-height: 32px; font-size: .82rem; box-shadow: none; background: var(--bg-2); }
.chip.on { background: var(--accent-soft); }

.fi { background: var(--card); border-radius: 18px; padding: .75rem .85rem .5rem; margin: .6rem 0; box-shadow: var(--shadow); }
.fi-row { display: flex; gap: .65rem; align-items: flex-start; }
.fi-ico { position: relative; flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.6rem; }
.fi-ico .catphoto { width: 38px; height: 38px; border-width: 2px; }
.fi-badge { position: absolute; right: -6px; bottom: -6px; font-size: .85rem; }
.fi-text p { margin: 0; }
.fi time, .comment time { display: block; color: var(--muted); font-size: .78rem; }
.fi.ev.out { border-left: 5px solid var(--out); }
.fi.ev.in { border-left: 5px solid var(--accent); }
.bubble { background: var(--bg-2); border-radius: 4px 18px 18px 18px; padding: .5rem .75rem; min-width: 0; flex: 1; }
.fi.msg.mine .bubble { background: var(--accent-soft); }
.bubble .who { margin: 0; }
.bubble .who small { color: var(--muted); }
.bubble .text, .comment .text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .15rem 0; }
.fi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .45rem; }
.react {
  border: 0; background: var(--bg-2); border-radius: 999px; min-height: 32px; min-width: 40px; padding: 0 .45rem;
  font-size: .95rem; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: .2rem;
}
.react small { font-weight: 700; font-size: .75rem; }
.react.empty { background: transparent; opacity: .45; filter: grayscale(.6); }
.react.on { background: var(--accent-soft); opacity: 1; filter: none; box-shadow: inset 0 0 0 2px var(--accent); }
.react:active { transform: scale(1.25); }
.thread { margin: .5rem 0 .25rem; padding-left: .5rem; border-left: 3px solid var(--line); }
.comment { display: flex; gap: .5rem; align-items: flex-start; margin: .4rem 0; }
.c-body { flex: 1; min-width: 0; font-size: .93rem; }
.cform { display: flex; gap: .4rem; margin-top: .4rem; }
.cform .btn { width: 40px; padding: 0; }
.x { border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; width: 32px; height: 32px; flex: none; border-radius: 50%; }

/* ------------------------------------------------------------ dialogs */

dialog { border: 0; padding: 0; color: var(--ink); background: transparent; max-width: 100vw; max-height: 100dvh; }
dialog::backdrop { background: rgb(40 25 15 / .45); backdrop-filter: blur(2px); }
.sheet-dialog[open], .book-dialog[open] { width: min(600px, 100vw); height: 100dvh; margin: 0 auto; }
.sheet { background: var(--bg); height: 100%; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top) + .7rem) 16px .7rem; }
.sheet-head h2 { margin: 0; }
.sheet-body { overflow-y: auto; padding: 0 16px calc(env(safe-area-inset-bottom) + 2rem); flex: 1; }
.sec { background: var(--card); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.sec h3 { font-size: 1.05rem; }
.people, .devices { list-style: none; margin: .3rem 0 .6rem; padding: 0; }
.people li, .devices li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.devices li { justify-content: space-between; border-bottom: 1px solid var(--line); }
.cat-row { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.cat-row .catphoto { width: 44px; height: 44px; border-width: 2px; }
.cat-edit { background: var(--bg-2); border-radius: 16px; padding: .75rem; margin: .5rem 0; }
.cat-edit .catphoto { width: 64px; height: 64px; }
.rival-list { display: flex; flex-direction: column; gap: .2rem; }
.check { display: flex; align-items: center; gap: .5rem; padding: .35rem .25rem; border-radius: 12px; cursor: pointer; }
.check input, .switch input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.check .catphoto { width: 28px; height: 28px; border-width: 2px; }
.check small { color: var(--muted); }
.prefs { display: flex; flex-direction: column; gap: .15rem; margin-top: .6rem; }
.switch { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; cursor: pointer; }
.invite { background: var(--bg-2); border-radius: 16px; padding: .75rem; margin: .6rem 0; }
.invite input { font-size: .85rem; }
.admin-hh { border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .5rem; }

.ask-dialog[open] { width: min(420px, calc(100vw - 32px)); margin: auto; }
.ask { background: var(--card); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.ask p { font-size: 1.05rem; font-weight: 600; }

/* ------------------------------------------------------------ the friend book */

.book {
  position: relative; min-height: 100%; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 1rem) 20px 2rem 44px;
  background:
    linear-gradient(90deg, transparent 30px, #f4a0a0 30px, #f4a0a0 32px, transparent 32px),
    repeating-linear-gradient(#fffdf6 0 31px, #cfe0f3 31px 32px);
  color: #3b2a20;
  font-family: var(--hand);
}
@media (prefers-color-scheme: dark) {
  .book {
    background:
      linear-gradient(90deg, transparent 30px, #8a4a4a 30px, #8a4a4a 32px, transparent 32px),
      repeating-linear-gradient(#2e2620 0 31px, #3b4656 31px 32px);
    color: #f7ede3;
  }
}
.book-dialog[open] .book { height: 100dvh; }
.book-close { position: absolute; top: calc(env(safe-area-inset-top) + .6rem); right: 12px; font-family: var(--font); }
.book-head { text-align: center; margin-bottom: 1rem; }
.book-head h2 { font-size: 1.5rem; margin-top: .6rem; }
.polaroid {
  display: inline-block; position: relative; background: #fff; padding: 10px 10px 26px; border-radius: 4px;
  box-shadow: 0 6px 18px rgb(0 0 0 / .2); transform: rotate(-3deg);
}
.polaroid .catphoto { border-radius: 2px; border: 0; box-shadow: none; }
.tape { position: absolute; top: -10px; left: 50%; width: 70px; height: 22px; transform: translateX(-50%) rotate(4deg); background: rgb(255 214 120 / .75); }
.fb { margin: 0; }
.fb-row { margin: 0 0 .7rem; }
.fb dt { font-weight: 700; color: var(--accent); font-size: .95rem; }
.fb dd { margin: 0; font-size: 1.05rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-sub { margin-top: 1.2rem; color: var(--accent); }
.traits { display: flex; flex-wrap: wrap; gap: .35rem; }
.trait { background: var(--accent-soft); border-radius: 999px; padding: .15rem .6rem; font-size: .9rem; color: var(--ink); font-family: var(--font); }
.book.edit { font-family: var(--font); }
.book.edit h2 { font-family: var(--hand); }
.trait-pick { position: relative; }
.trait-pick input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; }
.trait-pick span { display: inline-block; border-radius: 999px; padding: .35rem .7rem; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; font-weight: 600; font-size: .88rem; }
.trait-pick input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.trait-pick input:focus-visible + span { outline: 3px solid var(--accent); }
.traits.pick { margin-bottom: .5rem; }

/* ------------------------------------------------------------ neighbourhoods */

.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline dotted; }
.icon-btn { position: relative; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--card); }
.hood-link {
  display: flex; align-items: center; gap: .4rem; padding: .7rem .8rem; margin: .3rem 0; border-radius: 14px;
  background: var(--bg-2); color: var(--ink); text-decoration: none; font-weight: 700;
}
.hood-link.here { box-shadow: inset 0 0 0 2px var(--accent); }
.turnstile { margin-top: .8rem; min-height: 0; }
.center-page .btn.big { margin-top: .5rem; text-decoration: none; }

/* ------------------------------------------------------------ turns */

.h2row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1.6rem; }
.h2row h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { background: var(--card); border-radius: var(--radius); padding: .8rem .9rem; box-shadow: var(--shadow); margin-top: .6rem; }
.tl-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: .5rem; margin: .35rem 0; }
.tl-name { display: flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name .catphoto { width: 24px; height: 24px; border-width: 2px; }
.tl-bar { position: relative; height: 18px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.tl-seg { position: absolute; top: 0; bottom: 0; background: hsl(var(--h) 60% 55%); border-radius: 999px; }
.tl-seg.pending { background: repeating-linear-gradient(45deg, hsl(var(--h) 60% 55% / .55) 0 6px, transparent 6px 12px); }
.tl-axis .tl-bar { background: none; height: 16px; overflow: visible; display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); }
.tl-now {
  position: absolute; top: .6rem; bottom: 1.5rem; width: 2px; background: var(--danger); border-radius: 2px; pointer-events: none;
  left: calc(.9rem + 110px + .5rem + (100% - 1.8rem - 110px - .5rem) * var(--x, 0));
}
.tl-now::after { content: 'nu'; position: absolute; bottom: -1.1rem; left: -8px; font-size: .7rem; color: var(--danger); font-weight: 800; }
:lang(en) .tl-now::after { content: 'now'; }
.timeline { position: relative; overflow: hidden; }
.turn { font-weight: 700; color: var(--muted); margin-bottom: .3rem; }
.turn.mine { color: var(--out); }
.turn.rival { color: var(--warn); }
.lock { font-weight: 700; color: var(--warn); }
.slot-group { background: var(--card); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.slot-cat { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.slot-cat .catphoto { width: 32px; height: 32px; border-width: 2px; }
.slot-row { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.slot-row.agreed b { color: var(--out); }
.days { display: flex; gap: .3rem; flex-wrap: wrap; }
.day { position: relative; }
.day input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; }
.day span { display: inline-grid; place-items: center; min-width: 42px; height: 38px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; cursor: pointer; }
.day input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.day input:focus-visible + span { outline: 3px solid var(--accent); }
input[type='time'], select { min-height: 44px; }

/* ------------------------------------------------------------ posts: sightings, birthdays, the paper */

.fi.post.sighting { border-left: 5px solid #7b61c9; }
.fi.post.birthday { border-left: 5px solid #e2508a; background: linear-gradient(135deg, #fde6ef, var(--card) 60%); }
.go-out-btn { margin-top: .4rem; background: var(--out); color: #fff; }
.paper {
  background: #fbf8f1; color: #2b2520; border-radius: 12px; padding: .9rem 1rem; font-family: Georgia, 'Times New Roman', serif;
  box-shadow: inset 0 0 0 1px #e4dccb;
}
.paper h3 { font-size: 1.35rem; margin: 0; letter-spacing: .02em; border-bottom: 3px double #2b2520; padding-bottom: .2rem; }
.paper .muted { color: #7a6f63; }
.awards { list-style: none; padding: 0; margin: .5rem 0; }
.awards li { margin: .3rem 0; }
.standings { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: .4rem; }
.standings td { border-top: 1px solid #e4dccb; padding: .25rem .2rem; }
.standings td:not(:first-child) { text-align: right; }
.trophies { display: flex; flex-wrap: wrap; gap: .4rem; }
.trophy { background: #fff3c4; color: #5a4300; border-radius: 999px; padding: .25rem .7rem; font-family: var(--font); font-weight: 700; font-size: .88rem; }
.sight-btn { background: #ece6fb; color: #4a3a8a; font-weight: 800; margin-bottom: 1rem; }
.sight-form { background: var(--card); border-radius: 16px; padding: .75rem; margin-bottom: 1rem; font-family: var(--font); }
.request { border-top: 1px solid var(--line); padding: .6rem 0; }
.request select { width: auto; flex: 1; min-width: 140px; }

/* ------------------------------------------------------------ flyer */

.flyer-dialog[open] { width: min(620px, 100vw); max-height: 100dvh; margin: auto; }
.flyer { background: #fff; color: #2b2520; border-radius: var(--radius); padding: 1.2rem 1.4rem 1.6rem; text-align: center; }
.flyer h1 { font-size: 1.9rem; margin: .4rem 0; }
.flyer-cats { display: flex; justify-content: center; align-items: center; gap: .6rem; }
.flyer-cats .vs { font-size: 2.4rem; }
.flyer-text { font-size: 1.1rem; max-width: 30rem; margin: .4rem auto 1rem; }
.qr { width: min(300px, 70vw); margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }
.flyer-url { font-family: ui-monospace, monospace; font-size: .8rem; word-break: break-all; color: #7a6f63; }
.flyer-brand { font-weight: 800; color: #f28c28; margin-top: .6rem; }

@media print {
  body > *:not(#flyer) { display: none !important; }
  #flyer { position: static; display: block; width: 100%; max-height: none; box-shadow: none; }
  #flyer::backdrop { display: none; }
  .no-print { display: none !important; }
  .flyer { box-shadow: none; }
}

/* ------------------------------------------------------------ accounts */

.auth .tabs { display: flex; width: 100%; margin-bottom: .4rem; }
.auth .tabs button { flex: 1; }
.or { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .6rem; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn.google { background: var(--card); box-shadow: inset 0 0 0 2px var(--line); color: var(--ink); }
.btn.google .g { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; color: #fff; background: #4285f4; font-size: .8rem; }
.center-row { justify-content: center; }
.center-row .btn.big { width: auto; flex: 1; }
.hood-row { border-bottom: 1px solid var(--line); padding: .4rem 0; }
.request-form h3 { margin-bottom: .2rem; }
.join-code { font: 800 1.8rem ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .12em; margin: .2rem 0; }
button.hood-link { width: 100%; border: 0; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }

/* ------------------------------------------------------------ operator page (/ops) */

:root { --chart-bar: #d9731a; --chart-grid: #efe5da; } /* validated: lightness band + ≥3:1 on the card surface */
@media (prefers-color-scheme: dark) { :root { --chart-bar: #d0752a; --chart-grid: #3d3128; } }
.ops { max-width: 1100px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 1rem) 16px 3rem; }
.ops-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.ops-head h1 { margin: 0; }
.ops-head .seg a { padding: .45rem .9rem; border-radius: 999px; color: var(--muted); font-weight: 700; text-decoration: none; }
.ops-head .seg a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: 1rem 0; }
.tile { background: var(--card); border-radius: 16px; padding: .8rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .15rem; }
.tile-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.tile-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.tile-sub { color: var(--muted); font-size: .8rem; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.chart { background: var(--card); border-radius: 16px; padding: .8rem 1rem; box-shadow: var(--shadow); margin: 0; }
.chart figcaption { margin-bottom: .3rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--chart-bar); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: color-mix(in srgb, var(--chart-bar) 10%, transparent); }
.chart .grid, .chart .axis { stroke: var(--chart-grid); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart details { margin-top: .4rem; font-size: .85rem; }
.ops-tip {
  position: fixed; z-index: 70; transform: translate(-50%, -100%); pointer-events: none;
  background: var(--ink); color: var(--bg); padding: .3rem .6rem; border-radius: 8px; font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.ops-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ops-table th, .ops-table td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ops-table th { color: var(--muted); font-weight: 700; font-size: .8rem; }
.ops-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.activity { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.activity li { padding: .25rem 0; border-bottom: 1px solid var(--line); }
.activity time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .4rem; }
.fb-item.read { opacity: .6; }
.fb-meta { font-size: .88rem; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.02rem; }

/* ------------------------------------------------------------ toast + confetti */

#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 50;
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s;
  background: var(--ink); color: var(--bg); padding: .75rem 1.1rem; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .25s ease; }
.burst { position: fixed; z-index: 60; pointer-events: none; font-size: 1.4rem; animation: burst 1.1s ease-out forwards; }

/* ------------------------------------------------------------ motion */

@keyframes bob { 0%, 100% { transform: translate(-50%, 0) rotate(-2deg); } 50% { transform: translate(-50%, -8px) rotate(2deg); } }
.hero.bob { animation: herobob 2.6s ease-in-out infinite; }
@keyframes herobob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.035, .98); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(22px, -40px) scale(1.3); } }
@keyframes flutter { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(40px, -12px) rotate(8deg); } 50% { transform: translate(90px, 6px) rotate(-6deg); } 75% { transform: translate(40px, 14px) rotate(6deg); } }
@keyframes roll { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(14px) rotate(160deg); } }
@keyframes twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--danger), var(--shadow); } 50% { box-shadow: 0 0 0 5px var(--danger), var(--shadow); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes burst { from { transform: translate(-50%, -50%) scale(.6); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* the privacy page (public/privacy.html) */
.privacy { padding-top: 1.5rem; line-height: 1.55; }
.privacy h1 { margin-top: .5rem; }
.privacy h2 { margin-top: 1.6rem; font-size: 1.2rem; }
.privacy ul { padding-left: 1.2rem; }
.privacy li { margin: .4rem 0; }
.privacy hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.privacy-top { font-size: .9rem; color: var(--muted); }

/* ---- low entry: Google first, the device-only app, the demo, feedback and replies */
.btn.google-main { display: flex; align-items: center; justify-content: center; gap: .6rem; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); font-weight: 700; text-decoration: none; }
.btn.google-main .g { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; color: #fff; background: #4285f4; font-size: .9rem; }
.solo-tag { font-size: .8rem; color: var(--muted); }
.feedback-cta { display: block; width: 100%; margin: 1rem 0; padding: 1rem 1.1rem; border: 0; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font: inherit; font-size: 1.05rem; font-weight: 700; text-align: center; cursor: pointer; box-shadow: var(--shadow); }
.feedback-cta:hover { filter: brightness(1.03); }
.feedback-cta:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card.connect h2 { margin-top: .25rem; }
.card.connect .btn + .small { display: block; text-align: center; margin-top: .6rem; }
.card.demo .demo-row { display: flex; align-items: center; justify-content: space-around; gap: .5rem; margin: .5rem 0; }
.demo-cat { display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; min-width: 88px; }
.demo-cat .demo-pic { position: relative; width: 56px; height: 56px; display: grid; place-items: center; transition: transform .4s ease; }
.demo-cat.out .demo-pic { transform: translateY(-4px); }
.demo-cat .badge { position: absolute; right: -6px; bottom: -4px; font-size: .95rem; background: var(--card); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; box-shadow: var(--shadow); }
.demo-cat small { color: var(--muted); }
.demo-light { font-size: 1.8rem; }
.demo-note { min-height: 2.6em; margin: .25rem 0 0; padding: .6rem .8rem; border-radius: 14px; background: var(--bg-2); font-size: .92rem; }
.fb-emoji { display: flex; justify-content: space-between; gap: .5rem; margin: .75rem 0 1rem; }
.fb-e { flex: 1; font-size: 2rem; line-height: 1; padding: .65rem 0; border: 0; border-radius: 16px; background: var(--bg-2); cursor: pointer; transition: transform .15s ease; }
.fb-e:hover, .fb-e:focus-visible { transform: scale(1.08); outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.card.reply { border-left: 5px solid var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .demo-cat .demo-pic, .fb-e { transition: none; }
}

/* ---- cat relations: beef, friends, lovers, the bully */
.rel-list { display: flex; flex-direction: column; gap: .35rem; margin: .5rem 0; }
.rel-row { display: flex; align-items: center; gap: .5rem; }
.rel-row select { max-width: 9.5rem; }
.tag.bully { background: var(--danger-soft); color: var(--danger); font-size: .75rem; vertical-align: middle; }
.cat-body .bond { margin: .15rem 0; font-size: .9rem; }

/* ---- the photo editor */
.photo-pick .btn { margin-top: .6rem; }
.photo-stage { display: grid; place-items: center; margin: .5rem 0; }
.photo-stage canvas { width: min(78vw, 320px); height: auto; aspect-ratio: 1; border-radius: 18px; touch-action: none; cursor: grab; background: #000; box-shadow: var(--shadow); }
.photo-stage canvas:active { cursor: grabbing; }
.photo-tools { align-items: center; gap: .6rem; }
.photo-tools input[type=range] { width: 100%; accent-color: var(--accent); }
.photo-filters { flex-wrap: wrap; overflow: visible; }
.photo-filters .chip.on { background: var(--accent); color: var(--accent-ink); }
.icon-btn.small { width: 32px; height: 32px; font-size: .9rem; }

.ops-head .ops-exit { align-self: flex-start; margin-bottom: .4rem; text-decoration: none; }

/* ---- relations */
.rel-btn { white-space: nowrap; }
.rel-sec .btn.big { margin: 0 0 .35rem; }
.board { list-style: none; padding: 0; margin: .25rem 0; display: flex; flex-direction: column; gap: .45rem; }
.board li { display: flex; align-items: center; gap: .5rem; }
.board .pair { display: inline-flex; }
.board .pair > * + * { margin-left: -8px; }

/* ---- /ops traffic breakdowns: one hue, longest first */
.breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.breakdowns .card h3 { margin-top: 0; }
.ops-table.breakdown td.bar-cell { width: 45%; }
.hbar { display: block; height: 10px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--chart-bar); }

/* ---- vertical only: nothing makes a page or a dialog wider than the screen */
/* on body only: it then applies to the viewport, so body isn't a scroll box and the sticky header sticks */
body { overflow-x: hidden; overscroll-behavior-x: none; }
body { overflow-wrap: break-word; }
dialog, .sheet, .sheet-body, .book, .book.edit, .ask { overflow-x: hidden; max-width: 100%; }
img, video, canvas { max-width: 100%; }

/* ---- /ops on a phone: back link, title and a grid of tabs stacked; tables become cards */
@media (max-width: 700px) {
  .ops { padding-left: 12px; padding-right: 12px; }
  .ops-head { flex-direction: column; align-items: stretch; gap: .5rem; }
  .ops-head .ops-exit { align-self: flex-start; margin: 0; }
  .ops-head .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; width: 100%; }
  .ops-head .seg { background: none; padding: 0; box-shadow: none; }
  .ops-head .seg a { text-align: center; padding: .55rem .3rem; font-size: .85rem; background: var(--bg-2); }
  .ops-head .seg a.on { background: var(--card); }
  .table-wrap { overflow-x: visible; background: transparent; box-shadow: none; }
  .ops-table td, .ops-table th { white-space: normal; overflow-wrap: anywhere; }
  .ops-table.cards thead { display: none; }
  .ops-table.cards, .ops-table.cards tbody, .ops-table.cards tr, .ops-table.cards td { display: block; width: 100%; }
  .ops-table.cards tr { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: .5rem .8rem; margin-bottom: .6rem; }
  .ops-table.cards td { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border: 0; padding: .2rem 0; text-align: right; }
  .ops-table.cards td::before { content: attr(data-label); color: var(--muted); font-weight: 700; font-size: .8rem; text-align: left; flex: none; }
  .ops-table.cards td:empty { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .charts, .breakdowns { grid-template-columns: 1fr; }
}

/* ---- the QR code that puts the app on your phone */
.device-qr { display: flex; flex-direction: column; align-items: center; gap: .4rem; margin: .6rem 0; text-align: center; }
.device-qr .qr { background: #fff; padding: 8px; border-radius: 14px; box-shadow: var(--shadow); line-height: 0; }
.device-qr .qr svg { width: 150px; height: 150px; }
.device-qr.big .qr svg { width: 220px; height: 220px; }
.device-qr p { max-width: 34ch; margin: 0; font-size: .9rem; }

/* ---- the banner where newcomers land (first screen, login, invites) and the about page */
.banner { text-align: center; margin: 0 0 1rem; padding: 1.1rem 1rem 1rem; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-soft), var(--bg-2) 75%); box-shadow: var(--shadow); }
.banner-cats { display: flex; justify-content: center; align-items: flex-end; gap: .2rem; }
.banner-cats .mirror { display: inline-flex; transform: scaleX(-1); }
.banner-peace { font-size: 1.9rem; align-self: center; animation: banner-peace 3s ease-in-out infinite; }
.banner .banner-brand { margin: .35rem 0 0; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; color: var(--accent); }
.banner .banner-title { margin: .15rem 0 .4rem; font-size: 1.5rem; line-height: 1.2; text-wrap: balance; }
.banner .banner-text { margin: 0 auto; max-width: 36ch; text-wrap: pretty; }
.banner .banner-more { display: inline-block; margin-top: .6rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.banner.compact { text-align: left; padding: .9rem 1rem; box-shadow: none; }
.banner.compact .banner-title { font-size: 1.15rem; }
.banner.compact .banner-text { margin: 0; max-width: none; }
@keyframes banner-peace { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .banner-peace { animation: none; } }
.about { text-align: left; }
.about h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
.about p { margin: .4rem 0; }
.about ul, .about ol { padding-left: 1.2rem; margin: .4rem 0; }
.about li { margin: .3rem 0; }
