:root {
  /* aibo's palette (us.aibo.com): the classic aibo pink, blush tint, warm grey. Same values as apple/Shared/Brand.swift. */
  --bg: #fef7f8;
  --card: #ffffff;
  --ink: #3a3532;
  --muted: #6f6762;
  --line: #f3dde1;
  --pink: #ea5c6f;       /* paws and art only: too light for text */
  --accent: #c2364d;     /* text and icons, 5.1:1 on --bg */
  --accent-fill: #c2364d; /* behind white text, 5.4:1 */
  --accent-ink: #ffffff;
  --soft: #fde9ec;
  --danger: #b3261e;
  --ok: #2e8b57;
  --radius: 18px;
  --tabs-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1517;
    --card: #2a2023;
    --ink: #f7edef;
    --muted: #b9a9ae;
    --line: #3d2f33;
    --accent: #f7899a;
    --soft: #3d262c;
    --danger: #ff7a6b;
    --ok: #6fcf97;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) 0 calc(var(--tabs-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1 { font-size: 1.6rem; margin: .2rem 0 .8rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
p { margin: .4rem 0; }
small, .muted { color: var(--muted); }

#view { max-width: 640px; margin: 0 auto; padding: 12px 16px 24px; }

/* bottom tabs */
#tabs {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
#tabs[hidden] { display: none; }
#tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
#tabs a span { font-size: 1.3rem; filter: grayscale(1); opacity: .7; }
#tabs a span.paw { width: 1.3rem; height: 1.3rem; filter: none; }
#tabs a.on { color: var(--accent); }
#tabs a.on span { filter: none; opacity: 1; }

/* building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grow { flex: 1; min-width: 0; }

button, .btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--accent-fill); color: var(--accent-ink); text-decoration: none;
}
button.ghost, .btn.ghost { background: var(--soft); color: var(--ink); }
button.plain { background: none; color: var(--muted); padding: 0 8px; min-height: 36px; }
button.danger { background: none; color: var(--danger); border: 1px solid currentColor; }
button:disabled { opacity: .5; cursor: default; }
button.wide { width: 100%; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }

.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }

/* avatars */
.av {
  width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover;
  background: var(--soft); display: grid; place-items: center; font-size: 1.4rem;
}
.av.lg { width: 88px; height: 88px; font-size: 2.6rem; }

/* posts */
.post .who { font-weight: 700; color: var(--ink); text-decoration: none; }
.post .meta { font-size: .82rem; color: var(--muted); }
.post .body { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post.auto .body { font-size: 1.05rem; }
.post .photo { margin: 10px -14px 0; width: calc(100% + 28px); max-width: none; max-height: 560px; object-fit: cover; }
.post .acts { display: flex; gap: 4px; margin: 8px -8px -6px; }
.post .acts button { background: none; color: var(--muted); min-height: 38px; padding: 0 10px; font-weight: 600; }
.post .acts button.on { color: var(--accent); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }

/* profile */
.profile { text-align: center; }
.profile .av { margin: 0 auto 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.chip { font-size: .85rem; padding: 6px 10px; border-radius: 999px; background: var(--soft); }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }

/* sheet (bottom modal) */
#sheet { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / .4); display: flex; align-items: flex-end; justify-content: center; }
#sheet[hidden] { display: none; }
#sheet .panel {
  width: 100%; max-width: 640px; max-height: 85vh; overflow: auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.menu button { width: 100%; justify-content: flex-start; background: var(--card); color: var(--ink); border-radius: 12px; margin-bottom: 8px; }
.menu button.bad { color: var(--danger); }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 30; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: .92rem;
}
#toast[hidden] { display: none; }

.hero { text-align: center; padding: 28px 0 8px; }
.hero .logo { font-size: 3.4rem; color: var(--pink); }
/* aibo's paw (public/paw.svg, from scripts/brand/paw.py), drawn in the current text colour */
.paw { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; background: currentColor;
  -webkit-mask: url(/paw.svg) center / contain no-repeat; mask: url(/paw.svg) center / contain no-repeat; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; background: var(--soft); padding: 8px 10px; border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; }

