:root{
    --ink:#1C1B19;
    --paper:#FAF7F0;
    --pine:#3B6E5E;
    --pine-dim:#2E5A4C;
    --clay:#C4582E;
    --stone:#8B8378;
    --card:#E8E2D4;
    --card-soft:#F1ECE0;
    --line:#D9D2C0;
    --good:#3B6E5E;
    --bad:#B6432A;
    --white:#FFFEFB;
    --shadow: 0 1px 2px rgba(28,27,25,0.04), 0 4px 12px rgba(28,27,25,0.06);
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--paper);
    color:var(--ink);
    font-family:'Inter',sans-serif;
    -webkit-font-smoothing:antialiased;
    min-height:100vh;
  }
  .display{font-family:'Fraunces',serif;}
  .mono{font-family:'JetBrains Mono',monospace;}

  ::selection{background:var(--clay); color:var(--white);}

  /* ---------- Layout shell ---------- */
  #root{
    display:grid;
    grid-template-columns: 260px 1fr 300px;
    grid-template-rows: 64px 1fr;
    grid-template-areas:
      "topbar topbar topbar"
      "rail stage notes";
    min-height:100vh;
    max-width:1400px;
    margin:0 auto;
  }
  @media (max-width: 980px){
    #root{
      grid-template-columns: 1fr;
      grid-template-rows: 56px auto 1fr auto;
      grid-template-areas:
        "topbar"
        "rail"
        "stage"
        "notes";
    }
  }

  /* ---------- Topbar ---------- */
  #topbar{
    grid-area: topbar;
    display:flex; align-items:center; justify-content:space-between;
    padding:0 24px;
    border-bottom:1px solid var(--line);
  }
  .brand{
    display:flex; align-items:center; gap:10px;
  }
  .brand-mark{
    width:28px;height:28px;border-radius:7px;
    background:var(--pine);
    display:flex;align-items:center;justify-content:center;
    color:var(--paper); font-family:'Fraunces',serif; font-weight:700; font-size:16px;
    flex-shrink:0;
  }
  .brand-name{font-family:'Fraunces',serif; font-weight:600; font-size:19px; letter-spacing:-0.01em;}
  .topbar-stats{display:flex; align-items:center; gap:18px;}
  .stat-chip{
    display:flex; align-items:baseline; gap:5px;
    font-family:'JetBrains Mono',monospace;
    font-size:13px;
    color:var(--stone);
  }
  .stat-chip b{color:var(--ink); font-size:14px; font-weight:700;}
  .level-badge{
    background:var(--pine); color:var(--paper);
    font-family:'JetBrains Mono',monospace; font-weight:700; font-size:12px;
    padding:4px 9px; border-radius:5px; letter-spacing:0.03em;
  }

  /* ---------- Left rail: skill map ---------- */
  #rail{
    grid-area: rail;
    border-right:1px solid var(--line);
    padding:20px 16px;
    overflow-y:auto;
  }
  .rail-title{
    font-size:11px; text-transform:uppercase; letter-spacing:0.08em;
    color:var(--stone); font-weight:600; margin:0 0 14px 4px;
  }
  .skill-node{
    display:flex; align-items:center; gap:10px;
    padding:9px 10px; border-radius:var(--r-sm);
    margin-bottom:3px; cursor:pointer;
    transition: background 0.15s ease;
    position:relative;
  }
  .skill-node:hover{background:var(--card-soft);}
  .skill-node.active{background:var(--card);}
  .skill-ring{
    width:30px; height:30px; flex-shrink:0; position:relative;
  }
  .skill-ring svg{transform:rotate(-90deg);}
  .skill-ring-bg{fill:none; stroke:var(--line); stroke-width:3;}
  .skill-ring-fg{fill:none; stroke:var(--pine); stroke-width:3; stroke-linecap:round; transition: stroke-dashoffset 0.6s ease;}
  .skill-info{flex:1; min-width:0;}
  .skill-name{font-size:13.5px; font-weight:500; color:var(--ink);}
  .skill-sub{font-size:11px; color:var(--stone); font-family:'JetBrains Mono',monospace;}
  .skill-due{
    width:7px; height:7px; border-radius:50%; background:var(--clay);
    flex-shrink:0;
  }

  .rail-section{margin-top:24px;}

  .weekly-bars{
    display:flex; align-items:flex-end; gap:5px; height:46px; padding:0 4px;
  }
  .week-bar{
    flex:1; background:var(--line); border-radius:3px 3px 0 0;
    position:relative; min-height:4px;
  }
  .week-bar.filled{background:var(--pine);}
  .week-bar.today{background:var(--clay);}
  .week-labels{display:flex; gap:5px; padding:6px 4px 0; }
  .week-labels span{flex:1; text-align:center; font-size:9.5px; color:var(--stone); font-family:'JetBrains Mono',monospace;}

  /* ---------- Center stage ---------- */
  #stage{
    grid-area: stage;
    padding:32px 40px;
    overflow-y:auto;
    display:flex; flex-direction:column;
    align-items:center;
  }
  .stage-inner{width:100%; max-width:620px;}

  .session-header{margin-bottom:28px;}
  .eyebrow{
    font-family:'JetBrains Mono',monospace; font-size:11px; text-transform:uppercase;
    letter-spacing:0.1em; color:var(--clay); font-weight:700; margin-bottom:8px;
  }
  .session-title{font-family:'Fraunces',serif; font-size:28px; font-weight:600; letter-spacing:-0.01em; line-height:1.2; margin:0 0 6px;}
  .session-sub{color:var(--stone); font-size:14.5px; line-height:1.5;}

  .card{
    background:var(--white);
    border:1px solid var(--line);
    border-radius:var(--r-lg);
    padding:28px;
    box-shadow:var(--shadow);
  }

  .prompt-text{
    font-family:'Fraunces',serif; font-size:21px; line-height:1.55; font-weight:500;
    margin-bottom:22px;
  }
  .prompt-text .blank{
    display:inline-block; min-width:90px; border-bottom:2px solid var(--pine);
    color:var(--pine); font-weight:600; text-align:center; padding:0 4px;
  }
  .context-tag{
    display:inline-block; background:var(--card); color:var(--stone);
    font-family:'JetBrains Mono',monospace; font-size:11px; padding:3px 8px;
    border-radius:5px; margin-bottom:16px;
  }

  .option-grid{display:flex; flex-direction:column; gap:9px;}
  .option-btn{
    text-align:left;
    padding:13px 16px;
    border:1.5px solid var(--line);
    background:var(--white);
    border-radius:var(--r-md);
    font-family:'Inter',sans-serif;
    font-size:15px;
    cursor:pointer;
    transition: all 0.12s ease;
    color:var(--ink);
  }
  .option-btn:hover{border-color:var(--pine); background:var(--card-soft);}
  .option-btn.selected{border-color:var(--pine); background:#EAF1ED;}
  .option-btn.correct{border-color:var(--good); background:#E8F2EC; color:var(--pine-dim); font-weight:600;}
  .option-btn.incorrect{border-color:var(--bad); background:#FBEAE5; color:var(--bad); font-weight:600;}
  .option-btn:disabled{cursor:default;}

  .free-input-row{display:flex; gap:10px; margin-top:4px;}
  .free-input{
    flex:1; padding:13px 16px; border:1.5px solid var(--line); border-radius:var(--r-md);
    font-family:'Inter',sans-serif; font-size:15px; background:var(--white); color:var(--ink);
  }
  .free-input:focus{outline:none; border-color:var(--pine);}

  .btn{
    font-family:'Inter',sans-serif; font-weight:600; font-size:14.5px;
    padding:12px 22px; border-radius:var(--r-md); border:none;
    cursor:pointer; transition: all 0.12s ease;
  }
  .btn-primary{background:var(--ink); color:var(--paper);}
  .btn-primary:hover{background:#000;}
  .btn-primary:disabled{background:var(--line); color:var(--stone); cursor:not-allowed;}
  .btn-ghost{background:transparent; color:var(--stone); border:1.5px solid var(--line);}
  .btn-ghost:hover{border-color:var(--ink); color:var(--ink);}

  .stage-actions{display:flex; justify-content:space-between; align-items:center; margin-top:20px;}

  .progress-track{
    height:4px; background:var(--line); border-radius:2px; overflow:hidden; margin-bottom:24px;
  }
  .progress-fill{height:100%; background:var(--pine); border-radius:2px; transition: width 0.4s ease;}

  /* Conversation mode */
  .chat-log{display:flex; flex-direction:column; gap:14px; margin-bottom:16px; max-height:380px; overflow-y:auto; padding-right:4px;}
  .msg{max-width:82%; padding:11px 15px; border-radius:14px; font-size:14.5px; line-height:1.5;}
  .msg.tutor{background:var(--card); align-self:flex-start; border-bottom-left-radius:4px;}
  .msg.user{background:var(--ink); color:var(--paper); align-self:flex-end; border-bottom-right-radius:4px;}
  .msg.thinking{background:var(--card); align-self:flex-start; color:var(--stone); font-style:italic;}
  .typing-dots span{display:inline-block; width:5px;height:5px;border-radius:50%;background:var(--stone); margin-right:3px; animation: bounce 1.2s infinite;}
  .typing-dots span:nth-child(2){animation-delay:0.15s;} .typing-dots span:nth-child(3){animation-delay:0.3s;}
  @keyframes bounce{0%,60%,100%{transform:translateY(0);} 30%{transform:translateY(-4px);}}

  /* ---------- Right notes panel (signature element) ---------- */
  #notes{
    grid-area: notes;
    border-left:1px solid var(--line);
    padding:24px 20px;
    overflow-y:auto;
    background: repeating-linear-gradient(var(--paper), var(--paper) 31px, var(--line) 32px);
    background-size: 100% 32px;
  }
  .notes-title{
    font-family:'JetBrains Mono',monospace; font-size:11px; text-transform:uppercase;
    letter-spacing:0.08em; color:var(--stone); font-weight:600; margin-bottom:16px;
  }
  .note{
    margin-bottom:18px;
    padding-left:14px;
    border-left:2.5px solid var(--line);
    animation: slideIn 0.35s ease;
  }
  .note.is-correction{border-left-color:var(--clay);}
  .note.is-praise{border-left-color:var(--pine);}
  .note.is-tip{border-left-color:var(--stone);}
  @keyframes slideIn{from{opacity:0; transform:translateX(8px);} to{opacity:1; transform:translateX(0);}}
  .note-label{
    font-family:'JetBrains Mono',monospace; font-size:10px; text-transform:uppercase;
    letter-spacing:0.06em; font-weight:700; margin-bottom:4px;
  }
  .note.is-correction .note-label{color:var(--clay);}
  .note.is-praise .note-label{color:var(--pine);}
  .note.is-tip .note-label{color:var(--stone);}
  .note-body{
    font-family:'Fraunces',serif; font-style:italic; font-size:14.5px; line-height:1.5; color:var(--ink);
  }
  .note-body .strike{text-decoration:line-through; color:var(--bad); font-style:normal; opacity:0.65;}
  .note-body .fix{color:var(--pine-dim); font-weight:600; font-style:normal;}
  .notes-empty{color:var(--stone); font-size:13px; font-style:italic; line-height:1.6; margin-top:8px;}

  /* mobile tab nav */
  #mobile-tabs{display:none;}
  @media (max-width:980px){
    #mobile-tabs{
      display:flex; border-bottom:1px solid var(--line); position:sticky; top:56px; background:var(--paper); z-index:5;
    }
    .mtab{flex:1; text-align:center; padding:10px; font-size:13px; font-weight:600; color:var(--stone); cursor:pointer; border-bottom:2px solid transparent;}
    .mtab.active{color:var(--ink); border-bottom-color:var(--pine);}
    #rail, #notes{display:none;}
    #rail.show-mobile, #notes.show-mobile{display:block; border:none;}
    #stage{padding:20px;}
  }

  .scroll-fade{
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
/* ── Speech / Mic UI ─────────────────────────────────────── */
.mic-btn{
  flex-shrink:0;
  width:42px; height:42px;
  border-radius:50%;
  border:1.5px solid var(--line);
  background:var(--white);
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition: all 0.15s ease;
  position:relative;
  color:var(--stone);
  font-size:17px;
}
.mic-btn:hover{ border-color:var(--pine); color:var(--pine); }
.mic-btn.listening{
  border-color:var(--clay);
  background:var(--clay);
  color:var(--white);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
.mic-btn.unsupported{ opacity:0.3; cursor:not-allowed; }
@keyframes mic-pulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(196,88,46,0.4); }
  50%{     box-shadow: 0 0 0 8px rgba(196,88,46,0); }
}
.mic-status{
  font-family:'JetBrains Mono',monospace;
  font-size:11px; color:var(--clay);
  margin-top:6px; min-height:16px;
  text-align:center; letter-spacing:0.04em;
}
.note.is-pronunciation .note-label{ color: #6B4FB8; }
.note.is-pronunciation{ border-left-color: #6B4FB8; }

/* ── Listening Exercises ────────────────────────────────────── */
.listen-card{
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  padding:28px;
  box-shadow:var(--shadow);
  margin-bottom:16px;
}
.listen-type-badge{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--card); color:var(--stone);
  font-family:'JetBrains Mono',monospace; font-size:11px;
  padding:4px 10px; border-radius:5px; margin-bottom:16px;
}

/* Audio player row */
.audio-player{
  display:flex; align-items:center; gap:14px;
  padding:14px 16px;
  background:var(--card-soft);
  border:1px solid var(--line);
  border-radius:var(--r-md);
  margin-bottom:20px;
}
.play-btn{
  width:40px; height:40px; border-radius:50%;
  background:var(--ink); color:var(--paper);
  border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
  transition: transform 0.1s ease, background 0.15s ease;
}
.play-btn:hover{ background:var(--pine); }
.play-btn:active{ transform:scale(0.95); }
.play-btn.playing{ background:var(--clay); }

/* Waveform animation */
.waveform{
  display:flex; align-items:center; gap:3px;
  height:32px; flex:1;
}
.wave-bar{
  width:3px; border-radius:2px;
  background:var(--line);
  transition: height 0.1s ease;
}
.waveform.active .wave-bar{
  background:var(--pine);
  animation: wave-bounce 0.8s ease-in-out infinite;
}
.waveform.active .wave-bar:nth-child(1){ animation-delay:0s;    height:8px; }
.waveform.active .wave-bar:nth-child(2){ animation-delay:0.1s;  height:20px; }
.waveform.active .wave-bar:nth-child(3){ animation-delay:0.2s;  height:14px; }
.waveform.active .wave-bar:nth-child(4){ animation-delay:0.05s; height:24px; }
.waveform.active .wave-bar:nth-child(5){ animation-delay:0.15s; height:10px; }
.waveform.active .wave-bar:nth-child(6){ animation-delay:0.25s; height:18px; }
.waveform.active .wave-bar:nth-child(7){ animation-delay:0.1s;  height:28px; }
.waveform.active .wave-bar:nth-child(8){ animation-delay:0.2s;  height:12px; }
.waveform.active .wave-bar:nth-child(9){ animation-delay:0.0s;  height:22px; }
.waveform.active .wave-bar:nth-child(10){ animation-delay:0.15s; height:8px; }
@keyframes wave-bounce{
  0%,100%{ transform:scaleY(0.5); }
  50%{ transform:scaleY(1); }
}
.replay-hint{
  font-size:12px; color:var(--stone);
  font-family:'JetBrains Mono',monospace;
  flex-shrink:0;
}

/* Dictation input */
.dictation-input{
  width:100%; padding:14px 16px;
  border:1.5px solid var(--line);
  border-radius:var(--r-md);
  font-family:'Fraunces',serif; font-style:italic;
  font-size:16px; color:var(--ink);
  background:var(--white);
  resize:none; min-height:80px;
  line-height:1.6;
}
.dictation-input:focus{ outline:none; border-color:var(--pine); }

/* Result display */
.dictation-result{
  padding:14px 16px;
  border-radius:var(--r-md);
  background:var(--card-soft);
  border:1px solid var(--line);
  font-family:'Fraunces',serif; font-style:italic;
  font-size:16px; line-height:1.6; margin-top:12px;
}
.word-correct{ color:var(--pine); }
.word-wrong{ color:var(--bad); text-decoration:line-through; }
.word-missing{ color:var(--clay); font-style:normal; font-weight:600; }

/* Listen exercise picker grid */
.listen-type-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:20px;
}
.listen-type-card{
  padding:16px; border:1.5px solid var(--line);
  border-radius:var(--r-md); cursor:pointer;
  background:var(--white); text-align:left;
  transition: all 0.12s ease;
}
.listen-type-card:hover{ border-color:var(--pine); background:var(--card-soft); }
.listen-type-card.active{ border-color:var(--pine); background:#EAF1ED; }
.ltc-icon{ font-size:22px; margin-bottom:8px; display:block; }
.ltc-name{ font-weight:600; font-size:14px; margin-bottom:3px; }
.ltc-desc{ font-size:12px; color:var(--stone); line-height:1.4; }
.ltc-level{ font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--clay); margin-top:5px; }

/* ── Speed control ───────────────────────────────────────── */
.speed-control{
  display:flex; gap:6px; margin:10px 0 16px;
}
.speed-btn{
  font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700;
  padding:4px 10px; border-radius:5px;
  border:1.5px solid var(--line); background:var(--white);
  cursor:pointer; color:var(--stone);
  transition: all 0.12s ease;
}
.speed-btn:hover{ border-color:var(--pine); color:var(--pine); }
.speed-btn.active{ border-color:var(--pine); background:var(--pine); color:var(--paper); }

/* ── Dashboard ───────────────────────────────────────────────── */
.dash-btn{
  width:32px; height:32px; border-radius:var(--r-sm);
  border:1.5px solid var(--line); background:var(--white);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:var(--stone); transition:all 0.12s ease;
}
.dash-btn:hover{ border-color:var(--pine); color:var(--pine); }

.dash-container{ display:flex; flex-direction:column; gap:16px; width:100%; max-width:680px; padding-bottom:40px; }
.dash-header{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:4px; }

.dash-stats-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:10px; }
.dash-stat{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-md); padding:14px 16px;
}
.dash-stat-value{ font-size:26px; font-weight:700; color:var(--ink); line-height:1; margin-bottom:4px; }
.dash-stat-label{ font-size:11.5px; color:var(--stone); }

.dash-two-col{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media(max-width:640px){ .dash-two-col{ grid-template-columns:1fr; } }

.dash-panel{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
}
.dash-panel-title{ font-weight:600; font-size:14px; margin-bottom:4px; }
.dash-panel-sub{ font-size:12.5px; color:var(--stone); margin-bottom:14px; line-height:1.5; }
.dash-empty{ font-size:13px; color:var(--stone); font-style:italic; }

/* Skill group bars */
.dash-skill-group{ margin-bottom:14px; }
.dash-skill-group:last-child{ margin-bottom:0; }
.dash-skill-group-label{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; margin-bottom:8px; }
.dash-skill-row{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.dash-skill-name{ font-size:12px; color:var(--ink); width:110px; flex-shrink:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dash-skill-bar-wrap{ flex:1; height:8px; background:var(--card); border-radius:4px; overflow:hidden; }
.dash-skill-bar{ height:100%; border-radius:4px; transition:width 0.6s ease; min-width:2px; }
.dash-skill-pct{ font-size:11px; color:var(--stone); width:32px; text-align:right; flex-shrink:0; }

/* CEFR journey SVG */
.dash-panel svg text{ font-smooth:antialiased; -webkit-font-smoothing:antialiased; }

/* Session bars */
.dash-session-bars{ display:flex; align-items:flex-end; gap:8px; height:120px; padding-top:24px; position:relative; }
.dash-session-bar-col{ display:flex; flex-direction:column; align-items:center; flex:1; gap:4px; }
.dash-session-acc{ font-size:10px; color:var(--stone); }
.dash-session-bar-wrap{ width:100%; display:flex; align-items:flex-end; height:72px; }
.dash-session-bar{ width:100%; background:var(--line); border-radius:3px 3px 0 0; min-height:4px; transition:height 0.5s ease; }
.dash-session-bar.current{ background:var(--pine); }
.dash-session-day{ font-size:10px; color:var(--stone); font-family:'JetBrains Mono',monospace; }
.dash-session-focus{ font-size:7px; color:var(--clay); }

/* Rank lists */
.dash-rank-list{ display:flex; flex-direction:column; gap:8px; }
.dash-rank-item{ display:flex; align-items:center; gap:8px; }
.dash-rank-num{ font-size:11px; color:var(--stone); width:14px; flex-shrink:0; }
.dash-rank-name{ font-size:12.5px; color:var(--ink); flex:0 0 120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dash-rank-bar-wrap{ flex:1; height:7px; background:var(--card); border-radius:4px; overflow:hidden; }
.dash-rank-bar{ height:100%; border-radius:4px; }
.dash-rank-bar.strong{ background:var(--pine); }
.dash-rank-bar.weak{ background:var(--clay); opacity:0.7; }
.dash-rank-pct{ font-size:11px; color:var(--stone); width:32px; text-align:right; flex-shrink:0; }

/* Error list */
.dash-error-list{ display:flex; flex-direction:column; gap:10px; }
.dash-error-item{ display:flex; align-items:center; gap:10px; }
.dash-error-skill{ font-size:13px; flex:0 0 130px; color:var(--ink); }
.dash-error-count{ font-size:11px; color:var(--clay); flex-shrink:0; }
.dash-error-bar-wrap{ flex:1; height:5px; background:var(--card); border-radius:3px; overflow:hidden; }
.dash-error-bar{ height:100%; background:var(--clay); opacity:0.6; border-radius:3px; transition:width 0.5s ease; }

/* Next action */
.dash-next-action{ border-left:3px solid var(--pine); }
.next-action-item{ display:flex; gap:14px; align-items:flex-start; margin-bottom:14px; }
.next-action-item:last-child{ margin-bottom:0; }
.next-action-icon{
  width:32px; height:32px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; flex-shrink:0;
}
.next-action-title{ font-size:13.5px; font-weight:600; color:var(--ink); margin-bottom:3px; }
.next-action-body{ font-size:12.5px; color:var(--stone); line-height:1.5; }

/* ── Onboarding ──────────────────────────────────────────────── */
.onboard-container{ display:flex; flex-direction:column; gap:16px; width:100%; max-width:560px; }

.ob-progress{ display:flex; gap:6px; margin-bottom:8px; }
.ob-dot{
  width:28px; height:4px; border-radius:2px;
  background:var(--line); transition:all 0.25s ease;
}
.ob-dot.done{ background:var(--pine); }
.ob-dot.active{ background:var(--clay); width:40px; }

.ob-options{ display:flex; flex-direction:column; gap:8px; }
.ob-option{
  display:flex; align-items:center; gap:14px;
  padding:13px 16px; border:1.5px solid var(--line);
  background:var(--white); border-radius:var(--r-md);
  cursor:pointer; text-align:left;
  transition:all 0.12s ease; width:100%;
}
.ob-option:hover{ border-color:var(--pine); background:var(--card-soft); }
.ob-option.selected{ border-color:var(--pine); background:#EAF1ED; }
.ob-option-icon{ font-size:22px; flex-shrink:0; width:30px; text-align:center; }
.ob-option-text{ flex:1; min-width:0; }
.ob-option-label{ font-size:14.5px; font-weight:600; color:var(--ink); }
.ob-option-desc{ font-size:12px; color:var(--stone); margin-top:2px; }
.ob-option-check{
  font-size:14px; color:var(--pine); opacity:0;
  transition:opacity 0.15s ease; flex-shrink:0;
}
.ob-option.selected .ob-option-check{ opacity:1; }

.ob-text-wrap{ display:flex; flex-direction:column; }
.ob-text-input{
  width:100%; padding:14px 16px;
  border:1.5px solid var(--line); border-radius:var(--r-md);
  font-family:'Inter',sans-serif; font-size:15px;
  background:var(--white); color:var(--ink);
  resize:vertical; line-height:1.5;
}
.ob-text-input:focus{ outline:none; border-color:var(--pine); }

.onboard-actions{
  display:flex; justify-content:space-between; align-items:center;
  margin-top:4px;
}
.onboard-skip{ font-size:13px; color:var(--stone); }

/* Summary screen */
.ob-summary-cards{
  display:grid; grid-template-columns:1fr 1fr; gap:10px;
}
.ob-summary-card{
  background:var(--card-soft); border-radius:var(--r-md);
  padding:14px; display:flex; flex-direction:column; gap:4px;
}
.ob-summary-icon{ font-size:20px; }
.ob-summary-label{ font-size:11px; color:var(--stone); text-transform:uppercase; letter-spacing:0.06em; font-weight:600; }
.ob-summary-value{ font-size:13.5px; font-weight:600; color:var(--ink); line-height:1.3; }

.ob-priority-list{ background:var(--white); border:1px solid var(--line); border-radius:var(--r-md); padding:16px; }
.ob-priority-title{ font-size:12px; color:var(--stone); text-transform:uppercase; letter-spacing:0.06em; font-weight:600; margin-bottom:12px; }
.ob-priority-item{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.ob-priority-item:last-child{ margin-bottom:0; }
.ob-priority-num{ font-size:11px; color:var(--stone); width:14px; flex-shrink:0; }
.ob-priority-name{ font-size:13px; color:var(--ink); flex:0 0 130px; }
.ob-priority-bar-wrap{ flex:1; height:6px; background:var(--card); border-radius:3px; overflow:hidden; }
.ob-priority-bar{ height:100%; background:var(--pine); border-radius:3px; transition:width 0.5s ease; }

.ob-goal-box{
  background:var(--card-soft); border-radius:var(--r-md);
  padding:16px; border-left:3px solid var(--pine);
}
.ob-goal-label{ font-size:11px; text-transform:uppercase; letter-spacing:0.06em; color:var(--stone); font-weight:600; margin-bottom:6px; }
.ob-goal-text{ font-family:'Fraunces',serif; font-size:16px; font-style:italic; color:var(--ink); line-height:1.5; margin-bottom:6px; }
.ob-goal-sub{ font-size:12px; color:var(--stone); }

.ob-start-btn{ width:100%; font-size:16px; padding:14px; margin-top:4px; }

/* ── Save code panel (in left rail) ─────────────────────────── */
.save-code-panel{
  padding:12px 10px;
  border-top:1px solid var(--line);
  margin-top:8px;
}
.save-code-label{
  font-size:10px; text-transform:uppercase; letter-spacing:0.07em;
  color:var(--stone); font-weight:600; margin-bottom:5px;
}
.save-code-value{
  font-size:12px; color:var(--ink); font-weight:700;
  letter-spacing:0.04em; margin-bottom:8px; cursor:pointer;
  word-break:break-all;
}
.save-code-actions{ display:flex; gap:6px; flex-wrap:wrap; }
.save-code-btn{
  font-size:11px; font-family:'Inter',sans-serif; font-weight:500;
  padding:4px 8px; border-radius:4px;
  border:1px solid var(--line); background:var(--white);
  cursor:pointer; color:var(--stone);
  transition:all 0.12s ease;
}
.save-code-btn:hover{ border-color:var(--pine); color:var(--pine); }
.save-code-status{
  font-size:10.5px; color:var(--pine); margin-top:5px;
  min-height:14px; font-family:'JetBrains Mono',monospace;
}

/* ── Writing module ──────────────────────────────────────────── */
.write-container{ display:flex; flex-direction:column; gap:16px; width:100%; max-width:680px; padding-bottom:48px; }

.write-header{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:4px; }

.write-prompt-box{
  background:var(--card-soft); border-radius:var(--r-lg);
  padding:20px 22px; border-left:3px solid var(--pine);
}
.write-prompt-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:0.08em; color:var(--pine); font-weight:700; margin-bottom:8px; }
.write-prompt-text{ font-family:'Fraunces',serif; font-size:17px; line-height:1.6; color:var(--ink); margin-bottom:12px; }
.write-prompt-meta{ display:flex; gap:16px; }

.write-tips{
  font-size:12.5px; color:var(--stone); padding:8px 12px;
  background:var(--card); border-radius:var(--r-sm);
  line-height:1.5;
}

.write-editor{
  width:100%; min-height:220px; padding:18px 20px;
  border:1.5px solid var(--line); border-radius:var(--r-lg);
  font-family:'Fraunces',serif; font-size:16px; line-height:1.75;
  background:var(--white); color:var(--ink); resize:vertical;
}
.write-editor:focus{ outline:none; border-color:var(--pine); }

.write-footer{ display:flex; justify-content:space-between; align-items:center; gap:12px; }
.write-wordcount{ font-family:'JetBrains Mono',monospace; font-size:12px; color:var(--stone); }
.write-submit-note{ display:flex; align-items:center; padding:12px 0; }

/* Score card */
.write-score-card{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
  display:flex; gap:24px; align-items:flex-start;
}
@media(max-width:640px){ .write-score-card{ flex-direction:column; } }
.write-overall-score{ text-align:center; flex-shrink:0; min-width:80px; }
.write-band{
  font-size:52px; font-weight:700; color:var(--pine); line-height:1;
  margin-bottom:4px;
}
.write-band-label{ font-size:11px; color:var(--stone); text-transform:uppercase; letter-spacing:0.06em; font-weight:600; }
.write-cefr-equiv{ font-size:12px; color:var(--stone); margin-top:3px; }
.write-dimension-scores{ flex:1; display:flex; flex-direction:column; gap:10px; }
.write-dim{ display:flex; align-items:center; gap:10px; }
.write-dim-name{ font-size:12px; color:var(--ink); flex:0 0 190px; }
.write-dim-bar-wrap{ flex:1; height:7px; background:var(--card); border-radius:4px; overflow:hidden; }
.write-dim-bar{ height:100%; border-radius:4px; transition:width 0.6s ease; }
.write-dim-score{ font-size:11px; color:var(--stone); width:28px; text-align:right; flex-shrink:0; }

/* Panels */
.write-panel{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
}
.write-panel-title{ font-weight:600; font-size:14px; margin-bottom:4px; }
.write-panel-sub{ font-size:12.5px; color:var(--stone); margin-bottom:14px; line-height:1.5; }
.write-priority-note{ font-weight:400; color:var(--stone); font-size:12px; }

/* Strengths */
.write-strengths-panel{ border-left:3px solid var(--pine); }
.write-strength-item{ margin-bottom:12px; }
.write-strength-item:last-child{ margin-bottom:0; }
.write-strength-label{ font-size:13px; font-weight:600; color:var(--pine); margin-bottom:2px; }
.write-strength-body{ font-size:13px; color:var(--ink); line-height:1.5; }
.write-strength-example{
  font-family:'Fraunces',serif; font-style:italic;
  font-size:13px; color:var(--stone); margin-top:4px;
  padding-left:10px; border-left:2px solid var(--line);
}

/* Annotated essay */
.write-annotated-essay{
  font-family:'Fraunces',serif; font-size:15px; line-height:1.8; color:var(--ink);
}
.write-annotated-essay p{ margin:0 0 14px; }
.ann-mark{ border-radius:2px; position:relative; cursor:pointer; }
.ann-num{
  display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:50%;
  font-family:'JetBrains Mono',monospace; font-size:9px; font-weight:700;
  color:var(--paper); margin-left:2px; vertical-align:super;
  cursor:pointer; flex-shrink:0;
}

/* Error items */
.write-errors-panel{ border-left:3px solid var(--clay); }
.write-error-item{
  margin-bottom:18px; padding-bottom:18px;
  border-bottom:1px solid var(--line);
}
.write-error-item:last-child{ margin-bottom:0; padding-bottom:0; border-bottom:none; }
.write-error-header{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.write-error-num{
  width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700;
  color:var(--paper); flex-shrink:0;
}
.write-error-cat{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; }
.write-error-original{
  font-family:'Fraunces',serif; font-style:italic;
  font-size:14px; color:var(--bad); text-decoration:line-through;
  margin-bottom:4px; opacity:0.8;
}
.write-error-correction{ font-size:14px; color:var(--pine); font-weight:600; margin-bottom:8px; }
.write-error-explain{ font-size:13px; color:var(--ink); line-height:1.5; margin-bottom:4px; }
.write-error-rule{
  font-size:12px; color:var(--stone); font-style:italic;
  padding-left:10px; border-left:2px solid var(--line);
}

/* Practice activities */
.write-activities-panel{ border-left:3px solid #6B4FB8; }
.write-activity{ display:flex; flex-direction:column; gap:12px; }
.write-act-eyebrow{
  font-family:'JetBrains Mono',monospace; font-size:10.5px;
  text-transform:uppercase; letter-spacing:0.08em; color:#6B4FB8; font-weight:700;
}
.write-act-prompt{ font-size:14.5px; color:var(--ink); line-height:1.5; }
.write-act-original{
  font-family:'Fraunces',serif; font-style:italic; font-size:14px;
  color:var(--stone); padding:10px 14px; background:var(--card-soft);
  border-radius:var(--r-sm);
}
.write-act-note{
  padding:12px 14px; border-radius:var(--r-sm);
  font-size:13px; line-height:1.5;
}
.write-act-note.is-correct{ background:#EAF1ED; border-left:3px solid var(--pine); }
.write-act-note.is-incorrect{ background:#FBEAE5; border-left:3px solid var(--clay); }
.write-act-done{
  text-align:center; padding:24px;
  color:var(--pine); font-size:14px;
}
.write-activity-progress{
  font-family:'JetBrains Mono',monospace; font-size:11px;
  color:var(--stone); margin-top:8px; text-align:right;
}
.write-actions{ display:flex; gap:10px; justify-content:space-between; }

/* ── TTS quality badge ───────────────────────────────────────── */
.tts-quality-badge{
  font-family:'JetBrains Mono',monospace;
  font-size:10px; color:var(--stone);
  letter-spacing:0.04em; align-self:center;
  flex-shrink:0; white-space:nowrap;
  transition:color 0.3s ease;
}

/* ── Curriculum module ───────────────────────────────────────── */
.btn-pine{
  font-family:'Inter',sans-serif; font-weight:600; font-size:14.5px;
  padding:12px 22px; border-radius:var(--r-md); border:none;
  cursor:pointer; background:var(--pine); color:var(--paper);
  transition:all 0.12s ease;
}
.btn-pine:hover{ background:var(--pine-dim); }

.curr-container{ display:flex; flex-direction:column; gap:14px; width:100%; max-width:680px; padding-bottom:48px; }

.curr-stages{ display:flex; flex-direction:column; gap:12px; }

.curr-stage{
  background:var(--white); border:1.5px solid var(--line);
  border-radius:var(--r-lg); padding:18px 20px;
  transition:border-color 0.2s ease;
  position:relative;
}
.curr-stage.unlocked{ border-color:var(--stage-color, var(--pine)); }
.curr-stage.current{ box-shadow:0 0 0 3px color-mix(in srgb, var(--stage-color, var(--pine)) 20%, transparent); }
.curr-stage.completed{ background:var(--card-soft); opacity:0.85; }

.curr-stage-header{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.curr-stage-icon{ font-size:24px; flex-shrink:0; }
.curr-stage-info{ flex:1; }
.curr-stage-name{ font-size:15px; font-weight:600; color:var(--ink); }
.curr-stage-band{ font-size:11px; color:var(--stone); margin-top:2px; }
.curr-stage-status{
  font-size:11px; font-weight:700; padding:3px 8px; border-radius:4px;
  font-family:'JetBrains Mono',monospace; text-transform:uppercase; letter-spacing:0.05em;
  flex-shrink:0;
}
.curr-stage-status.done{ background:#EAF1ED; color:var(--pine); }
.curr-stage-status.current{ background:var(--card); color:var(--ink); }
.curr-stage-status.ready{ background:#FFF8E7; color:#A07800; }
.curr-stage-status.locked{ background:var(--card); color:var(--stone); }

.curr-stage-desc{ font-size:13px; color:var(--stone); line-height:1.5; margin-bottom:12px; }
.curr-stage-locked-msg{ font-size:12.5px; color:var(--stone); font-style:italic; margin-top:4px; }

.curr-stage-bar-row{ display:flex; align-items:center; gap:10px; }
.curr-stage-bar-wrap{ flex:1; height:6px; background:var(--card); border-radius:3px; overflow:hidden; }
.curr-stage-bar{ height:100%; border-radius:3px; transition:width 0.5s ease; }

.curr-start-btn{ font-size:13.5px; padding:10px 18px; }

/* ================================================================
   MOBILE UI POLISH — comprehensive touch-first overhaul
   Breakpoints: 480px (small phone), 640px (large phone/small tablet)
   Touch target minimum: 44px (Apple HIG) / 48dp (Material)
   Safe area: env(safe-area-inset-*) for notch/home-indicator devices
   ================================================================ */

/* ── Base mobile resets ─────────────────────────────────────── */
@media (max-width: 640px){

  /* Prevent iOS text size adjustment on orientation change */
  html{ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  /* Smooth momentum scrolling on iOS */
  #stage, #rail, #notes{ -webkit-overflow-scrolling: touch; }

  /* ── Root layout ── */
  #root{
    grid-template-rows: 52px auto 1fr;
    /* No bottom auto row — notes panel is tab-switched, not in flow */
  }

  /* ── Topbar: collapse to essentials ── */
  #topbar{ padding: 0 14px; height: 52px; }
  .brand-name{ font-size: 16px; }
  .brand-mark{ width: 24px; height: 24px; font-size: 13px; }
  .topbar-stats{ gap: 10px; }

  /* Hide verbose stats on small screens — keep level badge and dash button */
  .stat-chip.save-status{ display: none; }
  .stat-chip:not(.save-status):nth-child(n+3){ display: none; }

  /* ── Mobile tabs ── */
  #mobile-tabs{
    position: sticky;
    top: 52px;
    z-index: 10;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    /* Safe area for notch devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .mtab{
    padding: 12px 8px;
    font-size: 12px;
    min-height: 44px; /* Touch target */
    display: flex; align-items: center; justify-content: center;
  }

  /* ── Stage (main content area) ── */
  #stage{
    padding: 16px 14px;
    /* Bottom padding: accounts for iOS home indicator */
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .stage-inner{
    max-width: 100%;
    padding: 0;
  }

  /* ── Typography scaling ── */
  .session-title{ font-size: 22px; line-height: 1.25; }
  .session-sub{ font-size: 13.5px; }
  .eyebrow{ font-size: 10px; }
  .prompt-text{ font-size: 17px; line-height: 1.6; }

  /* ── Cards ── */
  .card{ padding: 18px 16px; border-radius: var(--r-md); }

  /* ── Option buttons — 48px minimum touch target ── */
  .option-btn{
    padding: 14px 16px;
    min-height: 48px;
    font-size: 15px;
    border-radius: var(--r-md);
    /* Prevent text from being too small to read */
    line-height: 1.4;
  }

  /* ── Primary / ghost buttons ── */
  .btn{
    min-height: 44px;
    padding: 12px 18px;
    font-size: 14px;
    border-radius: var(--r-md);
  }
  .btn-primary{ width: 100%; justify-content: center; }
  .stage-actions{
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 16px;
  }
  .stage-actions .btn-ghost{ width: 100%; }

  /* ── Free input rows ── */
  .free-input-row{
    flex-wrap: wrap;
    gap: 8px;
  }
  .free-input{
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
    padding: 13px 14px;
    border-radius: var(--r-md);
  }

  /* Keyboard-safe: extra bottom padding when input is focused */
  .free-input:focus ~ .stage-actions,
  .free-input:focus + .stage-actions{
    padding-bottom: 16px;
  }

  /* ── Conversation chat ── */
  .chat-log{ max-height: 280px; }
  .msg{ font-size: 14px; padding: 10px 13px; }
  .free-input-row .btn{ min-width: 64px; flex-shrink: 0; }

  /* ── Mic button ── */
  .mic-btn{ width: 44px; height: 44px; } /* Exact touch target */

  /* ── Progress bar ── */
  .progress-track{ height: 5px; margin-bottom: 18px; }

  /* ── Session header ── */
  .session-header{ margin-bottom: 16px; }
  .session-header h1.session-title{ margin-bottom: 4px; }

  /* ── Home screen buttons ── */
  #stage .card{ padding: 20px 16px; }

  /* ── Onboarding ── */
  .onboard-container{ gap: 14px; }
  .ob-option{
    padding: 12px 14px;
    min-height: 52px; /* Taller for easier tapping */
  }
  .ob-option-icon{ font-size: 20px; width: 26px; }
  .ob-option-label{ font-size: 14px; }
  .ob-option-desc{ font-size: 11.5px; }
  .ob-summary-cards{ grid-template-columns: 1fr; gap: 8px; }
  .ob-start-btn{ padding: 14px; font-size: 15px; }
  .ob-progress{ margin-bottom: 12px; }

  /* ── Dashboard ── */
  .dash-stat{ padding: 12px; }
  .dash-stat-value{ font-size: 22px; }
  .dash-stats-row{ grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dash-panel{ padding: 16px; }
  .dash-panel-title{ font-size: 13.5px; }

  /* Fix dimension score bar overflow */
  .write-dim{ flex-wrap: wrap; }
  .write-dim-name{
    flex: 0 0 100%; /* Full width label */
    font-size: 11.5px;
    margin-bottom: 4px;
  }
  .write-dim-bar-wrap{ flex: 1; }

  /* Score card stacks on mobile */
  .write-score-card{ flex-direction: column; gap: 16px; padding: 16px; }
  .write-overall-score{ text-align: left; display: flex; align-items: center; gap: 16px; }
  .write-band{ font-size: 40px; }

  /* ── Writing editor ── */
  .write-container{ gap: 12px; }
  .write-prompt-box{ padding: 16px; }
  .write-prompt-text{ font-size: 15px; }
  .write-editor{
    font-size: 16px; /* Prevent iOS zoom */
    min-height: 180px;
    padding: 14px;
  }
  .write-footer{
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .write-footer > div{
    width: 100%;
    flex-direction: column;
    display: flex;
    gap: 8px;
  }
  .write-footer .btn{ width: 100%; }
  .write-actions{ flex-direction: column; gap: 8px; }
  .write-actions .btn{ width: 100%; }

  /* Error annotations — smaller on mobile */
  .write-annotated-essay{ font-size: 14px; line-height: 1.7; }
  .ann-num{ width: 14px; height: 14px; font-size: 8px; }
  .write-error-item{ padding-bottom: 14px; margin-bottom: 14px; }

  /* ── Curriculum stage map ── */
  .curr-container{ gap: 12px; }
  .curr-stage{ padding: 14px; }
  .curr-stage-header{ gap: 10px; flex-wrap: wrap; }
  .curr-stage-icon{ font-size: 20px; }
  .curr-stage-name{ font-size: 14px; }
  .curr-stage-status{ font-size: 10px; padding: 2px 6px; }
  .curr-start-btn{ font-size: 13px; padding: 10px 14px; width: 100%; }
  .curr-stage-desc{ font-size: 12.5px; }

  /* ── Listening exercises ── */
  .audio-player{ padding: 12px; border-radius: var(--r-md); }
  .play-btn{ width: 48px; height: 48px; } /* Minimum touch target */
  .speed-control{ gap: 4px; flex-wrap: wrap; }
  .speed-btn{ padding: 6px 12px; min-height: 36px; font-size: 12px; }
  .tts-quality-badge{ font-size: 9px; }

  /* ── Save code panel ── */
  .save-code-panel{ padding: 10px 8px; }
  .save-code-actions{ flex-direction: column; gap: 4px; }
  .save-code-btn{ width: 100%; text-align: center; padding: 8px; min-height: 36px; }

  /* ── Notes panel ── */
  #notes{ padding: 16px 14px; }
  .note-body{ font-size: 13.5px; }

  /* ── Skill rail ── */
  #rail{ padding: 16px 12px; }
  .skill-node{ padding: 8px; }
  .skill-name{ font-size: 13px; }
  .skill-sub{ font-size: 10.5px; }

  /* ── Context tags ── */
  .context-tag{ font-size: 10px; padding: 2px 6px; margin-bottom: 12px; }
}

/* ── Extra small (SE-size, 375px and below) ── */
@media (max-width: 390px){
  .session-title{ font-size: 19px; }
  .prompt-text{ font-size: 16px; }
  .option-btn{ font-size: 14px; }
  .brand-name{ display: none; } /* Show only logo mark on tiny screens */
  .topbar-stats{ gap: 8px; }
  .ob-summary-cards{ grid-template-columns: 1fr; }
}

/* ── Landscape phone ── */
@media (max-width: 900px) and (orientation: landscape){
  #stage{ padding: 12px 16px; }
  .session-title{ font-size: 18px; }
  .card{ padding: 14px 16px; }
  .write-editor{ min-height: 120px; }
  .chat-log{ max-height: 200px; }
}

/* ── Touch device: remove hover states that feel sticky ── */
@media (hover: none){
  .option-btn:hover{ border-color: var(--line); background: var(--white); }
  .btn-primary:hover{ background: var(--ink); }
  .btn-ghost:hover{ border-color: var(--line); color: var(--stone); }
  .skill-node:hover{ background: transparent; }
  .ob-option:hover{ border-color: var(--line); background: var(--white); }

  /* Increase tap feedback via active state instead */
  .option-btn:active{ border-color: var(--pine); background: var(--card-soft); }
  .btn-primary:active{ opacity: 0.85; }
  .btn-ghost:active{ background: var(--card-soft); }
  .ob-option:active{ border-color: var(--pine); background: var(--card-soft); }
}

/* ── Safe area insets for notch/home-indicator ── */
@supports (padding: env(safe-area-inset-bottom)){
  #root{
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  #topbar{
    padding-top: env(safe-area-inset-top);
    height: calc(52px + env(safe-area-inset-top));
  }
  #stage{
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* ── Focus styles: visible on keyboard nav, clean on touch ── */
@media (hover: hover){
  .free-input:focus{ box-shadow: 0 0 0 3px rgba(59,110,94,0.15); }
  .option-btn:focus-visible{ outline: 2px solid var(--pine); outline-offset: 2px; }
}
.free-input:focus{ outline: none; } /* Replaced by border-color change */

/* ── Speaking Lab ────────────────────────────────────────────── */
.speak-container{ display:flex; flex-direction:column; gap:16px; width:100%; max-width:680px; padding-bottom:48px; }

/* Task picker */
.speak-task-grid{ display:flex; flex-direction:column; gap:10px; }
.speak-task-card{
  display:flex; align-items:flex-start; gap:14px;
  padding:16px; border:1.5px solid var(--line);
  background:var(--white); border-radius:var(--r-lg);
  cursor:pointer; transition:all 0.12s ease;
}
.speak-task-card:hover{ border-color:var(--pine); background:var(--card-soft); }
.speak-task-icon{ font-size:28px; flex-shrink:0; }
.speak-task-info{ flex:1; }
.speak-task-title{ font-size:15px; font-weight:600; color:var(--ink); margin-bottom:4px; }
.speak-task-desc{ font-size:13px; color:var(--stone); line-height:1.5; margin-bottom:6px; }
.speak-task-badge{
  font-size:11px; font-family:'JetBrains Mono',monospace;
  color:var(--pine); font-weight:600; text-transform:uppercase; letter-spacing:0.05em;
}
.speak-tip{
  font-size:12.5px; color:var(--stone); padding:10px 14px;
  background:var(--card); border-radius:var(--r-sm); line-height:1.5;
}

/* Prompt box */
.speak-prompt-box{
  background:var(--white); border:1.5px solid var(--pine);
  border-radius:var(--r-lg); padding:20px 22px;
}
.speak-prompt-label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:0.08em;
  color:var(--pine); font-weight:700; margin-bottom:10px;
}
.speak-read-text{
  font-family:'Fraunces',serif; font-size:17px; line-height:1.8;
  color:var(--ink);
}
.speak-opinion-q{
  font-family:'Fraunces',serif; font-size:17px; line-height:1.6;
  color:var(--ink); font-weight:500;
}
.speak-image-placeholder{
  background:var(--card); border-radius:var(--r-md);
  padding:20px; text-align:center; margin-bottom:12px;
}
.speak-image-icon{ font-size:40px; margin-bottom:10px; }
.speak-image-desc{ font-size:13.5px; color:var(--stone); line-height:1.5; font-style:italic; }
.speak-task-instruction{ font-size:14px; color:var(--ink); line-height:1.5; margin-top:8px; }

/* Prep box */
.speak-prep-box{
  text-align:center; padding:16px;
  background:var(--card-soft); border-radius:var(--r-md);
}
.speak-prep-label{ font-size:11px; text-transform:uppercase; letter-spacing:0.07em; color:var(--stone); font-weight:600; margin-bottom:6px; }
.speak-prep-timer{ font-family:'JetBrains Mono',monospace; font-size:28px; font-weight:700; color:var(--ink); }
.speak-prep-sub{ font-size:12px; color:var(--stone); margin-top:4px; }

/* Recorder */
.speak-recorder{
  background:var(--white); border:1.5px solid var(--line);
  border-radius:var(--r-lg); padding:24px 20px;
  display:flex; flex-direction:column; align-items:center; gap:14px;
}
.speak-waveform{
  display:flex; align-items:center; gap:3px; height:48px;
}
.speak-wave-bar{
  width:8px; background:var(--line); border-radius:3px;
  transition:height 0.06s ease; min-height:4px;
}
.speak-timer-display{
  font-family:'JetBrains Mono',monospace; font-size:32px;
  font-weight:700; color:var(--ink); transition:color 0.3s;
}
.speak-rec-label{ font-size:13px; color:var(--stone); }
.speak-rec-btn{
  width:72px; height:72px; border-radius:50%;
  background:var(--ink); border:none; cursor:pointer;
  font-size:28px; display:flex; align-items:center; justify-content:center;
  transition:all 0.15s ease; box-shadow:0 2px 12px rgba(28,27,25,0.2);
}
.speak-rec-btn:hover{ transform:scale(1.05); }
.speak-rec-btn.recording{
  background:var(--clay);
  animation:rec-pulse 1.5s ease-in-out infinite;
}
@keyframes rec-pulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(196,88,46,0.4); }
  50%{     box-shadow:0 0 0 12px rgba(196,88,46,0); }
}
.speak-rec-hint{ font-size:11.5px; color:var(--stone); font-family:'JetBrains Mono',monospace; }
.speak-submit-note{ display:flex; align-items:center; padding:12px 0; }

/* Score card */
.speak-score-card{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
  display:flex; gap:24px; align-items:flex-start;
}
@media(max-width:640px){ .speak-score-card{ flex-direction:column; } }
.speak-overall{ text-align:center; flex-shrink:0; min-width:80px; }
.speak-band{ font-size:52px; font-weight:700; line-height:1; margin-bottom:4px; }
.speak-band-label{ font-size:11px; color:var(--stone); text-transform:uppercase; letter-spacing:0.06em; font-weight:600; }
.speak-band-sub{ font-size:12px; color:var(--stone); margin-top:3px; }
.speak-dimensions{ flex:1; display:flex; flex-direction:column; gap:10px; }
.speak-dim{ display:flex; align-items:center; gap:10px; }
.speak-dim-name{ font-size:12px; color:var(--ink); flex:0 0 160px; }
.speak-dim-bar-wrap{ flex:1; height:7px; background:var(--card); border-radius:4px; overflow:hidden; }
.speak-dim-bar{ height:100%; border-radius:4px; transition:width 0.6s ease; }
.speak-dim-score{ font-size:12px; font-family:'JetBrains Mono',monospace; width:28px; text-align:right; flex-shrink:0; }

/* Panels */
.speak-panel{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
}
.speak-panel-title{ font-weight:600; font-size:14px; margin-bottom:4px; }
.speak-panel-sub{ font-size:12.5px; color:var(--stone); margin-bottom:14px; line-height:1.5; }
.speak-strengths-panel{ border-left:3px solid var(--pine); }
.speak-feedback-panel{ border-left:3px solid var(--clay); }
.speak-model-panel{ border-left:3px solid #6B4FB8; }

/* Transcript */
.speak-transcript{
  font-family:'Fraunces',serif; font-size:15px; line-height:1.9;
  color:var(--ink); margin-bottom:14px;
}
.speak-transcript-word{ display:inline; }
.speak-ref-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:0.07em; color:var(--stone); font-weight:600; margin-bottom:6px; margin-top:8px; }
.speak-reference{ font-size:13.5px; color:var(--stone); font-style:italic; line-height:1.6; }

/* Word grid */
.speak-word-grid{ display:flex; flex-wrap:wrap; gap:6px; }
.speak-word-chip{
  display:flex; flex-direction:column; align-items:center;
  padding:6px 10px; border-radius:var(--r-sm); border:1px solid;
  min-width:48px; cursor:default;
}
.speak-word-text{ font-size:13px; font-weight:500; color:var(--ink); }
.speak-word-score{ font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:700; margin-top:2px; }

/* Feedback */
.speak-feedback-item{ display:flex; gap:12px; margin-bottom:16px; align-items:flex-start; }
.speak-feedback-item:last-child{ margin-bottom:0; }
.speak-feedback-num{
  width:22px; height:22px; border-radius:50%; flex-shrink:0;
  background:var(--clay); color:var(--paper);
  font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.speak-feedback-label{ font-size:13px; font-weight:600; color:var(--ink); margin-bottom:3px; }
.speak-feedback-text{ font-size:13px; color:var(--ink); line-height:1.5; }
.speak-feedback-example{ font-size:12.5px; color:var(--stone); margin-top:4px; }

/* Model button */
.speak-model-btn{ margin-top:4px; }

/* Mobile */
@media(max-width:640px){
  .speak-rec-btn{ width:64px; height:64px; font-size:24px; }
  .speak-band{ font-size:40px; }
  .speak-dim-name{ flex:0 0 120px; font-size:11.5px; }
  .speak-read-text{ font-size:15px; }
  .speak-word-chip{ padding:5px 8px; min-width:42px; }
}

/* ── Auth screen ─────────────────────────────────────────────── */
.auth-container{
  display:flex; flex-direction:column; align-items:center;
  gap:20px; width:100%; max-width:420px;
  padding:24px 0 48px; margin:0 auto;
}
.auth-brand{ text-align:center; }
.auth-brand-name{ font-size:28px; font-weight:600; letter-spacing:-0.01em; margin:8px 0 4px; }
.auth-brand-sub{ font-size:14px; color:var(--stone); }

.auth-card{ width:100%; padding:28px; }

.auth-tabs{
  display:flex; gap:0; margin-bottom:22px;
  border-bottom:1px solid var(--line);
}
.auth-tab{
  flex:1; padding:10px; font-size:14px; font-weight:600;
  background:transparent; border:none; cursor:pointer;
  color:var(--stone); border-bottom:2px solid transparent;
  transition:all 0.15s ease; font-family:'Inter',sans-serif;
  margin-bottom:-1px;
}
.auth-tab.active{ color:var(--ink); border-bottom-color:var(--pine); }

.auth-form{ display:flex; flex-direction:column; gap:14px; }
.auth-field{ display:flex; flex-direction:column; gap:5px; }
.auth-label{ font-size:13px; font-weight:500; color:var(--ink); }
.auth-hint{ font-weight:400; color:var(--stone); }
.auth-input{ font-size:15px; } /* inherits .free-input */

.auth-error{
  font-size:13px; color:var(--bad);
  padding:8px 12px; background:#FBEAE5;
  border-radius:var(--r-sm); border-left:3px solid var(--bad);
  line-height:1.4;
}
.auth-submit{ width:100%; margin-top:4px; }
.auth-footer{
  margin-top:16px; text-align:center;
  font-size:13px; color:var(--stone);
}
.auth-link{
  background:none; border:none; cursor:pointer;
  color:var(--pine); font-size:13px; font-weight:600;
  font-family:'Inter',sans-serif; padding:0; text-decoration:underline;
}
.auth-migrate-note{
  font-size:12.5px; color:var(--pine);
  padding:8px 12px; background:#EAF1ED;
  border-radius:var(--r-sm); border-left:3px solid var(--pine);
}
.auth-skip{ text-align:center; }
.auth-skip-note{ font-size:11.5px; color:var(--stone); margin-top:4px; }

/* Account menu in topbar — avatar + always-visible logout button */
.auth-menu{ display:flex; align-items:center; gap:8px; }
.auth-avatar-btn{
  width:30px; height:30px; border-radius:50%;
  background:var(--pine); color:var(--paper);
  border:none; cursor:default; font-size:13px; font-weight:700;
  font-family:'Inter',sans-serif;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.auth-logout-direct{
  padding:5px 12px; border:1px solid var(--line); border-radius:6px;
  background:var(--white); color:var(--stone);
  font-size:12px; font-weight:600; cursor:pointer;
  font-family:'Inter',sans-serif; white-space:nowrap;
  transition:all 0.12s ease;
}
.auth-logout-direct:hover{ border-color:var(--clay); color:var(--clay); background:#FBEAE5; }

@media(max-width:640px){
  .auth-logout-direct{ padding:4px 8px; font-size:11px; }
}

/* Mobile auth */
@media(max-width:640px){
  .auth-container{ padding:16px 0 32px; }
  .auth-card{ padding:20px 16px; }
  .auth-brand-name{ font-size:24px; }
}

/* ── Conversation practice ───────────────────────────────────── */
.conv-container{ display:flex; flex-direction:column; gap:14px; width:100%; max-width:680px; padding-bottom:48px; }

/* Topic picker */
.conv-level-group{ margin-bottom:8px; }
.conv-level-label{
  font-size:11px; text-transform:uppercase; letter-spacing:0.07em;
  color:var(--stone); font-weight:700; margin-bottom:8px;
  display:flex; align-items:center; gap:8px;
}
.conv-rec-tag{
  font-size:10px; background:#EAF1ED; color:var(--pine);
  padding:2px 7px; border-radius:4px; font-weight:700;
  text-transform:none; letter-spacing:0;
}
.conv-topic-grid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
@media(max-width:480px){ .conv-topic-grid{ grid-template-columns:1fr; } }
.conv-topic-card{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; background:var(--white);
  border:1.5px solid var(--line); border-radius:var(--r-md);
  cursor:pointer; transition:all 0.12s ease;
}
.conv-topic-card:hover{ border-color:var(--pine); background:var(--card-soft); }
.conv-topic-icon{ font-size:22px; flex-shrink:0; }
.conv-topic-title{ font-size:13.5px; font-weight:600; color:var(--ink); }
.conv-topic-agent{ font-size:11.5px; color:var(--stone); margin-top:2px; }

/* Goal box */
.conv-goal-box{
  background:var(--card-soft); border-radius:var(--r-md);
  padding:10px 14px; display:flex; gap:10px; align-items:flex-start;
  font-size:13px; line-height:1.5;
}
.conv-goal-label{
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:0.07em; color:var(--pine); flex-shrink:0; padding-top:2px;
}
.conv-goal-text{ color:var(--ink); }

/* Conversation log */
.conv-log{
  display:flex; flex-direction:column; gap:10px;
  max-height:340px; overflow-y:auto; padding:4px 0;
  scroll-behavior:smooth;
}
.conv-msg{ display:flex; flex-direction:column; gap:3px; max-width:82%; }
.conv-msg-agent{ align-self:flex-start; }
.conv-msg-learner{ align-self:flex-end; }
.conv-msg-label{
  font-size:10.5px; font-weight:700; text-transform:uppercase;
  letter-spacing:0.05em; color:var(--stone);
}
.conv-msg-agent .conv-msg-label{ color:var(--pine); }
.conv-msg-learner .conv-msg-label{ color:var(--clay); text-align:right; }
.conv-msg-text{
  padding:10px 14px; border-radius:var(--r-md);
  font-size:14px; line-height:1.5;
}
.conv-msg-agent .conv-msg-text{ background:var(--card-soft); color:var(--ink); border-bottom-left-radius:4px; }
.conv-msg-learner .conv-msg-text{ background:var(--pine); color:var(--paper); border-bottom-right-radius:4px; }

/* Controls */
.conv-controls{
  background:var(--white); border:1.5px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
  display:flex; flex-direction:column; align-items:center; gap:12px;
}
.conv-turn-counter{
  font-family:'JetBrains Mono',monospace; font-size:11px;
  color:var(--stone); text-transform:uppercase; letter-spacing:0.06em;
}
.conv-status{ font-size:14px; color:var(--stone); font-weight:500; text-align:center; }
.conv-mic-btn{
  width:68px; height:68px; border-radius:50%;
  background:var(--line); border:none; cursor:pointer;
  font-size:26px; display:flex; align-items:center; justify-content:center;
  transition:all 0.15s ease;
}
.conv-mic-btn.ready{ background:var(--pine); }
.conv-mic-btn.ready:hover{ transform:scale(1.05); }
.conv-mic-btn.recording{
  background:var(--clay);
  animation:rec-pulse 1.5s ease-in-out infinite;
}
.conv-mic-btn:disabled{ opacity:0.4; cursor:not-allowed; }
.conv-hint{ font-size:12px; color:var(--stone); text-align:center; font-family:'JetBrains Mono',monospace; }

/* Report */
.conv-score-card{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px;
  display:flex; gap:24px; align-items:flex-start;
}
@media(max-width:640px){ .conv-score-card{ flex-direction:column; } }
.conv-overall{ text-align:center; flex-shrink:0; min-width:80px; }
.conv-band{ font-size:52px; font-weight:700; line-height:1; margin-bottom:4px; }
.conv-band-label{ font-size:11px; color:var(--stone); text-transform:uppercase; letter-spacing:0.06em; font-weight:600; }
.conv-band-sub{ font-size:12px; color:var(--stone); margin-top:3px; }
.conv-dimensions{ flex:1; display:flex; flex-direction:column; gap:10px; }
.conv-dim{ display:flex; align-items:center; gap:10px; }
.conv-dim-name{ font-size:12px; color:var(--ink); flex:0 0 150px; }
.conv-dim-bar-wrap{ flex:1; height:7px; background:var(--card); border-radius:4px; overflow:hidden; }
.conv-dim-bar{ height:100%; border-radius:4px; transition:width 0.6s ease; }
.conv-dim-score{ font-size:12px; font-family:'JetBrains Mono',monospace; width:46px; text-align:right; flex-shrink:0; }
.conv-report-panel{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:18px 20px;
}
.conv-report-title{ font-weight:600; font-size:14px; margin-bottom:12px; }
.conv-point{ margin-bottom:12px; }
.conv-point:last-child{ margin-bottom:0; }
.conv-point-label{ font-size:13px; font-weight:600; color:var(--ink); margin-bottom:3px; }
.conv-point-body{ font-size:13px; color:var(--ink); line-height:1.5; }
.conv-imp-item{ display:flex; gap:12px; margin-bottom:16px; align-items:flex-start; }
.conv-imp-item:last-child{ margin-bottom:0; }
.conv-imp-num{
  width:22px; height:22px; border-radius:50%; flex-shrink:0;
  background:var(--clay); color:var(--paper);
  font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
.conv-imp-example{ font-size:12.5px; color:var(--stone); margin-top:5px; }
.conv-imp-better{ font-size:12.5px; color:var(--pine); margin-top:3px; }
.conv-said{ font-style:italic; }
.conv-transcript{ display:flex; flex-direction:column; gap:8px; max-height:300px; overflow-y:auto; }
.conv-tr-msg{ font-size:13px; line-height:1.5; }
.conv-tr-label{ font-weight:700; margin-right:6px; }
.conv-tr-agent .conv-tr-label{ color:var(--pine); }
.conv-tr-learner .conv-tr-label{ color:var(--clay); }
.conv-tr-text{ color:var(--ink); }

/* ── Landing page ────────────────────────────────────────────── */

/* ============================================================
   Landing page — premium, brand-aware, SEO-optimized
   ============================================================ */

.landing {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px 80px;
  color: var(--ink);
}

/* ── Nav ── */
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0 40px;
}
.landing-nav-brand { display: flex; align-items: center; gap: 10px; }
.landing-nav-name {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px;
  letter-spacing: -0.01em; color: var(--ink);
}
.landing-nav-signin {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); font-size: 14px; font-weight: 500;
  padding: 8px 18px; border-radius: 8px;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.15s ease;
}
.landing-nav-signin:hover { border-color: var(--pine); color: var(--pine); }

/* ── Hero ── */
.landing-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 60px;
  align-items: center; padding: 40px 0 80px;
}
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; gap: 40px; }
}
.landing-hero-content { max-width: 560px; }
.landing-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--pine); font-weight: 600; margin-bottom: 20px;
}
.landing-h1 {
  font-family: 'Fraunces', serif; font-weight: 600;
  font-size: clamp(38px, 6vw, 62px); line-height: 1.05;
  letter-spacing: -0.02em; margin-bottom: 22px;
  color: var(--ink);
}
.landing-h1 em {
  font-style: italic; color: var(--pine); font-weight: 500;
}
.landing-lede {
  font-size: 17px; line-height: 1.6; color: var(--stone);
  margin-bottom: 28px; max-width: 480px;
}
.landing-cta-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.landing-cta-primary {
  background: var(--ink); color: var(--paper);
  padding: 14px 26px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s ease; letter-spacing: -0.01em;
  box-shadow: 0 2px 12px rgba(28,27,25,0.12);
}
.landing-cta-primary:hover {
  background: var(--pine); box-shadow: 0 4px 16px rgba(59,110,94,0.25);
  transform: translateY(-1px);
}
.landing-cta-secondary {
  color: var(--stone); text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px; transition: all 0.15s ease;
}
.landing-cta-secondary:hover { color: var(--pine); border-bottom-color: var(--pine); }
.landing-cta-note { font-size: 12.5px; color: var(--stone); margin-top: 4px; }

/* ── Mockup card (hero visual) ── */
.landing-hero-visual { display: flex; justify-content: center; }
.mockup-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 8px 40px rgba(28,27,25,0.08);
  overflow: hidden; width: 100%; max-width: 460px;
  transform: rotate(0.4deg);
  transition: transform 0.4s ease;
}
.mockup-card:hover { transform: rotate(0deg) translateY(-4px); }
.mockup-header {
  padding: 10px 14px; background: var(--card-soft);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
}
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-dot-r { background: #E85D5D; }
.mockup-dot-y { background: #F0C13F; }
.mockup-dot-g { background: #6BCB6B; }
.mockup-label {
  margin-left: 10px; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--stone);
}
.mockup-body { padding: 22px 24px 20px; }
.mockup-text {
  font-family: 'Fraunces', serif; font-size: 15.5px;
  line-height: 1.75; color: var(--ink); margin-bottom: 20px;
}
.mockup-err {
  background: #FBEAE5; color: var(--clay); padding: 0 3px;
  border-radius: 3px; text-decoration: underline;
  text-decoration-color: var(--clay); text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.mockup-feedback { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.mockup-fb-item { display: flex; gap: 12px; align-items: flex-start; }
.mockup-fb-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--clay); color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mockup-fb-title { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.mockup-fb-body { font-size: 12.5px; line-height: 1.5; color: var(--stone); }
.mockup-score {
  padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.mockup-score-band {
  font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600;
  color: var(--pine); line-height: 1;
}
.mockup-score-label { font-size: 11.5px; color: var(--stone); line-height: 1.4; }

/* ── Sections ── */
.landing-section {
  padding: 70px 0; border-top: 1px solid var(--line);
}
.landing-h2 {
  font-family: 'Fraunces', serif; font-weight: 600;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.1;
  letter-spacing: -0.02em; color: var(--ink);
  margin-bottom: 40px; text-align: center;
}

/* ── Features grid ── */
.landing-features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
@media (max-width: 900px) { .landing-features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .landing-features { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px 22px;
  transition: all 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-3px); border-color: var(--pine);
  box-shadow: 0 8px 24px rgba(28,27,25,0.06);
}
.feature-icon { font-size: 32px; margin-bottom: 14px; line-height: 1; }
.feature-title {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 15.5px; color: var(--ink); margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.feature-body { font-size: 13.5px; line-height: 1.6; color: var(--stone); }

/* ── How it works ── */
.landing-how { background: var(--card-soft); border-radius: 20px; padding: 70px 40px; margin: 20px 0; border-top: none; }
.landing-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 800px) { .landing-steps { grid-template-columns: 1fr; gap: 20px; } }
.landing-step { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.step-num {
  font-family: 'Fraunces', serif; font-weight: 600;
  font-size: 48px; line-height: 1; color: var(--pine); opacity: 0.35;
}
.step-title {
  font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 16px; color: var(--ink); letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.step-body { font-size: 14px; line-height: 1.55; color: var(--stone); }

/* ── FAQ ── */
.landing-faq { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.faq-item {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px 22px; transition: all 0.2s ease;
}
.faq-item[open] { border-color: var(--pine); background: var(--card-soft); }
.faq-item summary {
  cursor: pointer; padding: 16px 0;
  font-size: 15px; font-weight: 500; color: var(--ink);
  list-style: none; position: relative;
  padding-right: 32px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 20px;
  color: var(--stone); transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "−"; color: var(--pine); }
.faq-item p {
  font-size: 14px; line-height: 1.6; color: var(--stone);
  padding: 4px 0 18px; max-width: 620px;
}

/* ── Final CTA ── */
.landing-final-cta { text-align: center; padding: 90px 0; }
.landing-final-h { margin-bottom: 14px; }
.landing-final-lede { font-size: 16px; color: var(--stone); margin-bottom: 30px; }

/* ── Footer ── */
.landing-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 30px 0; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--stone); flex-wrap: wrap; gap: 12px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-sep { color: var(--line); }
.footer-tagline { font-style: italic; }
.footer-links a { color: var(--stone); text-decoration: none; }
.footer-links a:hover { color: var(--pine); }
