:root {
  --ink: #1a1a1a;
  --muted: rgba(0, 0, 0, .48);
  --paper: #f6f3ee;
  --card: #fff;
  --line: rgba(0, 0, 0, .1);
  --logo-blue: #2860a8;
  --logo-orange: #f86018;
  --ok: #1a7f4b;
  --bad: #c43c3c;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--font); }
button, input, textarea { font: inherit; }
#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(88px + env(safe-area-inset-bottom, 0px)); }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 64px 10px 0; position: relative; }
.top img { position: absolute; right: 0; top: 8px; height: 52px; width: auto; object-fit: contain; z-index: 50; pointer-events: none; }
.who { flex: 1; font-weight: 700; font-size: 22px; line-height: 26px; min-width: 0; }
.who .muted { font-size: 13px; font-weight: 500; line-height: 1.3; margin-top: 2px; color: var(--muted); }
.hello { font-size: 17px; font-weight: 600; margin: 8px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 0 12px; }
.muted, .empty { color: var(--muted); font-size: 13px; }
.flash { color: var(--bad); }
.ok { color: var(--ok); }
.intake { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.intake b { color: var(--ink); font-weight: 650; }
.back { display: inline-block; color: var(--logo-blue); text-decoration: none; font-weight: 650; padding: 4px 0 10px; }
.btn { appearance: none; border: 0; background: var(--logo-blue); color: #fff; width: 100%; padding: 12px; border-radius: 10px; font-weight: 600; }
.btn.ghost, .ghost { background: transparent; color: var(--logo-orange); border: 1px solid var(--logo-orange); }
a.btn { display: block; text-align: center; text-decoration: none; }
.login-body { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--card); border-radius: 16px; padding: 28px 22px; border: 1px solid var(--line); }
.login-logo { width: 48px; height: 48px; display: block; margin: 0 auto 12px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 0 0 16px; }
.login-card label, .add-form label { display: block; margin: 0 0 12px; font-size: 14px; }
.login-card input, .login-card textarea, .add-form input, .add-form textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.login-card textarea, .add-form textarea { min-height: 72px; resize: vertical; }
.login-card.intake-card { width: min(480px, 100%); }
.login-card .hint { margin: 0 0 16px; }
.login-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.login-tabs button {
  flex: 1; appearance: none; border: 1px solid var(--logo-orange); background: transparent;
  border-radius: 999px; padding: 8px; color: var(--logo-orange);
}
.login-tabs button.on { background: var(--logo-blue); color: #fff; border-color: var(--logo-blue); }
.remember { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.remember input { width: auto; margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.me-btn { margin: 14px 0 10px; }
.demo-link { margin-top: 14px; }
#first-back { margin-top: 10px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 6px; background: var(--card); border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar a {
  flex: 1; text-align: center; text-decoration: none;
  border: 1px solid var(--line); background: #f3f3f3; color: var(--muted);
  padding: 8px 2px; font-size: 13px; font-weight: 600; border-radius: 10px;
}
.tabbar a.on { background: var(--logo-blue); border-color: var(--logo-blue); color: #fff; }
.folders {
  display: grid;
  grid-template-columns: repeat(var(--folder-cols, 3), minmax(0, 1fr));
  justify-items: center;
  gap: 10px 0;
  margin: 8px 0 16px;
}
.child-fig {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 96px; padding: 6px 4px 4px; color: inherit; text-decoration: none;
}
.child-fig img { width: 80px; height: 80px; object-fit: contain; }
.child-fig-name { font-size: 12px; font-weight: 650; text-align: center; }
.demo-mark {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 15; pointer-events: none; user-select: none;
  font-size: 88px; font-weight: 700; letter-spacing: 0.18em;
  color: rgba(0, 0, 0, .06); line-height: 1;
}
@media (min-width: 768px) {
  #app { max-width: 980px; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: min(980px, 100%); }
}
