  :root {
    --bg: #f4f5f0;
    --surface: #ffffff;
    --surface-alt: #ebede4;
    --surface-raised: #ffffff;
    --border: #d7dbce;
    --border-strong: #c2c9b6;
    --text: #232922;
    --text-muted: #667062;
    --text-faint: #8a9384;
    --accent: #2f6f5e;
    --accent-strong: #204a3f;
    --accent-soft: #dcebe3;
    --accent-soft-border: #b7d4c7;
    --on-accent: #ffffff;
    --warn-bg: #fdf1ce;
    --warn-border: #e8b23c;
    --warn-ink: #7a5209;
    --mask-hit-bg: #fce089;
    --mask-hit-border: #d9a015;
    --mask-hit-ink: #5c4308;
    --danger: #b54b3a;
    --danger-bg: #f8e6e1;
    --danger-border: #dda293;
    --success: #4c7a3d;
    --success-bg: #e6efdf;
    --success-border: #b6d2a4;
    --info: #3e6ea5;
    --info-bg: #e3ecf5;
    --shadow-sm: 0 1px 2px rgba(35, 41, 34, 0.06), 0 1px 1px rgba(35, 41, 34, 0.04);
    --shadow-md: 0 6px 20px rgba(35, 41, 34, 0.08), 0 2px 6px rgba(35, 41, 34, 0.05);
    --font-display: "BIZ UDPGothic", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo UI", "Segoe UI", sans-serif;
    --font-body: "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", "Meiryo", "Segoe UI", sans-serif;
    color-scheme: light;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #1a201a;
      --surface: #232a22;
      --surface-alt: #2a322a;
      --surface-raised: #2c342c;
      --border: #3b453a;
      --border-strong: #4c584a;
      --text: #ecefe6;
      --text-muted: #a3ad9a;
      --text-faint: #7c8677;
      --accent: #5cb298;
      --accent-strong: #7fcab1;
      --accent-soft: #2b3f37;
      --accent-soft-border: #3d5c50;
      --on-accent: #0f1a15;
      --warn-bg: #3a2f14;
      --warn-border: #8a6a1e;
      --warn-ink: #f0cf7c;
      --mask-hit-bg: #6b5417;
      --mask-hit-border: #cf9f2e;
      --mask-hit-ink: #fbe6a8;
      --danger: #e0846f;
      --danger-bg: #3a231e;
      --danger-border: #7a4638;
      --success: #8fc27a;
      --success-bg: #24331f;
      --success-border: #4c6a3f;
      --info: #8ab2dd;
      --info-bg: #202b38;
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
      color-scheme: dark;
    }
  }

  :root[data-theme="dark"] {
    --bg: #1a201a;
    --surface: #232a22;
    --surface-alt: #2a322a;
    --surface-raised: #2c342c;
    --border: #3b453a;
    --border-strong: #4c584a;
    --text: #ecefe6;
    --text-muted: #a3ad9a;
    --text-faint: #7c8677;
    --accent: #5cb298;
    --accent-strong: #7fcab1;
    --accent-soft: #2b3f37;
    --accent-soft-border: #3d5c50;
    --on-accent: #0f1a15;
    --warn-bg: #3a2f14;
    --warn-border: #8a6a1e;
    --warn-ink: #f0cf7c;
    --mask-hit-bg: #6b5417;
    --mask-hit-border: #cf9f2e;
    --mask-hit-ink: #fbe6a8;
    --danger: #e0846f;
    --danger-bg: #3a231e;
    --danger-border: #7a4638;
    --success: #8fc27a;
    --success-bg: #24331f;
    --success-border: #4c6a3f;
    --info: #8ab2dd;
    --info-bg: #202b38;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }

  :root[data-theme="light"] {
    --bg: #f4f5f0;
    --surface: #ffffff;
    --surface-alt: #ebede4;
    --surface-raised: #ffffff;
    --border: #d7dbce;
    --border-strong: #c2c9b6;
    --text: #232922;
    --text-muted: #667062;
    --text-faint: #8a9384;
    --accent: #2f6f5e;
    --accent-strong: #204a3f;
    --accent-soft: #dcebe3;
    --accent-soft-border: #b7d4c7;
    --on-accent: #ffffff;
    --warn-bg: #fdf1ce;
    --warn-border: #e8b23c;
    --warn-ink: #7a5209;
    --mask-hit-bg: #fce089;
    --mask-hit-border: #d9a015;
    --mask-hit-ink: #5c4308;
    --danger: #b54b3a;
    --danger-bg: #f8e6e1;
    --danger-border: #dda293;
    --success: #4c7a3d;
    --success-bg: #e6efdf;
    --success-border: #b6d2a4;
    --info: #3e6ea5;
    --info-bg: #e3ecf5;
    --shadow-sm: 0 1px 2px rgba(35, 41, 34, 0.06), 0 1px 1px rgba(35, 41, 34, 0.04);
    --shadow-md: 0 6px 20px rgba(35, 41, 34, 0.08), 0 2px 6px rgba(35, 41, 34, 0.05);
    color-scheme: light;
  }

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

  .app {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 17px;
    line-height: 1.75;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }

  a { color: var(--accent); }

  *:focus-visible {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }

  button { font-family: inherit; font-size: inherit; }

  /* ---------- Header ---------- */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
  .app-header-top {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    flex-shrink: 0;
  }
  .brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.01em;
  }
  .brand-tag {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
  }
  .org-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px 6px 10px;
    font-size: 13.5px;
    color: var(--text-muted);
  }
  .org-badge strong {
    color: var(--text);
    font-weight: 700;
  }
  .org-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--info-bg);
    color: var(--info);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .app-nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }
  .app-nav button {
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 15px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .app-nav button:hover { color: var(--text); }
  .app-nav button.active {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
  }

  /* ---------- Main layout ---------- */
  main {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 80px;
  }
  .screen { display: none; }
  .screen.active { display: block; }

  .page-intro { margin-bottom: 26px; }
  .page-intro h1 { font-size: 24px; }
  .page-intro p {
    color: var(--text-muted);
    margin: 8px 0 0;
    font-size: 15.5px;
    max-width: 62ch;
  }

  /* ---------- Step wizard ---------- */
  .wizard { display: flex; flex-direction: column; gap: 0; }

  .step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 18px;
    position: relative;
  }
  .step-rail {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .step-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--accent);
    color: var(--accent-strong);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    z-index: 1;
    background: var(--surface);
  }
  .step-line {
    flex: 1;
    width: 2px;
    background: var(--border-strong);
    margin: 2px 0;
    min-height: 24px;
  }
  .step:last-child .step-line { display: none; }

  .step-body { padding-bottom: 26px; min-width: 0; }
  .step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px 20px;
    box-shadow: var(--shadow-sm);
  }
  .step-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    margin: 0 0 4px;
  }
  .step-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 14px;
  }

  /* ---------- Category pills ---------- */
  .pill-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 -2px;
  }
  .pill {
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .pill:hover { border-color: var(--accent); }
  .pill.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-strong);
  }
  .pill .count {
    color: var(--text-faint);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .pill.active .count { color: var(--accent); }

  /* ---------- Form controls ---------- */
  label.field-label {
    display: block;
    font-weight: 700;
    font-size: 14.5px;
    margin-bottom: 6px;
    color: var(--text);
  }
  select, input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="month"], input[type="time"], input[type="file"], textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    padding: 11px 13px;
  }
  select:focus, input:focus, textarea:focus { border-color: var(--accent); }
  select { appearance: none; cursor: pointer; padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 13px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }
  .prompt-meta {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
  }
  textarea {
    min-height: 170px;
    resize: vertical;
    line-height: 1.7;
  }
  .textarea-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
  .char-count { font-size: 12.5px; color: var(--text-faint); margin-left: auto; font-variant-numeric: tabular-nums; }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    padding: 11px 20px;
    cursor: pointer;
    border: 1.5px solid transparent;
    min-height: 44px;
    line-height: 1;
  }
  .btn-primary { background: var(--accent); color: var(--on-accent); }
  .btn-primary:hover { background: var(--accent-strong); }
  .btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
  .btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
  .btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; padding: 9px 12px; }
  .btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
  .btn-lg { font-size: 16.5px; padding: 13px 26px; min-height: 50px; width: 100%; }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .btn:disabled:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }

  /* ---------- Masking preview ---------- */
  .mask-empty {
    border: 1.5px dashed var(--border-strong);
    border-radius: 10px;
    padding: 22px 16px;
    text-align: center;
    color: var(--text-faint);
    font-size: 14.5px;
  }
  .mask-preview {
    display: none;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 17px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.85;
    font-size: 15.5px;
  }
  .mask-preview.show { display: block; }
  mark.mask-hit {
    background: var(--mask-hit-bg);
    color: var(--mask-hit-ink);
    border: 1px solid var(--mask-hit-border);
    border-radius: 5px;
    padding: 0 4px;
    font-weight: 700;
    cursor: help;
    font-size: 0.95em;
  }
  .mask-summary {
    display: none;
    margin-top: 14px;
  }
  .mask-summary.show { display: block; }
  .mask-summary-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--warn-ink);
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  .mask-summary-head .n { font-variant-numeric: tabular-nums; }
  .mask-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
  .mask-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 11px;
    flex-wrap: wrap;
  }
  .mask-list .orig { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--danger); }
  .mask-list .arrow { color: var(--text-faint); }
  .mask-list .repl { font-weight: 700; color: var(--mask-hit-ink); background: var(--mask-hit-bg); border-radius: 4px; padding: 0 5px; }
  .mask-list .kind { margin-left: auto; font-size: 11.5px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
  .mask-none {
    display: none;
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 700;
  }
  .mask-none.show { display: block; }

  /* ---------- Step 6: generate controls ---------- */
  .recap-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-border);
    color: var(--accent-strong);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 14px;
  }
  .model-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
  .gen-helper { font-size: 13px; color: var(--text-muted); margin-top: 10px; text-align: center; }
  .gen-helper.blocked { color: var(--danger); font-weight: 600; }

  /* ---------- Result area ---------- */
  .result-empty { color: var(--text-faint); font-size: 14.5px; }
  .result-loading { display: none; align-items: center; gap: 12px; color: var(--text-muted); font-size: 14.5px; padding: 6px 0; }
  .result-loading.show { display: flex; }
  .spinner {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2.5px solid var(--border-strong);
    border-top-color: var(--accent);
    flex-shrink: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    .spinner { animation: spin 0.8s linear infinite; }
  }
  @media (prefers-reduced-motion: reduce) {
    .spinner { opacity: 0.7; }
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .result-output {
    display: none;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 19px;
    white-space: pre-wrap;
    line-height: 1.85;
    font-size: 15.5px;
  }
  .result-output.show { display: block; }
  .result-actions { display: none; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
  .result-actions.show { display: flex; }

  /* ---------- Settings screen ---------- */
  .settings-grid { display: flex; flex-direction: column; gap: 20px; }
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px 22px;
    box-shadow: var(--shadow-sm);
  }
  .card h2 { font-size: 17px; margin-bottom: 3px; }
  .card .card-desc { color: var(--text-muted); font-size: 13.5px; margin: 0 0 16px; }
  .field-group { display: flex; flex-direction: column; gap: 14px; }
  .key-row { display: flex; gap: 8px; }
  .key-row input { flex: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
  .inline-note {
    display: flex;
    gap: 8px;
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 14px;
  }
  .inline-note strong { color: inherit; }

  .table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
  table.roster { width: 100%; border-collapse: collapse; min-width: 420px; font-size: 14.5px; }
  table.roster th, table.roster td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  table.roster th { background: var(--surface-alt); font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-muted); }
  table.roster tbody tr:last-child td { border-bottom: none; }
  table.roster td.label-cell { color: var(--accent-strong); font-weight: 600; }
  .row-actions-top { display: flex; justify-content: flex-end; margin-top: 12px; }

  /* ---------- Prompt body viewer / editor ---------- */
  .prompt-body-toggle {
    margin-top: 14px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    text-align: left;
  }
  .prompt-body-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }
  .prompt-body-toggle .pb-caret {
    display: inline-block;
    transition: transform 0.15s ease;
    color: var(--accent);
    font-size: 12px;
    flex-shrink: 0;
  }
  .prompt-body-toggle[aria-expanded="true"] .pb-caret { transform: rotate(90deg); }
  .prompt-body-toggle .pb-sub { margin-left: auto; font-weight: 500; font-size: 12.5px; color: var(--text-faint); }
  .prompt-body-panel { margin-top: 12px; }
  .pb-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }
  .pb-head .field-label { margin-bottom: 0; }
  .edited-badge {
    background: var(--warn-bg);
    color: var(--warn-ink);
    border: 1px solid var(--warn-border);
    border-radius: 999px;
    padding: 2px 12px;
    font-size: 12.5px;
    font-weight: 700;
  }
  .btn-restore { margin-left: auto; }
  #promptBodyText {
    font-size: 14px;
    line-height: 1.7;
    min-height: 120px;
    max-height: 340px;
    overflow-y: auto;
    background: var(--surface-alt);
  }
  .pb-hint {
    font-size: 12.5px;
    color: var(--text-faint);
    margin: 6px 0 0;
  }
  .extra-box { margin-top: 14px; }
  .extra-box input { font-size: 15px; }
  .result-meta {
    display: none;
    align-items: flex-start;
    gap: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-border);
    color: var(--accent-strong);
    border-radius: 8px;
    padding: 8px 13px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.6;
  }
  .result-meta.show { display: flex; }

  /* ---------- Toast ---------- */
  #toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text);
    color: var(--bg);
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
    max-width: 90vw;
    text-align: center;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  footer.app-footer {
    text-align: center;
    color: var(--text-faint);
    font-size: 12.5px;
    padding: 10px 20px 30px;
  }

  @media (max-width: 640px) {
    .app { font-size: 16px; }
    main { padding: 20px 14px 70px; }
    .step { grid-template-columns: 32px 1fr; gap: 12px; }
    .step-badge { width: 32px; height: 32px; font-size: 14px; }
    .step-card { padding: 15px 15px 17px; }
    .org-badge span.org-text { display: none; }
    .brand-tag { display: none; }
  }

/* ---------- Auth screens (login / pending) ---------- */
.auth-body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 28px 26px 24px;
}
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { max-height: 32px; margin-bottom: 10px; }
.auth-logo h1 { font-size: 19px; font-family: var(--font-display); }
.auth-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.auth-tabs a {
  flex: 1; text-align: center; padding: 10px 4px; font-size: 13.5px; font-weight: 700;
  color: var(--text-muted); text-decoration: none; border-bottom: 3px solid transparent;
}
.auth-tabs a.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.auth-form label input, .auth-form label select { margin-top: 5px; }
.auth-form .hp { position: absolute; left: -9999px; }
.auth-radio-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 13.5px; }
.auth-radio-label { font-weight: 700; width: 100%; }
.auth-radio { display: flex; align-items: center; gap: 5px; font-weight: 500; }
.auth-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.auth-footer { text-align: center; font-size: 12.5px; color: var(--text-muted); margin: 18px 0 0; }
.alert { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; line-height: 1.6; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.alert-ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

/* ---------- Template management ---------- */
.tpl-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tpl-list li {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.tpl-item-main { min-width: 0; flex: 1; }
.tpl-item-cat { font-size: 12px; color: var(--accent-strong); font-weight: 700; }
.tpl-item-name { font-weight: 700; margin: 2px 0 4px; }
.tpl-item-body { font-size: 13px; color: var(--text-muted); white-space: pre-wrap; max-height: 4.5em; overflow: hidden; }
.tpl-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tpl-form { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.api-key-status { font-size: 13px; color: var(--text-muted); margin: 0 0 6px; }
.api-key-status.set { color: var(--success); font-weight: 700; }
table.roster td.actions-cell { text-align: right; white-space: nowrap; }
table.roster td.actions-cell button { margin-left: 6px; }
