@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=swap');

/* Palette adapted from katsumoku.com (WordPress "JIN" theme):
   navy #3b4675 (primary), gold #ffcd44 (highlight), teal #008db7 (links). */
:root {
    --bg: #f5f6f9;
    --panel: #ffffff;
    --text: #313131;
    --muted: #6b7280;
    --line: #e7e9f0;
    --accent: #3b4675;
    --accent-strong: #2e3860;
    --soft-accent: #eef0f7;
    --gold: #ffcd44;
    --link: #008db7;
    --positive: #0f9d8b;
    --negative: #d9333f;
    --neutral: #374151;
    --warning-bg: #fffdef;
    --warning-line: #ffe39a;
    --heading-font: "Quicksand", "ヒラギノ角ゴ ProN W3", Hiragino Sans, "ヒラギノ角ゴ ProN W3", Hiragino Kaku Gothic ProN, "メイリオ", Meiryo, sans-serif;
    --body-font: "Quicksand", "ヒラギノ角ゴ ProN W3", Hiragino Sans, "ヒラギノ角ゴ ProN W3", Hiragino Kaku Gothic ProN, "メイリオ", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--body-font);
    line-height: 1.55;
}

.page {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 320px);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--accent);
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 6px;
    font-weight: 700;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-family: var(--heading-font); }
h1 { font-size: clamp(30px, 4vw, 46px); letter-spacing: .01em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }

.lead {
    margin: 14px 0 0;
    color: var(--muted);
    max-width: 760px;
}

.status-card,
.kpi,
.exposure-card,
.watch-card,
.update-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.status-card {
    padding: 12px 16px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}
.status-card .value { font-size: 16px; }
.label { color: var(--muted); font-size: 13px; }
.value { font-size: 24px; font-weight: 700; margin-top: 4px; font-family: var(--heading-font); }
.sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.alert {
    background: var(--warning-bg);
    border: 1px solid var(--warning-line);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.kpi { padding: 0; overflow: hidden; }
.kpi .label {
    background: var(--accent);
    color: #ffffff;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
}
.kpi .value { padding: 12px 16px 0; }
.kpi .sub { padding: 2px 16px 14px; }

.summary-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 28px;
}
.summary-strip > div {
    background: var(--panel);
    padding: 14px 16px;
}
.summary-strip span { display: block; color: var(--muted); font-size: 12px; }
.summary-strip strong { display: block; margin-top: 4px; font-size: 17px; }

.section {
    margin-top: 28px;
}
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.section-heading h2 {
    padding-left: 13px;
    border-left: 5px solid var(--accent);
}
.section-heading h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 3px;
    margin-top: 6px;
    margin-left: -13px;
    background: var(--gold);
    border-radius: 999px;
}
.section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: auto;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}
th, td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    vertical-align: top;
    text-align: left;
    font-size: 14px;
}
th {
    background: var(--accent);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
td small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.memo { color: var(--muted); font-size: 12px; margin: 6px 0 0; max-width: 380px; }

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.links a {
    display: inline-block;
    color: var(--accent);
    background: var(--soft-accent);
    padding: 4px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: background-color .15s ease, color .15s ease;
}
.links a:hover {
    background: var(--gold);
    color: var(--accent-strong);
}

/* compact inline links used inside table cells (chart / report) */
.minilink {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--soft-accent);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.minilink:hover { background: var(--gold); color: var(--accent-strong); }
.ticker-line .minilink { margin-left: 6px; }

.exposure-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.exposure-card { padding: 18px; }
.exposure-row { margin-top: 14px; }
.exposure-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}
.bar {
    height: 8px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 7px;
}
.bar span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
}
.exposure-value { color: var(--muted); font-size: 12px; margin-top: 4px; }

.updates,
.watch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.update-card,
.watch-card { padding: 18px; }
.update-card time { color: var(--muted); font-size: 12px; }
.update-card p,
.watch-card p { color: var(--muted); font-size: 14px; }
.watch-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.watch-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.theme-line { color: var(--accent) !important; font-weight: 700; }
.watch-price { color: var(--text) !important; }

.disclaimer {
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
    margin-top: 36px;
    padding-top: 18px;
}

.is-positive { color: var(--positive); }
.is-negative { color: var(--negative); }
.is-neutral { color: var(--neutral); }
.is-muted { color: var(--muted); }

.side-long, .side-short { font-size: 12px; font-weight: 700; }
.side-long { color: var(--positive); }
.side-short { color: var(--negative); }

/* ── Global header / menu bar (adapted from katsumoku.com / JIN theme) ── */
#header-box { background: var(--accent); }
#header {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
}
#site-info { padding: 12px 0; }
#site-info a {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .04em;
    color: #f4f4f4;
    text-decoration: none;
}
#site-info a:hover { color: var(--gold); }

.global-nav .menu-box {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
}
.global-nav .menu-item { position: relative; }
.global-nav .menu-item > a {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 16px;
    color: #f4f4f4;
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
    white-space: nowrap;
    transition: color .15s ease;
}
.global-nav .menu-item > a:hover { color: var(--gold); }
.global-nav .menu-item-has-children > a::after {
    content: "\25BE";
    margin-left: 6px;
    font-size: 11px;
    opacity: .85;
}

.global-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    z-index: 30;
}
.global-nav .menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.global-nav .sub-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.global-nav .sub-menu a:hover { color: var(--accent); background: var(--soft-accent); }

#navtoggle { display: none; }
.sp-menu-open { display: none; }

@media (max-width: 767px) {
    #header { min-height: 56px; }
    .sp-menu-open {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0 10px;
        cursor: pointer;
    }
    .cps-icon-bar {
        display: block;
        height: 2px;
        background: #f4f4f4;
        border-radius: 2px;
        transition: transform .2s ease, opacity .2s ease;
    }
    .global-nav {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid var(--line);
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
        box-shadow: 0 16px 28px rgba(15, 23, 42, .12);
        z-index: 25;
    }
    #navtoggle:checked ~ .global-nav { max-height: 80vh; overflow: auto; }
    .global-nav .menu-box { display: block; }
    .global-nav .menu-item > a {
        height: auto;
        padding: 13px 18px;
        color: var(--text);
        border-bottom: 1px solid var(--line);
    }
    .global-nav .menu-item > a:hover { color: var(--accent); }
    .global-nav .menu-item-has-children > a::after { margin-left: auto; }
    .global-nav .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: #f7f8fa;
    }
    .global-nav .sub-menu a {
        padding: 11px 18px 11px 34px;
        border-bottom: 1px solid var(--line);
    }
    #navtoggle:checked ~ .sp-menu-open .cps-icon-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    #navtoggle:checked ~ .sp-menu-open .cps-icon-bar:nth-child(2) { opacity: 0; }
    #navtoggle:checked ~ .sp-menu-open .cps-icon-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 980px) {
    .hero,
    .kpi-grid,
    .summary-strip,
    .exposure-grid,
    .updates,
    .watch-grid {
        grid-template-columns: 1fr;
    }
    .section-heading { display: block; }
    .section-heading p { margin-top: 4px; }
}
