*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Base viewport color — the fluid canvas paints its own warm-white → blue
   gradient, so leaving body transparent lets the fluid show through every
   section (Hero, Domains, Services, ...) instead of only inside Hero. */
html { background: #f5f7fb; }
body {
    font-family: system-ui, -apple-system, 'Hiragino Kaku Gothic ProN', sans-serif;
    background: transparent;
    color: #0f1a2e;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Body-level fluid background ─────────────────── */
.site-fluid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}
.site-fluid-bg .fluid-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #1a4dcc; }

/* ── Header / Nav ─────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.5rem;      /* trimmed horizontal padding to give nav more room */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 26, 46, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 100vw;
    overflow-x: hidden;         /* absolute failsafe against horizontal scrollbar */
}
.site-nav {
    flex: 1 1 auto;
    min-width: 0;               /* allow nav to shrink inside flex parent */
}
.site-logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0f1a2e;
}
.site-nav ul {
    display: flex;
    align-items: center;
    gap: 0.9rem;               /* tightened from 1.2rem to fit 10 nav + lang + AccountWidget */
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;           /* graceful degradation when even 0.9rem gaps don't fit */
    justify-content: flex-end;
}
.site-nav a {
    font-size: 0.82rem;        /* slightly smaller to save horizontal room */
    font-weight: 600;
    color: #2a3550;
    padding: 0.35rem 0.15rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    white-space: nowrap;       /* prevent single label wrapping mid-word */
}
.site-nav a:hover { border-bottom-color: #1a4dcc; }
.lang-toggle {
    background: #0f1a2e;
    color: #fff;
    border: 0;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.lang-toggle:hover { background: #1a4dcc; }
.nav-hamburger {
    display: none;
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    cursor: pointer;
}
@media (max-width: 900px) {
    .nav-hamburger { display: block; }
    .site-nav { display: none; position: absolute; top: 100%; right: 0; background: #fff; padding: 1rem 2rem; box-shadow: 0 8px 16px rgba(0,0,0,0.1); }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
}

/* ── Main / Page ─────────────────────────────────── */
.site-main {
    flex: 1;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.page-placeholder {
    text-align: center;
    padding: 4rem 1rem;
}
.page-placeholder h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem;
    color: #0f1a2e;
}
.muted { opacity: 0.55; }
.not-found { text-align: center; padding: 4rem; font-size: 1.5rem; opacity: 0.5; }

/* ── Home page sections ─────────────────────────── */
.home-hero {
    position: relative;
    text-align: center;
    padding: 4rem 1rem 3rem;
    overflow: hidden;
    /* Keep Hero taller than the IntersectionObserver "middle band" so at
       scroll 0 the palette signal locks to HERO (blue). Previously Hero was
       ~500 px, letting Domains (which starts right after) also intersect the
       middle band and win the last-observer race → teal palette on load. */
    min-height: 65vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.home-hero-sdf {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 1.2rem;
    z-index: 1;
}
.home-hero-sdf .sdf-canvas {
    display: block;
    width: 100%;
    height: 240px;
}
.home-hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin: 0 0 0.8rem;
    color: #0f1a2e;
    letter-spacing: 0.01em;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.home-hero-tagline {
    font-size: clamp(1.2rem, 3vw, 2rem);
    margin: 0 0 0.6rem;
    color: #1a4dcc;
    font-weight: 600;
}
.home-hero-sub {
    font-size: 1.1rem;
    color: #2a3550;
    font-weight: 600;
    margin: 0 0 2rem;
}
.home-hero-lead {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.9;
    color: #4a5570;
    font-size: 0.95rem;
}

.home-section {
    padding: 3rem 1rem;
    border-top: 1px solid rgba(15, 26, 46, 0.06);
}
.home-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.home-section-head h2 {
    font-size: 2rem;
    margin: 0;
    color: #0f1a2e;
}
.home-section-sub {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: #8794b0;
    text-transform: uppercase;
}
.home-body {
    line-height: 1.9;
    color: #2a3550;
}
.home-link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: #1a4dcc;
}

.home-domains, .home-service-list, .home-products, .home-portfolio {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    gap: 1rem;
}
.home-domains { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.home-service-list { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.home-products { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.home-portfolio { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.home-domain, .home-service-list li, .home-products li, .home-portfolio li {
    background: #fff;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    border: 1px solid rgba(15, 26, 46, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.home-domain strong, .home-service-list strong, .home-products strong, .home-portfolio strong {
    font-size: 1.05rem;
    color: #0f1a2e;
}
.home-domain span, .home-service-list span, .home-products span, .home-portfolio span {
    font-size: 0.9rem;
    color: #4a5570;
    line-height: 1.55;
}
.home-portfolio-year {
    font-size: 0.75rem !important;
    color: #8794b0 !important;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}
.home-services-summary {
    background: linear-gradient(135deg, #f2f5ff, #e8eeff);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.home-services-summary h3 { margin: 0 0 0.6rem; color: #0f1a2e; font-size: 1.15rem; }
.home-services-summary p  { margin: 0; color: #4a5570; }

.home-about {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1.6rem;
    max-width: 640px;
}
.home-about dt { font-weight: 600; color: #4a5570; }
.home-about dd { margin: 0; color: #0f1a2e; }

/* ── SDF Text canvases (Phase C.1 body impl) ────── */
.sdf-text {
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
}
/* NOTE: earlier revisions applied `filter: drop-shadow(... white ...)` here
   to add a halo for contrast over the fluid palette. That looked good on
   isolated glyphs but composited badly at internal stroke intersections
   (vertical + horizontal crossings) — the drop-shadow's white shadow bled
   through the SDF's anti-aliased edges, producing visible white dots inside
   each CJK glyph. Palette softening + dark text colour + Hero min-height
   deliver enough contrast on their own; the halo is not worth the artefact.

   If a section palette ever needs extra text pop (Hero paragraphs over dense
   blob peaks), prefer a per-section semi-transparent CSS backdrop like:

       .home-hero-tagline {
           background: linear-gradient(to bottom,
               rgba(255,255,255,0) 0%,
               rgba(255,255,255,0.35) 40%,
               rgba(255,255,255,0.35) 60%,
               rgba(255,255,255,0) 100%);
           padding: 0.4em 1em;
       }

   which doesn't touch the glyph alpha. */
.site-logo .sdf-text-hero-display {
    width: 140px;
    height: 32px;
}
.site-nav a .sdf-text-nav-item {
    width: 96px;
    height: 22px;
}
.home-section-head h2 {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-section-head h2 .sdf-text-section-heading {
    width: 320px;
    height: 44px;
}

/* ── SDF Text canvases (Phase C.2 body — body text) ── */

/* Hero paragraphs */
.home-hero-tagline {
    line-height: 0;
    margin: 0 0 0.6rem;
}
.home-hero-tagline .sdf-text-body-large {
    width: 640px;
    height: 40px;
    max-width: 90vw;
}
.home-hero-sub {
    line-height: 0;
    margin: 0 0 2rem;
}
.home-hero-sub .sdf-text-body-large {
    width: 420px;
    height: 30px;
    max-width: 80vw;
}

/* Section head caption (uppercase muted) */
.home-section-sub {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-section-sub .sdf-text-caption {
    width: 140px;
    height: 16px;
}

/* Card strong / span text */
.home-domain strong,
.home-service-list strong,
.home-products strong,
.home-portfolio strong,
.home-services-summary h3 {
    line-height: 0;
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.home-domain strong .sdf-text-label,
.home-service-list strong .sdf-text-label,
.home-products strong .sdf-text-label,
.home-portfolio strong .sdf-text-label {
    width: 200px;
    height: 24px;
}
.home-services-summary h3 .sdf-text-label {
    width: 320px;
    height: 26px;
}
.home-domain span .sdf-text-body-large {
    width: 260px;
    height: 22px;
    max-width: 100%;
}
.home-portfolio-year {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-portfolio-year .sdf-text-caption {
    width: 80px;
    height: 14px;
}

/* About definition list */
.home-about dt {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-about dt .sdf-text-label {
    width: 110px;
    height: 22px;
}
.home-about dd {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-about dd .sdf-text-body-large {
    width: 320px;
    height: 24px;
    max-width: 100%;
}

/* Gallery / short body text */
.home-body .sdf-text-body-large {
    width: 360px;
    height: 28px;
    max-width: 100%;
}

/* HomeLink CTA */
.home-link {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.home-link .sdf-text-link {
    width: 220px;
    height: 22px;
}

/* ── Font demo page — 15 family × 39 variant showcase ────── */
.font-demo {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}
.font-demo-header {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(15, 26, 46, 0.12);
    padding-bottom: 1.6rem;
}
.font-demo-title {
    line-height: 0;
    display: inline-flex;
}
.font-demo-title .sdf-text-biz-udpgothic-bold {
    width: 620px;
    height: 64px;
    max-width: 92vw;
}
.font-demo-subtitle {
    line-height: 0;
    display: inline-flex;
}
.font-demo-subtitle .sdf-text-m-plus-1p-regular {
    width: 520px;
    height: 24px;
    max-width: 92vw;
}
.font-demo-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(15, 26, 46, 0.06);
}
.font-demo-group-heading {
    line-height: 0;
    display: inline-flex;
    margin-bottom: 0.4rem;
}
.font-demo-group-heading .sdf-text-biz-udgothic-bold {
    width: 320px;
    height: 32px;
}
.font-demo-family {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed rgba(15, 26, 46, 0.06);
}
.font-demo-family-name {
    line-height: 0;
    display: inline-flex;
}
.font-demo-family-name .sdf-text-m-plus-1p-regular {
    width: 480px;
    height: 20px;
    max-width: 92vw;
}
.font-demo-family-line {
    line-height: 0;
    display: inline-flex;
}
/* Every family sample line — target 44 px height, 720 px width, scales to viewport */
.font-demo-family-line canvas {
    width: 780px;
    height: 44px;
    max-width: 96vw;
}
.font-demo-footer {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(15, 26, 46, 0.12);
}
.font-demo-footer-note {
    line-height: 0;
    display: inline-flex;
}
.font-demo-footer-note .sdf-text-m-plus-1p-regular {
    width: 540px;
    height: 20px;
}
.font-demo-footer-tagline {
    line-height: 0;
    display: inline-flex;
}
.font-demo-footer-tagline .sdf-text-biz-udpgothic-regular {
    width: 640px;
    height: 32px;
    max-width: 92vw;
}

/* ── Footer ─────────────────────────────────────── */
.site-footer {
    background: #0f1a2e;
    color: #d0d8ec;
    padding: 2.5rem 2rem 1.5rem;
}
.site-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.site-footer-brand strong {
    display: block;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.3rem;
}
.site-footer-brand p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.75;
}
.site-footer-copy {
    font-size: 0.8rem;
    opacity: 0.55;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Playground (interactive typography) ────────── */
.playground {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.playground-stage {
    border-radius: 14px;
    padding: 2rem 1rem;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: background 0.3s ease;
}
.playground-canvas {
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.playground-stage-inner {
    position: relative;
    display: block;
    width: min(900px, 92vw);
    height: 140px;
}
.playground-stage-inner canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.playground-stage-particles {
    pointer-events: none;
}
.playground-stage-inner.playground-clickable {
    cursor: crosshair;
}

/* ── Content pages — Phase B.5 ───────────────────────────────────── */

.content-page {
    padding: 4rem 1.5rem 5rem;
    min-height: 60vh;
}
.content-wrap {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.content-hero h1 {
    margin: 0 0 0.6rem;
    line-height: 1.2;
}
.content-hero .lead {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2a3550;
    max-width: 720px;
    margin: 0;
}
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.content-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.content-card {
    padding: 1.4rem 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.content-card strong { font-size: 1.05rem; }
.content-card p     { margin: 0; color: #4a5570; font-size: 0.95rem; line-height: 1.6; }
.content-card .year { color: #8794b0; font-size: 0.85rem; letter-spacing: 0.06em; }
.content-list dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.6rem 1.2rem;
    margin: 0;
}
.content-list dt { color: #8794b0; font-size: 0.9rem; letter-spacing: 0.05em; }
.content-list dd { margin: 0; color: #0f1a2e; }
.content-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: 640px;
    padding: 1.4rem 1.2rem;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.content-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: #4a5570;
}
.content-form input,
.content-form textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 8px;
    background: #f8f8f5;
    color: #0f1a2e;
}
.content-form textarea { min-height: 140px; resize: vertical; }
.content-cta {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    background: #0f1a2e;
    color: #f5efe0;
    text-decoration: none;
    font-weight: 600;
    width: fit-content;
}
.content-cta:hover { background: #1a4dcc; }
@media (max-width: 720px) {
    .content-grid,
    .content-grid-3 { grid-template-columns: 1fr; }
    .content-list dl { grid-template-columns: 1fr; gap: 0.2rem 0; }
    .content-list dt { margin-top: 0.6rem; }
}

/* ── Gallery — Phase B.4 ─────────────────────────────────────────── */

.gallery {
    max-width: 1200px;
    margin: 3rem auto 4rem;
    padding: 0 1.5rem;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.gallery-card {
    border-radius: 12px;
    padding: 1.2rem 0.8rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 8 / 3;
    overflow: hidden;
}
.gallery-card-stage {
    line-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-card-stage .playground-stage-inner {
    width: 100%;
    height: 100%;
}
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
.playground-controls {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 46, 0.08);
}
.playground-input {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 8px;
    background: #f8f8f5;
    color: #0f1a2e;
    font-family: inherit;
    box-sizing: border-box;
}
.playground-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.playground-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 8px;
    background: #f8f8f5;
    color: #0f1a2e;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.playground-btn:hover {
    background: #efeee9;
}
.playground-btn.active {
    background: #0f1a2e;
    color: #f5efe0;
    border-color: #0f1a2e;
}
.playground-btn-effect {
    padding: 0.45rem 0.7rem;
    font-size: 1.1rem;
    min-width: 2.3rem;
}
.playground-colors {
    gap: 1rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(15, 26, 46, 0.08);
}
.playground-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4a5570;
}
.playground-swatch input[type="color"] {
    width: 44px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(15, 26, 46, 0.14);
    border-radius: 6px;
    cursor: pointer;
}

/* β.4.a / β.4.b — auth UI */
.account-widget {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.account-name {
    font-size: 0.9rem;
    color: #0f1a2e;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-login-btn,
.account-logout-btn {
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(15, 26, 46, 0.18);
    border-radius: 6px;
    background: #fff;
    color: #0f1a2e;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1.2;
}
.account-login-btn:hover,
.account-logout-btn:hover {
    background: #f4f6fa;
}

/* β.4.b — LoginModal */
.login-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 46, 0.55);
    display: flex;
    align-items: flex-start;      /* prevent modal from overflowing above viewport when tall */
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 4vh 1rem;
    overflow-y: auto;             /* backdrop scrolls when content taller than viewport */
}
.login-modal {
    position: relative;
    max-width: 22rem;
    width: 100%;
    max-height: calc(100vh - 8vh); /* cap so it never exceeds viewport minus backdrop padding */
    overflow-y: auto;             /* modal itself scrolls internally when content overflows */
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    margin: auto 0;               /* re-center vertically when short enough */
}
.login-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    background: none;
    border: none;
    color: #4a5570;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.login-modal-close:hover {
    color: #0f1a2e;
}
.login-modal-title {
    margin: 0 0 1.1rem;
    font-size: 1.15rem;
    color: #0f1a2e;
    font-weight: 600;
}
.login-provider-btn {
    display: block;
    width: 100%;
    margin-bottom: 0.55rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid rgba(15, 26, 46, 0.18);
    border-radius: 8px;
    background: #fff;
    color: #0f1a2e;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.12s ease;
}
.login-provider-btn:hover {
    background: #f4f6fa;
}
.login-provider-github {
    background: #0f1a2e;
    color: #fff;
    border-color: #0f1a2e;
}
.login-provider-github:hover {
    background: #1a2540;
}
.login-provider-google {
    background: #fff;
    color: #0f1a2e;
}
.login-modal-divider {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0;
    color: #8794b0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.login-modal-divider::before,
.login-modal-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(15, 26, 46, 0.12);
}
.login-email-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.login-email-label {
    font-size: 0.75rem;
    color: #4a5570;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.login-email-input {
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(15, 26, 46, 0.18);
    border-radius: 8px;
    font-size: 0.95rem;
    color: #0f1a2e;
    background: #fff;
}
.login-email-input:focus {
    outline: 2px solid rgba(15, 26, 46, 0.35);
    outline-offset: 1px;
}
.login-email-feedback {
    margin: 0.6rem 0 0;
    min-height: 1.2rem;
    font-size: 0.82rem;
    color: #4a5570;
}
.login-email-feedback-ok {
    color: #1c6b3a;
}
.login-email-feedback-err {
    color: #a12727;
}

/* β.4.a — ConsentBanner */
.consent-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 28rem;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(15, 26, 46, 0.18);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    z-index: 900;
}
.consent-banner-text {
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
    color: #2a3550;
    line-height: 1.4;
}
.consent-banner-actions {
    display: flex;
    gap: 0.5rem;
}
.consent-btn {
    flex: 1;
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(15, 26, 46, 0.18);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}
.consent-btn-primary {
    background: #0f1a2e;
    color: #fff;
    border-color: #0f1a2e;
}
.consent-btn-primary:hover {
    background: #1a2540;
}
.consent-btn-secondary {
    background: #fff;
    color: #0f1a2e;
}
.consent-btn-secondary:hover {
    background: #f4f6fa;
}

/* ── /account (β.4.d.1 GDPR minimal) ─────────────────────────────── */
.account-page {
    max-width: 720px;
    margin: 3rem auto 5rem;
    padding: 0 1.5rem;
    color: #0f1a2e;
}
.account-page-head h1 {
    font-size: clamp(1.6rem, 3vw, 2rem);
    margin: 0 0 0.4rem;
}
.account-page .muted {
    color: #6a7690;
    font-size: 0.95rem;
    margin: 0 0 2rem;
}
.account-anon {
    padding: 2rem;
    text-align: center;
    background: rgba(15, 26, 46, 0.04);
    border-radius: 12px;
}
.account-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1.2rem;
    padding: 1rem 1.2rem;
    margin: 0 0 2rem;
    background: rgba(15, 26, 46, 0.04);
    border-radius: 10px;
    font-size: 0.9rem;
}
.account-facts dt {
    color: #6a7690;
    font-family: monospace;
}
.account-facts dd {
    margin: 0;
    font-family: monospace;
}
.account-actions {
    display: grid;
    gap: 1.2rem;
}
.account-action-card {
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(15, 26, 46, 0.12);
    border-radius: 12px;
    background: #fff;
}
.account-action-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}
.account-action-card p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #2a3550;
    line-height: 1.5;
}
.account-warn {
    color: #8a4a1a;
    background: rgba(255, 200, 130, 0.18);
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem !important;
}
.account-action-card-danger {
    border-color: rgba(180, 40, 40, 0.4);
}
.account-action-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 26, 46, 0.24);
    background: #fff;
    color: #0f1a2e;
    font-size: 0.9rem;
    cursor: pointer;
}
.account-action-btn:hover:not(:disabled) {
    background: #f4f6fa;
}
.account-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.account-action-btn-danger {
    background: #b42828;
    color: #fff;
    border-color: #b42828;
}
.account-action-btn-danger:hover:not(:disabled) {
    background: #931f1f;
}
.account-error {
    color: #b42828;
    font-size: 0.85rem;
    margin: 0.6rem 0 0 !important;
}
.account-name-link {
    color: inherit;
    text-decoration: none;
}
.account-name-link:hover .account-name {
    text-decoration: underline;
}

/* ── delete confirm modal ────────────────────────────────────────── */
.delete-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 26, 46, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem;
    overflow-y: auto;
}
.delete-modal {
    background: #fff;
    border-radius: 12px;
    padding: 1.6rem 1.8rem;
    max-width: 460px;
    width: 100%;
    max-height: calc(100vh - 8vh);
    overflow-y: auto;
    margin: auto 0;
    box-shadow: 0 20px 60px rgba(15, 26, 46, 0.28);
}
.delete-modal h2 {
    margin: 0 0 0.8rem;
    font-size: 1.15rem;
    color: #0f1a2e;
}
.delete-modal .account-warn {
    margin: 0 0 1rem;
}
.delete-confirm-label {
    display: block;
    font-size: 0.85rem;
    color: #2a3550;
    margin: 0 0 0.5rem;
}
.delete-confirm-phrase {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.15rem 0.4rem;
    background: rgba(15, 26, 46, 0.08);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}
.delete-confirm-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin: 0 0 1rem;
    border: 1px solid rgba(15, 26, 46, 0.24);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: monospace;
    box-sizing: border-box;
}
.delete-modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* ── LoginGate (β.4.e login-gated 秘匿層) ─────────────────────────── */
.login-gate {
    margin: 2rem 0;
}
.login-gate-open {
    /* children rendered as-is; no visual distortion */
}
.login-gate-locked {
    padding: 2.4rem 1.5rem;
    background: rgba(15, 26, 46, 0.04);
    border: 1px dashed rgba(15, 26, 46, 0.25);
    border-radius: 14px;
    text-align: center;
}
.login-gate-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}
.login-gate-icon {
    font-size: 2rem;
    color: rgba(15, 26, 46, 0.55);
    line-height: 1;
}
.login-gate-copy {
    margin: 0;
    color: #2a3550;
    font-size: 0.95rem;
    line-height: 1.55;
}
.login-gate-copy strong {
    color: #0f1a2e;
    font-weight: 600;
}
.login-gate-btn {
    padding: 0.6rem 1.4rem;
    border: 1px solid #0f1a2e;
    background: #0f1a2e;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}
.login-gate-btn:hover {
    background: #1a2540;
}

/* Gated section markers — used by rd / portfolio / font_demo. */
.content-gated-section {
    margin: 3rem 0 0;
}
.content-gated-head {
    margin: 0 0 1.4rem;
    text-align: center;
}
.content-gated-head h2 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    color: #0f1a2e;
}
.content-gated-head .lead {
    margin: 0;
    color: #6a7690;
    font-size: 0.9rem;
}
.content-card-gated {
    position: relative;
}
.content-card-gated::before {
    content: "⟢";
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    color: rgba(15, 26, 46, 0.28);
    font-size: 0.85rem;
    line-height: 1;
}
.font-demo-gated {
    margin: 3rem 0 0;
}

/* ── β.4.e Level 2: gated fetch state placeholders ──────────────── */
.content-gated-status {
    text-align: center;
    padding: 2rem;
    color: #6a7690;
    font-size: 0.9rem;
    background: rgba(15, 26, 46, 0.03);
    border-radius: 10px;
    margin: 0;
}
.content-gated-status-error {
    color: #b42828;
    background: rgba(180, 40, 40, 0.05);
}

/* ── β.4.c: Cross-device linking UI ──────────────────────────────── */
.account-devices,
.account-link {
    margin: 3rem 0 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}
.account-devices h2,
.account-link h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    color: #0f1a2e;
}
.account-devices .muted {
    margin: 0 0 1.4rem;
}
.device-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}
.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    background: #fff;
    border: 1px solid rgba(15, 26, 46, 0.12);
    border-radius: 10px;
}
.device-item.device-current {
    border-color: rgba(15, 26, 46, 0.32);
    background: #f4f6fa;
}
.device-facts {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    flex: 1;
}
.device-did {
    font-family: monospace;
    font-size: 0.85rem;
    color: #2a3550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.device-badge {
    font-size: 0.75rem;
    color: #6a7690;
    background: rgba(15, 26, 46, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.account-link .account-action-card {
    margin: 0 0 1.2rem;
}
.account-link h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #0f1a2e;
}
.link-code-display {
    margin: 1rem 0 0;
    padding: 1rem 1.2rem;
    background: #0f1a2e;
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.link-code-display code {
    font-family: monospace;
    font-size: 2.2rem;
    letter-spacing: 0.3em;
    font-weight: 500;
}
.link-code-ttl {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    font-family: monospace;
}
.link-code-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    margin: 0 0 0.8rem;
    border: 1px solid rgba(15, 26, 46, 0.24);
    border-radius: 8px;
    font-size: 1.25rem;
    font-family: monospace;
    text-align: center;
    letter-spacing: 0.2em;
    box-sizing: border-box;
}
.account-success {
    color: #106a3f;
    font-size: 0.85rem;
    margin: 0.6rem 0 0 !important;
}
.link-anon-hint {
    font-size: 0.8rem !important;
    margin-top: 0.6rem !important;
}

/* ── β.4.d.2: k-anonymity dashboard ──────────────────────────────── */
.account-anonymity {
    margin: 3rem auto 0;
    max-width: 720px;
    padding: 0 1.5rem;
}
.account-anonymity h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    color: #0f1a2e;
}
.account-anonymity .muted {
    margin: 0 0 1.4rem;
}
.account-anonymity .account-action-card {
    margin: 0 0 1.2rem;
}
.anonymity-facts {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem 1.2rem;
    margin: 0 0 1rem;
    font-size: 0.9rem;
}
.anonymity-facts dt {
    color: #6a7690;
}
.anonymity-facts dd {
    margin: 0;
    font-family: monospace;
    color: #0f1a2e;
    text-align: right;
}
.anonymity-ok {
    color: #106a3f;
    background: rgba(16, 106, 63, 0.06);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 0;
}
.anonymity-warn {
    color: #8a4a1a;
    background: rgba(255, 200, 130, 0.18);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 0;
}

/* ── β.5 — hero welcome back recognition ─────────────────────────── */
.home-hero-welcome-back {
    margin: 0.4rem 0 0;
    opacity: 0.7;
    font-size: 0.85rem;
}
