/* ---------------------------------------
   Design System (easy to retheme per event)
------------------------------------------*/
:root {
    --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans JP', sans-serif;

    /* === Pink Theme === */
    --primary: oklch(70% .16 15);
    /* soft coral pink */
    --primary-ink: #fff;
    --bg: #fde8ec;
    /* light pink background */
    --surface: #fff6f8;
    /* pale rose surface */
    --text: oklch(25% .04 15);
    --title: oklch(22% .04 15);
    --muted: oklch(45% .03 15);
    --label: oklch(35% .04 15);
    --line: oklch(90% .03 15);
    --input: #fff;
    --danger: oklch(55% .20 27);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, .06);
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

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

/* Nav */
.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 20px;
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--title);
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
}
.btn--primary {
    background: var(--primary);
    color: var(--primary-ink);
    font-size: 1.2rem;
}


.btn--ghost {
    background: transparent;
    color: var(--title);
    border: 1px solid var(--line);
    font-size: 1.2rem;
}

/* Responsive adjustment for Logout button */
@media (max-width: 640px) {
    .nav__right .btn--ghost {
        font-size: 0.8rem;
        padding: 6px 10px;
        border-radius: 8px;
    }

    .brand {
        font-size: 0.9rem;
    }
}

/* Even tighter for very small phones */
@media (max-width: 400px) {
    .nav__right .btn--ghost {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}


.btn:hover {
    filter: brightness(0.98);
}

/* Hero (short height, full width) */
.hero {
    position: relative;
    height: 28vh;
    min-height: 220px;
    max-height: 300px;
    overflow: hidden;
    background: #111;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: saturate(0.9) hue-rotate(-5deg) brightness(1.05);
}


.hero__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;

    /* Pink gradient overlay tint */
    background: linear-gradient(to top,
            color-mix(in oklab, var(--primary) 25%, transparent) 0%,
            color-mix(in oklab, var(--primary) 10%, transparent) 70%,
            transparent 100%);

    color: #000;
}


.hero h1 {
    margin: 0 0 4px 0;
    font-size: clamp(20px, 3.5vw, 34px);
    font-weight: bold;
}

.hero p {
    margin: 0;
    opacity: 1;
    font-size: 1.5rem;
}

/* Sections */
.section {
    padding: 24px 20px;
    max-width: 1300px;
    margin: 0 auto;
}

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section h2 {
    margin: 0;
    font-size: clamp(18px, 2.8vw, 26px);
    color: var(--title);
    font-size: 2rem;
    margin-bottom: 20px;
}



/* ---------- Basic login card (kept for non-enhanced) ---------- */
body.login {
    display: flex;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    width: min(92vw, 440px);
    background: var(--surface);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    padding: 32px;
    border: 1px solid var(--line);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.2px;
    color: var(--title);
}

.muted {
    color: var(--muted);
    font-size: .95rem;
    margin-top: .25rem;
}

.login-form {
    margin-top: 24px;
    display: grid;
    gap: 14px;
}

.field label {
    font-size: 1.2rem;
    color: var(--label);
    display: block;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--input);
    color: var(--text);
    outline: none;
    font-size: 1.2rem;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 20%, transparent);
}

.err {
    color: var(--danger);
    font-size: rem;
    margin-top: 8px;
}

.foot {
    margin-top: 18px;
    font-size: .8rem;
    color: var(--muted);
}

/* ===== Enhanced Login Experience (split layout) ===== */
.login--enhanced {
    display: grid;
    place-items: center;
    min-height: 100dvh;
}

/* Override base login flex-centering to prevent layout fights */
.login--enhanced.login {
    display: grid;
}

/* The shell */
.login-shell {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    width: min(1500px, 94vw);
    height: min(720px, 92vh);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

@media (max-width: 920px) {
    .login-shell {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    .login-card {
        align-items: stretch !important;
        padding: 32px !important;
    }

    .login-visual {
        display: none;
    }
}

/* Visual side */
.login-visual {
    position: relative;
    background: url('login-visual.jpg') center center / contain no-repeat;
    background-color: #fde8ec;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #4a2e2e;
}

/* Remove dark overlays and greetings */
.gv,
.orb,
.greetings {
    display: none !important;
}


/* Greetings marquee */
.greetings {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 64px;
    display: grid;
    gap: 10px;
    padding: 0 24px;
    pointer-events: none;
}

.greetings__line {
    display: flex;
    gap: 24px;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 28px);
    opacity: .9;
    color: #fff;
    white-space: nowrap;
    transform: translateX(0);
    animation: marquee 22s linear infinite;
}

.greetings__line--alt {
    opacity: .7;
    animation-duration: 28s;
}

.greetings__line span {
    opacity: .98;
}

@keyframes marquee {
    from {
        transform: translateX(0%);
    }

    to {
        transform: translateX(-50%);
    }
}

.event-mark {
    position: absolute;
    top: 24px;
    left: 24px;
    display: grid;
    gap: 8px;
    color: #000000;
}

.event-mark__tag {
    display: inline-block;
    font-size: 1.25rem;
    letter-spacing: .18em;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, .06);
}

.event-mark__name {
    font-weight: 700;
    font-size: clamp(18px, 2.4vw, 24px);
    text-shadow: 0 6px 26px rgba(0, 0, 0, .35);
}

/* Right card within shell: remove base card’s fixed width & borders */
.login--enhanced .login-card {
    width: auto;
    display: flex !important;
    flex-direction: column;
    justify-content: center !important;
    align-items: center !important;
    /* horizontal center */
    text-align: left;
    background: var(--surface);
    box-shadow: none;
    border: none;
    height: 100%;
    padding: 48px 60px !important;
}

/* Keep inner fields aligned inside centered card */
.login-card__head,
.login-form,
.extbox,
.login-foot {
    width: 100%;
    max-width: 360px;
}

.login-card--fx {
    animation: popIn .4s cubic-bezier(.2, .7, .2, 1) both;
}

.login-card__head {
    margin-bottom: 16px;
    font-size: 1.5rem;
}

.login-subtitle {
    color: var(--muted);
    margin-top: 6px;
}

.btn--wide {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ico {
    opacity: .92;
}

/* ===== Viewing Period Notice (bigger & clearer) ===== */
.err--bar {
    font-size: 1.2rem;
    /* make text bigger */
    line-height: 1.6;
    background-color: #ffe9e9;
    color: #a00000;
    border: 2px solid #f5b5b5;
    border-radius: 10px;
    padding: 1.2em 1.4em;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    max-width: 460px;
    margin: 1.8em auto;
}


.login-form--fx input:focus {
    transform: translateY(-1px);
    transition: transform .12s ease;
}

.login-foot {
    margin-top: auto;
    color: var(--muted);
    font-size: 1.15rem;
}

/* Entrance */
@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.995);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* === Tech Light Mesh + Grid (animated page background) === */
.theme-login-tech {
    position: relative;
    min-height: 100dvh;
    background: linear-gradient(180deg, #f9fbff 0%, #f6f8fb 100%);
    /* light, clean base */
    overflow: hidden;
}

/* moving micro-grid */
.theme-login-tech::before {
    content: "";
    position: fixed;
    /* cover full viewport even if content scrolls */
    inset: -2px;
    background:
        /* subtle dots layer */
        radial-gradient(circle at 25px 25px, rgba(30, 70, 140, .06) 1px, transparent 2px) 0 0/50px 50px,
        /* x grid */
        repeating-linear-gradient(0deg, rgba(30, 70, 140, .05) 0 1px, transparent 1px 40px),
        /* y grid */
        repeating-linear-gradient(90deg, rgba(30, 70, 140, .05) 0 1px, transparent 1px 40px);
    animation: techGridPan 26s linear infinite;
    pointer-events: none;
    z-index: 0;
    /* soften overall */
    filter: saturate(110%) contrast(102%) brightness(102%);
}

/* drifting light blobs (gives the “mesh” feel) */
.theme-login-tech::after {
    content: "";
    position: fixed;
    inset: -30%;
    background:
        radial-gradient(40% 35% at 20% 30%, rgba(110, 160, 255, .28), transparent 65%),
        radial-gradient(45% 40% at 80% 65%, rgba(0, 200, 210, .22), transparent 65%),
        radial-gradient(35% 30% at 40% 80%, rgba(255, 170, 200, .18), transparent 70%);
    filter: blur(6px);
    animation: techMeshDrift 24s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

/* keep your login shell above the animated background */
.login-shell {
    grid-template-columns: 1.4fr 1fr !important;
    /* left ≈ 58%, right ≈ 42% */
    align-items: stretch;
    border-radius: 28px;
    overflow: hidden;
    height: 640px !important;
}

/* smooth pan and drift */
@keyframes techGridPan {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }

    100% {
        background-position: 50px 50px, 0 40px, 40px 0;
    }
}

@keyframes techMeshDrift {
    0% {
        transform: translate3d(-3%, -2%, 0) scale(1);
    }

    100% {
        transform: translate3d(3%, 2%, 0) scale(1.06);
    }
}

/* optional diagonal shimmer sweep */
.theme-login-tech .login-shell::before {
    content: "";
    position: absolute;
    inset: -10%;
    background: linear-gradient(120deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, 0) 60%);
    animation: techSweep 10s linear infinite;
    pointer-events: none;
    z-index: -1;
    /* behind the shell content but above page bg */
    mix-blend-mode: soft-light;
    filter: blur(2px);
}

@keyframes techSweep {
    from {
        transform: translateX(-120%) translateY(-30%);
    }

    to {
        transform: translateX(120%) translateY(30%);
    }
}

/* accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {

    .theme-login-tech::before,
    .theme-login-tech::after,
    .theme-login-tech .login-shell::before {
        animation: none;
    }
}

/* ===== Official Website box under login ===== */
.extbox {
    margin-top: 20px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.extbox__title {
    font-size: 1.3rem;
    color: var(--label);
    margin: 2px 0 8px;
    font-weight: 600;
    letter-spacing: .2px;
}

.extbox__link {
    /* reuse .btn styles; make it feel a touch more “clickable” */
    border-color: color-mix(in oklab, var(--primary) 30%, var(--line));
}

.extbox__link:hover {
    filter: none;
    background: color-mix(in oklab, var(--primary) 10%, #fff);
    border-color: color-mix(in oklab, var(--primary) 45%, var(--line));
}

/* screen-reader only helper (for the form hint) */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    font-size: 1.2rem;
}




/* ===== Footer ===== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 24px 20px;
    text-align: center;
    margin-top: 40px;
}

.footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 6px;
    justify-items: center;
}

.footer__brand {
    font-weight: 600;
    color: var(--title);
}

.footer__copy {
    font-size: .85rem;
    color: var(--muted);
}

.footer__link {
    margin-top: 6px;
    font-size: .9rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer__link:hover {
    text-decoration: underline;
}



/* Badge style for申請方法 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
}

.badge--primary {
    background: var(--primary);
    color: var(--primary-ink);
}



/* ===== Online Seminar Section ===== */
/* =========================================================
   ONLINE SEMINAR CARDS (Responsive Button Version)
   Refined 2025-10 Stable Update
========================================================= */

.seminar-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
    margin-top: 2rem;
    padding: 0 0.5rem;
}

/* --- Card Container --- */
.seminar-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    padding: 1.6rem 1.4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seminar-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

/* --- Texts --- */
.seminar-card h3 {
    margin: 0 0 0.4rem;
    color: var(--title);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.4;
}

.seminar-card p {
    margin: 0 0 1.4rem;
    font-size: 0.96rem;
    color: #555;
    line-height: 1.6;
}

/* --- Button Wrapper --- */
.seminar-button-wrap {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

/* --- Test Button --- */
.test-btn {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--primary);
    color: var(--primary-ink);
    border: none;
    border-radius: 8px;
    padding: 0.75em 1.6em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.test-btn:hover {
    background: color-mix(in oklab, var(--primary) 85%, #fff);
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- Responsive Tweaks --- */
@media (max-width: 900px) {
    .seminar-card {
        padding: 1.3rem 1rem;
    }

    .seminar-card h3 {
        font-size: 1.05rem;
    }

    .seminar-card p {
        font-size: 0.9rem;
    }

    .test-btn {
        font-size: 1rem;
        padding: 0.7em 1.3em;
    }
}

@media (max-width: 500px) {
    .seminar-cards {
        gap: 1.2rem;
    }

    .seminar-card {
        padding: 1.2rem 0.9rem;
    }

    .seminar-card h3 {
        font-size: 1rem;
    }

    .seminar-card p {
        font-size: 0.88rem;
    }

    .test-btn {
        width: 100%;
        max-width: 220px;
        font-size: 0.98rem;
        padding: 0.65em 1.2em;
    }
}

/* ===== Online Seminar Section ===== */


/* ===== 単位table ===== */
/* =========================================================
   単位テーブル（Refined Responsive, Scrollable Style）
   ========================================================= */

/* ===== Styled Unit Periods Box ===== */
.unit-periods {
    width: 96%;
    margin-inline: auto;
    background: linear-gradient(180deg,
            color-mix(in oklab, var(--primary) 15%, #fff) 0%,
            color-mix(in oklab, var(--primary) 8%, #fff) 100%);
    border: 1px solid color-mix(in oklab, var(--primary) 35%, #fff);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    padding: 1.4em 1.6em;
    line-height: 1.75;
    font-size: 1.05rem;
    color: var(--title);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.unit-periods::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
    border-radius: 14px 0 0 14px;
    opacity: 0.85;
}

.unit-periods p {
    margin: 0.3em 0;
}

.unit-note {
    margin-top: 0.8em;
    color: #c00;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.4em 0.6em;
    border-left: 4px solid #c00;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* =========================================================
   Table Layout (Desktop Default)
   ========================================================= */

/* ===== Units Section Header ===== */
#unitsTableSection>h2 {
    background: linear-gradient(90deg,
            color-mix(in oklab, var(--primary) 18%, #fff) 0%,
            color-mix(in oklab, var(--primary) 8%, #fff) 100%);
    border: 1px solid color-mix(in oklab, var(--primary) 35%, #fff);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: var(--title);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
    position: relative;
}

/* optional cute icon before text */
#unitsTableSection>h2::before {
    content: "🧾";
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Optional consistency tweak */
#unitsTableSection {
    position: relative;
    padding-top: 1.5rem;
}

.units__table {
    width: 100%;
    margin-inline: auto;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    font-size: 1rem;
    table-layout: fixed;
}

.units__table th,
.units__table td {
    border: 1px solid #ccc;
    padding: 1.1em 1.2em;
    text-align: left;
    vertical-align: top;
    line-height: 1.7;
    word-break: break-word;
}

.units__table thead th {
    background: linear-gradient(90deg,
            var(--primary),
            color-mix(in oklab, var(--primary) 75%, white));
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.units__table th:nth-child(1),
.units__table td:nth-child(1) {
    width: 20%;
}

.units__table th:nth-child(2),
.units__table td:nth-child(2) {
    width: 28%;
}

.units__table th:nth-child(3),
.units__table td:nth-child(3) {
    width: 52%;
}

/* Highlight rows and organization column */
.unit-org {
    background: color-mix(in oklab, var(--primary) 12%, #fff);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.unit-warn {
    color: #c00;
    font-weight: 600;
}

.units__table tbody tr:nth-child(even) {
    background: color-mix(in oklab, var(--primary) 4%, #fff);
}

/* Ordered lists inside */
.units__table td ol {
    margin: 0.4em 0 0.4em 1.3em;
    padding: 0;
}

.units__table td ol li {
    margin-bottom: 0.4em;
}

/* =========================================================
   Collapsible Details (詳細 ▶)
   ========================================================= */
.detail-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-bottom: 0.6em;
}

.detail-toggle:hover {
    background: color-mix(in oklab, var(--primary) 85%, black);
    transform: translateY(-1px);
}

.detail-toggle::after {
    content: "▶";
    display: inline-block;
    font-size: 0.9em;
    transition: transform 0.25s ease;
}

.detail-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

.detail-content {
    margin-top: 0.5em;
    padding: 1em 1.2em;
    background: #fff8f8;
    border: 1px solid var(--line);
    border-radius: 10px;
    line-height: 1.7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    animation: fadeIn 0.25s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   Link Styling
   ========================================================= */
.units__table a,
.unit-periods a {
    color: color-mix(in oklab, var(--primary) 75%, black);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease, background-color 0.2s ease;
    text-underline-offset: 2px;
}

.units__table a:hover,
.unit-periods a:hover {
    color: var(--primary);
    background-color: color-mix(in oklab, var(--primary) 10%, #fff);
    text-decoration-thickness: 2px;
    border-radius: 4px;
    padding: 1px 2px;
}

.units__table a:focus-visible,
.unit-periods a:focus-visible {
    outline: 3px solid color-mix(in oklab, var(--primary) 60%, white);
    outline-offset: 2px;
    border-radius: 4px;
}

/* =========================================================
   Responsive Behavior — keep table horizontal, scrollable
   ========================================================= */
@media (max-width: 1024px) {
    .units__table {
        width: 100%;
        font-size: 0.95rem;
    }

    .units__table th,
    .units__table td {
        padding: 0.9em 1em;
    }
}

@media (max-width: 860px) {
    .units__table {
        display: block;
        width: 100%;
        overflow-x: auto;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .units__table::-webkit-scrollbar {
        height: 8px;
    }

    .units__table::-webkit-scrollbar-thumb {
        background: color-mix(in oklab, var(--primary) 40%, #ccc);
        border-radius: 8px;
    }

    .units__table th,
    .units__table td {
        white-space: nowrap;
        min-width: 200px;
    }

    .units__table th:nth-child(3),
    .units__table td:nth-child(3) {
        min-width: 400px;
    }

    .detail-toggle {
        font-size: 0.95rem;
        padding: 6px 12px;
    }

    .detail-content {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .unit-periods {
        font-size: 0.95rem;
        padding: 1.1em;
    }

    .units__table {
        font-size: 0.9rem;
    }

    .units__table th,
    .units__table td {
        padding: 0.7em 0.9em;
    }

    .detail-toggle {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
    }

    .detail-content {
        font-size: 0.9rem;
    }
}



/* full program  */
/* =========================================================
   FULL PROGRAM SECTION (Refined & Unified)
   - Clean structure, proper grouping, and working toggles
   - Hidden-by-default content for each group
   - 2025-10 stable version
========================================================= */

/* ===== Header Area ===== */
#programSection .section__head {
    background: linear-gradient(90deg,
            color-mix(in oklab, var(--primary) 18%, #fff) 0%,
            color-mix(in oklab, var(--primary) 8%, #fff) 100%);
    border: 1px solid color-mix(in oklab, var(--primary) 35%, #fff);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

#programSection .section__head h2 {
    margin: 0;
    color: var(--title);
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
}

/* Main table wrapper */
.program-table__wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    border-radius: 12px;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Table Base ===== */
.program-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    background: #fff;
    font-size: 1rem;
    border-radius: 12px;
}

.program-table th,
.program-table td {
    border: 1px solid #ccc;
    padding: 0.8em 1em;
    vertical-align: top;
    line-height: 1.6;
    text-align: left;
}

.program-table thead th {
    background: var(--primary);
    color: #fff;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

.program-table td small {
    display: block;
    margin-top: 4px;
    color: #555;
    font-size: 1rem;
    line-height: 1.5;
}

/* Even row background for readability */
.program-table tbody tr:nth-child(even) {
    background: white;
}

/* Buttons inside table cells */
.program-table td button {
    white-space: nowrap;
}

/* ===== Group Title Rows ===== */
.group-row {
    background-color: white;
    font-weight: 700;
    color: var(--title);
    text-align: left;
    font-size: 1.1rem;
}

.group-row td {
    padding: 1em 1.5em;
    position: relative;
}

/* Center text for 単位 and 研修 columns */
.program-table td:nth-child(3),
.program-table td:nth-child(4),
.program-table td:nth-child(5) {
  text-align: center;
  vertical-align: middle;
}

/* ===== Custom background: 学会指定研修プログラム & 市民公開講座 ===== */



/* ===== 表示 / 非表示 Button ===== */
.toggle-group-btn {
    float: right;
    font-size: 0.9rem;
    background-color: var(--accent, #2b7de9);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.4em 1em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.toggle-group-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ===== Hidden Group Content ===== */
.group-content {
    display: table-row;
    ;
    /* hidden by default */
    animation: fadeSlideIn 0.25s ease forwards;
}

/* smooth open animation */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 700px) {

    .program-table th,
    .program-table td {
        font-size: 0.9rem;
        padding: 0.6em;
    }

    .toggle-group-btn {
        font-size: 0.8rem;
        padding: 0.3em 0.9em;
    }
}


/* full program  */

/* video  */

/* =========================
   VIDEO MODAL (Centered Overlay)
========================= */
#videoModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#videoModal[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
}

#videoModal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

#videoModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#videoModal[aria-hidden="true"] {
    opacity: 0;
    pointer-events: none;
}

#videoModal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal__content {
    position: relative;
    z-index: 10;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.player__wrap {
    width: 100%;
    height: 100%;
}


#videoModal iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* optional smooth fade animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 640px) {
    #videoModal .modal__content {
        width: 95%;
        aspect-ratio: 16 / 9;
    }
}