/* i-dic 공통 — 모바일 우선. 페이지별 inline 또는 별도 css 가 토큰 위에 얹힘. */
:root { color-scheme: light; --muted:#888; --line:#8884; --panel:#8881; --accent:#4285f4; }
[data-theme="dark"] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.6 system-ui, -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: Canvas; color: CanvasText;
  min-height: 100dvh;
  overscroll-behavior-y: contain;
}
button { font: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: .9rem; }

/* 상단 헤더 (sticky, 4 아이콘 우정렬, 좌측은 i-dic 브랜드) */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + .55rem) 1rem .55rem;
  border-bottom: 1px solid var(--line); background: Canvas;
}
.brand-mini { font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; color: inherit; }
.topbar-icons { display: flex; gap: .35rem; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: inherit; padding: 0;
  font-size: 1.05rem;
}
.icon-btn:active { transform: scale(.96); }
.icon-btn[aria-current="page"] { background: var(--panel); }

/* 일반 페이지 main */
.page { padding: 1.25rem 1rem 2rem; max-width: 720px; margin: 0 auto; }
.page h2 { margin: .25rem 0 .6rem; font-size: 1.2rem; }
.page p { margin: .35rem 0; }

/* 하단 약관 링크 (setting 등) */
.foot {
  padding: 1.5rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  font-size: .8rem; color: var(--muted); text-align: center;
}
.foot a { color: inherit; margin: 0 .35rem; }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.85); color: #fff;
  padding: .55rem 1rem; border-radius: 999px;
  font-size: .85rem; max-width: 90vw; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
