* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; padding: 0; height: 100%; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    align-items: flex-start;   /* top-align so tall screens don't clip the card's top on mobile */
    justify-content: center;
    padding: 16px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }
  .card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    padding: 24px;
    width: 100%;
    max-width: 480px;
  }
  h1 { font-size: 22px; margin: 0 0 16px; font-weight: 600; }
  h2 { font-size: 18px; margin: 0 0 12px; font-weight: 600; color: #1d1d1f; }
  p { line-height: 1.5; margin: 0 0 12px; }
  label { display: block; font-size: 14px; font-weight: 500; margin: 16px 0 6px; color: #555; }
  input, select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
  }
  input:focus, select:focus { outline: none; border-color: #0071e3; }
  button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 16px;
    font-family: inherit;
    transition: background 0.15s, transform 0.05s;
  }
  button:active { transform: scale(0.98); }
  button:disabled { opacity: 0.5; cursor: not-allowed; }
  .btn-primary { background: #0071e3; color: #fff; }
  .btn-primary:hover:not(:disabled) { background: #0077ed; }
  .btn-record { background: #d93025; color: #fff; }
  .btn-record.recording { background: #1d1d1f; }
  .btn-secondary { background: #e8e8ed; color: #1d1d1f; }
  .progress-bar {
    width: 100%;
    height: 6px;
    background: #e8e8ed;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 24px;
  }
  .progress-fill {
    height: 100%;
    background: #0071e3;
    transition: width 0.3s;
  }
  .step-label {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 8px;
    text-align: right;
  }
  .scenario {
    background: #f5f5f7;
    padding: 16px;
    border-radius: 10px;
    margin: 12px 0 16px;
    line-height: 1.5;
    font-size: 15px;
  }
  .feedback {
    background: #e8f5e9;
    border-left: 3px solid #34a853;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
  }
  .feedback-label { font-weight: 600; font-size: 12px; color: #1e7d32; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
  .answer {
    background: #eef2f7;
    border-left: 3px solid #5b6b7f;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
    font-style: italic;
    color: #33414f;
  }
  .answer-label { font-weight: 600; font-size: 12px; color: #5b6b7f; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-style: normal; }
  .timer {
    text-align: center;
    font-size: 28px;
    font-weight: 300;
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
    color: #d93025;
  }
  .timer.idle { color: #86868b; }
  .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8ed;
    border-top-color: #0071e3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 24px auto;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .center { text-align: center; }
  .muted { color: #86868b; font-size: 14px; }
  .loading-tip {
    max-width: 460px;
    margin: 28px auto 0;
    padding: 14px 18px;
    background: #eef2f7;
    color: #1d1d1f;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    transition: opacity 0.3s;
  }
  .error {
    background: #fdecea;
    border-left: 3px solid #d93025;
    padding: 12px 14px;
    border-radius: 6px;
    color: #a50e0e;
    font-size: 14px;
    margin-bottom: 16px;
  }
  .result-score {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    margin: 16px 0 8px;
    color: #0071e3;
  }
  .result-status {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-block;
    margin: 0 auto 16px;
  }
  .result-status.pass { background: #e8f5e9; color: #1e7d32; }
  .result-status.fail { background: #fdecea; color: #a50e0e; }
  .result-wrap { text-align: center; }
  .pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #d93025;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1s ease-in-out infinite;
    vertical-align: middle;
  }
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
  .rule { font-size: 13px; color: #86868b; line-height: 1.5; margin-bottom: 12px; }
  .warmup-story {
    background: #f5f5f7;
    padding: 16px;
    border-radius: 10px;
    margin: 12px 0 16px;
    line-height: 1.9;
    font-size: 18px;
    min-height: 96px;
  }
  .warmup-story .w-ai { color: #1d1d1f; }
  .warmup-story .w-player { color: #0071e3; font-weight: 600; }
  .warmup-story .empty { color: #86868b; font-style: italic; font-size: 15px; }
  .warmup-reset {
    background: #fff4e5;
    border-left: 3px solid #f59e0b;
    padding: 12px 14px;
    border-radius: 6px;
    color: #9a3412;
    font-size: 14px;
    margin-bottom: 16px;
  }
  .warmup-input-row { display: flex; gap: 8px; align-items: stretch; }
  .warmup-input-row input { flex: 1; }
  .warmup-input-row button { width: auto; margin-top: 0; padding: 12px 18px; white-space: nowrap; }
  .drill-instruction {
    padding: 14px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    border: 2px solid transparent;
  }
  .drill-instruction.drill-bet { background: #fdecea; color: #a50e0e; border-color: #f3b4ad; }
  .drill-instruction.drill-un  { background: #e8f5e9; color: #1e7d32; border-color: #a6d7af; }
  .drill-instruction.drill-neutral { background: #eef2f7; color: #33414f; border-color: #cdd6e0; }
  /* Drill flow: down-arrows drawing the eye my-answer → AI → notice-feeling → next. */
  .flow-arrow { text-align: center; color: #c2b3df; font-size: 24px; line-height: 1; margin: 2px 0 8px; }
  .scenario.reflect-q { font-size: 18px; line-height: 1.5; }
  .answered-req { font-size: 12px; color: #86868b; background: #f5f5f7; border-radius: 8px; padding: 8px 12px; line-height: 1.4; }
  #topic-list, .topic-group { display: flex; flex-direction: column; gap: 8px; }
  .topic-group { margin-bottom: 4px; }
  .topic-btn {
    width: 100%;
    margin-top: 0;
    text-align: left;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 2px solid #e8e8ed;
    font-weight: 500;
  }
  .topic-btn.selected { border-color: #0071e3; background: #eaf3fe; }

  /* Category selector (Improvizācija / Piepārdošana) */
  #category-list { display: flex; gap: 8px; margin-bottom: 4px; }
  .cat-btn {
    flex: 1;
    margin-top: 0;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 2px solid #e8e8ed;
  }
  .cat-btn.selected { border-color: #0071e3; background: #eaf3fe; color: #0071e3; }

  /* Selection training ("Ko piepārdot") */
  #sell-options { display: flex; flex-direction: column; gap: 8px; }
  .sell-option {
    width: 100%;
    margin-top: 0;
    text-align: left;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 2px solid #e8e8ed;
    font-weight: 500;
  }
  .sell-option:hover:not(:disabled) { border-color: #0071e3; background: #eaf3fe; }

  /* Per-step score breakdown on the result screen */
  .result-breakdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin: 4px 0 8px;
    font-size: 14px;
    color: #33414f;
  }
  .result-breakdown .bd-item { white-space: nowrap; }
  .ja-un-ievads {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #33414f;
  }
  .ja-un-ievads summary {
    cursor: pointer;
    display: block;
    width: 100%;
    background: #f5f5f7;
    border: 2px solid #e8e8ed;
    border-radius: 10px;
    padding: 14px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 16px;
    list-style: none;
  }
  .ja-un-ievads summary::-webkit-details-marker { display: none; }
  .ja-un-ievads[open] summary { border-color: #0071e3; background: #eaf3fe; }
  .ja-un-ievads p:first-of-type { margin-top: 12px; }
  .ja-un-ievads ul { margin: 6px 0 12px; padding-left: 20px; }
  .ja-un-ievads li { margin-bottom: 4px; }
  .ja-un-ievads strong { color: #1d1d1f; }
  #feedback-block { border-top: 1px solid #e8e8ed; margin-top: 20px; padding-top: 4px; }
  .rate-row { display: flex; gap: 12px; justify-content: center; margin: 4px 0 12px; }
  .rate-btn { width: auto; flex: 1; max-width: 120px; font-size: 30px; padding: 10px; margin-top: 0; background: #f5f5f7; border: 2px solid #e8e8ed; }
  .rate-btn.selected { border-color: #0071e3; background: #eaf3fe; }
  textarea { width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid #d2d2d7; border-radius: 10px; font-family: inherit; resize: vertical; }
  textarea:focus { outline: none; border-color: #0071e3; }
  .feel-callout {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #6a3ea1;
    background: #f3eefb;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 4px;
  }
  .drill-nudge {
    background: #fff4e5;
    border-left: 3px solid #f59e0b;
    color: #9a3412;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
  }
  /* Drill: round-A client reaction shown in a cooling red tone (conversation
     winding down); round B keeps the default green .feedback (warming up). */
  .feedback.as-block { background: #fdecea; border-left-color: #d93025; }
  .feedback.as-block .feedback-label { color: #a50e0e; }
  /* Drill: make the client's reaction the prominent, quote-like focal point. */
  .feedback.drill-reaction { padding: 16px 18px; border-left-width: 5px; }
  .feedback.drill-reaction .feedback-label { font-size: 13px; }
  .feedback.drill-reaction #feedback-text {
    font-size: 19px;
    font-weight: 500;
    font-style: italic;
    line-height: 1.5;
    margin-top: 4px;
  }
  .hidden { display: none !important; }
  #viz {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    background: #f5f5f7;
    margin: 0 0 4px;
    display: block;
  }