/* Hack Hokkaido portal. Uses only tokens from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--primary); }
img, video, iframe { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-foreground); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.04; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(var(--text-4xl), 7vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: var(--text-2xl); }
h1 em, h2 em, h3 em { color: var(--primary); }
p { margin: 0 0 var(--space-4); }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--space-5); }
.read { max-width: 44rem; }
main { flex: 1; padding-bottom: var(--space-20); }
.mono, .eyebrow, .btn, .badge, label, th, .count { font-family: var(--font-mono); }
.eyebrow { font-size: var(--text-xs); letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.eyebrow .sep { color: var(--muted-foreground); }
.muted { color: var(--muted-foreground); }
.small { font-size: var(--text-sm); }
.lead { font-size: var(--text-lg); color: var(--muted-foreground); max-width: 40rem; }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top { border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--background) 92%, transparent); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.top .wrap { display: flex; align-items: center; gap: var(--space-6); min-height: 64px; }
.logo { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.logo svg { width: 32px; height: 32px; flex-shrink: 0; }
.logo .word { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-sm); letter-spacing: .14em; line-height: 1.1; }
.logo .word b { color: var(--primary); font-weight: 600; }
.logo .sub { display: block; font-size: 9px; letter-spacing: .2em; color: var(--muted-foreground); font-weight: 400; }
.fill-primary { fill: var(--primary); }
.nav { display: flex; gap: var(--space-5); font-size: var(--text-sm); flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted-foreground); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--foreground); }
.who { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
@media (max-width: 760px) {
  .top .wrap { flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .nav { order: 3; flex-basis: 100%; gap: var(--space-4); overflow-x: auto; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-size: var(--text-xs); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  border-radius: var(--radius); border: 1px solid transparent; padding: var(--space-3) var(--space-5); min-height: 44px;
  transition: background var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
  background: transparent; color: var(--foreground);
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 88%, var(--foreground)); color: var(--primary-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { color: var(--secondary-foreground); background: color-mix(in oklab, var(--secondary) 85%, var(--primary)); }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover { border-color: var(--foreground); color: var(--foreground); }
.btn-destructive { color: var(--destructive); border-color: color-mix(in oklab, var(--destructive) 40%, transparent); }
.btn-destructive:hover { background: var(--destructive); color: var(--destructive-foreground); }
.btn-sm { min-height: 32px; padding: var(--space-1) var(--space-3); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted-foreground); cursor: pointer; text-decoration: underline; }

/* forms */
form { margin: 0; }
label { display: block; font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: var(--space-2); }
.field { margin-bottom: var(--space-5); }
.field .hint { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: var(--space-1); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--foreground); background: var(--card);
  border: 1px solid var(--input); border-radius: var(--radius); padding: var(--space-3); min-height: 44px;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
textarea.code { font-family: var(--font-mono); font-size: var(--text-sm); min-height: 420px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ring); outline-offset: -1px; border-color: var(--ring); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.check { display: flex; gap: var(--space-2); align-items: center; text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: var(--text-base); color: var(--foreground); }
.honey { position: absolute; left: -9999px; }

/* surfaces */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); }
a.card { display: block; text-decoration: none; transition: border-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease); }
a.card:hover { border-color: var(--foreground); color: var(--card-foreground); }
.card h3 { margin-bottom: var(--space-2); }
.grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-2 { display: grid; gap: var(--space-8); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.rule { border: 0; border-top: 1px solid var(--border); margin: var(--space-10) 0; }
.section { padding-top: var(--space-16); }
.section-head { display: flex; align-items: baseline; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.section-head .num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--primary); letter-spacing: .14em; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 2px var(--space-2); border-radius: var(--radius); border: 1px solid var(--border); color: var(--muted-foreground); white-space: nowrap; }
.badge-primary { border-color: color-mix(in oklab, var(--primary) 45%, transparent); color: var(--primary); }
.badge-success { border-color: color-mix(in oklab, var(--success) 45%, transparent); color: var(--success); }
.badge-solid { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.code-chip { font-family: var(--font-display); font-size: var(--text-2xl); color: var(--primary); line-height: 1; }

/* hero */
.hero { padding: var(--space-16) 0 var(--space-10); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-top: var(--space-5); }
.hero-art { position: absolute; right: -60px; top: -40px; width: 420px; height: 420px; opacity: .9; pointer-events: none; }
@media (max-width: 760px) { .hero-art { width: 260px; height: 260px; right: -80px; top: -20px; opacity: .35; } }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-6); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground); }
.facts span b { color: var(--primary); font-weight: 400; margin-right: var(--space-2); }

/* countdown */
.countdown { display: inline-flex; align-items: baseline; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.countdown .label { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-foreground); }
.countdown .count { font-size: var(--text-xl); font-variant-numeric: tabular-nums; color: var(--foreground); }
.countdown.hot .count { color: var(--primary); }
.countdown-hero .count { font-size: var(--text-3xl); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 400; background: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--font-mono); text-align: right; }

/* notices */
.notice { border: 1px solid var(--border); border-left: 3px solid var(--primary); padding: var(--space-4); border-radius: var(--radius); background: var(--card); margin-bottom: var(--space-5); }
.notice.error { border-left-color: var(--destructive); }
.notice.ok { border-left-color: var(--success); }
.secret { font-family: var(--font-mono); background: var(--muted); padding: var(--space-1) var(--space-2); border-radius: var(--radius); user-select: all; word-break: break-all; }

/* project cards */
.pcard { display: flex; flex-direction: column; gap: var(--space-3); padding: 0; overflow: hidden; }
.pcard .art { aspect-ratio: 16 / 7; background: var(--muted); border-bottom: 1px solid var(--border); }
.pcard .art svg { width: 100%; height: 100%; }
.pcard .body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.pcard h3 { font-size: var(--text-2xl); }
.pcard .team { font-size: var(--text-sm); color: var(--muted-foreground); margin-top: auto; }
.empty { border: 1px dashed var(--input); border-radius: var(--radius); padding: var(--space-10); text-align: center; color: var(--muted-foreground); }
.empty h3 { color: var(--foreground); margin-bottom: var(--space-2); }

/* tracks */
.track { padding: var(--space-8) 0; border-top: 1px solid var(--border); }
.cat { display: grid; grid-template-columns: 56px 1fr; gap: var(--space-4); }

/* prose */
.prose { font-size: var(--text-lg); line-height: 1.7; }
.prose h1, .prose h2 { font-size: var(--text-3xl); margin: var(--space-10) 0 var(--space-4); }
.prose h3 { font-size: var(--text-2xl); margin: var(--space-8) 0 var(--space-3); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-5); }
.prose li + li { margin-top: var(--space-2); }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--muted); padding: 1px var(--space-1); border-radius: var(--radius); }
.prose pre { background: var(--secondary); color: var(--secondary-foreground); padding: var(--space-5); border-radius: var(--radius); overflow-x: auto; font-size: var(--text-sm); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { margin: 0 0 var(--space-5); padding-left: var(--space-5); border-left: 3px solid var(--primary); color: var(--muted-foreground); font-family: var(--font-display); font-size: var(--text-xl); }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); }
.prose a { color: var(--primary); }

/* video */
.player { aspect-ratio: 16 / 9; width: 100%; background: var(--secondary); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.player video, .player iframe { width: 100%; height: 100%; border: 0; }
.recorder { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: var(--space-5); }
.recorder .preview { margin-bottom: var(--space-4); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--destructive); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.progress { height: 6px; background: var(--muted); border-radius: var(--radius); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); width: 0; transition: width var(--motion-fast) linear; }
.progress.w-0 > i { width: 0; } .progress.w-10 > i { width: 10%; } .progress.w-20 > i { width: 20%; } .progress.w-30 > i { width: 30%; } .progress.w-40 > i { width: 40%; }
.progress.w-50 > i { width: 50%; } .progress.w-60 > i { width: 60%; } .progress.w-70 > i { width: 70%; } .progress.w-80 > i { width: 80%; } .progress.w-90 > i { width: 90%; } .progress.w-100 > i { width: 100%; }

/* tabs (editor) */
.steps { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-6) 0; }
.steps a { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted-foreground); }
.steps a.done { color: var(--success); border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ok { color: var(--success); } .checklist .no { color: var(--muted-foreground); }

/* login */
.auth { max-width: 26rem; margin: var(--space-16) auto 0; }
.dev-login { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px dashed var(--input); }

/* judge app */
.judge-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; min-height: calc(100vh - 64px); }
.judge-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: calc(100vh - 64px); position: sticky; top: 64px; }
.judge-list a { display: block; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); text-decoration: none; font-size: var(--text-sm); }
.judge-list a[aria-current="true"] { background: var(--accent); color: var(--accent-foreground); }
.judge-list .t { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; display: block; }
.judge-main { padding: var(--space-6); overflow-x: hidden; }
.judge-score { border-left: 1px solid var(--border); padding: var(--space-6); background: var(--card); position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow-y: auto; }
@media (max-width: 1100px) { .judge-shell { grid-template-columns: 1fr; } .judge-list, .judge-score { position: static; max-height: none; border: 0; border-bottom: 1px solid var(--border); } }
.crit { padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.crit.active { background: color-mix(in oklab, var(--accent) 60%, transparent); margin: 0 calc(var(--space-6) * -1); padding-left: var(--space-6); padding-right: var(--space-6); }
.crit .name { font-family: var(--font-display); font-size: var(--text-xl); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-1); margin-top: var(--space-2); }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { margin: 0; text-align: center; padding: var(--space-2) 0; border: 1px solid var(--input); border-radius: var(--radius); cursor: pointer; font-size: var(--text-base); color: var(--foreground); letter-spacing: 0; }
.scale input:checked + label { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.scale input:focus-visible + label { outline: 2px solid var(--ring); outline-offset: 2px; }
kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--input); border-bottom-width: 2px; border-radius: var(--radius); padding: 0 var(--space-1); color: var(--muted-foreground); }

/* recap / blog layout */
.post-hero { padding-top: var(--space-16); padding-bottom: var(--space-8); text-align: left; position: relative; }
.post-hero h1 { font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl)); max-width: 18ch; }
.post-hero .tagline { font-family: var(--font-display); font-style: italic; font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); color: var(--primary); margin-top: var(--space-4); max-width: 30ch; line-height: 1.2; }
.post-art { width: 100%; aspect-ratio: 21 / 8; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--secondary); }
.post-art svg { width: 100%; height: 100%; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin: var(--space-8) 0; }
.metric { padding: var(--space-5); border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric .v { font-family: var(--font-display); font-size: var(--text-4xl); line-height: 1; }
.metric .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-foreground); margin-top: var(--space-2); }
.lang-bar { display: flex; height: 10px; border-radius: var(--radius); overflow: hidden; margin: var(--space-3) 0; }
.lang-bar svg { width: 100%; height: 10px; }
.byline { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; font-size: var(--text-sm); color: var(--muted-foreground); }
.people { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.person { display: flex; gap: var(--space-3); align-items: flex-start; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-foreground); display: grid; place-items: center; font-family: var(--font-display); font-size: var(--text-xl); flex-shrink: 0; }
.award { display: inline-flex; gap: var(--space-2); align-items: center; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--primary-foreground); background: var(--primary); padding: var(--space-1) var(--space-3); border-radius: var(--radius); }
.dark-band { background: var(--secondary); color: var(--secondary-foreground); padding: var(--space-16) 0; margin-top: var(--space-16); }
.dark-band .muted { color: color-mix(in oklab, var(--secondary-foreground) 70%, transparent); }
.dark-band a.card { background: color-mix(in oklab, var(--secondary-foreground) 6%, var(--secondary)); color: var(--secondary-foreground); border-color: color-mix(in oklab, var(--secondary-foreground) 18%, transparent); }

footer.foot { border-top: 1px solid var(--border); padding: var(--space-8) 0; font-size: var(--text-sm); color: var(--muted-foreground); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .top, footer.foot, .btn { display: none !important; } }

/* generative snow-star art (SnowStar.tsx) */
.gs .bg { fill: var(--secondary); }
.gs .ridge { fill: none; stroke: var(--secondary-foreground); stroke-opacity: .22; stroke-width: 1; }
.gs .ridge.hi { stroke: var(--primary); stroke-opacity: .85; stroke-width: 1.5; }
.gs .star { fill: var(--primary); }
.gs .star.ghost { fill: none; stroke: var(--secondary-foreground); stroke-opacity: .35; }
.gs .flake { fill: var(--secondary-foreground); fill-opacity: .55; }
.gs.light .bg { fill: var(--muted); }
.gs.light .ridge { stroke: var(--foreground); stroke-opacity: .16; }
.gs.light .flake { fill: var(--foreground); fill-opacity: .25; }
.gs.light .star.ghost { stroke: var(--foreground); stroke-opacity: .25; }
.gs.bare .bg { fill: transparent; }
.lang-1 { fill: var(--chart-1); } .lang-2 { fill: var(--chart-2); } .lang-3 { fill: var(--chart-3); } .lang-4 { fill: var(--chart-4); } .lang-5 { fill: var(--muted-foreground); } .lang-6 { fill: var(--border); }
.dot-1 { color: var(--chart-1); } .dot-2 { color: var(--chart-2); } .dot-3 { color: var(--chart-3); } .dot-4 { color: var(--chart-4); } .dot-5 { color: var(--muted-foreground); } .dot-6 { color: var(--border); }

.section-tight { margin-top: var(--space-5); }
.sticky-col { position: sticky; top: 88px; align-self: start; }
@media (max-width: 900px) { .sticky-col { position: static; } }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain > * + * { margin-top: var(--space-5); }
.pick { cursor: pointer; text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: var(--text-base); color: var(--card-foreground); margin: 0; position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: color-mix(in oklab, var(--accent) 50%, var(--card)); }
.pick:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.pick-name { display: block; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.15; }
.pick-sub { display: block; font-size: var(--text-sm); color: var(--muted-foreground); margin-top: var(--space-1); }

.card-pad { padding: var(--space-4); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-2); }
.judge-title { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
.avatar-sm { width: 24px; height: 24px; font-size: var(--text-sm); }

/* recap */
.recap-hero { position: relative; min-height: min(78vh, 720px); display: flex; align-items: flex-end; color: var(--secondary-foreground); background: var(--secondary); overflow: hidden; }
.recap-art { position: absolute; inset: 0; }
.recap-art svg { width: 100%; height: 100%; }
.recap-hero-text { position: relative; padding-bottom: var(--space-16); padding-top: var(--space-24); }
.recap-hero h1 { max-width: 16ch; font-size: clamp(var(--text-4xl), 8vw, var(--text-6xl)); }
.recap-hero .lead { color: color-mix(in oklab, var(--secondary-foreground) 75%, transparent); }
.stories { display: grid; gap: var(--space-8); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .stories { grid-template-columns: 1fr; } }
.story { display: grid; gap: var(--space-4); text-decoration: none; color: inherit; }
.story:hover { color: inherit; }
.story:hover h3 { color: var(--primary); }
.story-art { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.story-art svg { width: 100%; height: 100%; transition: transform 600ms var(--motion-ease); }
.story:hover .story-art svg { transform: scale(1.03); }
.story h3 { font-size: var(--text-3xl); transition: color var(--motion-fast) var(--motion-ease); }
.story-tag { font-family: var(--font-display); font-style: italic; font-size: var(--text-xl); color: var(--primary); line-height: 1.25; margin: 0; }
.story-meta { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-xs); letter-spacing: .08em; color: var(--muted-foreground); }
.story-big { grid-column: 1 / -1; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; gap: var(--space-8); }
.story-big h3 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
.story-big.story-flip .story-art { order: 2; }
@media (max-width: 860px) { .story-big { grid-template-columns: 1fr; } .story-big.story-flip .story-art { order: 0; } }

/* admin */
details.admin-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin-bottom: var(--space-3); }
details.admin-item > summary { cursor: pointer; padding: var(--space-3) var(--space-4); display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; font-size: var(--text-sm); }
details.admin-item > div { padding: var(--space-4); border-top: 1px solid var(--border); }
details.admin-actions { margin: 0; min-width: 14rem; }
.inline { flex-wrap: nowrap; }
.inline input, .inline select { width: auto; min-height: 32px; padding: var(--space-1) var(--space-2); font-size: var(--text-sm); }
textarea.csv { font-family: var(--font-mono); font-size: var(--text-sm); min-height: 120px; }
.gs.bare .ridge { stroke: var(--foreground); stroke-opacity: .14; }
.gs.bare .flake { fill: var(--foreground); fill-opacity: .2; }
.gs.bare .star.ghost { stroke: var(--foreground); stroke-opacity: .25; }

/* long links (repo URLs) wrap inside their card */
.repo-link { display: block; overflow-wrap: anywhere; }
.card, .stack > * { min-width: 0; }

/* video-first article */
.feature-video { max-width: 60rem; margin: 0 auto var(--space-8); }
.feature-video .player { box-shadow: 0 30px 60px -30px color-mix(in oklab, var(--secondary) 55%, transparent); }
.post-art.slim { aspect-ratio: auto; height: 80px; }

/* flow: choices, stepper, editor */
.choice-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.choice { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-8); }
.choice h2, .choice h3 { margin: 0; }
.choice .btn { align-self: flex-start; margin-top: auto; }
.code-input { text-transform: uppercase; letter-spacing: .2em; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); }
.editor-title { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin: var(--space-6) 0; overflow: hidden; }
.stepper a { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); text-decoration: none; border-right: 1px solid var(--border); color: var(--muted-foreground); position: relative; }
.stepper a:last-child { border-right: 0; }
.stepper .n { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .12em; }
.stepper .l { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.1; color: var(--foreground); }
.stepper a.done .n { color: var(--success); }
.stepper a.current { background: var(--accent); }
.stepper a.current::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--primary); }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stepper a:nth-child(3) { border-right: 0; } .stepper a:nth-child(-n+3) { border-bottom: 1px solid var(--border); } }
.step-card h2 { margin-bottom: var(--space-5); }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.md-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.md-pane { display: flex; flex-direction: column; min-width: 0; }
.md-pane + .md-pane { border-left: 1px solid var(--border); }
.md-head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border); background: var(--muted); }
.md-head .label { margin: 0; }
.md-pane textarea.code { border: 0; border-radius: 0; min-height: 60vh; flex: 1; background: var(--card); }
.md-preview { padding: var(--space-5); max-height: 70vh; overflow-y: auto; font-size: var(--text-base); }
@media (max-width: 900px) { .md-editor { grid-template-columns: 1fr; } .md-pane + .md-pane { border-left: 0; border-top: 1px solid var(--border); } }
.invite { display: flex; gap: var(--space-2); }
.invite input { min-width: 0; }
.join-code { font-size: var(--text-3xl); letter-spacing: .2em; color: var(--primary); margin: var(--space-4) 0 var(--space-2); }
.team-card { display: flex; flex-direction: column; gap: var(--space-4); }
.team-card h2 { margin: 0; }
.mini-steps { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground); }
.mini-steps .done { color: var(--success); }
details.card > summary { cursor: pointer; }

/* studio */
.studio { max-width: 92rem; margin: 0 auto; padding: var(--space-5); }
.studio-top { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; margin-bottom: var(--space-5); }
.studio-title { flex: 1; }
.studio-title .eyebrow { margin: 0; }
.studio-steps { display: flex; gap: var(--space-2); list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; }
.studio-steps li { padding: var(--space-1) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted-foreground); }
.studio-steps li.current { border-color: var(--primary); color: var(--primary); }
.studio-steps li.done { color: var(--success); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-6); align-items: start; }
@media (max-width: 1000px) { .studio-grid { grid-template-columns: 1fr; } }
.studio-side .stack > * + * { margin-top: var(--space-3); }
.stage { position: relative; aspect-ratio: 16 / 9; background: var(--secondary); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.stage > video { width: 100%; height: 100%; object-fit: contain; }
.stage .stage-cam { position: absolute; width: 22%; height: auto; aspect-ratio: 1; right: 3%; bottom: 5%; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); box-shadow: 0 10px 30px -10px color-mix(in oklab, var(--secondary) 80%, transparent); }
.editor-stage .stage-cam { right: auto; bottom: auto; }
.stage .movable { cursor: grab; touch-action: none; }
.stage .movable:active { cursor: grabbing; }
.stage-empty, .stage-loading { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in oklab, var(--secondary-foreground) 70%, transparent); pointer-events: none; }
.stage-count { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 10rem; color: var(--primary-foreground); background: color-mix(in oklab, var(--secondary) 55%, transparent); }
.meter { height: 6px; background: var(--muted); border-radius: var(--radius); overflow: hidden; margin-top: var(--space-2); }
.meter i { display: block; height: 100%; background: var(--success); transform-origin: left; transform: scaleX(0); transition: transform 60ms linear; }
.rec-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.rec-time { font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.rec-dot.paused { animation: none; background: var(--muted-foreground); }
.transport { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.timeline { position: relative; height: 96px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); cursor: text; user-select: none; touch-action: none;
  background: repeating-linear-gradient(135deg, var(--muted) 0 6px, var(--background) 6px 12px); }
.timeline:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tl-thumbs { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .3; }
.tl-wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 32px; opacity: .9; pointer-events: none; }
.tl-segs { position: absolute; inset: 0; }
.seg { position: absolute; top: 0; bottom: 0; border: 2px solid color-mix(in oklab, var(--primary) 55%, transparent); border-radius: var(--radius); background: color-mix(in oklab, var(--card) 10%, transparent); box-shadow: inset 0 0 0 999px color-mix(in oklab, var(--background) 0%, transparent); }
.seg.sel { border-color: var(--primary); background: color-mix(in oklab, var(--accent) 25%, transparent); }
.seg .h { position: absolute; top: 0; bottom: 0; width: 12px; background: var(--primary); cursor: ew-resize; }
.seg .h.l { left: -2px; border-radius: var(--radius) 0 0 var(--radius); }
.seg .h.r { right: -2px; border-radius: 0 var(--radius) var(--radius) 0; }
.seg .h::after { content: ""; position: absolute; left: 5px; top: 35%; bottom: 35%; width: 2px; background: var(--primary-foreground); opacity: .8; }
.seg-len { position: absolute; top: var(--space-1); left: var(--space-4); font-size: 10px; color: var(--primary-foreground); background: var(--primary); padding: 0 var(--space-1); border-radius: var(--radius); }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--foreground); pointer-events: none; }
.tl-head::before { content: ""; position: absolute; top: -1px; left: -5px; border: 6px solid transparent; border-top-color: var(--foreground); }
.tools { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-top: var(--space-3); }
.bubble-tools { display: inline-flex; gap: var(--space-1); align-items: center; }
.studio-cta { padding: var(--space-5); border: 1px dashed var(--input); border-radius: var(--radius); background: color-mix(in oklab, var(--accent) 35%, var(--card)); }

/* decks (hh-deck/1) */
.stepper { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stepper a:nth-child(3) { border-right: 1px solid var(--border); } .stepper a:nth-child(4) { border-right: 0; } .stepper a:nth-child(-n+4) { border-bottom: 1px solid var(--border); } }
.deck-tools { margin-bottom: var(--space-4); }
.deck-editor textarea.code { min-height: 70vh; font-size: var(--text-xs); }
.deck-preview { padding: var(--space-4); max-height: 75vh; overflow-y: auto; background: var(--muted); }
.deck-errors ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }
.deck-thumbs { display: flex; flex-direction: column; gap: var(--space-4); }
.dslide { position: relative; aspect-ratio: 16 / 9; container-type: inline-size; background: var(--background); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.dslide.d-dark { background: var(--secondary); color: var(--secondary-foreground); border-color: var(--secondary); }
.d-inner { flex: 1; min-height: 0; position: relative; padding: 5cqw 6cqw 2cqw; display: flex; }
.d-inner > * { min-width: 0; }
.d-col { display: flex; flex-direction: column; gap: 1.6cqw; flex: 1; min-height: 0; position: relative; }
.d-center { justify-content: center; }
.d-split { display: grid; grid-template-columns: 3fr 2fr; gap: 4cqw; align-items: center; flex: 1; }
.d-eyebrow { font-family: var(--font-mono); font-size: 1.3cqw; letter-spacing: .2em; text-transform: uppercase; color: var(--primary); }
.d-h1 { font-family: var(--font-display); font-size: 7.4cqw; line-height: .98; font-weight: 400; margin: 0; max-width: 60%; }
.d-h2 { font-family: var(--font-display); font-size: 4.6cqw; line-height: 1.02; font-weight: 400; margin: 0; }
.d-sub { font-family: var(--font-display); font-style: italic; color: var(--primary); font-size: 2.8cqw; line-height: 1.2; max-width: 55%; margin: 0; }
.d-team { margin-top: auto; font-family: var(--font-mono); font-size: 1.3cqw; letter-spacing: .08em; opacity: .8; }
.d-art { position: absolute; inset: 0; opacity: .95; }
.d-art svg { width: 100%; height: 100%; }
.d-title .d-col { z-index: 1; }
.d-md { font-size: 1.9cqw; line-height: 1.45; }
.d-md p, .d-md ul, .d-md ol { margin: 0 0 1cqw; }
.d-md h2, .d-md h3 { font-family: var(--font-display); font-weight: 400; font-size: 2.6cqw; margin: 1cqw 0; }
.d-stat { display: flex; flex-direction: column; gap: 1cqw; border-left: 0.4cqw solid var(--primary); padding-left: 3cqw; }
.d-stat .v { font-family: var(--font-display); font-size: 12cqw; line-height: .9; color: var(--primary); }
.d-stat .k { font-size: 1.8cqw; color: var(--muted-foreground); }
.d-url { font-family: var(--font-mono); font-size: 1.8cqw; color: var(--primary); margin: 0; word-break: break-all; }
.d-video { flex: 1; min-height: 0; display: flex; }
.d-video video { width: 100%; height: 100%; object-fit: contain; background: var(--foreground); border-radius: var(--radius); }
.d-backup { display: none; position: absolute; inset: 0; z-index: 2; }
.d-backup.show { display: flex; }
.d-poster { max-height: 45%; width: auto; border-radius: var(--radius); border: 1px solid color-mix(in oklab, var(--secondary-foreground) 25%, transparent); }
.d-hint { font-family: var(--font-mono); font-size: 1.2cqw; opacity: .7; margin: 0; }
.d-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.4cqw 3cqw; }
.d-steps li { display: flex; gap: 1.4cqw; align-items: baseline; font-size: 2cqw; line-height: 1.3; }
.d-steps .n { font-family: var(--font-mono); color: var(--primary); font-size: 1.4cqw; }
.d-chips { display: flex; flex-wrap: wrap; gap: .8cqw; margin: auto 0 0; }
.d-chips span { font-family: var(--font-mono); font-size: 1.2cqw; letter-spacing: .08em; border: 1px solid var(--border); border-radius: var(--radius); padding: .3cqw .9cqw; }
.d-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3cqw; margin-top: auto; margin-bottom: auto; }
.d-metrics > div { display: flex; flex-direction: column; gap: .6cqw; border-top: 0.25cqw solid var(--primary); padding-top: 1.4cqw; }
.d-metrics .v { font-family: var(--font-display); font-size: 7cqw; line-height: 1; }
.d-metrics .k { font-family: var(--font-mono); font-size: 1.2cqw; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-foreground); }
.d-figure { margin: 0; display: flex; flex-direction: column; gap: 1cqw; flex: 1; min-height: 0; align-items: center; justify-content: center; }
.d-figure img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: var(--radius); }
.d-figure figcaption { font-size: 1.6cqw; color: var(--muted-foreground); }
.d-quote { margin: auto 0; display: flex; flex-direction: column; gap: 2cqw; }
.d-quote p { font-family: var(--font-display); font-size: 4.8cqw; line-height: 1.12; margin: 0; }
.d-quote cite { font-family: var(--font-mono); font-style: normal; font-size: 1.5cqw; color: var(--primary); letter-spacing: .1em; }
.d-bullets { margin: 0; padding-left: 2.4cqw; font-size: 2.2cqw; line-height: 1.4; }
.d-bullets li + li { margin-top: .8cqw; }
.d-ask { margin-top: auto; display: flex; gap: 2cqw; align-items: baseline; background: var(--primary); color: var(--primary-foreground); padding: 1.6cqw 2.4cqw; border-radius: var(--radius); font-size: 2.2cqw; }
.d-ask .k { font-family: var(--font-mono); font-size: 1.2cqw; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.d-foot { display: flex; justify-content: space-between; gap: 2cqw; padding: 1.4cqw 6cqw 2cqw; font-family: var(--font-mono); font-size: 1.05cqw; letter-spacing: .14em; text-transform: uppercase; opacity: .7; position: relative; z-index: 1; }
.d-brand { display: inline-flex; gap: .6cqw; align-items: center; }
.d-brand svg { width: 1.6cqw; height: 1.6cqw; }
.d-notes { position: absolute; left: 2cqw; right: 2cqw; bottom: 5cqw; z-index: 3; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4cqw 2cqw; font-size: 1.6cqw; }
.presenter { min-height: 100vh; background: var(--secondary); display: flex; flex-direction: column; }
.deck-present { flex: 1; display: grid; place-items: center; padding: var(--space-4); }
.deck-present .dslide { display: none; width: min(100%, calc((100vh - 90px) * 16 / 9)); border: 0; }
.deck-present .dslide.active { display: flex; }
.presenter:fullscreen .deck-present { padding: 0; }
.presenter:fullscreen .dslide { width: min(100vw, calc(100vh * 16 / 9)); border-radius: 0; }
.presenter:fullscreen .presenter-bar { display: none; }
.presenter-bar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-5); background: var(--card); border-top: 1px solid var(--border); }

/* ---- event model: scorecard 0–100, rubric editor, sign-ups ---- */
.score-row { display: grid; grid-template-columns: 1fr 88px; gap: var(--space-3); align-items: center; margin-top: var(--space-2); }
.score-row input[type=range] { width: 100%; accent-color: var(--primary); min-height: 44px; }
.score-num { text-align: right; font-size: var(--text-xl); }
.score-total { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.score-total .v { font-family: var(--font-display); font-size: var(--text-5xl); line-height: 1; color: var(--primary); }
.score-total .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-foreground); }
.crit label.name { text-transform: none; letter-spacing: 0; color: var(--foreground); margin: 0; font-family: var(--font-display); font-size: var(--text-xl); }
.rubric-table td { padding: var(--space-2); }
.rubric-table input { min-height: 40px; padding: var(--space-2); }
.rubric-table .w-num { width: 88px; }
.metrics-flat { margin: var(--space-4) 0; }
.pick.locked { cursor: not-allowed; opacity: .6; }
.pick .pick-state { display: block; margin-top: var(--space-3); }
.signup-group { margin-top: var(--space-8); }
.pick-state .on, .pick:has(input:checked) .pick-state .off { display: none; }
.pick:has(input:checked) .pick-state .on { display: inline-flex; }

/* Partners, prizes, perks */
.partner-logo { display: flex; align-items: center; height: var(--space-16); margin-bottom: var(--space-3); }
.partner-logo img { max-height: 100%; max-width: 12rem; object-fit: contain; }
.partner-logo.small { height: var(--space-8); margin: 0; }
.partner-logo.small img { max-width: 7rem; }
.partner-word { font-family: var(--font-display); font-size: var(--text-2xl); line-height: 1; color: var(--foreground); }
.partner-logo.small .partner-word { font-size: var(--text-base); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted-foreground); }
.partner-strip { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: center; }
.partner-strip a { text-decoration: none; }
.prize-list .block { display: block; margin-top: var(--space-1); }
.prize-value { color: var(--primary); white-space: nowrap; }
.perk-card { display: flex; flex-direction: column; gap: var(--space-3); }
.perk-card h3, .perk-card h1 { margin: 0; }
.perk-card h3 a { color: inherit; text-decoration: none; }
.perk-card.got { border-color: color-mix(in oklab, var(--success) 45%, var(--border)); }
.perk-value { font-family: var(--font-display); font-size: var(--text-4xl); line-height: 1; color: var(--primary); }
.perk-action { margin-top: auto; }
.perk-summary { display: flex; flex-direction: column; gap: var(--space-4); text-decoration: none; color: inherit; }
.perk-summary .facts { margin-top: 0; }
.perk-summary .btn { align-self: flex-start; }
.reveal { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.reveal-code { font-family: var(--font-mono); font-size: var(--text-lg); padding: var(--space-2) var(--space-3); border: 1px dashed var(--primary); border-radius: var(--radius); background: var(--muted); word-break: break-all; }
.claim-steps { display: flex; flex-direction: column; gap: var(--space-5); }
.claim-step { display: grid; grid-template-columns: var(--space-8) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.claim-num { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; color: var(--primary); padding-top: var(--space-1); }
.claim-step .field { margin: 0; }
dialog.modal { width: min(36rem, calc(100vw - var(--space-8))); max-height: calc(100vh - var(--space-16)); overflow: auto; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); }
/* The backdrop is always a navy veil: foreground is navy in light mode, background is navy in dark mode. */
dialog.modal::backdrop { background: color-mix(in oklab, var(--foreground) 45%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) dialog.modal::backdrop { background: color-mix(in oklab, var(--background) 75%, transparent); } }
:root[data-theme="dark"] dialog.modal::backdrop { background: color-mix(in oklab, var(--background) 75%, transparent); }
dialog.modal h2 { margin: var(--space-2) 0 var(--space-5); }
@media (prefers-reduced-motion: no-preference) {
  dialog.modal[open] { animation: modal-in var(--motion-fast) var(--motion-ease); }
  @keyframes modal-in { from { opacity: 0; transform: translateY(var(--space-2)); } }
}
.block { display: block; }
fieldset.plain > legend.eyebrow { padding: 0; margin-bottom: var(--space-3); }

/* Language switch: EN / 日本語 in the header */
.lang-switch { display: inline-flex; gap: var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .08em; }
.lang-switch a { text-decoration: none; color: var(--muted-foreground); padding: var(--space-1) 0; }
.lang-switch a + a::before { content: "/"; margin-right: var(--space-2); color: var(--border); }
.lang-switch a[aria-current="true"] { color: var(--foreground); }
html[lang="ja"] body { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
/* Japanese layout: break headings and short labels between phrases (Chromium), never inside a word. */
html[lang="ja"] :is(h1, h2, h3, .btn, .stepper .l) { word-break: auto-phrase; }
/* A section head's link or badge goes to its own line instead of shrinking to one character per line. */
.section-head > .grow { flex-basis: auto; }
.countdown { flex-wrap: wrap; }
.countdown .label, .countdown .count { white-space: nowrap; }
@media (max-width: 760px) {
  html[lang="ja"] .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[lang="ja"] .stepper a { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  html[lang="ja"] .stepper a:nth-child(2n), html[lang="ja"] .stepper a:last-child { border-right: 0; }
  html[lang="ja"] .stepper a:last-child { border-bottom: 0; }
  html[lang="ja"] .stepper .l { font-size: var(--text-base); }
}

/* Japanese versions of content fields in edit forms */
details.ja-fields { border: 1px dashed var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
details.ja-fields > summary { cursor: pointer; font-size: var(--text-sm); }
details.ja-fields[open] > summary { margin-bottom: var(--space-3); }
