.tgen-page { position: relative; width: 100%; padding: 1.5rem 1rem 0; overflow: hidden; }
    .tgen-page .orb {
      position: absolute; border-radius: 50%;
      filter: blur(80px); opacity: 0.2;
      pointer-events: none; z-index: 0;
    }
    .tgen-page .orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #f472b6, transparent 70%); top: -120px; left: -100px; }
    .tgen-page .orb-2 { width: 420px; height: 420px; background: radial-gradient(circle, #34d399, transparent 70%); top: 40px; right: -90px; }
    .tgen-page .orb-3 { width: 340px; height: 340px; background: radial-gradient(circle, #38bdf8, transparent 70%); bottom: 0; left: 30%; }
    .tgen-page .orb-4 { width: 260px; height: 260px; background: radial-gradient(circle, #fbbf24, transparent 70%); bottom: -60px; right: 20%; }

    .tgen-inner {
      position: relative; z-index: 1; width: 100%; max-width: 940px;
      display: flex; flex-direction: column; align-items: center; gap: 1.75rem;
      margin: 0 auto;
    }

    /* Greeting */
    .tgen-greeting { text-align: center; margin-bottom: 0.25rem; }
    .tgen-greeting h1 {
      font-family: 'Cormorant Garamond', serif;
      font-size: clamp(2rem, 5vw, 2.9rem);
      font-weight: 300; letter-spacing: -0.01em;
      color: #000000 !important;
      margin: 0 0 0.5rem; line-height: 1.15;
    }
    .tgen-greeting h1 em {
      font-style: italic;
      background: linear-gradient(135deg, #f472b6, #7c3aed, #38bdf8);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    }
    .tgen-greeting p {
      font-family: 'DM Mono', monospace; font-size: 0.78rem;
      color: #1e293b !important; letter-spacing: 0.04em; text-transform: uppercase;
    }

    /* Badge row */
    .hum-badge-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
    .hum-badge {
      font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.04em;
      text-transform: uppercase; padding: 0.3rem 0.7rem; border-radius: 99px;
      border: 1px solid rgba(52,211,153,0.25); background: rgba(52,211,153,0.07);
      color: rgba(110,231,183,0.9); display: inline-flex; align-items: center; gap: 0.35rem;
    }
    .hum-badge i { font-size: 0.68rem; color: #34d399; }

    /* Source tabs (Upload vs Paste) */
    .doc-source-tabs {
      display: inline-flex; gap: 0.3rem; padding: 0.28rem; border-radius: 12px;
      background: rgba(15,23,42,0.04); border: 1px solid rgba(15,23,42,0.08);
      margin: 0 auto;
    }
    .doc-source-tab {
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.8rem; font-weight: 700;
      padding: 0.45rem 1.1rem; border-radius: 9px; border: none; cursor: pointer;
      background: transparent; color: #334155; display: inline-flex; align-items: center; gap: 0.4rem;
      transition: all 0.18s;
    }
    .doc-source-tab.active {
      background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff;
      box-shadow: 0 4px 14px rgba(124,58,237,0.3);
    }

    /* Upload panel */
    .hum-panel {
      background: #ffffff;
      border: 1px solid rgba(15,23,42,0.1);
      border-radius: 18px; padding: 1.1rem 1.1rem 0.9rem;
      box-shadow: 0 4px 24px rgba(15,23,42,0.06);
      display: flex; flex-direction: column; gap: 0;
      position: relative; transition: border-color 0.2s;
      width: 100%;
    }
    .hum-panel:focus-within { border-color: rgba(124,58,237,0.4); }
    .hum-panel--output { border-color: rgba(52,211,153,0.22); }
    .hum-panel--output:focus-within { border-color: rgba(52,211,153,0.45); }

    .hum-panel-label {
      font-family: 'DM Mono', monospace; font-size: 0.65rem;
      letter-spacing: 0.06em; text-transform: uppercase;
      color: #334155; margin-bottom: 0.55rem;
      display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    }
    .hum-panel-label .label-badge {
      font-size: 0.55rem; padding: 1px 6px; border-radius: 4px;
      background: linear-gradient(135deg, #7c3aed, #2563eb);
      color: white; font-weight: 700; letter-spacing: 0.02em;
    }
    .hum-panel--output .hum-panel-label .label-badge {
      background: linear-gradient(135deg, #10b981, #059669);
    }

    .doc-dropzone {
      display: none; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
      min-height: 220px; border: 2px dashed rgba(124,58,237,0.3); border-radius: 14px;
      background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(56,189,248,0.03));
      cursor: pointer; transition: all 0.18s; text-align: center; padding: 1.5rem;
    }
    .doc-dropzone.active-tab { display: flex; }
    .doc-dropzone:hover, .doc-dropzone.dragover {
      border-color: rgba(124,58,237,0.6); background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(56,189,248,0.06));
      transform: translateY(-1px);
    }
    .doc-dropzone svg { color: #7c3aed; opacity: 0.8; }
    .doc-dropzone p { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 500; color: #0f172a; margin: 0; }
    .doc-dropzone span { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: #64748b; letter-spacing: 0.03em; }
    .doc-format-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: center; margin-top: 0.2rem; }
    .doc-format-chip {
      font-family: 'DM Mono', monospace; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em;
      padding: 0.2rem 0.55rem; border-radius: 6px; color: #fff;
    }
    .doc-format-chip.pdf  { background: #ef4444; }
    .doc-format-chip.docx { background: #2563eb; }
    .doc-format-chip.doc  { background: #0284c7; }
    .doc-format-chip.txt  { background: #64748b; }

    .doc-file-chip {
      display: none; align-items: center; gap: 0.7rem; width: 100%;
      padding: 0.85rem 1rem; border-radius: 12px; margin-top: 0.7rem;
      background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(52,211,153,0.05));
      border: 1px solid rgba(124,58,237,0.2);
    }
    .doc-file-chip.visible { display: flex; }
    .doc-file-icon {
      width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff;
      font-size: 1.05rem;
    }
    .doc-file-meta { flex: 1; min-width: 0; }
    .doc-file-name { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 700; font-size: 0.85rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .doc-file-sub  { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: #64748b; }
    .doc-file-remove {
      width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(248,113,113,0.3);
      background: rgba(248,113,113,0.08); color: #ef4444; cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; transition: all 0.15s;
    }
    .doc-file-remove:hover { background: rgba(248,113,113,0.16); }

    .hum-textarea {
      display: none;
      width: 100%; background: transparent; border: none; outline: none; resize: none;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.93rem;
      color: #000000 !important; font-weight: 500; line-height: 1.7;
      min-height: 240px; max-height: 420px; overflow-y: auto;
    }
    .hum-textarea.active-tab { display: block; }
    .hum-textarea::placeholder { color: #64748b; }
    .hum-textarea--prompt { min-height: 70px; max-height: 140px; font-size: 0.85rem; display: block; }

    .hum-output-text {
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.93rem;
      color: #000000 !important; font-weight: 500; line-height: 1.75;
      min-height: 200px; white-space: pre-wrap;
      flex: 1;
    }
    .doc-summary-title {
      font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 600;
      color: #0f172a; margin: 0 0 0.6rem;
      background: linear-gradient(135deg, #7c3aed, #10b981);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
      display: none;
    }
    .doc-key-points {
      display: none; flex-direction: column; gap: 0.5rem; margin-top: 1rem;
      padding-top: 1rem; border-top: 1px dashed rgba(15,23,42,0.1);
    }
    .doc-key-point {
      display: flex; align-items: flex-start; gap: 0.55rem;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.85rem; color: #0f172a; line-height: 1.5;
    }
    .doc-key-point-dot {
      width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
      display: flex; align-items: center; justify-content: center;
      font-family: 'DM Mono', monospace; font-size: 0.6rem; font-weight: 700; color: #fff;
      background: linear-gradient(135deg, #7c3aed, #10b981);
    }
    .hum-output-placeholder {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-height: 240px; gap: 0.75rem;
      color: #334155; text-align: center;
    }
    .hum-output-placeholder svg { opacity: 0.25; }
    .hum-output-placeholder p { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 300; margin: 0; }
    .hum-output-placeholder span { font-family: 'DM Mono', monospace; font-size: 0.67rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.6; }

    .hum-panel-footer {
      display: flex; align-items: center; justify-content: space-between;
      margin-top: 0.7rem; padding-top: 0.65rem;
      border-top: 1px solid rgba(15,23,42,0.06);
      gap: 0.5rem; flex-wrap: wrap;
    }
    .hum-word-count { font-family: 'DM Mono', monospace; font-size: 0.66rem; color: #334155; letter-spacing: 0.02em; }
    .hum-clear-btn {
      font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.03em; padding: 0.28rem 0.65rem;
      border-radius: 7px; border: 1px solid rgba(15,23,42,0.1); background: #ffffff; color: #334155;
      cursor: pointer; transition: all 0.15s; text-transform: uppercase;
    }
    .hum-clear-btn:hover { border-color: rgba(248,113,113,0.35); color: #f87171; background: rgba(248,113,113,0.06); }
    .hum-action-btn {
      display: inline-flex; align-items: center; gap: 0.35rem;
      padding: 0.38rem 0.85rem; border-radius: 8px;
      border: 1px solid rgba(15,23,42,0.1); background: #ffffff; color: #334155;
      font-family: 'DM Mono', monospace; font-size: 0.68rem;
      letter-spacing: 0.02em; cursor: pointer; transition: all 0.15s;
    }
    .hum-action-btn:hover { border-color: rgba(16,185,129,0.4); color: #059669; background: rgba(16,185,129,0.06); }
    .hum-action-btn--success { border-color: rgba(52,211,153,0.4) !important; color: #059669 !important; background: rgba(52,211,153,0.1) !important; }

    /* Compression gauge */
    .hum-score-wrap { display: flex; align-items: center; gap: 0.5rem; }
    .hum-score-label { font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.04em; text-transform: uppercase; color: #334155; }
    .hum-score-bar { width: 80px; height: 5px; border-radius: 99px; background: rgba(15,23,42,0.08); overflow: hidden; }
    .hum-score-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f472b6, #7c3aed, #34d399); transition: width 0.6s cubic-bezier(.34,1.56,.64,1); }
    .hum-score-num { font-family: 'Cormorant Garamond', serif; font-size: 1rem; font-weight: 600; background: linear-gradient(135deg, #7c3aed, #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

    /* Settings row */
    .hum-settings-row { width: 100%; display: flex; gap: 0.75rem; flex-wrap: wrap; }
    .hum-select-wrap { flex: 1; min-width: 150px; position: relative; }
    .hum-select-wrap label {
      display: flex; align-items: center; gap: 0.35rem;
      font-family: 'DM Mono', monospace; font-size: 0.65rem;
      letter-spacing: 0.05em; text-transform: uppercase; color: #334155; margin-bottom: 0.35rem;
    }
    .hum-select-container { position: relative; }
    .hum-select {
      width: 100%; background: #ffffff; border: 1px solid rgba(15,23,42,0.14); border-radius: 10px;
      padding: 0.52rem 2rem 0.52rem 0.85rem; color: #000000 !important;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.84rem; font-weight: 500;
      outline: none; cursor: pointer; appearance: none; transition: border-color 0.2s;
    }
    .hum-select:focus { border-color: rgba(124,58,237,0.45); }
    .hum-select-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #334155; }

    /* Length / style pills */
    .hum-intensity-wrap { flex: 1; min-width: 220px; }
    .hum-intensity-wrap label {
      display: flex; align-items: center; gap: 0.35rem;
      font-family: 'DM Mono', monospace; font-size: 0.65rem;
      letter-spacing: 0.05em; text-transform: uppercase; color: #334155; margin-bottom: 0.35rem;
    }
    .hum-intensity-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; }
    .hum-intensity-pill {
      font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.03em; text-transform: uppercase;
      padding: 0.38rem 0.75rem; border-radius: 8px; border: 1px solid rgba(15,23,42,0.12); background: #ffffff;
      color: #1e293b; cursor: pointer; transition: all 0.15s; white-space: nowrap;
    }
    .hum-intensity-pill:hover { border-color: rgba(124,58,237,0.35); color: #6d28d9; background: rgba(124,58,237,0.05); }
    .hum-intensity-pill.active {
      border-color: rgba(124,58,237,0.5); background: rgba(124,58,237,0.1); color: #6d28d9; font-weight: 700;
      box-shadow: 0 2px 8px rgba(124,58,237,0.18);
    }

    /* Main action button */
    .hum-action-row { display: flex; align-items: center; gap: 1rem; width: 100%; justify-content: center; flex-wrap: wrap; }
    .hum-btn {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.8rem 2rem; border-radius: 12px; border: none;
      background: linear-gradient(135deg, #7c3aed, #ec4899, #f59e0b);
      background-size: 200% 100%;
      color: #fff; font-family: 'Cabinet Grotesk', sans-serif;
      font-size: 0.95rem; font-weight: 700; cursor: pointer;
      white-space: nowrap; transition: all 0.2s;
      box-shadow: 0 4px 20px rgba(124,58,237,0.35);
      position: relative; overflow: hidden;
    }
    .hum-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.5); background-position: 100% 0; }
    .hum-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
    .hum-btn-secondary {
      display: inline-flex; align-items: center; gap: 0.4rem;
      padding: 0.7rem 1.4rem; border-radius: 12px;
      border: 1px solid rgba(15,23,42,0.1); background: #ffffff; color: #1e293b;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.85rem;
      font-weight: 600; cursor: pointer; transition: all 0.18s;
    }
    .hum-btn-secondary:hover { border-color: rgba(124,58,237,0.4); color: #6d28d9; background: rgba(124,58,237,0.06); }

    /* Loading */
    .hum-loading { display: none; align-items: center; gap: 0.7rem; justify-content: center; padding: 1.5rem; font-family: 'DM Mono', monospace; font-size: 0.75rem; color: #334155; letter-spacing: 0.04em; }
    .hum-loading.visible { display: flex; }
    .hum-spinner { width: 18px; height: 18px; border: 2px solid rgba(124,58,237,0.2); border-top-color: #7c3aed; border-radius: 50%; animation: spin 0.7s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Tips */
    .hum-tips-row { width: 100%; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
    .hum-tip {
      display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.75rem; border-radius: 99px;
      border: 1px solid rgba(15,23,42,0.08); background: #ffffff; color: #1e293b;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.78rem; transition: all 0.15s; cursor: default;
    }
    .hum-tip svg { opacity: 0.5; flex-shrink: 0; }
    .hum-tip:hover { border-color: rgba(124,58,237,0.25); background: rgba(124,58,237,0.05); }

    /* Stats bar */
    .hum-stats-bar {
      display: none; width: 100%; background: #ffffff; border: 1px solid rgba(15,23,42,0.08);
      border-radius: 14px; padding: 0.9rem 1.2rem; gap: 1.5rem; flex-wrap: wrap; justify-content: center;
    }
    .hum-stats-bar.visible { display: flex; }
    .hum-stat { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; min-width: 70px; }
    .hum-stat-num {
      font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; line-height: 1.1;
      background: linear-gradient(135deg, #7c3aed, #34d399);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    }
    .hum-stat-label { font-family: 'DM Mono', monospace; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; }
    .hum-stat-divider { width: 1px; height: 36px; background: rgba(15,23,42,0.08); }

    /* History */
    .tgen-history { width: 100%; max-width: 940px; margin: 0 auto; padding: 1.5rem 0 4rem; }
    .tgen-history-header {
      display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem;
      padding: 1.2rem 1.4rem; background: #ffffff; border: 1px solid rgba(15,23,42,0.08);
      border-radius: 16px; flex-wrap: wrap; gap: 1rem;
    }
    .tgen-history-title-wrap { display: flex; align-items: center; gap: 1rem; }
    .tgen-history-icon {
      width: 44px; height: 44px; border-radius: 12px;
      background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(52,211,153,0.15));
      border: 1px solid rgba(124,58,237,0.25); display: flex; align-items: center; justify-content: center; color: #7c3aed; flex-shrink: 0;
      font-size: 1.25rem;
    }
    .tgen-history-header h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; font-weight: 400; color: #0f172a !important; margin: 0 0 2px; }
    .tgen-history-header p { font-family: 'DM Mono', monospace; font-size: 0.68rem; color: #475569; margin: 0; letter-spacing: 0.02em; }
    .tgen-history-stats { display: flex; align-items: center; gap: 1rem; background: #f8fafc; border: 1px solid rgba(15,23,42,0.08); border-radius: 10px; padding: 0.55rem 1rem; }
    .tgen-history-stat { text-align: center; }
    .tgen-history-stat-num {
      display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 600;
      background: linear-gradient(135deg, #7c3aed, #34d399);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2;
    }
    .tgen-history-stat-label { font-family: 'DM Mono', monospace; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; }
    .tgen-history-stat-divider { width: 1px; height: 28px; background: rgba(15,23,42,0.1); }
    .tgen-history-table-wrap { border-radius: 14px; overflow: hidden; border: 1px solid rgba(15,23,42,0.08); background: #ffffff; }
    .tgen-history-table { width: 100%; border-collapse: collapse; font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.87rem; color: #0f172a !important; }
    .tgen-history-table thead tr { background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(52,211,153,0.06)); border-bottom: 1px solid rgba(15,23,42,0.08); }
    .tgen-history-table thead th { text-align: left; padding: 0.8rem 1rem; font-family: 'DM Mono', monospace; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; color: #6d28d9; }
    .tgen-history-row { border-bottom: 1px solid rgba(15,23,42,0.05); transition: background 0.15s; animation: rowFadeIn 0.3s ease both; }
    @keyframes rowFadeIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
    .tgen-history-row:hover { background: rgba(124,58,237,0.05); }
    .tgen-history-row:last-child { border-bottom: none; }
    .tgen-history-table td { padding: 0.8rem 1rem; vertical-align: middle; }
    .td-prompt-inner { display: flex; align-items: flex-start; gap: 0.55rem; }
    .td-prompt-dot { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, #34d399); margin-top: 6px; flex-shrink: 0; }
    .td-prompt span { color: #000000; font-weight: 500; line-height: 1.5; font-size: 0.84rem; }
    .tgen-model-badge {
      display: inline-flex; align-items: center; padding: 0.22rem 0.6rem; border-radius: 6px;
      background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(124,58,237,0.08)); border: 1px solid rgba(16,185,129,0.25);
      font-family: 'DM Mono', monospace; font-size: 0.62rem; color: #059669; font-weight: 600; letter-spacing: 0.02em;
      white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
    }
    .tgen-word-pill {
      display: inline-flex; align-items: center; padding: 0.22rem 0.65rem; border-radius: 20px;
      background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(99,102,241,0.06)); border: 1px solid rgba(124,58,237,0.2);
      font-family: 'DM Mono', monospace; font-size: 0.7rem; color: #6d28d9; font-weight: 600;
    }
    .tgen-date-text { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: #475569; white-space: nowrap; }
    .tgen-view-btn {
      display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.32rem 0.75rem; border-radius: 8px;
      background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(16,185,129,0.1)); border: 1px solid rgba(124,58,237,0.25); color: #6d28d9;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.75rem; font-weight: 700; text-decoration: none; transition: all 0.16s; white-space: nowrap;
    }
    .tgen-view-btn:hover { background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(16,185,129,0.18)); border-color: rgba(124,58,237,0.45); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.2); }
    .tgen-history-empty { text-align: center; padding: 3rem 1rem !important; }
    .tgen-history-empty-inner { display: flex; flex-direction: column; align-items: center; color: #64748b; }
    .tgen-history-empty-inner p { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 400; color: #334155; margin: 0 0 4px; }
    .tgen-history-empty-inner span { font-family: 'DM Mono', monospace; font-size: 0.7rem; color: #64748b; }
    .tgen-pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
    .tgen-page-btn {
      display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 0.5rem;
      border-radius: 9px; border: 1px solid rgba(15,23,42,0.1); background: #ffffff; color: #334155;
      font-family: 'DM Mono', monospace; font-size: 0.75rem; text-decoration: none; transition: all 0.15s; cursor: pointer;
    }
    .tgen-page-btn:hover { border-color: rgba(124,58,237,0.4); color: #6d28d9; background: rgba(124,58,237,0.06); transform: translateY(-1px); }
    .tgen-page-btn.current { border-color: rgba(124,58,237,0.5); background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(99,102,241,0.1)); color: #6d28d9; font-weight: 700; box-shadow: 0 2px 12px rgba(124,58,237,0.18); }

    /* Modal */
    .tgen-modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(15,10,30,0.6); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 1rem; animation: fadeIn 0.15s ease; }
    .tgen-modal-overlay.visible { display: flex; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .tgen-modal {
      background: #ffffff; border: 1px solid rgba(15,23,42,0.1); border-radius: 20px; width: 100%; max-width: 720px; max-height: 85vh;
      display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,0.25); animation: modalUp 0.25s ease;
    }
    @keyframes modalUp { from { opacity:0; transform: translateY(20px) scale(0.97); } to { opacity:1; transform: none; } }
    .tgen-modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.4rem 1.6rem 1rem; border-bottom: 1px solid rgba(15,23,42,0.07); gap: 1rem; }
    .tgen-modal-title { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; font-weight: 400; color: #0f172a !important; line-height: 1.4; }
    .tgen-modal-meta { font-family: 'DM Mono', monospace; font-size: 0.65rem; color: #475569; margin-top: 4px; letter-spacing: 0.03em; padding-top: 0.5rem; border-top: 1px solid rgba(15,23,42,0.06); }
    .tgen-modal-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(15,23,42,0.1); background: #f8fafc; color: #334155; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
    .tgen-modal-close:hover { border-color: rgba(248,113,113,0.4); color: #f87171; background: rgba(248,113,113,0.08); }
    .tgen-modal-content { flex: 1; overflow-y: auto; padding: 1.25rem 1.6rem; }
    .tgen-modal-body { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.92rem; line-height: 1.72; color: #0f172a !important; white-space: pre-wrap; background: #f8fafc; border: 1px solid rgba(15,23,42,0.06); border-radius: 12px; padding: 1.25rem 1.4rem; }
    .tgen-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.6rem 1.3rem; border-top: 1px solid rgba(15,23,42,0.06); flex-wrap: wrap; }
    .tgen-action-btn {
      display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1rem; border-radius: 9px;
      border: 1px solid rgba(15,23,42,0.1); background: #f8fafc; color: #334155;
      font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
    }
    .tgen-action-btn:hover { border-color: rgba(124,58,237,0.35); color: #6d28d9; background: rgba(124,58,237,0.06); }

    /* AI tools cards */
    .ai-tools-section { width: 100%; max-width: 940px; margin: 0 auto; padding: 1.5rem 0 0; }
    .ai-tools-section-label { font-family: 'DM Mono', monospace; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: #475569; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
    .ai-tools-section-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(124,58,237,0.25), transparent); }
    .ai-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1rem; }
    .ai-tool-card { background: #ffffff; border: 1px solid rgba(15,23,42,0.08); border-radius: 16px; padding: 1.2rem 1.25rem 1.1rem; cursor: pointer; transition: all 0.22s; display: flex; flex-direction: column; gap: 0.6rem; position: relative; overflow: hidden; box-shadow: 0 2px 10px rgba(15,23,42,0.04); }
    .ai-tool-card::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.22s; border-radius: 16px; }
    .ai-tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(15,23,42,0.12); }
    .ai-tool-card:hover::before { opacity: 1; }
    .ai-tool-card-header { display: flex; align-items: center; gap: 0.75rem; }
    .ai-tool-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 1px solid; flex-shrink: 0; font-size: 1.05rem; }
    .ai-tool-card-title { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.9rem; font-weight: 700; color: #0f172a !important; }
    .ai-tool-card-desc { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.8rem; color: #475569; line-height: 1.55; }
    .ai-tool-card-use-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.75rem; border-radius: 7px; border: 1px solid; font-family: 'DM Mono', monospace; font-size: 0.65rem; letter-spacing: 0.03em; font-weight: 600; margin-top: auto; width: fit-content; }
    .ai-tool-card--textgen { border-color: rgba(124,58,237,0.2); }
    .ai-tool-card--textgen::before { background: linear-gradient(135deg, rgba(124,58,237,0.05), rgba(99,102,241,0.03)); }
    .ai-tool-card--textgen:hover { border-color: rgba(124,58,237,0.4); }
    .ai-tool-card--textgen .ai-tool-icon { background: linear-gradient(135deg, rgba(124,58,237,0.16), rgba(99,102,241,0.1)); color: #7c3aed; border-color: rgba(124,58,237,0.3); }
    .ai-tool-card--textgen .ai-tool-card-use-btn { background: rgba(124,58,237,0.08); border-color: rgba(124,58,237,0.2); color: #6d28d9; }
    .ai-tool-card--humanizer { border-color: rgba(56,189,248,0.2); }
    .ai-tool-card--humanizer::before { background: linear-gradient(135deg, rgba(56,189,248,0.05), rgba(14,165,233,0.03)); }
    .ai-tool-card--humanizer:hover { border-color: rgba(56,189,248,0.4); }
    .ai-tool-card--humanizer .ai-tool-icon { background: linear-gradient(135deg, rgba(56,189,248,0.16), rgba(14,165,233,0.1)); color: #0284c7; border-color: rgba(56,189,248,0.3); }
    .ai-tool-card--humanizer .ai-tool-card-use-btn { background: rgba(56,189,248,0.08); border-color: rgba(56,189,248,0.2); color: #0369a1; }
    .ai-tool-card--email { border-color: rgba(251,191,36,0.25); }
    .ai-tool-card--email::before { background: linear-gradient(135deg, rgba(251,191,36,0.06), rgba(245,158,11,0.03)); }
    .ai-tool-card--email:hover { border-color: rgba(251,191,36,0.45); }
    .ai-tool-card--email .ai-tool-icon { background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(245,158,11,0.1)); color: #b45309; border-color: rgba(251,191,36,0.35); }
    .ai-tool-card--email .ai-tool-card-use-btn { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.25); color: #92400e; }
    .ai-tool-card--proposal { border-color: rgba(244,114,182,0.22); }
    .ai-tool-card--proposal::before { background: linear-gradient(135deg, rgba(244,114,182,0.06), rgba(236,72,153,0.03)); }
    .ai-tool-card--proposal:hover { border-color: rgba(244,114,182,0.42); }
    .ai-tool-card--proposal .ai-tool-icon { background: linear-gradient(135deg, rgba(244,114,182,0.18), rgba(236,72,153,0.1)); color: #be185d; border-color: rgba(244,114,182,0.32); }
    .ai-tool-card--proposal .ai-tool-card-use-btn { background: rgba(244,114,182,0.1); border-color: rgba(244,114,182,0.22); color: #9d174d; }
    .ai-tool-card--product { border-color: rgba(52,211,153,0.22); }
    .ai-tool-card--product::before { background: linear-gradient(135deg, rgba(52,211,153,0.06), rgba(16,185,129,0.03)); }
    .ai-tool-card--product:hover { border-color: rgba(52,211,153,0.42); }
    .ai-tool-card--product .ai-tool-icon { background: linear-gradient(135deg, rgba(52,211,153,0.18), rgba(16,185,129,0.1)); color: #047857; border-color: rgba(52,211,153,0.32); }
    .ai-tool-card--product .ai-tool-card-use-btn { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.22); color: #065f46; }
    .ai-tool-card--slides { border-color: rgba(249,115,22,0.22); }
    .ai-tool-card--slides::before { background: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(234,88,12,0.03)); }
    .ai-tool-card--slides:hover { border-color: rgba(249,115,22,0.42); }
    .ai-tool-card--slides .ai-tool-icon { background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(234,88,12,0.1)); color: #c2410c; border-color: rgba(249,115,22,0.32); }
    .ai-tool-card--slides .ai-tool-card-use-btn { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.22); color: #9a3412; }
    .ai-tool-card--docsum { border-color: rgba(99,102,241,0.22); }
    .ai-tool-card--docsum::before { background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(79,70,229,0.03)); }
    .ai-tool-card--docsum:hover { border-color: rgba(99,102,241,0.42); }
    .ai-tool-card--docsum .ai-tool-icon { background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(79,70,229,0.1)); color: #4338ca; border-color: rgba(99,102,241,0.32); }
    .ai-tool-card--docsum .ai-tool-card-use-btn { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.22); color: #3730a3; }
    .ai-tool-card--chatdocs { border-color: rgba(20,184,166,0.22); }
    .ai-tool-card--chatdocs::before { background: linear-gradient(135deg, rgba(20,184,166,0.06), rgba(13,148,136,0.03)); }
    .ai-tool-card--chatdocs:hover { border-color: rgba(20,184,166,0.42); }
    .ai-tool-card--chatdocs .ai-tool-icon { background: linear-gradient(135deg, rgba(20,184,166,0.18), rgba(13,148,136,0.1)); color: #0f766e; border-color: rgba(20,184,166,0.32); }
    .ai-tool-card--chatdocs .ai-tool-card-use-btn { background: rgba(20,184,166,0.1); border-color: rgba(20,184,166,0.22); color: #115e59; }

    .tgen-poweredby { font-family: 'DM Mono', monospace; font-size: 0.67rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(100,116,139,0.6); text-align: center; }
    .tgen-poweredby a { color: rgba(124,58,237,0.7); text-decoration: none; transition: color 0.15s; }
    .tgen-poweredby a:hover { color: #7c3aed; }

    @keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
    .fade-up { animation: fadeUp 0.35s ease both; }

    /* Mobile responsiveness */
    @media (max-width: 700px) {
      .tgen-page { padding: 1rem 0.6rem 0; }
      .hum-settings-row { flex-direction: column; }
      .hum-select-wrap, .hum-intensity-wrap { min-width: 100%; }
      .tgen-history-header { flex-direction: column; align-items: flex-start; }
      .tgen-history-stats { width: 100%; justify-content: space-around; }
      .hum-btn, .hum-btn-secondary { width: 100%; justify-content: center; }
      .hum-action-row { flex-direction: column; }
      .doc-source-tabs { width: 100%; }
      .doc-source-tab { flex: 1; justify-content: center; }
      .tgen-history-table { font-size: 0.78rem; }
      .tgen-history-table thead th:nth-child(1), .tgen-history-table td:nth-child(1) { display: none; }
    }
    @media (max-width: 480px) {
      .hum-stats-bar { gap: 0.8rem; padding: 0.8rem; }
      .hum-stat { min-width: 60px; }
      .tgen-history-table thead th:nth-child(2), .tgen-history-table td:nth-child(2) { display: none; }
    }
    /* ── Chat With Documents ── */
    .doc-chat-messages { max-height: 480px; min-height: 260px; overflow-y: auto; padding: 1.1rem 1.1rem 0.4rem; display: flex; flex-direction: column; gap: 0.7rem; }
    .doc-chat-bubble { display: flex; }
    .doc-chat-bubble--user { justify-content: flex-end; }
    .doc-chat-bubble--ai { justify-content: flex-start; }
    .doc-chat-bubble-inner { max-width: 78%; padding: 0.65rem 0.9rem; border-radius: 14px; font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.88rem; line-height: 1.55; }
    .doc-chat-bubble--user .doc-chat-bubble-inner { background: linear-gradient(135deg,#7c3aed,#6d28d9); color: #fff; border-bottom-right-radius: 4px; }
    .doc-chat-bubble--ai .doc-chat-bubble-inner { background: #f1f5f9; color: #0f172a; border-bottom-left-radius: 4px; }
    .doc-chat-typing { display: flex; gap: 4px; padding: 0 1.1rem 0.6rem; }
    .doc-chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: docTypingBounce 1.2s infinite ease-in-out; }
    .doc-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
    .doc-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
    @keyframes docTypingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
    .doc-chat-input-row { display: flex; align-items: flex-end; gap: 0.6rem; padding: 0.8rem 1rem; border-top: 1px solid rgba(15,23,42,0.08); background: #fafafa; }
    .doc-chat-input { flex: 1; resize: none; border: 1px solid rgba(15,23,42,0.12); border-radius: 12px; padding: 0.6rem 0.8rem; font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.88rem; max-height: 140px; min-height: 42px; }
    .doc-chat-input:focus { outline: none; border-color: rgba(124,58,237,0.4); }
    .doc-chat-send-btn { padding: 0.6rem 0.8rem; flex-shrink: 0; }
    @media (max-width: 480px) { .doc-chat-bubble-inner { max-width: 88%; } }

    /* FAQ section (semantic content for SEO and EEAT) */
    .doc-faq-section { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid rgba(15,23,42,0.08); }
    .doc-faq-section h2 { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1.15rem; font-weight: 800; color: #0f172a; margin-bottom: 1rem; }
    .doc-faq-item { margin-bottom: 1rem; }
    .doc-faq-item h3 { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.95rem; font-weight: 700; color: #1e293b; margin-bottom: 0.3rem; }
    .doc-faq-item p { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.88rem; line-height: 1.6; color: #475569; margin: 0; }