/* ===== 共通部品(components/parts.js)。base.css の button 全体指定は各クラスで打ち消す ===== */
.ui-chip { display: inline-flex; align-items: center; gap: 4px; width: auto; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); font-size: 0.875rem; font-weight: normal; line-height: 1.4; transition: none; }
button.ui-chip { cursor: pointer; }
button.ui-chip:hover { background: var(--accent-a10); }
.ui-chip-good { border-color: var(--great); color: var(--great); background: var(--great-a15); }
.ui-chip-bad { border-color: var(--terrible); color: var(--terrible); background: var(--terrible-a15); }
.ui-chip-active, button.ui-chip-active:hover { border-color: var(--accent); background: var(--accent-a18); color: var(--accent-2); }

/* 押せる範囲は44pxのまま、枠は ::before で上下5px内側に描いて細く見せる */
.ui-chip-opener, .ui-chip-opener.ui-chip-active { position: relative; isolation: isolate; min-height: 44px; border: none; border-radius: 8px; padding: 0 12px; background: none; }
button.ui-chip-opener:hover, button.ui-chip-opener.ui-chip-active:hover { background: none; }
.ui-chip-opener::before { content: ''; position: absolute; inset: 5px 0; z-index: -1; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
button.ui-chip-opener:hover::before { background: var(--accent-a10); }
.ui-chip-opener.ui-chip-active::before, button.ui-chip-opener.ui-chip-active:hover::before { border-color: var(--accent); background: var(--accent-a18); }
.ui-chip-opener::after { content: ''; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); }
.ui-chip-remove { width: 44px; height: 44px; margin: -12px -10px -12px -8px; padding: 0; border: none; border-radius: 50%; background: none; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; transition: none; }
button.ui-chip-remove:hover { background: var(--accent-a10); }
.ui-chip-text { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ui-toggle { position: relative; isolation: isolate; display: inline-flex; padding: 0 2px; border: none; border-radius: 8px; background: none; }
.ui-toggle::before { content: ''; position: absolute; inset: 5px 0; z-index: -1; border-radius: 8px; background: var(--panel-2); }
.ui-toggle-btn { position: relative; width: auto; min-height: 44px; padding: 0 12px; border: none; border-radius: 6px; background: transparent; color: var(--muted); font-size: 0.875rem; font-weight: normal; white-space: nowrap; cursor: pointer; transition: none; }
.ui-toggle-btn::before { content: ''; position: absolute; inset: 7px 0; z-index: -1; border-radius: 6px; }
.ui-toggle-btn:hover::before { background: var(--accent-a10); }
.ui-toggle-btn[aria-pressed="true"] { color: var(--text); font-weight: bold; }
.ui-toggle-btn[aria-pressed="true"]::before { background: var(--panel); }

.ui-summary { padding: 20px 16px; border-radius: 16px; background: var(--panel); }
.ui-summary-label { margin: 0; color: var(--muted); font-size: 0.875rem; }
.ui-summary-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 0; }
.ui-summary-big strong { font-size: 2.75rem; line-height: 1.1; font-weight: bold; }
.ui-summary-big strong small { font-size: 1.375rem; font-weight: bold; }
.ui-summary-big span { color: var(--muted); }
.ui-summary-note { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }
.ui-summary-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.ui-summary-hero + .ui-summary-metrics { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.ui-summary-item { min-width: 0; }
.ui-summary dt { color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.ui-summary dd { margin: 2px 0 0; color: var(--text); font-size: 1.375rem; font-weight: bold; line-height: 1.3; overflow-wrap: anywhere; }
.ui-summary dd small { display: block; color: var(--muted); font-size: 0.875rem; font-weight: normal; margin-top: 2px; }
.ui-summary-good dd { color: var(--great); }
.ui-summary-bad dd { color: var(--terrible); }

ul.ui-rows { padding: 0; margin: 0; list-style: none; border: none; border-radius: 0; }
.ui-row + .ui-row { border-top: 1px solid var(--line); }
.ui-row-body, .ui-row-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 10px 0; border: none; border-radius: 0; background: none; color: var(--text); font-size: 0.9375rem; font-weight: normal; text-align: left; transition: none; }
.ui-row-btn { cursor: pointer; text-decoration: none; }
.ui-row-btn:hover { background: var(--accent-a10); }
a.ui-row-btn, a.ui-row-btn:hover { color: var(--text); text-decoration: none; }
.ui-row-btn::after { content: ''; flex-shrink: 0; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); }
.ui-row-btn[aria-expanded="true"]::after { transform: rotate(135deg); }
.ui-row-danger, a.ui-row-danger { color: var(--bad); }
.ui-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ui-row-main small { color: var(--muted); font-size: 0.875rem; }
.ui-row-aside { flex-shrink: 0; color: var(--accent-2); font-weight: bold; }
.ui-row-aside-good { color: var(--great); }
.ui-row-aside-bad { color: var(--terrible); }
.ui-row-bar { display: block; position: relative; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--panel-2); }
.ui-row-bar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text); opacity: .35; }
.ui-row-bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; }
.ui-row-bar-good { background: var(--great); }
.ui-row-bar-mid { background: var(--accent-2); }
.ui-row-bar-bad { background: var(--terrible); }
.ui-row-bar-marker { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }

.ui-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ui-sheet-head h3 { margin: 0; color: var(--text); font-size: 1rem; }
.ui-sheet-close { width: auto; min-height: 44px; padding: 0 4px; border: none; background: none; color: var(--accent); font-size: 0.875rem; font-weight: normal; cursor: pointer; transition: none; }

.ui-notice { padding: 10px 14px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--accent-a06); color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.ui-notice-warn { border-left-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.ui-notice-error { border-left-color: var(--error-border); background: var(--error-bg); color: var(--error-text); }
.ui-notice + .ui-notice { margin-top: 8px; }
.ui-notice > b { display: block; color: var(--text); }
.ui-notice-warn > b { color: var(--warn-text); }
.ui-notice-error > b { color: var(--error-text); }
.ui-notice p { margin: 2px 0 0; }
.ui-action { width: auto; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 0.9375rem; font-weight: bold; cursor: pointer; transition: none; }
.ui-action:hover { background: var(--accent-a10); }
.ui-notice .ui-action { display: block; margin-top: 8px; }
