/* 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; }

body.portal-page {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--portal-text);
    background:
        radial-gradient(circle at top left, rgba(24, 95, 165, 0.07), transparent 25%),
        linear-gradient(180deg, #f8fafc 0%, var(--portal-bg) 100%);
}

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: 30px;
    max-width: 980px;
    margin: 0 auto;
}

.portal-topbar {
    --header-bg-start: var(--portal-blue);
    --header-bg-end: #1c67b2;
    --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: #3f63a8;
    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;
}

.detail-body {
    font-size: 14px;
    line-height: 1.85;
    color: var(--color-text-primary);
}

.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;
}

.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 .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;
}
