  :root {
    --app-shell-width: 1180px;
    --navy: #0D1B2A;
    --navy-mid: #1A2E42;
    --navy-light: #243D55;
    --cream: #F7F3EE;
    --cream-dark: #EDE7DE;
    --amber: #D4860A;
    --amber-light: #F5A623;
    --amber-pale: #FEF3DC;
    --teal: #0E7A6B;
    --teal-pale: #D4F0EB;
    --coral: #C94E3B;
    --coral-pale: #FDECEA;
    --text-primary: #0D1B2A;
    --text-secondary: #4A6275;
    --text-hint: #8BA0B0;
    --border: rgba(13,27,42,0.12);
    --border-strong: rgba(13,27,42,0.25);
    --surface: #FFFFFF;
    --bg: #FFFFFF;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --shadow-card: 0 1px 3px rgba(13,27,42,0.08), 0 4px 12px rgba(13,27,42,0.06);
    --shadow-float: 0 8px 32px rgba(13,27,42,0.14);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
  }

  body[data-page="dashboard"],
  body[data-page="reading"],
  body[data-page="practice"],
  body[data-page="studyplan"],
  body[data-page="support"],
  body[data-page="speaking"],
  body[data-page="listening"],
  body[data-page="placement"],
  body[data-page="writing"],
  body[data-page="writing-result"],
  body[data-page="writing-editor"],
  body[data-page="login"] {
    background:
      radial-gradient(circle at top left, rgba(247, 205, 153, 0.1), rgba(255,255,255,0) 22%),
      radial-gradient(circle at right 14%, rgba(212,134,10,0.08), rgba(255,255,255,0) 20%),
      linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  }

  /* NAV */
  .nav {
    width: 100%;
    max-width: var(--app-shell-width);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 24px;
    flex-wrap: wrap;
  }
  .nav-brand {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--navy);
    margin-right: 16px;
    flex-shrink: 0;
    text-decoration: none;
  }
  .nav-brand span { color: var(--amber); }
  .app-nav {
    max-width: var(--app-shell-width);
    gap: 18px;
    padding-top: 20px;
    padding-bottom: 16px;
  }
  .app-nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 760px;
    min-width: 0;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 10px 24px rgba(13,27,42,0.08);
  }
  .app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }
  .app-nav-link:hover {
    background: rgba(13,27,42,0.06);
    color: var(--navy);
  }
  .app-nav-link.active {
    background: var(--navy);
    color: white;
    box-shadow: 0 8px 18px rgba(13,27,42,0.18);
  }
  .app-nav-link.support-link {
    background: rgba(14,122,107,0.1);
    color: var(--teal);
    border: 1px solid rgba(14,122,107,0.2);
  }
  .app-nav-link.support-link:hover {
    background: rgba(14,122,107,0.16);
    color: #075E52;
  }
  .app-nav-link.support-link.active {
    background: var(--teal);
    color: white;
    border-color: var(--teal);
    box-shadow: 0 8px 18px rgba(14,122,107,0.22);
  }
  /* MAIN */
  .main {
    width: 100%;
    max-width: var(--app-shell-width);
    padding: 0 24px 60px;
  }

  .screen { display: none; animation: fadeIn 0.25s ease; }
  .screen.active { display: block; }

  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  /* CARDS */
  .card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 0.5px solid var(--border);
    box-shadow: var(--shadow-card);
  }
  .card-pad { padding: 24px 28px; }

  .app-page-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 30px;
    margin-bottom: 24px;
    border-radius: 30px;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 20px 44px rgba(13,27,42,0.08);
  }
  .app-page-hero::after {
    content: '';
    position: absolute;
    inset: auto -64px -96px auto;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,134,10,0.12), rgba(212,134,10,0) 72%);
    pointer-events: none;
  }
  .app-page-hero > * {
    position: relative;
    z-index: 1;
  }
  .app-page-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: #F4EBDD;
    color: #7A5A16;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .app-page-title {
    font-size: clamp(34px, 4.6vw, 54px);
    line-height: 1.02;
    letter-spacing: -0.05em;
    color: var(--navy);
    margin-bottom: 12px;
  }
  .app-page-lead {
    max-width: 860px;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-secondary);
  }
  .app-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
  }
  .app-content-stack {
    display: grid;
    gap: 20px;
  }
  .support-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 20px;
    align-items: start;
  }
  .support-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
  }
  .support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
  }
  .support-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
  }
  .support-list-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--r-md);
    background: rgba(14,122,107,0.07);
    border: 1px solid rgba(14,122,107,0.12);
  }
  .support-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: white;
    background: var(--teal);
    font-weight: 800;
  }
  .support-note {
    border-color: rgba(14,122,107,0.24);
    background: linear-gradient(180deg, rgba(212,240,235,0.7), rgba(255,255,255,0.96));
  }

  /* DASHBOARD HERO */
  .dashboard-shell {
    position: relative;
    padding: 8px 0 4px;
  }
  .dashboard-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
  }
  .dashboard-topline-meta {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.92fr);
    gap: 24px;
    padding: 34px;
    border-radius: 36px;
    background:
      linear-gradient(140deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.96) 58%, rgba(249,245,239,0.94) 100%);
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 24px 60px rgba(13,27,42,0.09);
  }
  .dashboard-hero::before {
    content: '';
    position: absolute;
    inset: auto -80px -120px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,134,10,0.12), rgba(212,134,10,0) 72%);
    pointer-events: none;
  }
  .dashboard-kicker {
    display: inline-flex;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #705d1d;
    background: #F8EFD9;
    margin-bottom: 16px;
  }
  .dashboard-hero-title {
    font-size: clamp(40px, 5vw, 66px);
    line-height: 0.98;
    letter-spacing: -0.05em;
    max-width: 660px;
    color: var(--navy);
    margin-bottom: 16px;
  }
  .dashboard-hero-text {
    max-width: 560px;
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 14px;
  }
  .dashboard-status-line {
    max-width: 620px;
    margin-bottom: 0;
  }
  .dashboard-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  .dashboard-hero-cta {
    min-width: 200px;
  }
  .dashboard-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }
  .dashboard-skill-pill {
    min-width: 110px;
    padding: 13px 18px;
    border-radius: 999px;
    border: 1px solid rgba(13,27,42,0.1);
    background: rgba(255,255,255,0.96);
    color: var(--navy);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(13,27,42,0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .dashboard-skill-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(13,27,42,0.1);
  }
  .dashboard-skill-pill.reading { border-color: rgba(24,95,165,0.16); }
  .dashboard-skill-pill.writing { border-color: rgba(212,134,10,0.2); }
  .dashboard-skill-pill.listening { border-color: rgba(139,160,176,0.22); }
  .dashboard-skill-pill.speaking { border-color: rgba(14,122,107,0.2); }
  .dashboard-hero-panel {
    position: relative;
    align-self: center;
    aspect-ratio: 3 / 2;
    width: 100%;
    min-height: 300px;
    border-radius: 30px;
    overflow: hidden;
    background: #F7F3EE;
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 20px 40px rgba(13,27,42,0.12);
  }
  .dashboard-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }
  .dashboard-highlight-card {
    position: relative;
    padding: 22px;
    border-radius: 28px;
    background:
      linear-gradient(180deg, rgba(13,27,42,0.96), rgba(19,38,55,0.92));
    color: white;
    box-shadow: 0 20px 40px rgba(13,27,42,0.18);
  }
  .dashboard-highlight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
  }
  .dashboard-highlight-value {
    font-family: var(--font-display);
    font-size: 56px;
    line-height: 0.96;
    margin-bottom: 8px;
  }
  .dashboard-highlight-copy {
    color: rgba(255,255,255,0.72);
    font-size: 14px;
    margin-bottom: 18px;
  }
  .dashboard-highlight-head .badge-outline {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.18);
  }
  .dashboard-highlight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .dashboard-floating-note {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: var(--shadow-card);
  }
  .dashboard-floating-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-hint);
    margin-bottom: 8px;
  }
  .dashboard-floating-title {
    font-size: 16px;
    line-height: 1.5;
    color: var(--navy);
  }
  .dashboard-hero-mini {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
  }
  .passage-list { display: flex; flex-direction: column; gap: 14px; }
  .passage-list-item {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 0.5px solid var(--border);
    box-shadow: var(--shadow-card);
    padding: 22px 24px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .passage-list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
  .passage-list-item h3 {
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.3;
    color: var(--navy);
    margin-bottom: 8px;
  }
  .passage-list-item p {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-secondary);
  }
  .writing-choice-item p:first-of-type {
    font-size: 14px;
    color: var(--text-primary);
  }
  body[data-page="writing"] .app-page-hero {
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(13,27,42,0.06);
  }
  body[data-page="writing"] {
    background: #ffffff;
  }
  body[data-page="writing-editor"] {
    background: #ffffff;
  }
  body[data-page="writing"] .app-page-hero::after {
    display: none;
  }
  body[data-page="writing"] .passage-list {
    gap: 16px;
  }
  body[data-page="writing"] .passage-list-item {
    background: #ffffff;
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 10px 28px rgba(13,27,42,0.06);
  }
  body[data-page="writing"] .passage-list-item:hover {
    box-shadow: 0 18px 34px rgba(13,27,42,0.08);
  }
  .writing-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(13,27,42,0.34);
    backdrop-filter: blur(8px);
    z-index: 1200;
  }
  .writing-modal-overlay.active {
    display: flex;
  }
  .writing-modal-card {
    width: min(100%, 440px);
    padding: 28px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 24px 60px rgba(13,27,42,0.18);
  }
  .writing-modal-card-compact {
    width: min(100%, 420px);
    text-align: center;
  }
  .writing-modal-title {
    font-size: 28px;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--navy);
    margin-bottom: 8px;
  }
  .writing-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
  }
  .writing-modal-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(13,27,42,0.14);
    background: #ffffff;
    color: var(--navy);
    font: inherit;
    font-size: 15px;
    box-shadow: inset 0 1px 2px rgba(13,27,42,0.03);
  }
  .writing-modal-input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(13,27,42,0.08);
  }
  .writing-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .writing-modal-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 4px solid rgba(13,27,42,0.12);
    border-top-color: var(--navy);
    animation: writingSpin 0.9s linear infinite;
  }
  @keyframes writingSpin {
    to { transform: rotate(360deg); }
  }
  .writing-focus-row {
    margin-top: 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .writing-focus-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .writing-focus-select-wrap {
    display: grid;
    gap: 6px;
    min-width: 220px;
  }
  .writing-focus-select {
    appearance: none;
    width: 100%;
    min-height: 46px;
    padding: 12px 42px 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(13,27,42,0.14);
    background: #fff;
    color: var(--navy);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(13,27,42,0.06);
    background-image:
      linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
      linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position:
      calc(100% - 18px) calc(50% - 2px),
      calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
  }
  .writing-focus-select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(13,27,42,0.08);
  }
  .dashboard-mini-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.58);
    margin-bottom: 8px;
  }
  .dashboard-mini-value {
    font-size: 24px;
    line-height: 1.1;
    color: white;
    margin-bottom: 4px;
  }
  .dashboard-hero-mini .caption {
    color: rgba(255,255,255,0.68);
  }
  .section-head-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  .section-title {
    font-size: 22px;
    line-height: 1.2;
    color: var(--navy);
  }

  /* SKILL TEST CARDS */
  .skill-test-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
  .skill-test-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    padding: 22px;
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(13,27,42,0.08);
    border-radius: 28px;
    box-shadow: 0 16px 36px rgba(13,27,42,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .skill-test-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 42px rgba(13,27,42,0.1);
  }
  .skill-test-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: var(--cream-dark);
  }
  .skill-test-card.reading::before { background: linear-gradient(90deg, #185FA5, #79B7FF); }
  .skill-test-card.writing::before { background: linear-gradient(90deg, #D4860A, #F3C36A); }
  .skill-test-card.speaking::before { background: linear-gradient(90deg, #0E7A6B, #70D5C1); }
  .skill-test-card.listening::before { background: linear-gradient(90deg, #8BA0B0, #CBD5DF); }
  .skill-test-card.muted {
    opacity: 0.88;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,245,241,0.94));
  }
  .skill-test-card.featured {
    background:
      linear-gradient(180deg, rgba(255,255,255,0.96), rgba(254,248,235,0.96));
    border-color: rgba(212,134,10,0.18);
  }
  .skill-test-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .skill-test-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
    background: #F7F3EE;
    color: var(--navy);
  }
  .skill-test-title {
    font-size: 26px;
    line-height: 1.15;
    color: var(--navy);
  }
  .skill-test-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    min-height: 92px;
  }
  .skill-test-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .skill-test-stat {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
  }
  .skill-test-note {
    font-size: 12px;
    color: var(--text-hint);
  }

  /* TYPOGRAPHY */
  .display { font-family: var(--font-display); font-size: 38px; line-height: 1.18; color: var(--navy); }
  .display-sm { font-family: var(--font-display); font-size: 26px; line-height: 1.25; color: var(--navy); }
  .label { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-hint); }
  .caption { font-size: 13px; color: var(--text-secondary); }

  /* BUTTONS */
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border-radius: var(--r-md);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all 0.15s; border: none; font-family: var(--font-body);
    text-decoration: none;
  }
  .btn-primary { background: var(--navy); color: white; }
  .btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,27,42,0.2); }
  .btn-blue { background: #185FA5; color: white; }
  .btn-blue:hover { background: #124D88; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24,95,165,0.22); }
  .btn-amber { background: var(--amber); color: white; }
  .btn-amber:hover { background: var(--amber-light); transform: translateY(-1px); }
  .btn-outline { background: white; color: var(--text-primary); border: 0.5px solid var(--border-strong); }
  .btn-outline:hover { background: var(--cream); border-color: var(--navy); }
  .btn-ghost { background: none; color: var(--text-secondary); border: 0.5px solid transparent; }
  .btn-ghost:hover { background: var(--cream-dark); color: var(--text-primary); }
  .btn-sm { padding: 7px 16px; font-size: 13px; }
  .btn-full { width: 100%; justify-content: center; }

  /* INPUTS */
  .input-group { margin-bottom: 18px; }
  .input-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
  .input {
    width: 100%; padding: 11px 14px;
    border: 0.5px solid var(--border-strong); border-radius: var(--r-sm);
    font-size: 14px; font-family: var(--font-body); color: var(--text-primary);
    background: white; transition: border-color 0.15s;
    outline: none;
  }
  .input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(13,27,42,0.08); }
  .input-hint { font-size: 12px; color: var(--text-hint); margin-top: 5px; }

  /* CHIPS / BADGES */
  .badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 500;
  }
  .badge-navy { background: var(--navy); color: white; }
  .badge-amber { background: var(--amber-pale); color: var(--amber); }
  .badge-teal { background: var(--teal-pale); color: var(--teal); }
  .badge-coral { background: var(--coral-pale); color: var(--coral); }
  .badge-outline { background: white; color: var(--text-secondary); border: 0.5px solid var(--border-strong); }

  /* PROGRESS BAR */
  .progress-bar { background: var(--cream-dark); border-radius: 4px; height: 6px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 4px; background: var(--amber); transition: width 0.4s ease; }
  .progress-fill.teal { background: var(--teal); }
  .progress-fill.navy { background: var(--navy); }

  /* SECTION HEADER */
  .section-header { margin-bottom: 24px; }
  .section-header .display-sm { margin-bottom: 6px; }

  /* GRID */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

  /* METRIC CARD */
  .metric-card {
    background: rgba(255,255,255,0.84);
    border-radius: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: 0 12px 28px rgba(13,27,42,0.05);
  }
  .metric-value { font-family: var(--font-display); font-size: 28px; color: var(--navy); }
  .metric-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .metric-trend { font-size: 12px; color: var(--teal); margin-top: 4px; }
  .metric-trend.down { color: var(--coral); }

  /* TASK ITEM */
  .task-item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
  }
  .task-item:last-child { border-bottom: none; }
  .task-item:hover { background: var(--cream); }
  .task-icon {
    width: 38px; height: 38px; border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
  }
  .task-icon.reading { background: #EDF4FF; }
  .task-icon.writing { background: var(--amber-pale); }
  .task-icon.speaking { background: var(--teal-pale); }
  .task-icon.listening { background: #F0EAF8; }
  .task-info { flex: 1; }
  .task-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
  .task-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .task-status { font-size: 12px; font-weight: 500; }
  .task-status.done { color: var(--teal); }
  .task-status.pending { color: var(--amber); }
  .task-status.todo { color: var(--text-hint); }

  /* FEEDBACK BLOCK */
  .feedback-block {
    border-radius: var(--r-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 0.5px solid var(--border);
  }
  .feedback-block.strength { background: var(--teal-pale); border-color: rgba(14,122,107,0.2); }
  .feedback-block.improve { background: var(--amber-pale); border-color: rgba(212,134,10,0.2); }
  .feedback-block.error { background: var(--coral-pale); border-color: rgba(201,78,59,0.2); }
  .feedback-block.summary { background: rgba(13,27,42,0.05); border-color: rgba(13,27,42,0.12); }
  .feedback-title { font-size: 12px; font-weight: 500; margin-bottom: 6px; }
  .feedback-title.teal { color: var(--teal); }
  .feedback-title.amber { color: var(--amber); }
  .feedback-title.coral { color: var(--coral); }
  .feedback-text { font-size: 13px; color: var(--text-primary); line-height: 1.65; }
  .writing-submission-text {
    max-height: 360px;
    overflow: auto;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(13,27,42,0.08);
    background: rgba(255,255,255,0.82);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
  }

  /* SCORE RING */
  .score-ring-wrap { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
  .score-ring-wrap svg { transform: rotate(-90deg); }
  .score-ring-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .score-big { font-family: var(--font-display); font-size: 20px; color: var(--navy); }
  .score-tiny { font-size: 9px; color: var(--text-hint); }

  /* PLACEMENT TEST */
  .question-block { margin-bottom: 28px; }
  .question-num { font-size: 11px; font-weight: 500; color: var(--text-hint); letter-spacing: 0.06em; margin-bottom: 8px; }
  .question-text { font-size: 15px; color: var(--text-primary); margin-bottom: 16px; line-height: 1.65; }
  .option-list { display: flex; flex-direction: column; gap: 8px; }
  .option-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--r-sm);
    border: 0.5px solid var(--border-strong); background: white;
    cursor: pointer; transition: all 0.15s;
    font-size: 14px; color: var(--text-primary);
  }
  .option-item:hover { border-color: var(--navy); background: var(--cream); }
  .option-item.selected { border-color: var(--navy); background: var(--navy); color: white; }
  .option-circle {
    width: 20px; height: 20px; border-radius: 50%;
    border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 10px; font-weight: 500;
  }

  /* RECORDING */
  .rec-btn {
    width: 72px; height: 72px; border-radius: 50%;
    border: none; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
  }
  .rec-btn.idle { background: var(--coral-pale); border: 2px solid var(--coral); }
  .rec-btn.recording { background: var(--coral); animation: pulse 1.4s infinite; }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,78,59,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(201,78,59,0); }
  }

  /* PLAN DAY ROW */
  .plan-row {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 0; border-bottom: 0.5px solid var(--border);
  }
  .plan-row:last-child { border-bottom: none; }
  .day-badge {
    width: 44px; text-align: center; flex-shrink: 0;
    font-size: 11px; color: var(--text-hint); font-weight: 500;
    padding-top: 2px;
  }
  .plan-tasks { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
  .plan-chip {
    padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
    border: 0.5px solid var(--border);
  }
  .plan-chip.writing { background: var(--amber-pale); color: var(--amber); border-color: transparent; }
  .plan-chip.speaking { background: var(--teal-pale); color: var(--teal); border-color: transparent; }
  .plan-chip.reading { background: #EDF4FF; color: #185FA5; border-color: transparent; }
  .plan-chip.vocab { background: #F0EAF8; color: #533085; border-color: transparent; }

  /* ONBOARDING STEP */
  .step-dots { display: flex; gap: 6px; margin-bottom: 32px; }
  .step-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--cream-dark); transition: all 0.3s; }
  .step-dot.active { width: 22px; background: var(--navy); }
  .step-dot.done { background: var(--amber); }

  .skill-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .skill-toggle {
    padding: 16px 14px; border-radius: var(--r-md);
    border: 1.5px solid var(--border);
    background: white; cursor: pointer; transition: all 0.15s;
    text-align: center;
  }
  .skill-toggle:hover { border-color: var(--navy); }
  .skill-toggle.selected { border-color: var(--navy); background: var(--navy); color: white; }
  .skill-toggle-icon { font-size: 22px; margin-bottom: 6px; }
  .skill-toggle-name { font-size: 13px; font-weight: 500; }

  /* WAVEFORM (fake) */
  .waveform {
    display: flex; align-items: center; gap: 3px; height: 44px;
    justify-content: center;
  }
  .wave-bar {
    width: 3px; border-radius: 2px; background: var(--amber);
    animation: waveAnim 0.8s ease-in-out infinite alternate;
  }

  /* CHART BARS */
  .bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
  .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--amber-pale); transition: height 0.4s; position: relative; }
  .bar.filled { background: var(--amber); }
  .bar-label { font-size: 10px; color: var(--text-hint); }

  /* SEPARATOR */
  .sep { height: 0.5px; background: var(--border); margin: 24px 0; }

  /* AVATAR */
  .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--navy); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; flex-shrink: 0;
  }

  /* UTIL */
  .flex { display: flex; }
  .flex-col { flex-direction: column; }
  .items-center { align-items: center; }
  .items-start { align-items: flex-start; }
  .justify-between { justify-content: space-between; }
  .gap-8 { gap: 8px; }
  .gap-12 { gap: 12px; }
  .gap-16 { gap: 16px; }
  .gap-20 { gap: 20px; }
  .gap-24 { gap: 24px; }
  .mb-4 { margin-bottom: 4px; }
  .mb-8 { margin-bottom: 8px; }
  .mb-12 { margin-bottom: 12px; }
  .mb-16 { margin-bottom: 16px; }
  .mb-20 { margin-bottom: 20px; }
  .mb-24 { margin-bottom: 24px; }
  .mb-32 { margin-bottom: 32px; }
  .mt-8 { margin-top: 8px; }
  .mt-12 { margin-top: 12px; }
  .mt-16 { margin-top: 16px; }
  .w-full { width: 100%; }
  .text-center { text-align: center; }
  .text-right { text-align: right; }
  .font-medium { font-weight: 500; }
  .color-secondary { color: var(--text-secondary); }
  .color-hint { color: var(--text-hint); }
  .color-amber { color: var(--amber); }
  .color-teal { color: var(--teal); }
  .color-coral { color: var(--coral); }
  .color-navy { color: var(--navy); }

  /* LAYOUT HELPERS */
  .two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: start; }
  .three-col { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 20px; align-items: start; }

  /* DIVIDER TEXT */
  .divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-hint); font-size: 12px; margin: 16px 0; }
  .divider-text::before, .divider-text::after { content: ''; flex: 1; height: 0.5px; background: var(--border); }

  /* SCORE BAND */
  .band-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .band-name { font-size: 13px; color: var(--text-secondary); width: 70px; flex-shrink: 0; }
  .band-bar-wrap { flex: 1; background: var(--cream-dark); border-radius: 4px; height: 8px; overflow: hidden; }
  .band-fill { height: 100%; border-radius: 4px; }
  .band-score { font-size: 13px; font-weight: 500; color: var(--navy); width: 28px; text-align: right; flex-shrink: 0; }

  /* TEXTAREA */
  .writing-area {
    width: 100%; min-height: 200px; padding: 14px 16px;
    border: 0.5px solid var(--border-strong); border-radius: var(--r-sm);
    font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
    line-height: 1.7; resize: vertical; outline: none; background: white;
  }
  .writing-area:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(13,27,42,0.07); }

  body[data-page="writing"],
  body[data-page="writing-result"],
  body[data-page="writing-editor"] {
    align-items: center;
  }
  body[data-page="writing"] .nav,
  body[data-page="writing-result"] .nav,
  body[data-page="writing-editor"] .nav {
    max-width: var(--app-shell-width);
    padding: 18px 24px;
    border-bottom: none;
  }
  body[data-page="writing"] .main,
  body[data-page="writing-result"] .main,
  body[data-page="writing-editor"] .main {
    max-width: var(--app-shell-width);
    padding: 0 24px 60px;
  }
  .writing-shell { display: grid; gap: 18px; }
  .writing-part-tabs {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }
  .writing-part-tab {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(13,27,42,0.12);
    background: rgba(255,255,255,0.72);
    color: var(--navy);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
  .writing-part-tab small {
    font-size: 12px;
    color: var(--text-secondary);
  }
  .writing-part-tab.active {
    background: var(--navy);
    border-color: var(--navy);
    color: white;
    box-shadow: 0 10px 24px rgba(13,27,42,0.18);
    transform: translateY(-1px);
  }
  .writing-part-tab.active small { color: rgba(255,255,255,0.72); }
  .writing-nav-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .writing-nav-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--navy);
    background: rgba(13,27,42,0.08);
  }
  .writing-nav-chip.muted {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.72);
  }
  .writing-timer-bar {
    width: fit-content;
    min-width: 340px;
    margin: 0 auto;
    background: var(--navy);
    padding: 10px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: rgba(255,255,255,0.72);
    gap: 16px;
    box-shadow: 0 12px 28px rgba(13,27,42,0.18);
  }
  .writing-timer-bar .timer-label { display: flex; align-items: center; gap: 6px; }
  .writing-timer-display {
    font-size: 28px;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    min-width: 74px;
    text-align: center;
  }
  .writing-timer-bar.amber-state .timer-label,
  .writing-timer-bar.amber-state .writing-timer-display { color: #F59E0B; }
  .writing-timer-bar.red-state .timer-label,
  .writing-timer-bar.red-state .writing-timer-display { color: #EF4444; }
  .writing-board {
    display: grid;
    grid-template-columns: minmax(320px, 0.94fr) minmax(420px, 1.2fr);
    min-height: calc(100vh - 185px);
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(13,27,42,0.09);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--shadow-float);
    backdrop-filter: blur(10px);
  }
  .writing-task-pane {
    padding: 26px 22px 26px 26px;
    background: rgba(255,255,255,0.94);
    border-right: 1px solid rgba(13,27,42,0.1);
  }
  .writing-answer-pane {
    display: flex;
    flex-direction: column;
    padding: 22px 24px 24px;
    background: rgba(255,255,255,0.98);
  }
  .writing-topic-title {
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1.04;
    margin-bottom: 6px;
    color: var(--navy);
  }
  .writing-prompt-card {
    background: var(--navy);
    border-radius: 18px;
    padding: 20px 20px 18px;
    box-shadow: 0 10px 26px rgba(13,27,42,0.18);
  }
  .writing-prompt-copy {
    font-size: 16px;
    color: white;
    line-height: 1.75;
  }
  .writing-visual-card {
    margin-top: 18px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(13,27,42,0.08);
    border-radius: 18px;
    padding: 16px 18px;
  }
  .writing-instructions-list {
    margin: 12px 0 0 18px;
    color: var(--text-secondary);
    font-size: 14px;
  }
  .writing-instructions-list li + li { margin-top: 6px; }
  .writing-answer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }
  .writing-compose-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border: 1px solid rgba(13,27,42,0.1);
    border-radius: 20px;
    background: white;
    padding: 18px 18px 16px;
    box-shadow: 0 6px 20px rgba(13,27,42,0.08);
  }
  .writing-area-exam {
    flex: 1;
    min-height: 420px;
    padding: 18px 20px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.9;
    box-shadow: inset 0 0 0 1px rgba(13,27,42,0.06);
  }
  .writing-answer-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
  }
  .writing-feedback-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 18px;
    align-items: start;
  }
  .writing-feedback-summary {
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: var(--shadow-card);
    padding: 22px;
  }
  .writing-feedback-stack {
    display: grid;
    gap: 14px;
  }
  .writing-empty-card {
    text-align: center;
    padding: 42px 30px;
    border-style: dashed;
    border-width: 1.5px;
    background: rgba(255,255,255,0.86);
  }
  .writing-result-shell { display: grid; gap: 18px; }
  .writing-result-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 28px;
    border-radius: 24px;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(13,27,42,0.08);
    box-shadow: var(--shadow-card);
  }
  .writing-result-copy { max-width: 720px; }
  .writing-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* STEPPER */
  .stepper { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
  .step-node {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    flex: 1; position: relative;
  }
  .step-node:not(:first-child)::before {
    content: ''; position: absolute; top: 14px; right: 50%; width: 100%; height: 1.5px;
    background: var(--border-strong);
  }
  .step-node.done:not(:first-child)::before { background: var(--teal); }
  .step-circle {
    width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong);
    background: white; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 500; color: var(--text-hint); position: relative; z-index: 1;
  }
  .step-circle.current { border-color: var(--navy); background: var(--navy); color: white; }
  .step-circle.done { border-color: var(--teal); background: var(--teal); color: white; font-size: 11px; }
  .step-label { font-size: 10px; color: var(--text-hint); text-align: center; }
  .step-label.current { color: var(--navy); font-weight: 500; }

  @media (max-width: 768px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
    .two-col, .three-col { grid-template-columns: 1fr; }
    .app-page-hero { padding: 22px; border-radius: 24px; }
    .app-page-title { font-size: 34px; }
    .app-page-lead { font-size: 15px; }
    .dashboard-topline { flex-direction: column; align-items: flex-start; }
    .dashboard-hero { grid-template-columns: 1fr; padding: 24px; }
    .support-grid { grid-template-columns: 1fr; }
    .dashboard-highlight-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-hero-title { font-size: 34px; }
    .skill-test-grid { grid-template-columns: 1fr 1fr; }
    .display { font-size: 28px; }
    .app-nav { justify-content: space-between; }
    .app-nav-center {
      order: 3;
      width: 100%;
      min-width: 0;
      justify-content: flex-start;
      overflow-x: auto;
      white-space: nowrap;
    }
    .writing-board,
    .writing-feedback-shell { grid-template-columns: 1fr; }
    .writing-focus-select-wrap { min-width: 0; width: 100%; }
    .writing-task-pane { border-right: 0; border-bottom: 1px solid rgba(13,27,42,0.08); }
    .writing-topic-title { font-size: 34px; }
    .writing-timer-bar { min-width: 0; width: 100%; }
    .writing-part-tabs { grid-template-columns: 1fr 1fr; }
    .writing-result-hero { flex-direction: column; align-items: flex-start; }
    .writing-result-actions { justify-content: flex-start; }
  }

  @media (max-width: 560px) {
    .skill-test-grid { grid-template-columns: 1fr; }
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .main { padding: 0 18px 48px; }
    .nav { padding: 18px; }
    .app-page-title { font-size: 30px; }
    .dashboard-hero-title { font-size: 30px; }
    .dashboard-hero { padding: 20px; border-radius: 28px; }
    .dashboard-hero-panel { min-height: 220px; }
    .dashboard-highlight-grid { grid-template-columns: 1fr; }
    .dashboard-topline-meta { width: 100%; justify-content: space-between; }
    .dashboard-skill-pill { width: calc(50% - 6px); min-width: 0; justify-content: center; }
    .app-nav {
      padding: 16px 14px 12px;
      gap: 12px;
    }
    body[data-page="writing"] .main,
    body[data-page="writing-result"] .main,
    body[data-page="writing-editor"] .main { padding: 0 14px 32px; }
    body[data-page="writing"] .nav,
    body[data-page="writing-result"] .nav,
    body[data-page="writing-editor"] .nav { padding: 14px; }
    .writing-answer-head,
    .writing-answer-footer { flex-direction: column; align-items: stretch; }
    .writing-compose-card { padding: 14px; }
    .writing-area-exam { min-height: 320px; }
    .writing-part-tabs { grid-template-columns: 1fr; }
  }
