    :root {
      --page-bg: #f8fcf8;
      --page-bg-soft: #edf5ef;
      --bg-primary: #244737;
      --bg-secondary: #ffffff;
      --bg-card: #f2f8f3;
      --text-primary: #234536;
      --text-secondary: #5f7668;
      --text-muted: #87988e;
      --accent: #5da57a;
      --accent-hover: #447f5e;
      --accent-green: #7ab88a;
      --accent-yellow: #e4c965;
      --success: #5aa06d;
      --warning: #dec15a;
      --danger: #e66b62;
      --border: #d8e7dc;
      --shadow-soft: 0 12px 30px rgba(36, 71, 55, 0.08);
      --shadow-strong: 0 18px 42px rgba(36, 71, 55, 0.14);
    }

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

    body {
      font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
      background:
        radial-gradient(circle at top left, rgba(241, 207, 91, 0.14), transparent 22%),
        radial-gradient(circle at top right, rgba(93, 165, 122, 0.08), transparent 26%),
        radial-gradient(circle at bottom left, rgba(115, 196, 107, 0.11), transparent 22%),
        radial-gradient(circle at bottom right, rgba(241, 207, 91, 0.08), transparent 18%),
        linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-soft) 100%);
      color: var(--text-primary);
      min-height: 100vh;
      line-height: 1.6;
      position: relative;
    }

    body::before,
    body::after {
      content: "";
      position: fixed;
      border-radius: 999px;
      filter: blur(56px);
      opacity: 0.25;
      pointer-events: none;
      z-index: 0;
    }

    body::before {
      top: 5%;
      right: 5%;
      width: 220px;
      height: 220px;
      background: rgba(93, 165, 122, 0.1);
    }

    body::after {
      bottom: 6%;
      left: 4%;
      width: 240px;
      height: 240px;
      background: rgba(115, 196, 107, 0.1);
    }

    .container { max-width: 1600px; margin: 0 auto; padding: 40px 24px; position: relative; z-index: 1; }

    /* フォーム: 左サイドバー + メイン（調査対象テキストを縦に伸ばす） */
    #analyze-form {
      display: flex;
      flex-direction: column;
      min-height: calc(100vh - 12.5rem);
      min-height: calc(100dvh - 12.5rem);
    }
    .form-layout {
      display: flex;
      flex-direction: row;
      gap: 28px;
      align-items: stretch;
      flex: 1;
      min-height: 0;
    }
    .sidebar {
      flex: 0 0 min(300px, 32vw);
      max-width: 340px;
      background: #f7faf7;
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 20px 20px 8px;
      position: sticky;
      top: 20px;
      box-shadow: var(--shadow-soft);
    }
    .sidebar-title {
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--text-primary);
      margin: 0 0 16px 0;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }
    .sidebar .form-group { margin-bottom: 18px; }
    .sidebar input,
    .sidebar select { width: 100%; }

    .sidebar-field-label {
      display: block;
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-secondary);
      margin-bottom: 8px;
    }
    .choice-btn-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .choice-btn-group.choice-btn-grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
    .choice-btn-group.choice-btn-grid-3 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
    }
    .choice-btn-group.choice-btn-grid-4 {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
    }
    .model-stage-group {
      margin-bottom: 14px;
    }
    .model-stage-group .sidebar-field-label {
      font-size: 0.8125rem;
    }

    /* 詳細設定（モデル・思考レベル）の開閉トグル */
    .advanced-settings-toggle-group {
      margin-bottom: 12px;
    }
    .advanced-settings-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: var(--surface, #ffffff);
      border: 1px solid var(--border, #d1d5db);
      border-radius: 8px;
      color: var(--text-primary, #1f2937);
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    }
    .advanced-settings-toggle:hover {
      border-color: var(--accent, #5da57a);
      background: rgba(93, 165, 122, 0.06);
    }
    .advanced-settings-toggle:focus-visible {
      outline: 2px solid var(--accent, #5da57a);
      outline-offset: 2px;
    }
    .advanced-settings-toggle[aria-expanded="true"] {
      border-color: var(--accent, #5da57a);
      background: rgba(93, 165, 122, 0.10);
      box-shadow: 0 4px 10px rgba(93, 165, 122, 0.15);
    }
    .advanced-settings-toggle-caret {
      width: 0;
      height: 0;
      border-left: 6px solid currentColor;
      border-top: 5px solid transparent;
      border-bottom: 5px solid transparent;
      transition: transform 0.18s ease;
      flex-shrink: 0;
    }
    .advanced-settings-toggle[aria-expanded="true"] .advanced-settings-toggle-caret {
      transform: rotate(90deg);
    }
    .advanced-settings-toggle-label {
      flex: 0 0 auto;
    }
    .advanced-settings-toggle-hint {
      margin-left: auto;
      font-size: 0.75rem;
      font-weight: 400;
      color: var(--text-secondary, #6b7280);
    }
    /* コラプス本体: 閉時は hidden 属性で完全非表示。開時は素直に表示する。 */
    .advanced-settings-wrap {
      padding-top: 4px;
    }
    .advanced-settings-wrap[hidden] {
      display: none !important;
    }
    /* デフォルトに戻すボタン: 右寄せの二次アクション */
    .advanced-settings-actions {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 10px;
    }
    .advanced-settings-reset-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      background: transparent;
      border: 1px solid var(--border, #d1d5db);
      border-radius: 6px;
      color: var(--text-secondary, #6b7280);
      font-size: 0.75rem;
      cursor: pointer;
      transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }
    .advanced-settings-reset-btn:hover {
      border-color: var(--accent, #5da57a);
      color: var(--accent, #5da57a);
      background: rgba(93, 165, 122, 0.06);
    }
    .advanced-settings-reset-btn:focus-visible {
      outline: 2px solid var(--accent, #5da57a);
      outline-offset: 2px;
    }
    .advanced-settings-reset-icon {
      font-size: 0.95rem;
      line-height: 1;
    }

    /* 処理件数：上段3＋下段3 */
    .max-patents-choice-stack {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .max-patents-choice-stack .max-patents-choice-row {
      margin: 0;
    }
    .max-patents-choice-stack .choice-btn {
      transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.25s ease;
    }
    .choice-btn {
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.92);
      color: var(--text-secondary);
      font-size: 0.75rem;
      font-family: inherit;
      cursor: pointer;
      text-align: center;
      line-height: 1.35;
      transition: border-color 0.2s, color 0.2s, background 0.2s;
    }
    .choice-btn small {
      display: block;
      font-size: 0.65rem;
      font-weight: 400;
      opacity: 0.85;
      margin-top: 2px;
    }
    .choice-btn:hover:not(:disabled) {
      border-color: var(--text-muted);
      color: var(--text-primary);
    }
    .choice-btn.active {
      background: linear-gradient(135deg, rgba(93, 165, 122, 0.08), rgba(115, 196, 107, 0.08));
      border-color: var(--accent);
      color: var(--bg-primary);
      font-weight: 600;
      box-shadow: 0 6px 14px rgba(93, 165, 122, 0.08);
    }
    .choice-btn.active small { color: var(--accent-hover); opacity: 0.9; }
    /* 分析・天秤評価の思考レベル: 選択色を段階で区別 */
    .thinking-level-choice-group .choice-btn.active[data-value="low"] {
      background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(59, 130, 246, 0.1));
      border-color: #2563eb;
      color: #1e3a8a;
      box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
    }
    .thinking-level-choice-group .choice-btn.active[data-value="medium"] {
      background: linear-gradient(135deg, rgba(234, 179, 8, 0.28), rgba(250, 204, 21, 0.18));
      border-color: #ca8a04;
      color: #713f12;
      box-shadow: 0 6px 14px rgba(202, 138, 4, 0.2);
    }
    .thinking-level-choice-group .choice-btn.active[data-value="high"] {
      background: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(239, 68, 68, 0.1));
      border-color: #dc2626;
      color: #991b1b;
      box-shadow: 0 6px 14px rgba(220, 38, 38, 0.16);
    }
    /* Gemini モデル選択: 3.1 Flash-Lite＝青、3 Flash＝黄、3.5 Flash＝赤（選択時に発光） */
    .model-choice-group .choice-btn {
      transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.25s ease;
    }
    .model-choice-group .choice-btn.active[data-value="gemini-3.1-flash-lite"] {
      background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.12));
      border-color: #2563eb;
      color: #1e3a8a;
      font-weight: 600;
      box-shadow:
        0 0 16px rgba(59, 130, 246, 0.55),
        0 0 28px rgba(37, 99, 235, 0.2),
        0 6px 14px rgba(37, 99, 235, 0.22);
    }
    .model-choice-group .choice-btn.active[data-value="gemini-3-flash-preview"] {
      background: linear-gradient(135deg, rgba(234, 179, 8, 0.38), rgba(250, 204, 21, 0.22));
      border-color: #ca8a04;
      color: #713f12;
      font-weight: 600;
      box-shadow:
        0 0 18px rgba(250, 204, 21, 0.65),
        0 0 32px rgba(234, 179, 8, 0.28),
        0 6px 14px rgba(202, 138, 4, 0.28);
    }
    .model-choice-group .choice-btn.active[data-value="gemini-3.5-flash"] {
      background: linear-gradient(135deg, rgba(220, 38, 38, 0.22), rgba(239, 68, 68, 0.12));
      border-color: #dc2626;
      color: #991b1b;
      font-weight: 600;
      box-shadow:
        0 0 16px rgba(239, 68, 68, 0.55),
        0 0 30px rgba(220, 38, 38, 0.25),
        0 6px 14px rgba(220, 38, 38, 0.24);
    }
    .choice-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    /* 処理件数: 5〜20件・10%＝青、30%＝黄、100%＝赤（選択時に発光） */
    .max-patents-choice-stack .choice-btn.active[data-value="count_5"],
    .max-patents-choice-stack .choice-btn.active[data-value="count_10"],
    .max-patents-choice-stack .choice-btn.active[data-value="count_20"],
    .max-patents-choice-stack .choice-btn.active[data-value="pct_10"] {
      background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(59, 130, 246, 0.12));
      border-color: #2563eb;
      color: #1e3a8a;
      box-shadow:
        0 0 16px rgba(59, 130, 246, 0.55),
        0 0 28px rgba(37, 99, 235, 0.2),
        0 6px 14px rgba(37, 99, 235, 0.22);
    }
    .max-patents-choice-stack .choice-btn.active[data-value="pct_30"] {
      background: linear-gradient(135deg, rgba(234, 179, 8, 0.38), rgba(250, 204, 21, 0.22));
      border-color: #ca8a04;
      color: #713f12;
      box-shadow:
        0 0 18px rgba(250, 204, 21, 0.65),
        0 0 32px rgba(234, 179, 8, 0.28),
        0 6px 14px rgba(202, 138, 4, 0.28);
    }
    .max-patents-choice-stack .choice-btn.active[data-value="pct_100"] {
      background: linear-gradient(135deg, rgba(220, 38, 38, 0.22), rgba(239, 68, 68, 0.12));
      border-color: #dc2626;
      color: #991b1b;
      box-shadow:
        0 0 16px rgba(239, 68, 68, 0.55),
        0 0 30px rgba(220, 38, 38, 0.25),
        0 6px 14px rgba(220, 38, 38, 0.24);
    }

    .manual-value-wrap[hidden] {
      display: none !important;
    }
    .main-fields {
      flex: 1;
      min-width: 0;
      min-height: 0;
      position: relative;
      z-index: 0;
      display: flex;
      flex-direction: column;
    }
    .main-fields .form-grid {
      margin-bottom: 0;
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      gap: 24px;
    }
    .main-fields .form-grid > .form-group.target-tech-field {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      min-height: 0;
    }
    #patent-target-text {
      flex: 1 1 auto;
      min-height: clamp(280px, 40vh, 620px);
      resize: vertical;
      width: 100%;
      box-sizing: border-box;
    }

    header {
      text-align: center;
      margin-bottom: 40px;
      position: relative;
    }

    .header-links {
      position: absolute;
      right: 0;
      top: 50%;
      transform: translateY(-50%);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .header-manual-link {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--accent);
      text-decoration: none;
      padding: 6px 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg-secondary);
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .header-manual-link:hover {
      background: var(--bg-card);
      color: var(--accent-hover);
      border-color: var(--accent);
    }

    h1 {
      font-size: 2.7rem; font-weight: 700;
      background: linear-gradient(90deg, #2f5a45 0%, #5b8f70 62%, #8db96f 100%);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
      margin-bottom: 8px;
      letter-spacing: -0.03em;
    }

    .card {
      background: rgba(255, 255, 255, 0.96); border: 1px solid var(--border);
      border-radius: 24px; padding: 32px; margin-bottom: 24px;
      box-shadow: var(--shadow-soft);
      backdrop-filter: blur(10px);
    }

    .card-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
    }

    .card-header h2 { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }

    .back-link {
      color: var(--accent); text-decoration: none; font-size: 0.875rem;
      display: flex; align-items: center; gap: 6px; transition: color 0.2s; cursor: pointer;
    }
    .back-link:hover { color: var(--accent-hover); }

    .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
    .form-group { display: flex; flex-direction: column; }
    .form-group.full-width { grid-column: 1 / -1; }

    label { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }

    input, textarea, select {
      background: rgba(255, 255, 255, 0.96); border: 1px solid var(--border); border-radius: 12px;
      padding: 12px 16px; color: var(--text-primary); font-size: 1rem; font-family: inherit;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    input:focus, textarea:focus, select:focus {
      outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(93, 165, 122, 0.14);
    }
    input::placeholder, textarea::placeholder { color: var(--text-muted); }
    textarea { min-height: 120px; resize: vertical; }
    select { cursor: pointer; }

    .file-input-wrapper {
      position: relative; display: flex; flex-direction: column; align-items: center;
      justify-content: center; padding: 32px; border: 2px dashed var(--border);
      border-radius: 16px; background: rgba(247, 251, 255, 0.95); cursor: pointer;
      transition: border-color 0.2s, background 0.2s;
    }
    /* CSV 用：高さを抑えたコンパクトなドロップゾーン */
    .file-input-wrapper.file-input-compact {
      padding: 14px 16px;
      min-height: 0;
    }
    .file-input-wrapper.file-input-compact .file-icon {
      width: 28px; height: 28px; margin-bottom: 6px;
    }
    .file-input-wrapper.file-input-compact .file-text {
      font-size: 0.8125rem; text-align: center; line-height: 1.45;
    }
    .file-input-wrapper:hover { border-color: var(--accent); background: rgba(93, 165, 122, 0.08); }
    .file-input-wrapper input[type="file"] {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      opacity: 0;
      cursor: pointer;
      z-index: 2;
    }
    .file-icon { width: 48px; height: 48px; margin-bottom: 12px; color: var(--text-muted); }
    .file-text { color: var(--text-secondary); font-size: 0.875rem; }

    /* CSV：ドロップゾーンとファイル名表示 */
    .csv-file-row {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: stretch;
      gap: 16px;
    }
    .csv-upload-col {
      flex: 0 0 min(260px, 100%);
      max-width: 100%;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .csv-file-row.csv-file-row--solo .csv-upload-col {
      flex: 1 1 auto;
      max-width: 100%;
    }
    .file-input-wrapper.file-drop-zone--has-file {
      padding-right: 96px;
    }
    .file-input-wrapper.file-drop-zone--has-file .file-text {
      width: 100%;
      max-width: 100%;
    }
    .file-text .csv-filename-in-drop {
      display: block;
      color: var(--text-primary);
      font-weight: 600;
      word-break: break-all;
      line-height: 1.35;
    }
    .file-text .csv-filename-hint {
      display: block;
      font-size: 0.7rem;
      font-weight: 400;
      color: var(--text-muted);
      margin-top: 4px;
    }
    .file-icon[hidden] {
      display: none !important;
    }
    .btn-csv-reset--overlay {
      position: absolute;
      top: 8px;
      right: 8px;
      z-index: 3;
      margin: 0;
      background: rgba(255, 255, 255, 0.92);
    }
    .file-text strong { color: var(--accent); }
    .file-input-wrapper.csv-file-loading {
      cursor: wait;
    }
    .file-input-wrapper.csv-file-loading input[type="file"] {
      cursor: wait;
    }
    .file-input-wrapper.csv-file-loading .file-icon {
      display: none;
    }
    .hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

    /* 各項目の「？」ヘルプ */
    .field-label-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }
    .field-label-row .sidebar-field-label {
      margin-bottom: 0;
      flex: 1;
    }
    .field-label-row > label {
      flex: 1;
      margin-bottom: 0;
    }
    .field-help-btn {
      flex-shrink: 0;
      width: 1.5rem;
      height: 1.5rem;
      padding: 0;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-muted);
      font-size: 0.75rem;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      font-family: inherit;
      transition: border-color 0.2s, color 0.2s, background 0.2s;
    }
    .field-help-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }
    .field-help-btn[aria-expanded="true"] {
      border-color: var(--accent);
      color: var(--accent);
      background: rgba(93, 165, 122, 0.12);
    }
    .field-label-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }
    .btn-ai-assist {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 1.9rem;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid rgba(93, 165, 122, 0.42);
      background: linear-gradient(135deg, rgba(93, 165, 122, 0.06), rgba(115, 196, 107, 0.08));
      color: var(--bg-primary);
      font-size: 0.75rem;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      box-shadow: 0 0 0 1px rgba(93, 165, 122, 0.06);
      transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
    }
    .btn-ai-assist:hover:not(:disabled) {
      border-color: rgba(93, 165, 122, 0.78);
      color: #fff;
      background: var(--accent);
      box-shadow: 0 0 0 1px rgba(93, 165, 122, 0.12), 0 8px 16px rgba(93, 165, 122, 0.14);
      transform: translateY(-1px);
    }
    .btn-ai-assist:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      box-shadow: none;
    }
    .btn-ai-assist.secondary {
      border-color: var(--border);
      background: var(--bg-secondary);
      color: var(--text-muted);
      box-shadow: none;
      font-weight: 600;
    }
    .ai-assist-panel {
      margin-top: 12px;
      padding: 14px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(245, 250, 255, 0.96);
    }
    .ai-assist-panel[hidden] {
      display: none !important;
    }
    .ai-assist-status {
      font-size: 0.875rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }
    .ai-assist-status.error { color: var(--danger); }
    .ai-assist-status.success { color: var(--success); }
    .ai-assist-status.loading { color: var(--accent); }
    .ai-assist-questions {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 12px;
    }
    .ai-assist-question {
      padding: 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.92);
    }
    .ai-assist-question-text {
      font-size: 0.9375rem;
      color: var(--text-primary);
      line-height: 1.55;
      margin-bottom: 10px;
    }
    .ai-assist-question-label {
      display: inline-block;
      margin-bottom: 8px;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: 0.02em;
      text-transform: uppercase;
    }
    .ai-assist-options {
      margin-top: 10px;
    }
    .ai-assist-options-label {
      display: block;
      margin-bottom: 6px;
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-muted);
    }
    .ai-assist-options-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .ai-assist-option-btn {
      padding: 7px 11px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.8125rem;
      font-weight: 500;
      font-family: inherit;
      line-height: 1.4;
      cursor: pointer;
      text-align: left;
      max-width: 100%;
    }
    .ai-assist-option-btn:hover:not(:disabled) {
      border-color: var(--accent);
      color: var(--accent);
    }
    .ai-assist-option-btn.selected {
      border-color: var(--accent);
      background: rgba(37, 99, 235, 0.12);
      color: var(--accent);
      font-weight: 600;
    }
    .ai-assist-option-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .ai-assist-free-answer {
      margin-top: 10px;
    }
    .ai-assist-free-label {
      display: block;
      margin-bottom: 6px;
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-muted);
    }
    .ai-assist-free-text {
      width: 100%;
      min-height: 80px;
      padding: 9px 11px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.875rem;
      font-family: inherit;
      line-height: 1.5;
      resize: vertical;
      box-sizing: border-box;
    }
    .ai-assist-free-text:focus {
      outline: none;
      border-color: var(--accent);
    }
    .ai-assist-free-text:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .ai-assist-free-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
    }
    .ai-assist-free-submit {
      padding: 7px 14px;
      border-radius: 8px;
      border: 1px solid var(--accent);
      background: var(--accent);
      color: #fff;
      font-size: 0.8125rem;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
    }
    .ai-assist-free-submit:hover:not(:disabled) {
      filter: brightness(1.05);
    }
    .ai-assist-free-submit:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .ai-assist-free-submit.ai-assist-free-submit--busy {
      background: linear-gradient(135deg, #64748b, #475569);
      border-color: #475569;
      color: #f8fafc;
      cursor: wait;
      box-shadow: 0 2px 8px rgba(71, 85, 105, 0.35);
    }
    .ai-assist-free-submit.ai-assist-free-submit--busy:disabled {
      opacity: 1;
    }
    .ai-assist-footer {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
    }
    .component-assist-panel {
      margin-top: 12px;
      padding: 14px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(250, 252, 255, 0.98);
    }
    .component-assist-panel[hidden] {
      display: none !important;
    }
    .component-assist-status {
      margin: 0 0 12px 0;
      font-size: 0.875rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }
    .component-assist-status.error { color: var(--danger); }
    /* 整形完了のみ：成功バナー（分析直後の案内は通常テキストのまま） */
    .component-assist-status.success-done {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin: 0 0 12px 0;
      padding: 14px 16px;
      font-size: 0.875rem;
      font-weight: 600;
      line-height: 1.55;
      color: #1e3a8a;
      background: linear-gradient(135deg, rgba(239, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.96) 55%, rgba(241, 245, 249, 0.5) 100%);
      border: 1px solid rgba(37, 99, 235, 0.22);
      border-left: 4px solid var(--accent);
      border-radius: 10px;
      box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1), 0 1px 2px rgba(15, 23, 42, 0.04);
    }
    .component-assist-status.success-done::before {
      content: "✓";
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 1.75rem;
      height: 1.75rem;
      margin-top: 0.05rem;
      font-size: 0.95rem;
      font-weight: 800;
      line-height: 1;
      color: #ffffff;
      background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%);
      border-radius: 50%;
      box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    }
    .component-assist-status.loading { color: var(--accent); }
    .component-assist-caution {
      margin: 0 0 12px 0;
      padding: 11px 12px 11px 14px;
      border-radius: 8px;
      border: 1px solid rgba(217, 119, 6, 0.4);
      border-left: 4px solid var(--warning);
      background: linear-gradient(135deg, rgba(255, 251, 235, 0.95) 0%, rgba(254, 243, 199, 0.45) 100%);
      box-shadow: 0 1px 3px rgba(180, 83, 9, 0.08);
    }
    .component-assist-caution__head {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
    }
    .component-assist-caution__icon {
      flex-shrink: 0;
      width: 1.25rem;
      height: 1.25rem;
      color: var(--warning);
    }
    .component-assist-caution__label {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      color: #b45309;
    }
    .component-assist-caution__text {
      margin: 0;
      font-size: 0.8125rem;
      line-height: 1.55;
      color: #78350f;
    }
    .component-assist-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-top: 12px;
      max-height: min(52vh, 28rem);
      overflow-y: auto;
      padding-right: 4px;
    }
    .component-assist-row {
      padding: 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.95);
    }
    .component-assist-row-head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 8px 12px;
      margin-bottom: 6px;
    }
    .component-assist-title {
      font-size: 0.9375rem;
      color: var(--text-primary);
      font-weight: 700;
    }
    .component-assist-ai-hint {
      font-size: 0.6875rem;
      font-weight: 600;
      color: var(--accent);
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(93, 165, 122, 0.12);
    }
    .component-assist-detail {
      margin: 0 0 10px 0;
      font-size: 0.8125rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }
    .component-assist-fieldset {
      border: none;
      margin: 0;
      padding: 0;
    }
    .component-assist-legend {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--text-muted);
      margin-bottom: 6px;
      padding: 0;
    }
    .component-assist-radios {
      display: flex;
      flex-wrap: wrap;
      gap: 12px 18px;
    }
    .component-assist-radio-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.8125rem;
      color: var(--text-primary);
      cursor: pointer;
    }
    .component-assist-radio-label input {
      accent-color: var(--accent);
    }
    .component-assist-note-wrap {
      margin-top: 10px;
    }
    .component-assist-note-label {
      display: block;
      margin-bottom: 6px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-muted);
    }
    .component-assist-user-note {
      width: 100%;
      min-height: 52px;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.8125rem;
      font-family: inherit;
      line-height: 1.45;
      resize: vertical;
      box-sizing: border-box;
    }
    .component-assist-user-note:focus {
      outline: none;
      border-color: var(--accent);
    }
    .component-assist-user-note:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .component-assist-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
      align-items: center;
    }
    .field-help-detail {
      margin: 0 0 10px 0;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(252, 253, 245, 0.98));
      font-size: 0.75rem;
      color: var(--text-muted);
      line-height: 1.55;
    }
    .field-help-detail[hidden] {
      display: none !important;
    }
    .field-help-detail p { margin: 0 0 8px 0; }
    .field-help-detail p:last-child { margin-bottom: 0; }
    .field-help-detail ul {
      margin: 0;
      padding-left: 1.2rem;
    }
    .submit-status-line {
      display: block;
      text-align: center;
      margin-top: 12px;
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    button[type="submit"] {
      width: 100%; padding: 16px 32px; font-size: 1rem; font-weight: 600;
      color: #ffffff; background: #6da986;
      border: none; border-radius: 12px; cursor: pointer;
      transition: transform 0.2s, box-shadow 0.2s; margin-top: 8px;
    }
    button[type="submit"]:hover { transform: translateY(-2px); background: #5f9777; box-shadow: 0 10px 20px rgba(93, 165, 122, 0.18); }
    button[type="submit"]:active { transform: translateY(0); }

    .error-card { background: rgba(230, 107, 98, 0.08); border-color: rgba(230, 107, 98, 0.35); }
    .error-message { color: var(--danger); font-weight: 500; }

    .results-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      font-size: 0.875rem;
      table-layout: fixed;
      box-sizing: border-box;
    }
    .results-table th {
      background: linear-gradient(90deg, #eef7f0 0%, #f5fbf4 72%, #fffbee 100%); padding: 12px 16px; text-align: left;
      font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border);
      position: relative; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
      box-sizing: border-box;
    }
    .results-table th:first-child { border-radius: 8px 0 0 0; }
    .results-table th:last-child { border-radius: 0 8px 0 0; }
    .results-table td {
      padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top;
      box-sizing: border-box;
      min-width: 0;
      word-break: break-word;
      overflow-wrap: anywhere;
      white-space: normal;
    }
    .results-ui-cell-wrap {
      white-space: normal;
    }
    .results-ui-cell-nowrap {
      white-space: nowrap;
    }
    #results-data-table .results-col-resolved { min-width: 9rem; max-width: 14rem; }
    #results-data-table .results-col-summary,
    #results-data-table .results-col-reason {
      min-width: 12rem;
      max-width: 36rem;
    }
    #results-data-table .results-col-verify-judge-prompt {
      min-width: 9rem;
      max-width: 11rem;
      text-align: center;
    }
    .results-ui-cell-prewrap {
      white-space: pre-wrap;
    }
    .judge-prompt-view-btn {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      color: var(--accent);
      border-radius: 8px;
      padding: 6px 12px;
      font-size: 0.8125rem;
      cursor: pointer;
      transition: all 0.15s;
      font-family: inherit;
    }
    .judge-prompt-view-btn:hover {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
    }
    .judge-prompt-view-btn[disabled] {
      cursor: not-allowed;
      opacity: 0.45;
      background: var(--bg-secondary);
      color: var(--text-muted);
    }
    .results-table tr:last-child td { border-bottom: none; }
    .results-table tr:hover td { background: rgba(93, 165, 122, 0.05); }

    .results-table-scroll {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      max-width: 100%;
    }

    /* 天秤評価カード（一覧）: 評価バッジを左上に大きく、最終評価は中央寄せの読みやすい本文 */
    .results-tenbin-cards {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
      min-width: 0;
      width: 100%;
    }
    .tenbin-result-card {
      position: relative;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: #ffffff;
      box-shadow: 0 1px 2px rgba(36, 71, 55, 0.04), 0 6px 16px rgba(36, 71, 55, 0.05);
      overflow: hidden;
      min-width: 0;
      display: flex;
      flex-direction: column;
      transition: box-shadow 0.18s ease, transform 0.18s ease;
    }
    .tenbin-result-card:hover {
      box-shadow: 0 2px 4px rgba(36, 71, 55, 0.06), 0 14px 28px rgba(36, 71, 55, 0.08);
    }
    .tenbin-result-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: var(--border);
    }
    .tenbin-result-card--A::before { background: #dc2626; }
    .tenbin-result-card--B::before { background: #eab308; }
    .tenbin-result-card--C::before { background: #2563eb; }
    .tenbin-result-card--D::before { background: #10b981; }

    .tenbin-result-card__head {
      padding: 6px 14px 4px 18px;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 2px;
    }
    .tenbin-result-card__head-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px 12px;
      min-width: 0;
    }
    .tenbin-result-card__head-left {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      min-width: 0;
      flex: 1 1 auto;
    }
    .tenbin-result-card__toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex: 0 1 auto;
    }
    .tenbin-result-card__head-progress {
      width: 100%;
      min-width: 0;
    }
    .tenbin-result-card__head-progress:empty {
      display: none;
    }
    .tenbin-result-card--streaming {
      box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25), 0 6px 20px rgba(36, 71, 55, 0.07);
    }
    .tenbin-verify-track {
      flex: 1 0 100%;
      width: 100%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      padding: 4px 0 0;
    }
    .tenbin-verify-track--reeval .tenbin-verify-steps-row {
      justify-content: center;
    }
    .tenbin-verify-track--reeval .tenbin-verify-step {
      flex: 0 1 auto;
      max-width: 14rem;
    }
    .tenbin-verify-steps-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 2px;
      width: 100%;
    }
    .tenbin-verify-step {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      text-align: center;
    }
    .tenbin-verify-step__dot {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 11px;
      height: 11px;
      border-radius: 999px;
      background: var(--border);
      transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
    }
    .tenbin-verify-step--pending .tenbin-verify-step__dot {
      background: var(--border);
      opacity: 0.85;
    }
    /* 完了済みフェーズ: 薄緑の塗り＋白いチェックマークで「終わったこと」を一目で示す */
    .tenbin-verify-step--done .tenbin-verify-step__dot {
      background: rgba(34, 197, 94, 0.4);
      opacity: 1;
      box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.55);
    }
    .tenbin-verify-step--done .tenbin-verify-step__dot::after {
      content: '';
      width: 6px;
      height: 6px;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path d='M1.4 4.2l1.7 1.7L6.7 2.3' fill='none' stroke='%23166534' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
      background-repeat: no-repeat;
      background-position: center;
      background-size: contain;
    }
    .tenbin-verify-step--done .tenbin-verify-step__label {
      color: #166534;
      opacity: 1;
      font-weight: 700;
    }
    .tenbin-verify-step--current .tenbin-verify-step__dot {
      background: var(--accent);
      opacity: 1;
      transform: scale(1.15);
      box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.32);
      animation: tenbinVerifyPulse 1.25s ease-in-out infinite;
    }
    .tenbin-verify-step__label {
      font-size: 0.625rem;
      font-weight: 700;
      line-height: 1.15;
      color: var(--text-secondary);
      letter-spacing: 0.02em;
    }
    .tenbin-verify-step--current .tenbin-verify-step__label {
      color: var(--accent);
    }
    .tenbin-verify-step--pending .tenbin-verify-step__label {
      color: var(--text-secondary);
      opacity: 0.9;
    }
    @keyframes tenbinVerifyPulse {
      0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3); }
      50% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0.16); }
    }
    /* 軌道は常にグレーのみ。進捗は上のドット表示に任せる（緑の塗りバーは出さない） */
    .tenbin-verify-rail {
      position: relative;
      width: 100%;
      height: 3px;
      border-radius: 999px;
      background: rgba(36, 71, 55, 0.1);
      flex-shrink: 0;
      overflow: hidden;
    }
    .tenbin-verify-rail__fill {
      display: none;
    }
    .tenbin-grade-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 2.125rem;
      height: 2.125rem;
      padding: 0 0.45rem;
      border-radius: 999px;
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      line-height: 1;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    }
    .tenbin-result-card__id {
      font-weight: 700;
      font-size: 0.875rem;
      color: var(--text-primary);
      letter-spacing: 0.02em;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .tenbin-result-card__open-link {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--accent);
      text-decoration: none;
      padding: 4px 10px;
      border-radius: 6px;
      border: 1px solid transparent;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }
    .tenbin-result-card__open-link::after {
      content: ' ↗';
      font-size: 0.8em;
    }
    .tenbin-result-card__open-link:hover {
      background: rgba(93, 165, 122, 0.1);
      color: var(--accent-hover);
    }

    .tenbin-result-card__section-label {
      display: inline-block;
      font-size: 0.65rem;
      font-weight: 700;
      color: var(--accent);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .tenbin-result-card__cols {
      display: grid;
      grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
      gap: 0;
      align-items: stretch;
    }
    .tenbin-result-card__summary-row {
      padding: 4px 16px 10px;
      min-width: 0;
      border-right: 1px dashed var(--border);
    }
    .tenbin-result-card__summary {
      margin: 0;
      font-size: 0.8125rem;
      color: var(--text-secondary);
      line-height: 1.5;
      overflow-wrap: anywhere;
    }

    .tenbin-result-card__final {
      padding: 4px 16px 10px;
      min-width: 0;
    }
    .tenbin-result-card__final-body {
      font-size: 0.8125rem;
      line-height: 1.6;
      color: var(--text-primary);
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: anywhere;
      padding: 10px 12px;
      background: rgba(93, 165, 122, 0.06);
      border: 1px solid rgba(93, 165, 122, 0.18);
      border-radius: 8px;
    }
    .tenbin-result-card__final--stack .tenbin-result-card__section-label {
      display: block;
    }
    .tenbin-result-card__final-stack {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .tenbin-result-card__final-block {
      min-width: 0;
    }
    .tenbin-result-card__final-body--reeval {
      background: rgba(59, 130, 246, 0.07);
      border-color: rgba(59, 130, 246, 0.22);
    }
    @media (max-width: 720px) {
      .tenbin-result-card__cols {
        grid-template-columns: 1fr;
      }
      .tenbin-result-card__summary-row {
        border-right: none;
        border-bottom: 1px dashed var(--border);
      }
    }

    /* カード上部ツールバーと共通のボタン見た目（旧フッターと同一クラス） */
    .tenbin-result-card__action-btn {
      font: inherit;
      font-size: 0.75rem;
      font-weight: 600;
      padding: 5px 11px;
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    }
    .tenbin-result-card__action-btn--ghost {
      color: var(--accent);
      background: #ffffff;
      border: 1px solid var(--border);
    }
    .tenbin-result-card__action-btn--ghost:hover:not(:disabled) {
      background: rgba(93, 165, 122, 0.1);
      border-color: var(--accent);
      color: var(--accent-hover);
    }
    .tenbin-result-card__action-btn:active:not(:disabled) {
      transform: translateY(1px);
    }
    .tenbin-result-card__action-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    @media (max-width: 640px) {
      .tenbin-result-card__head,
      .tenbin-result-card__summary-row,
      .tenbin-result-card__final {
        padding-left: 14px;
        padding-right: 14px;
      }
      .tenbin-result-card__toolbar {
        justify-content: flex-start;
        width: 100%;
      }
      .tenbin-result-card__id {
        white-space: normal;
      }
    }

    /* ===== 経緯モーダル内: 双方主張・双方反論カラム + 暫定/最終評価パネル ===== */
    .tenbin-debate-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 0;
      align-items: stretch;
      border-bottom: 1px solid var(--border);
    }
    .tenbin-debate-row__cell {
      min-width: 0;
      display: flex;
      flex-direction: column;
    }
    .tenbin-debate-row__cell--left {
      border-right: 1px solid var(--border);
    }
    .tenbin-debate-row__cell .tenbin-panel {
      width: 100%;
      align-items: stretch;
    }
    .tenbin-eval-row {
      flex: 0 0 auto;
      min-width: 0;
      border-bottom: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 12px;
      background: rgba(93, 165, 122, 0.03);
      box-sizing: border-box;
    }
    .tenbin-history-modal__sections .tenbin-eval-row:last-child {
      border-bottom: none;
    }
    .tenbin-panel--eval {
      flex: 0 0 auto;
      border-bottom: none;
      width: 100%;
      max-width: 42rem;
    }
    .tenbin-panel--eval-initial {
      flex: 0 0 auto;
      border-bottom: none;
      opacity: 0.96;
      width: 100%;
      max-width: 42rem;
    }
    .tenbin-panel__title-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }
    .tenbin-panel__title-wrap .tenbin-panel__title {
      margin-bottom: 0;
    }
    .tenbin-panel__title-wrap .label {
      font-size: 0.7rem;
    }
    .tenbin-debate-row .tenbin-panel {
      flex: 1 1 auto;
      border-bottom: none;
      min-height: 0;
    }
    @media (max-width: 640px) {
      .tenbin-debate-row {
        grid-template-columns: 1fr;
      }
      .tenbin-debate-row__cell--left {
        border-right: none;
        border-bottom: 1px solid var(--border);
      }
    }
    .tenbin-panel {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      min-height: 0;
      padding: 12px 14px;
      border-bottom: 1px solid var(--border);
    }
    .tenbin-panel__title {
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--accent);
      text-transform: none;
      letter-spacing: 0.02em;
      margin-bottom: 8px;
    }
    .tenbin-panel__body {
      font-size: 0.8125rem;
      line-height: 1.55;
      color: var(--text-primary);
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: anywhere;
      flex: 1 1 auto;
    }
    .tenbin-debate-row .tenbin-panel__body,
    .tenbin-eval-row .tenbin-panel__body {
      border: 1px dashed var(--border);
      border-radius: 8px;
      padding: 10px 12px;
      background: rgba(93, 165, 122, 0.04);
    }
    .tenbin-panel--eval-initial .tenbin-panel__body {
      background: rgba(100, 116, 139, 0.06);
    }

    .th-resize-handle {
      position: absolute; top: 0; right: 0; width: 5px; height: 100%;
      cursor: col-resize; user-select: none; z-index: 1;
    }
    .th-resize-handle:hover, .th-resize-handle.active {
      background: var(--accent);
    }

    .label { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
    .label-score-10 { background: rgba(127, 29, 29, 0.2); color: #7f1d1d; }
    .label-score-9 { background: rgba(185, 28, 28, 0.18); color: #991b1b; }
    .label-score-8 { background: rgba(220, 38, 38, 0.16); color: #b91c1c; }
    .label-score-7 { background: rgba(234, 179, 8, 0.28); color: #a16207; }
    .label-score-6 { background: rgba(245, 158, 11, 0.22); color: #b45309; }
    .label-score-5 { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; }
    .label-score-4 { background: rgba(59, 130, 246, 0.12); color: #1e40af; }
    .label-score-3 { background: rgba(16, 185, 129, 0.16); color: #047857; }
    .label-score-2 { background: rgba(5, 150, 105, 0.14); color: #047857; }
    .label-score-1 { background: rgba(6, 95, 70, 0.1); color: #065f46; }
    .label-score-0 { background: rgba(6, 95, 70, 0.12); color: #065f46; }
    .label-Error { background: rgba(107, 114, 128, 0.22); color: #4b5563; }
    /* B評価振り分けで評価が変化した行: 旧ラベル → 新ラベルを併記 */
    .label-change {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
    }
    .label-change__arrow {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 600;
      line-height: 1;
    }
    .label.label--prev {
      opacity: 0.7;
      text-decoration: line-through;
      text-decoration-color: rgba(0, 0, 0, 0.35);
    }
    /* B 評価再評価のフライト中（テーブル view の label セル横に出るローディング表示） */
    .reeval-inflight {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-left: 8px;
      font-size: 0.7rem;
      color: var(--text-muted);
      vertical-align: middle;
    }
    .reeval-inflight__spinner {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 2px solid rgba(36, 71, 55, 0.18);
      border-top-color: var(--accent);
      animation: reeval-inflight-spin 0.85s linear infinite;
    }
    .reeval-inflight__text {
      font-weight: 600;
      letter-spacing: 0.02em;
    }
    @keyframes reeval-inflight-spin {
      to { transform: rotate(360deg); }
    }
    /* 天秤評価カードのヘッダ pill 用「旧 → 新」表示 */
    .tenbin-grade-change {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .tenbin-grade-change__arrow {
      font-size: 0.95rem;
      color: var(--text-muted);
      font-weight: 700;
      line-height: 1;
    }
    .tenbin-grade-pill.tenbin-grade-pill--prev {
      opacity: 0.65;
      text-decoration: line-through;
      text-decoration-color: rgba(0, 0, 0, 0.35);
    }
    
    .label-- { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); }

    .link { color: var(--accent); text-decoration: none; transition: color 0.2s; }
    .link:hover { color: var(--accent-hover); text-decoration: underline; }

    .reason-cell { line-height: 1.5; }

    .header-actions { display: flex; align-items: center; gap: 16px; }

    .btn-download {
      display: inline-flex; align-items: center; gap: 8px;
      background: linear-gradient(90deg, #7bc96f, #63bfa9); color: #fff; border: none;
      padding: 10px 18px; border-radius: 8px; font-size: 0.875rem; font-weight: 600;
      cursor: pointer; transition: all 0.2s;
    }
    .btn-download:hover { background: linear-gradient(90deg, #6cbc61, #56b6a0); transform: translateY(-1px); box-shadow: 0 8px 16px rgba(77, 188, 93, 0.16); }
    .btn-download svg { flex-shrink: 0; }
    .btn-download:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .filter-bar {
      display: flex; align-items: center; gap: 12px; padding: 16px 0;
      border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap;
    }
    .filter-label { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); }
    .filter-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

    .filter-btn {
      padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
      cursor: pointer; transition: all 0.2s; border: 1px solid var(--border);
      background: var(--bg-secondary); color: var(--text-secondary);
    }
    .filter-btn:hover { border-color: var(--text-muted); }
    .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
    .filter-btn.filter-score-10:hover, .filter-btn.filter-score-10.active { background: #7f1d1d; border-color: #7f1d1d; color: #fff; }
    .filter-btn.filter-score-9:hover, .filter-btn.filter-score-9.active { background: #991b1b; border-color: #991b1b; color: #fff; }
    .filter-btn.filter-score-8:hover, .filter-btn.filter-score-8.active { background: #b91c1c; border-color: #b91c1c; color: #fff; }
    .filter-btn.filter-score-7:hover, .filter-btn.filter-score-7.active { background: #ca8a04; border-color: #ca8a04; color: #fff; }
    .filter-btn.filter-score-6:hover, .filter-btn.filter-score-6.active { background: #b45309; border-color: #b45309; color: #fff; }
    .filter-btn.filter-score-5:hover, .filter-btn.filter-score-5.active { background: #2563eb; border-color: #2563eb; color: #fff; }
    .filter-btn.filter-score-4:hover, .filter-btn.filter-score-4.active { background: #1e40af; border-color: #1e40af; color: #fff; }
    .filter-btn.filter-score-3:hover, .filter-btn.filter-score-3.active { background: #059669; border-color: #059669; color: #fff; }
    .filter-btn.filter-score-2:hover, .filter-btn.filter-score-2.active { background: #047857; border-color: #047857; color: #fff; }
    .filter-btn.filter-score-1:hover, .filter-btn.filter-score-1.active { background: #065f46; border-color: #065f46; color: #fff; }
    .filter-btn.filter-score-0:hover, .filter-btn.filter-score-0.active { background: #065f46; border-color: #065f46; color: #fff; }
    .filter-btn.filter-Error:hover, .filter-btn.filter-Error.active { background: #6b7280; border-color: #6b7280; color: #fff; }
    .filter-btn.filter-other:hover, .filter-btn.filter-other.active { background: #475569; border-color: #475569; color: #fff; }
    .filter-btn.filter-reeval:hover, .filter-btn.filter-reeval.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
    .filter-btn.filter-btn-empty:not(.active) { opacity: 0.5; }
    
    .filter-info { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
    .reeval-b-btn {
      margin-left: 8px;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      border: 1px solid var(--accent);
      background: var(--bg-secondary);
      color: var(--accent);
      white-space: nowrap;
    }
    .reeval-b-btn:hover:not(:disabled) {
      background: var(--accent);
      color: #fff;
    }
    .reeval-b-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }
    .reeval-dialog .reeval-q { margin-bottom: 20px; }
    .reeval-dialog .reeval-q__title { font-weight: 600; margin-bottom: 6px; }
    .reeval-dialog .reeval-q__ctx { font-size: 0.8125rem; color: var(--text-secondary); margin: 0 0 6px; }
    .reeval-dialog .reeval-q__rel { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
    .reeval-dialog .reeval-q__label { display: block; font-size: 0.75rem; margin-bottom: 4px; }
    .reeval-dialog .reeval-q__choices {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px 16px;
      margin-bottom: 10px;
    }
    .reeval-dialog .reeval-q__choice {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      font-size: 0.875rem;
      line-height: 1.35;
    }
    .reeval-dialog .reeval-q__choice input {
      margin-top: 0;
      flex-shrink: 0;
    }
    .reeval-dialog .reeval-q__choice-label {
      flex: 0 1 auto;
      min-width: 0;
    }
    .reeval-dialog .reeval-q__label--note {
      margin-top: 4px;
    }
    .reeval-dialog .reeval-q__input {
      width: 100%;
      min-height: 88px;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      font: inherit;
      resize: vertical;
    }
    .reeval-dialog .reeval-q__input--note {
      min-height: 52px;
    }
    .reeval-dialog .reeval-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
    .reeval-dialog #reeval-modal-status { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 12px; }
    tr.hidden-row { display: none; }

    .results-table-wrap {
      margin-top: 16px;
    }
    .results-pagination {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .results-pagination-info {
      font-size: 0.8125rem;
      color: var(--text-secondary);
    }
    .btn-page {
      padding: 6px 14px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.75rem;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
    }
    .btn-page:hover:not(:disabled) {
      border-color: var(--accent);
      color: var(--accent);
    }
    .btn-page:disabled {
      opacity: 0.45;
      cursor: not-allowed;
    }

    .progress-container { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
    .progress-bar { height: 8px; background: #dbe7de; border-radius: 999px; overflow: hidden; }
    .progress-fill {
      height: 100%; background: linear-gradient(90deg, #f1cf5b 0%, #9bd96b 45%, #73c8a6 100%);
      transition: width 0.3s ease; width: 0%;
    }
    .progress-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; display: block; }
    .progress-eta {
      font-size: 0.72rem;
      color: var(--text-secondary);
      display: block;
      margin-top: 4px;
      line-height: 1.4;
    }

    .confirm-modal-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(36, 71, 55, 0.2); display: none; align-items: center;
      justify-content: center; z-index: 2000; padding: 20px; backdrop-filter: blur(4px);
    }
    .confirm-modal-overlay.active { display: flex; }
    .confirm-modal {
      background: #ffffff; border: 2px solid rgba(244, 204, 77, 0.7); border-radius: 24px;
      padding: 40px; max-width: 440px; width: 100%; text-align: center;
      box-shadow: var(--shadow-strong);
      animation: modalPop 0.3s ease-out;
    }
    @keyframes modalPop {
      from { opacity: 0; transform: scale(0.9) translateY(-20px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .confirm-modal-icon { color: var(--warning); margin-bottom: 20px; }
    .confirm-modal-icon svg { filter: drop-shadow(0 0 20px rgba(234, 179, 8, 0.5)); }
    .confirm-modal-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin: 0 0 12px 0; }
    .confirm-modal-message { font-size: 1rem; color: var(--text-secondary); margin: 0 0 32px 0; line-height: 1.6; }
    .confirm-modal-buttons { display: flex; gap: 12px; justify-content: center; }
    .confirm-btn { padding: 14px 32px; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; }
    .confirm-btn-cancel { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }
    .confirm-btn-cancel:hover { background: #eef7f0; color: var(--bg-primary); }
    .confirm-btn-ok { background: var(--warning); color: var(--bg-primary); }
    .confirm-btn-ok:hover { background: #eabb24; transform: translateY(-1px); }

    .modal-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(36, 71, 55, 0.22); display: none; align-items: center;
      justify-content: center; z-index: 1000; padding: 20px;
    }
    .modal-overlay.active { display: flex; }
    /* 天秤評価プロンプト: スクロール位置に関係なく現在のビューポート中央に表示（position:static だと先頭付近に出る） */
    #judge-prompt-modal.judge-prompt-dialog {
      position: fixed;
      inset: 0;
      width: min(900px, calc(100vw - 40px));
      max-width: min(900px, calc(100vw - 40px));
      height: fit-content;
      max-height: 80vh;
      margin: auto;
      padding: 0;
      border: none;
      background: transparent;
      box-shadow: none;
      overflow: visible;
    }
    #judge-prompt-modal.judge-prompt-dialog::backdrop {
      background: rgba(36, 71, 55, 0.22);
    }
    /* 再評価（追加質問）モーダル: judge-prompt-dialog と同じくビューポート中央に表示 */
    #reeval-modal.reeval-dialog {
      position: fixed;
      inset: 0;
      width: min(720px, calc(100vw - 40px));
      max-width: min(720px, calc(100vw - 40px));
      height: fit-content;
      max-height: 80vh;
      margin: auto;
      padding: 0;
      border: none;
      background: transparent;
      box-shadow: none;
      overflow: visible;
    }
    #reeval-modal.reeval-dialog::backdrop {
      background: rgba(36, 71, 55, 0.22);
    }
    /* 天秤評価の経緯: ビューポート中央・横幅広め */
    #tenbin-history-modal.tenbin-history-dialog {
      position: fixed;
      inset: 0;
      width: min(72rem, calc(100vw - 24px));
      max-width: min(72rem, calc(100vw - 24px));
      height: fit-content;
      max-height: 92vh;
      margin: auto;
      padding: 0;
      border: none;
      background: transparent;
      box-shadow: none;
      overflow: visible;
    }
    #tenbin-history-modal.tenbin-history-dialog::backdrop {
      background: rgba(36, 71, 55, 0.22);
    }
    .tenbin-history-modal__body {
      max-height: min(78vh, 820px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .tenbin-history-modal__sections {
      display: flex;
      flex-direction: column;
      gap: 0;
      min-width: 0;
    }
    .tenbin-history-modal__sections .tenbin-eval-row .tenbin-panel__body {
      max-width: 42rem;
      margin-inline: auto;
      line-height: 1.65;
    }
    .modal-content {
      background: #ffffff; border: 1px solid var(--border); border-radius: 20px;
      max-width: 900px; width: 100%; max-height: 80vh; display: flex; flex-direction: column;
      box-shadow: var(--shadow-strong);
    }
    /* .modal-content より後に置き、経緯モーダルだけ広幅に */
    .modal-content.modal-content--tenbin-history {
      max-width: min(72rem, calc(100vw - 24px));
      max-height: 90vh;
    }
    .modal-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 20px 24px; border-bottom: 1px solid var(--border);
    }
    .modal-header h3 { margin: 0; font-size: 1.25rem; color: var(--text-primary); }
    .modal-close {
      background: none; border: none; color: var(--text-muted); font-size: 1.5rem;
      cursor: pointer; padding: 0; width: 36px; height: 36px; display: flex;
      align-items: center; justify-content: center; border-radius: 8px; transition: all 0.2s;
    }
    .modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
    .modal-body { padding: 24px; overflow-y: auto; }
    .modal-body pre {
      margin: 0; white-space: pre-wrap; word-wrap: break-word;
      font-family: 'Fira Code', 'Consolas', monospace; font-size: 0.875rem; line-height: 1.6;
      color: var(--text-secondary); background: #f4f8f2; padding: 20px;
      border-radius: 12px; border: 1px solid var(--border);
    }

    .count-badge { background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 0.875rem; font-weight: 600; }

    .btn-csv-reset { background: none; border: 1px solid var(--danger); color: var(--danger); padding: 2px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem; flex-shrink: 0; }
    .btn-csv-reset:hover { background: var(--danger); color: #fff; }

    .file-selected { border-color: var(--success) !important; background: rgba(77, 188, 93, 0.09) !important; }

    /* 調査対象の参考画像アップローダ（最大1枚。CSV と同じく「ドロップゾーン＝プレビュー」に切替）。 */
    .target-images-uploader {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 18px 16px;
      border: 1.5px dashed var(--border);
      border-radius: 12px;
      background: #fbfdfa;
      cursor: pointer;
      transition: border-color 0.15s ease, background 0.15s ease;
      min-height: 96px;
      text-align: center;
    }
    .target-images-uploader:hover,
    .target-images-uploader:focus-visible {
      border-color: var(--accent);
      background: rgba(93, 165, 122, 0.06);
      outline: none;
    }
    .target-images-uploader.dragover {
      border-color: var(--accent);
      background: rgba(93, 165, 122, 0.12);
    }
    .target-images-uploader .file-icon {
      width: 32px;
      height: 32px;
      color: var(--text-muted);
    }
    .target-images-uploader .file-text {
      margin: 0;
      font-size: 0.8125rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }
    .target-images-uploader .file-text strong { color: var(--text-primary); }

    /* 画像が選択された後のプレビュー領域。中央に画像サムネ＋直下にファイル名。 */
    .target-images-preview {
      max-width: 100%;
      max-height: 180px;
      width: auto;
      height: auto;
      object-fit: contain;
      border-radius: 8px;
      background: #ffffff;
      box-shadow: var(--shadow-soft);
    }
    .target-images-preview[hidden] { display: none !important; }
    .target-images-placeholder-icon[hidden] { display: none !important; }

    /* has-image 状態：ファイル選択済みの見た目（CSV の file-drop-zone--has-file と同様の枠＋色） */
    .target-images-uploader.has-image {
      border-style: solid;
      border-color: var(--success);
      background: rgba(77, 188, 93, 0.07);
      padding-right: 96px; /* 右上のリセットボタンと干渉しないよう余白を確保 */
    }
    .target-images-uploader.has-image .file-text {
      width: 100%;
      max-width: 100%;
      word-break: break-all;
    }
    .target-images-uploader.has-image .file-text .target-images-filename {
      display: block;
      color: var(--text-primary);
      font-weight: 600;
      line-height: 1.35;
    }
    .target-images-uploader.has-image .file-text .target-images-hint {
      display: block;
      font-size: 0.7rem;
      font-weight: 400;
      color: var(--text-muted);
      margin-top: 4px;
    }

    /* 画像が添付されたときだけ表示する「画像の説明」入力欄。 */
    .target-image-caption-block {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-top: 8px;
    }
    .target-image-caption-block[hidden] { display: none !important; }
    .target-image-caption-label {
      font-size: 0.8125rem;
      color: var(--text-primary);
      font-weight: 600;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .target-image-caption-hint {
      font-size: 0.7rem;
      font-weight: 400;
      color: var(--text-muted);
    }
    .target-image-caption-textarea {
      width: 100%;
      box-sizing: border-box;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #ffffff;
      font: inherit;
      font-size: 0.8125rem;
      line-height: 1.5;
      resize: vertical;
      min-height: 60px;
    }
    .target-image-caption-textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(93, 165, 122, 0.2);
    }

    .btn-abort {
      display: inline-flex; align-items: center; gap: 6px;
      background: transparent; color: var(--danger); border: 1px solid var(--danger);
      padding: 8px 12px; border-radius: 8px; font-size: 0.8125rem; font-weight: 600;
      cursor: pointer; transition: all 0.2s;
    }
    .btn-abort:hover { background: rgba(230, 107, 98, 0.12); }

    .btn-loading { position: relative; pointer-events: none; opacity: 0.8; }
    .btn-loading::after {
      content: ''; position: absolute; width: 20px; height: 20px; top: 50%; left: 24px;
      margin-top: -10px; border: 2px solid transparent; border-top-color: var(--bg-primary);
      border-radius: 50%; animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    @media (max-width: 900px) {
      .form-layout { flex-direction: column; }
      .sidebar {
        flex: none;
        max-width: none;
        width: 100%;
        position: static;
        order: 2;
      }
      .main-fields { order: 1; }
    }

    @media (max-width: 720px) {
      .csv-file-row { flex-direction: column; }
      .csv-file-block .csv-upload-col {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
      }
    }

    @media (max-width: 768px) {
      .container { padding: 24px 16px; }
      h1 { font-size: 1.75rem; }
      .card { padding: 20px; }
      .form-grid { grid-template-columns: 1fr; }
      /* テーブルは display:table のまま。横スクロールは .results-table-scroll */
    }

    /* ライセンスセッション UI（ログイン/ログアウト） */
    /* HTML5 の hidden 属性は user-agent stylesheet で display:none だが、
       author stylesheet の display:flex に負けてしまうため、明示的に上書きする。 */
    .license-session-row[hidden] { display: none !important; }
    .license-session-row {
      display: flex;
      gap: 6px;
      align-items: stretch;
      flex-wrap: nowrap;
      margin-top: 4px;
    }
    .license-session-row > input[type="password"] {
      flex: 1 1 auto;
      min-width: 0;
    }
    .license-session-status {
      flex: 1 1 auto;
      min-width: 0;
      font-size: 0.825rem;
      color: var(--text-primary);
      background: rgba(122, 184, 138, 0.18);
      border: 1px solid rgba(122, 184, 138, 0.42);
      border-radius: 6px;
      padding: 8px 10px;
      line-height: 1.3;
      display: flex;
      align-items: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .btn-session {
      flex: 0 0 auto;
      font-size: 0.8125rem;
      padding: 6px 12px;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: #fff;
      color: var(--text-primary);
      cursor: pointer;
      transition: background 0.15s ease, border-color 0.15s ease;
      white-space: nowrap;
      line-height: 1.2;
    }
    .btn-session:hover { background: var(--page-bg-soft); }
    .btn-session:disabled { opacity: 0.6; cursor: not-allowed; }
    .btn-session--primary {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
    }
    .btn-session--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
    .btn-session--ghost {
      background: transparent;
      color: var(--text-secondary);
    }
    .btn-session--small { font-size: 0.75rem; padding: 4px 10px; }
    .license-session-msg {
      margin-top: 6px;
      font-size: 0.78rem;
      line-height: 1.35;
      color: var(--text-secondary);
    }
    .license-session-msg--ok { color: var(--success); }
    .license-session-msg--err { color: var(--danger); }

    /* Gemini API キーの「このブラウザに記憶する」行 */
    .gemini-key-remember-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-top: 8px;
      flex-wrap: nowrap;
    }

    /* 汎用トグルスイッチ（チェックボックスを iOS / Material 風スライダーに変換） */
    .toggle-switch {
      flex: 1 1 auto;
      min-width: 0;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      user-select: none;
      font-size: 0.78rem;
      color: var(--text-secondary);
      line-height: 1.3;
    }
    /* チェックボックス本体は視覚的に隠しつつアクセシビリティは維持 */
    .toggle-switch__input {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      border: 0;
      clip: rect(0 0 0 0);
      overflow: hidden;
      white-space: nowrap;
    }
    .toggle-switch__slider {
      position: relative;
      flex: 0 0 auto;
      display: inline-block;
      width: 34px;
      height: 18px;
      background: #c5d4cf;
      border-radius: 999px;
      transition: background 0.18s ease;
    }
    .toggle-switch__slider::before {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 14px;
      height: 14px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
      transition: transform 0.18s ease;
    }
    .toggle-switch__input:checked + .toggle-switch__slider {
      background: var(--accent);
    }
    .toggle-switch__input:checked + .toggle-switch__slider::before {
      transform: translateX(16px);
    }
    .toggle-switch__input:focus-visible + .toggle-switch__slider {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .toggle-switch__input:disabled + .toggle-switch__slider {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .toggle-switch__label {
      flex: 1 1 auto;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }