:root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bot-bubble: #ffffff;
    --user-bubble: #dcf8c6;
    --accent: #06c755;
    --accent-pressed: #05a847;
    --pay-later: #64748b;
    --danger: #dc2626;
    --choice-bg: #f8fafc;
    --choice-border: #d1d5db;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --app-max: 520px;
    --header-pad: 14px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        "Hiragino Sans",
        "Hiragino Kaku Gothic ProN",
        "Noto Sans JP",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================================================
   アプリシェル（PCは中央寄せ・やや広めのスマホ幅）
   高さは visualViewport 連動の --app-height を優先（キーボード表示時用）。
   未設定時は 100dvh。interactive-widget は iOS 未対応のため採用せず。
====================================================== */
.okane-app {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    width: min(100%, var(--app-max));
    height: 100vh;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    transform: translateY(var(--app-offset-y, 0px));
    margin: 0 auto;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--border);
}

.okane-header {
    flex-shrink: 0;
    padding: 8px var(--header-pad) 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.okane-header__top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

.page-heading {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.35;
    /* 絶対配置の設定ボタンと折り返し文字が重ならないよう左右を確保 */
    padding: 0 40px;
}

.settings-open-btn {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.settings-open-btn svg {
    width: 20px;
    height: 20px;
}

.settings-open-btn:hover {
    background: var(--choice-bg);
    color: var(--text);
}

.settings-open-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.page-lead {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.4;
}

.view-tabs {
    display: flex;
    gap: 0;
    margin-top: 8px;
}

.view-tab {
    flex: 1;
    padding: 8px 8px 9px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.view-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.view-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* ===================================================
   メイン領域
====================================================== */
.okane-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.view {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.view.is-active {
    display: flex;
}

/*
  チャット画面の責務分離:
  - .view-chat … 履歴＋Composer の縦レイアウト容器（自身はスクロールしない）
  - #chat-thread … 会話履歴のみが縦スクロール
  - #composer … 画面下端の固定帯（履歴スクロールに乗らない）
  サイトフッターは履歴ビューのスクロール末尾のみ（チャットの固定クロムには置かない）
*/
.view-chat {
    min-height: 0;
}

.view-chat.is-active {
    display: flex;
    flex-direction: column;
}

/* ===================================================
   チャット履歴（唯一のスクロール領域）
====================================================== */
.chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px var(--header-pad) 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

/* Composer 非表示時はチャット末尾でホームインジケータ分を確保 */
.view-chat:has(#composer[hidden]) .chat-thread {
    padding-bottom: calc(10px + var(--safe-bottom));
}

.chat-date-sep {
    align-self: center;
    margin: 2px 0 6px;
}

.chat-date-sep span {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.06);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    gap: 2px;
}

.chat-msg--bot {
    flex-direction: row;
    align-self: flex-start;
    align-items: flex-start;
    gap: 8px;
    max-width: 92%;
}

.chat-msg__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.06);
}

.chat-msg__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
}

.chat-msg--user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg--enter {
    animation: chat-msg-enter 130ms ease-out;
}

@keyframes chat-msg-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg__time {
    padding: 0 2px;
    color: var(--text-muted);
    font-size: 0.625rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.chat-msg--user .chat-msg__time {
    text-align: right;
}

.bubble {
    max-width: 100%;
    padding: 8px 11px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 0.875rem;
    line-height: 1.45;
}

.bubble p {
    margin: 0;
}

.bubble-bot {
    background: var(--bot-bubble);
    border-bottom-left-radius: 4px;
}

.bubble-user {
    background: var(--user-bubble);
    border-bottom-right-radius: 4px;
}

.bubble-system {
    background: transparent;
    box-shadow: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 2px 6px;
}

/* 入力中インジケータ（ボット吹き出しと同じ位置・見た目） */
.bubble-typing {
    min-width: 3.5rem;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 1.2em;
    padding: 2px 4px;
}

.typing-dots span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.35;
    animation: typing-dot 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dot {
    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-msg--enter {
        animation: none;
    }

    .typing-dots span {
        animation: none;
        opacity: 0.7;
    }
}

.choice-hint {
    margin-top: 4px !important;
    color: var(--text-muted);
    font-size: 0.6875rem;
    line-height: 1.35;
}

.choice-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}

/*
 * カテゴリは最大6件まで高さそのまま。7件目から内部スクロール。
 * 行高 = line-height*font-size + 上下padding（.choice-btn と揃える）
 */
.choice-grid--category {
    --choice-row-h: calc(0.8125rem * 1.35 + 12px);
    max-height: calc(6 * var(--choice-row-h) + 5 * 5px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.choice-grid--category + .choice-btn--done {
    margin-top: 8px;
}

.choice-btn {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.35em;
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--choice-border);
    border-radius: 8px;
    background: var(--choice-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.choice-btn__emoji {
    flex: 0 0 auto;
    line-height: 1;
    font-size: 1.05em;
}

.choice-btn__label {
    min-width: 0;
    line-height: 1.35;
}

.choice-btn:hover {
    background: #eef2f7;
}

.choice-btn:active {
    background: #e5eaf0;
}

.choice-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.choice-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.choice-btn--done {
    margin-top: 2px;
    color: var(--text-muted);
    background: transparent;
    border-style: dashed;
}

.choice-btn--done:hover {
    background: var(--choice-bg);
    color: var(--text);
}

.choice-secondary {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 4px 2px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.choice-secondary:hover {
    color: var(--accent);
}

.choice-secondary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.chat-action {
    display: flex;
    width: 100%;
}

.chat-action--user {
    justify-content: flex-end;
}

.chat-action.chat-msg--enter {
    animation: chat-msg-enter 130ms ease-out;
}

.add-record-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.add-record-btn:hover {
    background: #e8f8ee;
}

.add-record-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.add-record-btn:active {
    background: #d8f3e3;
}

/* ===================================================
   金額入力 Composer（履歴とは別レイヤー・画面下端に固定）
====================================================== */
.composer {
    flex: 0 0 auto;
    padding: 8px var(--header-pad) calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.composer[hidden] {
    display: none !important;
}

.composer-panel[hidden] {
    display: none !important;
}

.composer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.amount-input,
.memo-input,
.date-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--choice-border);
    border-radius: 20px;
    background: var(--bg);
    font: inherit;
    /* iOS Safariは16px未満の入力欄フォーカスで自動ズームするため、16px（1rem）以上にする */
    font-size: 1rem;
}

.amount-input:focus,
.memo-input:focus,
.date-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.amount-unit {
    color: var(--text-muted);
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.send-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 16px;
    border: none;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.send-btn:hover:not(:disabled) {
    background: var(--accent-pressed);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.send-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.composer-hint {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    padding-left: 4px;
}

/* ===================================================
   履歴（サマリー固定・リストのみスクロール）
====================================================== */
.view-history {
    overflow: hidden;
    padding: 0;
    min-height: 0;
}

.view-history.is-active {
    display: flex;
    flex-direction: column;
}

.history-chrome {
    flex-shrink: 0;
    padding: 12px var(--header-pad) 0;
    background: var(--bg);
    z-index: 1;
}

.history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 var(--header-pad);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.summary-panels {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.summary-panels[hidden] {
    display: none;
}

.summary-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.summary-card__head {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.summary-card__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.summary-card__toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.summary-card__label {
    flex: 1;
}

.summary-card__amount {
    font-variant-numeric: tabular-nums;
}

.income-record-btn {
    flex-shrink: 0;
    margin: 6px 8px 0 0;
    padding: 5px 8px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: #e8f8ee;
    color: var(--accent);
    font: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    pointer-events: auto;
}

.income-record-btn:hover {
    background: #d8f3e3;
}

.income-record-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.income-record-btn.is-spotlight {
    animation: income-btn-spotlight 0.85s ease-in-out 3;
}

@keyframes income-btn-spotlight {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(6, 199, 85, 0.35);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(6, 199, 85, 0);
        transform: scale(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    .income-record-btn.is-spotlight {
        animation: none;
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }
}

.summary-card__budget {
    margin: 0;
    padding: 0 10px 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.summary-card__budget-over {
    color: var(--danger);
}

.summary-card__deferred {
    margin: 0;
    padding: 0 10px 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.summary-card__income {
    margin: 0;
    padding: 0 10px 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.summary-card__balance {
    margin: 0;
    padding: 0 10px 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.summary-card__balance-plus {
    color: var(--accent);
    font-weight: 600;
}

.summary-card__balance-minus {
    color: var(--danger);
    font-weight: 600;
}

.summary-card__budget + .summary-card__deferred,
.summary-card__budget + .summary-card__income,
.summary-card__deferred + .summary-card__income,
.summary-card__income + .summary-card__balance {
    padding-top: 0;
    margin-top: -4px;
}

.summary-card__chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.625rem;
    transition: transform 0.15s ease;
}

.summary-card.is-open .summary-card__chevron {
    transform: rotate(180deg);
}

.summary-card__detail {
    padding: 0 10px 8px;
    border-top: 1px solid var(--border);
}

.summary-card__detail[hidden] {
    display: none;
}

.summary-breakdown {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.summary-breakdown li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
}

.summary-breakdown__label {
    color: var(--text);
}

.summary-breakdown__amount {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.summary-breakdown__empty {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.history-empty {
    margin-top: 48px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9375rem;
}

.history-empty[hidden] {
    display: none;
}

.history-day {
    margin-bottom: 10px;
}

.history-day__title {
    margin-bottom: 4px;
    padding: 0 2px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border-radius: 8px;
    padding: 7px 10px 4px;
    margin-bottom: 4px;
    box-shadow: var(--shadow);
}

.history-item--income {
    border-left: 3px solid var(--accent);
}

.history-item__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.history-item__category {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item__amount {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.history-item__amount--income {
    color: var(--accent);
}

.history-item__payment {
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item__memo {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item__actions {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 0;
    margin-left: auto;
}

.history-item__actions button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: auto;
    padding: 2px 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.6875rem;
    cursor: pointer;
}

.history-item__actions button:hover {
    background: var(--choice-bg);
    color: var(--text);
}

.history-item__actions button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.history-item__actions .btn-delete:hover {
    color: var(--danger);
    background: #fef2f2;
}

.history-item__actions .btn-icon {
    display: inline-flex;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.history-item__actions .btn-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===================================================
   フッタ（履歴タブのスクロール末尾。固定表示はしない）
====================================================== */
.okane-footer {
    flex-shrink: 0;
    margin-top: 16px;
    padding: 16px 0 calc(16px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: transparent;
    text-align: center;
}

.privacy-note {
    color: var(--text-muted);
    font-size: 0.6875rem;
    margin-bottom: 8px;
}

.okane-footer__links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.okane-footer__links a {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
}

.okane-footer__links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ===================================================
   グラフ
   チャット同様：上部クロム固定、本文のみスクロール
====================================================== */
.view-graph {
    min-height: 0;
    overflow: hidden;
}

.view-graph.is-active {
    display: flex;
    flex-direction: column;
}

.graph-chrome {
    flex-shrink: 0;
    padding: 12px var(--header-pad) 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1;
}

.graph-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px var(--header-pad) 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.graph-scale-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.graph-scale-tab {
    flex: 1;
    padding: 7px 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.graph-scale-tab.is-active {
    background: var(--bg);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
}

.graph-scale-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.graph-scale-tab:disabled {
    opacity: 0.4;
    cursor: default;
}

.graph-period-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
}

.graph-period-nav__label {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.graph-period-nav__btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.graph-period-nav__btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.graph-period-nav__btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.graph-period-nav__btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.graph-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.graph-empty {
    margin: 24px 0 8px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.graph-empty-inline {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.graph-hero {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 14px 12px;
    text-align: center;
}

.graph-hero__label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.graph-hero__amount {
    margin: 4px 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.graph-hero__budget {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.graph-hero__income,
.graph-hero__balance {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.graph-hero .summary-card__budget-over {
    color: var(--danger);
}

.graph-section {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 12px 10px 10px;
}

.graph-section__title {
    margin: 0 0 10px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.graph-compare-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    height: 150px;
    padding-top: 4px;
}

.graph-compare-bar {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.graph-compare-bar:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 4px;
}

.graph-compare-bar:disabled {
    opacity: 0.35;
    cursor: default;
}

.graph-compare-bar__amount {
    min-height: 0.875rem;
    font-size: 0.625rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.graph-compare-bar.is-selected .graph-compare-bar__amount {
    color: var(--text);
    font-weight: 700;
}

.graph-compare-bar__track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 36px;
    flex: 1;
    min-height: 0;
    border-radius: 4px 4px 2px 2px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.graph-compare-bar__fill {
    display: block;
    width: 100%;
    min-height: 0;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
}

.graph-compare-bar.is-selected .graph-compare-bar__fill {
    background: var(--accent-pressed);
}

.graph-compare-bar.is-selected .graph-compare-bar__track {
    border-bottom-color: var(--accent-pressed);
}

.graph-compare-bar__label {
    font-size: 0.6875rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.graph-compare-bar.is-selected .graph-compare-bar__label {
    color: var(--text);
    font-weight: 700;
}

.graph-bars-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 -2px;
    padding: 0 2px 4px;
}

.graph-bars-scroll--fit {
    overflow-x: hidden;
}

.graph-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-width: max-content;
    height: 140px;
    padding-top: 4px;
}

.graph-bars--fit {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 6px;
}

.graph-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: 22px;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.graph-bars--fit .graph-bar {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: none;
}

.graph-bar:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 4px;
}

.graph-bar__track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 4px 4px 2px 2px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.graph-bar__fill {
    display: block;
    width: 100%;
    min-height: 0;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    transition: height 0.15s ease;
}

.graph-bar.is-selected .graph-bar__fill {
    background: var(--accent-pressed);
}

.graph-bar.is-selected .graph-bar__track {
    border-bottom-color: var(--accent-pressed);
}

.graph-bar.is-selected .graph-bar__label {
    color: var(--text);
    font-weight: 700;
}

.graph-bar__label {
    font-size: 0.625rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.graph-day-detail {
    margin: 8px 0 0;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.graph-day-detail[hidden] {
    display: none;
}

.graph-pay-stack {
    display: flex;
    width: 100%;
    height: 10px;
    margin: 0 0 10px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
}

.graph-pay-stack__seg {
    display: block;
    height: 100%;
    min-width: 0;
}

.graph-pay-stack__seg--now {
    background: var(--accent);
}

.graph-pay-stack__seg--later {
    background: var(--pay-later);
}

.graph-pay-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.graph-pay-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
}

.graph-pay-item__swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.graph-pay-item__swatch--now {
    background: var(--accent);
}

.graph-pay-item__swatch--later {
    background: var(--pay-later);
}

.graph-pay-item__label {
    min-width: 0;
}

.graph-pay-item__amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.graph-pay-item__pct {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 2.75em;
    text-align: right;
}

.graph-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.graph-cat-item__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8125rem;
}

.graph-cat-item__label {
    min-width: 0;
}

.graph-cat-item__amount {
    flex-shrink: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.graph-cat-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.graph-cat-bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--bg);
    overflow: hidden;
}

.graph-cat-bar__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    min-width: 0;
}

.graph-cat-item__pct {
    flex-shrink: 0;
    width: 3.25rem;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* ===================================================
   編集ダイアログ
====================================================== */
.edit-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    margin: auto;
    width: min(calc(100% - 32px), 400px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.edit-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.edit-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-form h2 {
    font-size: 1.0625rem;
}

.edit-fieldset {
    border: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-fieldset legend {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.edit-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--choice-border);
    border-radius: 10px;
    background: var(--choice-bg);
    font-size: 0.875rem;
    cursor: pointer;
}

.edit-option:has(input:checked) {
    border-color: var(--accent);
    background: #e8f8ee;
}

.edit-amount-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.edit-amount {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--choice-border);
    border-radius: 10px;
    font: inherit;
    /* iOS Safariの自動ズーム防止のため16px以上 */
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
}

.edit-amount:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-secondary,
.btn-primary {
    flex: 1;
    height: 44px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    border: 1px solid var(--choice-border);
    background: var(--choice-bg);
    color: var(--text);
}

.btn-primary {
    border: none;
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-pressed);
}

.btn-danger {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-secondary:focus-visible,
.btn-primary:focus-visible,
.btn-danger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===================================================
   確認ダイアログ
====================================================== */
.confirm-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    margin: auto;
    width: min(calc(100% - 32px), 360px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.confirm-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-form h2 {
    font-size: 1.0625rem;
}

.confirm-dialog__body {
    margin: 0;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-line;
}

.confirm-dialog__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* ===================================================
   設定サイドシート
====================================================== */
.settings-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.settings-overlay.is-open {
    opacity: 1;
}

.settings-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 41;
    display: flex;
    flex-direction: column;
    width: 85%;
    max-width: 420px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
    transform: translateX(100%);
    transition: transform 0.22s ease;
}

.settings-sheet.is-open {
    transform: translateX(0);
}

.settings-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid var(--border);
}

.settings-sheet__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.settings-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.settings-close-btn svg {
    width: 20px;
    height: 20px;
}

.settings-close-btn:hover {
    background: var(--choice-bg);
    color: var(--text);
}

.settings-close-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.settings-sheet__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0 calc(16px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
}

.settings-section {
    padding: 12px 16px 16px;
}

.settings-section + .settings-section {
    border-top: 1px solid var(--border);
}

.settings-section__title {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.settings-note {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.65;
}

.settings-section .btn-block + .btn-block {
    margin-top: 8px;
}

.btn-block {
    display: block;
    width: 100%;
    flex: none;
}

/* display:none だと一部環境でファイル選択が発火しないため、視覚的に隠すだけにする */
.data-import-file {
    position: fixed;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.app-toast {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 60;
    padding: 12px 16px;
    border-radius: 10px;
    background: #1f2937;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.app-toast--anchored {
    bottom: auto;
}

.app-toast--below {
    transform: translateY(-6px);
}

.app-toast--above {
    transform: translateY(6px);
}

.app-toast--center {
    top: 50%;
    bottom: auto;
    transform: translateY(calc(-50% + 8px));
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast--center.is-visible {
    transform: translateY(-50%);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    cursor: pointer;
}

.settings-row--nav {
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
}

.settings-row--nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-row__text {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.settings-row__chevron {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.settings-subview {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    transform: translateX(100%);
    transition: transform 0.22s ease;
}

.settings-subview.is-open {
    transform: translateX(0);
}

.settings-subview__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.settings-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
}

.settings-back-link:hover {
    color: var(--text);
}

.settings-back-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-subview__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
}

.settings-section--items {
    padding: 4px 20px 8px 16px;
}

.settings-item-list {
    list-style: none;
}

.settings-item-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.settings-check-row {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 44px;
    padding: 0;
    cursor: pointer;
}

.settings-item-row--editing .settings-check-row--editing {
    cursor: default;
}

.settings-item-edit-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--choice-border);
    border-radius: 8px;
    background: var(--surface);
    font: inherit;
    /* iOS Safariの自動ズーム防止のため16px以上 */
    font-size: 1rem;
    color: var(--text);
}

.settings-item-edit-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.settings-item-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.settings-item-action:hover {
    background: var(--choice-bg);
    color: var(--text);
}

.settings-item-action:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-item-delete:hover {
    background: #fef2f2;
    color: var(--danger);
}

.settings-item-delete:active {
    background: #fee2e2;
    color: var(--danger);
}

.settings-item-save:hover {
    background: #e8f8ee;
    color: var(--accent);
}

.settings-item-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.settings-item-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-check {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid var(--choice-border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.settings-check:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.settings-check:checked::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.settings-check:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-custom-form {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.settings-custom-field {
    flex: 1;
    min-width: 0;
}

.settings-custom-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--choice-border);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    /* iOS Safariの自動ズーム防止のため16px以上 */
    font-size: 1rem;
    color: var(--text);
}

.settings-custom-count {
    margin-top: 4px;
    padding: 0 2px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: right;
}

.settings-custom-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.settings-custom-add-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.settings-custom-add-btn:hover {
    background: var(--accent-pressed);
}

.settings-custom-add-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-custom-error {
    margin-top: 8px;
    color: var(--danger);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.settings-budget-fields {
    margin-top: 10px;
}

.settings-budget-fields[hidden] {
    display: none !important;
}

.settings-budget-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.settings-budget-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--choice-border);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    /* iOS Safariの自動ズーム防止のため16px以上 */
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
}

.settings-budget-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.settings-budget-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.75rem;
    line-height: 1.4;
}

.settings-budget-error[hidden] {
    display: none !important;
}

.settings-budget-status {
    margin-top: 6px;
    color: var(--accent);
    font-size: 0.75rem;
    line-height: 1.4;
}

.settings-budget-status[hidden] {
    display: none !important;
}

/* トグルスイッチ（iOS風・アクセントカラー） */
.settings-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 28px;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: #d1d5db;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.settings-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.settings-switch:checked {
    background: var(--accent);
}

.settings-switch:checked::after {
    transform: translateX(20px);
}

.settings-switch:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .settings-overlay,
    .settings-sheet,
    .settings-subview,
    .settings-switch,
    .settings-switch::after,
    .settings-check {
        transition: none;
    }
}

/* ===================================================
   PC：余白をやや広めに
====================================================== */
@media (min-width: 560px) {
    body {
        background: #e4e7ec;
    }

    .okane-app {
        margin-top: 0;
        border-radius: 0;
        min-height: 0;
    }

    .okane-header {
        padding-top: 12px;
    }

    .page-heading {
        font-size: 1.125rem;
    }

    .chat-thread {
        padding: 14px 18px 12px;
        gap: 8px;
    }

    .composer,
    .history-chrome,
    .history-scroll,
    .graph-chrome,
    .graph-scroll {
        padding-left: 18px;
        padding-right: 18px;
    }

    .graph-bars {
        width: 100%;
        min-width: 0;
        justify-content: space-between;
    }

    .graph-bar {
        flex: 1;
        width: auto;
        max-width: 28px;
    }

    .graph-bars--fit .graph-bar {
        max-width: none;
    }

    /* PC：合計のカテゴリ内訳を常時表示＋2列で高さ抑制 */
    .summary-panels {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .summary-card__chevron {
        display: none;
    }

    .summary-card__toggle {
        cursor: default;
        pointer-events: none;
        padding: 8px 10px 6px;
    }

    .summary-card__detail,
    .summary-card__detail[hidden] {
        display: block;
        padding: 0 10px 8px;
    }
}
