/*
 * Laibra UI: サービス全体で使う共通スタイル。
 * 色・文字・余白の値はここだけで定義する。画面ごとの <style> で :root を上書きしない。
 * Bootstrap を読み込む画面では、Bootstrap の後に読み込むこと。
 */

/* ---------- 値 ---------- */
:root {
    --paper: #F7F5EF;
    --white: #FFFFFF;
    --ink: #15151C;
    --ink-2: #43423E;
    --muted: #6C6B66;
    --line: rgba(21, 21, 28, 0.16);
    --line-strong: rgba(21, 21, 28, 0.3);
    --yellow: #FFE81A;
    --blue: #2196F3;
    --blue-ink: #0B62C4;
    --red: #D8341F;
    --green: #17804A;

    --f-sans: "Archivo", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    --f-pixel: "DotGothic16", "M PLUS 1 Code", monospace;
    --f-code: "M PLUS 1 Code", ui-monospace, Menlo, Consolas, monospace;

    --gutter: clamp(20px, 3.4vw, 48px);
    --max: 1440px;
    --header-h: 64px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- 土台 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--f-sans);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* 日本語の組版(文字詰め、文節での改行、禁則)。ほかの言語では効かせない */
:lang(ja) { font-feature-settings: "palt"; word-break: auto-phrase; line-break: strict; }

::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

a { color: inherit; }
img, svg { display: block; }
code, pre, kbd, samp, textarea { font-family: var(--f-code); font-feature-settings: normal; word-break: normal; }

.wrap {
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* コードのコメント風のラベル */
.tag {
    margin: 0;
    font-family: var(--f-pixel);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.06em;
    font-feature-settings: normal;
    color: var(--muted);
}
.tag b { font-weight: 400; color: var(--ink); }

/* 状態を示す小さな札 */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 5px;
    border: 1px solid var(--ink);
    font-family: var(--f-pixel);
    font-size: 12px;
    font-weight: 400;
    font-feature-settings: normal;
    letter-spacing: 0.08em;
    line-height: 1;
    white-space: nowrap;
    color: var(--ink);
    justify-self: start;
}
.chip-ink { background: var(--ink); color: var(--yellow); }
.chip-yellow { background: var(--yellow); }
.chip-blue { background: var(--blue); }
.chip-quiet { border-color: var(--line-strong); color: var(--muted); }

/* ---------- ボタン ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7em;
    min-height: 56px;
    padding: 12px 28px;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    font-family: var(--f-sans);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover, .btn:focus { box-shadow: none; }
.btn:disabled, .btn.disabled { opacity: 0.4; cursor: not-allowed; }
.btn .arw { display: inline-block; transition: transform 0.25s var(--ease); }
.btn:hover .arw { transform: translateX(5px); }

.btn-ink, .btn-primary, .btn-dark {
    background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.btn-ink:hover, .btn-primary:hover, .btn-dark:hover,
.btn-primary:focus, .btn-primary:active, .btn-dark:focus, .btn-dark:active {
    background: var(--yellow); border-color: var(--ink); color: var(--ink);
}
.btn-line, .btn-secondary, .btn-light,
.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark {
    background: transparent; border-color: var(--ink); color: var(--ink);
}
.btn-line:hover, .btn-secondary:hover, .btn-light:hover,
.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-dark:hover,
.btn-secondary:focus, .btn-secondary:active, .btn-outline-primary:active, .btn-outline-secondary:active {
    background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.btn-yellow, .btn-warning, .btn-success {
    background: var(--yellow); border-color: var(--ink); color: var(--ink);
}
.btn-yellow:hover, .btn-warning:hover, .btn-success:hover,
.btn-warning:focus, .btn-success:focus, .btn-warning:active, .btn-success:active {
    background: var(--ink); border-color: var(--ink); color: var(--yellow);
}
.btn-danger, .btn-outline-danger {
    background: transparent; border-color: var(--red); color: var(--red);
}
.btn-danger:hover, .btn-outline-danger:hover, .btn-danger:focus, .btn-danger:active {
    background: var(--red); border-color: var(--red); color: var(--white);
}
.btn-link {
    min-height: 0; padding: 0; border: 0;
    font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px;
    color: var(--ink);
}
.btn-link:hover { color: var(--blue-ink); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn-lg { min-height: 64px; padding: 14px 36px; font-size: 18px; }

.link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5em;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 6px;
}
.link .arw { display: inline-block; transition: transform 0.25s var(--ease); }
.link:hover .arw { transform: translateX(5px); }

/* ---------- ロゴ ---------- */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-sans);
    font-size: 22px;
    font-weight: 800;
    font-stretch: 105%;
    letter-spacing: -0.02em;
    line-height: 1;
    text-decoration: none;
    color: var(--ink);
}
.logo svg { width: 30px; height: 30px; }
.logo:hover { color: var(--ink); }

/* ---------- アプリの枠(ログイン後) ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.app-header-inner {
    display: flex;
    align-items: center;
    gap: clamp(20px, 3vw, 48px);
    height: var(--header-h);
}
.app-nav { display: flex; gap: clamp(16px, 2.2vw, 32px); margin-right: auto; }
.app-nav a {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    line-height: var(--header-h);
    text-decoration: none;
    color: var(--ink);
}
.app-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 18px;
    height: 1.5px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.app-nav a:hover::after, .app-nav a.is-active::after { transform: scaleX(1); }
.app-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    padding: 0;
    border: 1.5px solid transparent;
    background: none;
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.15s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .count {
    position: absolute;
    top: 2px; right: 0;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: var(--red);
    color: var(--white);
    font-family: var(--f-pixel);
    font-size: 11px;
    font-feature-settings: normal;
    line-height: 16px;
    text-align: center;
}

.user-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 6px 0 12px;
    border: 1.5px solid transparent;
    background: none;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--ink); }
.user-btn .initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: var(--ink);
    color: var(--yellow);
    font-size: 13px;
    font-weight: 700;
}
.user-btn .name { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-menu-btn { display: none; }
.app-menu-btn span {
    display: block;
    width: 22px; height: 2px;
    margin: 5px auto;
    background: var(--ink);
}

.app-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    padding: 6px var(--gutter);
    background: var(--yellow);
    border-bottom: 1.5px solid var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}
.app-banner.is-alert { background: var(--red); color: var(--white); border-bottom-color: var(--red); }
.app-banner.is-alert .btn { border-color: var(--white); color: var(--white); }
.app-banner form { margin: 0; }

.app-main {
    padding-block: clamp(32px, 4vw, 56px) clamp(72px, 9vw, 144px);
    min-height: calc(100vh - var(--header-h));
}

/* お知らせのドロップダウン */
.notification-dropdown { width: min(380px, calc(100vw - 2 * var(--gutter))); padding: 0; }
.notification-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notification-header .btn-link { font-size: 13px; }
.notification-body { max-height: 420px; overflow-y: auto; }
.notification-empty { margin: 0; padding: 28px 16px; font-size: 14px; text-align: center; color: var(--muted); }
.notification-item { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notification-item:hover { background: rgba(255, 232, 26, 0.35); }
.notification-item.unread { border-left: 6px solid var(--yellow); padding-left: 10px; }
.notification-time { font-family: var(--f-pixel); font-size: 12px; font-feature-settings: normal; line-height: 1.4; color: var(--muted); }
.notification-title { margin-top: 2px; font-size: 14px; font-weight: 900; line-height: 1.6; }
.notification-text { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.user-mail { margin: 0; padding: 8px 18px; font-family: var(--f-pixel); font-size: 12px; font-feature-settings: normal; color: var(--muted); }

/* 操作の結果を知らせるメッセージ */
.flash { margin: 0 0 clamp(20px, 2.4vw, 32px); padding: 0; list-style: none; }
.flash li { padding: 14px 18px; border: 1.5px solid var(--ink); border-left-width: 8px; background: var(--white); font-size: 15px; font-weight: 700; line-height: 1.7; }
.flash li + li { margin-top: 8px; }
.flash .is-success { border-left-color: var(--green); }
.flash .is-warning { border-left-color: var(--yellow); }
.flash .is-error { border-left-color: var(--red); }
.flash .is-info { border-left-color: var(--blue); }

/* ページの見出し */
.page-head { padding-bottom: clamp(24px, 2.8vw, 40px); }
.page-head .crumbs { display: flex; flex-wrap: wrap; gap: 0 0.6em; }
.page-head .crumbs a { color: var(--muted); text-decoration: none; }
.page-head .crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.page-title {
    margin: 12px 0 0;
    font-size: clamp(1.75rem, 2.8vw, 2.6rem);
    font-weight: 900;
    font-stretch: 92%;
    line-height: 1.25;
    letter-spacing: -0.04em;
}
.page-lead { margin: 16px 0 0; max-width: 44em; color: var(--ink-2); }
.page-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.section-title {
    margin: 0;
    font-size: clamp(1.15rem, 1.4vw, 1.35rem);
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

/* 罫線で区切る一覧 */
.rows { margin: 0; padding: 0; list-style: none; border-top: 1.5px solid var(--ink); }
.rows > li { border-bottom: 1px solid var(--line); }
.row-link {
    display: grid;
    align-items: center;
    gap: 12px 24px;
    padding: 18px 12px 18px 0;
    color: var(--ink);
    text-decoration: none;
    background: linear-gradient(var(--yellow), var(--yellow)) no-repeat left / 0 100%;
    transition: background-size 0.35s var(--ease), padding 0.35s var(--ease);
}
a.row-link:hover { background-size: 100% 100%; padding-left: 14px; color: var(--ink); }
.row-link .arw { font-size: 22px; transition: transform 0.3s var(--ease); }
a.row-link:hover .arw { transform: translateX(6px); }

/* 大きな数字 */
.figure {
    margin: 0;
    font-size: clamp(2.2rem, 3.4vw, 3.2rem);
    font-weight: 800;
    font-stretch: 84%;
    line-height: 1;
    letter-spacing: -0.05em;
    white-space: nowrap;
}
.figure small { margin-left: 0.3em; font-size: 0.34em; font-weight: 700; font-stretch: 100%; letter-spacing: 0; }

/* 数字を横に並べる */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: var(--gutter); margin: 0; padding: 0; list-style: none; border-top: 1.5px solid var(--ink); }
.stats > li { padding: 16px 0 clamp(20px, 2.4vw, 32px); border-bottom: 1px solid var(--line); }
.stats .figure { margin-top: 10px; }

/* 本文と補助の2段組み */
.split { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: clamp(48px, 6vw, 80px); align-items: start; }
.split > .main { grid-column: 1 / span 8; min-width: 0; }
.split > .side { grid-column: 9 / span 4; min-width: 0; }
.block { margin-top: clamp(48px, 6vw, 88px); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; }

/* 進み具合 */
.meter { height: 6px; background: var(--line); }
.meter > span { display: block; height: 100%; background: var(--ink); }

/* 何もないとき */
.empty { padding: clamp(32px, 5vw, 64px) 0; border-bottom: 1px solid var(--line); }
.empty p { margin: 0 0 20px; color: var(--muted); }

/* ---------- 公開ページの枠(ログイン前) ---------- */
/* Bootstrap を使わない画面(body.site)では、見出し・段落・リストの既定の余白を消す */
:where(.site) :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure) { margin: 0; }
:where(.site) :where(ul, ol) { padding: 0; list-style: none; }
:where(.site) :where(button) { font: inherit; color: inherit; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: var(--header-h);
}
.site-header .logo { justify-self: start; }
.site-nav { display: flex; gap: clamp(16px, 2.2vw, 32px); }
.site-nav a {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    line-height: var(--header-h);
    text-decoration: none;
    white-space: nowrap;
}
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 18px;
    height: 1.5px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }
.site-nav .is-dim { color: var(--muted); font-weight: 500; }
.site-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }

.site-menu-btn {
    display: none;
    justify-self: end;
    width: 44px; height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.site-menu-btn span {
    display: block;
    width: 24px; height: 2px;
    margin: 6px auto;
    background: var(--ink);
    transition: transform 0.25s var(--ease);
}
.site-menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.site-menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.site-menu {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    padding: 24px var(--gutter) 32px;
    background: var(--ink);
    color: var(--paper);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
}
.site-menu.is-open { visibility: visible; opacity: 1; }
.site-menu .site-nav { flex-direction: column; gap: 0; }
.site-menu .site-nav a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid rgba(247, 245, 239, 0.2);
    font-size: 26px;
    font-weight: 900;
    line-height: 1.4;
    color: var(--paper);
    white-space: normal;
}
.site-menu .site-nav a::after { display: none; }
.site-menu .site-nav .is-dim { color: rgba(247, 245, 239, 0.6); }
.site-menu-actions { display: grid; gap: 12px; margin-top: auto; padding-top: 32px; }
.site-menu-actions .btn { border-color: var(--paper); color: var(--paper); }
.site-menu-actions .btn-yellow { color: var(--ink); border-color: var(--yellow); }

/* 見出しを左、本文を右に置くセクション */
.sec { padding: clamp(72px, 9vw, 144px) 0; border-top: 1px solid var(--line); }
.sec-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gutter);
    align-items: start;
}
.sec-head { grid-column: 1 / span 4; position: sticky; top: calc(var(--header-h) + 32px); }
.sec-body { grid-column: 5 / span 8; min-width: 0; }
.sec-title {
    margin: 18px 0 0;
    font-size: clamp(2rem, 3.3vw, 3.2rem);
    font-weight: 900;
    font-stretch: 92%;
    line-height: 1.3;
    letter-spacing: -0.045em;
}
.sec-sub { margin: 20px 0 0; max-width: 26em; color: var(--muted); }
.sec-head .link { margin-top: 28px; }
.sec.is-yellow { background: var(--yellow); border-top: 0; }
.sec.is-blue { background: var(--blue); border-top: 0; }
.sec.is-yellow + .sec, .sec.is-blue + .sec { border-top: 0; }
.sec.is-yellow .tag, .sec.is-yellow .sec-sub, .sec.is-blue .tag, .sec.is-blue .sec-sub { color: rgba(21, 21, 28, 0.66); }

/* ページの最後(呼びかけとフッター) */
.site-end { background: var(--ink); color: var(--paper); }
.site-end .tag { color: rgba(247, 245, 239, 0.55); }
.end-cta { padding-block: clamp(80px, 10vw, 160px); }
.end-title {
    margin: 20px 0 0;
    font-size: clamp(2.6rem, 9.4vw, 8.4rem);
    font-weight: 900;
    font-stretch: 92%;
    line-height: 1.16;
    letter-spacing: -0.06em;
}
.end-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; margin-top: clamp(28px, 3vw, 44px); }
.end-row p { margin: 0; font-size: clamp(16px, 1.4vw, 19px); font-weight: 700; }
.site-end .btn-yellow { border-color: var(--yellow); }

.site-footer { padding: 32px 0 0; border-top: 1px solid rgba(247, 245, 239, 0.2); }
.site-footer-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 32px; }
.site-footer .logo { grid-column: 1 / span 4; align-self: start; color: var(--paper); }
.site-footer-col { grid-column: span 4; }
.site-footer-col a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.7;
    text-decoration: none;
    color: rgba(247, 245, 239, 0.78);
    transition: color 0.15s;
}
.site-footer-col a:hover { color: var(--yellow); }
.site-footer-col .is-dim { color: rgba(247, 245, 239, 0.45); }
.site-footer-col .tag { margin-bottom: 8px; }
.copyright { margin-top: clamp(40px, 5vw, 64px); padding: 20px 0 24px; border-top: 1px solid rgba(247, 245, 239, 0.12); text-align: right; }

/* 表示の動き。html に .js が付いているときだけ隠してから見せる */
@media (prefers-reduced-motion: no-preference) {
    .js .rise { opacity: 0; transform: translateY(28px); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 90ms + 80ms); }
    @keyframes rise { to { opacity: 1; transform: none; } }
    .js .rv { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
    .js .rv.is-in { opacity: 1; transform: none; }
}

/* 1枚ものの画面(ログイン、登録、完了、エラー) */
.plain { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
.plain-header { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.plain-main { display: grid; align-content: center; padding-block: clamp(32px, 6vw, 88px); }
.plain-box { width: 100%; max-width: 520px; margin-inline: auto; }
.plain-box.is-wide { max-width: 760px; }
.plain-title {
    margin: 14px 0 0;
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    font-weight: 900;
    font-stretch: 92%;
    line-height: 1.2;
    letter-spacing: -0.05em;
}
.plain-lead { margin: 16px 0 0; color: var(--ink-2); }
.plain-form { display: grid; gap: 20px; margin-top: clamp(28px, 3.4vw, 40px); }
.plain-form .btn { width: 100%; }
.plain-links { display: grid; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.plain-footer { padding-block: 20px; }

/* ---------- 入力 ---------- */
.form-label, label.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--ink);
}
.form-control, .form-select {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background-color: var(--white);
    box-shadow: none;
    color: var(--ink);
    font-family: var(--f-sans);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    transition: box-shadow 0.15s;
}
.form-control::placeholder { color: #A9A8A2; }
.form-control:focus, .form-select:focus {
    border-color: var(--ink);
    box-shadow: 4px 4px 0 var(--yellow);
    outline: none;
}
.form-control:disabled, .form-control[readonly] { background-color: var(--paper); color: var(--muted); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--red); background-image: none; }
.form-text { margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.invalid-feedback, .errorlist { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--red); }
.form-check-input { border: 1.5px solid var(--ink); border-radius: 0; box-shadow: none; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.form-check-input:focus { box-shadow: 3px 3px 0 var(--yellow); border-color: var(--ink); }
.form-switch .form-check-input { border-radius: 0; }

/* ---------- Bootstrap の部品を同じ見た目にそろえる ---------- */
.card {
    border: 0;
    border-top: 1.5px solid var(--ink);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.card-header, .card-footer {
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0 !important;
    background: transparent;
    font-weight: 900;
}
.card-footer { border-top: 1px solid var(--line); border-bottom: 0; }
.card-body { padding: 20px 0; }

.alert {
    padding: 14px 18px;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: var(--white);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.7;
}
.alert-success { border-left: 8px solid var(--green); }
.alert-info, .alert-primary { border-left: 8px solid var(--blue); }
.alert-warning { border-left: 8px solid var(--yellow); }
.alert-danger { border-left: 8px solid var(--red); }

.badge {
    padding: 4px 8px 5px;
    border: 1px solid var(--ink);
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ink) !important;
    font-family: var(--f-pixel);
    font-size: 12px;
    font-weight: 400;
    font-feature-settings: normal;
    letter-spacing: 0.08em;
    line-height: 1;
}
.badge.bg-primary, .badge.bg-dark { background: var(--ink) !important; color: var(--yellow) !important; }
.badge.bg-warning, .badge.bg-success { background: var(--yellow) !important; }
.badge.bg-danger { border-color: var(--red); background: var(--red) !important; color: var(--white) !important; }

.breadcrumb {
    margin: 0;
    padding: 0;
    background: none;
    font-family: var(--f-pixel);
    font-size: 14px;
    font-feature-settings: normal;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.breadcrumb-item.active { color: var(--ink); }

.table { margin: 0; border-top: 1.5px solid var(--ink); color: var(--ink); }
.table > :not(caption) > * > * { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); background: transparent; box-shadow: none; }
.table > thead > tr > th {
    border-bottom: 1px solid var(--line-strong);
    font-family: var(--f-pixel);
    font-size: 13px;
    font-weight: 400;
    font-feature-settings: normal;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.table-hover > tbody > tr:hover > * { background: rgba(255, 232, 26, 0.35); }

.progress { height: 6px; border-radius: 0; background: var(--line); }
.progress-bar { background: var(--ink); }

.dropdown-menu {
    margin-top: 8px !important;
    padding: 6px 0;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: var(--white);
    box-shadow: 6px 6px 0 rgba(21, 21, 28, 0.12);
    font-size: 14px;
}
.dropdown-item { padding: 10px 18px; font-weight: 700; color: var(--ink); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--yellow); color: var(--ink); }
.dropdown-item.is-danger { color: var(--red); }
.dropdown-divider { margin: 6px 0; border-top: 1px solid var(--line); opacity: 1; }

.modal-content { border: 1.5px solid var(--ink); border-radius: 0; background: var(--paper); box-shadow: 10px 10px 0 rgba(21, 21, 28, 0.18); }
.modal-header, .modal-footer { border-color: var(--line); border-radius: 0; }
.modal-title { font-weight: 900; letter-spacing: -0.02em; }
.modal-backdrop.show { opacity: 0.55; background: var(--ink); }

.nav-tabs { border-bottom: 1.5px solid var(--ink); }
.nav-tabs .nav-link { margin: 0; border: 0; border-radius: 0; font-weight: 700; color: var(--muted); }
.nav-tabs .nav-link.active, .nav-tabs .nav-link:hover { background: var(--ink); color: var(--paper); }
.nav-pills .nav-link { border-radius: 0; font-weight: 700; color: var(--ink); }
.nav-pills .nav-link.active { background: var(--ink); color: var(--paper); }

.list-group-item { border-color: var(--line); border-radius: 0 !important; background: transparent; color: var(--ink); }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--blue-ink) !important; }
.text-danger { color: var(--red) !important; }
.spinner-border { border-width: 2px; color: var(--ink); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
    .app-nav, .user-btn .name { display: none; }
    .app-menu-btn { display: block; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
    .app-actions { gap: 2px; margin-left: auto; }
    .app-header-inner { gap: 8px; }
    .app-header.is-open .app-nav {
        position: fixed;
        inset: var(--header-h) 0 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 16px var(--gutter);
        background: var(--ink);
        overflow-y: auto;
    }
    .app-header.is-open .app-nav a {
        padding: 14px 0;
        border-bottom: 1px solid rgba(247, 245, 239, 0.2);
        font-size: 24px;
        font-weight: 900;
        line-height: 1.4;
        color: var(--paper);
    }
    .app-header.is-open .app-nav a::after { display: none; }
}
@media (max-width: 1080px) {
    .split > .main, .split > .side { grid-column: 1 / -1; }
    .site-header .site-nav, .site-actions { display: none; }
    .site-header-inner { grid-template-columns: 1fr auto; }
    .site-menu-btn { display: block; }
    .sec-head { grid-column: 1 / -1; position: static; }
    .sec-body { grid-column: 1 / -1; margin-top: 40px; }
}
@media (max-width: 720px) {
    body { font-size: 15px; }
    .page-actions .btn { flex: 1 1 100%; }
    .stats { grid-template-columns: 1fr 1fr; }
    .site-footer .logo, .site-footer-col { grid-column: 1 / -1; }
    .end-row .btn { flex: 1 1 100%; }
    .copyright { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- auth: ログイン・登録・完了画面で使う部品 ---------- */
/* .plain の子は grid item なので、.wrap の margin-inline: auto で幅が縮む。幅いっぱいに戻す */
.plain > .wrap { width: 100%; }
/* ボタンと補足を縦に並べる区画(完了画面など、フォームでない画面) */
.plain-actions { display: grid; gap: 12px; margin-top: clamp(28px, 3.4vw, 40px); }
.plain-actions .btn { width: 100%; }
/* フォームの中に出す入力エラーのまとめ */
.plain-form .flash { margin: 0; }
/* 入力欄を2列に並べる */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* 入力欄のまとまり(保護者・お子さまなど)。fieldset に付け、見出しは legend.tag で付ける */
.form-section { display: grid; gap: 20px; min-width: 0; margin: 12px 0 0; padding: 14px 0 0; border: 0; border-top: 1.5px solid var(--ink); }
.form-section > legend { float: left; width: 100%; padding: 0; }
.form-section > legend + * { clear: both; }
/* 送信ボタンの前の、規約への同意の一文 */
.terms-text { font-size: 13px; line-height: 1.7; color: var(--muted); }
.terms-text a { color: var(--ink); font-weight: 700; text-underline-offset: 4px; }
/* 何段かに分けた入力。JS が今の段に .active を付ける */
.form-step { display: none; }
.form-step.active { display: grid; gap: 20px; }
/* 送信中に文言を切り替えるボタン。JS が .is-busy を付ける */
.btn .btn-label { display: inline-flex; align-items: center; gap: 0.7em; }
.btn .btn-busy { display: none; }
.btn.is-busy .btn-label { display: none; }
.btn.is-busy .btn-busy { display: inline; }
/* 手順の位置(1/2 など)。JS が li に .active / .completed を付ける */
.steps { display: flex; gap: 20px; margin: 24px 0 0; padding: 0; list-style: none; }
.steps li { flex: 1; padding-top: 10px; border-top: 1.5px solid var(--line); font-family: var(--f-pixel); font-size: 14px; font-feature-settings: normal; letter-spacing: 0.06em; line-height: 1.4; color: var(--muted); }
.steps li.active { border-top-color: var(--ink); color: var(--ink); }
.steps li.completed { border-top-color: var(--ink); }
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ---------- public: 長い文章と、開閉する質問の一覧(規約・学習ガイド・法人向け) ---------- */
.prose { max-width: 45em; font-size: 16px; line-height: 2; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
    margin-top: 2.8em;
    padding-top: 18px;
    border-top: 1.5px solid var(--ink);
    font-size: clamp(1.3rem, 1.9vw, 1.6rem);
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: -0.02em;
}
.prose h3 { margin-top: 2em; font-size: 1.1rem; font-weight: 900; line-height: 1.6; }
.prose h2 + *, .prose h3 + * { margin-top: 0.8em; }
.prose ul, .prose ol { padding-left: 1.6em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li, .prose li > ul, .prose li > ol { margin-top: 0.4em; }
.prose li::marker { color: var(--muted); font-family: var(--f-pixel); font-feature-settings: normal; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose a:hover { color: var(--blue-ink); }
.prose strong { font-weight: 900; }
.prose table { width: 100%; border-collapse: collapse; border-top: 1.5px solid var(--ink); font-size: 15px; line-height: 1.8; }
.prose th, .prose td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 700; }
.prose pre { margin-top: 1.4em; padding: 20px 22px; background: var(--ink); color: var(--paper); overflow-x: auto; font-size: 14px; line-height: 1.8; overflow-wrap: normal; }
.prose .note { padding: 14px 18px; border-left: 6px solid var(--yellow); background: var(--white); }

.acc { border-top: 1.5px solid var(--ink); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 24px;
    align-items: center;
    padding: 22px 0;
    font-size: clamp(17px, 1.6vw, 21px);
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: -0.01em;
    cursor: pointer;
    list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
    content: "";
    width: 18px; height: 18px;
    background: linear-gradient(var(--ink), var(--ink)) center / 18px 2px no-repeat,
                linear-gradient(var(--ink), var(--ink)) center / 2px 18px no-repeat;
    transition: background-size 0.3s var(--ease);
}
.acc details[open] summary::after { background-size: 18px 2px, 2px 0; }
.acc details > :not(summary) { max-width: 40em; padding: 0 42px 26px 0; font-size: 15px; color: var(--ink-2); }
@media (max-width: 720px) {
    .acc details > :not(summary) { padding-right: 0; }
}

/* ---------- settings: 受講者画面の中の、1つのことを変えるフォーム(名前・メール・パスワード・退会) ---------- */
/* 本文の幅をしぼる。page-head の下に置く */
.form-page { max-width: 640px; }
/* 今の値を「項目名 / 値」で並べる一覧 */
.now-list { margin: 0; padding: 0; list-style: none; border-top: 1.5px solid var(--ink); }
.now-list > li { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.now-list .lab { font-size: 14px; font-weight: 800; line-height: 1.6; }
.now-list .val { min-width: 0; line-height: 1.6; overflow-wrap: anywhere; }
/* 入力欄を縦に積むフォーム */
.form-stack { display: grid; gap: 24px; margin-top: clamp(32px, 4vw, 48px); }
/* 送信ボタンと「やめる」を横に並べる */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 8px; }
@media (max-width: 720px) {
    .now-list > li { grid-template-columns: 1fr; }
    .form-actions .btn { flex: 1 1 100%; }
}

/* ---------- ide2: 画面の隅に出る一言の知らせ(Playground)。.toast-stack に JS が .toast-note を足し、数秒で消す ---------- */
.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 3000; display: grid; justify-items: end; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast-note { padding: 12px 18px; border: 1.5px solid var(--ink); border-left-width: 8px; background: var(--white); box-shadow: 6px 6px 0 rgba(21, 21, 28, 0.12); font-size: 14px; font-weight: 700; line-height: 1.6; color: var(--ink); }
.toast-note.success { border-left-color: var(--green); }
.toast-note.error { border-left-color: var(--red); }

/* ---------- 移行用 ----------
 * まだ書き直していない画面が使っている古い変数名。画面を書き直したら、この節ごと消す。
 */
:root {
    --primary: var(--ink);
    --primary-color: var(--ink);
    --secondary-color: var(--ink);
    --dark: var(--ink);
    --dark-bg: var(--ink);
    --light-bg: var(--paper);
    --pink: var(--red);
    --orange: #E0621B;
    --cyan: var(--blue);
    --success-color: var(--green);
    --danger-color: var(--red);
    --warning-color: var(--yellow);
    --info-color: var(--blue);
}
