* {
    box-sizing: border-box;
    touch-action: manipulation;
}

:root {
    --bg-0: #06131a;
    --bg-1: #0b1f2a;
    --card: rgba(10, 28, 38, 0.78);
    --stroke: rgba(120, 220, 210, 0.18);
    --mint: #5eead4;
    --mint-deep: #14b8a6;
    --ink: #e8f6f4;
    --muted: #93b0b4;
    --key: #16313c;
    --key-hover: #1e4250;
}

body {
    width: min(980px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 42px 28px 56px;
    color: var(--ink);
    text-align: center;
    font-family: "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(20, 184, 166, 0.22), transparent 55%),
        radial-gradient(900px 500px at 110% 10%, rgba(56, 189, 248, 0.16), transparent 50%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1) 55%, #07151c);
}

h1 {
    margin: 0;
    color: var(--ink);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.04em;
}

p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

form {
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.user-info button {
    min-height: 34px;
    padding: 5px 14px;
    color: var(--ink);
    font: 600 13px "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
    background: var(--key);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-info button:hover {
    background: var(--key-hover);
    border-color: rgba(94, 234, 212, 0.4);
}

/* App launcher: four icons per row, with labels below each icon. */
.app-menu {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px 24px;
    width: min(760px, 100%);
    margin: 38px auto 0;
    padding: 16px 0 20px;
}
.app-menu .app-launcher {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
    border-radius: 18px;
    -webkit-tap-highlight-color: transparent;
}
.app-menu .app-icon {
    display: block;
    width: min(100%, 116px);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 24%;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .16));
    transition: transform .15s ease;
}
.app-menu .app-name {
    max-width: 100%;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}
.app-menu a:focus-visible {outline: 2px solid var(--mint); outline-offset: 6px;}
.app-menu a:active .app-icon {transform: scale(.95);}
@media (hover: hover) {
    .app-menu a:hover .app-icon {transform: translateY(-3px);}
}
@media (prefers-reduced-motion: reduce) {
    .app-menu .app-icon {transition: none;}
}

@media (max-width: 600px) {
    body {
        padding: 28px 16px 36px;
    }

    h1 {
        font-size: 29px;
    }

    .user-info {
        margin-top: 10px;
        font-size: 13px;
    }

    p {
        margin-top: 10px;
        font-size: 14px;
    }

    .app-menu {
        gap: 24px 12px;
        padding: 14px 0 18px;
    }
    .app-menu .app-launcher {gap: 8px;}
    .app-menu .app-icon {width: min(100%, 78px);}
    .app-menu .app-name {font-size: clamp(10px, 2.8vw, 14px);}
    .app-menu .app-name--single {font-size: clamp(8px, 2.35vw, 12px);}

}

/* HOME header and layout */
body.home-page {
    width: 100%;
    padding: 0 0 36px;
}
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 28px;
    padding: 20px clamp(16px, 3vw, 48px);
    text-align: left;
    background: rgba(6, 19, 26, 0.65);
    border-bottom: 1px solid var(--stroke);
}
.home-brand {min-width: 0;}
.home-brand h1 {font-size: 24px; letter-spacing: 0.02em;}
.home-brand p {margin-top: 6px; font-size: 13px;}
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 14px;
    min-width: 0;
    margin-left: auto;
    font-size: 13px;
}
.login-id {color: var(--muted); overflow-wrap: anywhere;}
.contact-link, .logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    font: 600 13px "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
    text-decoration: none;
    cursor: pointer;
}
.contact-link {color: var(--mint); background: rgba(20, 184, 166, 0.08);}
.logout-button {color: var(--ink); background: var(--key);}
.contact-link:hover, .logout-button:hover {background: var(--key-hover); border-color: var(--mint-deep);}
.contact-link:focus-visible, .logout-button:focus-visible {outline: 2px solid var(--mint); outline-offset: 3px;}
.home-page main {padding: 0 clamp(16px, 3vw, 48px);}
.home-page .app-menu {margin-top: 24px;}
@media (max-width: 600px) {
    .home-header {padding: 16px; gap: 14px;}
    .home-brand h1 {font-size: 21px;}
    .home-brand p {font-size: 12px;}
    .header-actions {width: 100%; margin-left: 0; justify-content: flex-start; gap: 8px;}
    .login-id {width: 100%; font-size: 12px;}
    .home-page .app-menu {margin-top: 18px;}
}
/* お知らせ：既存HOMEの配色に合わせる */
.news-space {margin:32px 0 0;padding:24px;text-align:left;background:var(--card);border:1px solid var(--stroke);border-radius:20px;}
.news-space a {color:var(--mint);overflow-wrap:anywhere;}
.news-heading {display:flex;align-items:center;justify-content:space-between;gap:16px;}
.news-heading h2 {margin:0;font-size:22px;}
.news-tabs {display:flex;gap:8px;flex-wrap:wrap;margin:18px 0;}
.news-tabs a {padding:12px 16px;border:1px solid var(--stroke);border-radius:10px;text-decoration:none;color:var(--ink);background:var(--key);}
.news-tabs a[aria-current=page] {color:var(--bg-0);background:var(--mint);font-weight:700;}
.news-space a:focus-visible,.news-space button:focus-visible,.news-space input:focus-visible,.news-table-scroll:focus-visible {outline:2px solid var(--mint);outline-offset:3px;}
.news-meta {font-size:13px;line-height:1.8;}
.news-meta strong {color:var(--mint);}
.news-search {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:20px;}
.news-search input {flex:1;min-width:180px;padding:12px;border-radius:8px;border:1px solid var(--stroke);background:var(--bg-0);color:var(--ink);font:inherit;}
.news-search button {padding:12px 20px;border:1px solid var(--stroke);border-radius:8px;background:var(--key);color:var(--ink);font:inherit;cursor:pointer;}
.news-table-scroll {overflow:auto;margin-top:12px;}
.news-table {width:100%;min-width:850px;border-collapse:collapse;font-size:14px;}
.news-table th,.news-table td {padding:14px 12px;text-align:left;vertical-align:top;border-bottom:1px solid var(--stroke);}
.news-table th {color:var(--mint);background:var(--bg-0);}
.news-table td:first-child {min-width:240px;}
.news-table small {display:block;margin-top:7px;color:var(--muted);line-height:1.6;}
.news-table details {min-width:180px;}
.news-table summary {cursor:pointer;color:var(--mint);}
.news-category {margin-top:28px;padding:0 18px 8px;border:1px solid var(--stroke);border-radius:14px;background:rgba(6,19,26,0.3);}
.news-category h3 {margin:0 -18px 8px;padding:16px 18px;border-bottom:1px solid rgba(94,234,212,0.3);border-left:5px solid var(--mint);border-radius:14px 14px 0 0;background:rgba(20,184,166,0.16);color:var(--mint);font-size:21px;font-weight:700;line-height:1.6;overflow-wrap:anywhere;}
.news-category[data-section="important"] h3,.news-category[data-section="letter"] h3 {color:#fde68a;border-left-color:#fbbf24;border-bottom-color:rgba(251,191,36,0.3);background:rgba(251,191,36,0.12);}
.news-category .news-entry:last-child {border-bottom:0;}
.news-entry {padding:12px 0 20px;border-bottom:1px solid var(--stroke);}
.news-entry h4 {margin:7px 0;font-size:16px;font-weight:500;line-height:1.7;}
.news-body {line-height:1.8;margin-top:10px;overflow-wrap:anywhere;}
.news-pagination {display:flex;justify-content:center;gap:24px;margin-top:20px;}
.news-empty {padding:20px 0;}
@media(max-width:600px){.news-space{padding:16px;margin-top:24px;}.news-tabs{display:grid;grid-template-columns:1fr;width:100%;}.news-tabs a{text-align:center;}.news-search label{width:100%;}}
@media(max-width:600px){.news-category{padding:0 12px 4px;margin-top:22px;}.news-category h3{margin:0 -12px 8px;padding:13px 12px;font-size:18px;}}
.supply-new-badge {display:inline-block;margin-right:5px;padding:3px 9px;border-radius:6px;background:#fbbf24;color:#06131a;font-size:12px;font-weight:700;line-height:1.4;vertical-align:middle;}
.supply-new-row {background:rgba(251,191,36,0.035);}
.supply-new-row td:first-child {border-left:3px solid #fbbf24;}

/* Keep the signed-in account at the right edge of the HOME title. */
.home-header {flex-wrap: nowrap; gap: 12px;}
.home-brand {flex: 1;}
.home-login-status {min-width: 0; max-width: 45%; margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; overflow-wrap: anywhere;}
@media (max-width: 600px) {
    .home-brand h1 {font-size: clamp(16px, 4vw, 21px);}
    .home-login-status {font-size: 12px;}
}

.app-name--single {white-space: nowrap;}
@media (max-width: 600px) {
    .app-name--single {font-size: clamp(8px, 2.4vw, 14px);}
}

.news-search-toggle {margin-top: 20px;}
.news-search-toggle > summary {width: fit-content; padding: 10px 16px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--key); color: var(--mint); font-weight: 700; cursor: pointer;}
.news-search-toggle > summary:focus-visible {outline: 2px solid var(--mint); outline-offset: 3px;}
.news-search-toggle .news-search {margin-top: 12px;}

/* Supply status badges use the apps' mint, warm orange and rose palette. */
.supply-status {display: inline-block; padding: 4px 10px; border: 1px solid var(--stroke); border-radius: 8px; font-size: 13px; font-weight: 700; line-height: 1.6;}
.supply-status--normal {color: #5eead4; background: rgba(20, 184, 166, .14); border-color: rgba(94, 234, 212, .3);}
.supply-status--limited {color: #fb923c; background: rgba(251, 146, 60, .14); border-color: rgba(251, 146, 60, .3);}
.supply-status--stopped {color: #fb7185; background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .3);}

/* PMDA approval table: retain the source text and scroll on small screens. */
.approval-table { min-width: 1000px; table-layout: fixed; }
.approval-table th:first-child,.approval-table td:first-child { width: 130px; min-width: 130px; }
.approval-table th:nth-child(2) { width: 260px; }
.approval-table th:nth-child(3) { width: 70px; }
.approval-table th:nth-child(5) { width: 170px; }
.approval-table td { overflow-wrap: anywhere; }

.news-space .product-search-button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 8px 14px; border: 1px solid var(--mint);
    border-radius: 8px; background: var(--mint); color: var(--bg-0);
    font-weight: 700; text-decoration: none; white-space: nowrap;
}
.news-space .product-search-button:hover { filter: brightness(1.1); }

.approval-table .supply-status { white-space: nowrap; padding-inline: 6px; }

.guideline-notice-table { min-width: 480px; }
.guideline-notice-table th:last-child,.guideline-notice-table td:last-child { width: 100px; }
.guideline-notice-table td:first-child { overflow-wrap: anywhere; }

/* The full service name stays on row one; the signed-in account has its own row. */
.home-header { flex-direction: column; align-items: stretch; gap: 6px; }
.home-brand { flex: none; width: 100%; }
.home-brand h1 { margin: 0; white-space: nowrap; letter-spacing: 0; font-size: clamp(14px, 4.4vw, 24px); }
.home-login-status { align-self: flex-start; max-width: 100%; margin-left: 0; text-align: left; }

.home-brand .brand-tagline { font-size: .75em; font-weight: 500; }

/* Keep the approved mark colors while making its wordmark readable on dark HOME. */
.home-brand .home-logo-heading { display: flex; align-items: center; gap: clamp(6px, 1.5vw, 16px); font-size: clamp(14px, 3.8vw, 24px); }
.home-logo { position: relative; display: inline-block; flex: 0 0 auto; width: clamp(100px, 27vw, 180px); aspect-ratio: 3 / 1; }
.home-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.home-logo-white { filter: brightness(0) invert(1); }
.home-logo .home-logo-color { position: absolute; inset: 0; clip-path: inset(0 64% 0 0); }
.home-logo-heading .brand-tagline { white-space: nowrap; }

.home-logo-heading .brand-tagline { transform: translateY(3px); }

/* Native disclosure keeps HOME news compact until requested. */
.news-disclosure > summary {list-style: none; cursor: pointer; min-height: 44px;}
.news-disclosure > summary::-webkit-details-marker {display: none;}
.news-disclosure > summary:focus-visible {outline: 2px solid var(--mint); outline-offset: 6px; border-radius: 4px;}
.news-disclosure-arrow {width: 11px; height: 11px; margin-right: 5px; border-right: 2px solid var(--mint); border-bottom: 2px solid var(--mint); transform: rotate(45deg); flex: 0 0 auto;}
.news-disclosure[open] > summary .news-disclosure-arrow {transform: rotate(225deg);}
.news-disclosure-content {padding-top: 2px;}
.news-admin-link {margin-top: 12px; text-align: right;}

.procedure-filter {display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:20px 0 12px;}
.procedure-filter select,.procedure-filter button {min-height:44px; max-width:100%; padding:8px 12px; border:1px solid var(--stroke); border-radius:8px; background:var(--key); color:var(--ink); font:inherit;}
.procedure-filter select {flex:1; min-width:0;}
.procedure-filter button {cursor:pointer;}
.procedure-filter select:focus-visible {outline:2px solid var(--mint); outline-offset:3px;}
