:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1b1f24;
  --muted: #5d6673;
  --line: #dde1e6;
  --team: #2f5bd3;
  --owner: #6a45b8;
  --family: #1d8a5a;
  --accent: #2f5bd3;
  --warn-bg: #fff4d6;
  --warn-text: #7a5600;
  --bad-bg: #fde7e7;
  --bad-text: #9b1c1c;
  --ok-bg: #e2f5ea;
  --ok-text: #11643c;
  --info-bg: #e8eefc;
  --info-text: #23439c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418; --surface: #1b1e24; --surface-2: #23272f; --text: #e8eaed; --muted: #a1a9b5; --line: #323843;
    --team: #7d9cf0; --owner: #b39ae8; --family: #5cc993;
    --warn-bg: #3d3214; --warn-text: #f3d27a; --bad-bg: #42201f; --bad-text: #f4a5a5;
    --ok-bg: #173826; --ok-text: #8fdcb2; --info-bg: #1f2a47; --info-text: #a9bff5;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: .3rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.demo-banner { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: center; padding: .4rem 1rem; background: var(--warn-bg); color: var(--warn-text); font-size: .85rem; border-bottom: 1px solid var(--line); }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--text); }
.spacetabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.spacetabs a { padding: .3rem .7rem; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); font-size: .9rem; }
.spacetabs a.active { color: #fff; border-color: transparent; background: var(--accent); }
.who { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.who > * { white-space: nowrap; }

main { max-width: 1080px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
main:focus { outline: none; }
.space-team { --accent: var(--team); }
.space-owner { --accent: var(--owner); }
.space-family { --accent: var(--family); }

.subnav { display: flex; gap: .2rem; flex-wrap: wrap; margin: .8rem 0 1rem; border-bottom: 1px solid var(--line); }
.subnav a { padding: .45rem .75rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
.card.space { border-top: 4px solid var(--accent); }
.tile .num { font-size: 1.7rem; font-weight: 700; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.badge { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.b-demo { background: var(--warn-bg); color: var(--warn-text); }
.b-live { background: var(--ok-bg); color: var(--ok-text); }
.b-ok { background: var(--ok-bg); color: var(--ok-text); }
.b-bad { background: var(--bad-bg); color: var(--bad-text); }
.b-info { background: var(--info-bg); color: var(--info-text); }
.b-lock { background: var(--bad-bg); color: var(--bad-text); }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .9rem; }
th { background: var(--surface-2); font-weight: 600; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.list li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .75rem; }

.stages { display: flex; gap: .3rem; flex-wrap: wrap; margin: .6rem 0; padding: 0; list-style: none; }
.stages li { padding: .3rem .7rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.stages li.done { background: var(--info-bg); color: var(--info-text); }
.stages li.now { background: var(--accent); color: #fff; font-weight: 600; }

.callout { border-left: 4px solid var(--warn-text); background: var(--warn-bg); color: var(--warn-text); padding: .6rem .8rem; border-radius: 6px; margin: .8rem 0; font-size: .9rem; }
.callout.info { border-color: var(--info-text); background: var(--info-bg); color: var(--info-text); }

button, .btn { font: inherit; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=url], input[type=text] { font: inherit; padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); min-width: 0; width: 100%; }
form.inline { display: flex; gap: .4rem; margin-top: .4rem; }

.persona { text-align: left; width: 100%; }
.persona strong { display: block; }

/* 아이 화면 */
.kids { --accent: var(--family); text-align: center; }
.kids h1 { font-size: 1.8rem; }
.setpick { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.setpick button { font-size: 1.1rem; padding: .8rem 1.2rem; border-radius: 14px; }
.setpick button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.wordcard { max-width: 420px; margin: 1rem auto; background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 1.5rem 1rem; }
.wordcard .emoji { font-size: 5rem; line-height: 1.1; }
.wordcard .word { font-size: 2.4rem; font-weight: 800; margin: .3rem 0; }
.wordcard .meaning { font-size: 1.15rem; }
.kidbtns { display: flex; gap: .8rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.kidbtns button { font-size: 1.2rem; padding: .8rem 1.4rem; border-radius: 14px; min-width: 9rem; }
.dots { display: flex; gap: .35rem; justify-content: center; margin-top: .8rem; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dots span.known { background: var(--family); }
.dots span.again { background: var(--warn-text); }
.dots span.cur { outline: 2px solid var(--text); outline-offset: 2px; }

@media (max-width: 560px) {
  .who { margin-left: 0; width: 100%; justify-content: space-between; }
  h1 { font-size: 1.25rem; }
}
form.inline button { white-space: nowrap; }
.topbar[hidden] { display: none; }
