/* =====================================================================
   Eclab - site.css
   モノクロ基調のまま、タイポグラフィ・余白・陰影・微細な動きで質感を上げる。
   HTML 構造は変更していないため、セレクタは従来どおり。
   ===================================================================== */

/* ===== Design Tokens ===== */
:root {
    /* surface / background */
    --bg:            #f7f8f9;
    --bg-deep:       #f1f3f5;
    --surface:       #ffffff;
    --surface-2:     #fbfbfc;

    /* ink scale */
    --ink:           #0d0f12;
    --ink-body:      #1b1f24;
    --ink-muted:     #5f666e;
    --ink-subtle:    #878e97;
    --ink-faint:     #aab0b8;

    /* lines */
    --line:          #e7e9ec;
    --line-strong:   #d5d9de;
    --line-soft:     #f0f1f3;

    /* accent - インタラクション時に控えめに使う */
    --accent:        #0f766e;
    --accent-soft:   rgba(15, 118, 110, 0.10);

    /* elevation */
    --shadow-xs:  0 1px 2px rgba(13, 15, 18, 0.04);
    --shadow-sm:  0 1px 2px rgba(13, 15, 18, 0.04), 0 2px 8px rgba(13, 15, 18, 0.04);
    --shadow-md:  0 2px 4px rgba(13, 15, 18, 0.04), 0 10px 28px rgba(13, 15, 18, 0.08);
    --shadow-lg:  0 4px 8px rgba(13, 15, 18, 0.04), 0 18px 50px rgba(13, 15, 18, 0.11);

    /* radii */
    --r-sm:   0.5rem;
    --r-md:   0.875rem;
    --r-lg:   1.25rem;
    --r-pill: 999px;

    /* motion */
    --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.30, 1);

    /* type */
    --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
                 "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
    --font-serif: Cardo, Georgia, "Times New Roman", serif;

    /* layout */
    --maxw:   1100px;
    --gutter: 2rem;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    background: var(--bg);
    color: var(--ink-body);
    line-height: 1.7;
    letter-spacing: 0.005em;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}

p { margin: 0; padding: 0; }

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }

img { max-width: 100%; display: block; }

::selection { background: var(--ink); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== Header / Nav ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
    .site-header {
        background: rgba(255, 255, 255, 0.72);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        backdrop-filter: saturate(180%) blur(14px);
    }
}

.site-nav { width: 100%; }

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0.9rem var(--gutter);
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s var(--ease);
}
.site-logo:hover { opacity: 0.7; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links .nav-link {
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-muted);
    padding: 0.35rem 0;
    transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

/* ホバーで下線が伸びる */
.nav-links .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.28s var(--ease-out);
}

.nav-links .nav-link:hover {
    color: var(--ink);
    opacity: 1;
}
.nav-links .nav-link:hover::after { transform: scaleX(1); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r-sm);
    transition: background 0.2s var(--ease);
}
.nav-toggle:hover { background: var(--line-soft); }
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-right: 0.25rem;
    padding: 0.2rem;
    background: var(--bg-deep);
    border-radius: var(--r-pill);
}

.lang-btn {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-pill);
    color: var(--ink-subtle);
    transition: color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.lang-btn:hover { color: var(--ink); opacity: 1; }
.lang-btn.active {
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

/* Login partial inside nav */
.nav-links ul.navbar-nav {
    display: flex;
    flex-direction: row;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}
.nav-links ul.navbar-nav .nav-link { padding: 0; }

/* ===== Main / Container ===== */
.container-site {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

main { flex: 1; }

/* ===== Hero ===== */
.hero {
    position: relative;
    z-index: 0;
    isolation: isolate;
    padding: 7rem var(--gutter) 6rem;
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4.5rem;
}

/* 全幅のアンビエント背景 */
.hero::before {
    content: "";
    position: absolute;
    z-index: -2;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    background:
        radial-gradient(58% 78% at 12% -5%, rgba(15, 118, 110, 0.07), transparent 62%),
        radial-gradient(48% 68% at 88% 8%, rgba(13, 15, 18, 0.055), transparent 62%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 78%);
}

/* 細いグリッド。中心から外へフェードさせる */
.hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(13, 15, 18, 0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 15, 18, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 35%, #000 0%, transparent 78%);
    mask-image: radial-gradient(70% 60% at 50% 35%, #000 0%, transparent 78%);
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-image {
    flex: 1;
    min-width: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.hero-title {
    font-size: clamp(2.4rem, 5.4vw, 3.9rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: 1.4rem;
    color: var(--ink);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .hero-title {
        background: linear-gradient(176deg, var(--ink) 38%, #434a52 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.hero-subtitle {
    font-size: 1.06rem;
    line-height: 1.85;
    color: var(--ink-muted);
    max-width: 30rem;
    margin-bottom: 2.4rem;
    text-wrap: pretty;
}

/* ===== Primary button ===== */
.btn-primary-site {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.7rem;
    background: linear-gradient(180deg, #2a2f36 0%, var(--ink) 100%);
    color: #fff;
    border-radius: var(--r-pill);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(13, 15, 18, 0.22), 0 6px 18px rgba(13, 15, 18, 0.16);
    transition: transform 0.22s var(--ease-out), box-shadow 0.28s var(--ease), filter 0.22s var(--ease);
}

/* 矢印は擬似要素で付与（マークアップ変更なし） */
.btn-primary-site::after {
    content: "\2192";
    font-size: 0.95em;
    line-height: 1;
    transition: transform 0.28s var(--ease-out);
}

.btn-primary-site:hover {
    color: #fff;
    opacity: 1;
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(13, 15, 18, 0.2), 0 14px 32px rgba(13, 15, 18, 0.22);
}
.btn-primary-site:hover::after { transform: translateX(4px); }
.btn-primary-site:active { transform: translateY(0); }

/* ===== Section ===== */
.section {
    padding: 5.5rem var(--gutter);
    max-width: var(--maxw);
    margin: 0 auto;
}

.section-divider {
    border: none;
    height: 1px;
    max-width: var(--maxw);
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    color: var(--ink);
}

/* 見出し上の小さなアクセントバー */
.section-title::before {
    content: "";
    display: block;
    width: 38px;
    height: 3px;
    border-radius: 2px;
    margin-bottom: 1.1rem;
    background: linear-gradient(90deg, var(--accent), rgba(15, 118, 110, 0.22));
}

.section-desc {
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1.85;
    max-width: 38rem;
    margin-bottom: 2.5rem;
    text-wrap: pretty;
}

/* ===== Service Card ===== */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    counter-reset: svc;
}

.service-card {
    position: relative;
    counter-increment: svc;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1.9rem 1.75rem;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/* 連番は CSS カウンタで生成（HTML は変更なし） */
.service-card::before {
    content: "0" counter(svc);
    display: block;
    margin-bottom: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

/* 上辺のアクセントライン（ホバーで伸びる） */
.service-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(15, 118, 110, 0.15));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s var(--ease-out);
}

.service-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.service-card:hover::after { transform: scaleX(1); }

.service-card h3 {
    font-size: 1.08rem;
    letter-spacing: -0.015em;
    margin-bottom: 0.6rem;
}

.service-card p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--ink-muted);
}

/* ===== Manual Card (clickable) ===== */
.manual-card {
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1.9rem 1.75rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s var(--ease-out), border-color 0.22s var(--ease), box-shadow 0.25s var(--ease);
}

.manual-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    color: inherit;
    opacity: 1;
}

.manual-card h3 {
    font-size: 1.05rem;
    letter-spacing: -0.015em;
    margin-bottom: 0.55rem;
    padding-right: 2.75rem;
}

.manual-card .post-card-date { margin-bottom: 0; }

/* 矢印を円形ボタン風に */
.manual-card-arrow {
    position: absolute;
    top: 1.65rem;
    right: 1.65rem;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    line-height: 1;
    border-radius: 50%;
    color: var(--ink-subtle);
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: color 0.22s var(--ease), background 0.22s var(--ease),
                border-color 0.22s var(--ease), transform 0.25s var(--ease-out);
}

.manual-card:hover .manual-card-arrow {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
    transform: translateX(3px);
}

/* 「すべてのマニュアルを見る」 */
.section .mt-3 .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    padding: 0.55rem 1.15rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--surface);
    transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease), transform 0.22s var(--ease-out);
}
.section .mt-3 .nav-link:hover {
    opacity: 1;
    border-color: var(--ink);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* ===== Posts Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease), border-color 0.22s var(--ease);
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.post-card-image {
    width: calc(100% + 3rem);
    margin: -1.5rem -1.5rem 1rem;
    display: block;
    height: 180px;
    object-fit: cover;
}

.post-card-date {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-faint);
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.post-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.post-card-excerpt {
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

a.post-card-link { display: block; color: inherit; text-decoration: none; }
a.post-card-link:hover { opacity: 1; }
a.post-card-link:hover .post-card {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ===== Page Content ===== */
.page-content {
    max-width: 50rem;
    margin: 0 auto;
    padding: 4.5rem var(--gutter) 5rem;
}

.page-content h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.page-content h2 {
    font-size: 1.25rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--ink);
}

.page-content p {
    color: var(--ink-body);
    margin-bottom: 1rem;
    line-height: 1.9;
}

/* ===== Post Detail ===== */
.post-detail {
    max-width: 50rem;
    margin: 0 auto;
    padding: 2.5rem var(--gutter) 4.5rem;
}

.post-detail-hero img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    margin-bottom: 2.25rem;
    display: block;
}

.post-detail-category {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-subtle);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    padding: 0.25rem 0.8rem;
    margin-bottom: 1rem;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.post-detail-category:hover { color: var(--ink); border-color: var(--ink); opacity: 1; }

.post-detail-title {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
}

.post-detail-date {
    font-size: 0.8rem;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.post-detail-content { line-height: 1.95; color: var(--ink-body); }
.post-detail-content p { margin-bottom: 1.3rem; }
.post-detail-content h2 {
    font-size: 1.35rem;
    margin: 2.75rem 0 0.9rem;
}
.post-detail-content h3 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
.post-detail-content h4 { font-size: 1rem; margin: 1.6rem 0 0.5rem; color: var(--ink); }
.post-detail-content img {
    max-width: 100%;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    margin: 1.5rem 0;
}
.post-detail-content ul, .post-detail-content ol { padding-left: 1.4rem; margin-bottom: 1.3rem; }
.post-detail-content li { margin-bottom: 0.45rem; }
.post-detail-content a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--ink-faint);
    transition: text-decoration-color 0.2s var(--ease);
}
.post-detail-content a:hover { text-decoration-color: var(--ink); opacity: 1; }
.post-detail-content strong { font-weight: 600; color: var(--ink); }
.post-detail-content table {
    box-shadow: var(--shadow-xs);
    border-radius: var(--r-sm);
    overflow: hidden;
}

/* ===== Company Table ===== */
.company-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.company-table th,
.company-table td {
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.94rem;
}

.company-table tr:last-child th,
.company-table tr:last-child td { border-bottom: none; }

.company-table th {
    font-weight: 600;
    color: var(--ink);
    width: 30%;
    background: var(--surface-2);
}

.company-table td { color: var(--ink-body); background: var(--surface); }

/* ===== Breadcrumb ===== */
.site-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--ink-subtle);
    margin: 0 auto 1.5rem;
    padding: 1.75rem var(--gutter) 0;
    max-width: 50rem;
    flex-wrap: wrap;
}
.site-breadcrumb a {
    color: var(--ink-subtle);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}
.site-breadcrumb a:hover { color: var(--ink); opacity: 1; }
.site-breadcrumb .sep {
    color: var(--ink-faint);
    font-size: 0.72rem;
    user-select: none;
}
.site-breadcrumb .current {
    color: var(--ink-body);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40ch;
}

/* ===== Footer ===== */
.site-footer {
    position: relative;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 3.5rem var(--gutter) 1.75rem;
    margin-top: 5rem;
}

.footer-container {
    display: flex;
    gap: 4.5rem;
    max-width: var(--maxw);
    margin: 0 auto 2.25rem;
}

.footer-heading {
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.9rem;
    color: var(--ink-faint);
}

.footer-col a {
    font-size: 0.88rem;
    color: var(--ink-muted);
    display: block;
    margin-bottom: 0.5rem;
    width: fit-content;
    transition: color 0.18s var(--ease), transform 0.18s var(--ease-out);
}

.footer-col a:hover {
    color: var(--ink);
    opacity: 1;
    transform: translateX(2px);
}

.footer-copy {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
}

.footer-copy p {
    font-size: 0.78rem;
    color: var(--ink-faint);
    letter-spacing: 0.01em;
}

/* ===== Motion ===== */
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
    /* ヒーローは読み込み時に段階的に立ち上げる */
    .hero-title       { animation: rise 0.85s var(--ease-out) 0.02s both; }
    .hero-subtitle    { animation: rise 0.85s var(--ease-out) 0.12s both; }
    .btn-primary-site { animation: rise 0.85s var(--ease-out) 0.20s both; }
    .hero-image       { animation: rise 1s var(--ease-out) 0.28s both; }

    /* スクロール連動。非対応ブラウザでは通常表示のまま */
    @supports (animation-timeline: view()) {
        .section-title,
        .section-desc,
        .service-card,
        .manual-card,
        .post-card {
            animation: reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 42%;
        }
    }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .hero { gap: 3rem; padding: 5rem var(--gutter) 4rem; }
    .footer-container { gap: 3rem; }
}

@media (max-width: 640px) {
    :root { --gutter: 1.5rem; }

    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem var(--gutter) 1.5rem;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        gap: 1rem;
    }
    .nav-links.open { display: flex; }
    .site-header { position: relative; }

    .lang-switcher { margin-top: 0.25rem; }

    .hero {
        padding: 3.5rem var(--gutter) 3rem;
        flex-direction: column;
        gap: 2.5rem;
    }
    .hero-image { width: 100%; }
    .hero-subtitle { margin-bottom: 2rem; }

    .section { padding: 3.5rem var(--gutter); }
    .service-grid, .posts-grid { gap: 1rem; }
    .service-card, .manual-card { padding: 1.5rem 1.35rem; }
    .manual-card h3 { padding-right: 2.5rem; }
    .manual-card-arrow { top: 1.3rem; right: 1.3rem; }

    .footer-container { flex-direction: column; gap: 2rem; }
    .site-footer { margin-top: 3.5rem; }
}

/* ===== Form Utilities (Bootstrap overrides) ===== */
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--accent);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

/* =====================================================================
   Manual（アプリのマニュアル）
   左に目次を固定し、本文は読みやすい幅にする。目次は本文の h2・h3 から manual.js が作る。
   本文の HTML は管理画面（Summernote）で書くので、部品はクラス名だけで使えるようにする。
     <p class="lead">              … 冒頭の要約
     <span class="ui">発行する</span> … 画面のボタン・メニューの名前
     <ol class="steps">            … 番号つきの手順
     <figure class="shot"><img …><figcaption>…</figcaption></figure> … スクリーンショット（押すと拡大）
     <div class="callout callout-tip">（callout-warning / callout-note）<p class="callout-title">ヒント</p>…</div>
     <div class="faq"><h3>質問</h3><p>答え</p>…</div> … よくある質問
     <dl class="facts"><div><dt>料金</dt><dd>…</dd></div>…</dl> … アプリの要点
     <div class="manual-cta"><a class="btn-primary-site" href="…">…</a><span class="manual-cta-note">…</span></div> … App Store へのボタン
     <p class="manual-note">       … 画面の例についての断り書きなど、控えめな注記
   見出し（h2・h3）に id を付けると、その id がリンクの先になる（無ければ s1、s1-2 のように付ける）。
   画像には width・height 属性（CSS の px）を付ける。その大きさを上限に、本文の幅まで縮めて表示する。
   ===================================================================== */
.manual {
    /* 上に固定されるヘッダーの高さぶん、目次と見出しの止まる位置を下げる（スマホではヘッダーが固定されない） */
    --manual-offset: 6rem;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0.5rem var(--gutter) 4.5rem;
}

/* パンくずは、マニュアルの見出しと左をそろえる */
.manual .site-breadcrumb { max-width: none; margin: 0 0 0.25rem; padding: 1.75rem 0 0; }

.manual-header {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.4rem 0 1.9rem;
    margin-bottom: 2.4rem;
    border-bottom: 1px solid var(--line);
}

.manual-icon {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
    background: var(--surface);
}

.manual-eyebrow {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-subtle);
    margin-bottom: 0.3rem;
}

.manual-title {
    font-size: clamp(1.55rem, 3.4vw, 2.15rem);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 0.45rem;
}

.manual-date {
    font-size: 0.8rem;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.manual-layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 3.25rem;
    align-items: start;
}

/* 見出しの無い記事は目次を出さず、本文を中央に */
.manual-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.manual-layout.no-toc .manual-toc { display: none; }
.manual-layout.no-toc .manual-main { margin: 0 auto; }

.manual-toc {
    position: sticky;
    top: var(--manual-offset);
    max-height: calc(100vh - var(--manual-offset) - 1.5rem);
    overflow-y: auto;
    padding: 0.25rem 0.25rem 1rem 0;
}

.manual-toc-title {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-subtle);
    margin-bottom: 0.7rem;
}

.manual-toc ol,
.manual-toc-mobile ol { list-style: none; padding: 0; margin: 0; }

.manual-toc a {
    display: block;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--ink-muted);
    padding: 0.36rem 0.8rem;
    border-left: 2px solid var(--line);
    text-decoration: none;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.manual-toc a:hover { color: var(--ink); opacity: 1; }
.manual-toc a.active {
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--accent);
    background: var(--accent-soft);
}

/* h3 は、読んでいる h2 の下だけ開く（長い記事でも目次が短く済む） */
.manual-toc .toc-sub { display: none; }
.manual-toc li.open > .toc-sub { display: block; }
.manual-toc .toc-sub a { padding-left: 1.65rem; font-size: 0.8rem; }

.manual-toc-mobile { display: none; }

.manual-main { max-width: 46rem; min-width: 0; }

.manual-back { margin-top: 3rem; }

/* ----- 本文 ----- */
.manual-content h2 {
    scroll-margin-top: var(--manual-offset);
    font-size: 1.4rem;
    letter-spacing: -0.015em;
    margin: 3.25rem 0 1rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
}
.manual-content > h2:first-child,
.manual-content > .lead + h2 { margin-top: 1.5rem; }
.manual-content h3 { scroll-margin-top: var(--manual-offset); font-size: 1.1rem; margin: 2.2rem 0 0.65rem; }
.manual-content h4 { scroll-margin-top: var(--manual-offset); }

.manual-content .heading-anchor {
    margin-left: 0.45rem;
    font-weight: 400;
    color: var(--ink-faint);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}
.manual-content h2:hover .heading-anchor,
.manual-content h3:hover .heading-anchor,
.manual-content .heading-anchor:focus { opacity: 1; }

.manual-content .lead {
    font-size: 1.04rem;
    line-height: 1.95;
    color: var(--ink);
}

/* 画面のボタン・メニューの名前 */
.manual-content .ui {
    display: inline-block;
    font-size: 0.86em;
    font-weight: 600;
    line-height: 1.55;
    color: var(--ink);
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 0.4rem;
    padding: 0 0.45rem;
    margin: 0 0.1rem;
}

/* 番号つきの手順 */
.manual-content ol.steps { list-style: none; counter-reset: step; padding-left: 0; margin: 1.2rem 0 1.7rem; }
.manual-content ol.steps > li {
    counter-increment: step;
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: 0.95rem;
}
.manual-content ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.12rem;
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

/* App Store などへのボタン（冒頭に置く） */
.manual-content .manual-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.1rem;
    margin: 1.4rem 0 1.9rem;
}
.manual-content .manual-cta .btn-primary-site { color: #fff; text-decoration: none; }
.manual-content .manual-cta-note { font-size: 0.84rem; color: var(--ink-muted); }

/* 画面の例についての断り書きなど、本文より控えめな注記 */
.manual-content .manual-note { font-size: 0.84rem; line-height: 1.8; color: var(--ink-muted); }

.manual-content code {
    white-space: nowrap;
    font-size: 0.86em;
    padding: 0.08rem 0.35rem;
    border-radius: 0.3rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink);
}

/* スクリーンショット（押すと拡大）。width・height 属性の大きさを上限に、本文の幅まで縮める */
.manual-content figure.shot { margin: 1.6rem 0 2.1rem; }
.manual-content figure.shot img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    background: var(--surface);
}
.manual-content figure.shot.narrow img { max-width: 440px; }
.manual-content figure.shot figcaption {
    margin-top: 0.7rem;
    font-size: 0.84rem;
    line-height: 1.7;
    color: var(--ink-muted);
}
.manual-content img { cursor: zoom-in; }

/* 注意・ヒント・補足 */
.manual-content .callout {
    margin: 1.4rem 0 1.8rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--ink-subtle);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    line-height: 1.85;
}
.manual-content .callout > :last-child { margin-bottom: 0; }
.manual-content .callout p { margin-bottom: 0.6rem; }
.manual-content .callout-title {
    font-weight: 700;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    color: var(--ink);
    margin-bottom: 0.3rem !important;
}
.manual-content .callout-tip { border-left-color: var(--accent); background: #f2f8f7; }
.manual-content .callout-warning { border-left-color: #b45309; background: #fdf8ef; }

/* 表（インラインの style を持たない表。持つ表はその指定が勝つ） */
.manual-content .table-scroll {
    overflow-x: auto;
    margin: 1.25rem 0 1.7rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.manual-content .table-scroll table { margin: 0 !important; box-shadow: none; border-radius: 0; }
.manual-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.7; }
.manual-content th,
.manual-content td { padding: 0.7rem 0.95rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.manual-content thead th { background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 0.86rem; white-space: nowrap; }
.manual-content tbody th { font-weight: 600; font-size: 0.88rem; color: var(--ink); white-space: nowrap; }
.manual-content tbody tr:last-child td,
.manual-content tbody tr:last-child th { border-bottom: none; }

/* アプリの要点 */
.manual-content dl.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0 2rem;
}
.manual-content dl.facts > div {
    padding: 0.9rem 1.05rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-xs);
}
.manual-content dl.facts dt { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-subtle); margin-bottom: 0.25rem; }
.manual-content dl.facts dd { margin: 0; font-size: 0.92rem; line-height: 1.65; color: var(--ink); }

/* よくある質問 */
.manual-content .faq h3 {
    position: relative;
    padding-left: 2rem;
    font-size: 1.02rem;
    margin-top: 1.9rem;
}
.manual-content .faq h3::before {
    content: "Q";
    position: absolute;
    left: 0;
    top: 0.05rem;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--accent);
}
.manual-content .faq h3 ~ p,
.manual-content .faq h3 ~ ul { padding-left: 2rem; }

/* ----- 画像の拡大 ----- */
.manual-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(13, 15, 18, 0.8);
    cursor: zoom-out;
}
.manual-lightbox img {
    max-width: min(1500px, 100%);
    max-height: 100%;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    background: #fff;
}

@media (max-width: 960px) {
    .manual-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .manual-toc { display: none; }
    .manual-main { max-width: none; }
    .manual-toc-mobile {
        display: block;
        margin-bottom: 2rem;
        border: 1px solid var(--line);
        border-radius: var(--r-sm);
        background: var(--surface);
    }
    .manual-layout.no-toc .manual-toc-mobile { display: none; }
    .manual-toc-mobile summary { padding: 0.85rem 1.05rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
    .manual-toc-mobile ol { padding: 0 1.05rem 0.9rem; }
    .manual-toc-mobile a { display: block; padding: 0.38rem 0; font-size: 0.88rem; color: var(--ink-muted); text-decoration: none; }
    /* スマホの目次は大見出し（h2）だけにして短くする */
    .manual-toc-mobile .toc-sub { display: none; }
}

@media (max-width: 640px) {
    .manual { --manual-offset: 1rem; }
    .manual-content dl.facts { grid-template-columns: minmax(0, 1fr); }
    /* 列の多い表は、列を細く詰めずに横へスクロールさせる */
    .manual-content th,
    .manual-content td { min-width: 6.5em; }
    .manual-header { align-items: flex-start; }
    .manual-icon { width: 52px; height: 52px; border-radius: 13px; }
    .manual-content h2 { font-size: 1.25rem; }
}

/* ----- マニュアルの一覧（アイコンと説明つきのカード） ----- */
.manual-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start; }
.manual-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    border: 1px solid var(--line);
    object-fit: cover;
    background: var(--surface);
}
.manual-card-icon.placeholder {
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink-subtle);
    background: var(--surface-2);
}
.manual-card-excerpt {
    font-size: 0.86rem;
    line-height: 1.75;
    color: var(--ink-muted);
    margin: 0.1rem 0 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
