/* index.css — extracted from inline <style> blocks. Generated by scripts/h1-extract.mjs */
:root {
    --bg: #1a1b26;
    --panel: #16171f;
    --panel2: #22242e;
    --border: #2d2f3b;
    --text: #c0caf5;
    --muted: #6b7089;
    --accent: #7aa2f7;
    --accent-dim: #3d59a1;
    --green: #9ece6a;
    --yellow: #e0af68;
    --red: #f7768e;
    --purple: #bb9af7;
    --hover: #2a2d3a;

    --work: #f7768e;
    --short: #9ece6a;
    --long: #7aa2f7;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
  }
  body { overflow-x: hidden; }
  button { font-family: inherit; }
  button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  #app {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 16px;
    padding: 16px;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
  }
  @media (max-width: 1100px) {
    #app { grid-template-columns: 1fr; }
  }
  @media (max-width: 768px) {
    #app { padding: 8px; gap: 8px; grid-template-columns: 1fr; }
    .panel { padding: 12px; }
    #main { padding-top: 12px; gap: 12px; order: -1; }
    #stats { order: 2; }
    #history { order: 3; max-height: 260px; }
    .history-list { max-height: 200px; }
    .ring-wrap, .ring-wrap svg { width: 260px; height: 260px; }
    .clock { font-size: 52px; }
    .phase-tabs button { padding: 10px 14px; min-height: 44px; font-size: 13px; }
    .controls button { min-height: 44px; padding: 10px 16px; font-size: 14px; }
    .controls button.primary { min-width: 120px; }
    .settings-toggle { min-height: 40px; font-size: 12px; }
    .setting input[type="number"], .setting select, .setting input[type="range"] {
      min-height: 40px;
    }
    .switch { width: 44px; height: 26px; }
    .switch::after { width: 20px; height: 20px; }
    .switch.on::after { left: 20px; }
    .modal { padding: 16px; }
    .history-item { padding: 12px 8px; min-height: 44px; }
    .stat-label, .phase-label, .history-item .time { font-size: 11px; }
    .stat-row { padding: 8px 0; }
    .chart-bars { height: 60px; }
  }
  @media (max-width: 480px) {
    #app { padding: 6px; gap: 6px; }
    .panel { padding: 10px; }
    .ring-wrap, .ring-wrap svg { width: 220px; height: 220px; }
    .clock { font-size: 44px; }
    .phase-tabs { flex-wrap: nowrap; }
    .phase-tabs button { padding: 10px 10px; font-size: 12px; }
    .controls button { padding: 10px 12px; }
    .controls button.primary { min-width: 100px; }
    #history { max-height: 220px; }
    .history-list { max-height: 160px; }
    .chart-bars { height: 50px; }
    .chart-labels span { font-size: 10px; }
    .stat-value { font-size: 16px; }
    .stat-value.big { font-size: 18px; }
  }

  .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .panel h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 600;
  }

  /* ---------- Main timer ---------- */
  #main { align-items: center; justify-content: flex-start; gap: 18px; padding-top: 28px; }
  .phase-tabs { display: flex; gap: 6px; background: var(--panel2); padding: 4px; border-radius: 8px; border: 1px solid var(--border); }
  .phase-tabs button {
    background: transparent;
    color: var(--muted);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
  }
  .phase-tabs button:hover { color: var(--text); }
  .phase-tabs button.active { background: var(--bg); color: var(--text); }
  .phase-tabs button.active[data-phase="work"]       { box-shadow: inset 0 -2px 0 var(--work); }
  .phase-tabs button.active[data-phase="shortBreak"] { box-shadow: inset 0 -2px 0 var(--short); }
  .phase-tabs button.active[data-phase="longBreak"]  { box-shadow: inset 0 -2px 0 var(--long); }

  .ring-wrap {
    position: relative;
    width: 340px;
    height: 340px;
    display: grid;
    place-items: center;
  }
  .ring-wrap svg { transform: rotate(-90deg); }
  .ring-bg { fill: none; stroke: var(--panel2); stroke-width: 14; }
  .ring-fg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear, stroke 0.3s;
  }
  .ring-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
  }
  .clock {
    font-variant-numeric: tabular-nums;
    font-size: 68px;
    font-weight: 300;
    letter-spacing: -1px;
    line-height: 1;
  }
  .phase-label {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .controls { display: flex; gap: 10px; align-items: center; }
  .controls button {
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 46px;
  }
  .controls button:hover { background: var(--hover); border-color: var(--accent-dim); }
  .controls button.primary {
    background: var(--accent);
    color: #0b0c14;
    border-color: var(--accent);
    min-width: 110px;
    font-weight: 600;
  }
  .controls button.primary:hover { background: #8db3f8; }

  .cycle-dots { display: flex; gap: 8px; margin-top: 6px; }
  .cycle-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--panel2);
    border: 1px solid var(--border);
    transition: all 0.2s;
  }
  .cycle-dots .dot.filled { background: var(--work); border-color: var(--work); }

  .settings-toggle {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .settings-toggle:hover { color: var(--text); border-color: var(--accent-dim); }

  /* ---------- Stats ---------- */
  .stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .stat-row:last-child { border-bottom: none; }
  .stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
  .stat-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .stat-value.big { font-size: 22px; color: var(--accent); }

  .chart {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
  .chart h3 {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
  }
  .chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
  }
  .chart-bar {
    flex: 1;
    background: var(--panel2);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 3px;
    transition: background 0.15s;
  }
  .chart-bar.has-data { background: var(--accent-dim); }
  .chart-bar.today { background: var(--accent); }
  .chart-bar:hover { background: var(--accent); }
  .chart-bar .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
  }
  .chart-bar:hover .tooltip { opacity: 1; }
  .chart-labels {
    display: flex;
    gap: 6px;
    margin-top: 4px;
  }
  .chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 10px;
    color: var(--muted);
  }

  /* ---------- History ---------- */
  #history { overflow: hidden; }
  .history-list {
    flex: 1;
    overflow-y: auto;
    margin: 0 -8px;
    padding: 0 8px;
    max-height: 520px;
  }
  .history-list::-webkit-scrollbar { width: 6px; }
  .history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  .history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 6px;
    font-size: 13px;
  }
  .history-item:hover { background: var(--panel2); }
  .history-item .phase-pill {
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
  }
  .history-item[data-phase="work"] .phase-pill { background: var(--work); }
  .history-item[data-phase="shortBreak"] .phase-pill { background: var(--short); }
  .history-item[data-phase="longBreak"] .phase-pill { background: var(--long); }
  .history-item .meta { flex: 1; min-width: 0; }
  .history-item .meta .top { display: flex; justify-content: space-between; gap: 8px; }
  .history-item .meta .kind { font-weight: 500; }
  .history-item .meta .dur { color: var(--muted); font-variant-numeric: tabular-nums; }
  .history-item .meta .time { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .empty { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 0; }

  .history-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
  .history-actions button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
  }
  .history-actions button:hover { color: var(--red); border-color: var(--red); }

  /* ---------- Settings modal ---------- */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
  }
  .modal-backdrop.open { display: flex; }
  .modal {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal h2 { margin-bottom: 16px; color: var(--text); font-size: 16px; text-transform: none; letter-spacing: 0; }
  .setting { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
  .setting:last-child { border-bottom: none; }
  .setting label { font-size: 13px; color: var(--text); flex: 1; }
  .setting .hint { font-size: 11px; color: var(--muted); }
  .setting input[type="number"], .setting select {
    background: var(--panel2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    width: 80px;
    text-align: right;
  }
  .setting select { width: 120px; text-align: left; }
  .setting input[type="range"] { width: 120px; }
  .switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--muted);
    border-radius: 50%;
    transition: all 0.2s;
  }
  .switch.on { background: var(--accent-dim); border-color: var(--accent); }
  .switch.on::after { left: 18px; background: var(--accent); }
  .modal-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
  .modal-footer button {
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
  }
  .modal-footer button.danger { color: var(--red); border-color: var(--red); }
  .modal-footer button.danger:hover { background: rgba(247, 118, 142, 0.1); }
  .modal-footer button.primary { background: var(--accent); color: #0b0c14; border-color: var(--accent); font-weight: 600; }

  /* Work-phase theming */
  body[data-phase="work"]        .ring-fg { stroke: var(--work); }
  body[data-phase="shortBreak"]  .ring-fg { stroke: var(--short); }
  body[data-phase="longBreak"]   .ring-fg { stroke: var(--long); }
  body[data-phase="work"]        .stat-value.big { color: var(--work); }
  body[data-phase="shortBreak"]  .stat-value.big { color: var(--short); }
  body[data-phase="longBreak"]   .stat-value.big { color: var(--long); }
