/* static/css/roudou_hoken.css
   労働保険料の計算(トップ・雇用保険料率・労災保険率表)専用の独自CSS(他ツールのCSSは読み込まない・共有しない)。 */
.breadcrumbs {
    margin: 1rem 0 1.25rem;
    font-size: .875rem;
    text-align: left;
}
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.breadcrumbs li {
    display: flex;
    align-items: center;
}
.breadcrumbs li:not(:last-child)::after {
    content: ">";
    margin-left: .375rem;
    color: #666;
}
.breadcrumbs a {
    color: #0066cc;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.breadcrumbs span[aria-current="page"] {
    color: #333;
    font-weight: 600;
}
.rh-page {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 1rem 2.5rem;
    box-sizing: border-box;
    background: #f6f8fb;
    font-family: 'M PLUS 1p', 'Sawarabi Gothic', sans-serif;
    line-height: 1.7;
    color: #1f2a44;
}
.rh-page h1 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin: 1.5rem 0 0.6rem;
    color: #111827;
}
.rh-page section {
    margin: 2rem 0 0;
}
.rh-page section > p {
    margin: 0 0 0.9rem;
    color: #374151;
}
.rh-page h2 {
    font-size: 1.15rem;
    margin: 0 0 0.9rem;
    color: #222222;
}
.rh-lead {
    color: #4b5563;
    margin: 0 0 1rem;
}
.rh-hint {
    font-size: 0.875rem;
    color: #4b5563;
}

/* ===== 最新値 ===== */
.rh-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
}
.rh-stat {
    padding: 0.9rem 1rem;
    background: #ffffff;
    border: 0.0625rem solid #dbe4f0;
    border-radius: 0.875rem;
}
.rh-stat--big {
    grid-column: 1 / -1;
    background: #eef4ff;
    border-color: #c7d9f7;
}
.rh-stat__label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.3rem;
}
.rh-stat__value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
}
.rh-stat--big .rh-stat__label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
}
.rh-stat--big .rh-stat__value {
    font-size: 1.9rem;
    color: #1d4ed8;
}
.rh-stat__sub {
    margin-top: 0.3rem;
    font-size: 0.8125rem;
    color: #4b5563;
}
.rh-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0 1rem;
}
.rh-field {
    margin-bottom: 1rem;
}
.rh-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.4rem;
}
.rh-input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 0.9375rem;
    padding: 0.6rem 0.75rem;
    border: 0.0625rem solid #d6deeb;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1f2a44;
}
.rh-input:focus {
    outline: none;
    border-color: #9eb8ef;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.18);
}
.rh-error {
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.9rem;
    color: #b42318;
    background: #fffafa;
    border: 0.0625rem solid #f1c0c0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
}

/* ===== 表(article-table相当の見た目) ===== */
.rh-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.rh-table {
    width: 100%;
    min-width: 26rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
    background: #fff;
}
.rh-table th,
.rh-table td {
    border: 0.0625rem solid #cfcfcf;
    padding: 0.5rem 0.75rem;
    text-align: left;
    line-height: 1.5;
}
.rh-table thead th {
    background: #f2f2f2;
    font-weight: 700;
    white-space: nowrap;
}
.rh-table tr:nth-child(even) td {
    background: #fcfcfc;
}
.rh-table a {
    color: #2f6ae6;
}

/* ===== リンク ===== */
.rh-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.4rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
}
.rh-links--wide {
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.rh-links a,
.rh-hint a,
.rh-source a {
    color: #2f6ae6;
}
.rh-links span[aria-current="page"] {
    font-weight: 700;
    color: #111827;
}
.rh-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.75rem;
}
.rh-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.08);
    text-decoration: none;
    color: #222222;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rh-card:hover,
.rh-card:focus-visible {
    transform: translateY(-0.0938rem);
    box-shadow: 0 0.3125rem 1rem rgba(47, 106, 230, 0.16);
    outline: none;
}
.rh-card__title {
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.rh-card__meta {
    font-size: 0.8125rem;
    color: #4b5563;
}
.rh-card__more {
    margin-top: auto;
    padding-top: 0.4rem;
    color: #2f6ae6;
    font-size: 0.8125rem;
    font-weight: 700;
}
.rh-source {
    margin: 2rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}
.rh-source p {
    margin: 0 0 0.3rem;
}

/* ===== 業種の選択(経営指標ツールと同じ形のポップアップ) ===== */
.rh-field__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.4rem;
}
.rh-picker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    padding: 0.4rem 0.45rem 0.4rem 0.75rem;
    border: 0.0625rem solid #d6deeb;
    border-radius: 0.5rem;
    background: #ffffff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1f2a44;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rh-picker-btn:hover,
.rh-picker-btn:focus-visible {
    border-color: #9eb8ef;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.15);
    outline: none;
}
.rh-picker-btn__text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.rh-picker-btn__icon {
    flex: 0 0 auto;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #e8f0fe;
    font-size: 0.75rem;
    color: #2f6ae6;
}

.rh-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.rh-modal[hidden] {
    display: none;
}
.rh-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    animation: rh-fade 0.2s ease-out;
}
.rh-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(44rem, 100%);
    max-height: min(80vh, 40rem);
    overflow: hidden;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.3);
    animation: rh-pop 0.2s ease-out;
}
.rh-modal__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.9rem 0.7rem 1.1rem;
    border-bottom: 0.0625rem solid #e2e8f0;
}
.rh-modal__title {
    font-weight: 700;
    color: #1f2a44;
}
.rh-modal__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    color: #475569;
    cursor: pointer;
}
.rh-modal__close:hover {
    background: #e2e8f0;
}
/* 長いときは、この中だけを右端のスクロールバーで送る */
.rh-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.75rem 1rem 1rem 1.1rem;
    scrollbar-width: thin;
    scrollbar-color: #9eb8ef transparent;
}
.rh-modal__body::-webkit-scrollbar {
    width: 0.5rem;
}
.rh-modal__body::-webkit-scrollbar-thumb {
    border-radius: 1rem;
    background: #9eb8ef;
}
html.rh-modal-open {
    overflow: hidden;
}
@keyframes rh-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes rh-pop {
    from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.rh-picker__group {
    margin-bottom: 0.6rem;
}
.rh-picker__group:last-child {
    margin-bottom: 0;
}
.rh-picker__label {
    display: inline-block;
    margin-bottom: 0.25rem;
    padding: 0 0.45rem;
    border-left: 0.25rem solid var(--rh-cat-line);
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
}
.rh-picker__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.35rem;
}
.rh-tile {
    min-height: 2.6rem;
    padding: 0.35rem 0.55rem;
    border: 0.0625rem solid var(--rh-cat-border);
    border-radius: 0.5rem;
    background: var(--rh-cat-bg);
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #1f2a44;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.rh-tile:hover,
.rh-tile:focus-visible {
    border-color: var(--rh-cat-line);
    box-shadow: 0 0.15rem 0.5rem rgba(15, 23, 42, 0.1);
    transform: translateY(-0.0625rem);
    outline: none;
}
.rh-tile[aria-pressed="true"] {
    border-color: var(--rh-cat-line);
    background: var(--rh-cat-line);
    color: #ffffff;
    font-weight: 700;
}
/* 分類ごとの色(背景・枠・選択中) */
.rh-cat-1 { --rh-cat-bg: #f1f5f9; --rh-cat-border: #cbd5e1; --rh-cat-line: #475569; }
.rh-cat-2 { --rh-cat-bg: #eef4ff; --rh-cat-border: #c7d9f7; --rh-cat-line: #2563eb; }
.rh-cat-3 { --rh-cat-bg: #ecfdf3; --rh-cat-border: #bbe5c8; --rh-cat-line: #15803d; }
.rh-cat-4 { --rh-cat-bg: #fff7ed; --rh-cat-border: #fed7aa; --rh-cat-line: #c2410c; }
.rh-cat-5 { --rh-cat-bg: #fefce8; --rh-cat-border: #fde68a; --rh-cat-line: #a16207; }
.rh-cat-6 { --rh-cat-bg: #f5f3ff; --rh-cat-border: #ddd6fe; --rh-cat-line: #6d28d9; }
.rh-cat-7 { --rh-cat-bg: #ecfeff; --rh-cat-border: #a5f3fc; --rh-cat-line: #0e7490; }
.rh-cat-8 { --rh-cat-bg: #fdf2f8; --rh-cat-border: #fbcfe8; --rh-cat-line: #be185d; }
.rh-cat-9 { --rh-cat-bg: #f0fdfa; --rh-cat-border: #99f6e4; --rh-cat-line: #0f766e; }
.rh-cat-10 { --rh-cat-bg: #fef2f2; --rh-cat-border: #fecaca; --rh-cat-line: #b91c1c; }
.rh-picker-btn {
    min-height: 2.75rem;
}
.rh-picker__grid--pref {
    grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
}


/* ===== パネル(検索・計算) ===== */
.rh-page .rh-panel {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.08);
}
.rh-panel .rh-stat-grid,
.rh-panel .rh-table-wrap {
    margin-bottom: 0.9rem;
}
.rh-panel .rh-stat {
    background: #fbfdff;
}
.rh-panel .rh-stat--big {
    background: #eef4ff;
}
.rh-note {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.9rem;
    font-size: 0.8125rem;
    color: #7c2d12;
    background: #fff7ed;
    border: 0.0625rem solid #fed7aa;
    border-radius: 0.75rem;
}
.rh-panel .rh-hint:empty {
    display: none;
}

/* ===== 表の行の種類 ===== */
.rh-table td {
    white-space: nowrap;
}
.rh-table td:first-child {
    white-space: normal;
}
.rh-table tr.is-none td {
    color: #94a3b8;
}
.rh-table tr.is-average td {
    background: #eef4ff;
    font-weight: 700;
}

/* ===== グラフ ===== */
.rh-graph {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.08);
}
.rh-grid {
    stroke: #e5e9f0;
    stroke-width: 1;
}
.rh-axis-label {
    font-size: 11px;
    fill: #64748b;
}
.rh-line {
    fill: none;
    stroke: #2f6ae6;
    stroke-width: 2.5;
    stroke-linejoin: round;
}
.rh-point {
    fill: #2f6ae6;
}
.rh-point--low {
    fill: #f97316;
}
.rh-point-label {
    font-size: 12px;
    font-weight: 700;
    fill: #1f2a44;
}
.rh-details {
    margin-top: 0.75rem;
}
.rh-details summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    color: #2f6ae6;
    margin-bottom: 0.5rem;
}

@media (max-width: 36rem) {
    .rh-page h1 {
        font-size: 1.3rem;
    }
    .rh-page .rh-panel {
        padding: 1rem 0.9rem 1.25rem;
        border-radius: 1rem;
    }
    .rh-table {
        font-size: 0.875rem;
    }
}

/* 長い表の途中の広告(appbomb/ad_mid.py の基準で、表を分けて入れる) */
.rh-ad-mid {
    margin: 1.25rem 0;
}

/* ===== チップ(事業の種類・払い方) ===== */
.rh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.rh-chip {
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border: 0.0625rem solid #d6deeb;
    border-radius: 999px;
    background: #fbfdff;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rh-chip:hover {
    border-color: #9eb8ef;
    color: #2f6ae6;
}
.rh-chip.is-active {
    background: #2f6ae6;
    border-color: #2f6ae6;
    color: #ffffff;
}
.rh-page section > .rh-chips {
    margin: 0 0 0.6rem;
}
/* 建設業の事業の種類(名前が長いので角丸の札にする) */
.rh-chips--tiles .rh-chip {
    border-radius: 0.5rem;
    text-align: left;
    line-height: 1.4;
}
.rh-field .rh-hint {
    margin: 0.4rem 0 0;
}
.rh-tile__rate {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.8;
}
.rh-panel + .rh-panel {
    margin-top: 1.25rem;
}

/* ===== 計算のしかた ===== */
.rh-steps {
    margin: 0 0 0.9rem;
    padding-left: 1.4rem;
    color: #374151;
}
.rh-steps li {
    margin-bottom: 0.5rem;
}

/* ===== 表 ===== */
/* 早見表は3列なので、スマホ幅でも横に送らずに収める */
.rh-table--num {
    min-width: 0;
}
.rh-table--num td {
    text-align: right;
}
.rh-table--num td:first-child {
    text-align: left;
}
.rh-table--history {
    min-width: 36rem;
}
.rh-table--history th,
.rh-table--history td {
    text-align: center;
}
.rh-table--history td:first-child {
    text-align: left;
    white-space: nowrap;
}
/* 広告で表が2つに分かれても列幅がそろうように、幅を決める */
.rh-table--rousai {
    table-layout: fixed;
    min-width: 30rem;
}
.rh-table--rousai th:nth-child(1) {
    width: 6.5rem;
}
.rh-table--rousai th:nth-child(2) {
    width: 3.75rem;
}
.rh-table--rousai th:nth-child(4) {
    width: 6.5rem;
}
.rh-table--rousai td:nth-child(1),
.rh-table--rousai td:nth-child(3) {
    white-space: normal;
}
.rh-table tr[hidden] {
    display: none;
}

/* ===== 雇用保険料率の推移のグラフ ===== */
.rh-graph-wrap {
    margin: 0 0 1rem;
    padding: 0.75rem 0.75rem 0.5rem;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.08);
}
.rh-graph-wrap .rh-graph {
    box-shadow: none;
    border-radius: 0;
}
.rh-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 0.25rem;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: #374151;
}
.rh-legend__mark {
    display: inline-block;
    width: 1rem;
    height: 0.2rem;
    margin-right: 0.35rem;
    vertical-align: middle;
    border-radius: 0.1rem;
}
.rh-legend__mark--worker {
    background: #2f6ae6;
}
.rh-legend__mark--employer {
    background: #ea580c;
}
.rh-line--worker {
    stroke: #2f6ae6;
}
.rh-line--employer {
    stroke: #ea580c;
}
.rh-graph .rh-line {
    stroke-width: 2;
}
.rh-graph .rh-point-label {
    font-size: 11px;
}
.rh-hit {
    fill: transparent;
}
.rh-hit:hover {
    fill: rgba(47, 106, 230, 0.06);
}
.rh-graph-wrap figcaption {
    margin-top: 0.25rem;
}
