/* static/css/roumu_tanka.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;
}
.rt-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;
}
.rt-page h1 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin: 1.5rem 0 0.6rem;
    color: #111827;
}
.rt-page section {
    margin: 2rem 0 0;
}
.rt-page section > p {
    margin: 0 0 0.9rem;
    color: #374151;
}
.rt-page h2 {
    font-size: 1.15rem;
    margin: 0 0 0.9rem;
    color: #222222;
}
.rt-lead {
    color: #4b5563;
    margin: 0 0 1rem;
}
.rt-hint {
    font-size: 0.875rem;
    color: #4b5563;
}

/* ===== 最新値 ===== */
.rt-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
}
.rt-stat {
    padding: 0.9rem 1rem;
    background: #ffffff;
    border: 0.0625rem solid #dbe4f0;
    border-radius: 0.875rem;
}
.rt-stat--big {
    grid-column: 1 / -1;
    background: #eef4ff;
    border-color: #c7d9f7;
}
.rt-stat__label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.3rem;
}
.rt-stat__value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
}
.rt-stat--big .rt-stat__label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
}
.rt-stat--big .rt-stat__value {
    font-size: 1.9rem;
    color: #1d4ed8;
}
.rt-stat__sub {
    margin-top: 0.3rem;
    font-size: 0.8125rem;
    color: #4b5563;
}
.rt-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0 1rem;
}
.rt-field {
    margin-bottom: 1rem;
}
.rt-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.4rem;
}
.rt-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;
}
.rt-input:focus {
    outline: none;
    border-color: #9eb8ef;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.18);
}
.rt-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相当の見た目) ===== */
.rt-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.rt-table {
    width: 100%;
    min-width: 26rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
    background: #fff;
}
.rt-table th,
.rt-table td {
    border: 0.0625rem solid #cfcfcf;
    padding: 0.5rem 0.75rem;
    text-align: left;
    line-height: 1.5;
}
.rt-table thead th {
    background: #f2f2f2;
    font-weight: 700;
    white-space: nowrap;
}
.rt-table tr:nth-child(even) td {
    background: #fcfcfc;
}
.rt-table a {
    color: #2f6ae6;
}

/* ===== リンク ===== */
.rt-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;
}
.rt-links--wide {
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}
.rt-links a,
.rt-hint a,
.rt-source a {
    color: #2f6ae6;
}
.rt-links span[aria-current="page"] {
    font-weight: 700;
    color: #111827;
}
.rt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.75rem;
}
.rt-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;
}
.rt-card:hover,
.rt-card:focus-visible {
    transform: translateY(-0.0938rem);
    box-shadow: 0 0.3125rem 1rem rgba(47, 106, 230, 0.16);
    outline: none;
}
.rt-card__title {
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.rt-card__meta {
    font-size: 0.8125rem;
    color: #4b5563;
}
.rt-card__more {
    margin-top: auto;
    padding-top: 0.4rem;
    color: #2f6ae6;
    font-size: 0.8125rem;
    font-weight: 700;
}
.rt-source {
    margin: 2rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}

/* ===== 都道府県・職種の選択(経営指標ツールと同じ形のポップアップ) ===== */
.rt-field__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.4rem;
}
.rt-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;
}
.rt-picker-btn:hover,
.rt-picker-btn:focus-visible {
    border-color: #9eb8ef;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.15);
    outline: none;
}
.rt-picker-btn__text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.rt-picker-btn__icon {
    flex: 0 0 auto;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #e8f0fe;
    font-size: 0.75rem;
    color: #2f6ae6;
}

.rt-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.rt-modal[hidden] {
    display: none;
}
.rt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    animation: rt-fade 0.2s ease-out;
}
.rt-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: rt-pop 0.2s ease-out;
}
.rt-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;
}
.rt-modal__title {
    font-weight: 700;
    color: #1f2a44;
}
.rt-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;
}
.rt-modal__close:hover {
    background: #e2e8f0;
}
/* 長いときは、この中だけを右端のスクロールバーで送る */
.rt-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;
}
.rt-modal__body::-webkit-scrollbar {
    width: 0.5rem;
}
.rt-modal__body::-webkit-scrollbar-thumb {
    border-radius: 1rem;
    background: #9eb8ef;
}
html.rt-modal-open {
    overflow: hidden;
}
@keyframes rt-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes rt-pop {
    from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
    to { opacity: 1; transform: none; }
}

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


/* ===== パネル(検索・計算) ===== */
.rt-page .rt-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);
}
.rt-panel .rt-stat-grid,
.rt-panel .rt-table-wrap {
    margin-bottom: 0.9rem;
}
.rt-panel .rt-stat {
    background: #fbfdff;
}
.rt-panel .rt-stat--big {
    background: #eef4ff;
}
.rt-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;
}
.rt-panel .rt-hint:empty {
    display: none;
}

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

/* ===== 加重平均のグラフ ===== */
.rt-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);
}
.rt-grid {
    stroke: #e5e9f0;
    stroke-width: 1;
}
.rt-axis-label {
    font-size: 11px;
    fill: #64748b;
}
.rt-line {
    fill: none;
    stroke: #2f6ae6;
    stroke-width: 2.5;
    stroke-linejoin: round;
}
.rt-point {
    fill: #2f6ae6;
}
.rt-point--low {
    fill: #f97316;
}
.rt-point-label {
    font-size: 12px;
    font-weight: 700;
    fill: #1f2a44;
}
.rt-details {
    margin-top: 0.75rem;
}
.rt-details summary {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 700;
    color: #2f6ae6;
    margin-bottom: 0.5rem;
}

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

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