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

:root {
    --color-primary:   #2f363d;
    --color-primary-d: #1a1a1a;
    --color-accent:    #7fa0b5;
    --color-accent-d:  #5a7f99;
    --color-hero-bg:   #d5dce3;
    --color-text:      #2d2d2d;
    --color-text-sub:  #666;
    --color-bg:        #eeeeee;
    --color-bg-alt:    #eeeeee;
    --color-border:    #d0d0cc;
    --color-white:     #fff;
    --font-base: 'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'BIZ UDMincho Medium', 'Yu Mincho', serif;
    --font-sans: "游ゴシック体", "Yu Gothic", "YuGothic", "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", sans-serif;
    --container-max: 860px;
    --radius: 6px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --transition: .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.8;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--color-accent-d); text-decoration: underline; transition: color var(--transition); }
a:hover { color: var(--color-primary); }

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.4;
}

/* ===== Layout ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ===== Site Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: calc(var(--container-max) + 2.5rem);
    margin: 0 auto;
    padding: .75rem 1.25rem;
    gap: 1rem;
}

.site-logo {
    text-decoration: none;
    color: var(--color-white);
    opacity: .85;
    display: flex;
    align-items: baseline;
    font-size: 1.35rem;
    font-family: var(--font-base);
    font-weight: 700;
    letter-spacing: .05em;
}
.site-logo:hover { color: rgba(255,255,255,.75); }
.site-logo-kanji { font-size: 1.35rem; }
.site-logo-kana  { font-size: 1.1rem; }

/* Nav */
.site-nav ul { list-style: none; display: flex; gap: 1.5rem; }
.site-nav a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: .875rem;
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.site-nav a:hover, .site-nav a.active {
    color: #fff;
    border-bottom-color: rgba(255,255,255,.6);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

/* ===== Hero ===== */
.hero {
    background: var(--color-hero-bg);
    color: var(--color-text);
    text-align: center;
    padding: 5rem 1.25rem 4rem;
}

.hero-inner { max-width: var(--container-max); margin: 0 auto; }

.hero-lead {
    font-family: var(--font-base);
    font-size: 2rem;
    letter-spacing: .1em;
    color: var(--color-primary);
    margin-bottom: .1rem;
    text-align: center;
    font-weight: bold;
}

.hero-title {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 1rem;
}
.hero-kanji { font-size: clamp(2.5rem, 8vw, 4rem); font-family: var(--font-base); font-weight: 900; letter-spacing: .08em; color: var(--color-primary); }
.hero-kana  { font-size: clamp(2rem, 6.5vw, 3.5rem); font-family: var(--font-base); font-weight: 700; color: var(--color-primary); }

.hero-desc {
    font-size: clamp(1rem, 3vw, 1.2rem);
    line-height: 1.9;
    color: var(--color-text);
    margin-bottom: 2rem;
    font-weight: 700;
}

.hero-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}
.badge-link img { height: 3rem; }

/* ===== Sections ===== */
.page-content {}

.content-section {
    padding: 3.5rem 0;
    background: var(--color-bg);
}
.content-section--alt { background: var(--color-bg-alt); }

.section-title {
    font-size: clamp(1.4rem, 4vw, 1.6rem);
    color: var(--color-primary);
    border-left: 4px solid var(--color-primary);
    padding-left: .75rem;
    margin-bottom: 1.75rem;
    letter-spacing: 4px;
}

.section-note {
    color: var(--color-text-sub);
    font-size: .9rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.container h3 {
    font-size: 1.1rem;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--color-primary);
    margin: 2rem 0 .75rem;
}

.container p { margin-bottom: 1em; letter-spacing: 2px; }
.container ul, .container ol { margin-left: 1.5rem; margin-bottom: 1em; }
.container li { margin-bottom: .4em; }

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.feature-card h3 {
    font-size: 1rem;
    color: var(--color-primary);
    margin: 0 0 .6rem;
    border: none;
    padding: 0;
}
.feature-card p { margin: 0; font-size: .95rem; }

/* Getting started */
.getting-started-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

/* Setup card (single white card per column) */
.setup-card {
    background: var(--color-white);
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
}

/* Setup steps (vertical list inside card) */
.setup-step {
    text-align: left;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.setup-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setup-step-number {
    display: inline-block;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    font-family: var(--font-sans);
    line-height: 1.6rem;
    text-align: center;
    margin-right: .4rem;
    vertical-align: middle;
    letter-spacing: 0;
}

.setup-step-text {
    font-size: .85rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0 0 .75rem;
    letter-spacing: .5px;
}

.setup-step-img {
    margin: 0 auto;
    max-width: 180px;
}

.setup-step-img img {
    width: 100%;
    height: auto;
}

.globe-icon {
    font-size: .9rem;
    vertical-align: middle;
}

/* Setup text steps (Android) */
.setup-text-steps {
    margin-left: 1.5rem;
    margin-bottom: 0;
}
.setup-text-steps li {
    margin-bottom: .5em;
    line-height: 1.7;
}
.setup-text-steps li:last-child {
    margin-bottom: 0;
}

/* Spec table column width classes */
.spec-table-col--half { width: 50%; }
.spec-table-col--quarter { width: 25%; }
.spec-table-col--fill { width: auto; }

/* Spec table 3-column (項目 / iPhone / Android) */
.spec-table--3col { table-layout: auto; }

/* Tables */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }

.spec-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .9rem;
    font-family: var(--font-sans);
}
.spec-table th, .spec-table td {
    border: none;
    border-bottom: 1px solid #000;
    padding: .55rem .85rem;
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
    word-break: break-word;
}
.spec-table thead th {
    font-weight: 700;
    border-bottom: 3px solid #000;
}

/* Related list */
.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem 2rem;
}
.related-list li { padding: .35rem 0; }
.related-list li::before { content: '→ '; color: var(--color-accent-d); }

@media (max-width: 640px) {
    .related-list { grid-template-columns: 1fr; }
}

/* ===== Breadcrumb ===== */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; font-size: .82rem; margin-bottom: 1.5rem; margin-left: 0; font-family: var(--font-sans); }
.breadcrumb li + li::before { content: '/'; margin-right: .3rem; color: var(--color-text-sub); }
.breadcrumb a { color: var(--color-accent-d); }

/* ===== Page title (inner pages) ===== */
.page-title {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

/* ===== Prose ===== */
.prose-section { margin-bottom: 2.5rem; }
.prose-section h2 {
    font-size: 1.35rem;
    color: var(--color-primary);
    border-left: 4px solid var(--color-primary);
    padding-left: .75rem;
    margin-bottom: 1rem;
}
.prose-body { font-size: .95rem; }
.prose-body p { margin-bottom: 1em; }
.prose-body ul, .prose-body ol { margin-left: 1.5rem; margin-bottom: 1em; }
.prose-body table { border-collapse: collapse; width: 100%; margin-bottom: 1em; font-size: .88rem; }
.prose-body th, .prose-body td { border: 1px solid var(--color-border); padding: .45rem .7rem; }
.prose-body thead th { background: var(--color-primary); color: #fff; }

/* ===== Release notes ===== */
.release-note-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}
.release-note-heading { font-size: 1.1rem; margin-bottom: .5rem; }
.release-note-date { font-weight: normal; font-size: .85rem; color: var(--color-text-sub); margin-left: .5rem; }

/* Release notes / Development history table */
.spec-table--changelog {
    table-layout: auto;
}
/* Release notes: version column */
.spec-table-col--ver {
    width: 5.5em;
}
/* Release notes: date column */
.spec-table-col--date {
    width: 8em;
}
/* Development history: date column (narrower) */
.spec-table-col--date-narrow {
    width: 8em;
}
/* Privacy policy revision history: 和暦の年月日を折り返さない幅 */
.spec-table-col--date-wide {
    width: 11em;
}

.spec-table td ul,
.spec-table td ol {
    margin: 0;
    padding-left: 1.2rem;
}
.spec-table td li {
    margin-bottom: .2em;
}
.spec-table td li:last-child {
    margin-bottom: 0;
}

/* Spec spelling: examples table */
.spec-table--examples {
    table-layout: auto;
}
.spec-table-col--label {
    width: 6em;
    white-space: nowrap;
}

/* ===== Contact form ===== */


.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 700;
    font-family: var(--font-sans);
    margin-bottom: .4rem;
    color: var(--color-text);
}
.required { color: #c00; margin-left: .2rem; }
.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--color-white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:not([type="radio"]):not([type="checkbox"]):focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(43,43,43,.12);
}
.form-group textarea { resize: vertical; }

.form-label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 600;
}
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
}
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: normal;
    cursor: pointer;
}
.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}
.form-submit { margin-top: 1.5rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: .65rem 1.75rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), transform .1s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-d); color: #fff; }

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
    font-size: .9rem;
}
.alert ul { margin: .4rem 0 0 1.2rem; }
.alert--success { background: #d4edda; border: 1px solid #a3d9b0; color: #155724; }
.alert--error   { background: #fde8e8; border: 1px solid #f5c6c6; color: #721c24; }

/* ===== Revision History (Policy) =====
   履歴そのものは他ページと同じ .spec-table で表示する。
   色で意味を持たせず、地の文と区別できる程度の装飾に留める。 */

/* 改定前後の対照（履歴表の「内容」欄に置く引用） */
.revision-diff {
    display: grid;
    gap: .7rem;
    margin: .7rem 0 .2rem;
}

.revision-quote {
    margin: 0;
}

/* 地味な見出し */
.revision-quote-label {
    font-family: var(--font-sans);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--color-text-sub);
    margin-bottom: .3rem;
}

/* 引用であることが分かる本文（左の罫と字下げのみで示す） */
.revision-quote-body {
    margin: 0;
    padding: .1rem 0 .1rem .8rem;
    border-left: 3px solid var(--color-border);
    font-size: .88rem;
    line-height: 1.9;
}

/* ===== Back link ===== */
.back-link { margin-top: 2.5rem; font-family: var(--font-sans); font-size: .9rem; }

/* ===== Site Footer ===== */
.site-footer {
    background: var(--color-primary-d);
    color: rgba(255,255,255,.65);
    padding: 2.5rem 1.25rem;
    margin-top: 3rem;
    font-family: var(--font-sans);
    font-size: .85rem;
}
.site-footer-inner { max-width: var(--container-max); margin: 0 auto; text-align: center; }

.site-footer-logo { margin-bottom: 1rem; }
.site-footer-logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    font-family: var(--font-base);
    font-weight: 700;
}

.footer-nav ul { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem 1.25rem; margin-bottom: 1rem; }
.footer-nav a { color: rgba(255,255,255,.65); text-decoration: none; }
.footer-nav a:hover { color: #fff; }

.site-footer-copy { opacity: .5; font-size: .8rem; }

/* ===== Page content wrapper (inner pages) ===== */
.page-content > .container {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

/* ===== Glyph correction tool (字形補正ファイル作成) ===== */
.gc-note {
    font-size: .85rem;
    color: var(--color-text-sub);
    margin: .75rem 0 1.5rem;
}

.gc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.gc-file-input { display: none; }
.gc-file-label { text-align: center; }

.gc-btn--danger {
    background: #fff;
    color: #b02a2a;
    border-color: #b02a2a;
}
.gc-btn--danger:hover { background: #b02a2a; color: #fff; }

.gc-btn--secondary {
    background: #fff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.gc-btn--secondary:hover { background: var(--color-primary); color: #fff; }

.gc-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    margin-bottom: 1rem;
}
.gc-search-input {
    flex: 1 1 16rem;
    padding: .6rem .85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--color-white);
}
.gc-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(43,43,43,.12);
}
.gc-configured-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--font-sans);
    font-size: .875rem;
    cursor: pointer;
    white-space: nowrap;
}
.gc-font-field {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-sans);
    font-size: .875rem;
    white-space: nowrap;
}
.gc-font-select {
    padding: .5rem .6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .875rem;
    font-family: var(--font-sans);
    background: var(--color-white);
}
.gc-font-custom {
    flex: 1 1 12rem;
    padding: .55rem .8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: var(--font-sans);
    background: var(--color-white);
}

.gc-status {
    font-family: var(--font-sans);
    font-size: .85rem;
    color: var(--color-text-sub);
    margin-bottom: .75rem;
}

/* テーブル */
.gc-table-wrap {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.gc-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
    font-family: var(--font-sans);
    font-size: .9rem;
}
.gc-table th, .gc-table td {
    border-bottom: 1px solid var(--color-border);
    padding: .5rem .75rem;
    text-align: left;
    vertical-align: middle;
}
.gc-table thead th {
    font-weight: 700;
    border-bottom: 2px solid var(--color-primary);
    background: var(--color-white);
}
.gc-table tbody tr:last-child td { border-bottom: none; }
.gc-col-code { width: 6.5em; white-space: nowrap; font-family: var(--font-sans); }
.gc-col-char {
    width: 3em;
    font-size: 1.6rem;
    font-family: var(--gc-glyph-font, var(--font-base));
    text-align: center;
}
.gc-row--configured .gc-col-code { font-weight: 700; }
.gc-empty { text-align: center; color: var(--color-text-sub); padding: 2rem 1rem; }

/* 字形選択ボタン */
.gc-variants {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: stretch;
}
.gc-variant {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .3rem .5rem .2rem;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.gc-variant:hover { border-color: var(--color-accent-d); }
.gc-variant--selected {
    border-color: var(--color-primary);
    background: var(--color-hero-bg);
}
.gc-variant--unregistered { border-style: dashed; border-color: #b02a2a; }
.gc-variant-glyph {
    font-size: 1.75rem;
    line-height: 1.2;
    font-family: var(--gc-glyph-font, var(--font-base));
}
.gc-variant-label {
    font-size: .7rem;
    color: var(--color-text-sub);
    font-family: var(--font-sans);
}
.gc-variant--selected .gc-variant-label { color: var(--color-primary); font-weight: 700; }
.gc-novariant {
    font-size: .8rem;
    color: var(--color-text-sub);
    align-self: center;
}

/* ページング（横いっぱいに均等配置） */
.gc-pagination {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: .3rem;
    margin: 1rem 0;
    font-family: var(--font-sans);
}
.gc-page {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .15rem;
    padding: .35rem .4rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.gc-page:hover:not(:disabled) { border-color: var(--color-accent-d); }
.gc-page:disabled { opacity: .35; cursor: default; }
.gc-page--current {
    border-color: var(--color-primary);
    background: var(--color-hero-bg);
    font-weight: 700;
}
.gc-page--nav {
    flex: 0 0 auto;
    justify-content: center;
    font-size: 1rem;
    padding: .35rem .7rem;
}
.gc-page-num { font-size: .9rem; line-height: 1.2; }
.gc-page-range {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    max-width: 100%;
    color: var(--color-text-sub);
}
.gc-page-glyph {
    font-family: var(--gc-glyph-font, var(--font-base));
    font-size: 1.05rem;
    line-height: 1.2;
    color: var(--color-text);
}
.gc-page-tilde { font-size: .7rem; }
.gc-page-ellipsis { flex: 0 0 auto; align-self: center; color: var(--color-text-sub); padding: 0 .1rem; }

.gc-code {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    font-size: .85rem;
    overflow-x: auto;
}

@media (max-width: 640px) {
    .gc-variants { gap: .3rem; }
    .gc-variant-glyph { font-size: 1.5rem; }
    .gc-controls { gap: .6rem .75rem; }
    .gc-font-field { flex: 1 1 100%; }
    .gc-font-select { flex: 1 1 auto; }
    .gc-pagination { gap: .2rem; }
    .gc-page { padding: .3rem .15rem; }
    .gc-page-num { font-size: .78rem; }
    .gc-page-glyph { font-size: .9rem; }
    .gc-page-tilde { display: none; }
    .gc-page--nav { padding: .3rem .45rem; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--color-primary-d);
        padding: 1rem 1.25rem 1.5rem;
    }
    .site-nav.is-open { display: block; }
    .site-nav ul { flex-direction: column; gap: .75rem; }
    .nav-toggle { display: flex; }

    .hero { padding: 3rem 1rem 2.5rem; }
    .hero-lead { font-size: 1.2rem; }

    .content-section { padding: 2.5rem 0; }

    .getting-started-grid { grid-template-columns: 1fr; }

    .features-grid { grid-template-columns: 1fr; }

}
