.flush { margin-top: 0; }
.flush-bottom { margin-bottom: 6px; }
.card { margin-bottom: 20px; }
.top-gap { margin-top: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); gap: 8px; }
.preset-btn.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-bottom: 12px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }

button, .btn, label.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; max-width: 100%; text-align: center; }
input:not([type="file"]):not([type="hidden"]), select { min-height: 44px; min-width: 44px; max-width: 100%; }
.mono, .mono-input { font-family: var(--mono); }

.err-msg { color: var(--warn); font-weight: 600; margin: 8px 0; overflow-wrap: anywhere; }
.warn-box { background: var(--chip); border: 1px solid var(--warn); color: var(--warn); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 115px), 1fr)); gap: 8px; }
.stat-box { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.stat-val { font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }

.pacer-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 12px; }
.breath-svg { width: 100%; max-width: 240px; height: auto; display: block; }
.ring-guide { fill: none; stroke: var(--line); stroke-width: 3; stroke-dasharray: 6 6; }
.ring-active { fill: var(--chip); stroke: var(--accent); stroke-width: 6; opacity: 0.9; }
.ring-active.phase-hold { stroke-width: 8; opacity: 1; }
.ring-active.phase-exhale { opacity: 0.78; }
.ring-active.phase-rest { stroke: var(--muted); opacity: 0.65; }
.ring-core { fill: var(--accent); opacity: 0.22; }

.pacer-readout { text-align: center; min-width: 0; max-width: 100%; }
.phase-label { font-size: 26px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.phase-countdown { font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1.2; margin: 2px 0 4px; }
.pacer-controls { justify-content: center; }

.chart-wrap { margin-top: 14px; }
.week-chart { width: 100%; max-width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.wk-bar { fill: var(--accent); }
.wk-bar.is-empty { fill: var(--line); }
.wk-lbl { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.wk-val { fill: var(--ink); font-size: 11px; font-family: var(--mono); font-weight: 600; }

.log-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.log-list li { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; min-width: 0; }
.log-main { flex: 1 1 180px; min-width: 0; }
.log-title { font-weight: 600; overflow-wrap: anywhere; }
.log-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.log-note { font-size: 14px; overflow-wrap: anywhere; margin-top: 4px; }
code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

@media print {
  .no-print, header.top, footer { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: none; padding: 0; }
}
