:root {
    --bg: #eef3f4;
    --surface: #ffffff;
    --ink: #17303a;
    --muted: #5b7380;
    --line: #d5e1e6;
    --teal: #0f5c66;
    --teal-2: #147a86;
    --teal-soft: #e4f4f5;
    --coral: #c45c4a;
    --amber: #b86a12;
    --green: #1f7a4d;
    --navy: #1c3d55;
    --shadow: 0 10px 30px rgba(23, 48, 58, 0.08);
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, #d7eef0 0%, transparent 55%),
        radial-gradient(900px 400px at 100% 0%, #f7e9e4 0%, transparent 50%),
        var(--bg);
    color: var(--ink);
    line-height: 1.65;
}

.app-header {
    background: linear-gradient(135deg, #0f5c66 0%, #1c3d55 100%);
    color: #fff;
    padding: 18px 24px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(15, 92, 102, 0.25);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    display: grid;
    place-items: center;
    font-size: 22px;
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand p {
    font-size: 0.78rem;
    opacity: 0.85;
}

.disclaimer {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: 8px 12px;
    max-width: 520px;
}

.nav-tabs {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-tab {
    border: 0;
    background: #fff;
    color: var(--muted);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.nav-tab.active {
    background: var(--teal);
    color: #fff;
}

.wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 24px 48px;
}

.panel { display: none; }
.panel.active { display: block; animation: fade .25s ease; }

@keyframes fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 12px;
}

.search-row input, .filter-chip {
    font: inherit;
}

.search-row input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-chip {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--muted);
}

.filter-chip.on {
    background: var(--teal-soft);
    border-color: var(--teal);
    color: var(--teal);
    font-weight: 700;
}

.guide-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    align-items: start;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(213, 225, 230, 0.8);
}

.list-card { overflow: hidden; }

.disease-list {
    max-height: calc(100vh - 240px);
    overflow: auto;
}

.disease-item {
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 12px 14px;
    cursor: pointer;
}

.disease-item:hover { background: #f4fbfb; }

.disease-item.active {
    background: var(--teal-soft);
    box-shadow: inset 4px 0 0 var(--teal);
}

.disease-item .name {
    font-weight: 700;
    display: block;
}

.disease-item .meta {
    font-size: 0.78rem;
    color: var(--muted);
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-right: 4px;
}

.badge.sti { background: #fde8e4; color: var(--coral); }
.badge.notify { background: #fff3d9; color: var(--amber); }
.badge.partner { background: #e8f6ee; color: var(--green); }
.badge.preg { background: #e7eef8; color: var(--navy); }

.detail { padding: 22px 24px 28px; min-height: 480px; }

.detail h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.en {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.summary {
    background: var(--teal-soft);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0 18px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

h3 {
    font-size: 0.95rem;
    color: var(--teal);
    margin: 18px 0 8px;
    letter-spacing: 0.04em;
}

ul { padding-left: 1.15rem; }
li { margin: 4px 0; }

.treat-table, .plain-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.treat-table th, .treat-table td,
.plain-table th, .plain-table td {
    border-bottom: 1px solid var(--line);
    padding: 8px 8px;
    vertical-align: top;
    text-align: left;
}

.treat-table th, .plain-table th {
    background: #f7fafb;
    font-size: 0.78rem;
    color: var(--muted);
}

.preg-ok { color: var(--green); font-weight: 700; }
.preg-ng { color: var(--coral); font-weight: 700; }
.preg-caution { color: var(--amber); font-weight: 700; }

.note-box {
    border-left: 4px solid var(--teal);
    background: #f7fbfb;
    padding: 10px 12px;
    margin-top: 8px;
    border-radius: 0 10px 10px 0;
}

.warn-box {
    border-left: 4px solid var(--coral);
    background: #fdf6f4;
    padding: 10px 12px;
    margin-top: 8px;
    border-radius: 0 10px 10px 0;
}

.toolbar {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.btn {
    border: 0;
    background: var(--navy);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.btn.ghost {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--line);
}

.empty {
    color: var(--muted);
    padding: 40px 12px;
    text-align: center;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tool-card { padding: 18px; }

.check-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 8px 0;
}

.result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
}

.result.yes { background: #e8f6ee; color: var(--green); }
.result.no { background: #f4f6f7; color: var(--muted); }
.result.warn { background: #fff3d9; color: var(--amber); }

.sources {
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--muted);
}

.sources.disease-sources {
    margin-top: 16px;
    margin-bottom: 0;
}

.treat-source {
    color: var(--muted);
    font-size: 0.75rem;
}

.panel-sources {
    margin: 8px 4px 24px;
}

@media (max-width: 980px) {
    .guide-layout, .grid-2 { grid-template-columns: 1fr; }
    .disease-list { max-height: 280px; }
    .brand h1 { font-size: 1.05rem; }
}

@media print {
    .app-header, .nav-tabs, .search-row, .filter-bar, .list-card, .toolbar, .nav-tab {
        display: none !important;
    }
    body { background: #fff; }
    .guide-layout { display: block; }
    .detail { box-shadow: none; border: 0; }
}
