/* Settings: plan and limits, send window, states, price card, keys, usage, sources, safety, data, policy. */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.settings-nav { position: sticky; top: var(--s4); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; min-height: 32px; padding: 6px 10px; color: var(--muted); text-decoration: none; border-radius: var(--radius); font-size: var(--t-sm); border: 1px solid transparent; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.warn { color: var(--accent); }
.settings-main { min-width: 0; }
.settings-section { margin-bottom: var(--s5); scroll-margin-top: var(--s4); }
.settings-section h2 { margin: 0 0 4px; }
.settings-section .section-sub { color: var(--muted); font-size: var(--t-sm); margin: 0 0 var(--s4); line-height: 1.5; }
.settings-section .field { margin-bottom: var(--s3); }
.settings-section input[type="text"], .settings-section input[type="number"], .settings-section input[type="password"], .settings-section input[type="time"], .settings-section input[type="date"], .settings-section input[type="url"], .settings-section select, .settings-section textarea { min-height: 36px; }
.settings-section input[type="number"], .settings-section input[type="time"], .settings-section input[type="date"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.settings-section textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.settings-actions { display: flex; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; align-items: center; }
.settings-actions .note { color: var(--muted); font-size: var(--t-sm); }
.plan-info { font-size: var(--t-sm); color: var(--text-2); margin: var(--s2) 0 var(--s4); line-height: 1.6; }
.limit-rows { border-top: 1px solid var(--line); }
.limit-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) 128px minmax(180px, 2fr); gap: var(--s3); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.limit-row .lbl { font-size: var(--t-sm); }
.limit-row .lbl small { display: block; color: var(--muted-2); font-size: var(--t-xs); line-height: 1.4; }
.limit-row input, .limit-row select { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); border-radius: var(--radius); font-size: var(--t-sm); outline: none; }
.limit-row input[type="number"], .limit-row input[type="date"], .limit-row input[type="time"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.limit-row input:focus, .limit-row select:focus { border-color: var(--accent); }
.limit-row .src { font-size: var(--t-xs); color: var(--muted); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; line-height: 1.4; }
.limit-row .src a { color: var(--blue); text-decoration: none; }
.limit-row .src a:hover { text-decoration: underline; }
.limit-row .src .checked { font-family: var(--font-mono); color: var(--muted-2); }
.limit-row .src .rule-note { color: var(--muted-2); flex-basis: 100%; }
.check-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.check-grid label { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface-2); font-size: var(--t-sm); cursor: pointer; user-select: none; }
.check-grid label.on { border-color: var(--accent-line); background: var(--accent-soft); }
.check-grid input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.switch-row .sw-text { flex: 1; min-width: 220px; }
.switch-row .sw-text strong { display: block; font-weight: 600; }
.switch-row .sw-text span { color: var(--muted); font-size: var(--t-sm); }
.switch-row .sw-ctl { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.key-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.key-row .key-name { font-weight: 600; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.key-row .key-name small { color: var(--muted-2); font-size: var(--t-xs); font-weight: 400; line-height: 1.4; }
.key-row input, .key-row select { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); border-radius: var(--radius); font-size: var(--t-sm); outline: none; }
.key-row input:focus, .key-row select:focus { border-color: var(--accent); }
.key-row .key-fields { display: flex; gap: var(--s2); flex-wrap: wrap; }
.key-row .key-fields > * { flex: 1; min-width: 140px; }
.key-row .key-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.key-result { grid-column: 1 / -1; font-size: var(--t-sm); color: var(--muted); font-family: var(--font-mono); }
.key-result.ok { color: var(--green); }
.key-result.bad { color: var(--red); }
.bands-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); margin-bottom: var(--s3); }
.bands-table th { text-align: left; font-family: var(--font-mono); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; padding: 6px 8px 6px 0; }
.bands-table td { padding: 4px 8px 4px 0; }
.bands-table input { width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); border-radius: var(--radius); font-family: var(--font-mono); font-size: var(--t-sm); }
.bands-table td.act { width: 90px; }
.proof-list .switch-row { padding: 8px 0; }
.usage-week th, .usage-week td { white-space: nowrap; }
.log-table td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.log-table td.err { color: var(--red); }
.src-state.ok { color: var(--green); } .src-state.error { color: var(--red); } .src-state.never { color: var(--muted-2); }
.policy-never p { margin: 0 0 var(--s2); padding: 6px 0 6px var(--s3); border-left: 2px solid var(--accent-line); font-size: var(--t-sm); line-height: 1.55; }
.policy-why { font-size: var(--t-sm); color: var(--text-2); line-height: 1.6; margin: var(--s3) 0 var(--s4); }
.policy-counts { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.policy-rules td.val { white-space: normal; min-width: 240px; line-height: 1.45; }
.policy-rules td.key { font-family: var(--font-mono); font-size: var(--t-xs); white-space: nowrap; }
.policy-rules td.note { color: var(--muted); white-space: normal; min-width: 260px; line-height: 1.45; font-size: var(--t-xs); }
.policy-rules a { color: var(--blue); text-decoration: none; }
.backup-list { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--muted); line-height: 1.7; margin-top: var(--s3); }
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s3); }
.data-grid .card { margin-bottom: 0; }
.data-grid .card p { margin: 0 0 var(--s3); font-size: var(--t-sm); color: var(--muted); line-height: 1.5; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .limit-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .limit-row .src { grid-column: 1 / -1; }
  .key-row { grid-template-columns: 1fr; }
  .key-row .key-btns { justify-content: flex-start; }
}
.overture-block { margin-top: var(--s2); }
.overture-block .duck-line { font-size: var(--t-sm); margin: 0 0 var(--s3); line-height: 1.5; }
.overture-block .duck-line.ready { color: var(--green); }
.overture-block .sweep-result { font-size: var(--t-sm); color: var(--muted); margin-top: var(--s3); line-height: 1.5; }
.overture-block .sweep-result a { color: var(--blue); text-decoration: none; }
.overture-block .sweep-result a:hover { text-decoration: underline; }
.overture-block .sweep-result.bad { color: var(--red); }
