:root {
    --bg: #ffffff;
    --panel: #ffffff;
    --muted: #64748b; /* slate-500 */
    --text: #0f172a;  /* slate-900 */
    --primary: #0f3d91; /* updated navy */
    --primary-600: #0b2f6d; /* darker navy */
    --secondary: #22d3ee; /* lighter cyan */
    --secondary-600: #06b6d4; /* cyan */
    --danger: #b91c1c;
    --success: #059669;
    --warning: #b45309;
    --card-border: #e5e7eb; /* light border */
  }
  
  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--text);
  }
  
  .app-header {
    padding: 2rem 1rem 1rem;
    text-align: center;
  }
  .app-header h1 {
    margin: 0 0 .25rem 0;
    font-weight: 800;
    letter-spacing: .2px;
  }
  .app-header .subtitle {
    margin: 0;
    color: var(--muted);
  }
  
  .settings-toggle {
    position: fixed;
    top: .75rem;
    right: .75rem;
    z-index: 50;
  }
  
  .settings.highlight {
    box-shadow: 0 0 0 2px rgba(11,47,109,.65), 0 0 0 6px rgba(34,211,238,.25);
    transition: box-shadow .6s ease;
  }
  
  .notice {
    max-width: 1000px;
    margin: 0 auto 1rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: .75rem 1rem;
    color: var(--muted);
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  
  .app-main { padding: 0 1rem 3rem; }
  
  .participants {
    max-width: 1000px;
    margin: 0 auto 1rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: .75rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  .participants .form-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
  .participants label { width: 110px; color: var(--muted); font-weight: 600; }
  .participants .hint { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
  
  .text-input {
    flex: 1;
    min-width: 0;
    padding: .6rem .7rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1; /* slate-300 */
    background: #ffffff;
    color: var(--text);
  }
  .text-input::placeholder { color: #94a3b880; }
  .
  .text-input:focus {
    outline: none;
    border-color: var(--secondary-600);
    box-shadow: 0 0 0 3px rgba(34,211,238,.25);
  }
  
  .segments {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
  }
  
  @media (min-width: 720px) {
    .segments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (min-width: 1080px) {
    .segments { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  
  .segment {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  .segment .name-row { margin: .25rem 0 .5rem; }
  .segment h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
  .segment .duration { color: var(--muted); font-weight: 600; }
  
  .sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
    white-space: nowrap;
  }
  
  .timer {
    font-variant-numeric: tabular-nums;
    font-size: 2.25rem;
    letter-spacing: .5px;
    margin: .25rem 0 .75rem;
    padding: .5rem .75rem;
    border-radius: 10px;
    background: #f1f5f9; /* slate-100 */
    border: 1px solid #e2e8f0; /* slate-200 */
    display: inline-block;
    min-width: 8ch;
    text-align: center;
  }
  .timer.warning { color: var(--warning); }
  .timer.elapsed { color: var(--danger); }
  
  .controls { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
  
  .btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text);
    padding: .55rem .8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .02s ease, background .15s ease, border-color .15s ease;
  }
  .btn:hover { background: #f8fafc; }
  .btn:active { transform: translateY(1px); }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
  .btn.primary {
    background: linear-gradient(180deg, var(--primary), var(--secondary-600));
    border-color: transparent;
    color: #ffffff;
  }
  .btn.danger {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    border-color: transparent;
    color: #ffffff;
  }
  
  .playback { width: 100%; margin-top: .25rem; }
  
  .app-footer {
    text-align: center;
    color: var(--muted);
    padding: 1.25rem 1rem 2rem;
  }
  
  
  /* Settings panel */
  .settings {
    position: fixed;
    top: 3.25rem;
    right: .75rem;
    width: min(420px, 92vw);
    max-height: 80vh;
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: .5rem 1rem;
    margin: 0;
    z-index: 60;
    box-shadow: 0 10px 20px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.06);
  }
  .hidden { display: none; }
  .settings summary { cursor: pointer; font-weight: 700; padding: .5rem 0; }
  .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .settings .setting { display: flex; flex-direction: column; gap: .35rem; }
  .settings .setting.inline { flex-direction: row; align-items: center; gap: .5rem; }
  .settings .setting.span-2 { grid-column: span 2; }
  
  .audio-devices { margin-top: .75rem; }
  .audio-devices .form-row { display: flex; align-items: center; gap: .5rem; }
  .level-row { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
  .level-meter { position: relative; flex: 1; height: 12px; background: #e5e7eb; border: 1px solid #cbd5e1; border-radius: 999px; overflow: hidden; }
  .level-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: linear-gradient(90deg, var(--secondary), var(--primary)); }
  
  /* Prep tracker */
  .prep { max-width: 1000px; margin: 0 auto 1rem; }
  .section-title { margin: 0 0 .5rem; font-size: 1.2rem; }
  .prep-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: .75rem; }
  @media (min-width: 720px) { .prep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .prep-card { background: #ffffff; border: 1px solid var(--card-border); border-radius: 12px; padding: .75rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  .prep-card h3 { margin: 0 0 .25rem; }
  
  /* Takes list */
  .takes { margin-top: .5rem; }
  .takes-title { margin: .5rem 0 .25rem; font-size: .95rem; color: var(--muted); }
  .take-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
  .take-item { display: flex; gap: .5rem; align-items: center; padding: .5rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
  .take-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .take-item .actions { display: flex; gap: .35rem; }
  
  /* Timer warning flash */
  .timer.flash { animation: flash 0.6s ease-in-out 3; }
  @keyframes flash { 0%, 100% { filter: none; } 50% { filter: brightness(1.8); } }
