  :root {
    --burgundy: #8B1A2F;
    --gold: #C8973A;
    --gold-light: #E8C47A;
    --cream: #FAF6EE;
    --dark: #1A1208;
    --mid: #5A4A30;
    --border: #E0D4BB;
    --surface: #FFF9F0;
    --green: #2D6A4F;
    --orange: #C45E1A;
    --radius: 16px;
    --shadow: 0 4px 24px rgba(26,18,8,0.10);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'DM Sans', 'Noto Serif TC', sans-serif;
    background: var(--cream);
    color: var(--dark);
    min-height: 100vh;
  }

  /* ─── HEADER ─────────────────────────────────── */
  .app-header {
    background: linear-gradient(135deg, var(--burgundy) 0%, #5A0E1F 100%);
    padding: 28px 20px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  .app-header::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }
  .header-badge {
    display: inline-block;
    background: rgba(200,151,58,0.25);
    border: 1px solid rgba(200,151,58,0.5);
    color: var(--gold-light);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
  }
  .app-header h1 {
    font-family: 'Noto Serif TC', serif;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
  }
  .app-header p {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    margin-top: 6px;
  }

  /* ─── PROGRESS BAR ────────────────────────────── */
  .progress-wrap {
    background: #fff;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--mid);
    margin-bottom: 8px;
    font-weight: 500;
  }
  .progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--burgundy), var(--gold));
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 0%;
  }

  /* ─── SCREENS ─────────────────────────────────── */
  .screen { display: none; animation: fadeUp 0.35s ease; }
  .screen.active { display: block; }
  @keyframes fadeUp {
    from { opacity:0; transform: translateY(16px); }
    to   { opacity:1; transform: translateY(0); }
  }

  /* ─── WELCOME ─────────────────────────────────── */
  #screen-welcome {
    padding: 32px 20px 40px;
    max-width: 480px;
    margin: 0 auto;
  }
  .welcome-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--burgundy), #C0392B);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(139,26,47,0.3);
  }
  #screen-welcome h2 {
    font-family: 'Noto Serif TC', serif;
    font-size: 24px;
    text-align: center;
    color: var(--dark);
    margin-bottom: 12px;
  }
  #screen-welcome p {
    text-align: center;
    color: var(--mid);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 28px;
  }
  .input-group { margin-bottom: 20px; }
  .input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }
  .input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: var(--dark);
    outline: none;
    transition: border-color 0.2s;
  }
  .input-group input:focus { border-color: var(--burgundy); }

  /* ─── BUTTONS ──────────────────────────────────── */
  .btn-primary {
    display: block; width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--burgundy) 0%, #A0202E 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(139,26,47,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .btn-primary:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(139,26,47,0.2); }

  .btn-gold {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--gold) 0%, #A87628 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(200,151,58,0.35);
    transition: transform 0.15s;
  }
  .btn-gold:active { transform: scale(0.97); }

  .btn-outline {
    display: block; width: 100%;
    padding: 14px;
    background: transparent;
    color: var(--burgundy);
    border: 2px solid var(--burgundy);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 12px;
  }
  .btn-outline:active { background: rgba(139,26,47,0.06); }

  /* ─── CATEGORY CARD ────────────────────────────── */
  .category-header {
    background: var(--burgundy);
    padding: 20px 20px 16px;
    position: relative;
  }
  .cat-number {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
  }
  .cat-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 20px;
    color: #fff;
    font-weight: 700;
  }
  .cat-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
  }

  .criteria-list {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 540px;
    margin: 0 auto;
  }

  /* ─── CRITERION ROW ────────────────────────────── */
  .criterion {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .criterion-label {
    padding: 14px 16px 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
  }
  .score-row {
    display: flex;
    padding: 10px 12px 4px;
    gap: 6px;
  }
  .score-btn {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 2px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--mid);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .score-btn:active { transform: scale(0.93); }
  .score-btn.s1.selected { background: #FDE8E8; border-color: #C0392B; color: #C0392B; }
  .score-btn.s2.selected { background: #FDECD8; border-color: #E67E22; color: #E67E22; }
  .score-btn.s3.selected { background: #FFF5D4; border-color: #D4AC0D; color: #A38A00; }
  .score-btn.s4.selected { background: #D9F0E4; border-color: #27AE60; color: #1E8449; }
  .score-btn.s5.selected { background: #C8E6C9; border-color: #1B5E20; color: #1B5E20; }

  .score-legend {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px 10px;
    font-size: 10px;
    color: #aaa;
    font-weight: 500;
  }

  .criterion.unanswered {
    border-color: #C0392B;
    box-shadow: 0 0 0 2px rgba(192,57,43,0.15);
  }
  .criterion.unanswered .criterion-label {
    color: var(--burgundy);
  }
  .required-banner {
    background: #FDE8E8; color: #C0392B;
    font-size: 13px; font-weight: 600;
    padding: 10px 16px; border-radius: 10px;
    margin: 0 20px 12px;
    max-width: 500px; margin-left: auto; margin-right: auto;
    display: none; text-align: center;
  }
  .required-banner.visible { display: block; }

  /* ─── NAV BUTTONS ──────────────────────────────── */
  .nav-row {
    display: flex;
    gap: 12px;
    padding: 16px 20px 32px;
    max-width: 540px;
    margin: 0 auto;
  }
  .btn-nav {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .btn-prev {
    background: #fff;
    border: 2px solid var(--border);
    color: var(--mid);
  }
  .btn-next {
    background: linear-gradient(135deg, var(--burgundy), #A0202E);
    color: #fff;
    box-shadow: 0 4px 14px rgba(139,26,47,0.25);
  }
  .btn-nav:active { transform: scale(0.97); }

  /* ─── RESULTS ──────────────────────────────────── */
  #screen-result { padding: 0 0 60px; }

  .result-header {
    background: linear-gradient(135deg, var(--dark) 0%, #3A2510 100%);
    padding: 28px 20px 24px;
    text-align: center;
  }
  .result-header .club-name {
    font-family: 'Noto Serif TC', serif;
    font-size: 20px;
    color: var(--gold-light);
    margin-bottom: 4px;
  }
  .result-header h2 {
    font-family: 'Noto Serif TC', serif;
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
  }
  .result-header .timestamp {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
  }

  .total-score-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    margin: 16px 20px;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  .total-ring {
    width: 72px; height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(var(--burgundy) var(--pct, 0%), var(--border) 0%);
    display: flex; align-items: center; justify-content: center;
    position: relative;
  }
  .total-ring::after {
    content: '';
    position: absolute;
    width: 54px; height: 54px;
    background: #fff;
    border-radius: 50%;
  }
  .total-ring span {
    position: relative; z-index: 1;
    font-size: 17px; font-weight: 700;
    color: var(--burgundy);
  }
  .total-text h3 {
    font-size: 16px; font-weight: 700;
    color: var(--dark);
  }
  .total-text p {
    font-size: 12px; color: var(--mid);
    margin-top: 3px; line-height: 1.5;
  }

  /* Category result rows */
  .cat-results {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 540px;
    margin: 0 auto;
  }
  .cat-result-row {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .cat-result-top {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
  }
  .cat-emoji { font-size: 22px; }
  .cat-result-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
  }
  .cat-score-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
  }
  .badge-high { background: #D9F0E4; color: #1E8449; }
  .badge-mid  { background: #FFF5D4; color: #9A7D0A; }
  .badge-low  { background: #FDE8E8; color: #C0392B; }
  .cat-bar-wrap {
    padding: 0 16px 14px;
  }
  .cat-bar-bg {
    height: 8px; background: var(--border);
    border-radius: 10px; overflow: hidden;
  }
  .cat-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
  }
  .bar-high { background: linear-gradient(90deg, #27AE60, #1E8449); }
  .bar-mid  { background: linear-gradient(90deg, #F1C40F, #D4AC0D); }
  .bar-low  { background: linear-gradient(90deg, #E74C3C, #C0392B); }

  /* ─── STRATEGY TABLE ────────────────────────────── */
  .section-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    padding: 20px 20px 10px;
    max-width: 540px;
    margin: 0 auto;
    display: block;
  }

  .strategy-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 0 20px 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  .strategy-head {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
  }
  .strategy-head .tag-alert {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    padding: 3px 9px; border-radius: 20px;
    background: #FDE8E8; color: #C0392B;
  }
  .strategy-head .tag-warn {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    padding: 3px 9px; border-radius: 20px;
    background: #FEF0DC; color: #C45E1A;
  }
  .strategy-head .tag-ok {
    background: #D9F0E4; color: #1E8449;
  }
  .strategy-head h4 {
    font-size: 14px; font-weight: 600; color: var(--dark);
  }
  .strategy-body { padding: 14px 16px; }
  .strategy-item {
    display: flex; gap: 10px;
    margin-bottom: 10px;
    font-size: 13px; line-height: 1.6; color: var(--mid);
  }
  .strategy-item:last-child { margin-bottom: 0; }
  .strategy-dot {
    width: 6px; height: 6px;
    background: var(--gold); border-radius: 50%;
    flex-shrink: 0; margin-top: 7px;
  }

  /* Strengths */
  .strength-card {
    background: linear-gradient(135deg, #F0FBF4, #E0F4E8);
    border-radius: var(--radius);
    border: 1px solid #A3D9B4;
    padding: 16px;
    margin: 0 20px 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  .strength-card h4 {
    font-size: 13px; font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
  }
  .strength-item {
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 8px;
    font-size: 13px; line-height: 1.6; color: #1E5F3F;
  }
  .strength-item:last-child { margin-bottom: 0; }
  .strength-check { color: var(--green); font-size: 14px; flex-shrink: 0; }

  /* ─── DISCUSSION BOXES ────────────────────── */
  .disc-box {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 0 20px 12px;
    max-width: 500px;
    margin-left: auto; margin-right: auto;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
  }
  .disc-box.required-alert { border-color: #C0392B; }
  .disc-q-label {
    display: flex; gap: 8px; align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 14px; font-weight: 600; color: var(--dark);
    line-height: 1.5;
  }
  .disc-q-num {
    background: var(--burgundy); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 8px;
    flex-shrink: 0; letter-spacing: 0.5px;
    margin-top: 2px;
  }
  .disc-required-tag {
    font-size: 10px; font-weight: 700; color: #C0392B;
    background: #FDE8E8; padding: 2px 8px; border-radius: 10px;
    flex-shrink: 0; align-self: center;
  }
  .disc-hint {
    font-size: 12px; color: var(--mid);
    background: #FFF9EE; border-left: 3px solid var(--gold);
    padding: 8px 10px; border-radius: 6px;
    margin-bottom: 14px; line-height: 1.6;
  }

  /* Bubble chips */
  .bubble-wrap {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 10px;
  }
  .bubble {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 30px;
    background: var(--surface);
    font-size: 12px; font-weight: 500;
    color: var(--mid);
    cursor: pointer; font-family: inherit;
    line-height: 1.4; text-align: left;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .bubble:active { transform: scale(0.96); }
  .bubble.selected {
    background: #FDE8E8; border-color: var(--burgundy);
    color: var(--burgundy); font-weight: 600;
  }
  .selected-count {
    font-size: 12px; color: var(--mid);
    margin-top: 8px;
    display: none;
    align-items: center; gap: 6px;
  }
  .selected-count.visible { display: flex; }
  .sc-badge {
    background: var(--burgundy); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 2px 9px; border-radius: 20px;
  }
  .required-msg {
    font-size: 12px; color: #C0392B; font-weight: 600;
    margin-top: 8px; display: none;
  }
  .required-msg.visible { display: block; }

  /* Action rows — card layout with number badge */
  .action-card {
    background: #fff;
    border: 1.5px solid #C9B0F0;
    border-radius: 12px;
    padding: 12px 12px 10px;
    margin-bottom: 12px;
    position: relative;
  }
  .action-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .action-num-badge {
    background: var(--burgundy); color: #fff;
    font-size: 11px; font-weight: 700;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .action-card-title {
    font-size: 11px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: #5B2D8E; flex: 1; margin-left: 8px;
  }
  .del-row-btn {
    background: none; border: none;
    color: #ccc; font-size: 18px; cursor: pointer;
    padding: 0; line-height: 1;
    -webkit-tap-highlight-color: transparent; flex-shrink: 0;
  }
  .del-row-btn:active { color: #C0392B; }

  .action-field { margin-bottom: 8px; }
  .action-field:last-child { margin-bottom: 0; }
  .action-field-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--mid); margin-bottom: 4px; display: block;
    padding-left: 2px;
  }
  .action-field select,
  .action-field textarea {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13px; font-family: inherit;
    color: var(--dark); background: #fff;
    outline: none; transition: border-color 0.2s;
    box-sizing: border-box;
  }
  .action-field select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235A4A30'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px; cursor: pointer;
    height: 42px;
  }
  .action-field textarea {
    resize: none; overflow: hidden; min-height: 52px; line-height: 1.5;
  }
  .action-field select:focus,
  .action-field textarea:focus { border-color: #5B2D8E; }

  /* Remove old grid-based action-row */
  .action-row { display: none; }
  .action-row-labels { display: none; }

  .add-row-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px;
    background: none;
    border: 1.5px dashed #C9B0F0;
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    color: #5B2D8E; font-family: inherit;
    cursor: pointer; width: 100%; justify-content: center;
    margin-top: 4px;
    transition: border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .add-row-btn:active { border-color: var(--gold); color: var(--gold); }

  /* By When — two-part selector */
  .bywhen-wrap { display: flex; flex-direction: column; gap: 8px; }
  .bywhen-type-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  }
  .bywhen-type-btn {
    padding: 9px 8px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-size: 12px; font-weight: 600;
    color: var(--mid); font-family: inherit;
    cursor: pointer; text-align: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .bywhen-type-btn.active {
    background: #5B2D8E; border-color: #5B2D8E; color: #fff;
  }
  .bywhen-type-btn:not(.active):active { background: #EDE0FF; }
  .bywhen-panel { animation: fadeUp 0.2s ease; }
  .bywhen-date-input {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px; font-family: inherit;
    color: var(--dark); background: #fff;
    outline: none; box-sizing: border-box;
    transition: border-color 0.2s;
    -webkit-appearance: none;
  }
  .bywhen-date-input:focus { border-color: #5B2D8E; }
  .action-field-select {
    width: 100%; padding: 9px 32px 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13px; font-family: inherit;
    color: var(--dark); background: #fff;
    outline: none; box-sizing: border-box;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235A4A30'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer; height: 42px;
    transition: border-color 0.2s;
  }
  .action-field-select:focus { border-color: #5B2D8E; }

  /* ─── OFFICER EMAIL FIELDS ───────────────── */
  .officer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow);
  }
  .officer-title {
    font-size: 13px; font-weight: 700;
    color: var(--burgundy);
    flex-shrink: 0; width: 80px;
  }
  .officer-email-input {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px; font-family: inherit;
    color: var(--dark); background: #fff;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
  }
  .officer-email-input:focus { border-color: var(--burgundy); }
  @media (max-width: 380px) {
    .officer-row { grid-template-columns: 80px 1fr; }
    .officer-title { font-size: 12px; }
    .officer-email-input { font-size: 13px; }
  }

  /* ─── SELECT DROPDOWNS ───────────────────── */
  .select-wrap {
    position: relative;
  }
  .select-wrap::after {
    content: '▾';
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--mid); font-size: 14px;
    pointer-events: none;
  }
  .select-wrap select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: var(--dark);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
  }
  .select-wrap select:focus  { border-color: var(--burgundy); }
  .select-wrap select:disabled {
    background: var(--surface);
    color: #bbb;
    cursor: not-allowed;
  }
  .select-wrap.loading::after { content: '⟳'; animation: spin 0.8s linear infinite; }
  .input-group.fade-in { animation: fadeUp 0.25s ease; }

  #start-btn { transition: opacity 0.2s, transform 0.15s, box-shadow 0.15s; }
  #start-btn:not([disabled]) { opacity: 1 !important; cursor: pointer !important; }
  .bp-section-label {
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--mid);
    padding: 4px 0 8px;
    display: block;
  }
  .bp-group {
    margin: 0 20px 10px;
    max-width: 500px;
    margin-left: auto; margin-right: auto;
  }
  /* ─── STRATEGY HIGHLIGHT ON BUBBLE SELECT ── */
  .bp-item.highlighted {
    border-color: #C45E1A;
    box-shadow: 0 0 0 3px rgba(196,94,26,0.18), var(--shadow);
  }
  .bp-item.highlighted .bp-trigger {
    background: linear-gradient(135deg, #FFF3E8, #FFFAF5);
  }
  .bp-item.highlighted .bp-cat-tag {
    background: #C45E1A; color: #fff;
  }
  .bp-item.highlighted .bp-challenge-text { color: #7A2E00; }
  .bp-item.highlighted .bp-arrow {
    color: #C45E1A; animation: none;
    transform: none;
  }
  .strategy-has-selection .bp-item:not(.highlighted) {
    opacity: 0.35; transition: opacity 0.25s;
  }
  .strategy-has-selection .bp-item.highlighted { opacity: 1; }

  .bp-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
  }
  .bp-trigger {
    width: 100%; background: none; border: none;
    padding: 0 16px;
    height: 64px;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }
  .bp-trigger:active { background: rgba(0,0,0,0.02); }
  .bp-cat-tag {
    font-size: 10px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; padding: 4px 9px; border-radius: 20px;
    background: #FEF0DC; color: #C45E1A; flex-shrink: 0;
    white-space: nowrap;
  }
  .bp-challenge-text {
    flex: 1; font-size: 13px; font-weight: 600;
    color: var(--dark); line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  @keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(5px); }
  }
  .bp-arrow {
    font-size: 18px; color: var(--gold); flex-shrink: 0;
    transition: transform 0.3s ease, color 0.2s;
    animation: bounceDown 1.4s ease-in-out infinite;
    line-height: 1;
  }
  .bp-item.open .bp-arrow {
    transform: rotate(180deg);
    animation: none;
    color: var(--burgundy);
  }
  .bp-body {
    display: none;
    border-top: 2px solid var(--border);
  }
  .bp-item.open .bp-body { display: block; }

  /* Body sections */
  .bp-section { padding: 14px 16px; }
  .bp-section.reason-section { background: #FFF9F5; }
  .bp-section.suggest-section { background: #F4FBF6; border-top: 1px solid var(--border); }
  .bp-section-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  }
  .bp-section-icon {
    width: 22px; height: 22px; border-radius: 6px;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .bp-section-icon.r { background: #FDE8D0; color: #C45E1A; }
  .bp-section-icon.s { background: #C8E6D4; color: #1E8449; }
  .bp-section-title {
    font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  }
  .bp-section-title.r { color: #C45E1A; }
  .bp-section-title.s { color: #1E8449; }
  .bp-entry {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 9px 12px; border-radius: 8px;
    margin-bottom: 6px; font-size: 14px; line-height: 1.65; color: var(--dark);
    border: 1px solid transparent;
  }
  .bp-entry:last-child { margin-bottom: 0; }
  .bp-entry.r { background: #fff; border-color: #F5D5BE; }
  .bp-entry.s { background: #fff; border-color: #B8E0C4; }
  .bp-entry-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 8px;
  }
  .bp-entry.r .bp-entry-dot { background: #C45E1A; }
  .bp-entry.s .bp-entry-dot { background: #27AE60; }

  /* ─── DISCUSSION BOX ──────────────────────── */
  .discussion-box {
    background: linear-gradient(135deg, #1A1208, #3A2510);
    border-radius: var(--radius);
    padding: 18px 16px;
    margin: 0 20px 16px;
    max-width: 500px;
    margin-left: auto; margin-right: auto;
  }
  .discussion-box h4 {
    font-family: 'Noto Serif TC', serif;
    font-size: 13px; font-weight: 700;
    color: var(--gold-light); margin-bottom: 12px;
    text-transform: uppercase; letter-spacing: 1px;
  }
  .discussion-q {
    display: flex; gap: 10px;
    margin-bottom: 10px;
    font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.88);
  }
  .discussion-q:last-child { margin-bottom: 0; }
  .q-num {
    font-size: 16px; font-weight: 700;
    color: var(--gold); flex-shrink: 0; line-height: 1.4;
  }

  /* Download zone */
  .download-zone {
    padding: 16px 20px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 540px;
    margin: 0 auto;
  }

  /* ─── CAPTURE CARD (hidden, for export) ───────── */
  #capture-card {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 390px;
    background: var(--cream);
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
  }
  .cc-header {
    background: linear-gradient(135deg, var(--burgundy), #5A0E1F);
    padding: 24px 20px;
    text-align: center;
  }
  .cc-header .badge-sm {
    font-size: 9px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--gold-light);
    background: rgba(200,151,58,0.2); border: 1px solid rgba(200,151,58,0.4);
    padding: 3px 10px; border-radius: 12px; display: inline-block; margin-bottom: 8px;
  }
  .cc-header .cc-club { font-family: 'Noto Serif TC',serif; font-size: 20px; color:#fff; font-weight:700; }
  .cc-header .cc-sub { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 4px; }
  .cc-body { padding: 16px; }
  .cc-row {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px 14px; margin-bottom: 8px;
  }
  .cc-row-icon { font-size: 18px; }
  .cc-row-name { flex:1; font-size: 13px; font-weight: 600; color: var(--dark); }
  .cc-row-score { font-size: 13px; font-weight: 700; }
  .cc-bar-bg { height: 6px; background: var(--border); border-radius: 10px; margin-top: 6px; overflow: hidden; }
  .cc-bar-fill { height: 100%; border-radius: 10px; }
  .cc-total {
    background: var(--dark); color: #fff;
    padding: 14px 16px; border-radius: 12px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
  }
  .cc-total-label { font-size: 13px; color: rgba(255,255,255,0.7); }
  .cc-total-val { font-size: 20px; font-weight: 700; color: var(--gold-light); }
  .cc-footer { text-align: center; padding: 10px 16px 16px; font-size: 10px; color: #aaa; }

  /* ─── TOAST NOTIFICATION ─────────────────────── */
  .toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
    background: var(--dark); color: #fff;
    padding: 12px 20px; border-radius: 30px;
    font-size: 13px; font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: transform 0.3s ease;
    z-index: 9999;
    white-space: nowrap;
  }
  .toast.show { transform: translateX(-50%) translateY(0); }

  /* ─── LOADING STATE ──────────────────────────── */
  .loading-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ════════════════════════════════════════
     RWD — 手機優化
  ═══════════════════════════════════════════ */

  /* 基底：確保全部不超出螢幕 */
  html, body { overflow-x: hidden; }
  img, svg   { max-width: 100%; }

  /* 所有 card/group 的 margin 收緊 */
  .cat-results,
  .bp-group,
  .disc-box,
  .strength-card,
  .strategy-card,
  .download-zone {
    margin-left: 12px;
    margin-right: 12px;
  }
  .section-title { padding-left: 12px; padding-right: 12px; }

  /* Criteria list padding */
  .criteria-list { padding-left: 12px; padding-right: 12px; }
  .nav-row        { padding-left: 12px; padding-right: 12px; }

  /* ── 極小螢幕 (< 380px) ── */
  @media (max-width: 380px) {
    .app-header h1   { font-size: 18px; }
    .app-header p    { font-size: 11px; }
    .cat-title       { font-size: 17px; }
    .criterion-label { font-size: 13px; }
    .score-btn       { font-size: 14px; }
    .btn-primary, .btn-nav { font-size: 14px; padding: 14px; }
    .disc-q-label    { font-size: 13px; }
    .bubble          { font-size: 11px; padding: 7px 11px; }
    .section-title   { font-size: 14px; }
    .bp-challenge-text { font-size: 12px; }
    .bp-cat-tag      { font-size: 9px; }
    .total-text h3   { font-size: 14px; }
    .total-text p    { font-size: 11px; }
  }

  /* ── 一般手機 (≤ 480px) ── */
  @media (max-width: 480px) {

    /* Welcome screen */
    #screen-welcome  { padding: 24px 16px 36px; }
    .welcome-icon    { width: 56px; height: 56px; font-size: 24px; }
    #screen-welcome h2 { font-size: 20px; }

    /* Category header */
    .category-header { padding: 16px 16px 14px; }
    .cat-desc        { font-size: 12px; }

    /* Progress bar */
    .progress-wrap   { padding: 12px 16px; }
    .progress-meta   { font-size: 11px; }

    /* Score buttons — bigger tap target on small screen */
    .score-row       { padding: 10px 10px 4px; gap: 5px; }
    .score-btn       { height: 48px; border-radius: 12px; }
    .score-legend    { padding: 4px 10px 10px; }

    /* Result header */
    .result-header   { padding: 20px 16px 18px; }
    .result-header .club-name { font-size: 18px; }

    /* Total score card */
    .total-score-wrap { margin: 12px 12px; padding: 14px 16px; }
    .total-ring       { width: 60px; height: 60px; }
    .total-ring::after { width: 44px; height: 44px; }
    .total-ring span  { font-size: 14px; }
    .total-text h3    { font-size: 15px; }

    /* Cat result rows — 2 col grid on result screen */
    .cat-results {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      padding: 0 12px;
    }
    .cat-result-row { border-radius: 12px; }
    .cat-result-top { padding: 10px 12px; gap: 8px; }
    .cat-emoji      { font-size: 18px; }
    .cat-result-name { font-size: 12px; }
    .cat-score-badge { font-size: 11px; padding: 3px 8px; }
    .cat-bar-wrap   { padding: 0 12px 10px; }

    /* Section title */
    .section-title  { font-size: 15px; padding: 16px 12px 8px; }

    /* BP accordion */
    .bp-group       { margin: 0 12px 8px; }
    .bp-trigger     { height: 56px; padding: 0 12px; gap: 8px; }
    .bp-cat-tag     { font-size: 9px; padding: 3px 7px; }
    .bp-challenge-text { font-size: 12px; }
    .bp-section     { padding: 12px 12px; }
    .bp-entry       { font-size: 13px; padding: 8px 10px; }

    /* Discussion boxes */
    .disc-box       { margin: 0 12px 10px; padding: 14px 14px; }
    .disc-q-label   { font-size: 13px; }
    .bubble         { font-size: 12px; padding: 8px 12px; }
    .disc-hint      { font-size: 11px; }

    /* Action cards stack naturally on mobile */
    .action-card { padding: 10px 10px 8px; }
    .action-field select,
    .action-field textarea { font-size: 14px; }

    /* Strength card */
    .strength-card  { margin: 0 12px 10px; padding: 14px; }
    .strength-item  { font-size: 12px; }

    /* Download zone */
    .download-zone  { padding: 14px 12px 0; flex-direction: column; align-items: stretch; }
    .btn-gold       { justify-content: center; width: 100%; padding: 15px; }
    .btn-outline    { width: 100%; margin-top: 8px; }

    /* Nav buttons */
    .nav-row        { padding: 14px 12px 28px; gap: 10px; }
    .btn-nav        { padding: 14px 10px; font-size: 14px; }
  }

  /* ── 中型手機 / 小型平板 (481–640px) ── */
  @media (min-width: 481px) and (max-width: 640px) {
    .cat-results {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .criteria-list { max-width: 100%; }
  }

  /* ── 平板及以上 (> 640px) ── 確保置中 */
  @media (min-width: 641px) {
    body { background: #EDE6D8; }
    .app-header,
    .progress-wrap,
    #screen-welcome,
    #screens-container,
    #screen-officers,
    [id^="screen-cat-"],
    #screen-result { max-width: 600px; margin-left: auto; margin-right: auto; }
    .progress-wrap { border-radius: 0; }
    body > .app-header { border-radius: 0; }
  }
