/* 日割り計算ツール 専用スタイル
   画面は hiwari_calculator.js が組み立てる(タブ・入力欄・設定・結果)。 */

.pt-hw-app {
    margin: 1rem 0 1.4rem;
}

/* ---- タブ ---- */
.pt-hw-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    margin-bottom: 0.7rem;
    -webkit-overflow-scrolling: touch;
}

.pt-hw-tab {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    border: 1px solid #ccd3da;
    border-radius: 0.7rem 0.7rem 0.3rem 0.3rem;
    background: #fff;
    color: var(--pt-blue);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}

.pt-hw-tab.is-active {
    background: var(--pt-blue);
    border-color: transparent;
    color: #fff;
}

/* ---- パネル ---- */
.pt-hw-panel {
    padding: 1rem;
    border: 1px solid var(--pt-green-border);
    border-radius: 1rem;
    background: linear-gradient(160deg, #f4f9ff 0%, var(--pt-green-bg) 100%);
}

.pt-hw-panel[hidden],
.pt-hw-field[hidden] {
    display: none;
}

.pt-hw-panel__title {
    margin: 0 0 0.2rem;
    font-size: 1.15rem;
}

.pt-hw-panel__lead {
    margin: 0 0 0.9rem;
    font-size: 0.85rem;
    color: #555;
}

/* ---- 入力欄 ---- */
.pt-hw-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1.2rem;
    margin-bottom: 0.9rem;
}

.pt-hw-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.pt-hw-field__label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #333;
}

.pt-hw-inputrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pt-hw-input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #ccd3da;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 1.05rem;
    min-width: 0;
}

.pt-hw-input:focus {
    outline: 2px solid var(--pt-blue-light);
    outline-offset: 1px;
}

.pt-hw-unit {
    font-size: 0.9rem;
    font-weight: 700;
    color: #555;
}

.pt-hw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.pt-hw-chip {
    padding: 0.15rem 0.6rem;
    border: 1px solid #ccd3da;
    border-radius: 62.5rem;
    background: #fff;
    color: #555;
    font-size: 0.75rem;
    cursor: pointer;
}

.pt-hw-chip:hover {
    background: var(--pt-green-bg);
    border-color: var(--pt-green-border);
}

/* 選択ボタン(ラジオの代わり) */
.pt-hw-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.pt-hw-seg__btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccd3da;
    border-radius: 0.5rem;
    background: #fff;
    color: #444;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.pt-hw-seg__btn.is-active {
    background: var(--pt-blue);
    border-color: transparent;
    color: #fff;
}

.pt-hw-seg__btn--toggle.is-active::before {
    content: '✓ ';
}

.pt-hw-hint {
    margin: 0.1rem 0 0;
    font-size: 0.72rem;
    color: #777;
}

/* ---- 計算の設定 ---- */
.pt-hw-settings {
    padding: 0.7rem 0.9rem;
    border: 1px dashed #b8c7d6;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.pt-hw-settings__title {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #667;
}

.pt-hw-settings__body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.6rem;
}

/* ---- 結果 ---- */
.pt-hw-result {
    margin-top: 0.2rem;
}

.pt-hw-total {
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--pt-blue) 0%, var(--pt-teal) 100%);
    color: #fff;
    text-align: center;
    margin-bottom: 0.9rem;
}

.pt-hw-total__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    opacity: 0.9;
}

.pt-hw-total__value {
    display: block;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.3;
}

.pt-hw-total__sub {
    display: block;
    font-size: 0.78rem;
    opacity: 0.9;
}

.pt-hw-block {
    padding: 0.8rem 0.9rem;
    border: 1px solid #e0e4e8;
    border-radius: 0.8rem;
    background: #fff;
    margin-bottom: 0.7rem;
}

.pt-hw-block__title {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    color: var(--pt-blue);
}

.pt-hw-formulabox {
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    background: #f3f7fb;
    border-left: 4px solid var(--pt-blue-light);
}

.pt-hw-formulabox p {
    margin: 0.15rem 0;
    font-weight: 700;
    color: #1a3a5c;
    font-size: 0.92rem;
    line-height: 1.6;
}

.pt-hw-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.6rem;
}

.pt-hw-list li {
    padding: 0.3rem 0.1rem;
    border-bottom: 1px solid #edf0f3;
    font-size: 0.87rem;
    line-height: 1.6;
}

.pt-hw-tag {
    display: inline-block;
    padding: 0 0.5rem;
    border-radius: 62.5rem;
    background: #e6f7ee;
    color: var(--pt-green-dark);
    font-size: 0.72rem;
    font-weight: 700;
}

/* カレンダー */
.pt-hw-cals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.pt-hw-cal {
    flex: 0 0 auto;
}

.pt-hw-cal__title {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.pt-hw-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1.9rem);
    gap: 2px;
}

.pt-hw-cal__wd,
.pt-hw-cal__day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.7rem;
    font-size: 0.75rem;
    border-radius: 0.3rem;
}

.pt-hw-cal__wd {
    font-size: 0.65rem;
    color: #888;
    height: 1.2rem;
}

.pt-hw-cal__wd.is-sun { color: #c0392b; }
.pt-hw-cal__wd.is-sat { color: #2f6fb3; }

.pt-hw-cal__day {
    background: #f4f6f8;
    color: #99a;
}

.pt-hw-cal__day.is-on {
    background: var(--pt-teal);
    color: #fff;
    font-weight: 700;
}

.pt-hw-cal__day.is-edge {
    outline: 2px solid var(--pt-blue);
    outline-offset: -2px;
}

.pt-hw-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.4rem 0 0;
    font-size: 0.72rem;
    color: #777;
}

.pt-hw-legend__on {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0.2rem;
    background: var(--pt-teal);
}

/* 方式の比較(棒グラフ) */
.pt-hw-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pt-hw-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
}

.pt-hw-bar.is-selected {
    background: #fff6d8;
}

.pt-hw-bar__label {
    font-size: 0.82rem;
    font-weight: 700;
}

.pt-hw-bar__label em {
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 62.5rem;
    background: var(--pt-blue);
    color: #fff;
    font-size: 0.66rem;
    font-style: normal;
}

.pt-hw-bar__track {
    display: block;
    height: 0.7rem;
    border-radius: 62.5rem;
    background: #e8edf2;
    overflow: hidden;
}

.pt-hw-bar__fill {
    display: block;
    height: 100%;
    border-radius: 62.5rem;
    background: linear-gradient(90deg, var(--pt-blue-light), var(--pt-teal));
}

.pt-hw-bar__value {
    font-size: 0.95rem;
    font-weight: 900;
    color: #1a3a5c;
}

.pt-hw-badge {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0 0.5rem;
    border-radius: 62.5rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.pt-hw-badge.is-base { background: #eef1f4; color: #667; }
.pt-hw-badge.is-zero { background: #eef1f4; color: #667; }
.pt-hw-badge.is-plus { background: #fde8e8; color: #b3261e; }
.pt-hw-badge.is-minus { background: #e2effc; color: #1f5fa8; }

/* 年間の負担割合(固定資産税) */
.pt-hw-yearbar {
    display: flex;
    height: 2.1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
}

.pt-hw-yearbar__seller,
.pt-hw-yearbar__buyer {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 0;
}

.pt-hw-yearbar__seller { background: #c98a2b; }
.pt-hw-yearbar__buyer { background: var(--pt-teal); }

/* 表・注意書き */
.pt-hw-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.4rem;
}

.pt-hw-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.85rem;
}

.pt-hw-table th,
.pt-hw-table td {
    border: 1px solid #e0e4e8;
    padding: 0.4rem 0.6rem;
    text-align: left;
}

.pt-hw-table thead th {
    background: #f2f5f8;
    white-space: nowrap;
}

.pt-hw-table tbody th {
    background: #fafbfc;
}

.pt-hw-table tr.is-selected th,
.pt-hw-table tr.is-selected td {
    background: #ffe9a8;
}

.pt-hw-note {
    margin: 0.4rem 0 0.6rem;
    font-size: 0.78rem;
    color: #666;
    line-height: 1.6;
}

.pt-hw-note--top {
    margin-top: 0;
}

.pt-hw-notice {
    margin: 0.4rem 0 0;
    padding: 0.7rem 0.9rem;
    border-radius: 0.6rem;
    background: #fff8e1;
    border: 1px solid #f0d78c;
    color: #6b4a00;
    font-size: 0.83rem;
    line-height: 1.7;
}

.pt-hw-error {
    padding: 0.7rem 0.9rem;
    border-radius: 0.6rem;
    background: #fff5f5;
    border: 1px solid #a1272a;
    color: #a1272a;
    font-size: 0.88rem;
    font-weight: 700;
}

.pt-hw-formula-box {
    padding: 0.7rem 1rem;
    border-radius: 0.6rem;
    background: var(--pt-green-bg);
    border: 1px solid var(--pt-green-border);
    text-align: center;
    font-weight: 900;
    font-size: 1.05rem;
}

@media (max-width: 40rem) {
    .pt-hw-form {
        grid-template-columns: 1fr;
    }

    .pt-hw-total__value {
        font-size: 2rem;
    }

    .pt-hw-cal__grid {
        grid-template-columns: repeat(7, 1.75rem);
    }
}
