/* TheLanguageSwap — design system
   Palette: ai-iro indigo (brand), shu-iro vermilion (action), washi paper background. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ed;
  --ink: #141a33;
  --ink-2: #3a4160;
  --muted: #667085;
  --line: #e7e3dc;
  --line-strong: #d5d0c6;
  --brand: #1f2a5c;
  --brand-2: #2f3f86;
  --brand-tint: #eceffa;
  --accent: #e4572e;
  --accent-600: #c9441d;
  --accent-tint: #fdeee8;
  --sakura: #f9e1dc;
  --success: #1f8a5b;
  --success-tint: #e6f5ee;
  --danger: #c2352b;
  --danger-tint: #fbe9e7;
  --info-tint: #eaf1fb;
  --shadow-sm: 0 1px 2px rgba(20, 26, 51, .06);
  --shadow: 0 1px 2px rgba(20, 26, 51, .05), 0 8px 24px rgba(20, 26, 51, .07);
  --shadow-lg: 0 24px 60px rgba(20, 26, 51, .16);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --font: "Inter", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --font-ja: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Inter", system-ui, sans-serif;
  --container: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1222;
    --surface: #161b2f;
    --surface-2: #1c2239;
    --ink: #eef0f7;
    --ink-2: #c7cbe0;
    --muted: #98a0bb;
    --line: #283050;
    --line-strong: #36406a;
    --brand: #9fb0ff;
    --brand-2: #b9c6ff;
    --brand-tint: #1d2547;
    --accent: #ff7a52;
    --accent-600: #ff906d;
    --accent-tint: #3a2220;
    --sakura: #3a2227;
    --success: #4fd197;
    --success-tint: #16302a;
    --danger: #ff7b70;
    --danger-tint: #3a1d1d;
    --info-tint: #1b2741;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="ja"] body, [lang="ja"] { font-family: var(--font-ja); }
html[lang="ja"] body { line-height: 1.75; letter-spacing: .01em; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; color: var(--ink); }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3 { letter-spacing: 0; line-height: 1.35; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; }
h3, .h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 1.5rem; }
.mt-lg { margin-top: 2.5rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
main { overflow-x: clip; }
.hero__grid > *, .split > *, .dash-grid > *, .browse > *, .profile-layout > *, .article-layout > * { min-width: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.section { padding: 80px 0; }
.section-tight { padding: 36px 0 64px; }
.section-tint { background: var(--surface-2); }
.section__head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.stack > * + * { margin-top: 16px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* Kicker / lead */
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
html[lang="ja"] .kicker { letter-spacing: .04em; }
.kicker__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.lead { font-size: 1.15rem; color: var(--ink-2); }

/* Buttons */
.btn {
  --b: var(--surface); --c: var(--ink); --bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--bd); background: var(--b); color: var(--c);
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--c); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { --b: var(--accent); --c: #fff; --bd: var(--accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { --b: var(--accent-600); --bd: var(--accent-600); }
.btn-outline { --b: transparent; --bd: var(--line-strong); }
.btn-outline:hover { --bd: var(--ink); }
.btn-ghost { --b: transparent; --bd: transparent; }
.btn-ghost:hover { --b: var(--surface-2); box-shadow: none; }
.btn-light { --b: #fff; --c: #1f2a5c; --bd: #fff; }
.btn-danger { --b: var(--danger); --c: #fff; --bd: var(--danger); }
.btn-google { --b: var(--surface); --bd: var(--line-strong); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-2); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.side-card { padding: 20px; }
.side-card .h3 { display: flex; align-items: center; gap: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__name { font-weight: 600; font-size: 1.08rem; letter-spacing: -.02em; font-family: var(--font); }
.brand__name strong { color: var(--accent); font-weight: 800; }
.site-nav { display: flex; align-items: center; gap: 16px; flex: 1; }
.site-nav__links { display: flex; gap: 2px; list-style: none; margin: 0 auto 0 12px; padding: 0; }
.site-nav__links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .94rem; }
.site-nav__links a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav__links a.is-active { color: var(--ink); background: var(--brand-tint); font-weight: 600; }
.site-nav__actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); }
.lang-switch:hover { border-color: var(--ink); color: var(--ink); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; }
.nav-toggle { display: none; margin-left: auto; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu__panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; }
.user-menu__panel a, .user-menu__panel button { display: block; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }
.user-menu__panel a:hover, .user-menu__panel button:hover { background: var(--surface-2); }
.user-menu__name { padding: 8px 12px 10px; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

.lang-hint { background: var(--brand); color: #fff; font-size: .9rem; }
.lang-hint__inner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 20px; }
.lang-hint .icon-btn { color: #fff; width: 32px; height: 32px; }
.notice-bar { background: var(--info-tint); border-bottom: 1px solid var(--line); font-size: .9rem; }
.notice-bar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 20px; }

.flashes { margin-top: 16px; display: grid; gap: 8px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .95rem; }
.alert-success { background: var(--success-tint); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { background: var(--danger-tint); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-tint); border-color: var(--line); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 84px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(600px 400px at 85% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 500px at 0% 100%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%);
}
.hero::after {
  /* seigaiha wave pattern */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='30' viewBox='0 0 60 30'%3E%3Cg fill='none' stroke='%231f2a5c' stroke-opacity='.10' stroke-width='1'%3E%3Cpath d='M0 30a30 30 0 0 1 60 0M10 30a20 20 0 0 1 40 0M20 30a10 10 0 0 1 20 0M-30 15a30 30 0 0 1 60 0M30 15a30 30 0 0 1 60 0'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.hero__title { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin-bottom: 20px; }
html[lang="ja"] .hero__title { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: 0; line-height: 1.3; }
.hl { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 28%, transparent) 62%); color: var(--ink); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0; color: var(--ink-2); font-size: .92rem; }
.hero__trust li { display: inline-flex; align-items: center; gap: 6px; }
.hero__trust .icon { color: var(--success); }

.hero__visual { position: relative; }
.mock-chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; transform: rotate(-1deg); }
.mock-chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.mock-chat__head small { display: block; color: var(--muted); font-size: .78rem; }
.mock-chat__timer { margin-left: auto; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; font-size: .75rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-2); }
.mock-chat__body { padding: 18px; display: grid; gap: 10px; background: var(--surface-2); }
.mock-chat__input { display: flex; justify-content: space-between; align-items: center; margin: 12px; padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .9rem; }
.mock-send { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; }
.mock-match { position: absolute; left: -36px; bottom: -28px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.mock-match small { display: block; color: var(--muted); font-size: .78rem; }

/* Chat bubbles (shared by mock and real chat) */
.bubble { position: relative; max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.msg .bubble { white-space: pre-wrap; }
.bubble-them { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble-me { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
@media (prefers-color-scheme: dark) { .bubble-me { background: #34449a; } }
.bubble__tools { display: flex; gap: 12px; margin-top: 6px; font-size: .75rem; color: var(--muted); }
.bubble__tools span, .bubble__tools button { display: inline-flex; align-items: center; gap: 4px; }
.bubble__translation { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-strong); color: var(--ink-2); font-size: .9rem; }
.bubble-correction { background: var(--success-tint); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.correction__label { display: flex; white-space: normal; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: var(--success); margin-bottom: 4px; }
del { color: var(--danger); text-decoration-thickness: 2px; background: var(--danger-tint); border-radius: 3px; }
ins { color: var(--success); text-decoration: none; font-weight: 700; background: color-mix(in srgb, var(--success) 14%, transparent); border-radius: 3px; }

/* Strip */
.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip__grid > div { padding: 22px 20px; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.strip__grid > div:first-child { border-left: 0; }
.strip__grid strong { font-size: 1rem; }
.strip__grid span { color: var(--muted); font-size: .9rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.step { position: relative; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.step__num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 16px; }
.step p { color: var(--ink-2); margin: 0; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); transition: transform .15s ease, box-shadow .15s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-tint); color: var(--accent); margin-bottom: 16px; }
.feature__icon .icon { width: 24px; height: 24px; }
.feature p { color: var(--ink-2); margin: 0; font-size: .95rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { color: var(--success); margin-top: 3px; }
.news-preview { display: grid; gap: 14px; }
.news-mini { display: grid; justify-items: start; gap: 6px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.news-mini:hover { color: var(--ink); transform: translateX(4px); box-shadow: var(--shadow); }
.level-demo { padding: 24px; }
.level-demo__tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.level-demo__tabs span { padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--surface-2); }
.level-demo__tabs .is-on { background: var(--brand); color: #fff; }
.level-demo__text { font-size: 1.2rem; line-height: 1.9; }

.city-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.city-chip { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .93rem; }
.city-chip:hover { border-color: var(--accent); color: var(--accent); }
.city-chip--all { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.city-chip--all:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }

.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 18px; margin: 0; }

.cta-band { background: linear-gradient(120deg, var(--brand) 0%, #2d3f8f 60%, #8a3d5b 100%); color: #fff; padding: 64px 0; }
@media (prefers-color-scheme: dark) { .cta-band { background: linear-gradient(120deg, #1d2754 0%, #2b3a80 60%, #6b2f49 100%); } }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; opacity: .85; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 56px 0 24px; font-size: .93rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer__brand p { color: var(--muted); margin-top: 12px; max-width: 320px; }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* Forms */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field__row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.field__row > .input { flex: 1; min-width: 0; }
label, .label { font-weight: 600; font-size: .92rem; }
.hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .97rem; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-tint); }
textarea.input { resize: vertical; min-height: 44px; line-height: 1.55; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23667085' stroke-width='1.6'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.counter { justify-self: end; color: var(--muted); font-size: .78rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 .field + .field, .grid-3 .field + .field { margin-top: 0; }
.form-card { padding: 28px; border: 1px solid var(--line); margin: 0 0 20px; }
.form-card legend { float: left; width: 100%; font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }
.form-card legend + * { clear: both; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.choice-card { position: relative; cursor: pointer; font-weight: 400; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card__body { display: grid; gap: 4px; padding: 18px; border: 2px solid var(--line); border-radius: var(--radius); transition: border-color .15s ease, background .15s ease; height: 100%; }
.choice-card__big { font-size: 1.35rem; font-weight: 800; }
.choice-card input:checked + .choice-card__body { border-color: var(--accent); background: var(--accent-tint); }
.choice-card input:focus-visible + .choice-card__body { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); }

.level-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.level-opt { cursor: pointer; font-weight: 400; position: relative; }
.level-opt input { position: absolute; opacity: 0; }
.level-opt__body { display: grid; gap: 3px; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; height: 100%; }
.level-opt__body small { font-weight: 400; }
.level-opt input:checked + .level-opt__body { border-color: var(--accent); background: var(--accent-tint); }
.level-opt input:focus-visible + .level-opt__body { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.level-bars { display: flex; gap: 3px; margin-bottom: 4px; }
.level-bars i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.level-bars i.on { background: var(--accent); }
/* Show level labels for the language being learned (learn = opposite of teach) */
.profile-form:has(input[name="teach_lang"][value="ja"]:checked) .lvl-learn-ja,
.profile-form:has(input[name="teach_lang"][value="en"]:checked) .lvl-learn-en { display: none; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { cursor: pointer; font-weight: 500; position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .9rem; transition: all .12s ease; }
.pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .pill input:checked + span { background: #34449a; border-color: #34449a; } }
.pill input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.pills-sm .pill span { padding: 5px 10px; font-size: .82rem; }

.avatar-field { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.avatar-field .field { flex: 1; }

.wizard-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: w; }
.wizard-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); padding-bottom: 10px; border-bottom: 3px solid var(--line); }
.wizard-steps li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); font-size: .78rem; }
.wizard-steps li.is-done, .wizard-steps li.is-current { color: var(--ink); border-color: var(--accent); }
.wizard-steps li.is-current span, .wizard-steps li.is-done span { background: var(--accent); color: #fff; }
.profile-form:not(.is-wizard) .wizard-steps { display: none; }

/* Avatars */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar-sm { width: 34px; height: 34px; font-size: .85rem; }
.avatar-md { width: 46px; height: 46px; font-size: 1.05rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.35rem; }
.avatar-xl { width: 104px; height: 104px; font-size: 2.2rem; }
.avatar-initial { display: inline-grid; place-items: center; color: #fff; font-weight: 800; background: hsl(calc(var(--h, 230) * 1deg) 55% 52%); }
.avatar-initial[data-hue="0"] { --h: 8; } .avatar-initial[data-hue="1"] { --h: 30; } .avatar-initial[data-hue="2"] { --h: 345; }
.avatar-initial[data-hue="3"] { --h: 160; } .avatar-initial[data-hue="4"] { --h: 200; } .avatar-initial[data-hue="5"] { --h: 230; }
.avatar-initial[data-hue="6"] { --h: 260; } .avatar-initial[data-hue="7"] { --h: 290; } .avatar-initial[data-hue="8"] { --h: 320; }
.avatar-initial[data-hue="9"] { --h: 140; } .avatar-initial[data-hue="10"] { --h: 180; } .avatar-initial[data-hue="11"] { --h: 15; }
.avatar-wrap { position: relative; display: inline-block; }
.avatar-wrap.is-online::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--success); border: 3px solid var(--surface); }

/* Tags, badges, pair */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .8rem; font-weight: 500; }
.tag-mode { background: var(--brand-tint); color: var(--brand-2); }
.tag-shared { background: var(--accent-tint); color: var(--accent-600); font-weight: 700; }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
html[lang="ja"] .badge { text-transform: none; letter-spacing: 0; }
.badge-japan { background: var(--accent-tint); color: var(--accent-600); }
.badge-world { background: var(--brand-tint); color: var(--brand-2); }
.badge-culture { background: #f6ecfb; color: #7b3fa0; }
.badge-science, .badge-tech { background: #e6f4f7; color: #1d6f82; }
.badge-sport { background: var(--success-tint); color: var(--success); }
.badge-business, .badge-lifestyle { background: #fbf3e1; color: #8a6514; }
@media (prefers-color-scheme: dark) { .badge-culture, .badge-science, .badge-tech, .badge-business, .badge-lifestyle { background: var(--surface-2); color: var(--ink-2); } }
.pair { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); margin: 8px 0; }
.pair__teach { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.pair__arrow { color: var(--accent); font-weight: 800; }
.pair__learn { color: var(--ink-2); }
.flag-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.flag-ja { background: radial-gradient(circle, #d9362b 45%, #fff 48%); box-shadow: 0 0 0 1px var(--line-strong); }
.flag-en { background: linear-gradient(135deg, #1f3e8a 50%, #c8102e 50%); }

.score { display: grid; place-items: center; align-content: center; min-width: 56px; height: 56px; border-radius: 16px; background: var(--accent-tint); color: var(--accent-600); line-height: 1; margin-left: auto; padding: 0 8px; }
.score strong { font-size: 1.3rem; font-weight: 800; }
.score span { font-size: .7rem; font-weight: 700; }
.score { grid-template-columns: auto auto; column-gap: 1px; }
.score small { grid-column: 1 / -1; font-size: .68rem; margin-top: 3px; font-weight: 600; }
.score-lg { min-width: 76px; height: 76px; }
.score-lg strong { font-size: 1.8rem; }

/* Member cards */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cards-grid--compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.member-card { position: relative; padding: 20px; display: grid; gap: 4px; align-content: start; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.member-card--public:hover { transform: none; }
.member-card__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.member-card__top { display: flex; gap: 14px; align-items: center; }
.member-card__name { margin: 0; font-size: 1.08rem; }
.member-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.member-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.member-card__bio { color: var(--ink-2); font-size: .92rem; margin: 4px 0 8px; }
.member-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Page heads, dashboard */
.page-head { margin-bottom: 28px; }
.page-head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { margin-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-row--6 { grid-template-columns: repeat(6, 1fr); }
.stat { display: grid; gap: 2px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
a.stat:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat strong { font-size: 1.5rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat__icon { color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.dash-grid .cards-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.section-title h2 { font-size: 1.25rem; margin: 0; }
.conv-mini, .news-list-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.conv-mini a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.conv-mini a:hover { background: var(--surface-2); }
.conv-mini span { display: grid; min-width: 0; flex: 1; }
.conv-mini small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-list-mini li { display: grid; padding: 8px 0; border-bottom: 1px solid var(--line); }
.news-list-mini li:last-child { border: 0; }
.news-list-mini a { color: var(--ink); text-decoration: none; font-weight: 600; }
.news-list-mini a:hover { color: var(--accent); }
.tip { background: var(--brand-tint); border-color: transparent; }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 24px; color: var(--muted); }
.empty > .icon { width: 36px; height: 36px; color: var(--line-strong); }

/* Browse */
.browse { display: grid; grid-template-columns: 290px 1fr; gap: 28px; align-items: start; }
.filters { padding: 20px; position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; display: grid; gap: 16px; }
.filters .field + .field { margin-top: 0; }
.filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.filters details summary { cursor: pointer; margin-bottom: 8px; }
.filters-toggle { display: none; }
.result-count { margin: 0 0 12px; font-size: .9rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 28px; }

/* Profile page */
.profile-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.profile-main { padding: 32px; }
.profile-head { display: flex; gap: 22px; align-items: flex-start; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.profile-head h1 { font-size: 1.9rem; margin-bottom: 4px; }
.profile-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.profile-section:last-child { border: 0; padding-bottom: 0; }
.profile-section h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
html[lang="ja"] .profile-section h2 { letter-spacing: .02em; }
.prose { color: var(--ink-2); }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { margin-top: 1.8em; font-size: 1.3rem; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: 6px; }
.profile-side { position: sticky; top: 88px; }
.quote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--ink-2); white-space: pre-wrap; }
.starter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2); font: inherit; font-size: .82rem; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); color: var(--accent); border-style: solid; }
.safety-box summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
.safety-box[open] summary { margin-bottom: 14px; }
.translation-box { margin-top: 8px; padding: 10px 14px; border-radius: 10px; background: var(--brand-tint); color: var(--ink); font-size: .93rem; white-space: pre-wrap; }

/* Requests */
.request-card { padding: 20px; display: grid; gap: 12px; }
.request-card__who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.request-card__who > span { display: grid; }
.request-card__who .pair { margin: 4px 0 0; }
.request-card__actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.out-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.out-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.out-list li a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }

/* Chat */
.page-messages .site-footer { display: none; }
.chat-shell { display: grid; grid-template-columns: 320px 1fr; gap: 16px; padding-top: 16px; padding-bottom: 16px; height: calc(100vh - 68px); height: calc(100dvh - 68px); }
.chat-list { overflow: hidden; display: flex; flex-direction: column; }
.chat-list__head { padding: 18px 18px 10px; }
.chat-list__head h1 { margin: 0; }
.chat-list ul { list-style: none; margin: 0; padding: 0 8px 8px; overflow: auto; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.conv:hover { background: var(--surface-2); }
.conv.is-active { background: var(--brand-tint); }
.conv__text { display: grid; min-width: 0; flex: 1; }
.conv__top { display: flex; justify-content: space-between; gap: 8px; }
.conv__last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; }
.chat { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.chat--empty { display: grid; place-items: center; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat__who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.chat__who > span { display: grid; min-width: 0; }
.chat__who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__back { display: none; }
.chat__tools { margin-left: auto; display: flex; gap: 4px; }
.chat__tools [aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-600); }
.topics { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); max-height: 200px; overflow: auto; }
.topics p { margin: 0 0 8px; }
.timer-bar { display: flex; justify-content: center; gap: 16px; align-items: center; padding: 8px 16px; background: var(--accent-tint); color: var(--accent-600); font-weight: 700; font-size: .9rem; }
.timer-bar.is-switch { animation: pulse 1s ease 3; }
@keyframes pulse { 50% { background: var(--accent); color: #fff; } }
.chat__messages { flex: 1; overflow-y: auto; padding: 20px; display: grid; align-content: start; gap: 6px; background: var(--surface-2); }
.chat__intro { text-align: center; padding: 6px 12px 16px; max-width: 520px; justify-self: center; }
.msg { display: grid; gap: 2px; }
.msg.mine { justify-items: end; }
.msg .bubble { max-width: min(78%, 620px); }
.msg__time { font-size: .7rem; color: var(--muted); padding: 0 6px; }
.msg__tools { display: flex; gap: 2px; opacity: .0; transition: opacity .15s ease; }
.msg:hover .msg__tools, .msg:focus-within .msg__tools { opacity: 1; }
@media (hover: none) { .msg__tools { opacity: 1; } }
.msg__tools button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .74rem; cursor: pointer; }
.msg__tools button:hover { background: var(--surface); color: var(--ink); }
.msg__extra { max-width: min(78%, 620px); padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line-strong); font-size: .88rem; white-space: pre-wrap; color: var(--ink-2); }
.bubble-me .correction__label { color: #b9f0d4; }
.msg.mine .bubble-correction { background: #1e6a4b; color: #fff; border: 0; }
.msg.mine .bubble-correction del { background: rgba(255,255,255,.12); color: #ffb3aa; }
.msg.mine .bubble-correction ins { background: rgba(255,255,255,.18); color: #b9f0d4; }
.correction-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: var(--success-tint); color: var(--success); font-weight: 600; font-size: .88rem; }
.correction-bar span { display: inline-flex; gap: 6px; align-items: center; }
.chat__composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat__composer textarea { max-height: 180px; border-radius: 22px; padding: 11px 18px; }
.chat__composer .btn { width: 46px; height: 46px; padding: 0; flex: none; }
.chat__note { margin: 0; padding: 0 16px 10px; font-size: .74rem; }

/* Translator */
.translator { padding: 20px; }
.translator__modes, .seg-group { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.translator__panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.translator__panes .field + .field { margin-top: 0; }
.translator__out { min-height: 182px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); white-space: pre-wrap; }
.translator__actions { margin-top: 14px; }
.translator__actions small { margin-right: auto; }

/* News */
.news-head { max-width: 760px; }
.news-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.news-controls .seg-group { margin: 0; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card { display: grid; gap: 10px; align-content: start; padding: 22px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.news-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); }
.news-card h2 { font-size: 1.15rem; margin: 0; }
.news-card p { margin: 0; font-size: .93rem; }
.news-card__top { display: flex; justify-content: space-between; align-items: center; }
.news-card__more { color: var(--accent); font-weight: 700; font-size: .9rem; }
.news-card--lead { grid-column: span 2; background: linear-gradient(135deg, var(--surface), var(--accent-tint)); }
.news-card--lead h2 { font-size: 1.6rem; }
.article-layout { display: grid; grid-template-columns: 1fr 340px; gap: 36px; align-items: start; }
.article h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-top: 12px; }
.article__meta { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.article__controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.article__controls .seg-group { margin: 0; }
.article__body { font-size: 1.1rem; line-height: 1.85; }
.article__body[lang="ja"] { font-size: 1.15rem; line-height: 2; }
.other-version { padding: 16px 20px; margin: 24px 0; }
.other-version summary { cursor: pointer; font-weight: 700; }
.other-version[open] summary { margin-bottom: 12px; }
.source { border-top: 1px solid var(--line); padding-top: 16px; }
.article-side { position: sticky; top: 88px; }
.vocab { margin: 0; display: grid; gap: 10px; }
.vocab div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.vocab div:last-child { border: 0; padding: 0; }
.vocab dt { font-weight: 700; }
.vocab dd { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; }
.discuss ol { padding-left: 1.2em; display: grid; gap: 10px; }
.discuss { background: var(--accent-tint); border-color: transparent; }
.ad-slot { margin: 28px 0; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); grid-column: 1 / -1; }
.ad-slot__label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }

/* Cities */
.hero--city { padding: 56px 0 48px; }
.hero--city .hero__title { font-size: clamp(2rem, 4.4vw, 3rem); }
.crumbs { color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.city-stats { display: flex; gap: 14px; margin-top: 24px; }
.city-stats div { display: grid; padding: 14px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.city-stats strong { font-size: 1.6rem; font-weight: 800; }
.city-stats span { color: var(--muted); font-size: .85rem; }
.city-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.city-card { display: grid; gap: 2px; padding: 16px 18px; text-decoration: none; color: var(--ink); transition: transform .15s ease, border-color .15s ease; }
.city-card:hover { color: var(--ink); transform: translateY(-2px); border-color: var(--accent); }
.city-card .badge { justify-self: start; margin-top: 6px; }
.numbered { padding-left: 1.3em; display: grid; gap: 10px; font-size: 1.02rem; }

/* How-it-works */
.timeline { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 16px; }
.timeline li { display: flex; gap: 18px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.timeline .step__num { flex: none; margin: 0; }
.timeline p { margin: 0; color: var(--ink-2); }
.callout { padding: 24px; background: var(--brand-tint); border-color: transparent; }
.callout .h3 { display: flex; gap: 8px; align-items: center; }

/* Auth */
.auth { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 380px); justify-content: center; gap: 40px; padding: 48px 20px 72px; align-items: center; }
.auth--single { grid-template-columns: minmax(0, 440px); }
.auth__card { padding: 34px; }
.auth__card h1 { font-size: 1.7rem; margin-bottom: 4px; }
.auth__card > .muted { margin-bottom: 22px; }
.auth__alt { text-align: center; margin: 20px 0 0; color: var(--muted); font-size: .93rem; }
.auth__aside { padding: 28px; }
.auth__aside h2 { font-size: 1.3rem; }

/* Admin */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card > .h3 { padding: 20px 20px 0; }
.card > .table-wrap, .card > p { padding: 0 20px 16px; }
.card > p.muted { padding-top: 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

.error-code { font-size: 5rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

/* Responsive */
@media (max-width: 1040px) {
  .hero__grid, .split { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero__visual { max-width: 520px; margin: 0 auto; width: 100%; }
  .mock-match { left: -8px; }
  .features { grid-template-columns: 1fr 1fr; }
  .dash-grid, .profile-layout, .article-layout { grid-template-columns: 1fr; }
  .profile-side, .article-side { position: static; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .stat-row--6 { grid-template-columns: repeat(3, 1fr); }
  .auth { grid-template-columns: minmax(0, 460px); }
  .auth__aside { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 12px 20px 20px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .site-nav.is-open { display: flex; }
  .site-nav__links { flex-direction: column; margin: 0; }
  .site-nav__links a { padding: 12px; border-radius: 10px; }
  .site-nav__actions { flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
  .user-menu__panel { position: static; box-shadow: none; margin-top: 8px; }
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; display: none; }
  .filters.is-open { display: grid; }
  .filters-toggle { display: inline-flex; }
  .steps { grid-template-columns: 1fr; }
  .strip__grid { grid-template-columns: 1fr 1fr; }
  .strip__grid > div:nth-child(3) { border-left: 0; }
  .strip__grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .chat-shell { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .chat-shell .card { border-radius: 0; border-left: 0; border-right: 0; }
  .has-thread .chat-list { display: none; }
  .page-messages:not(.has-thread) .chat { display: none; }
  .chat__back { display: inline-grid; }
}
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .container { padding: 0 16px; }
  .btn { white-space: normal; text-align: center; }
  .mock-chat__head { flex-wrap: wrap; }
  .mock-chat__timer { margin-left: 0; }
  .brand__name { font-size: 1rem; }
  .hero { padding: 40px 0 64px; }
  .features, .news-grid, .grid-2, .grid-3, .translator__panes { grid-template-columns: 1fr; }
  .news-card--lead { grid-column: auto; }
  .stat-row, .stat-row--6 { grid-template-columns: 1fr 1fr; }
  .level-picker { grid-template-columns: 1fr 1fr; }
  .choice-cards { grid-template-columns: 1fr; }
  .profile-head { flex-wrap: wrap; }
  .profile-main, .form-card, .auth__card { padding: 20px; }
  .wizard-steps li { font-size: 0; gap: 0; justify-content: center; }
  .wizard-steps li span { font-size: .78rem; }
  .cta-band__inner { flex-direction: column; align-items: flex-start; }
  .hide-sm { display: none; }
  .mock-chat { transform: none; }
  .mock-match { position: relative; left: 0; bottom: 0; margin-top: -16px; transform: none; }
  .site-footer__bottom { flex-direction: column; }
  .msg .bubble, .msg__extra { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] .hero__title { word-break: auto-phrase; }
