/* Portal UI for the partner top page and details. Lightweight and shared. */
:root {
    --portal-blue: #185fa5;
    --portal-blue-deep: #0c447c;
    --portal-bg: #f4f6f9;
    --portal-surface: #ffffff;
    --portal-border: #d8e0ea;
    --portal-text: #16202a;
    --portal-muted: #647386;
    --portal-shadow: 0 10px 30px rgba(19, 41, 63, 0.08);
    --portal-radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { overflow-y: scroll; }

body.portal-page {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--portal-text);
    background: #fff;
}
/* ヘッダー直下より下を白いカーテンで覆い、それをフェードアウトすることでコンテンツが
   「じわっと現れる」効果を実現する。コンテンツ要素自体に opacity を当てないので、
   ヘッダーや GPUレイヤーには一切影響しない。 */
body.portal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 50;
    pointer-events: none;
    animation: portalCurtainFade 0.45s ease-out forwards;
}
/* skip-curtain クラスが付いているときは body カーテンを無効化。
   ラベル絞り込みなど、一部だけ再フェードしたいケースで使う。 */
body.portal-page.skip-curtain::before { animation: none; opacity: 0; }
@keyframes portalCurtainFade {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* 一覧フィルタタブ切替時の再発火用フェード（管理側 list-view-fade-in と同スペック）。
   JS でクラス付け外し→reflow→再付与でアニメ再発火させる。 */
.is-fading-in {
    animation: list-view-fade-in 0.45s ease-out both;
}
@keyframes list-view-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body.portal-page::before { animation: none; opacity: 0; }
    .notice-ticker-item, .notice-ticker-item.is-active {
        transition: none !important;
        animation: none !important;
    }
    .is-fading-in { animation: none; }
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

.portal-shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 26px 0 40px;
}

.main {
    padding: 0 30px;
    max-width: 760px;
    margin: 0 auto;
}

/* 中身ラッパー：上下padding を担う（is-compact で密度UP） */
.portal-main-inner {
    padding-top: 30px;
    padding-bottom: 30px;
}
.portal-main-inner.is-compact {
    padding-top: 15px;
    padding-bottom: 15px;
}
@media (max-width: 600px) {
    .main { padding: 0 18px; }
}

/* ── portal-band：パンくず等の全幅レーン（中身は max-width: 760px） ── */
.portal-band {
    border-bottom: 1px solid var(--portal-border);
}
.portal-band-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 30px;
}
@media (max-width: 600px) {
    .portal-band-inner { padding: 10px 18px; }
}

/* ── パンくず ── */
.breadcrumb {
    margin: 0;
    font-size: 13px;
    color: var(--portal-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--portal-muted);
    transition: color 0.12s ease;
}
.breadcrumb a:hover {
    color: var(--portal-text);
}
.breadcrumb .sep {
    color: #b3bdc9;
}
.breadcrumb .current {
    color: var(--portal-muted);
    font-weight: inherit;
}

/* ── お知らせティッカー（全幅レーン + 中身2段） ── */
.notice-ticker {
    border-bottom: 1px solid var(--portal-border);
}
.notice-ticker-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notice-ticker-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--portal-muted);
}
.notice-ticker-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.notice-ticker-slides {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    min-height: 22px;
}
.notice-ticker-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
    pointer-events: none;
}
.notice-ticker-item.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    animation: noticeSlideIn 0.4s ease-out;
}
@keyframes noticeSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
/* 逆方向（左矢印 or 前ドット）：新スライドは右から、旧スライドは左へ抜ける。
   :not(.is-active) を必須にしないと active 要素の translateX(0) を上書きしてしまう。 */
.notice-ticker-slides.is-reverse .notice-ticker-item:not(.is-active) {
    transform: translateX(-20px);
}
.notice-ticker-slides.is-reverse .notice-ticker-item.is-active {
    animation-name: noticeSlideInReverse;
}
@keyframes noticeSlideInReverse {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
/* スライドが1件しかないとき（is-active クラス未付与）でも表示する */
.notice-ticker-slides > .notice-ticker-item:only-child {
    position: relative;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    animation: none;
}
.notice-ticker-item .badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    flex: 0 0 auto;
}
.notice-ticker-item .badge.campaign { background: #fcebd2; color: #8a5a12; }
.notice-ticker-item .badge.new      { background: #e3edfa; color: #1a4f8c; }
.notice-ticker-item .badge.update   { background: #e4eed3; color: #4d7517; }
.notice-ticker-item .badge.other    { background: #eef0f3; color: #5a6b80; }
.notice-ticker-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    transition: color 0.12s ease;
}
.notice-ticker-item:hover .notice-ticker-title { color: var(--portal-blue); }
.notice-ticker-item.is-unread .notice-ticker-title::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--portal-blue);
    margin-right: 6px;
    vertical-align: 2px;
}
.notice-ticker-date {
    font-size: 11px;
    color: var(--portal-muted);
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}
.notice-ticker-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.notice-ticker-nav button {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: var(--portal-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: background 0.12s, color 0.12s;
}
/* 矢印グリフ（‹ ›）が行ボックス内で上寄りに描画されるため、ホバーの丸い影を
   疑似要素で下にオフセットして、矢印が影の中心になるよう揃える。 */
.notice-ticker-nav button:not(.notice-ticker-dot) {
    position: relative;
    isolation: isolate;
}
.notice-ticker-nav button:not(.notice-ticker-dot)::before {
    content: "";
    position: absolute;
    inset: 3px 0 -6px 0;
    border-radius: 50%;
    background: transparent;
    transition: background 0.12s;
    z-index: -1;
}
.notice-ticker-nav button:not(.notice-ticker-dot):hover {
    background: transparent;
}
.notice-ticker-nav button:not(.notice-ticker-dot):hover::before {
    background: #f0f3f7;
}
.notice-ticker-nav button:hover { background: #f0f3f7; color: var(--portal-text); }
.notice-ticker-dots { display: inline-flex; align-items: center; gap: 4px; padding: 0 2px; }
.notice-ticker-nav button.notice-ticker-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--portal-border);
    color: transparent;
    cursor: pointer;
    transition: background 0.12s, transform 0.12s;
    display: block;
}
.notice-ticker-nav button.notice-ticker-dot:hover {
    background: #98a5b8;
    transform: scale(1.15);
}
.notice-ticker-nav button.notice-ticker-dot.is-active {
    background: var(--portal-blue);
}
@media (max-width: 600px) {
    .notice-ticker-inner { padding: 12px 18px; }
    .notice-ticker-row { flex-wrap: wrap; gap: 8px; }
    .notice-ticker-date { display: none; }
}

/* ── 3セクターカード（学ぶ / 使う / 渡す） ── */
.sector-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.sector-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 20px 20px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    color: inherit;
    transition: border-color 0.12s ease;
}
.sector-card:hover { border-color: var(--surface-nav-hover-border); }
.sector-mark {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.sector-mark svg { width: 18px; height: 18px; display: block; }
.sector-card.is-learn .sector-mark { background: #e7f1fb; color: var(--portal-blue); }
.sector-card.is-use .sector-mark { background: #d1fae5; color: #10b981; }
.sector-card.is-give .sector-mark { background: #f7e4c1; color: #9a620c; }
.sector-card-head { display: flex; flex-direction: column; gap: 4px; }
.sector-card-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }
.sector-card-subtitle { margin: 0; font-size: 13px; color: var(--portal-muted); line-height: 1.5; }
.sector-links {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sector-links li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--portal-text);
}
.sector-links li::before {
    content: "▸";
    color: var(--portal-blue);
    font-size: 11px;
    line-height: 1;
    flex: 0 0 auto;
}
.sector-card.is-use .sector-links li::before { color: #10b981; }
.sector-card.is-give .sector-links li::before { color: #b0791b; }
.sector-links li.is-future { color: var(--portal-muted); }
.sector-links li.is-future::before { content: "＋"; font-size: 12px; }
.sector-links li.is-future .sector-link-note {
    margin-left: 4px;
    font-size: 11px;
    color: #8a96a8;
}
@media (max-width: 720px) {
    .sector-grid { grid-template-columns: 1fr; gap: 12px; }
    .sector-card { padding: 20px 18px 18px; }
    .sector-card-title { font-size: 18px; }
}

/* ── コピペ集（partner/copypaste） ── */
.snippet-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 14px;
}
.snippet-filter-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px;
    width: fit-content;
    border-radius: 10px;
    background: #f3f5f8;
}
.snippet-filter-tabs.is-number { background: transparent; padding: 0; gap: 6px; }
.snippet-filter-tab {
    border: 0;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 8px;
    background: transparent;
    color: #58697d;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}
.snippet-filter-tab:not(.is-active):hover { background: #e1e4ea; color: #394552; }
.snippet-filter-tabs:not(.is-number) .snippet-filter-tab.is-active {
    background: #15233b;
    color: #fff;
}
.snippet-filter-tabs.is-number .snippet-filter-tab { min-width: 30px; background: #f3f5f8; }
.snippet-filter-tabs.is-number .snippet-filter-tab.is-active { background: #10b981; color: #fff; }

.snippet-list { display: flex; flex-direction: column; gap: 12px; }
.snippet-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    transition: border-color 0.12s ease;
}
.snippet-card:hover { border-color: var(--surface-nav-hover-border); }
.snippet-card.is-hidden { display: none; }
.snippet-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.snippet-card-title-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
.snippet-card-no { font-size: 14px; font-weight: 700; color: var(--portal-text); flex: 0 0 auto; }
.snippet-card-title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--portal-text); }
.snippet-card-pill {
    display: inline-flex;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f0f2f5;
    color: #58697d;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}
/* 旧 .snippet-copy（card ヘッダの大コピーボタン）は body-title-row / body-content 内の
   .snippet-inline-copy に置き換わったため、view からは削除済み。CSS 定義も廃止。 */

.snippet-body-wrap { position: relative; }

/* ── 件名・タイトル行（任意フィールドが入力されているスニペットのみ表示） ──
   本文 pre の直上に配置し、境界線でつながっている見た目にする。 */
.snippet-body-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #eaeef3;
    border-bottom: 1px solid #eaeef3; /* body との区切り線 */
    border-radius: 8px 8px 0 0;
}
.snippet-body-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--portal-text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
/* has-body-title のときは body pre の上端を title-row と繋げる */
.snippet-body-wrap.has-body-title .snippet-body {
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.snippet-body-content { position: relative; }

/* インラインコピーアイコンボタン（件名 / 本文それぞれの右端に配置） */
.snippet-inline-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--portal-muted, #6b7280);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
}
.snippet-inline-copy:hover {
    background: #eef2f7;
    color: var(--portal-text);
    border-color: #d1d5db;
}
.snippet-inline-copy:active { transform: scale(0.94); }
.snippet-inline-copy svg { width: 15px; height: 15px; }
.snippet-inline-copy-icon-done { display: none; }
.snippet-inline-copy.is-copied {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.snippet-inline-copy.is-copied .snippet-inline-copy-icon-copy { display: none; }
.snippet-inline-copy.is-copied .snippet-inline-copy-icon-done { display: inline-block; }

/* 本文エリアのコピーアイコン：右上コーナーに絶対配置。
   タイトル行のアイコン位置と揃えるため、right は title-row の
   border(1px) + padding-right(12px) = 13px と一致させる。 */
.snippet-inline-copy-body {
    position: absolute;
    top: 8px;
    right: 13px;
    z-index: 2; /* fade より前面 */
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(4px);
}
/* 「もっと見る／閉じる」開閉。max-height 22em ⇄ body.scrollHeight を transition する。
   固定値（22em → 200em）で animate すると実コンテンツ範囲を過ぎたあとの余剰スペースが
   長々アニメされて「一瞬で開ききって残り時間だけ待つ」ジャンプ挙動になるので、
   展開時は JS で body.scrollHeight を測って inline max-height に注入する。 */
.snippet-body {
    margin: 0;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #eaeef3;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--portal-text);
    max-height: 22em;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.snippet-body-fade {
    position: absolute;
    left: 1px; right: 1px; bottom: 1px;
    height: 3em;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, #f8fafc 80%);
    border-radius: 0 0 8px 8px;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.snippet-body-wrap.is-expanded .snippet-body-fade { opacity: 0; }
.snippet-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-top: 2px;
    background: transparent;
    border: 0;
    color: var(--portal-blue);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.5;
    border-radius: 4px;
    transition: background 0.12s ease;
}
.snippet-toggle:hover { background: #eef2f7; }
.snippet-toggle-icon { display: inline-block; transition: transform 0.2s ease; }
.snippet-toggle.is-expanded .snippet-toggle-icon { transform: rotate(180deg); }
.snippet-toggle[hidden] { display: none; }

.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 18px;
    background: #1f2a37;
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 12px 28px rgba(19, 41, 63, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}
.copy-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── ラベル絞り込みエリア（使う一覧で使用） ── */
.label-filter {
    margin: 14px 0 4px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
}
.label-filter-head {
    font-size: 12px;
    color: var(--portal-muted);
    margin-bottom: 10px;
}
.label-filter-head small {
    color: #8a96a8;
    font-size: 11px;
    margin-left: 4px;
}
.filter-axis {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
}
.filter-axis + .filter-axis {
    border-top: 1px dashed #e2e7ee;
}
.filter-axis-name {
    width: 48px;
    padding-top: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-muted);
    flex: 0 0 auto;
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
}
.label-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--portal-border);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #58697d;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.label-chip:hover { border-color: var(--surface-nav-hover-border); }
.label-chip.is-active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.label-chip.is-active:hover { background: #059669; border-color: #059669; }

.filter-summary {
    margin: 14px 0 0;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--portal-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-summary-count {
    font-size: 13px;
    color: var(--portal-text);
    font-weight: 700;
    white-space: nowrap;
}

/* ── 「使う」結果カードグリッド ── */
.use-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 6px;
}
.use-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 14px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s ease;
}
.use-card:hover { border-color: var(--surface-nav-hover-border); }
.use-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.use-card-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: #10b981;
    flex: 0 0 auto;
}
.use-card-icon svg { width: 18px; height: 18px; display: block; }
.use-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #10b981;
    color: #10b981;
    cursor: pointer;
    line-height: 1;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.use-card-action:hover { background: #10b981; color: #fff; }
.use-card-title {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}
.use-card-desc {
    margin: 0;
    font-size: 12px;
    color: var(--portal-muted);
    line-height: 1.55;
}
.use-card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.use-card-label {
    display: inline-flex;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f0f2f5;
    color: #58697d;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}
@media (max-width: 600px) {
    .filter-axis { flex-direction: column; gap: 6px; }
    .filter-axis-name { width: auto; padding-top: 0; }
    .use-grid { grid-template-columns: 1fr; }
}

/* ── Portal フッター ── */
.portal-footer {
    max-width: 760px;
    margin: 36px auto 0;
    padding: 20px 30px 28px;
    border-top: 1px solid var(--portal-border);
    text-align: center;
}
.portal-copyright {
    font-size: 12px;
    color: var(--portal-muted);
    letter-spacing: 0.02em;
}

.portal-topbar {
    --header-bg-start: #15233b;
    --header-bg-end: #1a2940;
    --header-subtext-color: rgba(255, 255, 255, 0.82);
    --header-button-border: rgba(255, 255, 255, 0.35);
}

.portal-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 22px;
}

.hero-panel {
    padding: 24px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e7f1fb;
    color: var(--portal-blue-deep);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero-title {
    margin: 0 0 10px;
    font-size: clamp(24px, 2.4vw, 34px);
    line-height: 1.2;
}

.hero-copy {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.8;
}

.hero-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.hero-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--surface-nav-border);
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff, #eef5fb);
    color: var(--portal-text);
    font-weight: 700;
    box-shadow: none;
    transition: border-color 0.15s ease;
}

.hero-link:hover {
    border-color: var(--surface-nav-hover-border);
}

.hero-link span {
    font-size: 15px;
}

.hero-link strong {
    min-width: 34px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e6f0ff;
    color: var(--portal-blue-deep);
    text-align: center;
    font-size: 14px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.stat {
    padding: 14px 16px;
    background: #f9fbfe;
    border: 1px solid #e5ebf2;
    border-radius: 14px;
}

.stat strong {
    display: block;
    font-size: 20px;
    margin-top: 6px;
}

.sidebar-list {
    display: grid;
    gap: 10px;
}

.notice-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--surface-nav-border);
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.15s ease;
}

.portal-notice-section .notice-card {
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: none;
}

.notice-card:hover {
    border-color: var(--surface-nav-hover-border);
}

.notice-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.notice-card.is-read .notice-head {
    gap: 0;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--portal-blue);
    flex: 0 0 auto;
}

.notice-card.new .dot { background: #1a66b8; }
.notice-card.campaign .dot { background: #b27418; }
.notice-card.update .dot { background: #5a8c21; }
.notice-card.other .dot { background: #77808b; }
.notice-card.is-unread .dot {
    opacity: 1;
    width: 9px;
    margin-left: 1px;
}
.notice-card.is-read .dot {
    opacity: 0;
    width: 0;
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--portal-blue-deep);
    font-size: 12px;
    font-weight: 700;
}

.badge.new { background: #e6f0ff; color: #1a66b8; }
.badge.campaign { background: #fff3dd; color: #b27418; }
.badge.update { background: #e8f4dd; color: #5a8c21; }

.notice-title {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

.notice-date,
.meta {
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-section {
    margin-top: 22px;
    padding: 20px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.section-subtitle {
    margin: 6px 0 0;
    color: var(--portal-muted);
    font-size: 12px;
}

.section-head-with-icon {
    align-items: center;
    justify-content: flex-start;
}

.section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-weight: 700;
}

.section-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.icon-train {
    background: #e7f1fb;
    color: var(--portal-blue);
}

.icon-dl {
    background: #e8f4dc;
    color: #4f7f17;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 2px;
    width: fit-content;
    border-radius: 10px;
    background: #f3f5f8;
}

.tab {
    border: 0;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    background: transparent;
    color: #58697d;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab.is-active {
    background: #15233b;
    color: #fff;
}

.tab:not(.is-active):hover {
    background: #e1e4ea;
    color: #394552;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 12px;
}

.content-grid.content-grid-training,
.content-grid.content-grid-download {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.notice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.portal-notice-section {
    padding: 0;
    margin-top: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.content-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--surface-nav-border);
    border-radius: 10px;
    overflow: hidden;
    background: #f7f8fa;
    cursor: pointer;
    transition: border-color 0.12s;
}

.content-card:hover {
    border-color: var(--surface-nav-hover-border);
}

.content-art {
    height: 100px;
    display: grid;
    place-items: center;
    background: #dcecf9;
    color: #3f63a8;
    overflow: hidden;
    position: relative;
}

.content-art.has-thumb {
    /* 旧 background-image 経路は撤去。サムネは <img.content-art-img> として配置し、
       焦点位置とズームを CSS変数で制御する。 */
    background: transparent;
}

.content-art-img {
    --thumb-focus-x: 50%;
    --thumb-focus-y: 50%;
    --thumb-zoom: 1;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--thumb-focus-x) var(--thumb-focus-y);
    transform: scale(var(--thumb-zoom));
    transform-origin: var(--thumb-focus-x) var(--thumb-focus-y);
    display: block;
}

.content-card.is-video .content-art {
    background-color: #dcecf9;
    color: #3f63a8;
}

.content-card.is-text .content-art {
    background-color: #dff0d0;
    color: #3b7720;
}

.content-card.is-download .content-art {
    background-color: #f7e4c1;
    color: #9a620c;
}

.art-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(63, 99, 168, 0.14);
    font-size: 18px;
    font-weight: 800;
}

.content-card.is-text .art-icon { background: rgba(59, 119, 32, 0.14); }
.content-card.is-download .art-icon { background: rgba(154, 98, 12, 0.14); }

.content-body {
    padding: 9px 11px 11px;
}

.content-title {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
}

.content-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--portal-muted);
    font-size: 10px;
}

.content-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--portal-blue-deep);
    font-size: 11px;
    font-weight: 700;
}

.content-card.is-hidden {
    display: none;
}

.detail-container {
    padding: 28px 24px;
    max-width: 760px;
    margin: 0 auto;
}

.detail {
    width: min(920px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.detail-head {
    padding: 0 0 12px;
}

/* 管理者が非公開コンテンツをプレビューしている時に画面上部に出すバナー */
.draft-preview-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fef3c7;
    color: #92400e;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid #fde68a;
    text-align: center;
}

.detail-body {
    font-size: 14px;
    line-height: 1.85;
    color: var(--color-text-primary);
}

/* hr はブラウザデフォルトだと濃いので、本文中の区切り線として柔らかい色に */
.detail-body hr {
    border: 0;
    border-top: 1px solid #e2e8ef;
    margin: 20px 0;
    height: 0;
}

.detail-body h2 {
    font-size: 17px;
    font-weight: 500;
    margin: 20px 0 10px;
    color: var(--color-text-primary);
}

.detail-body h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 16px 0 8px;
}

.detail-body p {
    margin: 0 0 12px;
}

.detail-body ul,
.detail-body ol {
    padding-left: 20px;
    margin: 8px 0 14px;
}

.detail-body li {
    margin: 5px 0;
}

.detail-body strong {
    font-weight: 500;
}

.detail-body a {
    color: #185FA5;
    text-decoration: underline;
}

.detail-body a:hover {
    text-decoration: underline;
    color: #0C447C;
}

.detail-body img {
    max-width: 100%;
    display: block;
    margin: 8px 0;
    border-radius: 8px;
}

/* ── 定義リスト dl/dt/dd ── */
.detail-body dl {
    margin: 12px 0;
    padding-left: 0;
}
.detail-body dt {
    font-weight: 700;
    color: #082340;
    margin-top: 10px;
    padding-left: 12px;
    border-left: 3px solid #185fa5;
}
.detail-body dd {
    margin: 4px 0 8px 16px;
    color: #2c3a4d;
}

/* ── テーブル ── */
.detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #fff;
    border: 1px solid #d6dde7;
    font-size: 13px;
}
.detail-body table caption {
    text-align: left;
    font-weight: 700;
    padding: 8px 4px;
    color: #082340;
}
.detail-body th,
.detail-body td {
    padding: 8px 12px;
    border: 1px solid #e2e8ef;
    text-align: left;
    vertical-align: top;
}
.detail-body th {
    background: #f4f6f9;
    font-weight: 700;
    color: #082340;
}
.detail-body tbody tr:nth-child(even) td {
    background: #fafbfc;
}
.detail-body tfoot td {
    background: #f4f6f9;
    font-size: 12px;
    color: #5a6b80;
}
/* JS が <div class="table-scroll"> で包むので、ラッパーに横スクロールを付ける。
   テーブル自体は通常のテーブルレイアウトを維持できる。 */
.detail-body .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 16px 0;
}
.detail-body .table-scroll table {
    margin: 0;
}

/* ── 折りたたみ details/summary ── */
.detail-body details {
    margin: 12px 0;
    padding: 8px 14px;
    background: #f4f6f9;
    border-radius: 8px;
    border: 1px solid #e2e8ef;
}
.detail-body summary {
    font-weight: 700;
    cursor: pointer;
    color: #185fa5;
    padding: 4px 0;
}
.detail-body details[open] summary {
    margin-bottom: 6px;
    border-bottom: 1px dashed #d6dde7;
}

/* ── インライン書式 ── */
.detail-body mark {
    background: #fff2b2;
    padding: 0 2px;
    border-radius: 3px;
}
.detail-body kbd {
    display: inline-block;
    padding: 1px 6px;
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.9em;
    background: #f4f6f9;
    border: 1px solid #d6dde7;
    border-radius: 4px;
    box-shadow: 0 1px 0 #d6dde7;
    color: #082340;
}
.detail-body samp,
.detail-body var,
.detail-body code {
    font-family: "Consolas", "Menlo", monospace;
    font-size: 0.92em;
    background: #f4f6f9;
    padding: 1px 5px;
    border-radius: 4px;
    color: #185fa5;
}
.detail-body abbr,
.detail-body dfn {
    text-decoration: underline dotted;
    cursor: help;
    font-style: normal;
}

.detail-body .video-embed {
    margin: 12px 0;
}

.detail-body .video-embed video {
    width: 100%;
    max-width: 720px;
    display: block;
    border-radius: 12px;
    background: #000;
}

.detail-body .file-embed {
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    background: #fff;
}

.detail-body .file-embed-frame {
    display: block;
    width: 100%;
    height: 480px;
    border: 0;
    background: #f5f8fc;
}

.detail-body .file-embed-click-capture {
    /* Editor-only overlay; inert on the public page. */
    display: none;
}

.detail-body .file-embed-download {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f5f8fc;
    border-top: 0.5px solid rgba(0, 0, 0, 0.12);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 13px;
}

.detail-body .file-embed-download:hover {
    background: #E6F1FB;
    color: #185FA5;
    text-decoration: none;
}

.detail-body .file-embed-download-icon {
    width: 30px;
    height: 30px;
    background: #FAEEDA;
    color: #854F0B;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
}

.detail-body .file-embed-download-body {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.detail-body .file-embed-download-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-body .file-embed-download-meta {
    font-size: 11px;
    color: var(--color-text-secondary);
}

.detail-body .file-embed.no-download .file-embed-download {
    display: none;
}

.detail-body .file-embed.no-viewer .file-embed-frame-wrap {
    display: none;
}

.detail-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 24px;
    flex-wrap: wrap;
}

.detail-pager {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 「← 一覧に戻る」と「前へ／次へ」を共通の丸ピル型ボタンで揃える */
.back-btn,
.detail-pager-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--surface-nav-border);
    border-radius: 999px;
    background: #fff;
    color: var(--portal-text, #16202a);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.back-btn:hover,
a.detail-pager-btn:hover {
    border-color: var(--portal-blue);
    color: var(--portal-blue);
    background: #fff;
    text-decoration: none;
}

.detail-pager-btn.is-disabled {
    color: #b8c0cb;
    background: #f6f8fb;
    cursor: not-allowed;
    pointer-events: none;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 20px;
    background: #e6f1fb;
    color: var(--portal-blue-deep);
    font-size: 10px;
    font-weight: 700;
}

.tag-download {
    background: #fff0d8;
    color: #9b5f00;
}

.tag-manu {
    background: #e6f1fb;
    color: var(--portal-blue-deep);
}

.detail-dur {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--portal-bg);
    color: var(--portal-muted);
}

.detail-date {
    font-size: 13px;
    color: var(--portal-muted);
}

.detail-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.image-wrap {
    background: #0C1929;
    border-radius: 14px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    max-height: 380px;
}

.image-wrap .detail-hero-image {
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    display: block;
    max-width: none;
    max-height: none;
}

.pdf-wrap {
    background: #1a2433;
    border-radius: 14px;
    aspect-ratio: 16 / 9;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    max-height: 480px;
}

.pdf-wrap .pdf-viewer {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.detail-hero-image {
    display: block;
    max-width: 100%;
    max-height: 380px;
    margin: 0 auto 18px;
    border-radius: 14px;
    border: 1px solid #e2e8ef;
    background: #fff;
    object-fit: contain;
}

.video-wrap .video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.detail-divider {
    border: 0;
    border-top: 1px solid #e2e8ef;
    margin: 20px 0 18px;
}

.training-detail {
    max-width: 760px;
}

.video-wrap {
    background: #0C1929;
    border-radius: 14px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    max-height: 380px;
}

.video-play-ring {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 2px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.video-play-icon {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #fff;
}

.video-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
    color: #fff;
}

.video-label-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.video-label-dur {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}

.training-body {
    font-size: 14px;
    line-height: 1.9;
    color: var(--portal-text);
}

.training-body h2 {
    margin: 24px 0 12px;
    font-size: 18px;
}

.training-body h3 {
    margin: 18px 0 10px;
    font-size: 16px;
}

.training-body p {
    margin: 0 0 14px;
}

.training-body ul,
.training-body ol {
    margin: 10px 0 16px;
    padding-left: 22px;
}

.training-body li {
    margin: 7px 0;
}

.training-files {
    margin-top: 24px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    box-shadow: var(--portal-shadow);
}

.training-files h2 {
    margin: 0 0 12px;
    font-size: 17px;
}

.training-file-list {
    display: grid;
    gap: 10px;
}

.training-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e4eaf1;
    border-radius: 12px;
    background: #f9fbfd;
}

.training-file a {
    color: var(--portal-blue);
    font-weight: 700;
}

.training-file-meta {
    color: var(--portal-muted);
    font-size: 12px;
    margin-top: 4px;
}

.file-preview {
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.file-icon-lg {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #f7e7c8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    color: #9b5f00;
}

.file-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--portal-text);
    margin-bottom: 4px;
}

.file-meta-sm {
    font-size: 12px;
    color: var(--portal-muted);
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--portal-blue);
    color: #fff;
    border: 0;
    padding: 11px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.dl-btn:hover {
    background: #0c447c;
    color: #fff;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 12px 20px;
    border-radius: 12px;
    background: #3f63a8;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.download-btn:hover {
    background: #2f5393;
    color: #fff;
}

.download-btn-icon {
    font-size: 16px;
    line-height: 1;
}

.download-btn-compact {
    margin-top: 18px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
}

.download-file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    padding: 18px 20px;
    border: 1px solid #d9e3ee;
    border-radius: 16px;
    background: #f8fafc;
    color: var(--portal-text);
    transition: border-color 0.12s ease;
}

.download-file-card:hover {
    border-color: #3f63a8;
}

.download-file-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #f6e7be;
    color: #9b5f00;
    font-size: 28px;
    flex: 0 0 auto;
}

.download-file-card-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
}

.download-file-card-meta {
    font-size: 12px;
    color: var(--portal-muted);
}

.download-file-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--portal-muted);
}

.scroll-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #d5dde8;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--portal-blue-deep);
    box-shadow: 0 8px 20px rgba(19, 41, 63, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top:hover {
    border-color: #3f63a8;
    background: #f5f9ff;
}

.scroll-top-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #e6f0ff;
    color: #3f63a8;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
}

.scroll-top-text {
    font-size: 12px;
    font-weight: 700;
}

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--portal-blue);
    border-radius: 10px;
    background: var(--portal-blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn.secondary, button.secondary {
    background: #fff;
    color: var(--portal-blue);
}

.btn.secondary:hover, button.secondary:hover {
    background: #eef2f6;
    border-color: #c4ccd6;
    color: #27415f;
}

body.preview-mode a,
body.preview-mode button,
body.preview-mode input,
body.preview-mode select,
body.preview-mode textarea,
body.preview-mode [role="button"] {
    pointer-events: none;
    cursor: default;
}

body.preview-mode .video-play-ring,
body.preview-mode .video-play-ring *,
body.preview-mode .video-play-ring button,
body.preview-mode .video-play-ring a {
    pointer-events: auto;
    cursor: pointer;
}

/* プレビュー中でも「使う」配下のインタラクション（タブ・コピー・アコーディオン・ラベル絞り込み）は
   動作確認したいので例外的に有効化する */
body.preview-mode .snippet-filter-tab,
body.preview-mode .snippet-toggle,
body.preview-mode [data-snippet-copy],
body.preview-mode .label-chip {
    pointer-events: auto;
    cursor: pointer;
}

body.preview-mode .scroll-top {
    display: none;
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #082340, #185fa5);
}

.login-card {
    width: min(420px, calc(100vw - 32px));
    padding: 26px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--portal-shadow);
}

input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c9d4e2;
    border-radius: 10px;
    font: inherit;
}

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #fff3cd;
    border: 1px solid #f3d37b;
}

.portal-footer-gap {
    height: 14px;
}

@media (max-width: 960px) {
    .hero-links {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    }

}

@media (max-width: 720px) {
    .portal-shell,
    .detail-container {
        width: min(100vw - 20px, 100%);
    }

    /* .portal-section,
    .hero-panel {
        padding: 18px;
    } */

    .portal-notice-section .notice-card {
        padding: 10px 11px;
    }

    .notice-head {
        gap: 8px;
        margin-bottom: 6px;
    }

    .badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    .notice-title {
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 5px;
    }

    .notice-date {
        font-size: 10px;
    }

    .training-video {
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .video-wrap {
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .training-video-play,
    .video-play-ring {
        width: 60px;
        height: 60px;
    }

    .training-title {
        font-size: clamp(22px, 6vw, 28px);
    }

    .training-files,
    .training-body,
    .detail-body,
    .file-preview {
        font-size: 14px;
    }

    .training-file {
        align-items: flex-start;
        flex-direction: column;
    }

    .file-preview {
        align-items: flex-start;
        padding: 16px;
    }

    .download-file-card {
        padding: 14px 16px;
        gap: 12px;
    }

    .download-file-card-icon {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }

    .download-file-card-title {
        font-size: 13px;
    }

    .download-file-card-meta {
        font-size: 11px;
    }

    .download-btn-compact {
        margin-top: 14px;
        padding: 9px 16px;
    }

    .detail-container {
        padding: 28px 24px;
        max-width: none;
        width: min(100vw - 20px, 100%);
    }

    .scroll-top {
        right: 12px;
        bottom: 12px;
        padding: 9px 12px;
    }

    .scroll-top-text {
        font-size: 11px;
    }

    .section-head-with-icon {
        gap: 10px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    }

    .content-grid.content-grid-training,
    .content-grid.content-grid-download {
        gap: 10px;
    }
}

@media (min-width: 524px) {
    .content-grid.content-grid-training,
    .content-grid.content-grid-download {
        justify-content: start;
    }
}

@media (max-width: 524px) {
    .notice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .notice-grid .notice-card:nth-child(3) {
        display: none;
    }

    .content-grid,
    .content-grid.content-grid-training,
    .content-grid.content-grid-download {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* --- 最新のお知らせ カルーセル --- */
.notice-carousel {
    --notice-visible: 3;
    --notice-gap: 12px;
    position: relative;
}

.notice-carousel-viewport {
    /* overflow-x: clip + overflow-y: visible で「横のスクロールだけ隠す」。
       overflow: hidden だとカードの border-radius がビューポート角でクリップされ、
       下端のボーダー/角丸が削れて見えるため。 */
    overflow-x: clip;
    overflow-y: visible;
    border-radius: 12px;
}

.notice-carousel-track {
    display: flex;
    gap: var(--notice-gap);
    transition: transform 0.3s ease;
    will-change: transform;
}

.notice-carousel-track > .notice-card {
    flex: 0 0 calc((100% - var(--notice-gap) * (var(--notice-visible) - 1)) / var(--notice-visible));
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 719px) {
    .notice-carousel {
        --notice-visible: 2;
    }
}

.notice-carousel-nav {
    appearance: none;
    position: absolute;
    top: 50%;
    z-index: 3;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--surface-nav-border);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
    color: var(--portal-text, #333);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(2px);
    box-shadow: 0 2px 6px rgba(19, 41, 63, 0.12);
    opacity: 1;
    transform: translateY(-50%);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}

.notice-carousel-prev { left: 8px; }
.notice-carousel-next { right: 8px; }

/* タッチデバイスはボタン廃止（スワイプ操作で代替） */
@media (hover: none) {
    .notice-carousel-nav {
        display: none;
    }
}

/* マウス機器のみホバー演出を適用（タッチでは :hover がタップ後も残るため除外） */
@media (hover: hover) {
    .notice-carousel-nav {
        opacity: 0;
    }

    /* ボタン付近の見えない判定エリア（疑似要素）。ここに入るとhoverが発火する */
    .notice-carousel-nav::after {
        content: '';
        position: absolute;
        inset: -32px -20px;
    }

    /* 判定エリアまたはボタンにマウスが入ると現れる（フォーカス対応も兼ねる） */
    .notice-carousel-nav:hover,
    .notice-carousel-nav:focus-visible {
        opacity: 1;
    }

    /* ホバーは「浮き上がり」だけ。色は変えない */
    .notice-carousel-nav:hover {
        box-shadow: 0 8px 18px rgba(19, 41, 63, 0.28);
        transform: translateY(calc(-50% - 2px)) scale(1.08);
    }
}

/* 押した瞬間に青く反応 */
.notice-carousel-nav:active {
    background: var(--portal-blue, #1a66b8);
    border-color: var(--portal-blue, #1a66b8);
    color: #fff;
    box-shadow: 0 3px 8px rgba(19, 41, 63, 0.22);
    transform: translateY(-50%) scale(1.02);
}


.notice-carousel-nav[hidden] {
    display: none;
}

.notice-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.notice-carousel-dot {
    appearance: none;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    border: 0;
    background: var(--surface-nav-border, #d0d4d9);
    padding: 0;
    cursor: pointer;
    transition: background 0.12s, width 0.12s;
}

.notice-carousel-dot.is-active {
    background: var(--portal-blue, #1a66b8);
    width: 18px;
}

.notice-carousel-dot[hidden] {
    display: none;
}
