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

  :root {
    --sidebar-w: 252px;
    --bg:        #f2f3f7;
    --surface:   #ffffff;
    --surface-2: #f0f1f5;
    --border:    #e3e5ec;
    --text:      #0f172a;
    --text-2:    #64748b;
    --text-3:    #94a3b8;
    --accent:    #2563eb;
    --accent-lt: #eff6ff;
    --accent-hv: #1d4ed8;
    --user-bg:   linear-gradient(135deg,#2563eb 0%,#1d4ed8 100%);
    --user-text: #ffffff;
    --think-bg:  #f8f9fc;
    --think-bd:  #dde1ea;
    --think-txt: #64748b;
    --think-hd:  #475569;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
    --shadow:    0 2px 8px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
    --radius:    20px;
    --radius-sm: 10px;
    --sidebar-bg:#ffffff;
  }

  html, body { height: 100%; overflow: hidden; }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
  }

  /* ════════════════════════════════════
     LOGIN SCREEN
  ════════════════════════════════════ */
  /* App starts hidden; JS reveals correct screen after auth check */
  #login-screen {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
  }
  #login-screen.visible { display: flex; }

  /* Initial loading overlay — shown while auth check is in flight */
  #boot-overlay {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 46%, #ecfeff 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 999; transition: opacity .25s;
  }
  #boot-overlay.hidden { opacity: 0; pointer-events: none; }
  #boot-overlay .tk-loading-state--boot { margin:0;width:min(520px,calc(100vw - 40px)); }

  .login-card {
    background: var(--surface);
    border-radius: 22px;
    padding: 44px 40px 36px;
    width: 400px;
    box-shadow: 0 12px 48px rgba(37,99,235,.12), 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid rgba(255,255,255,.8);
  }

  .login-logo {
    width: 60px; height: 60px;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto 18px;
  }
  .login-logo img { width: 100%; height: 100%; object-fit: cover; }

  .login-title {
    font-size: 24px; font-weight: 800;
    text-align: center; color: var(--text);
    letter-spacing: -0.6px; margin-bottom: 4px;
  }

  .login-sub {
    font-size: 13px; color: var(--text-2);
    text-align: center; margin-bottom: 32px;
  }

  .login-field { margin-bottom: 14px; }

  .login-field label {
    display: block; font-size: 11.5px; font-weight: 600;
    color: var(--text-2); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
  }

  .login-field input {
    width: 100%; padding: 11px 15px;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: 11px; color: var(--text); font-size: 14px;
    outline: none; transition: border-color .15s, background .15s;
    font-family: inherit;
  }
  .login-field input:focus { border-color: var(--accent); background: var(--surface); }

  .login-btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    color: white; border: none; border-radius: 11px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    margin-top: 10px; transition: opacity .15s, transform .1s;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(37,99,235,.38);
  }
  .login-btn:hover { opacity: .88; }
  .login-btn:active { transform: scale(.98); }

  .login-error {
    margin-top: 14px; padding: 10px 14px;
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 9px; color: #dc2626; font-size: 13px;
    display: none;
  }
  .login-error.show { display: block; }

  /* ════════════════════════════════════
     MAIN APP
  ════════════════════════════════════ */
  #app {
    display: none;
    height: 100%;
    flex-direction: column;
    display: none;
  }
  #app.ready { display: flex; }
  #app-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
  }

  /* ════════════════════════════════════
     SIDEBAR
  ════════════════════════════════════ */
  #sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: 2px 0 12px rgba(0,0,0,.04);
  }

  .sidebar-logo {
    padding: 20px 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
  }
  .logo-mark img { width: 36px; height: 36px; object-fit: cover; }

  .logo-text { display: flex; flex-direction: column; line-height: 1.2; }
  .logo-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
  .logo-sub  { font-size: 10px; color: var(--text-3); font-weight: 500; letter-spacing: 0.2px; }

  .sidebar-divider { height: 1px; background: var(--border); margin: 18px 16px 10px; }

  .sidebar-nav { padding: 14px 10px 0; flex: 1; }

  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-2);
    font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s;
    user-select: none;
  }
  #nav-runpod { display: none; }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.active { background: rgba(44,112,130,.14); color: var(--text-2); font-weight: 500; }
  .nav-item.active .nav-icon { color: var(--text-3); }
  .nav-board-section { margin: 12px 0 6px; }
  .nav-section-title {
    padding: 0 12px 7px;
    font-size: 10.5px;
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
  }
  .nav-board-list { display: flex; flex-direction: column; gap: 2px; }
  .nav-board-item {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
  }
  .nav-board-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-board-item.active { background: rgba(44,112,130,.14); color: var(--text-2); }
  .nav-board-item.active .nav-icon { color: var(--text-3); }
  .nav-board-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-icon {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--text-3); transition: color .15s;
  }
  .nav-icon--img { width: auto; overflow: visible; }
  .nav-monday-logo { height: 16px; width: auto; display: block; }

  /* ── Sidebar user card ── */
  .sidebar-footer {
    padding: 10px 10px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .sidebar-user {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    cursor: pointer; transition: background .15s, border-color .15s;
    user-select: none;
  }
  .sidebar-user:hover { background: var(--accent-lt); border-color: rgba(37,99,235,.25); }

  /* ── Profile Modal ── */
  #profile-modal { display: none; }
  .profile-card {
    background: var(--surface); border-radius: 20px; padding: 28px;
    width: 380px; max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
  }
  .profile-av {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg,#2563eb,#7c3aed);
    color: white; font-size: 26px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 4px 16px rgba(37,99,235,.3);
  }
  .profile-name { font-size: 18px; font-weight: 800; text-align: center; letter-spacing: -.3px; margin-bottom: 3px; }
  .profile-role { text-align: center; margin-bottom: 20px; }
  .profile-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
  .profile-field {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 13px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px;
  }
  .profile-field-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
  .profile-field-value { font-size: 13.5px; font-weight: 500; color: var(--text); }
  .profile-actions { display: flex; gap: 8px; }
  .btn-profile-close {
    flex: 1; padding: 10px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
    color: var(--text-2); font-family: inherit; transition: background .15s;
  }
  .btn-profile-close:hover { background: var(--border); }
  .btn-profile-logout {
    padding: 10px 18px; background: #fee2e2; border: 1px solid #fecaca;
    border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
    color: #dc2626; font-family: inherit; transition: background .15s;
  }
  .btn-profile-logout:hover { background: #fecaca; }
  .user-av-sm {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    color: white; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  /* Role-specific avatar colors */
  .user-av-sm.role-Admin       { background: linear-gradient(135deg,#dc2626,#b91c1c); }
  .user-av-sm.role-Moderator   { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
  .user-av-sm.role-Experte     { background: linear-gradient(135deg,#059669,#047857); }
  .user-av-sm.role-Benutzer    { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
  .user-av-sm.role-Gast        { background: linear-gradient(135deg,#9ca3af,#6b7280); }
  .user-info-sm { flex: 1; min-width: 0; }
  .user-name-sm {
    font-size: 12.5px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .user-role-sm { font-size: 10.5px; color: var(--text-3); }

  .logout-btn {
    width: 26px; height: 26px; border: none; border-radius: 7px;
    background: none; cursor: pointer; color: var(--text-3);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s; flex-shrink: 0;
  }
  .logout-btn:hover { background: #fee2e2; color: #dc2626; }

  /* ════════════════════════════════════
     MAIN CONTENT AREA
  ════════════════════════════════════ */
  #main {
    flex: 1; display: flex; flex-direction: column;
    height: 100%; overflow: hidden; min-width: 0;
    position: relative;
  }

  /* ── Topbar ── */
  #topbar {
    height: 56px; background: linear-gradient(135deg,#2c7082 0%,#14b8a6 100%);
    border-bottom: 0;
    display: flex; align-items: center;
    padding: 0 20px; gap: 18px;
    flex-shrink: 0;
    box-shadow: 0 1px 10px rgba(15,23,42,.12);
    position: relative;
    z-index: 900;
  }
  .topbar-brand { width: calc(var(--sidebar-w) - 8px);display:flex;align-items:center;gap:7px;flex-shrink:0;color:#fff; }
  .topbar-logo-mark { position:relative;width:35px;height:35px;border-radius:0;background:transparent;display:flex;align-items:center;justify-content:center;overflow:visible;transform:translateX(1px) rotate(-3deg); }
  .topbar-logo-mark img { width:35px;height:35px;object-fit:cover;display:block;filter:drop-shadow(0 8px 16px rgba(15,23,42,.18)); }
  .topbar-logo-text { display:flex;flex-direction:column;line-height:1;min-width:0;font-family:"Arial Rounded MT Bold","Avenir Next","Trebuchet MS","Aptos Display","Segoe UI",system-ui,sans-serif; }
  .topbar-logo-name { position:relative;display:inline-flex;align-items:center;gap:2px;font-size:23px;font-weight:800;color:#fff;letter-spacing:-.55px;line-height:1;transform:skewX(-6deg) rotate(-1.5deg);transform-origin:left center;text-shadow:0 1px 0 rgba(255,255,255,.16),0 9px 18px rgba(15,23,42,.2); }
  .topbar-logo-word { position:relative;z-index:1; }
  .topbar-logo-ai { position:relative;z-index:1;display:inline;color:#fff; }
  .topbar-logo-sub { display:none; }
  .topbar-title    { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }
  .topbar-divider  { width: 1px; height: 18px; background: var(--border); }
  .topbar-subtitle { display:none; }
  .topbar-actions  { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  .icon-btn {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: transparent;
    color: var(--text-2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
  }
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }

  .topbar-pill-btn {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
  }
  .topbar-pill-btn:hover { background: var(--surface-2); border-color: #cbd5e1; color: var(--text); }
  #topbar .icon-btn,
  #topbar .topbar-pill-btn,
  #topbar .btn-new-chat--topbar {
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.09);
    color: #fff;
    box-shadow: none;
  }
  #topbar .icon-btn:hover,
  #topbar .topbar-pill-btn:hover,
  #topbar .btn-new-chat--topbar:hover {
    border-color: rgba(255,255,255,.34);
    background: rgba(255,255,255,.17);
    color: #fff;
    opacity: 1;
  }
  .global-user-wrap { position:relative;display:flex;align-items:center; }
  .global-user-btn { position:relative;width:42px;height:42px;border:1px solid rgba(255,255,255,.28);border-radius:999px;background:rgba(255,255,255,.1);padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease; }
  .global-user-btn:hover,.global-user-btn.active { background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.4); }
  .global-user-av { width:36px;height:36px;border-radius:999px;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center;letter-spacing:.01em;box-shadow:0 2px 10px rgba(15,23,42,.16); }
  .global-user-av.role-Admin { background:linear-gradient(135deg,#dc2626,#b91c1c); }
  .global-user-av.role-Moderator { background:linear-gradient(135deg,#7c3aed,#6d28d9); }
  .global-user-av.role-Experte { background:linear-gradient(135deg,#059669,#047857); }
  .global-user-av.role-Gast { background:linear-gradient(135deg,#9ca3af,#6b7280);box-shadow:none; }
  .global-user-mail-warning {
    position:absolute;
    right:-2px;
    top:-2px;
    width:16px;
    height:16px;
    border-radius:999px;
    background:linear-gradient(135deg,#facc15,#f59e0b);
    color:#78350f;
    border:2px solid rgba(255,255,255,.95);
    box-shadow:0 6px 14px rgba(146,64,14,.22);
    font-size:10px;
    font-weight:900;
    line-height:1;
    align-items:center;
    justify-content:center;
  }
  .global-user-menu { position:absolute;right:0;top:calc(100% + 10px);width:236px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 18px 42px rgba(15,23,42,.18);padding:10px;z-index:2600;color:#0f172a; }
  .global-user-menu-name { font-size:14px;font-weight:500;color:#0f172a;padding:7px 8px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  .global-user-menu-divider { height:1px;background:#e2e8f0;margin:0 2px 9px; }
  .global-user-menu-section { font-size:13px;font-weight:500;color:#94a3b8;padding:0 8px 7px; }
  .global-user-menu-section--admin { margin-top:10px;padding-top:8px;border-top:1px solid #e2e8f0; }
  .global-user-menu-item { width:100%;height:36px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;gap:9px;padding:0 8px;font-family:inherit;font-size:13px;font-weight:400;cursor:pointer;text-align:left;transition:background .15s ease,color .15s ease; }
  .global-user-menu-item svg { color:#64748b; }
  .global-user-menu-item:hover { background:#f1f5f9;color:#0f172a; }
  .global-user-menu-item:hover svg { color:#0f172a; }
  .global-user-menu-warning {
    margin-left:2px;
  }

  /* ════════════════════════════════════
     CHAT VIEW
  ════════════════════════════════════ */
  #chat-view {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; min-width: 0;
    background:
      radial-gradient(circle, rgba(37,99,235,.055) 1.5px, transparent 1.5px),
      linear-gradient(180deg, rgba(37,99,235,.018) 0%, transparent 60%);
    background-size: 26px 26px, 100% 100%;
    background-color: var(--bg);
  }

  #messages {
    flex: 1; overflow-y: auto;
    padding: 28px 0 16px;
    display: flex; flex-direction: column; gap: 4px;
    background: transparent;
  }
  #messages::-webkit-scrollbar { width: 5px; }
  #messages::-webkit-scrollbar-track { background: transparent; }
  #messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  .msg-row {
    display: flex; padding: 4px 28px; gap: 12px; align-items: end;
    animation: msgIn .2s ease;
  }
  @keyframes msgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

  .msg-row.user { flex-direction: row-reverse; }

  .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    flex-shrink: 0; display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; margin-top: 2px;
  }
  .avatar.user-av { background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; font-size: 11px; }
  .avatar.user-av.role-Admin     { background: linear-gradient(135deg,#dc2626,#b91c1c); }
  .avatar.user-av.role-Moderator { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
  .avatar.user-av.role-Experte   { background: linear-gradient(135deg,#059669,#047857); }
  .avatar.user-av.role-Gast      { background: linear-gradient(135deg,#9ca3af,#6b7280); }
  .avatar.ai-av   { background: var(--surface); border: 1.5px solid var(--border); overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .avatar.ai-av img { width: 22px; height: 22px; object-fit: contain; }

  .bubble-wrap { display: flex; flex-direction: column; gap: 4px; max-width: min(72%, 720px); }

  .bubble {
    padding: 11px 16px; border-radius: var(--radius);
    line-height: 1.75; white-space: normal;
    word-break: break-word; font-size: 14px;
  }
  .user .bubble {
    background: var(--user-bg); color: var(--user-text);
    border-bottom-right-radius: 5px;
    box-shadow: 0 3px 12px rgba(37,99,235,.28);
  }
  .ai .bubble {
    background: var(--surface); border: 1px solid var(--border);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
  }

  .system-notice {
    text-align: center; padding: 10px 28px;
    font-size: 12px; color: var(--text-3);
  }

  .cursor {
    display: inline-block; width: 2px; height: .85em;
    background: var(--accent); border-radius: 1px;
    vertical-align: text-bottom; margin-left: 2px;
    animation: blink .7s step-end infinite;
  }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

  /* ── Date divider & msg-time defined later, skip duplicate ── */

  .msg-time { font-size: 10.5px; color: var(--text-3); padding: 0 4px; margin-top: 4px; letter-spacing: 0.1px; }
  .msg-row.user .msg-time { text-align: right; }
  .rag-sources-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 8px; padding: 7px 12px 7px 10px;
    background: linear-gradient(135deg,
      color-mix(in srgb,var(--accent) 8%,var(--surface-2)) 0%,
      color-mix(in srgb,var(--accent) 4%,var(--surface-2)) 100%);
    border: 1px solid color-mix(in srgb,var(--accent) 22%,var(--border));
    border-left: 3px solid var(--accent);
    border-radius: 8px; }
  .rag-sources-label {
    display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700;
    color: var(--accent); white-space: nowrap; flex-shrink: 0;
    letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
  .rag-sources-chips { display: flex; flex-wrap: wrap; gap: 5px; }
  .rag-source-chip {
    display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
    padding: 3px 10px 3px 8px; line-height: 1.4;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text-2);
    max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,.06); }
  a.rag-source-link {
    text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
  a.rag-source-link:hover {
    background: color-mix(in srgb,var(--accent) 10%,var(--surface));
    border-color: color-mix(in srgb,var(--accent) 40%,var(--border));
    color: var(--accent); box-shadow: 0 2px 6px color-mix(in srgb,var(--accent) 15%,transparent); }

  /* ── Input panel ── */
  #input-panel {
    background: var(--bg);
    padding: 10px 20px 16px;
    flex-shrink: 0;
  }
  .chat-input-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 10px 10px 10px 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: border-color .2s, box-shadow .2s;
  }
  .chat-input-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1), 0 2px 12px rgba(0,0,0,.07);
  }
  #user-input {
    flex: 1; background: none; border: none;
    color: var(--text); font-size: 15px; font-family: inherit;
    resize: none; outline: none; line-height: 1.5;
    min-height: 24px; max-height: 200px; padding: 0;
    align-self: center;
  }
  #user-input::placeholder { color: var(--text-3); }

  .send-btn {
    width: 38px; height: 38px; flex-shrink: 0; border: none; border-radius: 12px;
    background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .15s, transform .1s;
    box-shadow: 0 2px 8px rgba(37,99,235,.35);
  }
  .send-btn:hover { opacity: .88; }
  .send-btn:active { transform: scale(.91); }
  .send-btn:disabled { background: var(--surface-2); color: var(--text-3); box-shadow: none; cursor: not-allowed; transform: none; }

  .input-hint { text-align: center; font-size: 11px; color: var(--text-3); margin-top: 6px; }
  /* disabled state when model not ready */
  .input-disabled-overlay { display: none; flex-direction: column; gap: 6px; margin-bottom: 6px; }
  .input-disabled-overlay.show { display: flex; }
  .chat-llm-banner { display:flex;align-items:flex-start;gap:10px;padding:12px 16px;border-radius:12px;font-size:12.5px;font-weight:500;line-height:1.5; }
  .chat-llm-banner-warn { background:#fef9c3;border:1.5px solid #fde68a;color:#92400e;animation:rpWarnPulse 2.5s ease-in-out infinite; }
  .dark .chat-llm-banner-warn { background:rgba(120,53,15,.18);border-color:#b45309;color:#fbbf24; }
  .chat-llm-banner-warn svg { flex-shrink:0;margin-top:1px;color:#d97706; }
  .chat-llm-banner-loading { flex-direction:column;gap:8px;background:linear-gradient(135deg,#eff6ff 0%,#ecfdf5 100%);border:1.5px solid #93c5fd;color:#1e40af; }
  .dark .chat-llm-banner-loading { background:linear-gradient(135deg,rgba(30,58,138,.22) 0%,rgba(20,83,45,.18) 100%);border-color:#3b82f6;color:#93c5fd; }
  .chat-llm-banner-loading svg { color:#3b82f6; }
  .chat-llm-banner-link { font-size:11px;font-weight:700;color:inherit;opacity:.7;text-decoration:none;flex-shrink:0;cursor:pointer; }
  .chat-llm-banner-link:hover { opacity:1; }

  /* ── Scroll button ── */
  #scroll-btn {
    position: absolute; bottom: 116px; right: 24px;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 3px 12px rgba(0,0,0,.14);
    cursor: pointer; display: none;
    align-items: center; justify-content: center;
    color: var(--text-2); z-index: 10;
    transition: background .15s, color .15s, transform .15s;
  }
  #scroll-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.07); }

  /* ════════════════════════════════════
     THINK BLOCK
  ════════════════════════════════════ */
  .think-block {
    border: 1px solid var(--think-bd); background: var(--think-bg);
    border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 8px;
  }
  .think-toggle {
    display: flex; align-items: center; gap: 7px; padding: 8px 12px;
    cursor: pointer; user-select: none; color: var(--think-hd);
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.2px;
    transition: background .15s;
  }
  .think-toggle:hover { background: rgba(0,0,0,.03); }
  .think-toggle-icon  {
    width: 16px; height: 16px; flex-shrink: 0; opacity: .65;
    display: flex; align-items: center; justify-content: center;
  }
  .think-toggle-label { flex: 1; }
  .think-chevron { font-size: 9px; opacity: .45; transition: transform .2s; }
  .think-block.open .think-chevron { transform: rotate(90deg); }
  .think-content {
    display: none; padding: 10px 12px;
    border-top: 1px solid var(--think-bd);
    color: var(--think-txt);
    font-family: 'Menlo','Monaco','Courier New',monospace;
    font-size: 12px; white-space: pre-wrap;
    word-break: break-word; line-height: 1.65;
    max-height: 340px; overflow-y: auto;
  }
  .think-block.open .think-content { display: block; }
  .think-block.streaming { border-color: #c7d2fe; }
  /* animated dots for streaming think block */
  .think-dots { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; vertical-align: middle; }
  .think-dots span {
    width: 4px; height: 4px; border-radius: 50%;
    background: #94a3b8; display: inline-block;
    animation: thinkDot 1.2s infinite ease-in-out;
  }
  .think-dots span:nth-child(2) { animation-delay: .2s; }
  .think-dots span:nth-child(3) { animation-delay: .4s; }
  @keyframes thinkDot { 0%,80%,100%{opacity:.25;transform:scale(.8)} 40%{opacity:1;transform:scale(1)} }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── Intent detecting indicator ── */
  .intent-detecting {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 12px; font-size: 12.5px; font-weight: 500;
    color: var(--text-2); background: var(--surface-2);
    border: 1px solid var(--border); margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  .intent-detecting-icon {
    width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); opacity: .8;
  }
  .intent-detecting-text { color: var(--text-2); }

  /* ════════════════════════════════════
     MARKDOWN
  ════════════════════════════════════ */
  .md-content { line-height: 1.75; }
  .md-content > *:first-child { margin-top: 0; }
  .md-content > *:last-child  { margin-bottom: 0; }
  .md-content h1,.md-content h2,.md-content h3,.md-content h4 { font-weight: 700; margin: 1em 0 .35em; line-height: 1.3; }
  .md-content h1 { font-size: 1.2em; } .md-content h2 { font-size: 1.1em; } .md-content h3 { font-size: 1em; }
  .md-content p  { margin: .5em 0; }
  .md-content ul,.md-content ol { padding-left: 1.4em; margin: .5em 0; }
  .md-content li { margin: .25em 0; }
  .md-content code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: .1em .4em; font-size: .87em; font-family: 'Menlo','Monaco','Courier New',monospace; }
  .md-content pre { background: #1e1e2e; border-radius: var(--radius-sm); padding: 13px 16px; overflow-x: auto; margin: .75em 0; border: 1px solid rgba(255,255,255,.06); }
  .md-content pre code { background: none; border: none; padding: 0; color: #cdd6f4; font-size: .85em; line-height: 1.65; }
  .md-content blockquote { border-left: 3px solid var(--accent); margin: .6em 0; padding: .35em .9em; color: var(--text-2); background: var(--accent-lt); border-radius: 0 6px 6px 0; }
  .md-content table { border-collapse: collapse; width: 100%; margin: .75em 0; font-size: .92em; }
  .md-content th,.md-content td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
  .md-content th { background: var(--surface-2); font-weight: 600; }
  .md-content tr:nth-child(even) { background: var(--surface-2); }
  .md-content a { color: var(--accent); text-decoration: underline; }
  .md-content hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
  .md-content strong { font-weight: 700; } .md-content em { font-style: italic; }

  /* ════════════════════════════════════
     SETTINGS PANEL
  ════════════════════════════════════ */
  #settings-panel {
    width: 0; min-width: 0; overflow: hidden;
    background: var(--surface); border-left: 0px solid var(--border);
    height: 100vh; flex-shrink: 0;
    transition: width .25s cubic-bezier(.4,0,.2,1), border-left-width .25s;
  }
  #settings-panel.open { width: 280px; border-left-width: 1px; }
  .settings-inner { width: 280px; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .settings-hd {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 16px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .settings-hd-title { font-size: 13.5px; font-weight: 700; flex: 1; }
  .settings-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
  .sgroup { display: flex; flex-direction: column; gap: 6px; }
  .slabel { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; }
  .sgroup textarea {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    padding: 8px 10px; font-size: 13px; font-family: inherit;
    resize: vertical; min-height: 80px; outline: none; line-height: 1.5;
    transition: border-color .15s; width: 100%;
  }
  .sgroup textarea:focus { border-color: var(--accent); background: var(--surface); }
  .srow { display: flex; align-items: center; gap: 8px; }
  .srow input[type=number] { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 6px 10px; font-size: 13px; outline: none; transition: border-color .15s; }
  .srow input[type=number]:focus { border-color: var(--accent); }
  .srow input[type=range] { flex: 1; accent-color: var(--accent); cursor: pointer; }
  .sval { font-size: 12px; font-weight: 600; color: var(--text-2); min-width: 32px; text-align: right; }
  .srow-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .toggle-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 22px; transition: .2s; }
  .toggle-slider::before { position: absolute; content: ''; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
  .toggle-switch input:checked + .toggle-slider { background: var(--accent); }
  .toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
  .settings-footer { padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
  .btn-save { width: 100%; padding: 9px 0; background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
  .btn-save:hover { background: var(--accent-hv); }
  .btn-save.saved { background: #16a34a; }

  /* ════════════════════════════════════
     USERS VIEW
  ════════════════════════════════════ */
  #users-view {
    flex: 1; overflow-y: auto;
    padding: 28px; display: none;
  }
  #users-view.active { display: block; }

  /* ── Roles matrix ── */
  .roles-matrix-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.07);
    margin-bottom: 24px; overflow: hidden;
  }
  .roles-matrix-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 13px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    user-select: none;
  }
  .roles-matrix-header:hover { background: var(--surface-3, rgba(0,0,0,.03)); }
  .roles-matrix-header-left { display: flex; align-items: center; gap: 10px; }
  .roles-matrix-header-icon {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--accent-lt); color: var(--accent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .roles-matrix-title { font-size: 14px; font-weight: 700; color: var(--text); }
  .roles-matrix-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
  .roles-matrix-chevron {
    color: var(--text-3); transition: transform .2s; font-size: 12px;
  }
  .roles-matrix-card.open .roles-matrix-chevron { transform: rotate(180deg); }
  .roles-matrix-body { display: none; overflow-x: auto; }
  .roles-matrix-card.open .roles-matrix-body { display: block; }
  /* Table */
  .rm-table { width: 100%; border-collapse: collapse; min-width: 540px; }
  .rm-table thead th {
    padding: 10px 14px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px; color: var(--text-3);
    background: var(--surface); border-bottom: 1px solid var(--border);
    text-align: center;
  }
  .rm-table thead th:first-child { text-align: left; width: 52%; }
  .rm-table tbody tr:last-child td { border-bottom: none; }
  .rm-table tbody tr:hover td { background: var(--surface-2); }
  .rm-table td {
    padding: 8px 14px; font-size: 12.5px; color: var(--text-2);
    border-bottom: 1px solid var(--border); text-align: center;
    transition: background .1s;
  }
  .rm-table td:first-child { text-align: left; color: var(--text); font-weight: 500; }
  /* Category separator row */
  .rm-cat-row td {
    padding: 7px 14px 5px; font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .6px; color: var(--accent);
    background: var(--accent-lt) !important; border-bottom: 1px solid var(--border);
  }
  .rm-cat-row td:first-child { border-radius: 0; }
  /* Check / cross icons */
  .rm-yes {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(22,163,74,.12); color: #16a34a;
  }
  .rm-no {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,.04); color: var(--text-3);
  }
  /* Role header badges */
  .rm-role-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
    letter-spacing: .2px;
  }
  .rm-role-gast    { background: rgba(148,163,184,.15); color: #64748b; }
  .rm-role-experte { background: rgba(168,85,247,.12);  color: #9333ea; }
  .rm-role-mod     { background: rgba(234,179,8,.14);   color: #b45309; }
  .rm-role-admin   { background: rgba(37,99,235,.12);   color: #2563eb; }

  .users-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
  }
  .users-title { font-size: 24px; font-weight: 500; color: var(--text); letter-spacing: 0; }
  .users-subtitle { margin-top:6px;font-size:13.5px;font-weight:400;color:#64748b;line-height:1.45; }

  .btn-create {
    display: flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg,#2563eb,#1d4ed8); color: white;
    border: none; border-radius: var(--radius-sm); padding: 9px 16px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    box-shadow: 0 2px 8px rgba(37,99,235,.3); transition: opacity .15s;
  }
  .btn-create:hover { opacity: .88; }

  .users-team-layout {
    display:grid;
    grid-template-columns:280px minmax(0,1fr);
    gap:0;
    align-items:stretch;
    height:calc(100vh - 190px);
    min-height:520px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 2px 12px rgba(0,0,0,.06);
    overflow:visible;
  }
  .users-team-sidebar {
    background:#fbfdff;
    border-right:1px solid #e2e8f0;
    border-radius:16px 0 0 16px;
    box-shadow:none;
    padding:10px;
    position:relative;
    top:auto;
    align-self:stretch;
    height:100%;
    overflow:auto;
  }
  .users-team-nav-btn {
    width:100%;
    border:0;
    background:transparent;
    border-radius:11px;
    padding:9px 10px;
    display:flex;
    align-items:center;
    gap:9px;
    color:var(--text-2);
    font-family:inherit;
    font-size:13px;
    font-weight:500;
    cursor:pointer;
    transition:background .15s ease,color .15s ease;
    text-align:left;
  }
  .users-team-nav-btn:hover { background:#f8fafc;color:var(--text); }
  .users-team-nav-btn.active { background:rgba(44,112,130,.14);color:var(--text); }
  .users-team-nav-icon {
    width:24px;
    height:24px;
    border-radius:8px;
    background:#f1f5f9;
    color:#64748b;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }
  .users-team-nav-btn.active .users-team-nav-icon { background:rgba(44,112,130,.18);color:#2c7082; }
  .users-team-nav-label { flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  .users-team-nav-count {
    min-width:24px;
    height:22px;
    border-radius:999px;
    background:#f1f5f9;
    color:#64748b;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0 7px;
    font-size:11.5px;
    font-weight:600;
  }
  .users-team-nav-btn.active .users-team-nav-count { background:#fff;color:#2c7082; }
  .users-team-nav-sep { height:1px;background:#e2e8f0;margin:8px 4px; }
  .users-team-panel {
    display:flex;
    flex-direction:column;
    background:#fff;
    border:0;
    border-radius:0 16px 16px 0;
    box-shadow:none;
    overflow:visible;
    min-width:0;
    min-height:0;
  }
  .users-team-panel-head {
    display:none;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:16px 18px;
    border-bottom:1px solid #e2e8f0;
    background:#f8fafc;
  }
  .users-team-panel-title { font-size:17px;font-weight:600;color:#0f172a;letter-spacing:-.2px; }
  .users-team-panel-sub { margin-top:2px;font-size:12.5px;color:#64748b; }
  .users-team-panel-count {
    min-width:34px;
    height:28px;
    border-radius:999px;
    background:#fff;
    border:1px solid #e2e8f0;
    color:#334155;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0 10px;
    font-size:12px;
    font-weight:600;
  }
  .users-team-content { padding:0;display:flex;flex-direction:column;gap:0;min-height:0;flex:1;overflow:auto; }
  .users-role-section {
    border:0;
    border-radius:0;
    overflow:visible;
    background:#fff;
  }
  .users-role-section-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 14px;
    background:#f8fafc;
    border-bottom:1px solid #e2e8f0;
  }
  .users-role-section-title { display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:#0f172a; }
  .users-role-section-count { font-size:12px;color:#64748b;font-weight:500; }
  .users-table-card { background:#fff;border-radius:0 16px 16px 0;overflow:visible; }
  .users-panel-top {
    position:sticky;
    top:0;
    z-index:20;
    background:#fff;
    padding:20px 18px 16px;
    border-bottom:1px solid #e2e8f0;
  }
  .users-panel-identity { display:flex;align-items:center;gap:14px;margin-bottom:15px; }
  .users-panel-team-icon {
    width:48px;
    height:48px;
    border-radius:14px;
    background:rgba(44,112,130,.12);
    color:#2c7082;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }
  .users-panel-team-icon svg { width:24px;height:24px; }
  .users-panel-team-name { font-size:24px;font-weight:500;color:#0f172a;letter-spacing:0;line-height:1.15; }
  .users-panel-team-sub { margin-top:3px;font-size:13px;color:#64748b;font-weight:400; }
  .users-search-box {
    height:38px;
    max-width:420px;
    border:1px solid #dbe3ee;
    border-radius:11px;
    background:#f8fafc;
    color:#64748b;
    display:flex;
    align-items:center;
    gap:9px;
    padding:0 12px;
    transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;
  }
  .users-search-box:focus-within {
    background:#fff;
    border-color:#2c7082;
    box-shadow:0 0 0 3px rgba(44,112,130,.12);
  }
  .users-search-box input {
    width:100%;
    border:0;
    outline:0;
    background:transparent;
    font-family:inherit;
    font-size:13px;
    color:#0f172a;
  }
  .users-search-box input::placeholder { color:#94a3b8; }
  .users-table-head,
  .users-card {
    display:grid;
    grid-template-columns:minmax(220px,1.15fr) minmax(180px,1fr) minmax(120px,.6fr) 42px;
    gap:14px;
    align-items:center;
  }
  .users-table-head {
    padding:12px 14px;
    background:#f8fafc;
    border-bottom:1px solid #e2e8f0;
    color:#334155;
    font-size:13.5px;
    font-weight:400;
  }
  .users-card-list { display:flex;flex-direction:column; }
  .users-card {
    padding:13px 14px;
    border-bottom:1px solid #eef2f7;
    min-height:58px;
  }
  .users-card:last-child { border-bottom:none; }
  .users-card:hover { background:#f8fafc; }
  .users-card-main { min-width:0;display:flex;align-items:center;gap:10px; }
  .users-card-avatar {
    width:32px;
    height:32px;
    border-radius:999px;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    font-size:11px;
    font-weight:800;
  }
  .users-card-avatar.role-Admin { background:linear-gradient(135deg,#dc2626,#b91c1c); }
  .users-card-avatar.role-Moderator { background:linear-gradient(135deg,#7c3aed,#6d28d9); }
  .users-card-avatar.role-Experte { background:linear-gradient(135deg,#059669,#047857); }
  .users-card-avatar.role-Gast { background:linear-gradient(135deg,#9ca3af,#6b7280); }
  .users-card-name { min-width:0; }
  .users-card-display { font-size:13.5px;font-weight:500;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  .users-card-username { margin-top:1px;font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  .users-card-meta { min-width:0;display:flex;flex-direction:column;gap:3px;font-size:12.5px;color:#475569; }
  .users-card-meta span { white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
  .users-card-title { min-height:1px;color:#64748b;font-size:12.5px; }
  .users-actions-wrap { position:relative;display:flex;justify-content:flex-end; }
  .users-actions-btn {
    width:30px;
    height:30px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#64748b;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    line-height:1;
    padding:0 0 4px;
  }
  .users-actions-btn:hover,.users-actions-btn.active { background:#f1f5f9;color:#0f172a; }
  .users-actions-menu {
    position:absolute;
    top:34px;
    right:0;
    z-index:1000;
    min-width:148px;
    padding:6px;
    border:1px solid #e2e8f0;
    border-radius:10px;
    background:#fff;
    box-shadow:0 14px 32px rgba(15,23,42,.16);
    display:none;
  }
  .users-actions-menu.open { display:flex;flex-direction:column;gap:2px; }
  .users-menu-action {
    height:32px;
    border:0;
    background:transparent;
    border-radius:8px;
    color:#0f172a;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 8px;
    font-family:inherit;
    font-size:12.5px;
    font-weight:400;
    cursor:pointer;
    text-align:left;
  }
  .users-menu-action:hover { background:#f1f5f9; }
  .users-menu-action.danger { color:#dc2626; }
  .users-menu-action.danger:hover { background:#fee2e2; }
  .users-empty-panel {
    padding:28px 18px;
    text-align:center;
    color:#64748b;
    font-size:13px;
  }

  @media(max-width:900px){
    .users-team-layout { grid-template-columns:1fr;height:auto;min-height:0; }
    .users-team-sidebar { position:relative;top:auto;border-right:0;border-bottom:1px solid #e2e8f0;border-radius:16px 16px 0 0;max-height:none; }
    .users-team-panel { border-radius:0 0 16px 16px; }
    .users-team-content { overflow:visible; }
    .users-panel-top { position:relative; }
    .users-table-head { display:none; }
    .users-card { grid-template-columns:1fr;align-items:start; }
    .users-card .tbl-actions { justify-content:flex-start; }
  }

  .users-table-wrap {
    background: var(--surface); border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07); overflow: hidden;
    border: 1px solid var(--border);
  }
  .users-table { width: 100%; border-collapse: collapse; }
  .users-table th {
    background: var(--surface-2); padding: 11px 16px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-2); text-align: left;
    border-bottom: 1px solid var(--border);
  }
  .users-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--text); }
  .users-table tr:last-child td { border-bottom: none; }
  .users-table tr:hover td { background: var(--surface-2); }

  .role-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
  }
  .role-badge.Admin     { background: #fee2e2; color: #dc2626; }
  .role-badge.Moderator { background: #ffedd5; color: #ea580c; }
  .role-badge.Experte   { background: #dbeafe; color: #2563eb; }
  .role-badge.Gast      { background: var(--surface-2); color: var(--text-2); }

  .tbl-actions { display: flex; gap: 6px; }
  .btn-tbl {
    width: 28px; height: 28px; border-radius: 7px;
    border: 1px solid var(--border); background: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-2); transition: background .12s, color .12s;
  }
  .btn-tbl.edit:hover  { background: var(--accent-lt); color: var(--accent); border-color: var(--accent); }
  .btn-tbl.del:hover   { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

  /* ── Modal ── */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.42); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    z-index: 600;
  }
  .modal-card {
    background: var(--surface); border-radius: 18px; padding: 30px;
    width: 440px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
  }
  #docs-upload-modal .modal-overlay { z-index: 5200; }
  #prompt-modal .modal-card { width: 780px; }
  #prompt-modal .modal-card textarea { min-height: 220px; }
  .modal-title { font-size: 18px; font-weight: 800; margin-bottom: 22px; letter-spacing: -0.3px; }
  .modal-field { margin-bottom: 14px; }
  .modal-field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
  .modal-field input, .modal-field select {
    width: 100%; padding: 10px 13px;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: 10px; color: var(--text); font-size: 14px;
    outline: none; transition: border-color .15s; font-family: inherit;
  }
  .modal-field input:focus, .modal-field select:focus { border-color: var(--accent); background: var(--surface); }
  .modal-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
  .modal-actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }
  .btn-modal-cancel { padding: 9px 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2); transition: background .12s; font-family: inherit; }
  .btn-modal-cancel:hover { background: var(--border); }
  .btn-modal-save { padding: 9px 22px; background: linear-gradient(135deg,#2563eb,#1d4ed8); color: white; border: none; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity .15s; }
  .btn-modal-save:hover { opacity: .88; }
  .modal-error { margin-top: 12px; padding: 9px 13px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #dc2626; font-size: 13px; display: none; }
  .modal-error.show { display: block; }

  /* ── Confirm dialog ── */
  .confirm-card {
    background: var(--surface); border-radius: 16px; padding: 26px 28px;
    width: 360px; max-width: 95vw;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
  }
  .confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
  .confirm-text  { font-size: 13.5px; color: var(--text-2); margin-bottom: 22px; }
  .btn-del { padding: 9px 20px; background: #dc2626; color: white; border: none; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
  .btn-del:hover { background: #b91c1c; }

  /* ════════════════════════════════════
     INTENT ROUTING
  ════════════════════════════════════ */
  .intent-chip {
    display: inline-block;
    font-size: 11px; font-weight: 600;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px;
    margin-bottom: 6px; overflow: hidden;
  }
  .intent-chip-details { display: block; }
  .intent-chip-details[open] .intent-chip-chevron svg { transform: rotate(180deg); }
  .intent-chip-summary {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 3px;
    padding: 5px 10px; cursor: pointer; list-style: none; user-select: none;
  }
  .intent-chip-summary::-webkit-details-marker { display: none; }
  .intent-chip-label  { color: #64748b; font-weight: 500; }
  .intent-chip-value  { color: #2563eb; font-weight: 700; font-family: 'Menlo','Monaco','Courier New',monospace; }
  .intent-chip-sep    { color: #cbd5e1; }
  .intent-chip-prompt { color: #475569; }
  .intent-chip-chevron { color: #94a3b8; margin-left: 2px; display: flex; align-items: center; transition: transform .15s; }
  .intent-chip-chevron svg { transition: transform .15s; }
  .intent-chip-json {
    margin: 0; padding: 8px 12px; border-top: 1px solid #bfdbfe;
    font-size: 11px; font-family: 'Menlo','Monaco','Courier New',monospace;
    color: #1e40af; white-space: pre; overflow-x: auto;
    background: #dbeafe; line-height: 1.55;
  }
  .intent-detecting {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 20px; font-size: 12px;
    color: var(--text-2); background: var(--surface-2);
    border: 1px solid var(--border); margin-bottom: 6px;
  }
  .intent-no-handler {
    padding: 8px 14px; border-radius: var(--radius-sm);
    background: #fff7ed; border: 1px solid #fed7aa;
    color: #c2410c; font-size: 12.5px; margin-bottom: 6px;
  }

  /* ─ Prompts list in settings ─ */
  .prompts-list { display: flex; flex-direction: column; gap: 5px; }
  .prompt-item {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 9px; padding: 8px 10px;
    display: flex; align-items: flex-start; gap: 8px;
  }
  .prompt-item-info { flex: 1; min-width: 0; }
  .prompt-item-name {
    font-size: 12.5px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .prompt-item-id {
    font-size: 10.5px; color: var(--accent);
    font-family: 'Menlo','Monaco','Courier New',monospace;
    font-weight: 600; margin-top: 2px;
  }
  .prompt-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
  .btn-prompt-edit, .btn-prompt-del {
    width: 24px; height: 24px; border-radius: 6px;
    border: 1px solid var(--border); background: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text-2); transition: background .12s, color .12s;
  }
  .btn-prompt-edit:hover { background: var(--accent-lt); color: var(--accent); border-color: var(--accent); }
  .btn-prompt-del:hover  { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
  .btn-add-prompt {
    width: 100%; padding: 7px 0; background: none;
    border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
    color: var(--text-2); font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: border-color .15s, color .15s, background .15s;
    font-family: inherit; margin-top: 5px;
  }
  .btn-add-prompt:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }

  /* ─ Welcome Screen ─ */
  #welcome-screen {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 24px 24px; gap: 24px;
    scrollbar-width: none;
  }
  #welcome-screen::-webkit-scrollbar { display: none; }
  .welcome-header { text-align: center; flex-shrink: 0; }
  .welcome-logo-ring {
    width: 72px; height: 72px; border-radius: 22px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
  }
  .welcome-logo-ring img { width: 60%; height: 60%; object-fit: contain; mix-blend-mode: multiply; }
  .welcome-greeting {
    font-size: 30px; font-weight: 800; color: var(--text);
    letter-spacing: -0.8px; margin-bottom: 6px; line-height: 1.2;
  }
  .welcome-greeting span {
    background: linear-gradient(135deg,#6ed2c8,#e87fb0);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .welcome-sub { font-size: 14.5px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
  .welcome-hint { font-size: 12px; color: var(--text-3); }
  .welcome-tiles {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; width: 100%; max-width: 500px; flex-shrink: 0;
  }
  .welcome-tile {
    background: var(--surface); border-radius: 18px; padding: 18px 16px 16px;
    cursor: pointer; text-align: left; border: 1.5px solid var(--border);
    transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, border-color .18s, opacity .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); position: relative; overflow: hidden;
  }
  .welcome-tile:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 10px 28px rgba(110,207,202,.22); border-color: transparent; }
  .welcome-tile:active { transform: translateY(-1px) scale(1.005); }
  .welcome-tile.tiles-loading { opacity: .45; pointer-events: none; cursor: not-allowed; }
  /* Gradient top accent bar for all tiles via pseudo-element (border can't use gradients with border-radius) */
  .welcome-tile::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg,#6ed2c8,#e87fb0);
  }
  .welcome-tile-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
    background: linear-gradient(135deg,rgba(110,207,202,.18),rgba(232,127,176,.12));
    color: #0A938C;
  }
  .welcome-tile-title {
    font-size: 13px; font-weight: 700; color: var(--text);
    margin-bottom: 5px; line-height: 1.3;
  }
  .welcome-tile-desc { font-size: 11.5px; color: var(--text-2); line-height: 1.55; }
  /* Edit button on tile (admin/mod only) */
  .welcome-tile-edit {
    position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
    border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-3); cursor: pointer; display: none;
    align-items: center; justify-content: center;
    transition: background .12s, color .12s, border-color .12s, opacity .15s;
    opacity: 0; z-index: 2;
  }
  .welcome-tile:hover .welcome-tile-edit { opacity: 1; }
  .welcome-tile-edit:hover { background: var(--accent-lt); color: var(--accent); border-color: var(--accent); }
  .can-edit-tiles .welcome-tile-edit { display: flex; }
  /* Loading shimmer on tiles */
  .welcome-tile.tiles-loading::after {
    content: ''; position: absolute; inset: 0;
    background: var(--surface-2); opacity: .5; border-radius: inherit;
  }
  /* Tile edit modal */
  #tile-edit-modal {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,.45); align-items: center; justify-content: center;
  }
  #tile-edit-modal.open { display: flex; }
  .tile-edit-card {
    background: var(--surface); border-radius: 18px; padding: 28px;
    width: 100%; max-width: 420px; box-shadow: 0 24px 60px rgba(0,0,0,.2);
    border: 1px solid var(--border);
  }
  .tile-edit-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 20px; color: var(--text); }
  .tile-edit-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
  .tile-edit-field label { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
  .tile-edit-field input, .tile-edit-field textarea {
    padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text); font-size: 13px; font-family: inherit;
    resize: vertical; transition: border-color .15s;
  }
  .tile-edit-field input:focus, .tile-edit-field textarea:focus { outline: none; border-color: var(--accent); }
  .tile-edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
  .tile-edit-actions button { padding: 8px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
  .btn-tile-save { background: var(--accent); color: #fff; }
  .btn-tile-save:hover { background: var(--accent-hv); }
  .btn-tile-cancel { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border) !important; }
  .btn-tile-cancel:hover { background: var(--border); }
  .tile-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
  .tile-radio-opt { display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 12.5px;
    font-weight: 500; color: var(--text-2); transition: all .15s; }
  .tile-radio-opt input[type=radio] { display: none; }
  .tile-radio-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); }
  .tile-icon-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 4px; }
  .tile-icon-opt {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 8px 4px; border-radius: 10px; cursor: pointer;
    border: 2px solid var(--border); background: var(--surface-2);
    color: var(--text-2); font-size: 9px; font-weight: 600; transition: all .15s;
  }
  .tile-icon-opt:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }
  .tile-icon-opt.selected { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); }

  /* ─ Queue status badge ─ */
  .queue-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
    background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c;
    margin-bottom: 4px;
  }

  /* ─ New Chat button ─ */
  .btn-new-chat {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white; border: none; cursor: pointer; font-size: 13px; font-weight: 600;
    font-family: inherit; transition: opacity .15s;
    box-shadow: 0 2px 8px rgba(37,99,235,.22);
  }
  .btn-new-chat:hover { opacity: .88; }
  .btn-new-chat--topbar {
    width: auto;
    margin: 0;
    min-height: 34px;
    border-radius: 10px;
    padding: 8px 13px;
    white-space: nowrap;
  }

  /* ─ Chat history drawer ─ */
  .sidebar-nav { padding: 14px 10px 0; flex: 1; overflow: hidden; display: flex; flex-direction: column; }
  .nav-items { flex-shrink: 0; padding-bottom: 4px; }
  #chat-history-overlay {
    position: fixed; inset: 0; z-index: 2600;
    background: rgba(15, 23, 42, .14);
    opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
  }
  #chat-history-overlay.open { opacity: 1; pointer-events: auto; }
  #chat-history-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 2601;
    width: min(360px, calc(100vw - 24px));
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -16px 0 40px rgba(15, 23, 42, .16);
    transform: translateX(104%);
    transition: transform .22s ease;
    display: flex; flex-direction: column;
  }
  #chat-history-drawer.open { transform: translateX(0); }
  .history-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border);
  }
  .history-drawer-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .history-drawer-title strong { font-size: 17px; font-weight: 500; color: var(--text); }
  .history-drawer-title span { font-size: 12px; color: var(--text-3); }
  .history-section { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; }
  .history-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4px 7px; flex-shrink: 0;
  }
  .history-hd-label { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
  .btn-clear-hist {
    width: 20px; height: 20px; border-radius: 5px;
    border: none; background: none; cursor: pointer; color: var(--text-3);
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
  }
  .btn-clear-hist:hover { background: #fee2e2; color: #dc2626; }
  .chat-history-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
  .chat-history-list::-webkit-scrollbar { width: 3px; }
  .chat-history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .history-empty { font-size: 12px; color: var(--text-3); text-align: center; padding: 16px 8px; font-style: italic; }
  .chi {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 8px; border-radius: 8px; cursor: pointer;
    transition: background .12s;
  }
  .chi:hover { background: var(--surface-2); }
  .chi.active { background: var(--accent-lt); }
  .chi-body { flex: 1; min-width: 0; }
  .chi-title { font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chi.active .chi-title { color: var(--accent); font-weight: 600; }
  .chi-time { font-size: 10px; color: var(--text-3); margin-top: 2px; }
  .chi-del {
    width: 18px; height: 18px; border-radius: 4px; border: none; background: none;
    cursor: pointer; color: transparent; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background .12s, color .12s;
  }
  .chi:hover .chi-del { color: var(--text-3); }
  .chi-del:hover { background: #fee2e2; color: #dc2626 !important; }

  /* ─ Welcome screen user avatar ─ */
  .welcome-user-av {
    width: 68px; height: 68px; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white; font-size: 24px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px; flex-shrink: 0;
    box-shadow: 0 6px 24px rgba(37,99,235,.3), 0 0 0 3px rgba(37,99,235,.1);
    letter-spacing: -0.5px;
  }

  /* ─ Date divider modernized ─ */
  .date-divider {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 28px 8px; color: var(--text-3); font-size: 11px; font-weight: 600;
    letter-spacing: 0.3px; text-transform: uppercase;
  }
  .date-divider::before, .date-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
  }
  .date-divider span {
    white-space: nowrap; padding: 3px 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 20px;
  }

  /* ═══ PROFILE VIEW ═══ */
  #profile-view {
    flex: 1; overflow-y: auto; display: none; background: var(--bg);
  }
  #profile-view.active { display: block; }
  .profile-view-inner { max-width: 700px; margin: 0 auto; padding: 28px 0 48px; display: flex; flex-direction: column; }

  /* ── Banner + hero ── */
  .profile-hero {
    background: var(--surface); border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .profile-hero-banner {
    height: 120px;
    background: linear-gradient(135deg,#6ed2c8 0%,#e87fb0 100%);
    position: relative;
    width: 100%;
  }
  .profile-hero-banner::after {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.07'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }
  .profile-hero-body {
    max-width: 700px; margin: 0 auto; padding: 0 24px 20px;
    display: flex; align-items: flex-end; gap: 18px;
    margin-top: -38px; position: relative;
  }
  .profile-hero-av {
    width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    color: white; font-size: 26px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 4px solid var(--surface);
    box-shadow: 0 4px 18px rgba(37,99,235,.3);
  }
  .profile-hero-av.role-Admin     { background: linear-gradient(135deg,#dc2626,#b91c1c); box-shadow: 0 4px 18px rgba(220,38,38,.3); }
  .profile-hero-av.role-Moderator { background: linear-gradient(135deg,#7c3aed,#6d28d9); box-shadow: 0 4px 18px rgba(124,58,237,.3); }
  .profile-hero-av.role-Experte   { background: linear-gradient(135deg,#059669,#047857); box-shadow: 0 4px 18px rgba(5,150,105,.3); }
  .profile-hero-av.role-Gast      { background: linear-gradient(135deg,#9ca3af,#6b7280); box-shadow: none; }
  .profile-hero-info { flex: 1; min-width: 0; padding-top: 42px; }
  .profile-hero-name { font-size: 20px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 5px; }
  .profile-hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .profile-hero-user {
    font-size: 12px; color: var(--text-2); font-family: 'Menlo','Monaco','Courier New',monospace;
    background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px;
  }

  /* ── Two-column layout ── */
  .profile-columns { display: flex; gap: 20px; padding: 0 24px; align-items: flex-start; }
  .profile-col-left { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
  .profile-col-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

  /* ── Account-info card (left) ── */
  .profile-info-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 18px 16px; display: flex; flex-direction: column; gap: 0;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
  }
  .profile-info-card-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-3); margin-bottom: 14px;
  }
  .profile-info-row { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
  .profile-info-label { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
  .profile-info-val { font-size: 13px; font-weight: 600; color: var(--text); }
  .profile-info-sep { border: none; border-top: 1px solid var(--border); margin: 8px 0 14px; }

  /* ── Sections (right) ── */
  .profile-section {
    background: var(--surface); border-radius: 16px; border: 1px solid var(--border);
    overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05);
  }
  .profile-section-hd {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
  }
  .profile-section-hd-icon {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-lt); color: var(--accent); flex-shrink: 0;
  }
  .profile-section-hd-title { font-size: 13.5px; font-weight: 700; color: var(--text); flex: 1; }
  .profile-section-hd-sub   { font-size: 11px; color: var(--text-3); margin-top: 1px; }
  .profile-section-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
  .profile-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .profile-form-row { display: flex; flex-direction: column; gap: 5px; }
  .profile-form-row label {
    font-size: 11px; font-weight: 700; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .5px;
  }
  .profile-form-row input {
    width: 100%; padding: 10px 13px; box-sizing: border-box;
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: 10px; color: var(--text); font-size: 13.5px;
    outline: none; transition: border-color .15s; font-family: inherit;
  }
  .profile-form-row input:focus { border-color: var(--accent); }
  .profile-form-row input[readonly] { opacity: .5; cursor: not-allowed; }
  .profile-mail-status { display:flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc;color:#64748b;font-size:12.5px;font-weight:500; }
  .profile-mail-status-dot { width:9px;height:9px;border-radius:999px;background:#cbd5e1;box-shadow:0 0 0 4px rgba(148,163,184,.14); }
  .profile-mail-status.is-ready { background:#f0fdf4;border-color:#bbf7d0;color:#166534; }
  .profile-mail-status.is-ready .profile-mail-status-dot { background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.14); }
  .profile-mail-mode { display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:4px;background:#f1f5f9;border-radius:12px; }
  .profile-mail-mode-btn { height:38px;border:0;border-radius:9px;background:transparent;color:#475569;font-family:inherit;font-size:12.5px;font-weight:500;cursor:pointer;transition:background .14s,color .14s,box-shadow .14s; }
  .profile-mail-mode-btn:hover { background:rgba(255,255,255,.72);color:#0f172a; }
  .profile-mail-mode-btn.active { background:#fff;color:#0f172a;box-shadow:0 1px 4px rgba(15,23,42,.08); }
  .profile-mail-panel { display:flex;flex-direction:column;gap:12px; }
  .profile-mail-check { display:flex;align-items:center;gap:8px;color:#475569;font-size:12.5px;font-weight:500; }
  .profile-mail-check input { width:16px;height:16px;accent-color:#0A938C; }
  .profile-mail-m365-card { display:flex;align-items:center;gap:12px;padding:13px;border:1px solid #dbeafe;border-radius:12px;background:linear-gradient(135deg,#eff6ff,#f8fafc); }
  .profile-mail-m365-mark { width:42px;height:42px;border-radius:12px;background:#2563eb;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;letter-spacing:.02em;flex:0 0 auto; }
  .profile-mail-m365-copy { min-width:0; }
  .profile-mail-m365-title { font-size:13px;font-weight:600;color:#0f172a; }
  .profile-mail-m365-sub { margin-top:2px;font-size:12px;color:#64748b;line-height:1.35; }
  .profile-mail-actions { display:flex;align-items:center;gap:8px;justify-content:flex-start; }
  .profile-mail-secondary,.profile-mail-danger { height:34px;border:0;border-radius:9px;padding:0 13px;font-family:inherit;font-size:12.5px;font-weight:500;cursor:pointer;transition:background .14s,color .14s; }
  .profile-mail-secondary { background:#0f172a;color:#fff; }
  .profile-mail-secondary:hover { background:#111827; }
  .profile-mail-danger { background:#fef2f2;color:#dc2626; }
  .profile-mail-danger:hover { background:#fee2e2; }
  .profile-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
  .btn-profile-save {
    padding: 9px 22px; background: linear-gradient(135deg,#6ed2c8,#0A938C);
    color: white; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: opacity .15s; box-shadow: 0 3px 10px rgba(110,207,202,.4);
  }
  .btn-profile-save:hover { opacity: .88; }
  .btn-profile-save.saved { background: linear-gradient(135deg,#16a34a,#15803d); box-shadow: 0 3px 10px rgba(22,163,74,.3); }
  .profile-msg { font-size: 12.5px; padding: 9px 13px; border-radius: 9px; display: none; font-weight: 500; }
  .profile-msg.ok  { display: flex; align-items: center; gap: 7px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
  .profile-msg.err { display: flex; align-items: center; gap: 7px; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }

  /* ── Collapsible password section ── */
  .profile-collapse-hd {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 20px;
    background: none; border: none; cursor: pointer; font-family: inherit; text-align: left;
    color: var(--text); transition: background .12s;
  }
  .profile-collapse-hd:hover { background: var(--surface-2); }
  .profile-collapse-chevron { margin-left: auto; color: var(--text-3); transition: transform .2s; flex-shrink: 0; }
  .profile-collapse-hd.open .profile-collapse-chevron { transform: rotate(180deg); }
  .profile-collapse-body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--border); padding-top: 16px; }

  /* ── Logout button ── */
  .btn-logout-full {
    width: 100%; padding: 9px 0; background: none; color: #dc2626;
    border: 1.5px solid #fecaca; border-radius: 10px; font-size: 13px;
    font-weight: 600; cursor: pointer; font-family: inherit;
    transition: background .15s, border-color .15s; margin-top: 4px;
  }
  .btn-logout-full:hover { background: #fef2f2; border-color: #f87171; }

  .profile-view-inner--account {
    max-width: none;
    width: 100%;
    padding: 34px 28px 56px;
    gap: 18px;
  }
  .profile-identity-card {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background:
      radial-gradient(circle at 18% 12%, rgba(255,255,255,.5), transparent 28%),
      linear-gradient(135deg, rgba(110,210,200,.96) 0%, rgba(10,147,140,.92) 48%, rgba(232,127,176,.88) 100%);
    border: 1px solid rgba(255,255,255,.64);
    border-radius: 18px;
    padding: 30px 24px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(10,147,140,.18);
  }
  .profile-identity-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 17px;
    background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0));
    pointer-events: none;
  }
  .profile-identity-card > * {
    position: relative;
    z-index: 1;
  }
  .profile-identity-avatar {
    width: 108px;
    height: 108px;
    font-size: 34px;
    border: 0;
    box-shadow: 0 12px 28px rgba(15,23,42,.18), inset 0 0 0 2px rgba(255,255,255,.42);
  }
  .profile-identity-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
  }
  .profile-identity-name {
    color: #fff;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.01em;
    text-shadow: 0 1px 2px rgba(15,23,42,.16);
  }
  .profile-identity-since {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 10px;
    color: rgba(255,255,255,.78);
    font-size: 13px;
  }
  .profile-identity-since svg {
    color: rgba(255,255,255,.88);
  }
  .profile-identity-since strong {
    color: rgba(255,255,255,.9);
    font-weight: 500;
  }
  .profile-info-wide-card {
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15,23,42,.045);
  }
  .profile-info-wide-title {
    padding: 18px 22px 15px;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
  }
  .profile-info-wide-divider {
    height: 1px;
    background: #e2e8f0;
    width: 100%;
  }
  .profile-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 4px 0;
  }
  .profile-info-tile {
    min-height: 90px;
    padding: 18px 22px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
  }
  .profile-info-tile:nth-child(3n) {
    border-right: 0;
  }
  .profile-info-tile:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  .profile-info-tile--wide {
    grid-column: span 2;
  }
  .profile-info-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0A938C;
    background: linear-gradient(135deg, rgba(110,210,200,.18), rgba(232,127,176,.14));
  }
  .profile-info-tile-copy {
    min-width: 0;
  }
  .profile-info-tile-key {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.2;
  }
  .profile-info-tile-value {
    color: #0f172a;
    font-size: 14.5px;
    line-height: 1.3;
    margin-top: 6px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .profile-info-mail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-top: 6px;
  }
  .profile-info-mail-row .profile-info-tile-value {
    margin-top: 0;
  }
  .profile-info-mail-value.is-connected {
    color: #2563eb;
  }
  .profile-info-mail-disconnect {
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: #eef2ff;
    color: #2563eb;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s, color .14s;
    flex: 0 0 auto;
  }
  .profile-info-mail-disconnect:hover {
    background: #dbeafe;
    color: #1d4ed8;
  }
  .profile-m365-connect-card {
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid rgba(37,99,235,.14);
    background:
      radial-gradient(circle at 12% 16%, rgba(255,255,255,.86), transparent 30%),
      linear-gradient(135deg, #fff7ed 0%, #eff6ff 48%, #f8fafc 100%);
    box-shadow: 0 18px 40px rgba(15,23,42,.08);
  }
  .profile-m365-connect-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(226,232,240,.9);
    box-shadow: 0 10px 24px rgba(15,23,42,.1);
  }
  .profile-m365-logo {
    width: 30px;
    height: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
  }
  .profile-m365-logo span {
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
  }
  .profile-m365-logo span:nth-child(1) { background:#f25022; }
  .profile-m365-logo span:nth-child(2) { background:#7fba00; }
  .profile-m365-logo span:nth-child(3) { background:#00a4ef; }
  .profile-m365-logo span:nth-child(4) { background:#ffb900; }
  .profile-m365-connect-copy {
    flex: 1;
    min-width: 0;
  }
  .profile-m365-connect-title {
    color: #0f172a;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .profile-m365-title-warning {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#facc15,#f59e0b);
    color: #78350f;
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 6px 14px rgba(146,64,14,.16);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
  }
  .profile-m365-connect-sub {
    color: #475569;
    font-size: 13.5px;
    line-height: 1.35;
    margin-top: 3px;
  }
  .profile-m365-connect-btn {
    height: 58px;
    padding: 0 24px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37,99,235,.18);
    transition: filter .14s, transform .12s, box-shadow .14s;
    flex: 0 0 auto;
    margin-left: auto;
  }
  .profile-m365-connect-btn:hover {
    filter: brightness(.96);
    box-shadow: 0 12px 24px rgba(37,99,235,.24);
  }
  .profile-m365-connect-btn:active {
    transform: translateY(1px);
  }
  @media (max-width: 860px) {
    .profile-view-inner--account { padding: 24px 16px 42px; }
    .profile-info-grid { grid-template-columns: 1fr; }
    .profile-info-tile,
    .profile-info-tile:nth-child(3n),
    .profile-info-tile:nth-last-child(-n+2) {
      border-right: 0;
      border-bottom: 1px solid #eef2f7;
    }
    .profile-info-tile:last-child { border-bottom: 0; }
    .profile-info-tile--wide { grid-column: auto; }
    .profile-m365-connect-card {
      align-items: flex-start;
      flex-wrap: wrap;
    }
    .profile-m365-connect-btn {
      width: 100%;
      height: 48px;
    }
  }

  /* ── Settings section headers ── */
  .s-section-hd {
    font-size: 9.5px; font-weight: 800; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.9px;
    display: flex; align-items: center; gap: 8px;
    margin: 6px 0 4px; padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .s-section-hd:first-child { border-top: none; padding-top: 0; margin-top: 0; }
  .s-section-hd::after { content: ''; flex: 1; height: 1px; background: var(--border); }

  /* ── Upload Widget ── */
  .upload-widget {
    background: var(--surface); border: 2px dashed var(--border); border-radius: 16px;
    padding: 28px 24px; margin: 8px 0; display: flex; flex-direction: column;
    align-items: center; gap: 14px; transition: border-color .2s, background .2s;
  }
  .upload-widget.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
  .upload-widget-icon { color: var(--text-3); }
  .upload-widget-title { font-size: 14px; font-weight: 600; color: var(--text); }
  .upload-widget-hint { font-size: 12.5px; color: var(--text-2); text-align: center; }
  .upload-widget-file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .upload-widget-url-or {
    width: min(100%, 420px); display: flex; align-items: center; gap: 10px;
    color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em;
  }
  .upload-widget-url-or::before,
  .upload-widget-url-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
  .upload-widget-url-row { width: min(100%, 460px); display: flex; justify-content: center; }
  .upload-widget-url {
    width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text); padding: 10px 12px;
    font: inherit; font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
  }
  .upload-widget-url:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
  }
  .upload-widget-btn {
    padding: 8px 16px; background: var(--surface-2); color: var(--text-2);
    border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px;
    font-family: inherit; cursor: pointer; transition: all .15s;
  }
  .upload-widget-btn:hover { border-color: var(--accent); color: var(--accent); }
  .upload-widget-selected {
    display: none; align-items: center; gap: 8px; padding: 7px 13px;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-radius: 10px; font-size: 12.5px; color: var(--text); max-width: 320px;
  }
  .upload-widget-selected.show { display: flex; }
  .upload-widget-selected-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .upload-widget-clear { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 0; line-height: 1; flex-shrink: 0; }
  .upload-widget-clear:hover { color: #dc2626; }
  .upload-widget-start {
    padding: 10px 26px; background: var(--accent); color: white; border: none;
    border-radius: 12px; font-size: 13.5px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: opacity .15s, transform .1s; display: none;
  }
  .upload-widget-start.show { display: block; }
  .upload-widget-start:hover { opacity: .9; }
  .upload-widget-start:active { transform: scale(.97); }
  .upload-widget-start:disabled { opacity: .5; cursor: not-allowed; }
  .upload-widget-error { font-size: 12.5px; color: #dc2626; display: none; }
  .upload-widget-error.show { display: block; }

  /* ══ Documents View ══ */
  #docs-view {
    flex: 1; overflow-y: auto; display: none; flex-direction: column;
  }
  #docs-view.active { display: flex; }
  .docs-view-inner { width: 100%; padding: 20px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
  .docs-view-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 0 0 0 0;
  }
  .docs-view-title { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); }
  .docs-view-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }
  .docs-search-bar {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: border-color .15s;
  }
  .docs-search-bar:focus-within { border-color: var(--accent); }
  .docs-search-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
  .docs-search-wrap svg { color: var(--text-3); flex-shrink: 0; }
  .docs-search-wrap input { flex: 1; border: none; background: transparent; color: var(--text); font-size: 13px; outline: none; }
  #docs-view .docs-search-bar { margin:0;padding:0;background:transparent;border:none;box-shadow:none; }
  #docs-view .docs-search-wrap { min-height:44px;width:50%;max-width:520px;min-width:260px;flex:0 1 520px;border:1px solid var(--border);border-radius:18px;background:#fff;padding:0 14px;box-shadow:0 1px 3px rgba(15,23,42,.03); }
  #docs-view .docs-section-icon { display:none; }
  #docs-view .docs-section-sub { margin:1px 0 12px 0;line-height:1.28; }
  #docs-view .docs-section-wrap { min-height:310px; }
  #docs-view .docs-grid { grid-template-columns:repeat(auto-fill,minmax(178px,1fr));gap:14px;min-height:210px;align-content:start; }
  .docs-search-wrap input::placeholder { color: var(--text-3); }
  .docs-view-count { font-size: 12.5px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
  .btn-docs-upload {
    display: flex; align-items: center; gap: 8px; padding: 10px 22px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8); color: white; border: none; border-radius: 12px;
    font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: opacity .15s, transform .1s, box-shadow .15s; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37,99,235,.28);
  }
  .btn-docs-upload:hover { opacity: .9; box-shadow: 0 6px 20px rgba(37,99,235,.38); }
  .btn-docs-upload:active { transform: scale(.97); }
  .btn-docs-confirm-upload {
    width: 100%; margin-top: 14px; padding: 11px; background: linear-gradient(135deg,var(--accent),#1d4ed8); color: #fff;
    border: none; border-radius: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px; transition: opacity .15s;
    box-shadow: 0 3px 10px rgba(37,99,235,.22);
  }
  .btn-docs-confirm-upload:hover { opacity: .88; }
  .btn-docs-confirm-upload:disabled { opacity: .5; cursor: default; }

  .docs-dropzone {
    border: 2px dashed var(--border); border-radius: 18px; padding: 36px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    transition: border-color .2s, background .2s; cursor: pointer;
    background: var(--surface);
  }
  .docs-dropzone:hover, .docs-dropzone.drag-over {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  }
  .docs-dropzone-icon { color: var(--text-3); opacity: .7; }
  .docs-dropzone-title { font-size: 15px; font-weight: 600; color: var(--text); }
  .docs-dropzone-hint { font-size: 13px; color: var(--text-3); }
  .docs-dropzone-btn {
    margin-top: 4px; padding: 8px 20px; background: var(--surface-2);
    border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px;
    font-weight: 600; color: var(--text-2); font-family: inherit; cursor: pointer;
    transition: all .15s;
  }
  .docs-dropzone-btn:hover { border-color: var(--accent); color: var(--accent); }
  .docs-uploading-bar {
    display: none; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2);
  }
  .docs-uploading-bar.show { display: flex; }

  .docs-section-wrap {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    padding: 20px 22px; box-shadow: 0 2px 10px rgba(0,0,0,.04);
    position: relative;
    transition: border-color .16s, background .16s, box-shadow .16s;
  }
  .docs-section-wrap.drag-upload-over {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    box-shadow: 0 10px 28px rgba(37,99,235,.12);
  }
  .docs-section-wrap.drag-upload-over::after {
    content: "Dateien hier ablegen";
    position: absolute;
    inset: 10px;
    border: 1.5px dashed var(--accent);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 20;
  }
  .docs-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
  .docs-section-icon {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
    color: var(--accent);
  }
  .docs-section-title { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.1px; }
  .docs-section-sub { font-size: 12px; color: var(--text-3); margin: 6px 0 16px 42px; line-height: 1.5; }
  .docs-section-badge {
    margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 9px;
    border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-3);
  }
  .docs-subsection-label {
    font-size: 12px; font-weight: 600; color: var(--text-2);
    display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
    padding: 6px 10px; background: var(--surface-2); border-radius: 8px;
    border-left: 3px solid var(--accent);
  }
  .docs-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 14px;
  }
  /* Doc card */
  .doc-card {
    background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px;
    overflow: visible; cursor: pointer; transition: border-color .18s, box-shadow .18s, transform .14s;
    display: flex; flex-direction: column; position: relative;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
  }
  .doc-card:hover {
    border-color: var(--accent); box-shadow: 0 8px 28px rgba(37,99,235,.13), 0 2px 8px rgba(0,0,0,.06);
    transform: translateY(-3px);
  }
  /* doc-card-preview: visual content area */
  .doc-card-preview {
    height: 126px; position: relative;
    border-radius: 14px 14px 0 0; overflow: hidden;
    background: var(--surface-2);
  }
  /* SVG content preview fills the whole area */
  .doc-card-preview svg.doc-preview-svg {
    width: 100%; height: 100%; display: block;
  }
  .doc-card-type {
    position: absolute; bottom: 8px; right: 8px; font-size: 9px; font-weight: 800;
    letter-spacing: .5px; padding: 3px 7px; border-radius: 6px; text-transform: uppercase;
    backdrop-filter: blur(6px); box-shadow: 0 1px 4px rgba(0,0,0,.1);
  }
  .doc-card-type.pdf  { background: rgba(254,226,226,.92); color: #dc2626; }
  .doc-card-type.txt  { background: rgba(224,242,254,.92); color: #0284c7; }
  .doc-card-type.md   { background: rgba(243,232,255,.92); color: #7c3aed; }
  .doc-card-type.docx { background: rgba(219,234,254,.92); color: #1d4ed8; }
  .doc-card-type.other { background: rgba(241,245,249,.92); color: var(--text-2); }
  .doc-global-badge {
    position: absolute; top: 8px; left: 8px; font-size: 9px; font-weight: 700;
    letter-spacing: .4px; padding: 3px 7px; border-radius: 6px; text-transform: uppercase;
    background: linear-gradient(135deg,#d1fae5,#a7f3d0); color: #065f46;
    display: flex; align-items: center; gap: 4px;
    backdrop-filter: blur(4px); box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }
  .doc-rag-badge {
    position: absolute; top: 8px; left: 8px; font-size: 9px; font-weight: 700;
    letter-spacing: .4px; padding: 3px 7px; border-radius: 6px; text-transform: uppercase;
    background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #1e40af;
    display: flex; align-items: center; gap: 4px;
    backdrop-filter: blur(4px); box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }
  .doc-global-badge { top: 34px !important; }
  .doc-global-uploader { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
  .doc-card-body { padding: 11px 12px 13px; flex: 1; display: flex; flex-direction: column; gap: 0; position: relative; }
  .doc-card-toprow { margin-bottom: 7px; }
  .doc-card-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
  .doc-card-menu-btn {
    position: absolute; top: 8px; right: 8px; z-index: 10;
    background: rgba(255,255,255,.9); border: none; cursor: pointer;
    padding: 3px 7px; border-radius: 7px; backdrop-filter: blur(6px);
    color: var(--text-2); font-size: 17px; line-height: 1; writing-mode: vertical-rl;
    transition: background .12s, color .12s, box-shadow .12s; font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
  }
  .doc-card-menu-btn:hover { background: rgba(255,255,255,1); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.14); }
  .doc-card-dropdown {
    display: none; position: absolute; right: 8px; top: 8px; z-index: 200;
    background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
    box-shadow: 0 12px 32px rgba(0,0,0,.16); min-width: 162px; overflow: hidden;
  }
  .doc-card-dropdown.open { display: block; }
  .doc-card-dropdown button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px;
    background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 500;
    font-family: inherit; color: var(--text); text-align: left; transition: background .1s;
  }
  .doc-card-dropdown button:hover { background: var(--surface-2); }
  .doc-card-dropdown button.del { color: #dc2626; }
  .doc-card-dropdown button.del:hover { background: #fef2f2; }
  .doc-card-dropdown hr { margin: 4px 0; border: none; border-top: 1px solid var(--border); }
  .doc-card-kvs { display: flex; flex-direction: column; gap: 4px; }
  .doc-card-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .doc-kv-label { font-size: 10.5px; color: var(--text-3); font-weight: 500; white-space: nowrap; }
  .doc-kv-val { font-size: 11px; color: var(--text-2); font-weight: 500; text-align: right; }
  /* ── Inline document list widget (chat) ── */
  .doc-list-widget { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .doc-list-widget-hd { font-size: 13px; font-weight: 500; color: var(--text-2); padding: 0 2px 2px; line-height: 1.5; }
  .doc-list-widget-empty { font-size: 13px; color: var(--text-3); padding: 12px 0; }
  .doc-list-widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .doc-list-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; overflow: visible; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .12s, transform .1s; }
  .doc-list-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.09); transform: translateY(-2px); }
  .doc-list-card-preview { height: 80px; display: flex; align-items: center; justify-content: center; border-radius: 12px 12px 0 0; overflow: hidden; position: relative; }
  .doc-list-card-body { padding: 9px 10px 11px; display: flex; flex-direction: column; }
  .doc-list-card-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
  .doc-list-widget-footer { padding-top: 4px; }
  .doc-list-all-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent); font-family: inherit; padding: 4px 2px; border-radius: 6px; transition: opacity .15s; }
  .doc-list-all-btn:hover { opacity: .75; }
  .av-report-list-item { display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:10px;margin-bottom:8px;background:var(--surface);position:relative; }
  .av-report-list-icon { color:var(--accent);flex-shrink:0;margin-top:2px; }
  .av-report-list-body { flex:1;min-width:0; }
  .av-report-list-name { font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text); }
  .av-report-list-meta { font-size:11.5px;color:var(--text-2);margin-top:3px; }
  .av-report-list-actions { margin-top:8px;display:flex;gap:8px; }
  .av-report-list-del { background:none;border:none;cursor:pointer;color:var(--text-3);padding:4px;border-radius:4px;position:absolute;top:10px;right:10px;opacity:0;transition:opacity .15s; }
  .av-report-list-item:hover .av-report-list-del { opacity:1; }
  .av-report-list-del:hover { color:#ef4444; }
  .docs-empty-state {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 48px 0; color: var(--text-3); text-align: center;
  }
  .docs-empty-state-icon { opacity: .3; }
  .docs-empty-state-text { font-size: 14px; font-weight: 500; }
  .docs-empty-state-sub { font-size: 13px; }

  /* ── PDF Viewer Modal ── */
  #doc-viewer-modal {
    display: none; position: fixed; inset: 0; z-index: 5000;
    background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  }
  #doc-viewer-modal.open { display: flex; align-items: stretch; justify-content: center; }
  .doc-viewer-inner {
    display: flex; flex-direction: column; width: 100%; max-width: 1100px;
    margin: 20px; background: var(--surface); border-radius: 18px; overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
  }
  .doc-viewer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .doc-viewer-title { font-size: 14px; font-weight: 700; color: var(--text); }
  .doc-viewer-close {
    width: 30px; height: 30px; background: var(--surface-2); border: none;
    border-radius: 8px; cursor: pointer; color: var(--text-2); display: flex;
    align-items: center; justify-content: center; transition: background .12s;
  }
  .doc-viewer-close:hover { background: var(--border); color: var(--text); }
  #doc-viewer-frame { flex: 1; border: none; min-height: 0; }
  #doc-viewer-text {
    display: none; flex: 1; overflow-y: auto; padding: 28px 32px;
    background: var(--surface); min-height: 0;
  }
  #doc-viewer-text pre {
    font-family: 'Inter', system-ui, sans-serif; font-size: 13.5px;
    line-height: 1.75; color: var(--text); white-space: pre-wrap;
    word-break: break-word; margin: 0;
  }

  /* ── Intent Prompt Card ── */
  .intent-prompt-card {
    background: var(--surface-2); border: 1.5px solid var(--border);
    border-radius: 12px; overflow: hidden;
  }
  .intent-prompt-card-hd {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    background: var(--surface);
  }
  .intent-prompt-card-icon {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    color: var(--accent); display: flex; align-items: center; justify-content: center;
  }
  .intent-prompt-card-title { font-size: 12px; font-weight: 700; color: var(--text); flex: 1; }
  .intent-prompt-card-id { font-size: 10px; color: var(--accent); font-family: monospace; font-weight: 600; }
  .btn-intent-edit {
    width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
    background: none; cursor: pointer; color: var(--text-2); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s, border-color .12s;
  }
  .btn-intent-edit:hover { background: var(--accent-lt); color: var(--accent); border-color: var(--accent); }
  .intent-prompt-card-preview {
    padding: 9px 12px; font-size: 10.5px; color: var(--text-3);
    font-family: 'Menlo','Monaco','Courier New',monospace;
    line-height: 1.55; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100%;
  }

  /* ── Prompt modal upload toggle ── */
  .prompt-upload-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0 4px; }
  .prompt-upload-toggle input[type=checkbox] { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
  .prompt-upload-toggle label { font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.5; }
  .prompt-upload-hint {
    display: none; font-size: 12px; color: var(--text-2); background: var(--surface-2);
    border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
    padding: 10px 12px; line-height: 1.6; margin-bottom: 8px;
  }
  .prompt-upload-hint.show { display: block; }
  .prompt-upload-hint code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; font-family: monospace; }

  /* ── AV Report Widget ── */
  .av-report-widget {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px 18px;
    max-width: 360px;
    display: flex; flex-direction: column; gap: 4px;
  }
  .av-report-widget-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
  }
  .av-report-widget-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg,#16a34a22,#16a34a44);
    color: #16a34a; font-size: 20px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .av-report-widget-title { font-size: 15px; font-weight: 700; color: var(--text); }
  .av-report-widget-score { font-size: 12.5px; color: var(--text-2); margin-top: 1px; overflow-wrap: anywhere; word-break: break-all; }
  .av-report-score-bar {
    height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 14px;
  }
  .av-report-score-fill { height: 100%; border-radius: 99px; background: #16a34a; transition: width .5s ease; }
  .av-widget-btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .btn-add-to-docs { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer;
    background: var(--surface-2); color: var(--text-2); border: 1.5px solid var(--border);
    transition: background .15s, color .15s, border-color .15s; }
  .btn-add-to-docs:hover:not(:disabled) { background: var(--accent-lt); color: var(--accent); border-color: var(--accent); }
  .btn-add-to-docs.saved { color: #059669; border-color: #059669; background: #f0fdf4; cursor: default; }
  .btn-add-to-docs:disabled { opacity: .7; cursor: default; }
  .btn-download-report {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent); color: #fff; border: none; border-radius: 9px;
    padding: 10px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer;
    width: 100%; transition: background .15s;
  }
  .btn-download-report:hover { filter: brightness(1.1); }
  .av-analyse-loading {
    display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px;
    padding: 14px 18px;
  }
  .av-analyse-loading-spinner {
    width: 18px; height: 18px; border: 2.5px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin .8s linear infinite; flex-shrink: 0;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ════════════════════════════════════
     FEEDBACK / RLHF KANBAN BOARD
  ════════════════════════════════════ */
  #feedback-view {
    display: none; flex-direction: column; height: 100%; overflow: hidden;
  }
  #feedback-view.active { display: flex; }

  .feedback-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 28px 0; flex-shrink: 0; gap: 12px;
  }
  .feedback-topbar-title { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
  .feedback-topbar-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
  .btn-feedback-create {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: 11px; border: none; cursor: pointer;
    background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff;
    font-size: 13px; font-weight: 600; font-family: inherit;
    box-shadow: 0 4px 14px rgba(37,99,235,.28); transition: opacity .15s, transform .1s, background .2s;
    white-space: nowrap; flex-shrink: 0;
  }
  .btn-feedback-create:hover { opacity: .88; }
  .btn-feedback-create:active { transform: scale(.97); }
  .btn-feedback-create:disabled {
    background: var(--surface-2); color: var(--text-3); box-shadow: none; cursor: not-allowed; opacity: 1;
  }
  /* Auswertung collapsible */
  .fb-auswertung {
    margin: 12px 28px 0; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--surface);
    overflow: hidden; flex-shrink: 0;
  }
  .fb-auswertung-header {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; cursor: pointer; user-select: none;
    transition: background .15s;
  }
  .fb-auswertung-header:hover { background: var(--surface-2); }
  .fb-auswertung-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 700; color: var(--text); flex-shrink: 0;
  }
  .fb-auswertung-summary { flex: 1; font-size: 12px; color: var(--text-2); }
  .fb-auswertung-chevron {
    font-size: 10px; color: var(--text-3);
    transition: transform .2s; flex-shrink: 0;
  }
  .fb-auswertung.open .fb-auswertung-chevron { transform: rotate(180deg); }
  .fb-auswertung-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
  /* Auswertung controls */
  .fb-aus-controls { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .fb-aus-controls-left { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; align-items: center; }
  .fb-aus-controls-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
  .fb-aus-sort-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); white-space: nowrap; }
  .fb-aus-sort-pill {
    padding: 4px 11px; border-radius: 99px;
    border: 1.5px solid var(--border);
    background: var(--surface-2); color: var(--text-2);
    font-size: 11.5px; font-weight: 600; cursor: pointer;
    transition: all .15s; white-space: nowrap;
  }
  .fb-aus-sort-pill:hover { border-color: var(--accent); color: var(--accent); }
  .fb-aus-sort-pill.active { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); }
  .fb-aus-model-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 99px;
    border: 1.5px solid var(--border);
    background: var(--surface-2); color: var(--text-2);
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: all .15s; max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fb-aus-model-chip:hover { border-color: var(--accent); color: var(--accent); }
  .fb-aus-model-chip.active { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); }
  .fb-aus-filter-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
  /* Groups grid */
  #fb-auswertung-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
  /* Group block */
  .fb-aus-group {
    background: var(--surface-2); border-radius: 12px;
    padding: 14px 16px; border: 1.5px solid var(--border);
    display: flex; flex-direction: column; gap: 10px;
  }
  .fb-aus-group-hd {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; color: var(--text);
    min-width: 0;
  }
  .fb-aus-group-hd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fb-aus-group-count {
    flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 2px 7px;
    border-radius: 99px; background: var(--accent-lt); color: var(--accent); margin-left: auto;
  }
  /* Score bars */
  .fb-aus-score-list { display: flex; flex-direction: column; gap: 7px; }
  .fb-aus-score-row { display: flex; align-items: center; gap: 8px; }
  .fb-aus-score-label { font-size: 11.5px; color: var(--text-2); width: 122px; flex-shrink: 0; }
  .fb-aus-score-bar-bg { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
  .fb-aus-score-bar-fill { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.4,0,.2,1); }
  .fb-aus-score-val { font-size: 12px; font-weight: 700; width: 36px; text-align: right; flex-shrink: 0; }
  /* Overall row */
  .fb-aus-overall {
    display: flex; align-items: center; gap: 8px;
    padding-top: 8px; border-top: 1px solid var(--border);
  }
  .fb-aus-overall-label { font-size: 11px; color: var(--text-3); flex: 1; }
  .fb-aus-overall-val { font-size: 22px; font-weight: 800; line-height: 1; }
  .fb-aus-overall-count { font-size: 11px; color: var(--text-3); }
  /* Pending (< 5 ratings) placeholder */
  .fb-aus-pending {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 18px 10px; text-align: center;
  }
  .fb-aus-pending-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-3, rgba(99,102,241,.08));
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
  }
  .fb-aus-pending-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
  .fb-aus-pending-sub { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
  .fb-aus-pending-track {
    width: 100%; height: 6px; border-radius: 99px;
    background: var(--border); overflow: hidden; margin-top: 2px;
  }
  .fb-aus-pending-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, transparent) 100%);
    transition: width .6s cubic-bezier(.4,0,.2,1);
  }
  .fb-aus-pending-steps {
    display: flex; gap: 4px; align-items: center; font-size: 11px; color: var(--text-3); font-weight: 600;
  }
  .fb-aus-pending-step {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--border); transition: background .3s;
    flex-shrink: 0;
  }
  .fb-aus-pending-step.done { background: var(--accent); }
  /* Sort admin hint badge */
  .fb-sort-admin-hint {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 600; color: var(--accent);
    background: var(--accent-lt); border-radius: 99px;
    padding: 2px 7px; white-space: nowrap; letter-spacing: .1px;
  }
  .fb-sort-admin-hint svg { flex-shrink: 0; }
  .fb-sort-section {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .fb-sort-label-wrap {
    display: flex; flex-direction: column; gap: 3px;
  }
  .fb-sort-pills { display: flex; gap: 5px; align-items: center; }
  /* Model filter dropdown */
  .fb-topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .fb-model-dd-wrap { position: relative; }
  .fb-model-dd-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text-2); font-size: 13px; font-weight: 600;
    font-family: inherit; cursor: pointer; white-space: nowrap;
    transition: border-color .15s, color .15s, background .15s;
  }
  .fb-model-dd-btn:hover { border-color: var(--accent); color: var(--accent); }
  .fb-model-dd-btn.active { border-color: var(--accent); background: var(--accent-lt); color: var(--accent); }
  .fb-model-dd-panel {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    width: 340px; background: var(--surface);
    border: 1.5px solid var(--border); border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14); z-index: 600;
    overflow: hidden;
  }
  .fb-model-dd-panel.open { display: block; }
  .fb-model-dd-inner { max-height: 420px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
  .fb-model-dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    border: 1.5px solid transparent; transition: background .12s, border-color .12s;
  }
  .fb-model-dd-item:hover { background: var(--surface-2); }
  .fb-model-dd-item.active { background: var(--accent-lt); border-color: rgba(37,99,235,.25); }
  .fb-model-dd-check {
    width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: transparent; transition: border-color .12s, background .12s, color .12s;
  }
  .fb-model-dd-item.active .fb-model-dd-check { border-color: var(--accent); background: var(--accent); color: #fff; }
  .fb-model-dd-info { flex: 1; min-width: 0; }
  .fb-model-dd-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fb-model-dd-item.active .fb-model-dd-name { color: var(--accent); }
  .fb-model-dd-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .fb-model-dd-score {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700; padding: 2px 7px;
    border-radius: 99px;
  }
  .fb-model-dd-score.good { background: #dcfce7; color: #16a34a; }
  .fb-model-dd-score.mid  { background: #fef9c3; color: #a16207; }
  .fb-model-dd-score.bad  { background: #fee2e2; color: #dc2626; }
  .fb-model-dd-score.none { background: var(--surface-2); color: var(--text-3); }
  .fb-model-dd-divider { height: 1px; background: var(--border); margin: 4px 0; }

  /* Board filter bar */
  .fb-filter-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 28px 0; flex-shrink: 0;
  }
  .fb-filter-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-3);
  }
  .fb-filter-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--border);
    background: var(--surface-2); color: var(--text-2);
    font-size: 12px; font-weight: 600; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    user-select: none;
  }
  .fb-filter-toggle:hover { border-color: var(--accent); color: var(--accent); }
  .fb-filter-toggle.active {
    border-color: var(--accent); background: var(--accent-lt); color: var(--accent);
  }
  .fb-filter-toggle svg { flex-shrink: 0; }
  /* Return banner in detail view */
  .fb-return-banner {
    display: flex; gap: 12px; padding: 14px 16px;
    background: linear-gradient(135deg,#fffbeb,#fef3c7);
    border: 1.5px solid #f59e0b; border-radius: 14px;
    margin-bottom: 2px;
  }
  .fb-return-banner-icon {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: #f59e0b; color: white;
    display: flex; align-items: center; justify-content: center;
  }
  .fb-return-banner-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .fb-return-banner-title { font-size: 13px; font-weight: 700; color: #92400e; }
  .fb-return-banner-comment {
    font-size: 13px; color: #78350f; line-height: 1.5;
    background: rgba(255,255,255,.6); border-radius: 8px;
    padding: 8px 10px; border-left: 3px solid #f59e0b;
    font-style: italic;
  }
  .fb-return-banner-hint { font-size: 11.5px; color: #a16207; font-weight: 500; }
  /* Return note inline field in detail */
  .fb-return-note-inline {
    border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 6px;
  }
  .fb-return-note-inline textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid #f59e0b; border-radius: 10px;
    background: #fffbeb; color: var(--text); font-size: 13px; font-family: inherit;
    outline: none; resize: vertical; min-height: 72px; line-height: 1.5;
    transition: border-color .15s; box-sizing: border-box;
  }
  .fb-return-note-inline textarea:focus { border-color: #d97706; background: #fef3c7; }
  .fb-return-note-err { font-size: 12px; color: #dc2626; display: none; }
  .fb-return-note-err.show { display: block; }

  .kanban-board {
    display: flex; gap: 16px; padding: 20px 0 28px 28px;
    overflow-x: auto; overflow-y: hidden; flex: 1; min-height: 0;
    align-items: stretch;
  }
  .kanban-col:last-child { margin-right: 28px; }
  .kanban-board::-webkit-scrollbar { height: 6px; }
  .kanban-board::-webkit-scrollbar-track { background: transparent; }
  .kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

  .kanban-col {
    flex: 1 1 0; min-width: 220px; display: flex; flex-direction: column;
    background: var(--surface-2); border-radius: 16px; overflow: hidden;
    border: 1px solid var(--border); min-height: 120px;
    max-height: 100%;
  }
  .kanban-col-header {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 14px 12px; flex-shrink: 0;
  }
  .kanban-col-dot {
    width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  }
  .kanban-col-dot.todo     { background: #94a3b8; }
  .kanban-col-dot.progress { background: #f59e0b; }
  .kanban-col-dot.review   { background: #8b5cf6; }
  .kanban-col-dot.done     { background: #10b981; }

  .kanban-col-title { font-size: 12.5px; font-weight: 700; color: var(--text); flex: 1; }
  .kanban-col-count {
    font-size: 11px; font-weight: 600; color: var(--text-3);
    background: var(--border); border-radius: 99px; padding: 1px 8px;
  }
  .kanban-col-body {
    padding: 0 10px 12px; overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 8px;
  }
  .kanban-col-body::-webkit-scrollbar { width: 4px; }
  .kanban-col-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

  .kanban-empty {
    padding: 28px 10px; text-align: center; color: var(--text-3);
    font-size: 12px; font-style: italic;
  }

  /* Feedback card */
  .fb-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 13px 14px; cursor: pointer;
    transition: box-shadow .15s, border-color .15s, transform .1s;
    position: relative; display: flex; flex-direction: column; gap: 8px;
  }
  .fb-card:hover { box-shadow: var(--shadow); border-color: #c7d2e8; transform: translateY(-1px); }
  .fb-card-title {
    font-size: 10.5px; font-weight: 700; color: var(--accent);
    text-transform: uppercase; letter-spacing: .5px;
  }
  .fb-card-question {
    font-size: 12.5px; font-weight: 500; color: var(--text);
    line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
  }
  .fb-card-meta {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    flex-wrap: wrap;
  }
  .fb-card-return-note {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 9px;
    padding: 7px 10px; display: flex; flex-direction: column; gap: 3px;
  }
  .fb-card-return-note-head {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; color: #d97706; text-transform: uppercase; letter-spacing: .4px;
  }
  .fb-card-return-note-body {
    font-size: 12px; color: #92400e; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .fb-card-claimer {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-2);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 99px; padding: 3px 10px 3px 4px; max-width: 240px;
  }
  /* fb-user-chip: colored avatar + username */
  .fb-user-chip { display:inline-flex; align-items:center; gap:5px; vertical-align:middle; }
  .fb-user-chip-av {
    display:inline-flex; align-items:center; justify-content:center;
    width:22px; height:22px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(135deg,var(--accent),#1d4ed8); color:#fff;
    font-size:7.5px; font-weight:800; letter-spacing:.3px;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
  }
  .fb-user-chip-av.role-Admin     { background:linear-gradient(135deg,#dc2626,#b91c1c); }
  .fb-user-chip-av.role-Moderator { background:linear-gradient(135deg,#7c3aed,#6d28d9); }
  .fb-user-chip-av.role-Experte   { background:linear-gradient(135deg,#059669,#047857); }
  .fb-user-chip-av.role-Gast      { background:linear-gradient(135deg,#9ca3af,#6b7280); }
  .fb-user-chip-name { font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .fb-scores-wrap { display: flex; flex-direction: column; gap: 4px; }
  .fb-scores-label { font-size: 9.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }
  .fb-card-scores {
    display: flex; gap: 4px; flex-wrap: wrap;
  }
  .fb-score-chip {
    display: inline-flex; align-items: center; gap: 3px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 6px; padding: 2px 6px; font-size: 10px; font-weight: 600;
    color: var(--text-2);
  }
  .fb-score-chip.high { color: #059669; border-color: #a7f3d0; background: #f0fdf4; }
  .fb-score-chip.mid  { color: #d97706; border-color: #fde68a; background: #fffbeb; }
  .fb-score-chip.low  { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
  .fb-card-sourcedoc {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; color: var(--text-3); max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fb-card-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
    text-transform: uppercase; letter-spacing: .3px;
  }
  .fb-card-badge.expert { background: #ede9fe; color: #7c3aed; }
  .fb-card-del {
    position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
    background: none; border: none; cursor: pointer; border-radius: 6px;
    color: var(--text-3); display: flex; align-items: center; justify-content: center;
    opacity: 1; transition: color .12s, background .12s;
  }
  .fb-card-del:hover { color: #dc2626; background: #fef2f2; }

  /* Feedback detail modal */
  #fb-detail-modal {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
  }
  #fb-detail-modal.open { display: flex; }
  .fb-modal-card {
    background: var(--surface); border-radius: 20px; width: 100%;
    max-width: 1200px; max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.22); border: 1px solid var(--border);
    margin: 20px;
  }
  .fb-modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 22px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .fb-modal-header-icon {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(135deg,#ede9fe,#ddd6fe);
    color: #7c3aed; display: flex; align-items: center; justify-content: center;
  }
  .fb-modal-title { font-size: 16px; font-weight: 800; color: var(--text); flex: 1; }
  .fb-modal-close {
    width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
    background: none; cursor: pointer; color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
  }
  .fb-modal-close:hover { background: var(--surface-2); color: var(--text); }
  .fb-modal-body {
    padding: 20px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px;
  }
  .fb-modal-body::-webkit-scrollbar { width: 5px; }
  .fb-modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

  .fb-section-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-2); margin-bottom: 6px;
  }
  .fb-text-block {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; font-size: 13px;
    line-height: 1.6; color: var(--text); white-space: pre-wrap;
    word-break: break-word; overflow-wrap: break-word; overflow: hidden;
    min-width: 0;
  }
  .fb-text-block.reference { border-left: 3px solid #10b981; }
  .fb-text-block.ai { border-left: 3px solid var(--accent); }
  .fb-text-block.md-block { white-space: normal; }
  .fb-text-block.md-block p { margin-bottom: 8px; }
  .fb-text-block.md-block p:last-child { margin-bottom: 0; }
  .fb-text-block.md-block ul, .fb-text-block.md-block ol { padding-left: 18px; margin-bottom: 8px; }
  .fb-text-block.md-block li { margin-bottom: 3px; }
  .fb-text-block.md-block h1, .fb-text-block.md-block h2, .fb-text-block.md-block h3 { margin: 8px 0 5px; font-size: 14px; }
  .fb-text-block.md-block strong { font-weight: 700; }
  .fb-text-block.md-block em { font-style: italic; }
  .fb-text-block.md-block code { background: var(--border); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; font-family: monospace; }
  .fb-text-block.md-block pre { background: var(--surface); padding: 8px 10px; border-radius: 8px; overflow-x: auto; margin: 6px 0; }
  .fb-text-block.md-block blockquote { border-left: 3px solid var(--border); padding-left: 10px; color: var(--text-2); margin: 6px 0; }

  .fb-scores-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  }
  .fb-score-row {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 12px;
  }
  .fb-score-row-label { font-size: 11px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; text-transform: capitalize; }
  .fb-score-bar-wrap { display: flex; align-items: center; gap: 8px; }
  .fb-score-bar-bg { flex: 1; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
  .fb-score-bar-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
  .fb-score-val { font-size: 12px; font-weight: 700; color: var(--text); min-width: 22px; text-align: right; }

  .fb-score-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .fb-score-input-row { display: flex; flex-direction: column; gap: 5px; }
  .fb-score-input-row label { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: capitalize; }
  .fb-score-input-wrap { display: flex; align-items: center; gap: 8px; }
  .fb-score-input-wrap input[type=range] { flex: 1; accent-color: var(--accent); cursor: pointer; }
  .fb-score-display { font-size: 13px; font-weight: 700; color: var(--text); min-width: 20px; text-align: center; }

  .fb-comment-area {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: 10px; background: var(--surface-2); color: var(--text);
    font-size: 13px; font-family: inherit; line-height: 1.5; resize: vertical;
    outline: none; min-height: 150px; transition: border-color .15s;
  }
  .fb-comment-area:focus { border-color: var(--accent); background: var(--surface); }

  .fb-modal-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap;
  }
  .fb-modal-footer-left { display: flex; gap: 8px; flex-wrap: wrap; }
  .fb-modal-footer-right { display: flex; gap: 8px; }
  .btn-fb-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; border: 1.5px solid transparent;
    transition: background .12s, color .12s, border-color .12s, transform .1s;
  }
  .btn-fb-action:active { transform: scale(.97); }
  .btn-fb-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
  .btn-fb-primary:hover { background: var(--accent-hv); border-color: var(--accent-hv); }
  .btn-fb-success { background: #10b981; color: #fff; border-color: #10b981; }
  .btn-fb-success:hover { background: #059669; border-color: #059669; }
  .btn-fb-warn { background: #f59e0b; color: #fff; border-color: #f59e0b; }
  .btn-fb-warn:hover { background: #d97706; border-color: #d97706; }
  .btn-fb-ghost { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
  .btn-fb-ghost:hover { background: var(--border); color: var(--text); }
  .btn-fb-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
  .btn-fb-danger:hover { background: #fee2e2; }

  .fb-review-note-wrap { display: flex; flex-direction: column; gap: 6px; }
  .fb-info-strip {
    display: flex; gap: 16px; flex-wrap: wrap;
  }
  .fb-info-item { display: flex; flex-direction: column; gap: 2px; }
  .fb-info-item-label { font-size: 10.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
  .fb-info-item-val { font-size: 12.5px; color: var(--text); font-weight: 600; }

  .fb-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
    letter-spacing: .2px; text-transform: uppercase;
  }
  .fb-status-badge.todo     { background: #f1f5f9; color: #64748b; }
  .fb-status-badge.in_progress { background: #fffbeb; color: #d97706; }
  .fb-status-badge.review   { background: #f5f3ff; color: #7c3aed; }
  .fb-status-badge.done     { background: #f0fdf4; color: #059669; }

  /* Create feedback modal */
  #fb-create-modal {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
  }
  #fb-create-modal.open { display: flex; }
  .fb-create-card {
    background: var(--surface); border-radius: 20px; width: 100%; max-width: 680px;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.22); border: 1px solid var(--border); margin: 20px;
  }
  .fb-create-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 22px 16px; border-bottom: 1px solid var(--border);
  }
  .fb-create-title { font-size: 16px; font-weight: 800; color: var(--text); }
  .fb-create-body { padding: 20px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
  .fb-create-field { display: flex; flex-direction: column; gap: 5px; }
  .fb-create-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
  .fb-create-textarea {
    padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px;
    background: var(--surface-2); color: var(--text); font-size: 13px;
    font-family: inherit; line-height: 1.55; resize: vertical; outline: none;
    transition: border-color .15s;
  }
  .fb-create-textarea:focus { border-color: var(--accent); background: var(--surface); }
  .fb-create-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 22px 18px; border-top: 1px solid var(--border);
  }
  .fb-create-error { color: #dc2626; font-size: 12.5px; display: none; padding: 0 22px 4px; }
  .fb-create-error.show { display: block; }

  /* ── Feedback Generate Modal ── */
  #fb-generate-modal {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,.52); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
  }
  #fb-generate-modal.open { display: flex; }
  .fb-gen-card {
    background: var(--surface); border-radius: 20px; width: 100%; max-width: 1200px;
    max-height: 92vh; display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,.22); border: 1px solid var(--border); margin: 16px;
  }
  #fb-gen-config { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
  .fb-gen-header {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 22px 22px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .fb-gen-header-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #2563eb;
    display: flex; align-items: center; justify-content: center;
  }
  .fb-gen-title { font-size: 16px; font-weight: 800; color: var(--text); display: block; }
  .fb-gen-subtitle { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
  .fb-gen-body {
    padding: 20px 22px; overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 16px;
  }
  .fb-gen-body::-webkit-scrollbar { width: 5px; }
  .fb-gen-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
  .fb-gen-field { display: flex; flex-direction: column; gap: 6px; }
  .fb-gen-label {
    font-size: 11.5px; font-weight: 600; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .4px;
  }
  .fb-gen-row { display: flex; align-items: center; gap: 12px; }
  .fb-gen-count-input {
    width: 90px; padding: 9px 12px; border: 1.5px solid var(--accent); border-radius: 10px;
    background: #f0f7ff; color: var(--text); font-size: 14px; font-weight: 600;
    font-family: inherit; outline: none; transition: border-color .15s, background .15s;
    -moz-appearance: textfield;
  }
  .fb-gen-count-input::-webkit-inner-spin-button,
  .fb-gen-count-input::-webkit-outer-spin-button { -webkit-appearance: none; }
  .fb-gen-count-input:focus { border-color: var(--accent-hv); background: #e8f2ff; }
  .fb-gen-count-hint { font-size: 12px; color: var(--text-3); white-space: nowrap; }
  .fb-gen-slider {
    flex: 1; height: 4px; accent-color: var(--accent); cursor: pointer; min-width: 0;
  }
  .fb-gen-select {
    padding: 9px 12px; border: 1.5px solid var(--accent); border-radius: 10px;
    background: #f0f7ff; color: var(--text); font-size: 13px;
    font-family: inherit; outline: none; cursor: pointer;
    transition: border-color .15s; width: 100%;
  }
  .fb-gen-select:focus { border-color: var(--accent-hv); background: #e8f2ff; }
  .fb-gen-check-box {
    border: 1.5px solid var(--border); border-radius: 12px; padding: 13px 15px;
    cursor: pointer; transition: border-color .15s, background .15s;
    background: var(--surface-2);
  }
  .fb-gen-check-box:hover { border-color: var(--accent); background: var(--accent-lt); }
  .fb-gen-check-box.checked { border-color: var(--accent); background: var(--accent-lt); }
  .fb-gen-check-label { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; pointer-events: none; }
  .fb-gen-check-label input[type=checkbox] { margin-top:2px; width:16px; height:16px; accent-color:var(--accent); cursor:pointer; flex-shrink:0; pointer-events: auto; }
  .fb-gen-check-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
  .fb-gen-check-desc { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.4; }
  .fb-gen-textarea {
    padding: 10px 12px; border: 1.5px solid var(--accent); border-radius: 10px;
    background: #f0f7ff; color: var(--text); font-size: 12px;
    font-family: inherit; outline: none; resize: vertical; min-height: 72px;
    transition: border-color .15s; line-height: 1.5; width: 100%; box-sizing: border-box;
  }
  .fb-gen-textarea:focus { border-color: var(--accent-hv); background: #e8f2ff; }
  .fb-gen-label-row { display: flex; align-items: center; justify-content: space-between; }
  .fb-gen-toggle-btn {
    background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
    padding: 4px 10px; font-size: 11px; font-weight: 600;
    color: var(--text-2); cursor: pointer; transition: color .12s, border-color .12s;
  }
  .fb-gen-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }
  .fb-gen-ref-box {
    padding: 10px 13px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 4px;
  }
  .fb-gen-ref-row { display: flex; align-items: center; gap: 8px; }
  .fb-gen-ref-key { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
  .fb-gen-ref-intent {
    font-size: 12px; font-weight: 700; color: var(--accent);
    background: var(--accent-lt); padding: 2px 8px; border-radius: 6px; font-family: monospace;
  }
  .fb-gen-ref-desc { font-size: 11.5px; color: var(--text-3); }
  .fb-gen-params-row { display: flex; gap: 8px; margin-top: 6px; }
  .fb-gen-param { flex: 1; display: flex; flex-direction: column; gap: 4px; }
  .fb-gen-param-label { font-size: 10.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; }
  .fb-gen-param-input {
    padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 8px;
    background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700;
    font-family: inherit; outline: none; opacity: .65; cursor: not-allowed; text-align: center; width: 100%;
  }
  .fb-gen-ref-info {
    display: flex; align-items: flex-start; gap: 7px;
    padding: 9px 12px; border-radius: 9px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-3); line-height: 1.5;
  }
  .fb-comment-count { font-size: 11.5px; color: var(--text-3); text-align: right; margin-top: 4px; }
  .fb-comment-count.ok { color: #16a34a; }
  .fb-comment-count.err { color: #dc2626; }
  /* Modal section divider */
  .fb-gen-divider {
    display: flex; align-items: center; gap: 10px; margin: 2px 0 0;
  }
  .fb-gen-divider-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
    color: var(--text-3); white-space: nowrap;
  }
  .fb-gen-divider-line { flex: 1; height: 1px; background: var(--border); }
  .fb-gen-sub-hint {
    font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-top: -2px;
  }
  /* System-prompt collapsible */
  .fb-gen-collapsible { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
  .fb-gen-collapsible-header {
    display: flex; align-items: center; gap: 9px; padding: 10px 14px; cursor: pointer;
    background: var(--surface-2); user-select: none;
    transition: background .12s;
  }
  .fb-gen-collapsible-header:hover { background: var(--surface-3, var(--surface-2)); }
  .fb-gen-collapsible-title { font-size: 12px; font-weight: 600; color: var(--text-2); flex: 1; }
  .fb-gen-collapsible-chevron {
    font-size: 11px; color: var(--text-3); transition: transform .18s;
    display: inline-block;
  }
  .fb-gen-collapsible-body { display: none; padding: 12px 14px; background: var(--surface); }
  .fb-gen-collapsible.open .fb-gen-collapsible-body { display: block; }
  .fb-gen-collapsible.open .fb-gen-collapsible-chevron { transform: rotate(180deg); }
  /* AI label input */
  .fb-gen-ai-label-input {
    padding: 9px 12px; border: 1.5px solid var(--accent); border-radius: 10px;
    background: #f0f7ff; color: var(--text); font-size: 13px; font-weight: 600;
    font-family: inherit; outline: none; width: 100%;
    transition: border-color .15s, background .15s;
  }
  .fb-gen-ai-label-input:focus { border-color: var(--accent-hv); background: #e8f2ff; }
  /* Detail modal: side-by-side answers */
  .fb-answer-cols {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; overflow: hidden;
    align-items: stretch;
  }
  .fb-answer-cols > div { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
  .fb-answer-cols > div .fb-text-block { flex: 1; }
  @media (max-width: 680px) { .fb-answer-cols { grid-template-columns: 1fr; } }
  /* Collapsible sections in detail modal */
  .fb-collapsible-header {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 6px 10px; margin: -6px -10px; border-radius: 8px;
    user-select: none; transition: background .12s;
  }
  .fb-collapsible-header:hover { background: var(--surface-2); }
  .fb-collapsible-header .fb-section-label { margin: 0; cursor: pointer; }
  .fb-collapsible-chevron {
    font-size: 9px; color: var(--text-3); margin-left: auto;
    transition: transform .2s; display: inline-block;
  }
  .fb-collapsible-body { margin-top: 8px; }
  .fb-collapsible.collapsed .fb-collapsible-body { display: none; }
  .fb-collapsible.collapsed .fb-collapsible-chevron { transform: rotate(-90deg); }
  /* Metadata section */
  .fb-meta-strip {
    display: flex; flex-direction: column;
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border);
  }
  .fb-meta-item {
    display: grid; grid-template-columns: 22px 1fr auto;
    align-items: center; gap: 10px;
    padding: 9px 14px; background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    transition: background .1s;
  }
  .fb-meta-item:last-child { border-bottom: none; }
  .fb-meta-item:hover { background: var(--surface-3, color-mix(in srgb, var(--surface-2) 60%, var(--border))); }
  .fb-meta-item-icon { display: flex; align-items: center; justify-content: center; color: var(--text-3); flex-shrink: 0; }
  .fb-meta-item-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
  .fb-meta-item-val { font-size: 12.5px; font-weight: 700; color: var(--text); text-align: right; }
  /* Preference radio group */
  .fb-pref-group { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  @media (max-width: 600px) { .fb-pref-group { grid-template-columns: 1fr; } }
  .fb-pref-option {
    display: flex; align-items: center; gap: 9px; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer;
    background: var(--surface-2); transition: border-color .15s, background .15s;
    font-size: 13px; font-weight: 500; color: var(--text);
  }
  .fb-pref-option:hover { border-color: var(--accent); background: var(--accent-lt); }
  .fb-pref-option input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
  .fb-pref-option.selected { border-color: var(--accent); background: var(--accent-lt); }
  .fb-pref-option .fb-pref-icon { font-size: 15px; flex-shrink: 0; }
  .fb-gen-model-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .fb-gen-model-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-3); flex-shrink: 0;
    transition: background .25s;
  }
  .fb-gen-model-dot.online  { background: #22c55e; }
  .fb-gen-model-dot.offline { background: #ef4444; }
  .fb-gen-model-name { font-size: 13px; font-weight: 700; color: var(--text); }
  .fb-gen-model-ready { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
  .fb-gen-no-model-banner {
    display: none; align-items: flex-start; gap: 11px;
    margin: 0 22px 2px; padding: 13px 15px; border-radius: 12px;
    background: #fef3c7; border: 1px solid #fcd34d;
  }
  .fb-gen-no-model-banner.show { display: flex; }
  .fb-gen-no-model-banner-icon {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: #f59e0b; color: #fff;
    display: flex; align-items: center; justify-content: center;
  }
  .fb-gen-no-model-banner-body { flex: 1; min-width: 0; }
  .fb-gen-no-model-banner-title { font-size: 13px; font-weight: 700; color: #92400e; margin-bottom: 2px; }
  .fb-gen-no-model-banner-text  { font-size: 12px; color: #78350f; line-height: 1.5; }
  .btn-fb-primary:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
  .fb-gen-error { color: #dc2626; font-size: 12.5px; display: none; padding: 0 22px 4px; }
  .fb-gen-error.show { display: block; }
  .fb-gen-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-shrink: 0;
  }
  .btn-fb-danger {
    background: none; color: #dc2626; border-color: #fca5a5;
  }
  .btn-fb-danger:hover { background: #fef2f2; border-color: #dc2626; }
  /* Progress view */
  .fb-gen-progress-body {
    padding: 28px 22px; flex: 1; display: flex; flex-direction: column; gap: 20px;
  }
  .fb-gen-progress-label {
    font-size: 13.5px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 8px;
  }
  .fb-gen-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--border); border-top-color: var(--accent);
    animation: spin .7s linear infinite; flex-shrink: 0;
  }
  .fb-gen-bar-bg {
    height: 8px; border-radius: 99px;
    background: var(--surface-2); overflow: hidden; border: 1px solid var(--border);
  }
  .fb-gen-bar-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
    transition: width .6s cubic-bezier(.4,0,.2,1); width: 0%;
  }
  .fb-gen-counter {
    font-size: 13px; color: var(--text-2); font-weight: 500; text-align: center; margin-top: 8px;
  }
  .fb-gen-items-list {
    display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto;
  }
  .fb-gen-items-list::-webkit-scrollbar { width: 4px; }
  .fb-gen-items-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
  .fb-gen-item-row {
    padding: 8px 12px; border-radius: 9px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    font-size: 12px; color: var(--text-2); line-height: 1.4;
    animation: fb-gen-in .3s ease;
  }
  @keyframes fb-gen-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .fb-gen-done-state {
    display: flex; align-items: center; gap: 10px; justify-content: center;
    padding: 14px; border-radius: 12px;
    background: #f0fdf4; border: 1px solid #bbf7d0;
    color: #16a34a; font-size: 13.5px; font-weight: 700;
  }
  /* Generation banner in feedback view */
  .fb-gen-banner {
    display: none; align-items: center; gap: 10px;
    margin: 16px 28px 0;
    padding: 10px 14px; border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1px solid #bfdbfe; font-size: 13px; color: var(--text-2);
  }
  .fb-gen-banner.show { display: flex; }
  .fb-gen-banner-spinner {
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid #bfdbfe; border-top-color: var(--accent);
    animation: spin .7s linear infinite; flex-shrink: 0;
  }
  .fb-gen-banner-text { flex: 1; font-weight: 500; }
  .fb-gen-banner-prog { font-weight: 700; color: var(--accent); }
  .fb-gen-banner-btn {
    padding: 4px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600;
    border: 1px solid var(--accent); color: var(--accent); background: none;
    cursor: pointer; transition: background .12s;
  }
  .fb-gen-banner-btn:hover { background: var(--accent-lt); }
  /* Generation overlay for chat input */
  #gen-loading-hint {
    background: #eff6ff !important; border-color: #bfdbfe !important; color: #1d4ed8 !important;
  }

  .status-widget {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #d1d5db; transition: background .3s; }
  .status-widget.online .status-dot  { background: #22c55e; }
  .status-widget.offline .status-dot { background: #ef4444; }
  .status-widget.loading .status-dot { background: #f59e0b; animation: pulse 1.2s infinite; }
  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
  .status-info { flex: 1; min-width: 0; }
  .status-label { font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .status-model { font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .model-picker-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 11px;
    border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer;
    background: var(--surface); transition: border-color .12s, background .1s;
  }
  .model-picker-item:hover { border-color: var(--accent); background: var(--surface-2); }
  .model-picker-item.active { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 8%,var(--surface)); }
  .model-picker-item.active .model-picker-check { opacity: 1; }
  .model-picker-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .model-picker-name { font-family: 'Menlo','Monaco','Courier New',monospace; font-size: 11px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .model-picker-meta { font-size: 10px; color: var(--text-3); font-weight: 500; }
  .model-picker-badges { display: flex; align-items: center; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
  .model-picker-params { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb,var(--accent) 12%,var(--surface)); color: var(--accent); font-size: 10px; font-weight: 700; }
  .rp-quant-active-badge { display:inline-flex;align-items:center;gap:3px;font-size:9.5px;font-weight:700;padding:1px 7px;border-radius:5px;background:rgba(100,116,139,.12);color:var(--text-2);border:1px solid rgba(100,116,139,.2);letter-spacing:.2px;white-space:nowrap; }
  .rp-sched-llm-row { display:flex;flex-direction:column;gap:5px; }
  .rp-sched-llm-model { font-size:11.5px;font-weight:600;color:var(--text);font-family:'Menlo','Monaco','Courier New',monospace; }
  .rp-sched-llm-badges { display:flex;gap:5px;flex-wrap:wrap;align-items:center; }
  .model-picker-check { opacity: 0; color: var(--accent); flex-shrink: 0; }
  .model-picker-item.active .model-picker-check { opacity: 1; }
  .model-picker-loading { font-size: 11px; color: var(--text-3); text-align: center; padding: 8px 0; }
  .model-picker-restart-btn { display:inline-flex;align-items:center;gap:3px;font-size:10px;font-weight:600;
    color:#d97706;background:#fef3c7;border:1px solid #fde68a;border-radius:5px;padding:2px 7px; }
  .model-picker-item:not(.active) { cursor:pointer; }
  #runpod-switch-status { font-size:11px;color:var(--text-2);padding:6px 4px 2px;display:none; }
  #runpod-switch-status.visible { display:block; }
  .runpod-progress-bar { height:3px;background:var(--border);border-radius:2px;margin-top:5px;overflow:hidden; }
  .runpod-progress-fill { height:100%;background:var(--accent);border-radius:2px;width:0%;transition:width .5s;animation:runpodPulse 1.5s ease-in-out infinite; }
  @keyframes runpodPulse { 0%,100%{opacity:1} 50%{opacity:.5} }
  .model-switch-banner { display:none;margin-bottom:6px;border-radius:9px;background:color-mix(in srgb,var(--accent) 10%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 28%,var(--border));padding:9px 12px; }
  .model-switch-banner.visible { display:block; }
  .model-switch-banner-title { font-size:11px;font-weight:700;color:var(--accent);margin-bottom:3px;display:flex;align-items:center;gap:5px; }
  .model-switch-banner-text { font-size:10.5px;color:var(--text-2); }
  @keyframes mpSpin { to { transform:rotate(360deg); } }
  .mp-spinner { animation:mpSpin 1s linear infinite;flex-shrink:0; }
  .model-picker-item.switching-target { border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--surface)); }
  .model-picker-item.switching-target .model-picker-name { color:var(--accent); }
  .model-picker-item.switching-away { opacity:0.4;pointer-events:none; }
  .rp-icon-model { background:color-mix(in srgb,var(--accent) 14%,var(--surface));color:var(--accent); }
  .rp-model-body { padding:18px 20px;display:flex;flex-direction:column;gap:14px; }
  .rp-model-current { display:flex;align-items:center;gap:10px;padding:10px 13px;border-radius:10px;background:var(--surface-2);border:1.5px solid var(--border); }
  .rp-model-current-name { font-family:'Menlo','Monaco','Courier New',monospace;font-size:12px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .rp-model-switch-row { display:flex;gap:8px;align-items:flex-end; }
  .rp-model-switch-row .rp-select { flex:1; }
  .rp-btn-model { background:var(--accent);color:#fff; }
  .rp-btn-model:hover:not(:disabled) { background:var(--accent-dark,#1d4ed8); }
  .rp-btn-model:disabled { background:var(--border);color:var(--text-3);cursor:not-allowed;opacity:.7; }
  .rp-model-switch-msg { font-size:11.5px;min-height:16px;color:var(--text-3); }
  .rp-model-switch-msg.ok { color:#16a34a; }
  .rp-model-switch-msg.err { color:#dc2626; }
  .rp-model-card-progress { height:3px;background:var(--border);border-radius:2px;overflow:hidden;display:none; }
  .rp-model-card-progress.visible { display:block; }
  .rp-model-card-progress-fill { height:100%;background:var(--accent);border-radius:2px;width:0%;transition:width .5s;animation:runpodPulse 1.5s ease-in-out infinite; }
  .rp-model-loaded-section { display:flex;flex-direction:column;gap:0;padding:10px 13px; }
  .rp-model-loaded-label { font-size:9.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-3);margin-bottom:6px; }
  .rp-model-loaded-row { display:flex;align-items:center;gap:8px; }
  .rp-model-loaded-section .model-picker-item { cursor:default; }
  .rp-model-params-badge { font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:6px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 22%,var(--border));flex-shrink:0;white-space:nowrap; }
  .rp-model-switch-divider { display:flex;align-items:center;gap:6px;color:var(--text-3); }
  .rp-model-switch-divider-line { flex:1;height:1px;background:var(--border); }
  .rp-model-switch-section { display:flex;flex-direction:column;gap:7px; }
  .rp-model-switch-label { font-size:9.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-3);margin-bottom:6px; }
  .rp-model-picker-cards { display:flex;flex-direction:column;gap:5px; }
  .rp-model-pick-card { display:flex;align-items:center;gap:10px;padding:9px 13px;border-radius:10px;border:1.5px solid var(--border);background:var(--surface-2);cursor:pointer;transition:border-color .15s,background .15s;user-select:none; }
  .rp-model-pick-card:hover { border-color:color-mix(in srgb,var(--accent) 50%,var(--border));background:color-mix(in srgb,var(--accent) 4%,var(--surface-2)); }
  .rp-model-pick-card.rp-pick-selected { border-color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--surface)); }
  .rp-model-pick-name { font-family:'Menlo','Monaco','Courier New',monospace;font-size:11.5px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .rp-model-pick-org { font-size:10px;color:var(--text-3);flex-shrink:0; }
  .rp-model-pick-params { font-size:10px;font-weight:700;padding:2px 7px;border-radius:5px;background:color-mix(in srgb,var(--accent) 10%,var(--surface));color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 18%,var(--border));flex-shrink:0; }
  .rp-pick-selected .rp-model-pick-params { background:color-mix(in srgb,var(--accent) 18%,var(--surface)); }
  /* Quantization / Start-Options — collapsible */
  .rp-quant-section { display:flex;flex-direction:column;border-top:1px solid var(--border); }
  .rp-quant-header { display:flex;align-items:center;gap:7px;padding:9px 13px;cursor:pointer;background:transparent;border:none;width:100%;text-align:left;transition:background .12s;font-family:inherit; }
  .rp-quant-header:hover { background:color-mix(in srgb,var(--accent) 4%,transparent); }
  .rp-quant-hd-icon { width:20px;height:20px;border-radius:6px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));display:flex;align-items:center;justify-content:center;color:var(--accent);flex-shrink:0; }
  .rp-quant-header-label { font-size:9.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-3);flex:1; }
  .rp-quant-chevron { color:var(--text-3);transition:transform .2s;flex-shrink:0; }
  .rp-quant-chevron.open { transform:rotate(180deg); }
  .rp-quant-body { display:none;flex-direction:column;gap:10px;padding:2px 13px 12px; }
  .rp-quant-body.open { display:flex; }
  .rp-quant-row { display:flex;flex-direction:column;gap:6px; }
  .rp-quant-row-header { display:flex;align-items:baseline;gap:5px; }
  .rp-quant-row-label { font-size:11px;font-weight:600;color:var(--text-2); }
  .rp-quant-scale-hint { font-size:9px;color:var(--text-3);margin-left:auto;white-space:nowrap; }
  .rp-quant-pills { display:flex;gap:4px; }
  .rp-quant-pill { flex:1;padding:7px 3px 6px;border-radius:8px;border:1.5px solid var(--border);background:var(--surface-2);font-family:inherit;cursor:pointer;transition:all .12s;text-align:center;display:flex;flex-direction:column;align-items:center;gap:4px; }
  .rp-quant-pill:hover { border-color:color-mix(in srgb,var(--accent) 55%,var(--border));background:color-mix(in srgb,var(--accent) 5%,var(--surface-2)); }
  .rp-quant-pill.active { border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--surface)); }
  .rp-qp-name { font-size:13px;font-weight:700;color:var(--text);line-height:1; }
  .rp-quant-pill.active .rp-qp-name { color:var(--accent); }
  .rp-qp-bar { width:28px;height:3px;border-radius:2px;background:var(--border);overflow:hidden;flex-shrink:0; }
  .rp-qp-fill { height:100%;border-radius:2px; }
  .rp-qp-sub { font-size:8.5px;font-weight:500;color:var(--text-3);line-height:1.2;white-space:nowrap; }
  .rp-quant-pill.active .rp-qp-sub { color:color-mix(in srgb,var(--accent) 65%,var(--text-3)); }
  .rp-quant-pill.rp-qp-auto { border-style:dashed; }
  .rp-quant-tradeoff { display:flex;align-items:center;gap:5px; }
  .rp-quant-tradeoff-label { font-size:8.5px;color:var(--text-3);white-space:nowrap; }
  .rp-quant-tradeoff-line { flex:1;height:1.5px;background:linear-gradient(to right,#16a34a,#ca8a04,#dc2626);border-radius:1px;opacity:.4; }
  .rp-gpu-mem-row { display:flex;align-items:center;gap:10px; }
  .rp-gpu-mem-slider { flex:1;accent-color:var(--accent);cursor:pointer;height:4px; }
  .rp-gpu-mem-val { font-size:12px;font-weight:700;color:var(--accent);min-width:34px;text-align:right; }
  /* Schedule summary */
  .rp-sched-status-badge { display:block; }
  .rp-sched-summary-row { display:flex;align-items:center;gap:8px; }
  .rp-sched-row-label { font-size:10.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--text-3);width:32px;flex-shrink:0; }
  .rp-sched-time-pill { padding:4px 10px;border-radius:8px;background:var(--surface-2);font-family:'Menlo','Monaco','Courier New',monospace;font-size:13px;font-weight:700;border:1px solid var(--border);color:var(--text); }
  .rp-sched-day-chip-item { display:inline-flex;align-items:center;justify-content:center;width:30px;height:28px;border-radius:7px;font-size:11px;font-weight:700; }
  .rp-sched-day-chip-item.on { background:var(--accent);color:#fff; }
  .rp-sched-day-chip-item.off { background:var(--surface-2);color:var(--text-3);border:1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════
   RUNPOD MANAGEMENT VIEW
═══════════════════════════════════════════════════════════ */
#runpod-view { display:none; flex-direction:column; flex:1; overflow-y:auto; background:var(--bg); }
#runpod-view.active { display:flex; }
.rp-view-inner { max-width:920px; width:100%; margin:0 auto; padding:28px 24px 56px; display:flex; flex-direction:column; gap:18px; }
/* Hero card */
.rp-hero-card { background:var(--surface);border:1.5px solid var(--border);border-radius:16px;padding:22px 24px;display:flex;flex-direction:column;gap:16px; }
.rp-hero-top { display:flex;align-items:center;gap:14px; }
.rp-hero-icon-wrap { width:42px;height:42px;border-radius:12px;background:var(--accent-lt);color:var(--accent);display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.rp-hero-text { flex:1;min-width:0; }
.rp-hero-title { font-size:18px;font-weight:800;letter-spacing:-.3px;color:var(--text);line-height:1.2; }
.rp-hero-sub { font-size:12px;color:var(--text-3);margin-top:2px; }
.rp-pod-id-badge { display:inline-flex;align-items:center;gap:4px;font-family:monospace;font-size:10.5px;font-weight:600;color:var(--text-3);background:var(--surface-2);border:1px solid var(--border);border-radius:5px;padding:1px 7px;letter-spacing:.3px;line-height:1.6;white-space:nowrap; }
.rp-pod-id-badge svg { opacity:.55;flex-shrink:0; }
.rp-hero-status-row { display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.rp-hero-uptime { font-size:11.5px;color:var(--text-3);margin-left:4px; }
/* Status chips */
.rp-status-chip { display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border); }
.rp-chip-dot { width:7px;height:7px;border-radius:50%;background:var(--text-3);flex-shrink:0;transition:background .3s; }
.rp-chip-group { display:flex;flex-direction:column;gap:0; }
.rp-chip-label { font-size:9px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-3);line-height:1; }
.rp-chip-val { font-size:12px;font-weight:700;color:var(--text);line-height:1.3; }
.rp-chip-running .rp-chip-dot { background:#22c55e;animation:rpPulse 1.8s ease-in-out infinite; }
.rp-chip-running .rp-chip-val { color:#16a34a; }
.rp-chip-stopped .rp-chip-dot { background:#6b7280; }
.rp-chip-stopped .rp-chip-val { color:var(--text-2); }
.rp-chip-warn .rp-chip-dot { background:#f59e0b;animation:rpPulse 1.8s ease-in-out infinite; }
.rp-chip-warn .rp-chip-val { color:#d97706; }
.rp-chip-ok .rp-chip-dot { background:#22c55e; }
.rp-chip-ok .rp-chip-val { color:#16a34a; }
.rp-chip-offline .rp-chip-dot { background:#ef4444; }
.rp-chip-offline .rp-chip-val { color:#dc2626; }
@keyframes rpPulse { 0%,100%{opacity:1} 50%{opacity:.35} }
/* GPU metrics */
.rp-metrics-row { display:flex;gap:18px;align-items:center;flex-wrap:wrap;padding:10px 14px;background:var(--surface-2);border-radius:10px;border:1px solid var(--border); }
.rp-metric-item { display:flex;align-items:center;gap:8px;flex:1;min-width:120px; }
.rp-metric-label { font-size:10.5px;font-weight:700;color:var(--text-3);letter-spacing:.3px;text-transform:uppercase;width:34px;flex-shrink:0; }
.rp-metric-track { flex:1;height:5px;background:var(--border);border-radius:3px;overflow:hidden; }
.rp-metric-fill { height:100%;border-radius:3px;background:var(--accent);transition:width .5s; }
.rp-metric-fill-vram { background:#8b5cf6; }
.rp-metric-val { font-size:11.5px;font-weight:700;color:var(--text);width:32px;text-align:right;flex-shrink:0; }
.rp-gpu-cards { display:flex;flex-direction:column;gap:10px;width:100%; }
.rp-gpu-card { display:flex;flex-direction:column;gap:8px; }
.rp-gpu-card-header { display:flex;align-items:center;justify-content:space-between;gap:8px; }
.rp-gpu-card-name { font-size:11px;font-weight:700;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.rp-gpu-card-temp { font-size:11px;font-weight:700;color:var(--text-3);flex-shrink:0; }
.rp-gpu-card-temp.hot { color:#f59e0b; }
.rp-gpu-card-temp.vhot { color:#ef4444; }
.rp-gpu-stats { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
.rp-gpu-stat { display:flex;flex-direction:column;gap:4px; }
.rp-gpu-stat-header { display:flex;align-items:center;justify-content:space-between; }
.rp-gpu-stat-label { font-size:9.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--text-3); }
.rp-gpu-stat-val { font-size:12px;font-weight:800;color:var(--text); }
.rp-gpu-stat-sub { font-size:9.5px;color:var(--text-3); }
.rp-gpu-bar-track { height:4px;background:var(--border);border-radius:2px;overflow:hidden; }
.rp-gpu-bar-fill { height:100%;border-radius:2px;transition:width .6s ease; }
.rp-gpu-bar-fill.compute { background:var(--accent); }
.rp-gpu-bar-fill.vram { background:#8b5cf6; }
.rp-gpu-bar-fill.high { background:#f59e0b; }
.rp-gpu-bar-fill.full { background:#ef4444; }
/* Hero actions */
.rp-hero-actions { display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
/* LLM warning */
@keyframes rpWarnPulse { 0%,100%{border-color:#fde68a;box-shadow:none} 50%{border-color:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.12)} }
.rp-llm-warn { display:flex;align-items:center;gap:16px;padding:18px 22px;border-radius:14px;background:linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%);border:1.5px solid #fcd34d;color:#78350f;font-size:13px;line-height:1.5; }
.dark .rp-llm-warn { background:linear-gradient(135deg,rgba(120,53,15,.22) 0%,rgba(92,45,11,.15) 100%);border-color:rgba(251,191,36,.35);color:#fcd34d; }
.rp-llm-warn-icon { width:42px;height:42px;background:rgba(245,158,11,.15);border-radius:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:#d97706; }
.dark .rp-llm-warn-icon { background:rgba(245,158,11,.1); }
.rp-llm-warn-title { font-weight:700;font-size:14px;margin-bottom:3px; }
.rp-llm-warn-sub { font-size:12px;opacity:.75; }
/* LLM starting progress banner */
.rp-llm-starting { display:flex;flex-direction:column;gap:12px;padding:18px 22px;border-radius:14px;background:linear-gradient(135deg,#eff6ff 0%,#ecfdf5 100%);border:1.5px solid #93c5fd;color:#1e40af;font-size:13px;line-height:1.5; }
.dark .rp-llm-starting { background:linear-gradient(135deg,rgba(30,58,138,.22) 0%,rgba(20,83,45,.15) 100%);border-color:rgba(147,197,253,.35);color:#93c5fd; }
.rp-llm-starting.rp-llm-starting-error { background:linear-gradient(135deg,#fef2f2 0%,#fff7ed 100%);border-color:#fca5a5;color:#991b1b; }
.dark .rp-llm-starting.rp-llm-starting-error { background:linear-gradient(135deg,rgba(127,29,29,.22) 0%,rgba(120,53,15,.15) 100%);border-color:#f87171;color:#fca5a5; }
.rp-llm-starting-icon { width:42px;height:42px;background:rgba(59,130,246,.12);border-radius:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:#3b82f6; }
.rp-llm-starting-title { font-weight:700;font-size:14px;margin-bottom:3px; }
.rp-llm-starting-sub { font-size:12px;opacity:.75; }
.rp-llm-starting-bar { height:3px;background:rgba(59,130,246,.15);border-radius:2px;overflow:hidden; }
@keyframes rpStartShimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.rp-llm-starting-fill { height:100%;border-radius:2px;width:8%;transition:width .6s ease;background:linear-gradient(90deg,#3b82f6,#06b6d4,#3b82f6);background-size:200% 100%;animation:rpStartShimmer 2s linear infinite; }
.rp-llm-starting-cancel-btn { display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border-radius:7px;border:1px solid rgba(59,130,246,.35);background:rgba(59,130,246,.08);color:#1e40af;font-size:11.5px;font-weight:600;cursor:pointer;flex-shrink:0;transition:background .15s; }
.rp-llm-starting-cancel-btn:hover { background:rgba(59,130,246,.18); }
.dark .rp-llm-starting-cancel-btn { color:#93c5fd;border-color:rgba(147,197,253,.35);background:rgba(59,130,246,.1); }
.dark .rp-llm-starting-cancel-btn:hover { background:rgba(59,130,246,.2); }
.rp-llm-log-toggle-btn { display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:5px;border:1px solid rgba(59,130,246,.3);background:rgba(59,130,246,.07);color:#1e40af;font-size:11px;font-weight:600;cursor:pointer;flex-shrink:0;transition:all .15s;white-space:nowrap; }
.rp-llm-log-toggle-btn:hover { background:rgba(59,130,246,.16); }
.dark .rp-llm-log-toggle-btn { color:#93c5fd;border-color:rgba(147,197,253,.3);background:rgba(59,130,246,.09); }
.dark .rp-llm-log-toggle-btn:hover { background:rgba(59,130,246,.18); }
.rp-llm-log-toggle-btn svg { transition:transform .2s; }
.rp-llm-log-toggle-btn.open svg { transform:rotate(180deg); }
.rp-llm-log-detail { margin-top:4px;border-radius:8px;overflow:hidden;border:1px solid rgba(59,130,246,.2);background:rgba(15,23,42,.06); }
.dark .rp-llm-log-detail { background:rgba(0,0,0,.25);border-color:rgba(147,197,253,.15); }
.rp-llm-log-detail-pre { margin:0;padding:10px 13px;font-size:11.5px;font-family:'JetBrains Mono',Consolas,monospace;color:#1e3a5f;white-space:pre-wrap;word-break:break-all;line-height:1.6;max-height:180px;overflow-y:auto; }
.dark .rp-llm-log-detail-pre { color:#93c5fd; }
.rp-llm-starting.rp-llm-starting-error .rp-llm-log-toggle-btn { color:#991b1b;border-color:rgba(239,68,68,.3);background:rgba(239,68,68,.07); }
.dark .rp-llm-starting.rp-llm-starting-error .rp-llm-log-toggle-btn { color:#fca5a5; }
.rp-llm-starting.rp-llm-starting-error .rp-llm-log-detail { border-color:rgba(239,68,68,.2);background:rgba(127,29,29,.06); }
.dark .rp-llm-starting.rp-llm-starting-error .rp-llm-log-detail { background:rgba(127,29,29,.2); }
.rp-llm-starting.rp-llm-starting-error .rp-llm-log-detail-pre { color:#991b1b; }
.dark .rp-llm-starting.rp-llm-starting-error .rp-llm-log-detail-pre { color:#fca5a5; }
/* Offline chip red dot pulses faster */
.rp-chip-offline .rp-chip-dot { background:#ef4444;animation:rpPulse 1.2s ease-in-out infinite; }
/* Card fade-in on view enter */
@keyframes rpCardIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.rp-view-inner > * { animation:rpCardIn .28s ease both; }
.rp-view-inner > *:nth-child(2) { animation-delay:.04s; }
.rp-view-inner > *:nth-child(3) { animation-delay:.08s; }
.rp-view-inner > *:nth-child(4) { animation-delay:.12s; }
.rp-view-inner > *:nth-child(5) { animation-delay:.16s; }
/* Button press animation */
.rp-btn:active:not(:disabled) { transform:scale(.97); }
/* Shimmer loading for status chips */
@keyframes rpShimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
.rp-chip-loading { background:linear-gradient(90deg,var(--surface-2) 25%,var(--border) 50%,var(--surface-2) 75%);background-size:200% 100%;animation:rpShimmer 1.4s ease-in-out infinite;border:none; }
.rp-chip-loading .rp-chip-dot,.rp-chip-loading .rp-chip-val { opacity:0; }
/* Cards */
/* ── Unified RunPod section card ─────────────────────────── */
.rp-section { background:var(--surface);border:1.5px solid var(--border);border-radius:14px;overflow:hidden; }
.rp-section > .rp-hero-card { border:none;border-radius:0;border-bottom:1px solid var(--border);padding:22px 24px; }
.rp-section > .rp-grid { display:grid;grid-template-columns:1fr 1fr;gap:0; }
.rp-section > .rp-grid > .rp-card { border:none;border-radius:0;background:transparent;border-top:1px solid var(--border); }
.rp-section > .rp-grid > .rp-card + .rp-card { border-left:1px solid var(--border); }
.rp-section > .rp-card { border:none;border-radius:0;background:transparent;border-top:1px solid var(--border); }
@media(max-width:680px){ .rp-section > .rp-grid { grid-template-columns:1fr; } .rp-section > .rp-grid > .rp-card + .rp-card { border-left:none; } }
.rp-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media(max-width:680px){ .rp-grid { grid-template-columns:1fr; } }
.rp-card { background:var(--surface);border:1.5px solid var(--border);border-radius:14px;overflow:hidden; }
.rp-card-header { display:flex;align-items:center;gap:10px;padding:15px 18px 13px;border-bottom:1px solid var(--border); }
.rp-card-icon { width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.rp-icon-schedule { background:#dcfce7;color:#16a34a; }
.rp-icon-log      { background:#f3f4f6;color:#6b7280; }
.rp-card-title { font-size:13px;font-weight:700;color:var(--text);flex:1; }
.rp-refresh-btn { background:none;border:none;cursor:pointer;color:var(--text-3);padding:4px;border-radius:6px;display:flex;align-items:center;transition:color .15s,background .15s; }
.rp-refresh-btn:hover { color:var(--accent);background:var(--accent-lt); }
.rp-btn { display:inline-flex;align-items:center;gap:7px;padding:8px 16px;border-radius:9px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;border:none;transition:all .15s; }
.rp-btn-start { background:#16a34a;color:#fff; }
.rp-btn-start:hover { background:#15803d; }
.rp-btn-stop  { background:#dc2626;color:#fff; }
.rp-btn-stop:hover  { background:#b91c1c; }
.rp-btn-gitpull { background:var(--surface-2);color:var(--text-2);border:1.5px solid var(--border); }
.rp-btn-gitpull:hover:not(:disabled) { background:var(--surface-3,var(--border));color:var(--text); }
.rp-btn-save  { background:var(--accent);color:#fff;margin-left:auto; }
.rp-btn-save:hover  { background:var(--accent-dark,#1d4ed8); }
.rp-btn:disabled { opacity:.5;cursor:not-allowed; }
.rp-action-msg { font-size:12px;margin-top:10px;min-height:18px;color:var(--text-3); }
.rp-action-msg.ok  { color:#16a34a; }
.rp-action-msg.err { color:#dc2626; }
/* ── LLM Instance Management ─────────────────────────────────────────────── */
.rp-inst-summary-chip{font-size:11px;font-weight:600;padding:2px 9px;border-radius:20px;background:var(--surface-2);color:var(--text-2);border:1px solid var(--border);margin-left:4px}
.rp-inst-add-btn{display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:8px;font-size:12px;font-weight:600;font-family:inherit;cursor:pointer;border:1.5px solid rgba(99,102,241,.35);background:rgba(99,102,241,.08);color:#6366f1;transition:all .15s;margin-left:auto}
.rp-inst-add-btn:hover{background:rgba(99,102,241,.16);border-color:rgba(99,102,241,.6)}
.rp-instances-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px;padding:16px}
.rp-inst-card{background:var(--surface-2,var(--surface));border:1.5px solid var(--border);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:10px;transition:border-color .2s,box-shadow .2s;position:relative}
.rp-inst-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.08)}
.rp-inst-card.online{border-color:rgba(22,163,74,.35)}
.rp-inst-card.starting{border-color:rgba(245,158,11,.4)}
.rp-inst-card.error{border-color:rgba(239,68,68,.35)}
.rp-inst-header{display:flex;align-items:flex-start;gap:8px}
.rp-inst-name{font-size:14px;font-weight:700;color:var(--text);margin-top:1px}
.rp-inst-badges{display:flex;gap:4px;align-items:center;flex-shrink:0}
.rp-inst-port-badge{display:inline-flex;align-items:center;gap:3px;font-size:10px;font-weight:600;padding:2px 7px;border-radius:5px;background:var(--surface-3,var(--border));color:var(--text-3);flex-shrink:0}
.rp-inst-primary-badge{font-size:10px;font-weight:700;padding:2px 7px;border-radius:5px;background:rgba(16,185,129,.12);color:#059669}
.rp-inst-model{display:flex;align-items:center;gap:6px;margin-top:1px;min-width:0}
.rp-inst-quant-badge{font-size:10px;font-weight:700;padding:1px 6px;border-radius:4px;background:var(--surface-3,var(--border));color:var(--text-2);flex-shrink:0}
.rp-inst-status-row{display:flex;align-items:center;gap:7px}
.rp-inst-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:#94a3b8}
.rp-inst-dot.online{background:#22c55e;box-shadow:0 0 0 2px rgba(34,197,94,.25);animation:rpInstPulse 2s ease-in-out infinite}
.rp-inst-dot.starting{background:#f59e0b;animation:rpInstPulse 1s ease-in-out infinite}
.rp-inst-dot.error{background:#ef4444}
@keyframes rpInstPulse{0%,100%{opacity:1}50%{opacity:.6}}
.rp-inst-status-text{font-size:11.5px;color:var(--text-2);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-inst-progress{display:flex;flex-direction:column;gap:5px}
.rp-inst-progress-bar{height:3px;border-radius:2px;background:var(--border);overflow:hidden}
.rp-inst-progress-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#6366f1,#8b5cf6,#6366f1);background-size:200% 100%;animation:rpStartShimmer 2s linear infinite;width:60%}
.rp-inst-progress-text{font-size:10.5px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-inst-actions{display:flex;gap:6px;flex-wrap:wrap}
.rp-inst-btn{display:inline-flex;align-items:center;gap:4px;padding:5px 11px;border-radius:7px;font-size:11.5px;font-weight:600;font-family:inherit;cursor:pointer;border:none;transition:all .15s}
.rp-inst-btn:disabled{opacity:.4;cursor:not-allowed}
.rp-inst-start{background:#16a34a;color:#fff}.rp-inst-start:hover:not(:disabled){background:#15803d}
.rp-inst-stop{background:rgba(220,38,38,.1);color:#dc2626;border:1px solid rgba(220,38,38,.25)}.rp-inst-stop:hover:not(:disabled){background:rgba(220,38,38,.2)}
.rp-inst-primary-btn{background:var(--surface-2,var(--border));color:var(--text-2);border:1px solid var(--border)}.rp-inst-primary-btn:hover:not(:disabled){background:var(--surface-3,var(--border));color:var(--text)}
.rp-inst-primary-btn.active{background:rgba(16,185,129,.1);color:#059669;border-color:rgba(16,185,129,.35)}
.rp-inst-log-btn{background:transparent;color:var(--text-3);border:1px solid var(--border)}.rp-inst-log-btn:hover{color:var(--text-2);background:var(--surface-2)}
.rp-inst-edit-btn{background:transparent;color:var(--text-3);border:1px solid var(--border);padding:5px 9px;margin-left:auto}.rp-inst-edit-btn:hover{color:#6366f1;border-color:rgba(99,102,241,.4);background:rgba(99,102,241,.06)}
.rp-inst-log-section{margin-top:4px;border-radius:8px;background:var(--surface);border:1px solid var(--border);overflow:hidden}
.rp-inst-log-pre{margin:0;padding:10px 12px;font-size:10.5px;font-family:'JetBrains Mono',Consolas,monospace;white-space:pre-wrap;word-break:break-all;color:var(--text-2);max-height:200px;overflow-y:auto;line-height:1.55}
/* Instance Modal */
.rp-inst-modal{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.45);backdrop-filter:blur(4px)}
.rp-inst-modal-card{background:var(--surface);border:1.5px solid var(--border);border-radius:16px;width:460px;max-width:calc(100vw - 32px);box-shadow:0 20px 60px rgba(0,0,0,.25);overflow:hidden}
.rp-inst-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border);font-size:14px;font-weight:700;color:var(--text)}
.rp-inst-modal-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:7px;border:none;background:var(--surface-2);color:var(--text-2);cursor:pointer;transition:all .15s}
.rp-inst-modal-close:hover{background:var(--surface-3,var(--border));color:var(--text)}
.rp-inst-modal-body{padding:20px;display:flex;flex-direction:column;gap:14px}
.rp-inst-form-field{display:flex;flex-direction:column;gap:5px}
.rp-inst-form-label{font-size:12px;font-weight:600;color:var(--text-2)}
.rp-inst-form-hint{font-size:10.5px;color:var(--text-3);font-weight:400;margin-left:4px}
.rp-inst-form-input{padding:9px 12px;border-radius:9px;border:1.5px solid var(--border);background:var(--surface-2);color:var(--text);font-size:13px;font-family:inherit;outline:none;transition:border-color .15s}
.rp-inst-form-input:focus{border-color:var(--accent)}
.rp-inst-form-presets{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
.rp-inst-model-preset{font-size:10.5px;padding:3px 9px;border-radius:5px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-2);cursor:pointer;transition:all .15s}
.rp-inst-model-preset:hover{border-color:var(--accent);color:var(--accent);background:rgba(59,130,246,.06)}
.rp-inst-quant-row{display:flex;gap:6px;flex-wrap:wrap}
.rp-inst-qbtn{padding:5px 13px;border-radius:7px;border:1.5px solid var(--border);background:var(--surface-2);color:var(--text-2);font-size:12px;font-weight:600;font-family:inherit;cursor:pointer;transition:all .15s}
.rp-inst-qbtn:hover{border-color:var(--accent);color:var(--accent)}
.rp-inst-qbtn.active{border-color:#6366f1;background:rgba(99,102,241,.12);color:#6366f1}
.rp-inst-modal-footer{display:flex;gap:10px;justify-content:flex-end;padding:14px 20px;border-top:1px solid var(--border)}
.rp-inst-modal-btn{padding:9px 20px;border-radius:9px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;border:none;transition:all .15s}
.rp-inst-modal-cancel{background:var(--surface-2);color:var(--text-2);border:1.5px solid var(--border)}.rp-inst-modal-cancel:hover{background:var(--surface-3,var(--border))}
.rp-inst-modal-save{background:#6366f1;color:#fff}.rp-inst-modal-save:hover{background:#4f46e5}
/* Port chips in modal */
.rp-inst-port-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px;min-height:0}
.rp-inst-port-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:7px;font-size:11.5px;font-weight:600;font-family:monospace;cursor:pointer;border:1.5px solid var(--border);background:var(--surface-2);color:var(--text-2);transition:all .15s}
.rp-inst-port-chip:hover{border-color:rgba(99,102,241,.5);background:rgba(99,102,241,.07);color:#6366f1}
.rp-inst-port-chip.free{border-color:rgba(16,185,129,.35);background:rgba(16,185,129,.07);color:#059669}
.rp-inst-port-chip.free:hover{border-color:#059669;background:rgba(16,185,129,.14)}
.rp-inst-port-chip.used{opacity:.45;cursor:not-allowed;border-style:dashed}
/* Port overview section */
.rp-port-overview{border-top:1px solid var(--border);padding:12px 16px 16px}
.rp-port-list{display:flex;flex-direction:column;gap:7px}
.rp-port-online-dot{width:6px;height:6px;border-radius:50%;background:#22c55e;flex-shrink:0;box-shadow:0 0 0 2px rgba(34,197,94,.25)}
.rp-port-starting-dot{width:6px;height:6px;border-radius:50%;background:#f59e0b;flex-shrink:0;animation:rpInstPulse 1s ease-in-out infinite}
.rp-port-offline-dot{width:6px;height:6px;border-radius:50%;background:#94a3b8;flex-shrink:0}
.rp-port-add-btn{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:600;font-family:inherit;cursor:pointer;border:1.5px solid rgba(16,185,129,.4);background:rgba(16,185,129,.07);color:#059669;transition:all .15s;white-space:nowrap}
.rp-port-add-btn:hover{background:rgba(16,185,129,.16);border-color:#059669}
/* Instance model name (short, truncated) */
.rp-inst-model-name{font-size:12px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Redesigned port rows */
.rp-port-overview-header{display:flex;align-items:flex-start;gap:8px;margin-bottom:10px}
.rp-port-overview-title{font-size:12px;font-weight:700;color:var(--text)}
.rp-port-overview-subtitle{font-size:11px;color:var(--text-3);margin-top:2px;line-height:1.4}
.rp-port-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:var(--surface-2);border:1px solid var(--border);border-radius:10px;transition:border-color .15s}
.rp-port-row.free{border-color:rgba(16,185,129,.3);background:rgba(16,185,129,.03)}
.rp-port-row.used{}
.rp-port-row-left{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.rp-port-row-info{display:flex;flex-direction:column;gap:1px;min-width:0}
.rp-port-row-name{font-size:12.5px;font-weight:700;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-port-row-model{font-size:11px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-port-row-name-free{font-size:12.5px;font-weight:700;color:#059669}
.rp-port-row-model-free{font-size:11px;color:rgba(5,150,105,.6)}
.rp-port-free-dot{width:8px;height:8px;border-radius:50%;background:rgba(16,185,129,.3);border:1.5px dashed #059669;flex-shrink:0}
.rp-port-row-right{display:flex;align-items:center;gap:6px;flex-shrink:0}
.rp-port-url-chip{display:inline-flex;align-items:center;font-size:10.5px;font-family:monospace;color:var(--text-3);padding:3px 8px;border-radius:6px;background:var(--surface-3,var(--border));text-decoration:none;border:1px solid var(--border);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all .15s}
.rp-port-url-chip:hover{color:var(--text-2);border-color:rgba(99,102,241,.4)}
.rp-port-url-chip.rp-port-url-free{color:#059669;background:rgba(16,185,129,.07);border-color:rgba(16,185,129,.3)}
.rp-port-num-badge{font-size:10px;font-weight:700;padding:2px 7px;border-radius:5px;background:var(--surface-3,var(--border));color:var(--text-3);flex-shrink:0}
.rp-port-overview-hint{display:none}
/* ── Accordion ───────────────────────────────────────── */
.rp-acc{border-top:1px solid var(--border,#e3e5ec)}
.rp-acc-item{border-bottom:1px solid var(--border,#e3e5ec)}
.rp-acc-hd{display:flex;align-items:center;gap:12px;padding:16px 22px;cursor:pointer;user-select:none;transition:background .15s}
.rp-acc-hd:hover{background:rgba(0,0,0,.025)}
.rp-acc-icon{width:32px;height:32px;border-radius:9px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.rp-acc-hd-text{flex:1;min-width:0}
.rp-acc-title{font-size:13.5px;font-weight:700;color:#0f172a}
.rp-acc-sub{font-size:11px;color:#94a3b8;margin-top:1px}
.rp-acc-chev{color:#94a3b8;flex-shrink:0;transition:transform .25s}
.rp-acc-chev.open{transform:rotate(180deg)}
.rp-acc-body{display:none}
.rp-acc-body.open{display:block}
.rp-acc-body-inner{padding:4px 22px 22px}
.rp-acc-action-btn{font-size:11.5px;font-weight:600;color:#6366f1;background:rgba(99,102,241,.08);border:1.5px solid rgba(99,102,241,.25);border-radius:7px;padding:5px 12px;cursor:pointer;font-family:inherit;transition:all .15s;flex-shrink:0}
.rp-acc-action-btn:hover{background:rgba(99,102,241,.16);border-color:rgba(99,102,241,.5)}
.rp-inst-skeleton{padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.rp-inst-skel-block{display:flex;flex-direction:column;gap:7px;padding:14px 16px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:12px}
.rp-inst-skel-line{height:11px;border-radius:6px;background:linear-gradient(90deg,var(--border) 25%,var(--surface-3,var(--surface)) 50%,var(--border) 75%);background-size:200% 100%;animation:rpSkelShimmer 1.4s ease-in-out infinite}
@keyframes rpSkelShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.rp-inst-card-main{cursor:pointer;display:flex;flex-direction:column;gap:8px;user-select:none}
.rp-inst-card-main:hover .rp-inst-name{color:var(--accent)}
.rp-inst-chevron{color:var(--text-3);flex-shrink:0;transition:transform .2s;margin-left:auto}
.rp-inst-chevron.open{transform:rotate(180deg)}
.rp-inst-details{border-top:1px solid var(--border);padding-top:12px;margin-top:2px;display:flex;flex-direction:column;gap:10px}
.rp-inst-kv-grid{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;align-items:start}
.rp-inst-kv-key{font-size:10.5px;font-weight:600;color:var(--text-3);white-space:nowrap;padding-top:1px}
.rp-inst-kv-val{font-size:11px;color:var(--text-2);word-break:break-all;font-family:monospace}
.rp-inst-kv-val a{color:var(--accent);text-decoration:none}.rp-inst-kv-val a:hover{text-decoration:underline}
.rp-inst-kv-pod-id{display:inline-block;padding:1px 6px;border-radius:4px;background:rgba(99,102,241,.1);color:#6366f1;font-size:10.5px;font-weight:700;font-family:monospace}
/* Schedule card */
.rp-schedule-body { padding:20px;display:flex;flex-direction:column;gap:16px; }
.rp-toggle-row { display:flex;align-items:center;justify-content:space-between;cursor:pointer; }
.rp-toggle-label { font-size:13px;font-weight:600;color:var(--text); }
.rp-toggle-wrap { position:relative; }
.rp-toggle-wrap input { position:absolute;opacity:0;width:0;height:0; }
.rp-toggle-slider { display:block;width:40px;height:22px;border-radius:11px;background:#d1d5db;transition:background .2s;cursor:pointer; }
.rp-toggle-slider::after { content:'';position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.2); }
.rp-toggle-wrap input:checked + .rp-toggle-slider { background:var(--accent); }
.rp-toggle-wrap input:checked + .rp-toggle-slider::after { transform:translateX(18px); }
.rp-sched-fields { display:flex;flex-direction:column;gap:14px; }
.rp-sched-fields.hidden { display:none; }
.rp-field { display:flex;flex-direction:column;gap:5px; }
.rp-field-label { font-size:11.5px;font-weight:600;color:var(--text-3);letter-spacing:.3px;text-transform:uppercase; }
.rp-field-row { display:flex;align-items:center;gap:10px; }
.rp-field-row .rp-field { flex:1; }
.rp-field-sep { color:var(--text-3);padding-top:18px; }
.rp-time-input,.rp-select,.rp-input { width:100%;padding:8px 11px;border:1.5px solid var(--border);border-radius:8px;background:var(--surface-2);color:var(--text);font-size:13px;font-family:inherit;outline:none;transition:border-color .15s;box-sizing:border-box; }
.rp-time-input:focus,.rp-select:focus,.rp-input:focus { border-color:var(--accent); }
.rp-days-row { display:flex;gap:6px;flex-wrap:wrap; }
.rp-day-chip { cursor:pointer; }
.rp-day-chip input { display:none; }
.rp-day-chip span { display:inline-flex;align-items:center;justify-content:center;width:36px;height:34px;border-radius:8px;font-size:12px;font-weight:600;border:1.5px solid var(--border);background:var(--surface-2);color:var(--text-2);transition:all .15s;cursor:pointer; }
.rp-day-chip input:checked + span { background:var(--accent);border-color:var(--accent);color:#fff; }
.rp-sched-preview { font-size:12px;color:var(--text-3);background:var(--surface-2);border-radius:8px;padding:9px 12px;line-height:1.6;min-height:38px; }
.rp-sched-save-row { display:flex;align-items:center;gap:10px; }
.rp-save-msg { font-size:12px;color:var(--text-3);min-height:18px; }
.rp-save-msg.ok  { color:#16a34a; }
.rp-save-msg.err { color:#dc2626; }
/* Log card */
.rp-log-card { grid-column:1/-1; }
.rp-log-body { padding:8px 0; max-height:300px; overflow-y:auto; }
.rp-log-empty { padding:20px 20px;font-size:13px;color:var(--text-3);text-align:center; }
.rp-log-row { display:flex;align-items:flex-start;gap:12px;padding:10px 20px;border-bottom:1px solid var(--border); }
.rp-log-row:last-child { border-bottom:none; }
.rp-log-badge { font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:999px;white-space:nowrap;flex-shrink:0;margin-top:1px; }
.rp-log-badge.start,.rp-log-badge.manual_start { background:#dcfce7;color:#16a34a; }
.rp-log-badge.stop,.rp-log-badge.manual_stop   { background:#fee2e2;color:#dc2626; }
.rp-log-badge.err   { background:#fef9c3;color:#a16207; }
.rp-log-badge.info  { background:#e0f2fe;color:#0369a1; }
.rp-log-msg  { font-size:12.5px;color:var(--text);flex:1;line-height:1.4; }
.rp-log-ts   { font-size:11px;color:var(--text-3);white-space:nowrap;flex-shrink:0;margin-top:1px; }

/* ═══════════════════════════════════════════════════════════
   TICKETS VIEW
═══════════════════════════════════════════════════════════ */
#tickets-view { display:none; flex-direction:column; flex:1; overflow:hidden; background:var(--surface); }
#tickets-view.active { display:flex; }
.tk-view-inner { display:flex; flex-direction:column; flex:1; overflow:hidden; max-width:none; width:100%; margin:0; }

/* ── Top bar ── */
.tk-topbar { display:flex; align-items:center; justify-content:space-between; padding:16px 28px 10px; flex-shrink:0; gap:12px; position:relative; background:var(--surface); }
.tk-topbar-left { display:flex; align-items:center; gap:12px; }
.tk-topbar-title { font-size:24px;font-weight:400;letter-spacing:0;color:var(--text); }
.tk-board-picker { position:relative;display:flex;align-items:center; }
.tk-board-picker-btn { width:30px;height:30px;border:1px solid transparent;border-radius:9px;background:transparent;color:#64748b;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-board-picker-btn:hover,.tk-board-picker-btn.active { background:#f1f5f9;border-color:#e2e8f0;color:#0f172a; }
.tk-board-picker-btn svg { transition:transform .16s; }
.tk-board-picker-btn.active svg { transform:rotate(180deg); }
.tk-board-picker-panel { position:absolute;top:38px;left:0;z-index:1200;width:520px;max-width:min(520px,calc(100vw - 42px));border:1px solid var(--border);border-radius:14px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.18);overflow:hidden;display:none; }
.tk-board-picker-panel.open { display:block; }
.tk-board-picker-head { padding:13px 14px;border-bottom:1px solid #e2e8f0;background:#f8fafc; }
.tk-board-picker-title { font-size:13px;font-weight:600;color:#0f172a; }
.tk-board-picker-sub { margin-top:2px;font-size:11.5px;color:#64748b;line-height:1.35; }
.tk-board-picker-list { display:flex;flex-direction:column;gap:10px;padding:12px;max-height:420px;overflow:auto; }
.tk-board-picker-empty { padding:18px 14px;color:#64748b;font-size:12px;text-align:center; }
.tk-board-option { display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:14px;align-items:start;padding:14px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;transition:background .12s,border-color .12s,transform .12s; }
.tk-board-option[role="button"] { cursor:pointer; }
.tk-board-option[role="button"]:hover { background:#f8fafc;border-color:#cbd5e1; }
.tk-board-option--test { border-style:solid; }
.tk-board-option.is-current { border-color:#93c5fd;background:#f8fbff; }
.tk-board-option-main { min-width:0;display:flex;flex-direction:column;gap:8px; }
.tk-board-option-title-row { display:flex;align-items:center;gap:8px;min-width:0; }
.tk-board-option-icon { width:24px;height:24px;border-radius:7px;background:#f1f5f9;color:#475569;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.tk-board-option.is-current .tk-board-option-icon { background:#e0f2fe;color:#0073ea; }
.tk-board-option-name { font-size:15px;font-weight:500;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.25;flex:0 1 auto;max-width:calc(100% - 74px); }
.tk-board-pin { width:26px;height:26px;border:0;border-radius:8px;background:transparent;color:#94a3b8;display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:2px;cursor:pointer;transition:background .12s,color .12s,transform .12s;flex-shrink:0; }
.tk-board-pin:hover { background:#f1f5f9;color:#334155; }
.tk-board-pin.is-pinned { color:#f59e0b; }
.tk-board-pin.is-pinned:hover { background:#fff7ed;color:#d97706; }
.tk-board-option-desc { min-height:34px;color:#475569;font-size:12px;line-height:1.4;white-space:pre-wrap;overflow-wrap:anywhere; }
.tk-board-option-meta { display:grid;grid-template-columns:128px minmax(0,1fr);gap:4px 10px;color:#64748b;font-size:11.5px;line-height:1.35; }
.tk-board-option-meta-key { color:#94a3b8; }
.tk-board-option-meta-val { color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-board-option-badge { border:1px solid #dbe4ef;border-radius:999px;background:#fff;padding:2px 7px;font-size:10.5px;color:#475569;white-space:nowrap; }
.tk-board-option-select { display:flex;justify-content:flex-end;align-items:flex-start;min-height:100%; }
.tk-board-option-switch { width:22px;height:22px;border:1px solid #cbd5e1;border-radius:999px;background:#fff;display:flex;align-items:center;justify-content:center;color:transparent; }
.tk-board-option:not(.is-current) .tk-board-option-switch { opacity:.55;background:#f8fafc; }
.tk-board-option.is-current .tk-board-option-switch { background:#0073ea;border-color:#0073ea;color:#fff;box-shadow:0 0 0 4px rgba(0,115,234,.12); }
.tk-topbar-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.tk-ticket-search { position:relative;display:flex;align-items:center;width:auto;margin:0;padding:0 28px 14px;background:var(--surface);box-sizing:border-box; }
.tk-ticket-search-field { position:relative;display:flex;align-items:center;flex:0 1 520px;max-width:520px;min-width:0; }
.tk-ticket-search-field > svg { position:absolute;left:12px;color:var(--text-3);pointer-events:none;transition:color .14s; }
.tk-ticket-search-input { width:100%;height:36px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:#0f172a;padding:0 38px 0 34px;font-size:13px;font-family:inherit;outline:none;box-shadow:0 1px 3px rgba(15,23,42,.03);transition:background .14s,border-color .14s,box-shadow .14s; }
.tk-ticket-search-input::placeholder { color:var(--text-3); }
.tk-ticket-search-input:focus { border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1); }
.tk-ticket-search.has-query .tk-ticket-search-input { border-color:#0073ea;background:#eff6ff;box-shadow:none; }
.tk-ticket-search.has-query .tk-ticket-search-field > svg { color:#0073ea; }
.tk-ticket-search-clear { position:absolute;right:7px;width:24px;height:24px;border:0;border-radius:7px;background:transparent;color:#64748b;display:none;align-items:center;justify-content:center;padding:0;cursor:pointer;transition:background .12s,color .12s; }
.tk-ticket-search.has-query .tk-ticket-search-clear { display:flex; }
.tk-ticket-search-clear:hover { background:rgba(100,116,139,.12);color:#334155; }
.tk-ticket-search-clear svg { display:block; }
.tk-ticket-board-filter { position:relative;margin-left:10px;display:flex;align-items:center; }
.tk-ticket-board-filter-btn { display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:#0f172a;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-ticket-board-filter-btn svg { position:static;color:#0f172a;pointer-events:auto;flex-shrink:0; }
.tk-ticket-board-filter-btn:hover { border-color:var(--border);background:#f8fafc;color:#0f172a; }
.tk-ticket-board-filter-btn.active,.tk-ticket-board-filter-btn.has-filter { border-color:#eff6ff;background:#eff6ff;color:#0f172a; }
.tk-ticket-board-filter-btn.active svg,.tk-ticket-board-filter-btn.has-filter svg { color:#0f172a; }
.tk-ticket-board-filter-count-pill { display:none;align-items:center;gap:7px;color:#0f172a;font-size:12px;font-weight:400;line-height:1; }
.tk-ticket-board-filter-btn.has-filter .tk-ticket-board-filter-count-pill { display:inline-flex; }
.tk-ticket-board-filter-sep { color:#94a3b8;font-weight:400; }
.tk-ticket-board-filter-badge { display:inline;color:inherit;background:transparent;border-radius:0;font-size:12px;font-weight:400;padding:0;min-width:0;height:auto; }
.tk-ticket-board-filter-caret { color:#0f172a;display:block;flex-shrink:0; }
.tk-ticket-board-filter-pop { position:fixed;top:0;left:0;right:auto;z-index:1900;width:min(980px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);overflow:auto;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 18px 44px rgba(15,23,42,.18);padding:14px;box-sizing:border-box; }
.tk-ticket-board-filter-pop.has-reference-filter { width:min(1140px,calc(100vw - 32px)); }
.tk-ticket-board-filter-head { display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:18px; }
.tk-ticket-board-filter-title-row { display:flex;align-items:baseline;gap:8px;min-width:0;flex-wrap:wrap; }
.tk-ticket-board-filter-title { font-size:14px;font-weight:700;color:#0f172a; }
.tk-ticket-board-filter-count { font-size:13px;font-weight:400;color:#0f172a;line-height:1.35; }
.tk-ticket-board-filter-save { flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;height:31px;padding:0 11px;border:0;border-radius:8px;background:#f1f5f9;color:#0f172a;font-size:12px;font-weight:400;font-family:inherit;white-space:nowrap;cursor:pointer;transition:background .14s,color .14s,opacity .14s; }
.tk-ticket-board-filter-save:hover { background:#e2e8f0;color:#0f172a; }
.tk-ticket-board-filter-save:disabled { cursor:default;opacity:.72; }
.tk-ticket-board-filter-save.is-saved { background:#dcfce7;color:#166534;opacity:1; }
.tk-ticket-board-filter-section-title { font-size:14px;font-weight:700;color:#0f172a;margin-bottom:9px; }
.tk-ticket-board-filter-sub { font-size:11.5px;color:#64748b;margin-top:2px;line-height:1.35; }
.tk-ticket-board-filter-clear { border:0;background:transparent;color:#0073ea;font-size:11.5px;font-family:inherit;cursor:pointer;padding:2px 0;white-space:nowrap; }
.tk-ticket-board-filter-clear:hover { color:#005fc2;text-decoration:underline; }
.tk-ticket-board-filter-divider { height:1px;background:#e2e8f0;margin:16px 0 12px; }
.tk-ticket-filter-mode-switch { width:auto;height:36px;border:0;border-radius:9px;background:#f1f5f9;color:#0f172a;padding:0 13px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;font-size:12.5px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .14s,color .14s; }
.tk-ticket-filter-mode-switch:hover { background:#e2e8f0;color:#0f172a; }
.tk-ticket-board-filter-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:start; }
.tk-ticket-board-filter-pop.has-reference-filter .tk-ticket-board-filter-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
.tk-ticket-board-filter-section { min-width:0; }
.tk-ticket-task-filter-types,.tk-ticket-group-filter-types,.tk-ticket-reference-filter-types,.tk-ticket-person-filter-types { display:flex;flex-direction:column;gap:8px;max-height:222px;overflow-y:auto;overflow-x:hidden;padding-right:3px;scrollbar-width:thin; }
.tk-ticket-task-filter-check { width:100%;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:38px;padding:9px 11px;border:1px solid #f1f5f9;border-radius:10px;background:#f1f5f9;color:#0f172a;font-size:12.5px;line-height:1.25;font-family:inherit;text-align:left;cursor:pointer;transition:background .14s,border-color .14s,color .14s;box-shadow:none;overflow:hidden;background-clip:padding-box; }
.tk-ticket-task-filter-check:hover { background:#e8eef6;border-color:#dbe4ee; }
.tk-ticket-task-filter-check.is-selected { background:#dbeafe;border-color:#dbeafe;color:#0f172a;box-shadow:none; }
.tk-ticket-task-filter-check.is-selected:hover { background:#bfdbfe;border-color:#bfdbfe; }
.tk-ticket-task-filter-label { min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:inherit;font-weight:400; }
.tk-ticket-task-filter-count { flex-shrink:0;color:inherit;font-size:12px;font-weight:400;opacity:.78; }
.tk-ticket-group-filter-main { min-width:0;display:flex;align-items:center;gap:8px; }
.tk-ticket-group-filter-dot { width:9px;height:9px;border-radius:999px;background:var(--tk-group-filter-color,#94a3b8);flex-shrink:0;box-shadow:0 0 0 2px rgba(255,255,255,.9); }
.tk-ticket-person-filter-main { min-width:0;display:flex;align-items:center;gap:8px; }
.tk-ticket-person-filter-check .global-user-av { width:23px;height:23px;font-size:9.5px;box-shadow:0 1px 5px rgba(15,23,42,.12);flex:0 0 auto; }
.tk-ticket-person-filter-empty-icon { width:23px;height:23px;border-radius:999px;background:#e2e8f0;color:#64748b;display:flex;align-items:center;justify-content:center;flex:0 0 auto; }
.tk-ticket-person-filter-check.is-selected .tk-ticket-person-filter-empty-icon { background:#bfdbfe;color:#0f172a; }
.tk-ticket-board-filter-advanced { min-height:238px; }
.tk-advanced-filter-rows { display:flex;flex-direction:column;gap:9px; }
.tk-advanced-filter-row { display:grid;grid-template-columns:44px minmax(150px,1.05fr) minmax(130px,.8fr) minmax(190px,1.35fr) 30px;gap:8px;align-items:center; }
.tk-advanced-filter-row.has-join { grid-template-columns:82px minmax(150px,1.05fr) minmax(130px,.8fr) minmax(190px,1.35fr) 30px; }
.tk-advanced-filter-where { color:#0f172a;font-size:13px;font-weight:400;line-height:34px; }
.tk-advanced-filter-select { min-width:0;height:34px;border:1px solid #e2e8f0;border-radius:9px;background:#f8fafc;color:#0f172a;padding:0 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12.5px;font-weight:400;font-family:inherit;text-align:left;cursor:pointer;transition:background .14s,border-color .14s; }
.tk-advanced-filter-select:hover { background:#eef2f7;border-color:#dbe4ee; }
.tk-advanced-filter-select.is-placeholder { color:#94a3b8; }
.tk-advanced-filter-select.is-disabled { color:#94a3b8;cursor:default;background:#f8fafc; }
.tk-advanced-filter-select-text { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-advanced-filter-caret { color:#64748b;flex-shrink:0; }
.tk-advanced-filter-remove { width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:#94a3b8;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .14s,color .14s; }
.tk-advanced-filter-remove:hover { background:#f1f5f9;color:#ef4444; }
.tk-advanced-filter-add { margin-top:12px;height:34px;border:0;border-radius:9px;background:#f1f5f9;color:#0f172a;padding:0 12px;display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .14s; }
.tk-advanced-filter-add:hover { background:#e2e8f0; }
.tk-advanced-filter-menu { position:fixed;z-index:1950;min-width:220px;max-width:min(320px,calc(100vw - 32px));max-height:300px;overflow:auto;border:1px solid #e2e8f0;border-radius:12px;background:#fff;box-shadow:0 18px 40px rgba(15,23,42,.18);padding:8px;box-sizing:border-box; }
.tk-advanced-filter-menu-title { padding:7px 9px 8px;color:#0f172a;font-size:12px;font-weight:700; }
.tk-advanced-filter-menu-empty { padding:8px 9px;color:#94a3b8;font-size:12.5px; }
.tk-advanced-filter-menu-option { width:100%;min-height:34px;border:0;border-radius:8px;background:transparent;color:#0f172a;padding:7px 9px;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12.5px;font-weight:400;font-family:inherit;text-align:left;cursor:pointer; }
.tk-advanced-filter-menu-option:hover { background:#f1f5f9; }
.tk-advanced-filter-menu-option.is-selected { background:#dbeafe;color:#0f172a; }
@media (max-width: 1120px) {
  .tk-ticket-board-filter-grid,.tk-ticket-board-filter-pop.has-reference-filter .tk-ticket-board-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tk-advanced-filter-row,.tk-advanced-filter-row.has-join { grid-template-columns:1fr;gap:7px; }
  .tk-advanced-filter-where { line-height:1.2; }
  .tk-advanced-filter-remove { justify-self:start; }
}
@media (max-width: 820px) {
  .tk-ticket-board-filter-pop,.tk-ticket-board-filter-pop.has-reference-filter { width:calc(100vw - 32px); }
  .tk-ticket-board-filter-grid { grid-template-columns:1fr; }
  .tk-ticket-board-filter-pop.has-reference-filter .tk-ticket-board-filter-grid { grid-template-columns:1fr; }
}
.tk-board-automation-banner { display:none;align-items:center;gap:10px;margin:-4px 28px 0;padding:11px 13px;border-radius:10px;border:1px solid #e2e8f0;background:#f8fafc;color:#334155;box-shadow:0 1px 3px rgba(15,23,42,.04); }
.tk-board-automation-banner.is-visible { display:flex; }
.tk-board-automation-banner.is-success { border-color:#bbf7d0;background:#f0fdf4;color:#166534; }
.tk-board-automation-banner.is-noop { border-color:#e2e8f0;background:#f8fafc;color:#475569; }
.tk-board-automation-icon { width:24px;height:24px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#e2e8f0;color:#475569; }
.tk-board-automation-banner.is-success .tk-board-automation-icon { background:#dcfce7;color:#16a34a; }
.tk-board-automation-spinner { width:13px;height:13px;border-radius:999px;border:2px solid currentColor;border-right-color:transparent;animation:tkSpin .72s linear infinite; }
.tk-board-automation-check { display:none; }
.tk-board-automation-banner.is-success .tk-board-automation-spinner { display:none; }
.tk-board-automation-banner.is-success .tk-board-automation-check { display:block; }
.tk-board-automation-banner.is-noop .tk-board-automation-spinner { display:none; }
.tk-board-automation-text { font-size:12.5px;font-weight:500;line-height:1.35;color:inherit; }

/* ── LLM status banner ── */
.tk-llm-banner { padding:0 28px;flex-shrink:0; }
.tk-llm-banner-inner { display:flex;align-items:center;gap:12px;padding:11px 16px;border-radius:12px;margin-top:12px; }
.tk-llm-banner-inner--offline { background:rgba(239,68,68,.08);border:1.5px solid rgba(239,68,68,.25); }
.tk-llm-banner-inner--loading { background:rgba(245,158,11,.07);border:1.5px solid rgba(245,158,11,.25); }
.tk-llm-banner-inner--online { background:rgba(22,163,74,.07);border:1.5px solid rgba(22,163,74,.25); }
.tk-llm-banner-icon { width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.tk-llm-banner-icon--offline { background:rgba(239,68,68,.12);color:#dc2626; }
.tk-llm-banner-icon--loading { background:rgba(245,158,11,.12);color:#d97706; }
.tk-llm-banner-icon--online { background:rgba(22,163,74,.12);color:#16a34a; }
.tk-llm-banner-text { display:flex;flex-direction:column;gap:2px;flex:1;min-width:0; }
.tk-llm-banner-title { font-size:12.5px;font-weight:700;color:var(--text); }
.tk-llm-banner-sub { font-size:11px;color:var(--text-3); }
.tk-llm-banner-btn { font-size:11.5px;font-weight:700;padding:6px 14px;border-radius:8px;border:none;cursor:pointer;flex-shrink:0;transition:opacity .15s; }
.tk-llm-banner-inner--offline .tk-llm-banner-btn { background:#dc2626;color:#fff; }
.tk-llm-banner-inner--offline .tk-llm-banner-btn:hover { opacity:.85; }
.tk-llm-banner-inner--loading .tk-llm-banner-btn { background:rgba(245,158,11,.15);color:#92400e;border:1px solid rgba(245,158,11,.3); }
.tk-llm-banner-inner--online { display:none; }

/* ─── Auto-Loop Activity Banner ─────────────────────────────────────────── */
.tk-loop-banner { display:none!important;padding:0 28px;flex-shrink:0; }
.tk-loop-banner-inner {
  display:flex;align-items:center;gap:14px;
  padding:11px 16px;border-radius:12px;margin-top:10px;
  background:linear-gradient(135deg,rgba(37,99,235,.07) 0%,rgba(124,58,237,.07) 100%);
  border:1.5px solid rgba(99,102,241,.22);
  position:relative;overflow:hidden;
}
.tk-loop-banner-inner::before {
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
  background:linear-gradient(180deg,#2563eb 0%,#7c3aed 100%);
  border-radius:12px 0 0 12px;
}
.tk-loop-banner-spinner {
  width:18px;height:18px;flex-shrink:0;
  border:2.4px solid rgba(99,102,241,.18);
  border-top-color:#6366f1;border-right-color:#6366f1;
  border-radius:50%;
  animation:tk-loop-spin .9s linear infinite;
}
@keyframes tk-loop-spin { to { transform:rotate(360deg); } }
.tk-loop-banner-text { display:flex;flex-direction:column;gap:1px;flex:1;min-width:0; }
.tk-loop-banner-title {
  font-size:12px;font-weight:700;color:#4338ca;letter-spacing:.1px;
  display:flex;align-items:center;gap:6px;
}
.tk-loop-banner-title::after {
  content:'';width:6px;height:6px;border-radius:50%;background:#10b981;
  box-shadow:0 0 0 0 rgba(16,185,129,.5);
  animation:tk-loop-pulse 1.6s ease-out infinite;
}
@keyframes tk-loop-pulse {
  0%   { box-shadow:0 0 0 0 rgba(16,185,129,.55); }
  70%  { box-shadow:0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow:0 0 0 0 rgba(16,185,129,0); }
}
.tk-loop-banner-sub {
  font-size:11.5px;color:var(--text-2);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.tk-loop-banner-pill {
  flex-shrink:0;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;
  padding:3px 9px;border-radius:999px;
  background:rgba(99,102,241,.12);color:#4338ca;
}
/* Idle-Variante (Loop aktiv, aber kein Ticket gerade in Bearbeitung) */
.tk-loop-banner-inner--idle {
  background:rgba(148,163,184,.07);
  border-color:rgba(148,163,184,.22);
}
.tk-loop-banner-inner--idle::before { background:#94a3b8; }
.tk-loop-banner-inner--idle .tk-loop-banner-spinner {
  border-color:rgba(148,163,184,.15);border-top-color:transparent;border-right-color:transparent;
  animation:none;background:#94a3b8;border-radius:50%;width:8px;height:8px;border-width:0;
  margin-left:5px;
}
.tk-loop-banner-inner--idle .tk-loop-banner-title { color:var(--text-2); }
.tk-loop-banner-inner--idle .tk-loop-banner-title::after { display:none; }
.tk-loop-banner-inner--idle .tk-loop-banner-pill {
  background:rgba(148,163,184,.15);color:var(--text-2);
}

/* ── Body ── */
.tk-body { display:flex; flex-direction:column; gap:16px; flex:1; min-height:0; padding:0 0 20px; overflow:hidden; }
.tk-view-inner.is-ticket-workspace { overflow:auto; }
.tk-view-inner.is-ticket-workspace .tk-topbar,
.tk-view-inner.is-ticket-workspace .tk-ticket-search { display:none; }
.tk-view-inner.is-ticket-workspace .tk-body { flex:0 0 auto;min-height:auto;gap:0;padding:0;overflow:visible; }
@media(max-width:800px){ .tk-body { grid-template-columns:1fr; } }

/* ── List column ── */
.tk-workspace-tabs { display:flex;align-items:center;min-height:45px;padding:0;border-bottom:0;background:#f7f9fc;flex-shrink:0;overflow-x:auto;overflow-y:hidden;box-sizing:border-box; }
.tk-workspace-ticket-tabs { display:flex;align-items:center;gap:0;min-width:0;width:100%; }
.tk-workspace-tab { position:relative;display:inline-flex;align-items:center;gap:8px;max-width:340px;height:45px;padding:0 14px;border:0;border-radius:0;background:#edf1f7;color:#334155;font-size:12.5px;font-weight:400;font-family:inherit;line-height:1.25;cursor:pointer;white-space:nowrap;box-shadow:none;transition:background .14s,color .14s,opacity .14s; }
.tk-workspace-tab:not(:last-child)::after { display:none; }
.tk-workspace-tab:hover { background:#e4eaf2;color:#0f172a; }
.tk-workspace-tab.active { background:#2c7082;color:#fff;box-shadow:none; }
.tk-workspace-tab.active::after { display:none; }
.tk-workspace-board-tab { flex:0 0 auto;max-width:220px;background:#e9eef5;color:#0f172a; }
.tk-workspace-board-tab:hover { background:#dfe6ef; }
.tk-workspace-board-tab.active { background:#2c7082;color:#fff; }
.tk-workspace-board-tab::before { display:none; }
.tk-workspace-ticket-tab { padding-right:8px; }
.tk-workspace-ticket-tab.is-dragging { opacity:.58;background:#dbeafe; }
.tk-workspace-tab-board { flex-shrink:0;display:inline-flex;align-items:center;height:19px;padding:0 6px;border-radius:6px;background:rgba(255,255,255,.55);color:#64748b;font-size:10.5px;font-weight:400; }
.tk-workspace-tab.active .tk-workspace-tab-board { background:rgba(255,255,255,.18);color:#fff; }
.tk-workspace-tab-title { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-workspace-tab-number { color:#64748b;font-size:11px;font-variant-numeric:tabular-nums; }
.tk-workspace-tab-close { width:20px;height:20px;border-radius:7px;color:#64748b;display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1;flex-shrink:0;transition:background .12s,color .12s; }
.tk-workspace-tab.active .tk-workspace-tab-close { color:rgba(255,255,255,.78); }
.tk-workspace-tab-close:hover { background:rgba(15,23,42,.08);color:#0f172a; }
.tk-workspace-tab.active .tk-workspace-tab-close:hover { background:rgba(255,255,255,.18);color:#fff; }
.tk-board-workspace { display:none;flex:1;min-height:0;overflow:hidden;background:#fff; }
.tk-board-workspace.active { display:flex;flex-direction:column; }
.tk-list-col { display:flex; flex-direction:column; min-height:0; overflow:auto; flex:1;background:var(--surface);padding:0 28px 20px;box-sizing:border-box; }
/* ── Workflow bar (inside detail panel) ── */
.tk-workflow-bar { display:none!important;align-items:center;gap:0;padding:7px 16px;border-bottom:1px solid var(--border);flex-shrink:0;background:color-mix(in srgb,var(--accent) 5%,var(--surface));border-top:1px solid color-mix(in srgb,var(--accent) 12%,var(--border)); }
.tk-workflow-step { display:flex;align-items:center;gap:5px;padding:4px 8px;border-radius:8px;font-size:11px;font-weight:600;color:var(--text-3);transition:all .15s;cursor:default;user-select:none; }
.tk-workflow-step.active { color:var(--accent);background:var(--accent-lt); }
.tk-workflow-step.done { color:#22c55e; }
.tk-wf-dot { width:6px;height:6px;border-radius:50%;background:currentColor;flex-shrink:0; }
.tk-wf-arrow { color:var(--text-3);opacity:.5;flex-shrink:0; }
/* ── Topbar sync info ── */
.tk-sync-group { display:flex;flex-direction:column;align-items:flex-end;gap:1px; }
.tk-settings-panel .tk-sync-group { align-items:flex-start; }
.tk-sync-label { font-size:9.5px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em; }
.tk-sync-info { font-size:12px;font-weight:700;color:var(--text-2); }
.tk-sync-sep { width:1px;height:28px;background:var(--border);margin:0 4px; }
.tk-settings-panel .tk-sync-sep { display:none; }
.tk-interval-sel { font-size:12px;font-weight:700;border:none;background:transparent;color:var(--text-2);cursor:pointer;outline:none;padding:0; }
/* ── Settings panel ── */
.tk-settings-btn { display:flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid transparent;border-radius:8px;background:transparent;color:#0f172a;cursor:pointer;transition:background .15s ease,color .15s ease;flex-shrink:0;font-size:20px;font-weight:400;line-height:1;letter-spacing:1px;font-family:inherit;padding:0; }
.tk-settings-dots { display:flex;align-items:center;justify-content:center;height:100%;line-height:1;transform:translateY(-2px); }
.tk-settings-btn:hover,.tk-settings-btn.active { border-color:transparent;color:#0f172a;background:#f1f5f9; }
.tk-automation-top-btn { display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 11px;border:1px solid transparent;border-radius:8px;background:transparent;color:#0f172a;font-size:14px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .15s ease,color .15s ease; }
.tk-automation-top-btn svg { color:#0f172a; }
.tk-automation-top-count { color:#475569;font-size:14px;font-weight:400;white-space:nowrap; }
.tk-automation-top-btn:hover { border-color:transparent;background:#f1f5f9;color:#0f172a; }
.tk-automation-top-btn:hover svg { color:#0f172a; }
.tk-refresh-btn { display:flex;align-items:center;justify-content:center;width:30px;height:30px;border:1.5px solid var(--border);border-radius:8px;background:transparent;color:var(--text-3);cursor:pointer;transition:all .15s;flex-shrink:0; }
.tk-refresh-btn:hover { border-color:var(--accent);color:var(--accent); }
.tk-auto-loop-btn { display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border:1.5px solid var(--border);border-radius:20px;background:transparent;color:var(--text-3);font-size:11px;font-weight:600;font-family:inherit;cursor:pointer;transition:all .15s;white-space:nowrap; }
.tk-auto-loop-btn:hover { border-color:var(--accent);color:var(--accent); }
.tk-auto-loop-btn.active { border-color:#16a34a;color:#16a34a;background:#f0fdf4; }
.tk-auto-loop-btn.running { border-color:var(--accent);color:var(--accent); }
.tk-auto-loop-dot { width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block;flex-shrink:0; }
.tk-auto-loop-btn.running .tk-auto-loop-dot { animation:tkLoopPulse 1s ease-in-out infinite; }
@keyframes tkLoopPulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.tk-settings-panel { position:fixed;z-index:1000;background:var(--surface);border:1.5px solid var(--border);border-radius:12px;padding:12px 14px;width:300px;box-shadow:0 8px 32px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:3px; }
.tk-settings-info-grid { display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;padding:8px 10px;margin:2px 0 8px;border:1px solid var(--border);border-radius:10px;background:var(--bg); }
.tk-settings-title { font-size:10px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.07em;margin-bottom:2px; }
.tk-settings-row { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:5px 0;font-size:12px;color:var(--text-2);cursor:pointer;border-bottom:1px solid var(--border); }
.tk-settings-row:last-child { border-bottom:none; }
.tk-settings-row input[type=checkbox] { width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0; }
.tk-classify-cfg-row { display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:4px;align-items:center; }
.tk-classify-cfg-row input { font-size:11px;padding:3px 6px;border:1px solid var(--border);border-radius:5px;background:var(--bg);color:var(--text);width:100%; }
.tk-classify-cfg-row input:focus { outline:none;border-color:var(--accent); }
.tk-classify-cfg-del { background:none;border:none;cursor:pointer;color:var(--text-3);padding:2px 4px;border-radius:4px;font-size:13px;line-height:1; }
.tk-classify-cfg-del:hover { color:#ef4444;background:#fef2f2; }
.tk-classify-cfg-add { background:none;border:1.5px dashed var(--border);border-radius:7px;padding:4px 10px;font-size:11px;color:var(--text-3);cursor:pointer;width:100%;text-align:center; }
.tk-classify-cfg-add:hover { border-color:var(--accent);color:var(--accent); }
.tk-settings-note { font-size:11px;color:var(--text-3);line-height:1.45;margin:2px 0 6px; }
.tk-settings-open-classify { display:flex;align-items:center;gap:6px;width:100%;padding:7px 9px;border-radius:8px;border:1px solid var(--border);background:var(--bg);color:var(--text-2);font-size:12px;font-weight:600;cursor:pointer;text-align:left; }
.tk-settings-open-classify:hover { background:var(--accent-lt);border-color:var(--accent);color:var(--accent); }
.tk-settings-action { display:grid;grid-template-columns:22px minmax(0,1fr) 14px;align-items:center;gap:8px;width:100%;padding:8px 6px;border-radius:9px;border:0;background:transparent;color:var(--text);font-size:12px;font-weight:500;cursor:pointer;text-align:left;transition:background .12s,color .12s; }
.tk-settings-action:hover { background:#f8fafc;color:var(--accent); }
.tk-settings-action-icon { width:22px;height:22px;border-radius:7px;background:#f1f5f9;color:#475569;display:flex;align-items:center;justify-content:center;transition:background .12s,color .12s; }
.tk-settings-action:hover .tk-settings-action-icon { background:#e0f2fe;color:var(--accent); }
.tk-settings-action-copy { display:block;min-width:0;line-height:1.25; }
.tk-settings-action-title { display:block;color:inherit;font-size:12.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-settings-action small { display:block;font-size:10.5px;color:var(--text-3);font-weight:400;margin-top:2px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-settings-action-chevron { color:#94a3b8;justify-self:end; }
.tk-settings-action:hover .tk-settings-action-chevron { color:var(--accent); }
.tk-automation-modal { position:fixed;inset:0;z-index:3700;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);padding:22px; }
.tk-automation-modal-card { width:min(1500px,calc(100vw - 36px));height:min(880px,calc(100vh - 48px));min-height:min(720px,calc(100vh - 48px));background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:0 24px 80px rgba(15,23,42,.28);overflow:hidden;display:flex;flex-direction:column; }
.tk-automation-modal-hd { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:20px 24px 16px;background:var(--surface); }
.tk-automation-modal-title { font-size:18px;font-weight:650;color:#0f172a;letter-spacing:0; }
.tk-automation-modal-sub { font-size:16px;color:#0f172a;margin:0;padding:18px 24px 10px;background:var(--bg);border-top:1px solid var(--border); }
.tk-automation-modal-close { width:30px;height:30px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-automation-modal-close:hover { border-color:var(--accent);color:#0f172a;background:var(--accent-lt); }
.tk-automation-tabs { display:flex;gap:18px;padding:0 24px;background:var(--bg);border-bottom:1px solid var(--border); }
.tk-automation-tab { position:relative;padding:13px 0 11px;border:0;background:transparent;color:var(--text-3);font-size:12.5px;font-weight:400;font-family:inherit;cursor:pointer; }
.tk-automation-tab::after { content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:999px;background:transparent; }
.tk-automation-tab.active { color:#0f172a;font-weight:400; }
.tk-automation-tab.active::after { background:#0073ea; }
.tk-automation-modal-body { flex:1;min-height:0;padding:18px 24px 24px;background:var(--bg);overflow:hidden;display:flex;flex-direction:column; }
.tk-automation-pane { display:none; }
.tk-automation-pane.active { display:block;height:100%;min-height:0;overflow:auto;padding-right:2px; }
.tk-quality-run-banner { display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:12px;margin:0;padding:12px 24px 13px;background:#f8fafc;border-bottom:1px solid #e2e8f0; }
.tk-quality-run-banner.running { background:#f8fbff; }
.tk-quality-run-banner.passed { background:#f0fdf4;border-bottom-color:#bbf7d0; }
.tk-quality-run-banner.failed,.tk-quality-run-banner.error { background:#fef2f2;border-bottom-color:#fecaca; }
.tk-quality-run-icon { width:28px;height:28px;border-radius:9px;background:#dbeafe;color:#1d4ed8;display:flex;align-items:center;justify-content:center;position:relative; }
.tk-quality-run-banner.running .tk-quality-run-icon::before { content:"";width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .75s linear infinite; }
.tk-quality-run-banner.passed .tk-quality-run-icon { background:#dcfce7;color:#15803d; }
.tk-quality-run-banner.passed .tk-quality-run-icon::before { content:"✓";font-size:16px;font-weight:700; }
.tk-quality-run-banner.failed .tk-quality-run-icon,.tk-quality-run-banner.error .tk-quality-run-icon { background:#fee2e2;color:#dc2626; }
.tk-quality-run-banner.failed .tk-quality-run-icon::before,.tk-quality-run-banner.error .tk-quality-run-icon::before { content:"!";font-size:16px;font-weight:700; }
.tk-quality-run-content { min-width:0; }
.tk-quality-run-title { font-size:13px;color:#0f172a;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-quality-run-sub { margin-top:2px;font-size:11.8px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-quality-run-progress { margin-top:7px;height:5px;border-radius:999px;background:#e2e8f0;overflow:hidden; }
.tk-quality-run-progress span { display:block;height:100%;width:0%;border-radius:inherit;background:#0073ea;transition:width .25s ease; }
.tk-quality-run-banner.running .tk-quality-run-progress span.indeterminate { width:42%;animation:tkQualityIndeterminate 1.15s ease-in-out infinite; }
.tk-quality-run-banner.passed .tk-quality-run-progress span { background:#16a34a; }
.tk-quality-run-banner.failed .tk-quality-run-progress span,.tk-quality-run-banner.error .tk-quality-run-progress span { background:#dc2626; }
.tk-quality-run-meta { font-size:12px;color:#334155;font-variant-numeric:tabular-nums;white-space:nowrap; }
@keyframes tkQualityIndeterminate { 0%{transform:translateX(-120%)} 100%{transform:translateX(260%)} }
.tk-automation-search { position:relative;display:flex;align-items:center;width:min(520px,100%);margin-bottom:14px; }
.tk-automation-search svg { position:absolute;left:12px;color:var(--text-3);pointer-events:none; }
.tk-automation-search input { width:100%;height:38px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:#0f172a;padding:0 12px 0 36px;font-size:13px;font-family:inherit;outline:none;box-shadow:0 1px 3px rgba(15,23,42,.03); }
.tk-automation-search input:focus { border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1); }
.tk-automation-widget { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;width:100%;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:0 1px 4px rgba(15,23,42,.04);margin-bottom:10px; }
.tk-automation-widget.is-hidden { display:none; }
.tk-automation-widget-icon { display:none; }
.tk-automation-widget-title { font-size:13.5px;font-weight:650;color:#0f172a;margin-bottom:4px; }
.tk-automation-widget-text { font-size:12.5px;line-height:1.55;color:var(--text-2); }
.tk-automation-widget-text strong { color:#0f172a;font-weight:750; }
.tk-automation-endpoint { display:inline-flex;align-items:center;min-height:20px;padding:0 6px;border-radius:6px;background:#f1f5f9;border:1px solid #e2e8f0;color:#0f172a;font-family:'Menlo','Monaco','Courier New',monospace;font-size:11.5px;vertical-align:middle; }
.tk-automation-inline-group { display:inline-flex;align-items:center;gap:3px;color:#9ca3af;font-weight:600;white-space:nowrap; }
.tk-automation-inline-group::before { content:"";width:8px;height:8px;border-radius:2px;background:#9ca3af;display:inline-block; }
.tk-automation-inline-status-label { color:#0073ea;font-weight:600; }
.tk-automation-inline-status { display:inline-flex;align-items:center;justify-content:center;height:21px;padding:0 5px;border-radius:0;background:#6b7280;color:#fff;font-size:12px;font-weight:400;vertical-align:middle;white-space:nowrap; }
.tk-automation-inline-status--classification { gap:4px;background:#0ea5e9;padding:0 7px;cursor:pointer;text-decoration:none; }
.tk-automation-inline-status--classification:hover { background:#0284c7;color:#fff; }
.tk-ai-function-grid { display:grid;grid-template-columns:1fr 1fr;gap:14px; }
.tk-ai-function-card { border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:16px;box-shadow:0 1px 4px rgba(15,23,42,.04); }
.tk-ai-function-card--wide { grid-column:1/-1; }
.tk-ai-function-title { font-size:14px;font-weight:600;color:#0f172a;margin-bottom:5px; }
.tk-ai-function-sub { font-size:12.5px;color:#64748b;line-height:1.45;margin-bottom:14px; }
.tk-ai-io-block { border:1px solid #e2e8f0;border-radius:11px;background:#f8fafc;padding:12px;margin-top:10px; }
.tk-ai-io-label { font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px; }
.tk-ai-io-list { display:flex;flex-wrap:wrap;gap:6px; }
.tk-ai-io-chip { display:inline-flex;align-items:center;min-height:24px;padding:0 9px;border:1px solid #dbe4ef;border-radius:999px;background:#fff;color:#0f172a;font-size:11.5px; }
.tk-ai-io-chip.output { background:#fffbeb;border-color:#fde68a;color:#92400e; }
.tk-ai-io-note { margin-top:8px;font-size:11.5px;line-height:1.45;color:#64748b; }
.tk-ai-flow-arrow { display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:999px;background:#e0f2fe;color:#0369a1;margin:10px 0 0; }
.tk-ai-prompt-editor { margin-top:14px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;overflow:hidden; }
.tk-ai-prompt-editor-hd { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid #e2e8f0;background:#fff; }
.tk-ai-prompt-editor-title { font-size:12px;font-weight:600;color:#0f172a; }
.tk-ai-prompt-editor-sub { margin-top:2px;font-size:11px;color:#64748b; }
.tk-ai-prompt-editor-actions { display:flex;align-items:center;gap:7px;flex-shrink:0; }
.tk-ai-prompt-btn { height:30px;border:1px solid #dbe4ef;border-radius:8px;background:#fff;color:#0f172a;padding:0 10px;font-size:12px;font-family:inherit;font-weight:500;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-ai-prompt-btn:hover { background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8; }
.tk-ai-prompt-btn.primary { background:#0073ea;border-color:#0073ea;color:#fff; }
.tk-ai-prompt-btn.primary:hover { background:#005fc2;border-color:#005fc2;color:#fff; }
.tk-ai-prompt-textarea { width:100%;min-height:260px;border:0;background:#fff;color:#0f172a;padding:12px;font-size:12px;font-family:'Menlo','Monaco','Courier New',monospace;line-height:1.55;resize:vertical;outline:none;box-sizing:border-box; }
.tk-ai-prompt-status { min-height:16px;font-size:11px;color:#64748b;padding:8px 12px;border-top:1px solid #e2e8f0;background:#fff; }
.tk-ai-prompt-status.ok { color:#15803d; }
.tk-ai-prompt-status.err { color:#dc2626; }
@media(max-width:820px){ .tk-ai-function-grid { grid-template-columns:1fr; } }
.tk-quality-grid { display:grid;grid-template-columns:minmax(340px,.7fr) minmax(0,1.3fr);gap:14px;align-items:start; }
.tk-quality-card { border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:16px;box-shadow:0 1px 4px rgba(15,23,42,.04);min-width:0; }
.tk-quality-card-hd { display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px; }
.tk-quality-card-hd.compact { margin-bottom:10px;align-items:center; }
.tk-quality-kicker { font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:5px; }
.tk-quality-title { font-size:15px;font-weight:500;color:#0f172a;letter-spacing:0; }
.tk-quality-sub { margin-top:4px;font-size:12.5px;line-height:1.45;color:#64748b; }
.tk-quality-status { display:inline-flex;align-items:center;justify-content:center;min-height:26px;padding:0 10px;border-radius:999px;border:1px solid #e2e8f0;background:#f8fafc;color:#475569;font-size:11.5px;white-space:nowrap; }
.tk-quality-status.running { border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8; }
.tk-quality-status.passed { border-color:#bbf7d0;background:#f0fdf4;color:#15803d; }
.tk-quality-status.failed,.tk-quality-status.error { border-color:#fecaca;background:#fef2f2;color:#dc2626; }
.tk-quality-stats { display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:12px 0 14px; }
.tk-quality-stat { border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;padding:12px; }
.tk-quality-stat span { display:block;font-size:22px;line-height:1;color:#0f172a;font-variant-numeric:tabular-nums; }
.tk-quality-stat small { display:block;margin-top:6px;color:#64748b;font-size:11.5px; }
.tk-quality-stat.ok span { color:#15803d; }
.tk-quality-stat.fail span { color:#dc2626; }
.tk-quality-actions { display:flex;flex-wrap:wrap;gap:8px;margin-top:8px; }
.tk-quality-btn { height:34px;border:1px solid #dbe4ef;border-radius:9px;background:#fff;color:#0f172a;padding:0 12px;font-size:12.5px;font-family:inherit;font-weight:400;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-quality-btn:hover:not(:disabled) { background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8; }
.tk-quality-btn.primary { background:#0073ea;border-color:#0073ea;color:#fff; }
.tk-quality-btn.primary:hover:not(:disabled) { background:#005fc2;border-color:#005fc2;color:#fff; }
.tk-quality-btn:disabled { opacity:.58;cursor:not-allowed; }
.tk-quality-icon-btn { width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-quality-icon-btn:hover { background:#f1f5f9;color:#0f172a; }
.tk-quality-note { margin-top:12px;padding:10px 11px;border:1px solid #e2e8f0;border-radius:11px;background:#f8fafc;color:#475569;font-size:12px;line-height:1.45; }
.tk-quality-results { display:flex;flex-direction:column;gap:8px;max-height:560px;overflow:auto;padding-right:2px; }
.tk-quality-empty { font-size:12.5px;color:#64748b;padding:14px 16px;border:1px dashed #dbe4ef;border-radius:12px;background:#f8fafc; }
.tk-quality-result { display:grid;grid-template-columns:82px minmax(0,1fr) 96px;gap:10px;align-items:start;padding:11px 12px;border:1px solid #e2e8f0;border-radius:12px;background:#fff; }
.tk-quality-result.pass { border-color:#bbf7d0;background:#fbfffd; }
.tk-quality-result.fail { border-color:#fecaca;background:#fffafa; }
.tk-quality-result-status { display:inline-flex;align-items:center;justify-content:center;min-height:24px;border-radius:999px;padding:0 8px;font-size:11px;color:#475569;background:#f1f5f9; }
.tk-quality-result.pass .tk-quality-result-status { background:#dcfce7;color:#15803d; }
.tk-quality-result.fail .tk-quality-result-status { background:#fee2e2;color:#dc2626; }
.tk-quality-result-main { min-width:0; }
.tk-quality-result-title { font-size:12.5px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-quality-result-meta { margin-top:3px;font-size:11.2px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-quality-result-score { text-align:right;font-size:11.5px;color:#64748b;font-variant-numeric:tabular-nums; }
.tk-quality-result-detail { grid-column:1/-1;margin-top:2px;font-size:11.5px;line-height:1.45;color:#b91c1c;background:#fef2f2;border-radius:8px;padding:8px 9px; }
.tk-quality-result-detail.ok { color:#166534;background:#f0fdf4; }
@media(max-width:920px){ .tk-quality-grid { grid-template-columns:1fr; } .tk-quality-result { grid-template-columns:74px minmax(0,1fr); } .tk-quality-result-score { grid-column:2;text-align:left; } }
.tk-automation-rule-meta { display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:8px;color:#64748b;font-size:11.5px; }
.tk-automation-rule-meta svg { flex-shrink:0;color:#64748b; }
.tk-automation-rule-meta-item { display:inline-flex;align-items:center;gap:5px;min-height:22px; }
.tk-automation-rule-meta-label { color:#475569; }
.tk-automation-rule-meta-value { color:#0f172a;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:2px 7px;font-variant-numeric:tabular-nums; }
.tk-automation-rule-chip { justify-self:end;display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border:1px solid #dbe4ef;border-radius:999px;background:#f8fafc;color:#475569;font-size:11.5px;white-space:nowrap; }
.tk-automation-toggle { position:relative;display:inline-flex;align-items:center;width:48px;height:28px;cursor:pointer; }
.tk-automation-toggle input { position:absolute;opacity:0;pointer-events:none; }
.tk-automation-toggle span { position:absolute;inset:0;border-radius:999px;background:#cbd5e1;transition:background .16s; }
.tk-automation-toggle span::after { content:"";position:absolute;width:22px;height:22px;left:3px;top:3px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.25);transition:transform .16s; }
.tk-automation-toggle input:checked + span { background:var(--accent); }
.tk-automation-toggle input:checked + span::after { transform:translateX(20px); }
.tk-automation-actions { position:relative;display:flex;align-items:center;gap:10px;justify-self:end; }
.tk-automation-actions.is-disabled { opacity:.6; }
.tk-automation-menu-btn { width:30px;height:30px;border:1px solid transparent;border-radius:8px;background:transparent;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-automation-menu-btn:hover,.tk-automation-menu-btn.active { background:#f8fafc;border-color:#dbe4ef;color:#0f172a; }
.tk-automation-menu { position:absolute;right:0;top:36px;z-index:10;width:168px;border:1px solid #dbe4ef;border-radius:11px;background:#fff;box-shadow:0 14px 32px rgba(15,23,42,.16);padding:6px;display:none; }
.tk-automation-menu.is-open { display:block; }
.tk-automation-menu button { width:100%;height:34px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;gap:8px;padding:0 9px;font-size:12.5px;font-family:inherit;font-weight:400;cursor:pointer;text-align:left; }
.tk-automation-menu button:hover:not(:disabled) { background:#f1f5f9; }
.tk-automation-menu button:disabled { color:#94a3b8;cursor:not-allowed; }
.tk-automation-menu svg { flex-shrink:0;color:currentColor; }
.tk-automation-title-modal { position:fixed;inset:0;z-index:3900;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);padding:18px; }
.tk-automation-title-card { width:min(460px,calc(100vw - 36px));background:#fff;border:1px solid var(--border);border-radius:15px;box-shadow:0 24px 70px rgba(15,23,42,.26);overflow:hidden; }
.tk-automation-title-hd { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--border); }
.tk-automation-title-kicker { font-size:11px;color:#64748b;margin-bottom:4px; }
.tk-automation-title-title { font-size:17px;font-weight:500;color:#0f172a;letter-spacing:0; }
.tk-automation-title-close { width:30px;height:30px;border:1px solid var(--border);border-radius:8px;background:#fff;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-automation-title-close:hover { border-color:var(--accent);background:var(--accent-lt); }
.tk-automation-title-body { padding:18px 20px 20px;background:#f8fafc; }
.tk-automation-title-label { display:block;font-size:12px;color:#475569;margin-bottom:7px; }
.tk-automation-title-input { width:100%;height:42px;border:1px solid var(--border);border-radius:10px;background:#fff;color:#0f172a;padding:0 12px;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box; }
.tk-automation-title-input:focus { border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1); }
.tk-automation-title-actions { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:16px; }
.tk-automation-title-btn { height:34px;border:1px solid var(--border);border-radius:9px;background:#fff;color:#0f172a;padding:0 12px;font-size:12.5px;font-family:inherit;cursor:pointer; }
.tk-automation-title-btn:hover { background:#f1f5f9; }
.tk-automation-title-btn.primary { border-color:var(--accent);background:var(--accent);color:#fff; }
.tk-automation-title-btn.primary:hover { background:#005fc2; }
.tk-label-modal { position:fixed;inset:0;z-index:3950;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);padding:18px; }
.tk-label-card { width:min(680px,calc(100vw - 36px));background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.26);overflow:hidden; }
.tk-label-hd { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--border); }
.tk-label-title { font-size:17px;font-weight:500;color:#0f172a; }
.tk-label-sub { margin-top:5px;font-size:12.5px;line-height:1.45;color:#64748b; }
.tk-label-close { width:30px;height:30px;border:1px solid var(--border);border-radius:8px;background:#fff;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-label-close:hover { border-color:var(--accent);background:var(--accent-lt); }
.tk-label-body { padding:16px 20px 18px;background:#f8fafc; }
.tk-label-list { display:grid;grid-template-columns:1fr 1fr;gap:9px; }
.tk-label-slot { position:relative;display:grid;grid-template-columns:34px minmax(0,1fr) 30px;align-items:center;gap:8px;height:42px;border:1px solid #dbe4ef;border-radius:10px;background:#fff;padding:0 7px;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease; }
.tk-label-slot.is-empty { border-style:dashed;background:#fbfdff;color:#64748b; }
.tk-label-slot.dragging { opacity:.6;box-shadow:0 10px 24px rgba(15,23,42,.16);border-color:#93c5fd; }
.tk-label-slot.is-swap-target { background:#f8fbff;border-color:#93c5fd;transform:scale(1.01); }
.tk-label-color { width:24px;height:24px;border:1px solid rgba(15,23,42,.16);border-radius:7px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22); }
.tk-label-input { min-width:0;border:0;background:transparent;color:#0f172a;font-family:inherit;font-size:13px;outline:none; }
.tk-label-input::placeholder { color:#94a3b8; }
.tk-label-menu-btn { width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:#64748b;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-label-menu-btn:hover { background:#f1f5f9;color:#0f172a; }
.tk-label-row-menu { position:absolute;right:7px;top:36px;z-index:2;width:148px;border:1px solid #dbe4ef;border-radius:10px;background:#fff;box-shadow:0 14px 32px rgba(15,23,42,.16);padding:5px;display:none; }
.tk-label-row-menu.is-open { display:block; }
.tk-label-row-menu button { width:100%;height:32px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;gap:8px;padding:0 8px;font-family:inherit;font-size:12px;cursor:pointer;text-align:left; }
.tk-label-row-menu button:hover { background:#fef2f2;color:#dc2626; }
.tk-label-palette { position:absolute;left:8px;top:36px;z-index:3;width:228px;display:none;grid-template-columns:repeat(10,1fr);gap:5px;border:1px solid #dbe4ef;border-radius:10px;background:#fff;box-shadow:0 14px 32px rgba(15,23,42,.16);padding:8px; }
.tk-label-palette.is-open { display:grid; }
.tk-label-swatch { width:17px;height:17px;border:1px solid rgba(15,23,42,.12);border-radius:5px;cursor:pointer; }
.tk-label-swatch:hover,.tk-label-swatch.active { outline:2px solid #0f172a;outline-offset:1px; }
.tk-label-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:16px; }
.tk-label-btn { height:34px;border:1px solid var(--border);border-radius:9px;background:#fff;color:#0f172a;padding:0 12px;font-size:12.5px;font-family:inherit;cursor:pointer; }
.tk-label-btn:hover { background:#f1f5f9; }
.tk-label-btn.primary { border-color:var(--accent);background:var(--accent);color:#fff; }
.tk-label-btn.primary:hover { background:#005fc2; }
.tk-duplicate-modal { position:fixed;inset:0;z-index:3920;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);padding:18px; }
.tk-duplicate-card { width:min(520px,calc(100vw - 36px));background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.26);overflow:hidden; }
.tk-duplicate-hd { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px 14px;border-bottom:1px solid var(--border); }
.tk-duplicate-kicker { font-size:11px;color:#64748b;margin-bottom:4px; }
.tk-duplicate-title { font-size:17px;font-weight:500;color:#0f172a;letter-spacing:0; }
.tk-duplicate-sub { margin-top:5px;font-size:12.5px;line-height:1.45;color:#64748b; }
.tk-duplicate-close { width:30px;height:30px;border:1px solid var(--border);border-radius:8px;background:#fff;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-duplicate-close:hover { border-color:var(--accent);background:var(--accent-lt); }
.tk-duplicate-body { padding:18px 20px 20px;background:#f8fafc; }
.tk-duplicate-grid { display:grid;grid-template-columns:1fr 1fr;gap:12px; }
.tk-duplicate-field label { display:block;font-size:12px;color:#475569;margin-bottom:7px; }
.tk-duplicate-field select { width:100%;height:40px;border:1px solid var(--border);border-radius:10px;background:#fff;color:#0f172a;padding:0 10px;font-size:13px;font-family:inherit;outline:none; }
.tk-duplicate-field select:focus { border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1); }
.tk-duplicate-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:18px; }
.tk-duplicate-btn { height:34px;border:1px solid var(--border);border-radius:9px;background:#fff;color:#0f172a;padding:0 12px;font-size:12.5px;font-family:inherit;cursor:pointer; }
.tk-duplicate-btn:hover { background:#f1f5f9; }
.tk-duplicate-btn.primary { border-color:var(--accent);background:var(--accent);color:#fff; }
.tk-duplicate-btn.primary:hover { background:#005fc2; }
.tk-duplicate-btn:disabled { opacity:.58;cursor:default;pointer-events:none; }
.tk-duplicate-status { display:none;align-items:center;gap:8px;margin-top:14px;padding:10px 12px;border:1px solid #bfdbfe;border-radius:11px;background:#eff6ff;color:#1d4ed8;font-size:12.5px;line-height:1.35; }
.tk-duplicate-status.show { display:flex; }
.tk-duplicate-status.ok { border-color:#bbf7d0;background:#f0fdf4;color:#15803d; }
.tk-duplicate-status.err { border-color:#fecaca;background:#fef2f2;color:#dc2626; }
.tk-duplicate-spinner { width:13px;height:13px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .75s linear infinite;flex-shrink:0; }
.tk-duplicate-status.ok .tk-duplicate-spinner { animation:none;border:none;width:13px;height:13px;display:flex;align-items:center;justify-content:center; }
.tk-duplicate-status.ok .tk-duplicate-spinner::before { content:"✓";font-size:13px;font-weight:700; }
.tk-automation-history { display:flex;flex-direction:column;gap:8px; }
.tk-automation-history-empty { font-size:12.5px;color:var(--text-3);padding:14px 16px;border:1px dashed var(--border);border-radius:12px;background:var(--surface); }
.tk-queue-head { display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px; }
.tk-queue-title { font-size:16px;font-weight:500;color:#0f172a;letter-spacing:0; }
.tk-queue-sub { margin-top:4px;font-size:12.5px;color:#64748b;line-height:1.45; }
.tk-queue-refresh { width:34px;height:34px;border:0;border-radius:9px;background:transparent;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer; }
.tk-queue-refresh:hover { background:#f1f5f9;color:#0f172a; }
.tk-queue-summary { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px; }
.tk-queue-summary-card { border:1px solid #e2e8f0;border-radius:12px;background:#fff;padding:12px 13px; }
.tk-queue-summary-card span { display:block;font-size:22px;line-height:1;color:#0f172a;font-variant-numeric:tabular-nums; }
.tk-queue-summary-card small { display:block;margin-top:6px;font-size:11.5px;color:#64748b; }
.tk-queue-list { display:flex;flex-direction:column;gap:8px; }
.tk-queue-row { display:grid;grid-template-columns:108px minmax(0,1.4fr) minmax(180px,.9fr) 82px;gap:12px;align-items:center;padding:11px 13px;border:1px solid #e2e8f0;border-radius:11px;background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.035); }
.tk-queue-row.is-running { border-color:#bfdbfe;background:#f8fbff; }
.tk-queue-row.is-waiting { border-color:#fde68a;background:#fffdf5; }
.tk-queue-row.is-error { border-color:#fecaca;background:#fffafa; }
.tk-queue-row.is-done { border-color:#bbf7d0;background:#fbfffd; }
.tk-queue-status { display:inline-flex;align-items:center;gap:8px;color:#334155;font-size:12.5px;white-space:nowrap; }
.tk-queue-status-icon { width:26px;height:26px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:#f1f5f9;color:#64748b; }
.tk-queue-row.is-running .tk-queue-status-icon { background:#dbeafe;color:#1d4ed8; }
.tk-queue-row.is-running .tk-queue-status-icon::before { content:"";width:13px;height:13px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .75s linear infinite; }
.tk-queue-row.is-waiting .tk-queue-status-icon { background:#fef3c7;color:#b45309; }
.tk-queue-row.is-waiting .tk-queue-status-icon::before { content:"";width:12px;height:12px;border-radius:50%;border:2px solid currentColor;box-sizing:border-box; }
.tk-queue-row.is-done .tk-queue-status-icon { background:#dcfce7;color:#15803d; }
.tk-queue-row.is-done .tk-queue-status-icon::before { content:"✓";font-size:14px;font-weight:700; }
.tk-queue-row.is-error .tk-queue-status-icon { background:#fee2e2;color:#dc2626; }
.tk-queue-row.is-error .tk-queue-status-icon::before { content:"!";font-size:14px;font-weight:700; }
.tk-queue-row.is-warning .tk-queue-status-icon { background:#ffedd5;color:#c2410c; }
.tk-queue-row.is-warning .tk-queue-status-icon::before { content:"!";font-size:14px;font-weight:700; }
.tk-queue-main { min-width:0; }
.tk-queue-job { font-size:13px;color:#0f172a;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-queue-progress { margin-top:2px;font-size:11.6px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-queue-progress-bar { margin-top:7px;height:4px;border-radius:999px;background:#e2e8f0;overflow:hidden; }
.tk-queue-progress-bar span { display:block;height:100%;width:36%;border-radius:inherit;background:#0073ea;animation:tkQualityIndeterminate 1.25s ease-in-out infinite; }
.tk-queue-ticket { min-width:0;font-size:12px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-queue-ticket a { color:#0073ea;text-decoration:none; }
.tk-queue-ticket a:hover { text-decoration:underline; }
.tk-queue-meta { text-align:right;font-size:11.5px;color:#64748b;font-variant-numeric:tabular-nums;white-space:nowrap; }
.tk-queue-empty { padding:22px;border:1px dashed #dbe4ef;border-radius:13px;background:#fff;color:#64748b;font-size:12.5px;text-align:center; }
@media(max-width:920px){ .tk-queue-summary { grid-template-columns:repeat(2,1fr); } .tk-queue-row { grid-template-columns:1fr;gap:7px; } .tk-queue-meta { text-align:left; } }
.tk-automation-table { display:flex;flex-direction:column;gap:7px;background:var(--surface-2); }
.tk-automation-table-head { display:grid;grid-template-columns:168px minmax(0,1fr) 132px 82px;gap:12px;align-items:center;padding:0 12px 8px;color:#475569;font-size:11.5px;border-bottom:1px solid var(--border);margin-bottom:3px;background:var(--surface-2); }
.tk-automation-day { display:flex;align-items:center;justify-content:center;gap:10px;margin:10px 0 2px;color:#64748b;font-size:11.5px; }
.tk-automation-day::before,.tk-automation-day::after { content:"";height:1px;background:#e2e8f0;flex:1; }
.tk-automation-day span { background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:3px 10px; }
.tk-automation-table-row { display:grid;grid-template-columns:168px minmax(0,1fr) 132px 82px;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface); }
.tk-automation-table-row.has-details { cursor:pointer;transition:border-color .15s,background .15s; }
.tk-automation-table-row.has-details:hover { border-color:#cbd5e1;background:#f8fafc; }
.tk-automation-table-row.success,.tk-automation-table-row.ok { border-color:#bbf7d0;background:#fbfffd; }
.tk-automation-table-row.error { border-color:#fecaca;background:#fffafa; }
.tk-automation-table-row.warn { border-color:#fed7aa;background:#fffaf4; }
.tk-automation-table-row.running { border-color:#bfdbfe;background:#f8fbff; }
.tk-automation-table-row.has-details:hover { border-color:#cbd5e1;box-shadow:0 4px 14px rgba(15,23,42,.06); }
.tk-automation-table-row.empty { background:#fff;border-style:dashed;color:#64748b; }
.tk-automation-status { display:flex;align-items:center;gap:9px;min-width:0;color:#0f172a;font-size:12.5px; }
.tk-automation-status-icon { width:26px;height:26px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#f1f5f9;color:#64748b; }
.tk-automation-table-row.success .tk-automation-status-icon,.tk-automation-table-row.ok .tk-automation-status-icon { background:#dcfce7;color:#15803d; }
.tk-automation-table-row.error .tk-automation-status-icon { background:#fee2e2;color:#dc2626; }
.tk-automation-table-row.warn .tk-automation-status-icon { background:#ffedd5;color:#c2410c; }
.tk-automation-table-row.running .tk-automation-status-icon { background:#dbeafe;color:#1d4ed8; }
.tk-automation-status-text { white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-automation-rule { min-width:0; }
.tk-automation-rule-title { font-size:12.5px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-automation-rule-sub { margin-top:2px;font-size:11.2px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-automation-time,.tk-automation-duration { font-size:11.5px;color:#64748b;text-align:right;white-space:nowrap; }
.tk-automation-duration { color:#334155;font-variant-numeric:tabular-nums;display:flex;align-items:center;justify-content:flex-end;gap:7px; }
.tk-automation-detail-toggle { width:24px;height:24px;border:1px solid #dbe3ed;border-radius:8px;background:#fff;color:#475569;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,border-color .15s,color .15s,transform .15s; }
.tk-automation-detail-toggle:hover { background:#f1f5f9;border-color:#cbd5e1;color:#0f172a; }
.tk-automation-detail-toggle.is-open { transform:rotate(180deg);background:#eef6ff;border-color:#bfdbfe;color:#1d4ed8; }
.tk-automation-detail-row { display:none;margin:-5px 0 5px;padding:12px 14px 14px;border:1px solid #e2e8f0;border-top:0;border-radius:0 0 14px 14px;background:#fff;box-shadow:0 8px 18px rgba(15,23,42,.04); }
.tk-automation-detail-row.is-open { display:block; }
.tk-automation-detail-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
.tk-automation-detail-card { border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;padding:10px 11px;min-width:0; }
.tk-automation-detail-card.full { grid-column:1/-1; }
.tk-automation-detail-title { font-size:11.2px;color:#475569;margin-bottom:7px; }
.tk-automation-detail-line { display:flex;gap:8px;align-items:flex-start;font-size:12px;line-height:1.45;color:#0f172a;margin:4px 0;min-width:0; }
.tk-automation-detail-key { color:#64748b;min-width:96px;flex-shrink:0; }
.tk-automation-detail-value { min-width:0;overflow-wrap:anywhere; }
.tk-automation-detail-pills { display:flex;flex-wrap:wrap;gap:6px; }
.tk-automation-detail-pill { max-width:100%;border:1px solid #dbeafe;border-radius:999px;background:#eff6ff;color:#1d4ed8;padding:3px 8px;font-size:11.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-automation-detail-pre { margin:0;white-space:pre-wrap;font-size:11.5px;line-height:1.5;color:#334155;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
.tk-summary-prompt-modal-card { position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:720px;max-width:95vw;max-height:88vh;background:var(--surface);border:1.5px solid var(--border);border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.28);display:flex;flex-direction:column;overflow:hidden; }
.tk-summary-prompt-modal-hd { display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:18px 22px 15px;border-bottom:1px solid var(--border);background:linear-gradient(180deg,var(--surface),var(--bg)); }
.tk-summary-prompt-kicker { font-size:10px;font-weight:800;color:var(--accent);text-transform:uppercase;letter-spacing:.08em;margin-bottom:4px; }
.tk-summary-prompt-title { font-size:16px;font-weight:850;color:var(--text);letter-spacing:-.2px; }
.tk-summary-prompt-sub { font-size:12px;color:var(--text-3);line-height:1.45;margin-top:3px; }
.tk-summary-prompt-body { padding:18px 22px;overflow:auto;display:flex;flex-direction:column;gap:12px; }
.tk-summary-prompt-help { display:grid;grid-template-columns:repeat(3,1fr);gap:8px; }
.tk-summary-prompt-help div { border:1px solid var(--border);border-radius:10px;background:var(--bg);padding:9px 10px;font-size:11px;color:var(--text-2);line-height:1.35; }
.tk-summary-prompt-help strong { display:block;color:var(--text);font-size:11.5px;margin-bottom:3px; }
.tk-summary-prompt-textarea { width:100%;min-height:260px;background:var(--surface-2);border:1.5px solid var(--border);border-radius:12px;color:var(--text);padding:13px 14px;font-size:12.5px;font-family:'Menlo','Monaco','Courier New',monospace;resize:vertical;outline:none;line-height:1.55;transition:border-color .15s,box-shadow .15s; }
.tk-summary-prompt-textarea:focus { border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent); }
.tk-summary-prompt-footer { padding:14px 22px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface); }
.tk-summary-prompt-status { font-size:12px;color:var(--text-3);min-height:18px; }
/* Connection info in settings */
.tk-conn-info { display:flex;flex-direction:column;gap:5px; }
.tk-conn-loading { font-size:11px;color:var(--text-3);padding:3px 0; }
.tk-conn-row { display:flex;align-items:center;gap:7px;padding:6px 9px;background:var(--bg);border-radius:8px;border:1px solid var(--border); }
.tk-conn-dot { width:6px;height:6px;border-radius:50%;flex-shrink:0; }
.tk-conn-dot.ok { background:#22c55e; }
.tk-conn-dot.err { background:#f43f5e; }
.tk-conn-name { font-size:11.5px;font-weight:700;color:var(--text); }
.tk-conn-meta { font-size:10px;color:var(--text-3);font-family:monospace;margin-left:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:110px; }
/* ── Collapsible group ── */
.tk-group-hd { display:flex;align-items:center;gap:6px;font-size:10.5px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em;padding:8px 4px 4px;cursor:pointer;user-select:none; }
.tk-group-hd:first-of-type { padding-top:4px; }
.tk-group-toggle { margin-left:auto;display:inline-flex;align-items:center;color:var(--text-3);transition:transform .2s; }
.tk-group-toggle.collapsed { transform:rotate(-90deg); }
.tk-group-hd.matching-collapsed + .tk-card { display:none; }
.tk-cards { flex:1;overflow:visible;display:flex;flex-direction:column;gap:14px;padding-bottom:10px;min-width:max-content;background:var(--surface); }
.tk-placeholder { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--text-3);font-size:12.5px;padding:42px 0;text-align:center;flex:1; }
.tk-loading-state { display:flex;flex-direction:column;align-items:center;gap:14px;color:#64748b; }
.tk-loading-state--board { width:min(560px,calc(100vw - 56px));margin:34px auto;padding:30px 28px 28px;border:1px solid #dbeafe;border-radius:16px;background:linear-gradient(135deg,#ffffff 0%,#f8fafc 48%,#ecfeff 100%);box-shadow:0 16px 44px rgba(15,23,42,.08);box-sizing:border-box; }
.tk-loading-mark { position:relative;width:64px;height:64px;display:flex;align-items:center;justify-content:center; }
.tk-loading-logo { position:relative;z-index:2;width:46px;height:46px;border-radius:15px;background:#fff;display:flex;align-items:center;justify-content:center;border:1px solid rgba(20,184,166,.25);box-shadow:0 10px 28px rgba(20,184,166,.18); }
.tk-loading-logo img { width:29px;height:29px;object-fit:contain;display:block; }
.tk-loading-pulse { position:absolute;inset:6px;border-radius:18px;background:linear-gradient(135deg,rgba(20,184,166,.24),rgba(255,21,138,.18));animation:tkLoadingPulse 1.7s ease-in-out infinite; }
.tk-loading-pulse--two { inset:0;opacity:.45;animation-delay:.34s; }
.tk-loading-copy { display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center; }
.tk-loading-title { font-size:14px;color:#0f172a;font-weight:500; }
.tk-loading-sub { font-size:12.5px;color:#64748b; }
.tk-loading-lines { display:flex;flex-direction:column;gap:8px;width:min(430px,100%);margin-top:4px; }
.tk-loading-line { height:10px;border-radius:999px;background:linear-gradient(90deg,#e2e8f0 20%,#f8fafc 42%,#ccfbf1 54%,#f8fafc 66%,#e2e8f0 82%);background-size:240% 100%;animation:tkLoadingShimmer 1.25s ease-in-out infinite; }
.tk-loading-line:nth-child(2){width:78%;animation-delay:.08s}.tk-loading-line:nth-child(3){width:56%;animation-delay:.16s}
.tk-loading-skeleton-table { width:100%;margin-top:6px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;overflow:hidden;box-shadow:0 1px 3px rgba(15,23,42,.03); }
.tk-loading-skeleton-head,.tk-loading-skeleton-row { display:grid;grid-template-columns:minmax(150px,1.15fr) 110px minmax(160px,1.2fr) 130px 100px 98px minmax(120px,.9fr);align-items:center;gap:0;min-height:32px;border-bottom:1px solid #eef2f7; }
.tk-loading-skeleton-head { background:#fff;color:#0f172a;font-size:11px;font-weight:400;text-align:center; }
.tk-loading-skeleton-head span { min-width:0;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-right:1px solid #eef2f7; }
.tk-loading-skeleton-head span:last-child { border-right:0; }
.tk-loading-skeleton-row { min-height:42px;background:#fff; }
.tk-loading-skeleton-row:last-child { border-bottom:0; }
.tk-loading-skel-cell { height:11px;margin:0 10px;border-radius:999px;background:linear-gradient(90deg,#e2e8f0 20%,#f8fafc 42%,#ccfbf1 54%,#f8fafc 66%,#e2e8f0 82%);background-size:240% 100%;animation:tkLoadingShimmer 1.25s ease-in-out infinite;border-right:1px solid transparent; }
.tk-loading-skeleton-row .tk-loading-skel-cell:nth-child(2){width:58%;justify-self:center;animation-delay:.04s}
.tk-loading-skeleton-row .tk-loading-skel-cell:nth-child(3){width:88%;animation-delay:.08s}
.tk-loading-skeleton-row .tk-loading-skel-cell:nth-child(4){width:72%;justify-self:center;animation-delay:.12s}
.tk-loading-skeleton-row .tk-loading-skel-cell:nth-child(5){width:64%;justify-self:center;animation-delay:.16s}
.tk-loading-skeleton-row .tk-loading-skel-cell:nth-child(6){width:52%;justify-self:center;animation-delay:.20s}
.tk-loading-skeleton-row .tk-loading-skel-cell:nth-child(7){width:78%;animation-delay:.24s}
@keyframes tkLoadingShimmer { from { background-position:220% 0; } to { background-position:-220% 0; } }
@keyframes tkLoadingPulse { 0%,100% { transform:scale(.88);opacity:.58; } 50% { transform:scale(1.08);opacity:1; } }

/* ── Cards ── */
.tk-card { background:var(--surface);border:1.5px solid var(--border);border-radius:12px;padding:12px 14px;cursor:pointer;transition:border-color .18s,box-shadow .18s,background .18s,transform .12s;display:flex;gap:10px;align-items:stretch; }
.tk-card:hover { border-color:rgba(var(--accent-rgb),.4);box-shadow:0 3px 12px rgba(0,0,0,.08);transform:translateY(-1px); }
.tk-card.selected { border-color:var(--accent);background:var(--accent-lt);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1),0 2px 8px rgba(0,0,0,.06); }
.tk-card-stripe { width:3px;border-radius:3px;flex-shrink:0;align-self:stretch; }
.tk-card-stripe.privaicy { background:#ec4899; }
.tk-card-stripe.matching { background:#9ca3af; }
.tk-card-stripe.inbearbeitung { background:#f59e0b; }
.tk-card-stripe.bittepruefen { background:#f97316; }
.tk-card-stripe.ueberarbeiten { background:#f43f5e; }
.tk-card-stripe.bereit { background:#22c55e; }
.tk-card-stripe.versendet { background:#16a34a; }
.tk-card-stripe.spam { background:#7c3aed; }
.tk-card-stripe.unknown { background:var(--border); }
.tk-card-body { flex:1;min-width:0;display:flex;flex-direction:column;gap:4px; }
.tk-card-row1 { display:flex;align-items:center;gap:6px; }
.tk-card-nr { font-size:10.5px;color:var(--text-3);font-weight:700;font-family:monospace; }
.tk-card-name { font-size:12.5px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-card-snippet { font-size:11.5px;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4; }
.tk-card-foot { display:flex;align-items:center;gap:4px;margin-top:1px; }
.tk-card-date { font-size:10.5px;color:var(--text-3); }

/* ── Detail column ── */
.tk-detail-col { display:flex;flex-direction:column;min-height:0;overflow:hidden; }
.tk-detail-placeholder { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--text-3);font-size:13px;flex:1;text-align:center; }
.tk-detail { display:flex;flex-direction:column;flex:1;overflow-y:auto;background:var(--surface);border:1.5px solid var(--border);border-radius:16px;min-height:0;box-shadow:0 2px 16px rgba(0,0,0,.05); }
.tk-ticket-workspace { display:none;flex:1;min-height:0;overflow:hidden;background:#f8fafc; }
.tk-ticket-workspace.active { display:flex;flex-direction:column; }
.tk-ticket-workspace-loader { display:none;flex:1;min-height:calc(100vh - 101px);align-items:center;justify-content:center;background:#f8fafc;padding:28px;box-sizing:border-box; }
.tk-ticket-workspace-loader .tk-loading-state { width:min(760px,100%); }
.tk-ticket-workspace .tk-detail { width:100%;height:100%;border:0;border-radius:0;box-shadow:none;flex:1;overflow:auto;background:#f8fafc; }
.tk-view-inner.is-ticket-workspace .tk-ticket-workspace { flex:0 0 auto;min-height:auto;overflow:visible; }
.tk-view-inner.is-ticket-workspace .tk-ticket-workspace .tk-detail { height:auto;min-height:calc(100vh - 101px);overflow:visible; }
.tk-ticket-workspace .tk-detail-placeholder { display:none !important; }
.tk-ticket-modal { position:fixed;inset:0;z-index:3600;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);display:none;align-items:center;justify-content:center;padding:24px; }
.tk-ticket-modal .tk-detail { width:min(1500px,calc(100vw - 36px));height:min(880px,calc(100vh - 48px));max-height:calc(100vh - 48px);flex:none;box-shadow:0 24px 80px rgba(15,23,42,.28),0 4px 18px rgba(15,23,42,.16); }
.tk-ticket-modal .tk-detail-placeholder { display:none !important; }
.tk-detail-close { margin-left:0;width:32px;height:32px;border:0;border-radius:9px;background:transparent;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s; }
.tk-detail-close:hover { color:#0f172a;background:#f1f5f9; }
.tk-detail-menu-btn { width:32px;height:32px;border:0;border-radius:9px;background:transparent;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s;font-size:21px;font-weight:800;letter-spacing:.8px;line-height:1;padding:0 0 5px;box-sizing:border-box; }
.tk-detail-menu-btn:hover,.tk-detail-menu-btn.active { background:#f1f5f9;color:#0f172a; }
.tk-detail-nav-btn { position:relative;width:32px;height:32px;border:1px solid #dbe4ef;border-radius:9px;background:#fff;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,border-color .15s,color .15s; }
.tk-detail-nav-btn:hover:not(:disabled) { background:#f1f5f9;border-color:#cbd5e1;color:#0f172a; }
.tk-detail-nav-btn:disabled { color:#cbd5e1;background:#fff;border-color:#e5e7eb;cursor:default; }
.tk-detail-nav-btn[data-tk-tooltip]::after { content:attr(data-tk-tooltip);position:absolute;right:50%;top:calc(100% + 9px);transform:translateX(50%) translateY(-2px);z-index:80;white-space:nowrap;padding:7px 9px;border-radius:8px;background:#111827;color:#fff;font-size:11px;font-weight:400;line-height:1.2;box-shadow:0 10px 24px rgba(15,23,42,.22);opacity:0;pointer-events:none;transition:opacity .14s ease,transform .14s ease; }
.tk-detail-nav-btn[data-tk-tooltip]::before { content:"";position:absolute;right:50%;top:calc(100% + 4px);transform:translateX(50%);border:5px solid transparent;border-bottom-color:#111827;opacity:0;pointer-events:none;transition:opacity .14s ease;z-index:81; }
.tk-detail-nav-btn[data-tk-tooltip]:hover:not(:disabled)::after { opacity:1;transform:translateX(50%) translateY(0); }
.tk-detail-nav-btn[data-tk-tooltip]:hover:not(:disabled)::before { opacity:1; }
.tk-detail-menu { position:absolute;right:40px;top:38px;z-index:30;width:360px;border:1px solid #dbe4ef;border-radius:13px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.18);padding:8px;display:none; }
.tk-detail-menu.is-open { display:block; }
.tk-detail-menu button { width:100%;height:34px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;gap:8px;padding:0 9px;font-size:12.5px;font-family:inherit;font-weight:400;cursor:pointer;text-align:left; }
.tk-detail-menu button:hover:not(:disabled) { background:#fef2f2;color:#dc2626; }
.tk-detail-menu button:disabled { color:#94a3b8;cursor:not-allowed; }
.tk-detail-menu-divider { height:1px;background:#e2e8f0;margin:8px 2px; }
body.tk-modal-open { overflow:hidden; }
@media(max-width:760px){
  .tk-ticket-modal { padding:10px;align-items:stretch; }
  .tk-ticket-modal .tk-detail { width:100%;height:calc(100vh - 20px);max-height:calc(100vh - 20px);border-radius:14px; }
  .tk-workspace-tabs { padding:0; }
  .tk-ticket-workspace .tk-detail { height:100%; }
}

/* Detail header */
.tk-detail-hd { padding:18px 22px 14px;border-bottom:0;flex-shrink:0;display:flex;align-items:center;gap:16px;background:#fff; }
.tk-detail-hd-top { position:relative;display:flex;align-items:center;gap:8px;margin-left:auto;order:2; }
.tk-detail-back { width:32px;height:32px;border:1px solid #dbe4ef;border-radius:9px;background:#fff;color:#0f172a;display:none;align-items:center;justify-content:center;cursor:pointer;transition:all .15s;flex:0 0 auto; }
.tk-detail-back:hover { border-color:#0073ea;background:#eff6ff;color:#0073ea; }
.tk-detail-nr-badge { font-size:10.5px;font-weight:700;color:var(--text-2);background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:2px 9px;font-family:monospace; }
.tk-detail-id-block { display:flex;align-items:center;gap:6px; }
.tk-detail-id-label { font-size:9.5px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.5px; }
/* Status badge — shared by pill, picker, card list */
.tk-sbadge { display:inline-block;font-size:10.5px;font-weight:700;padding:3px 11px;border-radius:999px;white-space:nowrap; }
.tk-sbadge.privaicy    { background:#fce7f3;color:#be185d; }
.tk-sbadge.matching    { background:#f3f4f6;color:#4b5563; }
.tk-sbadge.klassifizierung { background:#e0f2fe;color:#0369a1; }
.tk-sbadge.datenschutzaufgabe { background:#e0f2fe;color:#0369a1; }
.tk-sbadge.inbearbeitung { background:#dbeafe;color:#1d4ed8; }
.tk-sbadge.bittepruefen  { background:#ffedd5;color:#c2410c; }
.tk-sbadge.ueberarbeiten { background:#ffe4e6;color:#be123c; }
.tk-sbadge.bereit      { background:#dcfce7;color:#15803d; }
.tk-sbadge.versendet   { background:#bbf7d0;color:#166534; }
.tk-sbadge.spam        { background:#ede9fe;color:#6d28d9; }
.tk-sbadge.unknown     { background:var(--bg);color:var(--text-3); }
/* Keep old pill class aliases for any remaining references */
.tk-detail-status-pill { font-size:10.5px;font-weight:700;padding:3px 11px;border-radius:999px; }
.tk-detail-status-pill.privaicy    { background:#fce7f3;color:#be185d; }
.tk-detail-status-pill.matching    { background:#f3f4f6;color:#4b5563; }
.tk-detail-status-pill.klassifizierung { background:#e0f2fe;color:#0369a1; }
.tk-detail-status-pill.datenschutzaufgabe { background:#e0f2fe;color:#0369a1; }
.tk-detail-status-pill.inbearbeitung { background:#dbeafe;color:#1d4ed8; }
.tk-detail-status-pill.bittepruefen  { background:#ffedd5;color:#c2410c; }
.tk-detail-status-pill.ueberarbeiten { background:#ffe4e6;color:#be123c; }
.tk-detail-status-pill.bereit      { background:#dcfce7;color:#15803d; }
.tk-detail-status-pill.versendet   { background:#bbf7d0;color:#166534; }
.tk-detail-status-pill.spam        { background:#ede9fe;color:#6d28d9; }
.tk-detail-status-pill.unknown     { background:var(--bg);color:var(--text-3); }
/* Custom status picker */
.tk-status-picker { position:relative;display:inline-block; }
.tk-status-current { display:inline-flex;align-items:center;gap:7px;padding:5px 10px 5px 5px;border-radius:9px;border:1.5px solid var(--border);background:var(--surface);cursor:pointer;transition:border-color .15s,box-shadow .15s;font-family:inherit }
.tk-status-current:hover { border-color:#be185d;box-shadow:0 0 0 3px rgba(190,24,93,.07); }
.tk-status-current:focus { outline:none;border-color:#be185d; }
.tk-status-chev { color:var(--text-3);transition:transform .2s;flex-shrink:0; }
.tk-status-chev.open { transform:rotate(180deg); }
.tk-status-dropdown { position:absolute;top:calc(100% + 6px);left:0;z-index:200;background:var(--surface);border:1.5px solid var(--border);border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.13),0 2px 8px rgba(0,0,0,.07);padding:5px;display:flex;flex-direction:column;gap:2px;min-width:170px;animation:tkDropIn .15s ease }
@keyframes tkDropIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.tk-status-opt { display:flex;align-items:center;padding:6px 8px;border-radius:8px;cursor:pointer;transition:background .1s; }
.tk-status-opt:hover { background:var(--surface-2); }
.tk-detail-title { display:flex;align-items:center;min-height:32px;margin-left:6px;font-size:18px;font-weight:700;color:var(--text);letter-spacing:0;line-height:1.35; }
.tk-detail-dates { font-size:11px;color:var(--text-3);margin-top:5px; }
.tk-detail-tabs { display:flex;align-items:center;gap:24px;padding:0 22px 0 38px;background:var(--surface);border-bottom:0; }
.tk-detail-tab { position:relative;display:inline-flex;align-items:center;gap:7px;padding:13px 0 11px;border:0;background:transparent;color:#0f172a;font-size:12.5px;font-weight:400;font-family:inherit;cursor:pointer; }
.tk-detail-tab + .tk-detail-tab { margin-left:10px; }
.tk-detail-tab + .tk-detail-tab::before { content:"|";position:absolute;left:-20px;top:50%;transform:translateY(-50%);color:#cbd5e1;font-weight:400;pointer-events:none; }
.tk-detail-tab svg { color:currentColor; }
.tk-detail-tab::after { content:"";position:absolute;left:-8px;right:-8px;bottom:-1px;height:2px;border-radius:999px;background:transparent; }
.tk-detail-tab.active { color:#0f172a;font-weight:400; }
.tk-detail-tab.active::after { background:var(--accent); }
.tk-internal-notes { flex:0 0 auto;padding:10px 28px 12px;background:#f8fafc;border-top:1px solid #eef2f7;border-bottom:1px solid #e2e8f0; }
.tk-internal-notes-head { min-height:34px;display:flex;align-items:center;justify-content:space-between;gap:14px; }
.tk-internal-notes-title-wrap { min-width:0;display:flex;align-items:center;gap:9px; }
.tk-internal-notes-icon { width:28px;height:28px;border-radius:8px;background:#fff;color:#0f766e;border:1px solid #dbe4ef;display:flex;align-items:center;justify-content:center;flex:0 0 auto; }
.tk-internal-notes-title { font-size:14px;font-weight:500;color:#0f172a;line-height:1.2; }
.tk-internal-notes-count { min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:#e2e8f0;color:#334155;display:inline-flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:400;box-sizing:border-box; }
.tk-internal-note-add { height:32px;padding:0 11px;border:0;border-radius:9px;background:#fff;color:#0f172a;display:inline-flex;align-items:center;gap:7px;font:inherit;font-size:12.5px;font-weight:400;white-space:nowrap;cursor:pointer;box-shadow:inset 0 0 0 1px #dbe4ef;transition:background .14s,box-shadow .14s,color .14s; }
.tk-internal-note-add:hover { background:#eef2f7;box-shadow:inset 0 0 0 1px #cbd5e1;color:#0f172a; }
.tk-internal-note-composer { margin-top:10px;padding:10px;border:1px solid #dbe4ef;border-radius:10px;background:#fff; }
.tk-internal-note-type-row { display:inline-flex;flex-wrap:wrap;gap:3px;margin-bottom:9px;padding:3px;border-radius:9px;background:#f1f5f9; }
.tk-internal-note-type { min-height:27px;border:0;border-radius:7px;background:transparent;color:#475569;padding:0 9px;font:inherit;font-size:12px;font-weight:400;cursor:pointer;transition:background .14s,color .14s; }
.tk-internal-note-type:hover { background:#e2e8f0;color:#0f172a; }
.tk-internal-note-type.active { background:#fff;color:#0f172a;box-shadow:0 1px 2px rgba(15,23,42,.08); }
.tk-internal-note-input,.tk-internal-note-body { width:100%;min-height:76px;resize:vertical;border:1px solid #dbe4ef;border-radius:9px;background:#fff;color:#0f172a;padding:10px 11px;font:inherit;font-size:13px;line-height:1.45;box-sizing:border-box;outline:none;transition:border-color .14s,box-shadow .14s,background .14s; }
.tk-internal-note-input:focus,.tk-internal-note-body:focus { border-color:#0f766e;box-shadow:0 0 0 3px rgba(15,118,110,.10); }
.tk-internal-note-actions { display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:9px; }
.tk-internal-note-status { margin-right:auto;font-size:12px;color:#64748b; }
.tk-internal-note-cancel,.tk-internal-note-save { border:0;border-radius:8px;background:transparent;color:#0f172a;font:inherit;font-size:12.5px;font-weight:400;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:0 9px;transition:background .14s,color .14s; }
.tk-internal-note-cancel:hover { background:#f1f5f9;color:#0f172a; }
.tk-internal-note-save { background:#0f172a;color:#fff;padding:0 12px; }
.tk-internal-note-save:hover:not(:disabled) { background:#111827; }
.tk-internal-note-save:disabled { opacity:.55;cursor:not-allowed; }
.tk-internal-notes-list { display:flex;flex-direction:column;gap:10px;margin-top:10px;max-height:none;overflow:visible; }
.tk-internal-notes-list:empty { margin-top:0; }
.tk-internal-notes-empty { grid-column:1/-1;padding:9px 10px;border:1px dashed #dbe4ef;border-radius:9px;background:#fff;color:#64748b;font-size:12.5px; }
.tk-internal-note-item { position:relative;display:flex;align-items:flex-start;gap:10px;padding:0;border:0;border-radius:0;background:transparent;overflow:visible; }
.tk-internal-note-item::before { display:none; }
.tk-internal-note-avatar { position:relative;flex:0 0 auto;padding-top:2px; }
.tk-internal-note-avatar .global-user-av { width:34px;height:34px;font-size:11.5px;box-shadow:0 2px 10px rgba(15,23,42,.14); }
.tk-internal-note-avatar::after { content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%) translateY(3px);z-index:6500;max-width:240px;padding:6px 9px;border-radius:7px;background:#0f172a;color:#fff;font-size:11.5px;font-weight:400;line-height:1.25;white-space:nowrap;box-shadow:0 12px 28px rgba(15,23,42,.26);opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease; }
.tk-internal-note-avatar::before { content:"";position:absolute;left:50%;bottom:calc(100% + 3px);transform:translateX(-50%) translateY(3px);z-index:6501;border:5px solid transparent;border-top-color:#0f172a;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease; }
.tk-internal-note-avatar:hover::after,.tk-internal-note-avatar:hover::before { opacity:1;transform:translateX(-50%) translateY(0); }
.tk-internal-note-bubble { position:relative;flex:0 1 80%;max-width:80%;min-width:min(420px,calc(100% - 46px));border:1px solid #e2e8f0;border-radius:14px;background:#fff;padding:10px 11px 8px;box-shadow:0 1px 3px rgba(15,23,42,.04); }
.tk-internal-note-bubble::before { content:"";position:absolute;left:-6px;top:16px;width:11px;height:11px;background:#fff;border-left:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;transform:rotate(45deg);border-radius:0 0 0 3px; }
.tk-internal-note-item-head { display:flex;align-items:center;gap:8px;min-width:0;margin-bottom:7px; }
.tk-internal-note-author { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a;font-size:13px;font-weight:600;line-height:1.2; }
.tk-internal-note-type-wrap { position:relative;display:inline-flex;flex:0 0 auto; }
.tk-internal-note-badge { border:0;flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:0 8px;border-radius:7px;background:#e0f2fe;color:#075985;font:inherit;font-size:11.5px;font-weight:400;cursor:pointer;transition:filter .14s,box-shadow .14s,transform .14s; }
.tk-internal-note-badge:hover,.tk-internal-note-badge.active { filter:saturate(1.08) brightness(.98);box-shadow:0 0 0 3px rgba(15,118,110,.08); }
.tk-internal-note-badge-caret { opacity:.68; }
.tk-internal-note-badge.call { background:#dcfce7;color:#166534; }
.tk-internal-note-badge.meeting { background:#ede9fe;color:#6d28d9; }
.tk-internal-note-type-menu { position:absolute;left:0;top:calc(100% + 7px);z-index:95;width:230px;padding:7px;border:1px solid #dbe4ef;border-radius:12px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.16);display:none;flex-direction:column;gap:3px; }
.tk-internal-note-type-menu.is-open { display:flex; }
.tk-internal-note-type-menu button { width:100%;height:34px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;gap:9px;padding:0 9px;font:inherit;font-size:12.5px;font-weight:400;text-align:left;cursor:pointer; }
.tk-internal-note-type-menu button:hover,.tk-internal-note-type-menu button.active { background:#f1f5f9; }
.tk-internal-note-type-dot { width:10px;height:10px;border-radius:4px;background:#0f766e;box-shadow:0 0 0 3px rgba(15,118,110,.10); }
.tk-internal-note-type-dot.call { background:#16a34a;box-shadow:0 0 0 3px rgba(22,163,74,.10); }
.tk-internal-note-type-dot.meeting { background:#7c3aed;box-shadow:0 0 0 3px rgba(124,58,237,.10); }
.tk-internal-note-item--call .tk-internal-note-bubble { border-color:#bbf7d0;background:linear-gradient(180deg,#fff 0%,#fbfffd 100%); }
.tk-internal-note-item--call .tk-internal-note-bubble::before { border-color:#bbf7d0;background:#fff; }
.tk-internal-note-item--meeting .tk-internal-note-bubble { border-color:#ddd6fe;background:linear-gradient(180deg,#fff 0%,#fdfcff 100%); }
.tk-internal-note-item--meeting .tk-internal-note-bubble::before { border-color:#ddd6fe;background:#fff; }
.tk-internal-note-meta { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b;font-size:11.5px; }
.tk-internal-note-item-actions { position:relative;display:flex;align-items:center;gap:4px;margin-left:auto; }
.tk-internal-note-kebab-btn { width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .14s,color .14s; }
.tk-internal-note-kebab-btn:hover,.tk-internal-note-kebab-btn.active { background:#f1f5f9;color:#0f172a; }
.tk-internal-note-menu { position:absolute;right:0;top:34px;z-index:100;width:184px;padding:7px;border:1px solid #dbe4ef;border-radius:12px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.16);display:none; }
.tk-internal-note-menu.is-open { display:block; }
.tk-internal-note-menu button { width:100%;height:34px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;gap:9px;padding:0 9px;font:inherit;font-size:12.5px;font-weight:400;text-align:left;cursor:pointer; }
.tk-internal-note-menu button:hover { background:#f1f5f9;color:#0f172a; }
.tk-internal-note-menu button.tk-internal-note-menu-danger:hover { background:#fef2f2;color:#dc2626; }
.tk-internal-note-text { color:#0f172a;font-size:13px;line-height:1.48;white-space:normal;overflow-wrap:anywhere;padding:5px 2px 2px; }
.tk-internal-note-text-empty { color:#94a3b8;font-style:italic; }
.tk-internal-note-body { min-height:62px;resize:vertical;background:transparent;border-color:transparent;border-radius:10px;padding:7px 2px 4px;box-shadow:none; }
.tk-internal-note-body:focus { background:#f8fafc;border-color:#dbe4ef;box-shadow:0 0 0 3px rgba(15,118,110,.08);padding:7px 9px 4px; }
.tk-internal-note-footer { display:flex;justify-content:flex-end;align-items:center;min-height:18px;margin-top:5px;color:#94a3b8;font-size:11.5px;line-height:1.2; }
@media(max-width:760px){
  .tk-internal-notes { padding:12px 14px; }
  .tk-internal-notes-head { align-items:flex-start;flex-direction:column; }
  .tk-internal-note-add { width:100%;justify-content:center; }
  .tk-internal-note-item { gap:8px; }
  .tk-internal-note-avatar .global-user-av { width:30px;height:30px;font-size:10px; }
  .tk-internal-note-bubble { flex:1 1 auto;max-width:none;min-width:0;border-radius:12px;padding:9px; }
}
.tk-internal-notes { padding:12px 28px 14px;background:#f8fafc;border-top:1px solid #eef2f7;border-bottom:1px solid #e2e8f0; }
.tk-internal-notes-head { min-height:34px;display:flex;align-items:center;justify-content:flex-start;gap:14px; }
.tk-internal-notes-title-wrap { min-width:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.tk-internal-notes-title { font-size:14.5px;font-weight:500;color:#0f172a;line-height:1.2; }
.tk-internal-note-add { height:32px;padding:0 12px;border:0;border-radius:9px;background:#fff;color:#0f172a;display:inline-flex;align-items:center;gap:7px;font:inherit;font-size:12.5px;font-weight:400;white-space:nowrap;cursor:pointer;box-shadow:inset 0 0 0 1px #dbe4ef;transition:background .14s,box-shadow .14s,color .14s; }
.tk-internal-note-add:hover { background:#eef2f7;box-shadow:inset 0 0 0 1px #cbd5e1;color:#0f172a; }
.tk-internal-notes-list { position:relative;display:flex;flex-direction:column;gap:16px;margin-top:13px;max-height:none;overflow:visible; }
.tk-internal-notes-list:empty { margin-top:0; }
.tk-internal-notes-empty { padding:10px 0;border:0;border-radius:0;background:transparent;color:#64748b;font-size:12.5px; }
.tk-internal-note-item { position:relative;display:flex;align-items:flex-start;gap:12px;padding:0;border:0;border-radius:0;background:transparent;overflow:visible; }
.tk-internal-note-item::before { display:none; }
.tk-internal-notes-list.has-timeline .tk-internal-note-item:not(:last-child)::after { content:"";position:absolute;left:16px;top:38px;bottom:-18px;width:2px;border-radius:999px;background:linear-gradient(180deg,#cbd5e1,#e2e8f0);z-index:0; }
.tk-internal-note-avatar { position:relative;z-index:2;flex:0 0 auto;padding-top:0; }
.tk-internal-note-avatar .global-user-av {
  width:34px;
  height:34px;
  font-size:11.5px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.30),
    inset 0 -9px 16px rgba(15,23,42,.13),
    0 2px 10px rgba(15,23,42,.14);
}
.tk-internal-note-main { flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:7px; }
.tk-internal-note-activity-row { min-height:34px;display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap; }
.tk-internal-note-author { min-width:0;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a;font-size:13px;font-weight:500;line-height:1.2; }
.tk-internal-note-action-text { color:#64748b;font-size:12.5px;font-weight:400;line-height:1.2; }
.tk-internal-note-dot { width:4px;height:4px;border-radius:999px;background:#94a3b8;display:inline-flex;align-self:center;margin:0 2px;flex:0 0 auto; }
.tk-internal-note-time { color:#64748b;font-size:12.5px;font-weight:400;line-height:1.2; }
.tk-internal-note-type-wrap { position:relative;display:inline-flex;flex:0 0 auto; }
.tk-internal-note-badge { border:0;flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:0 8px;border-radius:7px;background:#e0f2fe;color:#075985;font:inherit;font-size:11.5px;font-weight:400;cursor:pointer;transition:filter .14s,box-shadow .14s,background .14s; }
.tk-internal-note-badge:hover,.tk-internal-note-badge.active { filter:saturate(1.08) brightness(.98);box-shadow:0 0 0 3px rgba(15,118,110,.08); }
.tk-internal-note-badge.call { background:#dcfce7;color:#166534; }
.tk-internal-note-badge.meeting { background:#ede9fe;color:#6d28d9; }
.tk-internal-note-item-actions { position:relative;display:flex;align-items:center;gap:4px;margin-left:2px; }
.tk-internal-note-kebab-btn { width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:#0f172a;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .14s,color .14s; }
.tk-internal-note-kebab-btn:hover,.tk-internal-note-kebab-btn.active { background:#eef2f7;color:#0f172a; }
.tk-internal-note-content { width:100%;max-width:min(760px,100%);border:1px solid #e2e8f0;border-radius:10px;background:#fff;padding:10px 12px;box-shadow:0 1px 2px rgba(15,23,42,.03);box-sizing:border-box; }
.tk-internal-note-text { color:#0f172a;font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere;padding:0; }
.tk-internal-note-body { width:100%;min-height:72px;resize:vertical;border:1px solid transparent;border-radius:8px;background:#fff;color:#0f172a;padding:0;font:inherit;font-size:13px;line-height:1.5;box-sizing:border-box;outline:none;box-shadow:none; }
.tk-internal-note-body:focus { background:#fff;border-color:#dbe4ef;box-shadow:0 0 0 3px rgba(15,118,110,.08);padding:8px 9px; }
@media(max-width:760px){
  .tk-internal-notes { padding:12px 14px; }
  .tk-internal-notes-head { align-items:center; }
  .tk-internal-note-add { width:auto;justify-content:center; }
  .tk-internal-note-item { gap:9px; }
  .tk-internal-note-avatar .global-user-av { width:30px;height:30px;font-size:10px; }
  .tk-internal-notes-list.has-timeline .tk-internal-note-item:not(:last-child)::after { left:14px;top:34px; }
  .tk-internal-note-author { max-width:150px; }
  .tk-internal-note-content { max-width:100%; }
}
.tk-detail-panel-tab { display:none; }
.tk-detail-panel-tab.active { display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden; }
#tk-detail-tab-overview.active { display:block;flex:none;min-height:auto;overflow:visible; }
.tk-detail-main-grid { display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:20px;padding:20px 28px 28px;border-bottom:1px solid var(--border);background:var(--bg);overflow:visible; }
.tk-ticket-info-panel,.tk-timeline-panel { min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 1px 4px rgba(15,23,42,.03);height:100%;background-clip:padding-box; }
.tk-ticket-info-panel { position:relative;z-index:30;display:flex;flex-direction:column;align-self:stretch;overflow:visible; }
.tk-info-title,.tk-timeline-title { font-size:17px;font-weight:400;color:#0f172a;letter-spacing:0; }
.tk-info-title { padding:14px 16px 8px;border-bottom:0; }
.tk-info-tabs { display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:6px 16px 0;padding:4px;border:1px solid #e2e8f0;border-radius:10px;background:#f1f5f9; }
.tk-info-tab { position:relative;display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:#475569;font-size:12.5px;font-weight:400;font-family:inherit;text-align:center;cursor:pointer;transition:background .14s,color .14s,box-shadow .14s; }
.tk-info-tab svg { flex-shrink:0;color:currentColor; }
.tk-info-tab.active { background:#fff;color:#0f172a;box-shadow:0 1px 3px rgba(15,23,42,.08); }
.tk-info-tab:hover { background:#e8eef6;color:#0f172a; }
.tk-info-tab.active:hover { background:#fff; }
.tk-info-pane { display:none;margin-top:12px;padding-bottom:16px;border-top:1px solid #e2e8f0; }
.tk-info-pane.active { display:block; }
.tk-info-block { display:flex;flex-direction:column;gap:8px;padding:0 16px;margin-top:22px; }
.tk-info-block:first-of-type { padding-top:16px;margin-top:0; }
.tk-info-block:last-child { padding-bottom:16px; }
.tk-info-label { font-size:13px;font-weight:400;color:#0f172a;letter-spacing:0;text-transform:none; }
.tk-info-value { font-size:14px;color:#0f172a;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-info-readonly { width:100%;min-height:38px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;color:#0f172a;font-size:12.5px;line-height:1.4;box-sizing:border-box; }
.tk-info-readonly--multiline { white-space:normal; }
.tk-info-action-modes { display:flex;flex-direction:column;gap:8px;align-items:stretch;min-height:38px;padding:8px;background:#fff; }
.tk-info-action-mode { position:relative;display:block;width:100%;min-height:32px;padding:10px 11px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;color:#0f172a;font-size:12px;font-weight:400;line-height:1.35;white-space:normal;box-sizing:border-box;cursor:default;transition:background .14s,border-color .14s,box-shadow .14s; }
.tk-info-action-mode:hover { background:#fff;border-color:#dbeafe;box-shadow:0 1px 2px rgba(15,23,42,.04); }
.tk-info-action-mode.is-privaicy { border-color:#d8b4fe;background:linear-gradient(135deg,#faf5ff 0%,#f5f3ff 48%,#eef2ff 100%); }
.tk-info-action-mode.is-privaicy:hover { background:linear-gradient(135deg,#f3e8ff 0%,#ede9fe 52%,#e0e7ff 100%);border-color:#c084fc;box-shadow:0 1px 3px rgba(126,34,206,.12); }
.tk-info-action-check { position:absolute;opacity:0;pointer-events:none; }
.tk-info-action-box { width:16px;height:16px;margin-top:1px;border:1px solid #cbd5e1;border-radius:4px;background:#fff;box-sizing:border-box;display:flex;align-items:center;justify-content:center; }
.tk-info-action-check:checked + .tk-info-action-box { border-color:#7c3aed;background:#7c3aed; }
.tk-info-action-check:checked + .tk-info-action-box::after { content:"";width:7px;height:4px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg);margin-top:-1px; }
.tk-info-action-main { min-width:0;display:flex;flex-direction:column;gap:6px; }
.tk-info-action-title { min-width:0;display:block;color:#0f172a;font-size:12.5px;line-height:1.35; }
.tk-info-action-number { display:inline-flex;align-items:center;align-self:flex-start;color:#6d28d9;background:#f5f3ff;border:1px solid #ddd6fe;border-radius:999px;padding:3px 7px;font-size:10.5px;font-weight:400;line-height:1;text-transform:none;letter-spacing:0;margin:0;white-space:nowrap; }
.tk-info-action-logo { width:20px;height:20px;border-radius:6px;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 2px rgba(76,29,149,.12);flex-shrink:0; }
.tk-info-action-logo img { width:14px;height:14px;display:block;object-fit:contain; }
.tk-info-action-ai-line { display:flex;align-items:center;gap:7px;min-width:0;color:#6d28d9;font-size:10.5px;line-height:1.2; }
.tk-info-action-ai-line.is-manual { color:#64748b; }
.tk-info-action-ai-label { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-info-action-confidence { position:relative;width:48px;height:5px;border-radius:999px;background:rgba(124,58,237,.16);overflow:hidden;flex-shrink:0; }
.tk-info-action-confidence span { position:absolute;inset:0 auto 0 0;border-radius:999px;background:linear-gradient(90deg,#a855f7,#7c3aed); }
.tk-info-action-confidence-value { flex-shrink:0;color:#4c1d95;font-size:10px; }
.tk-info-similar-ticket { width:100%;display:flex;flex-direction:column;gap:8px;padding:0;border:0;border-radius:0;background:#fff;box-sizing:border-box;box-shadow:none; }
.tk-info-similar-link { position:relative;width:100%;display:flex;align-items:center;gap:8px;padding:8px 10px 8px 12px;border:1px solid color-mix(in srgb,var(--tk-similar-group-accent,#64748b) 30%,#e2e8f0);border-left:4px solid var(--tk-similar-group-accent,#64748b);border-radius:0;background:#fff;color:#0f172a;text-align:left;font-family:inherit;cursor:pointer;box-sizing:border-box;transition:background .14s,box-shadow .14s,border-color .14s; }
.tk-info-similar-link:hover { background:color-mix(in srgb,var(--tk-similar-group-accent,#64748b) 7%,#fff);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tk-similar-group-accent,#64748b) 26%,transparent); }
.tk-info-similar-link-icon { width:24px;height:24px;border-radius:6px;background:color-mix(in srgb,var(--tk-similar-group-accent,#64748b) 12%,#fff);color:var(--tk-similar-group-accent,#64748b);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 1px 2px rgba(15,23,42,.05); }
.tk-info-similar-link-main { min-width:0;display:flex;flex-direction:column;gap:3px; }
.tk-info-similar-title { color:#0f172a;font-size:12.5px;font-weight:500;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.tk-info-similar-id { color:#64748b;font-size:11.5px;line-height:1.2; }
.tk-info-similar-reason { width:100%;padding:0 4px;color:#334155;font-size:12px;line-height:1.45;box-sizing:border-box; }
.tk-info-similar-meta { display:flex;flex-direction:column;gap:7px;padding:0 4px 2px; }
.tk-info-similar-meta-row { display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px;align-items:start;color:#64748b;font-size:11.5px;line-height:1.35; }
.tk-info-similar-meta-label { color:#94a3b8; }
.tk-info-similar-meta-value { color:#334155;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-info-similar-mandant-badge { position:relative;display:block;width:100%;min-width:0;min-height:24px;padding:4px 10px 4px 15px;border:1px solid #e2e8f0;border-radius:6px;background:#fff;color:#64748b;font-size:11.5px;font-weight:500;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;box-sizing:border-box;cursor:pointer;font-family:inherit;transition:border-color .15s,box-shadow .15s,background .15s,color .15s; }
.tk-info-similar-mandant-badge::before { content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#0073ea; }
.tk-info-similar-mandant-badge:hover { border-color:#bfdbfe;background:#f8fbff;color:#334155;box-shadow:0 0 0 3px rgba(0,115,234,.07); }
.tk-info-reference-quality { width:100%; }
.tk-ref-quality-card { width:100%;padding:11px 12px;border:1px solid #e2e8f0;border-radius:9px;background:#fff;box-sizing:border-box;color:#0f172a; }
.tk-ref-quality-card.is-good { border-color:#bbf7d0;background:linear-gradient(135deg,#f0fdf4,#fff); }
.tk-ref-quality-card.is-usable { border-color:#bae6fd;background:linear-gradient(135deg,#f0f9ff,#fff); }
.tk-ref-quality-card.is-low { border-color:#fde68a;background:linear-gradient(135deg,#fffbeb,#fff); }
.tk-ref-quality-card.is-off,.tk-ref-quality-card.is-spam { border-color:#e2e8f0;background:#f8fafc; }
.tk-ref-quality-head { display:flex;align-items:center;justify-content:space-between;gap:10px; }
.tk-ref-quality-status { min-width:0;display:flex;align-items:center;gap:7px; }
.tk-ref-quality-dot { width:8px;height:8px;border-radius:999px;background:#94a3b8;box-shadow:0 0 0 3px rgba(148,163,184,.12);flex-shrink:0; }
.tk-ref-quality-card.is-good .tk-ref-quality-dot { background:#16a34a;box-shadow:0 0 0 3px rgba(22,163,74,.12); }
.tk-ref-quality-card.is-usable .tk-ref-quality-dot { background:#0ea5e9;box-shadow:0 0 0 3px rgba(14,165,233,.13); }
.tk-ref-quality-card.is-low .tk-ref-quality-dot { background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.14); }
.tk-ref-quality-card.is-off .tk-ref-quality-dot,.tk-ref-quality-card.is-spam .tk-ref-quality-dot { background:#94a3b8;box-shadow:0 0 0 3px rgba(148,163,184,.12); }
.tk-ref-quality-label { min-width:0;color:#0f172a;font-size:12.5px;font-weight:500;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-ref-quality-score { display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:18px;padding:0 6px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:10.5px;line-height:1;box-sizing:border-box; }
.tk-ref-quality-sub { margin-top:8px;color:#64748b;font-size:11.5px;line-height:1.35; }
.tk-ref-quality-reasons { display:flex;flex-direction:column;gap:6px;margin-top:10px; }
.tk-ref-quality-reason { position:relative;padding-left:12px;color:#334155;font-size:11.8px;line-height:1.42; }
.tk-ref-quality-reason::before { content:"";position:absolute;left:0;top:.62em;width:4px;height:4px;border-radius:50%;background:#cbd5e1; }
.tk-ref-quality-toggle { position:relative;width:38px;height:22px;display:inline-flex;align-items:center;flex-shrink:0;cursor:pointer; }
.tk-ref-quality-toggle input { position:absolute;opacity:0;pointer-events:none; }
.tk-ref-quality-switch { position:absolute;inset:0;border-radius:999px;background:#cbd5e1;transition:background .15s,box-shadow .15s; }
.tk-ref-quality-switch::after { content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.2);transition:transform .15s; }
.tk-ref-quality-toggle.is-on .tk-ref-quality-switch { background:#0073ea;box-shadow:0 0 0 3px rgba(0,115,234,.1); }
.tk-ref-quality-toggle.is-on .tk-ref-quality-switch::after { transform:translateX(16px); }
.tk-ref-quality-toggle.is-disabled { cursor:not-allowed;opacity:.55; }
.tk-ref-profile-card { width:100%;border:1px solid #e2e8f0;background:#fff;border-radius:12px;padding:12px;box-sizing:border-box;display:flex;flex-direction:column;gap:12px; }
.tk-ref-profile-row { display:flex;flex-direction:column;gap:6px;min-width:0; }
.tk-ref-profile-row > span { color:#64748b;font-size:11.5px;line-height:1.2; }
.tk-ref-profile-row p { margin:0;color:#0f172a;font-size:12.5px;line-height:1.45; }
.tk-ref-profile-type { display:inline-flex;align-items:center;align-self:flex-start;min-height:24px;padding:0 9px;border-radius:8px;background:#f1f5f9;color:#0f172a;font-size:11.8px; }
.tk-ref-profile-chips { display:flex;flex-wrap:wrap;gap:6px;min-width:0; }
.tk-ref-profile-chip { display:inline-flex;align-items:center;min-height:24px;max-width:100%;padding:0 8px;border-radius:7px;background:#e8f2ff;color:#0f172a;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-ref-profile-quote { border-left:3px solid #8b5cf6;background:#faf5ff;color:#312e81;border-radius:0 8px 8px 0;padding:8px 9px;font-size:11.8px;line-height:1.42; }
.tk-ref-profile-steps { margin:0;padding:0 0 0 17px;color:#0f172a;font-size:11.8px;line-height:1.45; }
.tk-ref-profile-steps li + li { margin-top:4px; }
#tk-info-ticket-number { display:flex;align-items:center;justify-content:center;width:100%;min-height:38px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#0f172a;font-family:'Menlo','Monaco','Courier New',monospace;font-size:13px;cursor:pointer;transition:border-color .15s,box-shadow .15s,color .15s;user-select:none; }
#tk-info-ticket-number:hover { border-color:#0073ea;box-shadow:0 0 0 3px rgba(0,115,234,.08); }
#tk-info-ticket-number.is-copied { border-color:#bbf7d0;color:#16a34a;font-family:inherit;font-weight:500; }
.tk-info-mandant-box { position:relative;display:flex;align-items:center;width:100%;min-height:38px;padding:6px 8px;border:1px solid #e2e8f0;border-radius:7px;background:#f1f5f9;overflow:visible; }
#tk-info-mandant { position:relative;display:block;width:100%;min-width:0;min-height:26px;padding:5px 10px 5px 16px;border:1px solid #e2e8f0;border-radius:6px;background:#fff;color:#64748b;font-size:12px;font-weight:500;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;box-sizing:border-box;box-shadow:0 1px 2px rgba(15,23,42,.04); }
#tk-info-mandant::before { content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#0073ea; }
.tk-info-mandant-box.is-clickable { cursor:pointer;transition:border-color .15s,box-shadow .15s,background .15s; }
.tk-info-mandant-box.is-clickable:hover { border-color:#bfdbfe;background:#eaf3ff;box-shadow:0 0 0 3px rgba(0,115,234,.07); }
.tk-info-mandant-box.is-empty { cursor:default; }
.tk-info-status-slot { min-width:0;width:100%; }
.tk-info-status-slot .tk-status-picker,.tk-info-status-slot .tk-status-current { width:100%; }
.tk-info-status-slot .tk-status-current { position:relative;display:flex;padding:0;border:none;border-radius:8px;overflow:hidden;background:transparent;box-shadow:none; }
.tk-info-status-slot .tk-status-current:hover { box-shadow:none;filter:brightness(.97); }
.tk-info-status-slot .tk-sbadge { flex:1;display:flex;align-items:center;justify-content:center;width:100%;min-height:38px;border-radius:8px;padding:10px 32px 10px 12px;font-size:12px;font-weight:500;color:#fff; }
.tk-info-status-slot .tk-sbadge.privaicy { background:#ff158a;color:#fff; }
.tk-info-status-slot .tk-sbadge.matching { background:#6b7280;color:#fff; }
.tk-info-status-slot .tk-sbadge.klassifizierung { background:#0ea5e9;color:#fff; }
.tk-info-status-slot .tk-sbadge.datenschutzaufgabe { background:#0ea5e9;color:#fff; }
.tk-info-status-slot .tk-sbadge.inbearbeitung { background:#3b82f6;color:#fff; }
.tk-info-status-slot .tk-sbadge.bittepruefen { background:#f97316;color:#fff; }
.tk-info-status-slot .tk-sbadge.ueberarbeiten { background:#f43f5e;color:#fff; }
.tk-info-status-slot .tk-sbadge.bereit { background:#22c55e;color:#fff; }
.tk-info-status-slot .tk-sbadge.versendet { background:#166534;color:#fff; }
.tk-info-status-slot .tk-sbadge.spam { background:#7c3aed;color:#fff; }
.tk-info-status-slot .tk-sbadge.unknown { background:#94a3b8;color:#fff; }
.tk-info-status-slot .tk-status-chev { position:absolute;right:11px;top:50%;transform:translateY(-50%);color:#fff; }
.tk-info-status-slot .tk-status-chev.open { transform:translateY(-50%) rotate(180deg); }
.tk-info-status-slot .tk-status-dropdown { z-index:5000;width:310px;max-width:min(310px,calc(100vw - 64px));grid-template-columns:1fr 1fr;gap:6px;padding:8px; }
.tk-info-status-slot .tk-status-opt { justify-content:center;padding:8px 7px; }
.tk-info-status-slot .tk-status-opt .tk-sbadge { min-height:auto;padding:6px 8px;font-size:11px;font-weight:400; }
.tk-info-attachments-slot { display:flex;flex-direction:column;gap:7px; }
.tk-info-attachments-slot.is-empty::after { content:"Keine Dateianhänge";display:flex;align-items:center;justify-content:center;width:100%;min-height:38px;padding:0 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#64748b;font-size:13px;font-weight:400;box-sizing:border-box; }
.tk-info-attachments-slot .tk-attach-list { display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;width:100%; }
.tk-info-attachments-slot .tk-attach-card { min-width:0;min-height:132px;padding:14px 9px 11px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc;text-decoration:none;color:#0f172a;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:7px;transition:background .15s,border-color .15s,box-shadow .15s,transform .12s; }
.tk-info-attachments-slot .tk-attach-card:hover { background:#f1f5f9;border-color:#cbd5e1;box-shadow:0 8px 18px rgba(15,23,42,.07);transform:translateY(-1px);color:#0f172a; }
.tk-info-attachments-slot .tk-attach-card .tk-doc-file-icon { width:42px;height:52px;margin:0 0 3px;border-radius:8px;box-shadow:0 3px 10px rgba(15,23,42,.07); }
.tk-info-attachments-slot .tk-attach-card .tk-doc-file-icon::before { width:14px;height:14px;border-top-right-radius:8px; }
.tk-info-attachments-slot .tk-attach-card .tk-doc-file-icon::after { left:10px;right:10px;bottom:10px;height:2px;box-shadow:0 6px 0 #e5eaf1; }
.tk-info-attachments-slot .tk-attach-card .tk-doc-file-ext { font-size:10px;font-weight:800;letter-spacing:.03em; }
.tk-info-attachments-slot .tk-attach-card .tk-attach-name { width:100%;font-size:11.5px;font-weight:500;line-height:1.25;text-align:center;color:#0f172a;white-space:normal;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word; }
.tk-info-attachments-slot .tk-attach-card .tk-attach-size { font-size:10.5px;color:#64748b;line-height:1.1;text-align:center; }
.tk-info-divider { height:1px;margin:20px 16px 0;background:#e2e8f0; }
.tk-info-tasktype-block { margin-top:18px; }
.tk-info-tasktype-slot { position:relative;display:flex;width:100%;min-height:38px;align-items:center;overflow:visible; }
.tk-mandant-page { display:none;flex:1;min-height:0;background:#f8fafc;overflow:auto; }
.tk-mandant-page.active { display:flex;flex-direction:column; }
.tk-mandant-tabs { display:flex;align-items:center;gap:24px;padding:0 22px 0 38px;background:#fff;border-bottom:1px solid #e2e8f0;flex-shrink:0; }
.tk-mandant-tab { position:relative;display:inline-flex;align-items:center;padding:13px 0 11px;border:0;background:transparent;color:#0f172a;font-size:12.5px;font-weight:400;font-family:inherit;cursor:pointer; }
.tk-mandant-tab::after { content:"";position:absolute;left:-8px;right:-8px;bottom:-1px;height:2px;border-radius:999px;background:#0073ea;opacity:0;transition:opacity .15s; }
.tk-mandant-tab.active::after { opacity:1; }
.tk-mandant-body { padding:18px 22px 24px;display:flex;flex-direction:column;gap:14px;min-width:980px; }
.tk-mandant-pane { display:none;flex-direction:column;gap:14px; }
.tk-mandant-pane.active { display:flex; }
.tk-mandant-table { background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow-x:auto;overflow-y:visible;box-shadow:none; }
.tk-mandant-empty { padding:28px;text-align:center;color:#64748b;font-size:13px;background:#fff;border:1px dashed #cbd5e1;border-radius:10px; }
.tk-mandant-table .tk-board-row { min-width:1080px; }
.tk-mandant-table .tk-board-row--mandant { grid-template-columns:320px 132px 360px 210px 150px 140px 220px;min-width:1532px; }
.tk-mandant-overview-head { display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px;border:1px solid #e2e8f0;border-radius:12px;background:linear-gradient(135deg,#ffffff 0%,#f8fafc 54%,#ecfeff 100%);box-shadow:none;overflow:hidden; }
.tk-mandant-overview-copy { min-width:0;display:flex;flex-direction:column;gap:5px; }
.tk-mandant-overview-eyebrow { color:#64748b;font-size:11px;line-height:1.2;text-transform:uppercase;letter-spacing:.08em; }
.tk-mandant-overview-title { color:#0f172a;font-size:22px;font-weight:400;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-mandant-overview-sub { color:#475569;font-size:12.5px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-mandant-overview-chips { flex:0 0 auto;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;max-width:52%; }
.tk-mandant-overview-chip { display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border:1px solid #dbeafe;border-radius:999px;background:#eff6ff;color:#1e3a8a;font-size:11.5px;font-weight:400;white-space:nowrap; }
.tk-mandant-overview-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px; }
.tk-mandant-kpi { position:relative;min-height:98px;padding:16px 16px 15px 18px;border:1px solid #e2e8f0;border-radius:12px;background:linear-gradient(180deg,#fff 0%,#f8fafc 100%);box-shadow:none;display:flex;flex-direction:column;justify-content:space-between;gap:12px;overflow:hidden; }
.tk-mandant-kpi::before { content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#14b8a6; }
.tk-mandant-kpi:nth-child(2)::before { background:#f59e0b; }
.tk-mandant-kpi:nth-child(3)::before { background:#8b5cf6; }
.tk-mandant-kpi:nth-child(4)::before { background:#0ea5e9; }
.tk-mandant-kpi-label { color:#64748b;font-size:12px;line-height:1.2; }
.tk-mandant-kpi-value { color:#0f172a;font-size:22px;font-weight:500;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-mandant-kpi-sub { color:#64748b;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-mandant-section { padding:16px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;box-shadow:none; }
.tk-mandant-section-title { color:#0f172a;font-size:14px;font-weight:500;line-height:1.25; }
.tk-mandant-recent-table { margin-top:12px;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-gutter:stable; }
.tk-mandant-recent-table .tk-board-row { width:max-content; }
.tk-mandant-recent-table .tk-board-row:last-child > div:first-child { border-bottom-left-radius:9px; }
.tk-mandant-recent-table .tk-board-row:last-child > div:last-child { border-bottom-right-radius:9px; }
.tk-mandant-profile-summary:empty { display:none; }
.tk-mandant-profile-card { display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;box-shadow:none; }
.tk-mandant-profile-card.is-loading { justify-content:flex-start;color:#475569; }
.tk-mini-spinner { width:18px;height:18px;border-radius:999px;border:2px solid #ccfbf1;border-top-color:#14b8a6;animation:tkSpin .75s linear infinite;flex:0 0 auto; }
.tk-mandant-profile-main { min-width:0;width:100%; }
.tk-mandant-profile-title-row { display:flex;align-items:center;gap:6px;min-width:0; }
.tk-mandant-profile-title { color:#0f172a;font-size:14px;font-weight:500;line-height:1.25; }
.tk-mandant-profile-card p { margin:7px 0 0;color:#475569;font-size:12.5px;line-height:1.45; }
.tk-mandant-profile-meta { display:flex;flex-wrap:wrap;gap:7px;margin-top:10px;color:#64748b;font-size:11.5px; }
.tk-mandant-profile-meta span { display:inline-flex;align-items:center;min-height:24px;padding:0 9px;border-radius:999px;background:#f1f5f9;color:#475569; }
.tk-mandant-profile-action { flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:7px;background:#f1f5f9;color:#0f172a;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .14s,color .14s; }
.tk-mandant-profile-action:hover { background:#e2e8f0;color:#0f172a; }
.tk-mandant-mini-list { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px; }
.tk-mandant-mini-list .tk-mandant-empty { grid-column:1 / -1; }
.tk-mandant-mini-ticket { min-width:0;padding:12px;border:1px solid #e2e8f0;border-left:4px solid var(--tk-group-accent,#94a3b8);border-radius:8px;background:#fff;color:#0f172a;text-align:left;font-family:inherit;cursor:pointer;transition:background .14s,border-color .14s,transform .12s; }
.tk-mandant-mini-ticket:hover { background:#f8fafc;border-color:#cbd5e1;transform:translateY(-1px); }
.tk-mandant-mini-title { font-size:12.5px;line-height:1.25;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-mandant-mini-meta { margin-top:7px;font-size:11.5px;color:#64748b;display:flex;gap:8px;align-items:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-mandant-chip-row { display:flex;flex-wrap:wrap;gap:7px;margin-top:12px; }
.tk-mandant-chip { display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border-radius:999px;background:#f1f5f9;color:#334155;font-size:11.5px;font-weight:400; }
.tk-mandant-doc-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px; }
.tk-mandant-doc-grid .tk-mandant-empty { grid-column:1 / -1; }
.tk-mandant-doc-card { min-height:158px;padding:16px 12px 13px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#0f172a;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center;transition:background .14s,border-color .14s,box-shadow .14s,transform .12s; }
.tk-mandant-doc-card:hover { background:#f8fafc;border-color:#cbd5e1;box-shadow:0 8px 22px rgba(15,23,42,.07);transform:translateY(-1px);color:#0f172a; }
.tk-mandant-doc-card .tk-doc-file-icon { width:48px;height:60px; }
.tk-mandant-doc-name { max-width:100%;font-size:12.5px;line-height:1.25;color:#0f172a;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word; }
.tk-mandant-doc-meta { font-size:11px;color:#64748b; }
.tk-mandant-history-list { display:flex;flex-direction:column;gap:10px; }
.tk-mandant-history-item { display:grid;grid-template-columns:150px minmax(0,1fr);gap:14px;padding:14px;border:1px solid #e2e8f0;border-left:4px solid var(--tk-group-accent,#94a3b8);border-radius:10px;background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.03); }
.tk-mandant-history-date { color:#64748b;font-size:12px;line-height:1.3; }
.tk-mandant-history-title { display:block;width:100%;padding:0;border:0;background:transparent;color:#0f172a;font-size:13px;font-weight:500;line-height:1.25;text-align:left;font-family:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer; }
.tk-mandant-history-title:hover { color:#0073ea; }
.tk-mandant-history-text { margin-top:6px;color:#475569;font-size:12px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.tk-mandant-history-meta { margin-top:9px;display:flex;flex-wrap:wrap;gap:7px;align-items:center; }
.tk-mandant-ai-context { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.tk-mandant-ai-card { min-height:120px;padding:16px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.03); }
.tk-mandant-ai-card--wide { grid-column:1 / -1;min-height:auto; }
.tk-mandant-ai-title { color:#0f172a;font-size:13.5px;font-weight:500;line-height:1.3; }
.tk-mandant-ai-text { margin:10px 0 0;color:#475569;font-size:12.5px;line-height:1.5; }
.tk-mandant-ai-list { margin:11px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:8px; }
.tk-mandant-ai-list li { color:#475569;font-size:12.5px;line-height:1.35;display:flex;flex-direction:column;gap:3px; }
.tk-mandant-ai-list li strong { color:#0f172a;font-size:12.5px;font-weight:500; }
.tk-mandant-ai-list li span { color:#64748b; }
.tk-mandant-ai-ticket { display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:34px;padding:0 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;color:#0f172a;text-align:left;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .14s,border-color .14s; }
.tk-mandant-ai-ticket:hover { background:#f1f5f9;border-color:#cbd5e1;color:#0f172a; }
.tk-mandant-ai-ticket span { flex:0 0 auto;color:#64748b;font-size:11.5px; }
.tk-mandant-notes-card { padding:18px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.03);display:flex;flex-direction:column;gap:12px; }
.tk-mandant-note-sub { margin-top:4px;color:#64748b;font-size:12px;line-height:1.35; }
.tk-mandant-notes-input { width:100%;min-height:280px;resize:vertical;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;padding:14px;font-size:13px;line-height:1.5;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .14s,box-shadow .14s; }
.tk-mandant-notes-input:focus { border-color:#14b8a6;box-shadow:0 0 0 3px rgba(20,184,166,.12); }
.tk-mandant-notes-footer { display:flex;align-items:center;justify-content:space-between;gap:12px;color:#64748b;font-size:12px; }
.tk-mandant-notes-footer #tk-mandant-notes-status { color:#0f766e; }
.tk-tasktype-picker { position:relative;width:100%; }
.tk-tasktype-current { position:relative;display:flex;align-items:center;justify-content:center;width:100%;min-height:38px;padding:0;border:0;border-radius:8px;background:transparent;font-family:inherit;cursor:pointer;overflow:hidden;transition:filter .14s; }
.tk-tasktype-current:hover { filter:brightness(.97); }
.tk-tasktype-badge { display:flex;align-items:center;justify-content:center;width:100%;min-height:38px;padding:9px 32px 9px 11px;border-radius:8px;background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;font-size:12px;font-weight:500;text-align:center;line-height:1.25;box-sizing:border-box; }
.tk-tasktype-badge.is-overridden { background:#fffbeb;color:#92400e;border-color:#fde68a; }
.tk-tasktype-chev { position:absolute;right:11px;top:50%;transform:translateY(-50%);color:#fff;transition:transform .16s; }
.tk-tasktype-current.is-open .tk-tasktype-chev { transform:translateY(-50%) rotate(180deg); }
.tk-tasktype-pop { position:absolute;left:0;top:calc(100% + 7px);z-index:6000;width:310px;max-width:min(310px,calc(100vw - 64px));border:1px solid var(--border);border-radius:12px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.18);padding:9px;display:none; }
.tk-tasktype-pop.is-open { display:block; }
.tk-tasktype-pop-title { font-size:11px;font-weight:650;color:#64748b;margin:0 0 8px; }
.tk-tasktype-pop-grid { display:grid;grid-template-columns:1fr 1fr;gap:6px; }
.tk-tasktype-pop-btn { min-width:0;border:1px solid #fde68a;border-radius:8px;background:#fffbeb;color:#92400e;padding:7px 8px;text-align:left;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background .12s,border-color .12s,color .12s; }
.tk-tasktype-pop-btn:hover { border-color:#f59e0b;background:#fef3c7;color:#78350f; }
.tk-tasktype-pop-btn.detected { border-color:#1c6fef;background:#eff6ff;color:#1d4ed8; }
.tk-tasktype-pop-btn.active:not(.detected) { border-color:#f59e0b;background:#fef3c7;color:#78350f;box-shadow:inset 0 0 0 1px rgba(245,158,11,.2); }
.tk-timeline-panel { display:flex;flex-direction:column;min-height:0;overflow:visible;background:var(--surface); }
.tk-timeline-panel-hd { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border);background:var(--surface);border-radius:11px 11px 0 0; }
.tk-timeline-filter-row { position:relative;display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--surface); }
.tk-timeline-filter-btn { display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:#0f172a;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-timeline-filter-btn svg { color:#0f172a;flex-shrink:0; }
.tk-timeline-filter-btn:hover { border-color:var(--border);background:#f8fafc;color:#0f172a; }
.tk-timeline-filter-btn.active,.tk-timeline-filter-btn.has-filter { border-color:#eff6ff;background:#eff6ff;color:#0f172a; }
.tk-timeline-filter-btn.active svg,.tk-timeline-filter-btn.has-filter svg { color:#0f172a; }
.tk-timeline-filter-count-pill { display:none;align-items:center;gap:7px;color:#0f172a;font-size:12px;font-weight:400;line-height:1; }
.tk-timeline-filter-btn.has-filter .tk-timeline-filter-count-pill { display:inline-flex; }
.tk-timeline-filter-caret { transform:translateY(0); }
.tk-timeline-search { margin-left:auto;flex:0 0 auto;display:flex;align-items:center;min-width:0; }
.tk-timeline-search-button { height:36px;display:inline-flex;align-items:center;gap:7px;padding:0 12px;border:0;border-radius:8px;background:transparent;color:#0f172a;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;transition:background .15s,color .15s; }
.tk-timeline-search-button svg { color:#0f172a;flex-shrink:0; }
.tk-timeline-search-button:hover { background:#f1f5f9;color:#0f172a; }
.tk-timeline-search-field { position:relative;display:none;align-items:center;width:340px;max-width:min(340px,36vw);min-width:220px; }
.tk-timeline-search.is-open .tk-timeline-search-field { display:flex; }
.tk-timeline-search.is-open .tk-timeline-search-button { display:none; }
.tk-timeline-search-field > svg { position:absolute;left:12px;color:var(--text-3);pointer-events:none;transition:color .14s; }
.tk-timeline-search-input { width:100%;height:36px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:#0f172a;padding:0 38px 0 34px;font-size:13px;font-family:inherit;outline:none;box-shadow:0 1px 3px rgba(15,23,42,.03);transition:background .14s,border-color .14s,box-shadow .14s; }
.tk-timeline-search-input::placeholder { color:var(--text-3); }
.tk-timeline-search-input:focus { border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1); }
.tk-timeline-search.has-query .tk-timeline-search-input { border-color:#0073ea;background:#eff6ff;box-shadow:none; }
.tk-timeline-search.has-query .tk-timeline-search-field > svg { color:#0073ea; }
.tk-timeline-search-clear { position:absolute;right:7px;width:24px;height:24px;border:0;border-radius:7px;background:transparent;color:#64748b;display:none;align-items:center;justify-content:center;padding:0;cursor:pointer;transition:background .12s,color .12s; }
.tk-timeline-search.is-open .tk-timeline-search-clear { display:flex; }
.tk-timeline-search-clear:hover { background:rgba(100,116,139,.12);color:#334155; }
.tk-timeline-filter-pop { position:absolute;top:45px;left:16px;z-index:750;width:300px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 18px 44px rgba(15,23,42,.18);padding:12px; }
.tk-timeline-actions { position:relative;margin-left:0;display:flex;align-items:center; }
.tk-timeline-actions-btn { width:36px;height:36px;display:flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:#0f172a;cursor:pointer;transition:background .15s,color .15s; }
.tk-timeline-actions-btn:hover,.tk-timeline-actions-btn.active { background:#f1f5f9;color:#0f172a; }
.tk-timeline-actions-pop { position:absolute;top:38px;right:0;z-index:750;width:190px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:0 18px 44px rgba(15,23,42,.18);padding:8px; }
.tk-timeline-actions-pop #tk-timeline-toolbar { display:flex !important;flex-direction:column;align-items:stretch !important;justify-content:flex-start !important;gap:6px !important;padding:0 !important; }
.tk-timeline-actions-pop .tl-refresh-btn { justify-content:center;width:100%; }
.tk-timeline-actions-pop .tl-refresh-btn:disabled { opacity:.45;cursor:not-allowed;background:#f8fafc;color:#94a3b8;border-color:#e2e8f0; }
.tk-timeline-actions-pop .tl-refresh-btn:disabled:hover { background:#f8fafc;color:#94a3b8;border-color:#e2e8f0; }
.tk-timeline-filter-title { font-size:12px;font-weight:650;color:#0f172a;margin-bottom:10px; }
.tk-timeline-filter-field { display:flex;flex-direction:column;gap:6px;margin-bottom:12px; }
.tk-timeline-filter-field label { font-size:11px;color:var(--text-3);font-weight:600; }
.tk-timeline-filter-field select { height:34px;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:#0f172a;padding:0 9px;font-family:inherit;font-size:12.5px; }
.tk-timeline-filter-types { display:flex;flex-direction:column;gap:7px;margin-bottom:12px; }
.tk-timeline-filter-check { display:flex;align-items:flex-start;gap:8px;font-size:12.5px;color:#0f172a;line-height:1.35; }
.tk-timeline-filter-check input { margin-top:2px;accent-color:var(--accent); }
.tk-timeline-filter-types .tk-timeline-filter-check { align-items:center;min-height:30px;padding:4px 6px;border-radius:8px;transition:background .12s; }
.tk-timeline-filter-types .tk-timeline-filter-check:hover { background:var(--bg); }
.tk-timeline-filter-types .tk-timeline-filter-check span:last-child { color:#0f172a;font-weight:400; }
.tk-timeline-filter-types .tk-timeline-filter-check input { appearance:none;width:18px;height:18px;margin:0;border:1.5px solid #cbd5e1;border-radius:6px;background:#fff;display:inline-grid;place-content:center;transition:background .14s,border-color .14s,box-shadow .14s;flex-shrink:0; }
.tk-timeline-filter-types .tk-timeline-filter-check input::before { content:"";width:9px;height:9px;clip-path:polygon(14% 44%,0 58%,39% 100%,100% 16%,86% 4%,38% 72%);transform:scale(0);background:#fff;transition:transform .12s; }
.tk-timeline-filter-types .tk-timeline-filter-check input:checked { background:#0073ea;border-color:#0073ea;box-shadow:0 0 0 3px rgba(0,115,234,.10); }
.tk-timeline-filter-types .tk-timeline-filter-check input:checked::before { transform:scale(1); }
.tk-timeline-type-icon { width:24px;height:24px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;color:#fff;flex-shrink:0; }
.tk-timeline-type-icon.email { background:#1c6fef; }
.tk-timeline-type-icon.assistant { background:#14b8a6; }
.tk-timeline-type-icon.ai { background:#ff158a; }
.tk-timeline-type-icon.draft { background:#64748b; }
.tk-timeline-slot { min-height:0;overflow:visible;background:var(--surface);border-radius:0 0 11px 11px;background-clip:padding-box; }
.tk-timeline-slot > div[style] { padding:10px 16px 0 !important; }
.tk-timeline-slot .tl-feed { padding:14px 16px 4px; }
#tk-timeline-toolbar { padding:0 !important; }
.tk-ticket-chat-panel { flex:1;min-height:0;padding:18px 22px;border-bottom:1px solid var(--border);background:#fff; }
.tk-ticket-chat-shell { height:100%;display:flex;flex-direction:column;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 1px 4px rgba(15,23,42,.03);overflow:hidden; }
.tk-ticket-chat-feed { flex:1;overflow:auto;padding:18px 0;display:flex;flex-direction:column;gap:4px;background:#fff; }
.tk-ticket-chat-empty { margin:auto;text-align:center;color:#64748b;font-size:13px;line-height:1.5; }
.tk-ticket-chat-starter { margin:auto;width:min(560px,100%);display:flex;flex-direction:column;align-items:center;gap:18px;padding:16px 4px; }
.tk-ticket-chat-starter-logo { width:58px;height:58px;border-radius:18px;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(15,23,42,.12); }
.tk-ticket-chat-starter-logo img { width:36px;height:36px;object-fit:contain;mix-blend-mode:multiply; }
.tk-ticket-chat-starter-head { text-align:center; }
.tk-ticket-chat-starter-brand { font-size:13px;color:#64748b;margin-bottom:3px; }
.tk-ticket-chat-starter-title { font-size:24px;line-height:1.18;color:#0f172a;margin-bottom:5px; }
.tk-ticket-chat-starter-title span { background:linear-gradient(135deg,#6ed2c8,#e87fb0);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text; }
.tk-ticket-chat-starter-sub { font-size:13px;color:#475569;margin-bottom:2px; }
.tk-ticket-chat-starter-hint { font-size:12px;color:#94a3b8; }
.tk-ticket-chat-starter-grid { display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%; }
.tk-ticket-chat-tile { position:relative;overflow:hidden;text-align:left;border:1px solid #d8e0ea;border-radius:12px;background:#fff;padding:14px 14px 13px;cursor:pointer;font-family:inherit;transition:transform .16s,box-shadow .16s,border-color .16s; }
.tk-ticket-chat-tile::before { content:'';position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,#6ed2c8,#e87fb0); }
.tk-ticket-chat-tile:hover { transform:translateY(-2px);border-color:#b8c4d4;box-shadow:0 10px 26px rgba(15,23,42,.10); }
.tk-ticket-chat-tile-title { display:block;font-size:13px;color:#0f172a;margin-bottom:5px; }
.tk-ticket-chat-tile-desc { display:block;font-size:11.5px;color:#64748b;line-height:1.45; }
.tk-ticket-chat-date { display:flex;align-items:center;gap:10px;padding:14px 18px 8px;color:#94a3b8;font-size:10.5px;font-weight:600;letter-spacing:.25px;text-transform:uppercase; }
.tk-ticket-chat-date::before,.tk-ticket-chat-date::after { content:"";flex:1;height:1px;background:linear-gradient(90deg,transparent,#e2e8f0,transparent); }
.tk-ticket-chat-date span { white-space:nowrap;padding:3px 10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px; }
.tk-ticket-chat-row { display:flex;align-items:flex-end;gap:10px;padding:4px 18px;animation:msgIn .2s ease; }
.tk-ticket-chat-row.user { flex-direction:row-reverse; }
.tk-ticket-chat-avatar { width:30px;height:30px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700; }
.tk-ticket-chat-avatar.user { background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff; }
.tk-ticket-chat-avatar.role-Admin { background:linear-gradient(135deg,#dc2626,#b91c1c); }
.tk-ticket-chat-avatar.role-Moderator { background:linear-gradient(135deg,#7c3aed,#6d28d9); }
.tk-ticket-chat-avatar.role-Experte { background:linear-gradient(135deg,#059669,#047857); }
.tk-ticket-chat-avatar.role-Gast { background:linear-gradient(135deg,#9ca3af,#6b7280); }
.tk-ticket-chat-avatar.ai { background:#fff;border:1.5px solid var(--border);box-shadow:0 1px 4px rgba(15,23,42,.08);overflow:hidden; }
.tk-ticket-chat-avatar.ai img { width:21px;height:21px;object-fit:contain; }
.tk-ticket-chat-bubble-wrap { display:flex;flex-direction:column;gap:4px;max-width:min(72%,720px); }
.tk-ticket-chat-bubble { padding:10px 14px;border:1px solid var(--border);border-radius:12px;background:#fff;color:#0f172a;font-size:13px;line-height:1.65;white-space:pre-wrap;word-break:break-word;box-shadow:0 2px 10px rgba(15,23,42,.05); }
.tk-ticket-chat-row.user .tk-ticket-chat-bubble { background:#0073ea;color:#fff;border-color:#0073ea;border-bottom-right-radius:5px;box-shadow:0 3px 12px rgba(37,99,235,.24); }
.tk-ticket-chat-row.assistant .tk-ticket-chat-bubble { border-bottom-left-radius:5px; }
.tk-ticket-chat-time { font-size:10.5px;color:#94a3b8;padding:0 4px;margin-top:1px; }
.tk-ticket-chat-row.user .tk-ticket-chat-time { text-align:right; }
.tk-ticket-chat-composer { display:flex;gap:8px;align-items:flex-end;margin:12px;padding:6px;border:1px solid #d8e0ea;border-radius:22px;background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.04);transition:border-color .15s,box-shadow .15s; }
.tk-ticket-chat-composer:focus-within { border-color:#0073ea;box-shadow:0 0 0 3px rgba(0,115,234,.08); }
.tk-ticket-chat-input { flex:1;min-height:36px;max-height:120px;resize:none;border:0;border-radius:16px;padding:9px 10px 8px 12px;font-family:inherit;font-size:13px;line-height:1.45;color:#0f172a;outline:none;background:#fff; }
.tk-ticket-chat-input:focus { border-color:transparent;box-shadow:none; }
.tk-ticket-chat-send { width:36px;height:36px;border:none;border-radius:999px;background:#0073ea;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,box-shadow .15s;box-shadow:none;flex-shrink:0; }
.tk-ticket-chat-send:hover:not(:disabled) { background:#0f172a;box-shadow:none;transform:none; }
.tk-ticket-chat-send:disabled { opacity:.45;cursor:not-allowed;box-shadow:none; }
.tk-ticket-docs-panel { flex:1;min-height:0;padding:18px 22px;border-bottom:1px solid var(--border);background:#fff;overflow:auto; }
.tk-ticket-docs-inner { display:flex;flex-direction:column;gap:12px;min-height:100%; }
.tk-ticket-docs-panel .docs-view-header { padding:0;border:none;background:transparent; }
.tk-ticket-docs-panel .docs-view-title { font-size:18px;font-weight:500; }
.tk-ticket-docs-panel .docs-view-subtitle { font-size:12.5px;margin-top:1px; }
.tk-ticket-docs-panel .docs-search-bar { margin:0;padding:0;background:transparent;border:none;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:none; }
.tk-ticket-docs-panel .docs-search-wrap { min-height:44px;width:50%;max-width:520px;min-width:260px;flex:0 1 520px;border:1px solid var(--border);border-radius:18px;background:#fff;padding:0 14px;box-shadow:0 1px 3px rgba(15,23,42,.03); }
.tk-ticket-docs-panel .docs-search-wrap input { font-size:14px; }
.tk-ticket-docs-actions { position:relative;margin-left:auto;display:flex;align-items:center; }
.tk-ticket-docs-actions .tk-timeline-actions-btn { width:44px;height:44px;border-radius:14px; }
.tk-ticket-docs-actions-pop { position:absolute;top:50px;right:0;z-index:800;width:178px;border:1px solid var(--border);border-radius:12px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.18);padding:8px;display:none; }
.tk-ticket-docs-actions-pop.open { display:block; }
.tk-ticket-docs-action-item { width:100%;display:flex;align-items:center;gap:8px;border:0;background:transparent;border-radius:8px;padding:9px 10px;font-family:inherit;font-size:12.5px;color:#0f172a;cursor:pointer;text-align:left; }
.tk-ticket-docs-action-item:hover { background:#f1f5f9; }
.tk-ticket-docs-panel .docs-section-header { margin-bottom:0; }
.tk-ticket-docs-panel .docs-section-icon { display:none; }
.tk-ticket-docs-panel .docs-section-sub { margin:1px 0 12px 0;line-height:1.28; }
.tk-ticket-docs-panel .docs-section-wrap { margin:0;padding:16px 18px;min-height:310px; }
.tk-ticket-docs-panel .docs-grid { grid-template-columns:repeat(auto-fill,minmax(178px,1fr));gap:14px;min-height:210px;align-content:start; }
.tk-doc-folder-bar { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 13px 42px; }
.tk-doc-folder-chip { min-height:30px;display:inline-flex;align-items:center;gap:7px;border:1px solid #d8e0ea;border-radius:10px;background:#fff;color:#334155;padding:6px 10px;font-family:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:background .12s,border-color .12s,color .12s,box-shadow .12s; }
.tk-doc-folder-chip:hover,.tk-doc-folder-chip.drag-over { border-color:#0073ea;background:#eff6ff;color:#0073ea; }
.tk-doc-folder-chip.active { border-color:#0073ea;background:#0073ea;color:#fff;box-shadow:0 4px 12px rgba(0,115,234,.18); }
.tk-doc-folder-chip .count { color:inherit;opacity:.72;font-size:11px; }
.tk-doc-folder-add { border-style:dashed;background:#f8fafc; }
.tk-doc-folder-nav { display:flex;align-items:center;gap:8px;min-height:36px;margin:0 0 13px 0; }
.tk-doc-nav-btn { height:32px;min-width:32px;padding:0 10px;border:1px solid #d8e0ea;border-radius:10px;background:#fff;color:#334155;font-family:inherit;font-size:12px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-doc-nav-btn:hover:not(:disabled) { border-color:#0073ea;background:#eff6ff;color:#0073ea; }
.tk-doc-nav-btn.is-current { background:#f1f5f9;color:#94a3b8;border-color:#e2e8f0; }
.tk-doc-nav-btn:disabled { opacity:.42;cursor:not-allowed; }
.tk-doc-nav-spacer { flex:1; }
.tk-doc-grid-empty { grid-column:1 / -1;min-height:196px;border:1px dashed #cbd5e1;border-radius:12px;padding:22px;text-align:center;color:#64748b;background:#f8fafc;font-size:12.5px;display:flex;align-items:center;justify-content:center; }
.tk-doc-card { position:relative;min-height:196px;padding:30px 14px 16px;border:1px solid #e2e8f0;border-radius:12px;background:#f3f4f6;display:flex;flex-direction:column;align-items:center;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s,transform .22s cubic-bezier(.2,.8,.2,1),opacity .15s;will-change:transform; }
.tk-doc-card:hover { background:#eef2f7;border-color:#cbd5e1;box-shadow:0 10px 24px rgba(15,23,42,.08);transform:translateY(-2px); }
.tk-doc-card.is-dragging { opacity:.55;transform:scale(.985); }
.tk-doc-card.drag-over { border-color:#0073ea;background:#eff6ff;box-shadow:0 0 0 3px rgba(0,115,234,.08); }
.tk-doc-folder-card { background:#f8fafc; }
.tk-doc-folder-card .doc-card-dropdown { top:38px;right:8px; }
.tk-doc-folder-icon { width:86px;height:72px;margin:12px auto 26px;position:relative;color:#0073ea; }
.tk-doc-folder-icon::before { content:"";position:absolute;left:6px;top:9px;width:33px;height:16px;border-radius:8px 8px 0 0;background:#bfdbfe;border:1px solid #93c5fd;border-bottom:0;z-index:1; }
.tk-doc-folder-icon::after { content:"";position:absolute;left:0;right:0;bottom:0;height:52px;border-radius:14px;background:linear-gradient(180deg,#dbeafe,#bfdbfe);border:1px solid #93c5fd;box-shadow:0 5px 14px rgba(37,99,235,.12);z-index:3; }
.tk-doc-folder-paper { position:absolute;left:13px;top:15px;width:60px;height:47px;border:1.5px solid #64748b;border-radius:9px;background:#fff;box-shadow:0 5px 12px rgba(15,23,42,.12);z-index:2;opacity:0;transform:translateY(12px) rotate(-2deg);transition:opacity .16s,transform .16s; }
.tk-doc-folder-paper::before { content:"";position:absolute;right:8px;top:8px;width:12px;height:2px;border-radius:99px;background:#e2e8f0; }
.tk-doc-folder-paper::after { content:"";position:absolute;left:11px;right:11px;top:21px;height:2px;border-radius:99px;background:#cbd5e1;box-shadow:0 8px 0 #e2e8f0,0 16px 0 #e2e8f0; }
.tk-doc-folder-icon.has-docs .tk-doc-folder-paper { opacity:1;transform:translateY(0) rotate(-2deg); }
.tk-doc-folder-icon.has-docs::after { background:linear-gradient(180deg,#c7ddff,#a9cdfc);border-color:#7eb6f8; }
.tk-doc-folder-name-input { width:100%;border:1px solid #0073ea;border-radius:8px;background:#fff;padding:7px 8px;text-align:center;font:inherit;font-size:13px;color:#0f172a;outline:none;box-shadow:0 0 0 3px rgba(0,115,234,.1); }
.tk-doc-card .doc-card-menu-btn { top:8px;right:8px;width:30px;height:30px;padding:0;border-radius:8px;background:transparent;box-shadow:none;color:#64748b;font-size:20px;display:flex;align-items:center;justify-content:center;line-height:1;font-weight:500;writing-mode:vertical-rl; }
.tk-doc-card .doc-card-menu-btn:hover { background:#fff;color:#0f172a;box-shadow:0 2px 8px rgba(15,23,42,.09); }
.tk-doc-card .doc-card-dropdown { top:38px;right:8px; }
.tk-doc-file-icon { position:relative;width:72px;height:88px;margin:4px auto 18px;border:1px solid #d7dee8;border-radius:12px;background:linear-gradient(180deg,#fff 0%,#f8fafc 100%);box-shadow:0 4px 14px rgba(15,23,42,.08);display:flex;align-items:center;justify-content:center;color:#0f172a; }
.tk-doc-file-icon::before { content:"";position:absolute;top:-1px;right:-1px;width:22px;height:22px;background:linear-gradient(135deg,#e2e8f0 0%,#f8fafc 52%,transparent 53%);border-top-right-radius:12px;border-left:1px solid #d7dee8;border-bottom:1px solid #d7dee8; }
.tk-doc-file-icon::after { content:"";position:absolute;left:16px;right:16px;bottom:17px;height:3px;border-radius:99px;background:#d8e0ea;box-shadow:0 9px 0 #e5eaf1; }
.tk-doc-file-ext { position:relative;z-index:1;font-size:16px;font-weight:800;letter-spacing:.03em;text-transform:uppercase; }
.tk-doc-file-icon--pdf .tk-doc-file-ext { color:#dc2626; }
.tk-doc-file-icon--docx .tk-doc-file-ext,.tk-doc-file-icon--doc .tk-doc-file-ext { color:#2563eb; }
.tk-doc-file-icon--pptx .tk-doc-file-ext,.tk-doc-file-icon--ppt .tk-doc-file-ext { color:#ea580c; }
.tk-doc-file-icon--xlsx .tk-doc-file-ext,.tk-doc-file-icon--xls .tk-doc-file-ext,.tk-doc-file-icon--csv .tk-doc-file-ext { color:#16a34a; }
.tk-doc-file-icon--txt .tk-doc-file-ext,.tk-doc-file-icon--md .tk-doc-file-ext { color:#475569; }
.tk-doc-card-name { width:100%;min-height:36px;color:#0f172a;font-size:13px;font-weight:500;line-height:1.35;text-align:center;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word; }
.tk-doc-card-date { margin-top:7px;color:#64748b;font-size:11.5px;line-height:1.3;text-align:center; }
.tk-doc-card-uploader { margin-top:3px;color:#94a3b8;font-size:10.5px;text-align:center;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-ticket-docs-pager { display:flex;align-items:center;justify-content:flex-start;gap:8px;margin-top:12px; }
.tk-ticket-docs-pager-info { font-size:11.5px;color:#64748b;margin-right:8px; }
.tk-ticket-docs-page-btn { min-width:30px;height:30px;border:1px solid #d8e0ea;border-radius:8px;background:#fff;color:#0f172a;font-size:12px;font-family:inherit;cursor:pointer;transition:background .12s,border-color .12s,color .12s; }
.tk-ticket-docs-page-btn:hover:not(:disabled),.tk-ticket-docs-page-btn.active { border-color:#0073ea;background:#eff6ff;color:#0073ea; }
.tk-ticket-docs-page-btn:disabled { opacity:.42;cursor:not-allowed; }
.tk-ticket-docs-page-ellipsis { min-width:22px;text-align:center;color:#94a3b8;font-size:12px; }
.tk-ticket-activity-panel { flex:1;min-height:0;padding:18px 22px;border-bottom:1px solid var(--border);background:var(--bg);overflow:auto; }
.tk-ticket-activity-panel .tk-automation-log-panel { margin:0;border-radius:12px;background:var(--surface-2); }
.tk-ticket-activity-panel .tk-automation-log-body { display:block;max-height:none;border-top:0;background:var(--surface-2); }
@media(max-width:900px){
  .tk-detail-main-grid { grid-template-columns:1fr;padding:14px; }
  .tk-ticket-chat-panel,.tk-ticket-docs-panel,.tk-ticket-activity-panel { padding:14px; }
  .tk-ticket-docs-panel .docs-search-wrap { width:100%;max-width:none;min-width:0;flex:1; }
}

/* Meta grid */
.tk-meta-grid { display:none;flex-wrap:wrap;gap:0;border-bottom:1px solid var(--border);flex-shrink:0; }
.tk-meta-item { display:flex;flex-direction:column;gap:2px;padding:12px 22px;border-right:1px solid var(--border);min-width:0; }
.tk-meta-item:last-child { border-right:none; }
.tk-meta-label { display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.4px; }
.tk-meta-val { font-size:13px;color:var(--text);font-weight:500; }
.tk-meta-val--status { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.tk-meta-val--status .tk-status-sel { font-size:12px;padding:4px 8px;border-radius:7px; }
.tk-meta-val--status .tk-saved-hint { font-size:11px; }

/* ── Classification widget ── */
@keyframes tkSpin { to { transform:rotate(360deg); } }
.tk-classify-bar { display:grid;grid-template-columns:minmax(210px,280px) 1fr;align-items:center;gap:16px;padding:14px 22px;border-bottom:1px solid var(--border);flex-shrink:0;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 4%,var(--surface)),var(--surface)); }
.tk-classify-main { display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0;flex-wrap:wrap; }
.tk-classify-current { display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-areas:"icon label" "icon value" "icon sub";column-gap:10px;align-items:center;min-width:0; }
.tk-classify-current::before { content:"";grid-area:icon;width:32px;height:32px;border-radius:9px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 24%,var(--border));box-shadow:inset 0 0 0 1px rgba(255,255,255,.35); }
.tk-classify-current-label { grid-area:label;font-size:10px;font-weight:800;color:var(--text-3);text-transform:uppercase;letter-spacing:.06em; }
.tk-classify-current-value { grid-area:value;font-size:13px;font-weight:850;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-classify-current-sub { grid-area:sub;font-size:11px;color:var(--text-3);line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-classify-run-btn { display:inline-flex;align-items:center;gap:6px;padding:8px 13px;border-radius:8px;font-size:12px;font-weight:800;border:1.5px solid var(--accent);background:var(--accent);color:#fff;cursor:pointer;transition:all .15s;white-space:nowrap;flex-shrink:0;box-shadow:0 6px 14px color-mix(in srgb,var(--accent) 18%,transparent); }
.tk-classify-run-btn:hover { opacity:.9; }
.tk-classify-run-btn:disabled { opacity:.5;cursor:not-allowed; }
.tk-classify-btns { display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;min-width:0; }
.tk-classify-btn { display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:650;border:1.5px solid var(--border);background:var(--surface);color:var(--text-2);cursor:pointer;transition:all .15s;white-space:nowrap; }
.tk-classify-btn:hover { border-color:var(--accent);color:var(--accent);background:var(--accent-lt); }
.tk-classify-btn.active { border-color:var(--accent);background:var(--accent-lt);color:var(--accent); }
.tk-classify-btn.active .tk-classify-dot { background:var(--accent); }
.tk-classify-btn--spam.active { border-color:#ef4444;background:#fef2f2;color:#dc2626; }
.tk-classify-btn--spam.active .tk-classify-dot { background:#ef4444; }
.tk-classify-btn--spam:hover { border-color:#ef4444;color:#dc2626;background:#fef2f2; }
.tk-classify-dot { width:6px;height:6px;border-radius:50%;background:var(--text-3);transition:background .15s; }
@media(max-width:900px){ .tk-classify-bar{grid-template-columns:1fr;padding:14px 16px}.tk-classify-current{min-width:0}.tk-classify-main{width:100%;justify-content:flex-start}.tk-classify-btns{justify-content:flex-start} }
.tk-summary-card { display:none;margin:12px 22px 0;border:1.5px solid var(--border);border-radius:11px;background:linear-gradient(180deg,var(--surface),var(--surface-2));overflow:hidden;flex-shrink:0; }
.tk-summary-card.is-loading { display:block;border-color:color-mix(in srgb,var(--accent) 30%,var(--border)); }
.tk-summary-hdr { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 13px;border-bottom:1px solid var(--border); }
.tk-summary-title { display:flex;align-items:center;gap:7px;font-size:11px;font-weight:800;color:var(--text-2);text-transform:uppercase;letter-spacing:.05em; }
.tk-summary-title::before { content:"";width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 13%,transparent); }
.tk-summary-state { font-size:10.5px;font-weight:700;color:var(--text-3);white-space:nowrap; }
.tk-summary-body { padding:12px 14px;font-size:12.5px;line-height:1.65;color:var(--text);white-space:pre-wrap; }
.tk-summary-card.is-loading .tk-summary-title::before { animation:tk-iss-blink 1.1s ease-in-out infinite; }
@media(max-width:900px){ .tk-summary-card{margin:10px 16px 0} }
.tk-skip-card { display:flex;margin:12px 22px 0;padding:12px 14px;border:1.5px solid var(--border);border-radius:11px;background:linear-gradient(180deg,var(--surface),var(--surface-2));flex-shrink:0;align-items:center;justify-content:space-between;gap:14px; }
.tk-detail-menu .tk-skip-card { margin:0;padding:11px 12px;align-items:flex-start;flex-direction:column;gap:10px;background:#f8fafc;border-color:#e2e8f0; }
.tk-skip-card.is-active { border-color:#f59e0b;background:linear-gradient(180deg,#fffbeb,var(--surface)); }
.tk-skip-copy { min-width:0; }
.tk-skip-title { display:flex;align-items:center;gap:7px;font-size:12px;font-weight:850;color:var(--text); }
.tk-skip-title::before { content:"";width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.14); }
.tk-skip-card.is-active .tk-skip-title { color:#92400e; }
.tk-skip-card.is-active .tk-skip-title::before { background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.16); }
.tk-skip-sub { margin-top:3px;font-size:11.5px;line-height:1.45;color:var(--text-3); }
.tk-skip-card.is-active .tk-skip-sub { color:#78350f; }
.tk-skip-toggle { display:inline-flex;align-items:center;gap:8px;flex-shrink:0;font-size:12px;font-weight:800;color:var(--text-2);cursor:pointer;user-select:none; }
.tk-detail-menu .tk-skip-toggle { width:100%;justify-content:space-between;font-weight:700;color:#334155; }
.tk-skip-card.is-active .tk-skip-toggle { color:#78350f; }
.tk-skip-toggle input { width:16px;height:16px;accent-color:#f59e0b; }
.tk-sources-panel { display:none;margin:0 22px 22px;border:1.5px solid var(--border);border-radius:11px;background:var(--surface);overflow:hidden;flex-shrink:0; }
.tk-reply-section .tk-sources-panel { margin:0 0 14px; }
.tk-sources-toggle { width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;border:0;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 5%,var(--surface)),var(--surface));color:var(--text);cursor:pointer; }
.tk-sources-title { display:flex;align-items:center;gap:7px;font-size:11px;font-weight:850;color:var(--text-2);text-transform:uppercase;letter-spacing:.05em; }
.tk-sources-count { font-size:10.5px;font-weight:800;color:var(--accent);background:var(--accent-lt);border-radius:999px;padding:2px 7px;text-transform:none;letter-spacing:0; }
.tk-sources-chev { flex-shrink:0;color:var(--text-3);transition:transform .15s; }
.tk-sources-toggle[aria-expanded="true"] .tk-sources-chev { transform:rotate(180deg); }
.tk-sources-body { display:none;border-top:1px solid var(--border);padding:10px 12px; }
.tk-sources-body.is-open { display:block; }
@media(max-width:900px){ .tk-skip-card,.tk-sources-panel{margin-left:16px;margin-right:16px}.tk-skip-card{align-items:flex-start;flex-direction:column} }
.tk-entity-mark { background:linear-gradient(180deg,transparent 45%,#fef08a 45%);border-radius:3px;padding:0 1px;box-decoration-break:clone;-webkit-box-decoration-break:clone; }
.tk-source-list { display:flex;flex-direction:column;gap:7px;margin-top:7px; }
.tk-source-row { display:grid;grid-template-columns:auto 1fr;gap:7px 9px;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface); }
.tk-source-kind { grid-row:1 / span 2;align-self:start;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:3px 6px;background:var(--accent-lt);color:var(--accent); }
.tk-source-kind.web { background:#ecfeff;color:#0e7490; }
.tk-source-title { font-size:12px;font-weight:750;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-source-title a { color:inherit;text-decoration:none; }
.tk-source-title a:hover { color:var(--accent);text-decoration:underline; }
.tk-source-snippet { grid-column:2;font-size:11px;color:var(--text-3);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.tk-automation-log-panel { display:block;margin:0 0 14px;border:1.5px solid var(--border);border-radius:11px;background:var(--surface);overflow:hidden;flex-shrink:0; }
.tk-automation-log-toggle { width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;border:0;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 4%,var(--surface)),var(--surface));color:var(--text);cursor:pointer; }
.tk-automation-log-title { display:flex;align-items:center;gap:7px;font-size:11px;font-weight:850;color:var(--text-2);text-transform:uppercase;letter-spacing:.05em; }
.tk-automation-log-count { font-size:10.5px;font-weight:800;color:var(--accent);background:var(--accent-lt);border-radius:999px;padding:2px 7px;text-transform:none;letter-spacing:0; }
.tk-automation-log-chev { flex-shrink:0;color:var(--text-3);transition:transform .15s; }
.tk-automation-log-toggle[aria-expanded="true"] .tk-automation-log-chev { transform:rotate(180deg); }
.tk-automation-log-body { display:none;border-top:1px solid var(--border);padding:10px 12px;max-height:360px;overflow:auto;background:var(--surface-2); }
.tk-automation-log-body.is-open { display:block; }
.tk-automation-log-empty { font-size:11.5px;color:var(--text-3);font-style:italic;padding:4px 2px; }
.tk-automation-timeline { display:flex;flex-direction:column;gap:8px; }
.tk-automation-event { display:grid;grid-template-columns:9px 1fr;gap:9px;padding:9px 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface); }
.tk-automation-dot { width:8px;height:8px;border-radius:50%;margin-top:5px;background:var(--text-3);box-shadow:0 0 0 3px color-mix(in srgb,var(--text-3) 13%,transparent); }
.tk-automation-event.success .tk-automation-dot { background:#16a34a;box-shadow:0 0 0 3px rgba(22,163,74,.14); }
.tk-automation-event.error .tk-automation-dot { background:#dc2626;box-shadow:0 0 0 3px rgba(220,38,38,.14); }
.tk-automation-event.warn .tk-automation-dot { background:#f59e0b;box-shadow:0 0 0 3px rgba(245,158,11,.16); }
.tk-automation-event.running .tk-automation-dot { background:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent);animation:tk-iss-blink 1.1s ease-in-out infinite; }
.tk-automation-main { min-width:0; }
.tk-automation-line { display:flex;align-items:center;gap:7px;min-width:0; }
.tk-automation-msg { font-size:12px;font-weight:750;color:var(--text);line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-automation-meta { display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:4px;font-size:10.5px;color:var(--text-3); }
.tk-automation-badge { display:inline-flex;align-items:center;border-radius:999px;padding:2px 6px;background:var(--bg);border:1px solid var(--border);font-size:9.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--text-3); }
.tk-automation-badge.auto_gen,.tk-automation-badge.generation { color:var(--accent);background:var(--accent-lt);border-color:color-mix(in srgb,var(--accent) 24%,var(--border)); }
.tk-automation-badge.auto_classify { color:#0e7490;background:#ecfeff;border-color:#a5f3fc; }
.tk-automation-badge.manual { color:#6d28d9;background:#f5f3ff;border-color:#ddd6fe; }
.tk-automation-details { margin-top:6px;font-size:10.5px;color:var(--text-3);line-height:1.45;white-space:pre-wrap;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden; }

/* Sections */
.tk-section { padding:18px 24px;border-bottom:1px solid var(--border); }
.tk-section:last-child { border-bottom:none; }
.tk-section-label { font-size:10.5px;font-weight:800;color:var(--text-3);text-transform:uppercase;letter-spacing:.6px;margin-bottom:12px;display:flex;align-items:center;gap:6px; }
.tk-section-label-row { display:flex;align-items:center;justify-content:space-between;margin-bottom:12px; }
.tk-section-label-row .tk-section-label { margin-bottom:0; }
.tk-status-row { display:flex;align-items:center;gap:10px; }
.tk-status-sel { font-size:13px;font-weight:600;border:1.5px solid var(--border);border-radius:9px;background:var(--bg);color:var(--text);padding:7px 12px;cursor:pointer;outline:none;transition:border-color .15s; }
.tk-status-sel:focus { border-color:var(--accent); }
.tk-saved-hint { font-size:11.5px;color:#16a34a;font-weight:600; }
.tk-msg-box { font-size:13px;color:var(--text);line-height:1.7;white-space:pre-wrap;background:var(--bg);border-radius:12px;padding:14px 16px;border:1px solid var(--border);max-height:280px;overflow-y:auto; }

/* AI Reply section */
:root { --tk-ai-color: #7c3aed; }
.tk-reply-section { background:linear-gradient(160deg,rgba(124,58,237,.03) 0%,transparent 55%); }
.tk-ai-badge { font-size:9px;font-weight:800;letter-spacing:.05em;background:#ede9fe;color:#6d28d9;border-radius:5px;padding:1px 6px;text-transform:uppercase;flex-shrink:0; }
/* Generate button */
.tk-gen-btn { display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#fff;background:#7c3aed;border:none;border-radius:9px;padding:8px 16px;cursor:pointer;transition:opacity .15s,transform .1s,box-shadow .15s;flex-shrink:0;box-shadow:0 2px 8px rgba(124,58,237,.3); }
.tk-gen-btn:hover:not(:disabled) { opacity:.9;box-shadow:0 4px 14px rgba(124,58,237,.4); }
.tk-gen-btn:active:not(:disabled) { transform:scale(.97); }
.tk-gen-btn:disabled { opacity:.4;cursor:not-allowed;box-shadow:none; }
.tk-gen-btn--secondary { background:transparent;color:#7c3aed;border:1.5px solid rgba(124,58,237,.4);box-shadow:none;padding:7px 14px; }
.tk-gen-btn--secondary:hover:not(:disabled) { background:rgba(124,58,237,.07);box-shadow:none;opacity:1; }
/* Empty state */
.tk-model-chip { display:inline-flex;align-items:center;gap:5px;font-size:10.5px;color:var(--text-3);background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:2px 8px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-model-chip svg { flex-shrink:0;opacity:.6; }
.tk-model-chip-wrap { margin-top:5px;display:flex;align-items:center;gap:6px; }
.tk-reply-empty { display:none !important;flex-direction:row;align-items:center;justify-content:flex-end;gap:0;padding:0; }
.tk-reply-empty-icon { display:none; }
.tk-reply-empty-text { display:none; }
.tk-reply-empty-sub { display:none; }
/* Formatting toolbar */
.tk-fmt-bar { display:flex;align-items:center;gap:2px;padding:5px 8px;background:var(--bg);border:1.5px solid var(--border);border-bottom:none;border-radius:10px 10px 0 0; }
.tk-fmt-btn { display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:transparent;color:var(--text-3);border-radius:6px;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0; }
.tk-fmt-btn:hover { background:var(--border);color:var(--text); }
.tk-fmt-btn--danger:hover { background:rgba(239,68,68,.1);color:#dc2626; }
.tk-fmt-sep { width:1px;height:18px;background:var(--border);margin:0 4px;flex-shrink:0; }
/* Reply textarea */
.tk-reply-wrap { position:relative; }
.tk-reply-ta { width:100%;min-height:120px;max-height:320px;resize:none;font-size:13px;line-height:1.7;color:var(--text);background:var(--bg);border:1.5px solid var(--border);border-top:none;border-radius:0 0 10px 10px;padding:10px 14px 12px;font-family:inherit;outline:none;transition:border-color .15s;box-sizing:border-box;overflow-y:auto;display:block; }
.tk-reply-ta:focus { border-color:var(--accent); }
.tk-reply-wrap:focus-within .tk-fmt-bar { border-color:var(--accent); }
.tk-reply-loader { position:absolute;bottom:0;left:0;right:0;height:3px;border-radius:0 0 10px 10px;overflow:hidden; }
.tk-reply-loader-bar { height:100%;width:40%;background:var(--accent);border-radius:3px;animation:tk-slide 1.2s ease-in-out infinite; }
@keyframes tk-slide { 0%{transform:translateX(-150%)} 100%{transform:translateX(350%)} }
.tk-reply-actions { display:flex;align-items:center;justify-content:space-between; }
.tk-reply-hint { font-size:11.5px;color:var(--text-3); }
.tk-upload-btn { display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--accent);background:var(--accent-lt);border:1.5px solid var(--accent);border-radius:9px;padding:8px 14px;cursor:pointer;transition:all .15s; }
.tk-upload-btn:hover:not(:disabled) { background:var(--accent);color:#fff;box-shadow:0 3px 10px rgba(var(--accent-rgb),.25); }
.tk-upload-btn:disabled { opacity:.4;cursor:not-allowed; }
/* Prompt transparency info */
.tk-prompt-info { margin-bottom:8px; }
.tk-pi-toggle { display:flex;align-items:center;gap:5px;width:100%;background:none;border:none;padding:4px 0;cursor:pointer;color:var(--text-3);font-size:11px;font-weight:600;text-align:left;transition:color .12s; }
.tk-pi-toggle:hover { color:var(--text-2); }
.tk-pi-chevron { transition:transform .2s;flex-shrink:0; }
.tk-pi-toggle[aria-expanded=true] .tk-pi-chevron { transform:rotate(180deg); }
.tk-pi-body { border:1px solid var(--border);border-radius:9px;overflow:hidden;margin-top:4px; }
.tk-pi-row { display:flex;flex-direction:row;align-items:baseline;gap:10px;padding:6px 12px;border-bottom:1px solid var(--border);font-size:11.5px; }
.tk-pi-row:last-child { border-bottom:none; }
.tk-pi-row--block { flex-direction:column;gap:4px;align-items:stretch; }
.tk-pi-key { font-size:10px;font-weight:700;color:var(--text-3);text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;flex-shrink:0; }
.tk-pi-val { color:var(--text);font-size:11.5px;font-weight:600; }
.tk-pi-pre { margin:0;font-size:11px;line-height:1.6;color:var(--text-2);white-space:pre-wrap;word-break:break-word;font-family:inherit;background:var(--bg);border-radius:6px;padding:8px 10px;max-height:160px;overflow-y:auto; }
.tk-pi-pre--muted { color:var(--text-3); }
/* Attachments */
.tk-attach-list { display:flex;flex-direction:column;gap:6px; }
.tk-attach-item { display:flex;align-items:center;gap:8px;padding:8px 11px;background:var(--bg);border:1px solid var(--border);border-radius:10px;text-decoration:none;color:var(--text);transition:border-color .15s,box-shadow .15s,transform .1s; }
.tk-attach-item:hover { border-color:var(--accent);color:var(--accent);box-shadow:0 2px 8px rgba(0,0,0,.06);transform:translateY(-1px); }
.tk-attach-icon { color:var(--text-3);flex-shrink:0; }
.tk-attach-item:hover .tk-attach-icon { color:var(--accent); }
.tk-attach-name { font-size:12px;font-weight:600;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-attach-size { font-size:10.5px;color:var(--text-3);flex-shrink:0; }
.tk-attach-item--ai { border-color:rgba(var(--accent-rgb),.35);background:linear-gradient(135deg,var(--accent-lt),var(--bg));user-select:none;gap:8px; }
.tk-attach-item--ai:hover { border-color:var(--accent); }
.tk-attach-item--ai .tk-attach-icon { color:var(--accent); }
.tk-attach-item--report { border-color:rgba(22,163,74,.35);background:linear-gradient(135deg,rgba(22,163,74,.06),var(--bg));gap:8px; }
.tk-attach-item--report:hover { border-color:rgba(22,163,74,.7);background:linear-gradient(135deg,rgba(22,163,74,.1),var(--bg)); }
.tk-attach-item--report .tk-attach-icon { color:rgba(22,163,74,.9); }
.tk-attach-item--draft { border-color:rgba(245,158,11,.4);background:linear-gradient(135deg,rgba(245,158,11,.09),var(--bg));gap:8px; }
.tk-attach-item--draft:hover { border-color:rgba(245,158,11,.7);background:linear-gradient(135deg,rgba(245,158,11,.15),var(--bg)); }
.tk-attach-item--draft .tk-attach-icon { color:rgba(180,100,0,.85); }
.tk-av-toggle-btn { margin-left:auto;padding:2px 6px;border:1px solid rgba(var(--accent-rgb),.4);border-radius:5px;background:rgba(var(--accent-rgb),.08);color:var(--accent);cursor:pointer;display:flex;align-items:center;gap:3px;font-size:10.5px;font-weight:600;transition:background .15s; }
.tk-av-toggle-btn:hover { background:rgba(var(--accent-rgb),.18); }
/* Publish state banner */
#tk-upload-section { display:flex;flex-direction:column;gap:6px;margin-top:10px; }
#tk-upload-section,.tk-prompt-info { display:none !important; }
.tk-reply-actions { margin-top:0; }
.tk-publish-banner { display:flex;align-items:center;gap:7px;padding:7px 11px;border-radius:8px;font-size:11.5px;font-weight:600;width:100%; }
.tk-publish-banner--draft { background:rgba(245,158,11,.1);border:1px solid rgba(245,158,11,.3);color:#92400e; }
.tk-publish-banner--sent  { background:rgba(22,163,74,.1);border:1px solid rgba(22,163,74,.3);color:#065f46; }
/* ── Floating Toast Notification ─────────────────────────────────────────── */
#pa-toast-stack{position:fixed;bottom:24px;right:24px;z-index:9800;display:flex;flex-direction:column;gap:10px;pointer-events:none;width:340px;max-width:calc(100vw - 32px)}
.pa-toast{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;border-radius:13px;background:#fff;box-shadow:0 8px 32px rgba(0,0,0,.15),0 2px 8px rgba(0,0,0,.08);pointer-events:all;animation:paToastIn .3s cubic-bezier(.34,1.56,.64,1);overflow:hidden;position:relative}
.pa-toast::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:13px 0 0 13px}
.pa-toast--loading::before{background:#6366f1}.pa-toast--ok::before{background:#22c55e}.pa-toast--err::before{background:#ef4444}.pa-toast--warn::before{background:#f59e0b}
.pa-toast-icon{flex-shrink:0;width:32px;height:32px;border-radius:9px;display:flex;align-items:center;justify-content:center}
.pa-toast--loading .pa-toast-icon{background:rgba(99,102,241,.1);color:#6366f1}.pa-toast--ok .pa-toast-icon{background:rgba(34,197,94,.1);color:#16a34a}.pa-toast--err .pa-toast-icon{background:rgba(239,68,68,.1);color:#dc2626}.pa-toast--warn .pa-toast-icon{background:rgba(245,158,11,.1);color:#d97706}
.pa-toast-body{flex:1;min-width:0}
.pa-toast-title{font-size:12.5px;font-weight:700;color:#0f172a;line-height:1.3}
.pa-toast-sub{font-size:11.5px;color:#64748b;margin-top:3px;line-height:1.45}
.pa-toast-close{background:none;border:none;cursor:pointer;color:#cbd5e1;padding:0;line-height:1;font-size:18px;flex-shrink:0;transition:color .15s;margin-top:-1px}
.pa-toast-close:hover{color:#475569}
.pa-toast-progress{position:absolute;bottom:0;left:4px;right:0;height:2px;border-radius:0 0 0 0;transform-origin:left;background:currentColor;opacity:.25}
@keyframes paToastIn{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}
@keyframes paToastOut{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(16px)}}
@keyframes paToastShrink{from{transform:scaleX(1)}to{transform:scaleX(0)}}
.pa-toast--loading .pa-toast-icon svg{animation:paSpin 1s linear infinite}
@keyframes paSpin{to{transform:rotate(360deg)}}
/* PDF preview modal */
.tk-pdf-modal { display:none;position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.65);flex-direction:column;animation:fadeIn .15s; }
.tk-pdf-modal-header { display:flex;align-items:center;justify-content:space-between;padding:12px 18px;background:var(--sidebar);border-bottom:1px solid var(--border);gap:12px; }
.tk-pdf-modal-title { font-size:13px;font-weight:600;color:var(--text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-pdf-modal-close { border:none;background:transparent;color:var(--text-2);cursor:pointer;padding:4px;border-radius:6px;display:flex;align-items:center; }
.tk-pdf-modal-close:hover { background:var(--border);color:var(--text); }
.tk-pdf-modal-body { flex:1;overflow:hidden; }
.tk-pdf-modal-frame { width:100%;height:100%;border:none; }
.tk-av-score { font-size:10.5px;font-weight:700;flex-shrink:0;border-radius:5px;padding:1px 6px; }
.tk-av-score--good { background:#d1fae5;color:#065f46; }
.tk-av-score--mid  { background:#fef3c7;color:#92400e; }
.tk-av-score--bad  { background:#fee2e2;color:#991b1b; }

/* ── Group headers ── */
.tk-monday-group-hd { display:flex;align-items:center;gap:7px;padding:14px 4px 5px;font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;color:var(--text-3);flex-shrink:0;user-select:none;border-top:1px solid var(--border);margin-top:2px; }
.tk-monday-group-hd:first-child { border-top:none;margin-top:0;padding-top:2px; }
.tk-monday-group-name { flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tk-monday-group-hd--collapsible { cursor:pointer; }
.tk-board-group { position:relative;z-index:1;flex:0 0 auto;overflow:visible;margin-bottom:22px; }
.tk-board-group:hover { z-index:80; }
.tk-board-group.has-status-menu-open { z-index:120; }
.tk-board-group:last-child { margin-bottom:0; }
.tk-board-group.drag-over .tk-board-table { border-color:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.11),0 5px 18px rgba(15,23,42,.08); }
.tk-board-group-hd { display:flex;align-items:center;gap:9px;min-height:38px;padding:2px 6px 8px;user-select:none;cursor:pointer; }
.tk-board-group-title { font-size:17px;font-weight:400;letter-spacing:0;text-transform:none;min-width:0;line-height:1.35;white-space:normal;overflow:visible;overflow-wrap:anywhere; }
.tk-board-group-count { opacity:0;pointer-events:none;font-size:11px;font-weight:500;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:1px 8px;margin-left:3px;color:var(--text-3);transition:opacity .12s; }
.tk-board-group-hd:hover .tk-board-group-count,.tk-board-group.is-collapsed .tk-board-group-count { opacity:1; }
.tk-board-group-hd .tk-group-toggle { margin-left:0;color:currentColor;flex-shrink:0;transition:transform .2s; }
.tk-board-table { display:flex;flex-direction:column;min-height:42px;min-width:100%;width:max-content;border:1px solid var(--border);border-radius:8px;background:var(--surface);overflow:visible;box-shadow:0 1px 4px rgba(15,23,42,.03); }
.tk-board-row { display:grid;grid-template-columns:var(--tk-board-cols,minmax(280px,1.2fr) 132px 190px 150px 200px 112px 140px minmax(180px,240px));align-items:stretch;gap:0;padding:0;min-width:100%;width:max-content;border-bottom:1px solid var(--border);background:var(--surface);transition:background .12s,box-shadow .12s,opacity .12s,transform .18s cubic-bezier(.2,.8,.2,1); }
.tk-board-row--customer { grid-template-columns:270px 112px 168px 84px 148px 138px 134px 126px 148px 104px 96px 140px 108px 176px 230px; }
.tk-board-row:last-child { border-bottom:none; }
.tk-board-row:first-child { border-radius:8px 8px 0 0; }
.tk-board-row:last-child { border-radius:0 0 8px 8px; }
.tk-board-row--head { min-height:36px;background:#fff;font-size:12px;font-weight:700;color:#0f172a;text-transform:none;letter-spacing:0; }
.tk-board-row--head > div:first-child { border-top-left-radius:8px; }
.tk-board-row--head > div:last-child { border-top-right-radius:8px; }
.tk-board-row:last-child > div:first-child { border-bottom-left-radius:8px; }
.tk-board-row:last-child > div:last-child { border-bottom-right-radius:8px; }
.tk-board-row.tk-card { position:relative;border-left:0;border-right:0;border-top:0;border-radius:0;box-shadow:none;cursor:pointer;align-items:stretch; }
.tk-board-row.tk-card::before { content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--tk-group-accent,var(--accent));opacity:0;z-index:4;pointer-events:none;transition:opacity .12s;border-radius:0 4px 4px 0; }
.tk-board-row.tk-card:hover { transform:none;background:#f8fafc;box-shadow:none;border-color:var(--border);border-bottom-color:var(--border); }
.tk-board-row.tk-card:hover::before,.tk-board-row.tk-card.selected::before,.tk-board-row.tk-card.is-expanded::before { opacity:1; }
.tk-board-row.tk-card:hover > div:not(.tk-board-status-cell) { background:#f8fafc;border-right-color:var(--border); }
.tk-board-row.tk-card:hover .tk-board-status-cell:not(.open) { opacity:.82;filter:none; }
.tk-board-row.tk-card.selected { background:color-mix(in srgb,var(--tk-group-accent,var(--accent)) 10%,var(--surface));box-shadow:none;border-color:var(--border); }
.tk-board-row.is-dragging { opacity:.82;box-shadow:0 12px 30px rgba(15,23,42,.12);position:relative;z-index:5; }
.tk-board-row.tk-dnd-shift { transition:transform .26s cubic-bezier(.22,.9,.2,1),background .12s,box-shadow .12s,opacity .12s;will-change:transform; }
.tk-board-row > div,.tk-board-cell { min-width:0;display:flex;align-items:center;gap:8px;padding:10px 12px;border-right:1px solid var(--border); }
.tk-board-row > div:last-child,.tk-board-cell:last-child { border-right:none; }
.tk-board-add-row { min-height:44px;background:#fff;color:#64748b;cursor:pointer; }
.tk-board-add-row:hover > div { background:#f8fafc; }
.tk-board-add-row.is-editing,.tk-board-add-row.is-saving { cursor:default;background:#fff; }
.tk-board-add-row.is-editing > div,.tk-board-add-row.is-saving > div { background:#fff; }
.tk-board-add-cell { justify-content:center; }
.tk-board-add-btn { width:100%;height:30px;border:0;background:transparent;color:#64748b;font-size:12.5px;font-weight:400;display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;padding:0 4px;border-radius:7px;cursor:pointer;transition:background .14s ease,color .14s ease; }
.tk-board-add-row:hover .tk-board-add-btn,.tk-board-add-btn:focus-visible { color:#0f172a;background:#eef2f7;outline:none; }
.tk-board-add-btn svg { color:var(--tk-group-accent,var(--accent));flex:0 0 auto; }
.tk-board-add-editor { width:100%;height:34px;display:flex;align-items:center;gap:6px;border:1px solid #bfdbfe;background:#fff;border-radius:8px;padding:3px 4px 3px 10px;box-shadow:0 0 0 3px rgba(0,115,234,.08); }
.tk-board-add-input { flex:1;min-width:0;height:100%;border:0;outline:none;background:transparent;color:#0f172a;font-size:13px;font-weight:400; }
.tk-board-add-input::placeholder { color:#94a3b8; }
.tk-board-add-save,.tk-board-add-cancel { width:26px;height:26px;border:0;border-radius:7px;background:transparent;color:#64748b;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .14s ease,color .14s ease; }
.tk-board-add-save { color:#0073ea; }
.tk-board-add-save:hover,.tk-board-add-save:focus-visible { background:#e0f2fe;color:#075985;outline:none; }
.tk-board-add-cancel:hover,.tk-board-add-cancel:focus-visible { background:#f1f5f9;color:#0f172a;outline:none; }
.tk-board-add-save:disabled,.tk-board-add-cancel:disabled,.tk-board-add-input:disabled { opacity:.7;cursor:wait; }
.tk-board-add-spinner { width:13px;height:13px;border-radius:999px;border:2px solid rgba(0,115,234,.22);border-top-color:#0073ea;animation:tkBoardAddSpin .8s linear infinite; }
@keyframes tkBoardAddSpin { to { transform:rotate(360deg); } }
.tk-board-row--head > div { position:relative;font-weight:700;color:#0f172a; }
.tk-board-row--head > div { justify-content:center;text-align:center; }
.tk-col-resizer { position:absolute;top:0;right:-4px;width:8px;height:100%;cursor:col-resize;z-index:4; }
.tk-col-resizer::after { content:"";position:absolute;top:8px;bottom:8px;left:3px;width:2px;border-radius:999px;background:transparent;transition:background .12s; }
.tk-col-resizer:hover::after,.tk-col-resizer.is-active::after { background:var(--accent); }
.tk-board-cell--title { flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;text-align:left; }
.tk-board-title { width:100%;font-size:13px;font-weight:400;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;text-align:left; }
.tk-board-ticket-no { font-size:12px;font-weight:500;color:#0f172a;font-family:'Menlo','Monaco','Courier New',monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-board-summary-cell { position:relative; }
.tk-board-summary { font-size:12px;color:#0f172a;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.tk-board-summary-popover { display:none;position:absolute;left:10px;top:calc(100% - 4px);z-index:6000;width:min(520px,70vw);max-height:min(420px,55vh);overflow:auto;background:#0f172a;border:1px solid rgba(255,255,255,.16);border-radius:10px;box-shadow:0 18px 44px rgba(15,23,42,.32);padding:11px 12px;font-size:12px;line-height:1.5;color:#fff;white-space:pre-wrap; }
.tk-board-summary-cell:hover .tk-board-summary-popover { display:block; }
.tk-board-mandant-cell { position:relative;background:var(--surface);justify-content:center;text-align:center;overflow:visible; }
.tk-board-mandant-badge { position:relative;display:block;width:100%;min-width:0;min-height:26px;padding:5px 10px 5px 16px;border:1px solid #e2e8f0;border-radius:6px;background:#fff;color:#64748b;font-size:12px;font-weight:500;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;box-sizing:border-box;box-shadow:0 1px 2px rgba(15,23,42,.04); }
.tk-board-mandant-badge::before { content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#0073ea; }
.tk-board-mandant-cell.is-clickable { cursor:pointer; }
.tk-board-mandant-cell.is-clickable .tk-board-mandant-badge { transition:border-color .15s,box-shadow .15s,background .15s,color .15s; }
.tk-board-mandant-cell.is-clickable:hover .tk-board-mandant-badge { border-color:#bfdbfe;background:#f8fbff;color:#334155;box-shadow:0 0 0 3px rgba(0,115,234,.07); }
.tk-board-mandant-popover { display:none;position:absolute;left:10px;top:calc(100% - 4px);z-index:6000;width:min(420px,62vw);max-height:min(260px,42vh);overflow:auto;background:#0f172a;border:1px solid rgba(255,255,255,.16);border-radius:10px;box-shadow:0 18px 44px rgba(15,23,42,.32);padding:11px 12px;font-size:12px;line-height:1.5;color:#fff;white-space:pre-wrap;text-align:left; }
.tk-board-mandant-cell:hover .tk-board-mandant-popover,.tk-info-mandant-box:hover .tk-board-mandant-popover { display:block; }
.tk-board-row .tk-board-cell:nth-child(2),.tk-board-row .tk-board-cell:nth-child(6),.tk-board-row .tk-board-cell:nth-child(7) { justify-content:center;text-align:center; }
.tk-board-account-manager-cell { justify-content:center;text-align:center;white-space:nowrap; }
.tk-board-account-manager-cell .tk-customer-value { color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-board-assignee-cell { justify-content:center;text-align:center;overflow:visible; }
.tk-ticket-assignee-btn { position:relative;width:34px;height:34px;border:0;border-radius:999px;background:transparent;padding:0;display:inline-flex;align-items:center;justify-content:center;color:#64748b;cursor:pointer;transition:background .14s ease,color .14s ease,transform .14s ease; }
.tk-ticket-assignee-btn:hover,.tk-ticket-assignee-btn.active { background:#eef2f7;color:#0f172a; }
.tk-ticket-assignee-btn:active { transform:scale(.97); }
.tk-ticket-assignee-btn.is-empty { color:#94a3b8; }
.tk-ticket-assignee-empty-avatar { position:relative;width:28px;height:28px;border-radius:999px;background:linear-gradient(135deg,#f8fafc 0%,#eef2f7 100%);border:1px solid #dbe4ee;display:flex;align-items:center;justify-content:center;color:#94a3b8;box-shadow:0 1px 5px rgba(15,23,42,.06);transition:border-color .14s ease,background .14s ease,color .14s ease; }
.tk-ticket-assignee-btn:hover .tk-ticket-assignee-empty-avatar,.tk-ticket-assignee-btn.active .tk-ticket-assignee-empty-avatar { background:#fff;border-color:#bfdbfe;color:#64748b; }
.tk-ticket-assignee-empty-user { width:17px;height:17px; }
.tk-ticket-assignee-plus { position:absolute;right:-2px;bottom:-2px;width:13px;height:13px;border-radius:999px;background:#0073ea;color:#fff;border:2px solid #fff;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 7px rgba(0,115,234,.28); }
.tk-ticket-assignee-plus svg { width:8px;height:8px;display:block; }
.tk-ticket-assignee-btn .global-user-av { width:28px;height:28px;font-size:10.5px;box-shadow:0 1px 6px rgba(15,23,42,.13); }
.tk-ticket-assignee-btn::after { content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%) translateY(3px);z-index:6500;max-width:220px;padding:6px 9px;border-radius:7px;background:#0f172a;color:#fff;font-size:11.5px;font-weight:400;line-height:1.25;white-space:nowrap;box-shadow:0 12px 28px rgba(15,23,42,.26);opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease; }
.tk-ticket-assignee-btn::before { content:"";position:absolute;left:50%;bottom:calc(100% + 3px);transform:translateX(-50%) translateY(3px);z-index:6501;border:5px solid transparent;border-top-color:#0f172a;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease; }
.tk-ticket-assignee-btn:hover::after,.tk-ticket-assignee-btn:focus-visible::after,.tk-ticket-assignee-btn:hover::before,.tk-ticket-assignee-btn:focus-visible::before { opacity:1;transform:translateX(-50%) translateY(0); }
.tk-assignee-picker { position:fixed;z-index:9000;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 22px 55px rgba(15,23,42,.24);padding:10px;box-sizing:border-box; }
.tk-assignee-search-wrap { height:40px;display:flex;align-items:center;gap:9px;border:1px solid #e2e8f0;border-radius:11px;background:#f8fafc;padding:0 11px;color:#64748b;box-sizing:border-box; }
.tk-assignee-search-wrap:focus-within { background:#fff;border-color:#bfdbfe;box-shadow:0 0 0 3px rgba(0,115,234,.09);color:#0f172a; }
.tk-assignee-search-wrap input { flex:1;min-width:0;border:0;outline:0;background:transparent;color:#0f172a;font-family:inherit;font-size:13px;font-weight:400; }
.tk-assignee-search-wrap input::placeholder { color:#94a3b8; }
.tk-assignee-section-row { display:flex;align-items:center;justify-content:space-between;gap:8px;margin:11px 2px 7px;color:#94a3b8;font-size:12px;font-weight:400; }
.tk-assignee-clear { border:0;background:transparent;color:#64748b;font-family:inherit;font-size:12px;font-weight:400;cursor:pointer;padding:3px 5px;border-radius:7px; }
.tk-assignee-clear:hover { background:#f1f5f9;color:#0f172a; }
.tk-assignee-list { display:flex;flex-direction:column;gap:2px;max-height:270px;overflow:auto;padding-right:2px; }
.tk-assignee-option { width:100%;display:flex;align-items:center;gap:10px;border:0;border-radius:10px;background:transparent;padding:8px 9px;font-family:inherit;text-align:left;color:#0f172a;cursor:pointer;transition:background .12s ease; }
.tk-assignee-option:hover { background:#f1f5f9; }
.tk-assignee-option.is-selected { background:#eef6ff; }
.tk-assignee-option .global-user-av { width:30px;height:30px;font-size:11px;flex:0 0 auto; }
.tk-assignee-option-text { flex:1;min-width:0;display:flex;flex-direction:column;gap:1px; }
.tk-assignee-option-text > span { font-size:13px;font-weight:500;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-assignee-option-text small { font-size:11.5px;font-weight:400;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-assignee-check { flex:0 0 auto;color:#0073ea; }
.tk-assignee-empty { padding:16px 10px;color:#64748b;font-size:12px;text-align:center; }
.tk-board-status-cell { position:relative;justify-content:center;align-self:stretch;font-size:11px;font-weight:400;text-transform:none;letter-spacing:0;color:#0f172a;background:var(--surface);border-right-color:var(--border);cursor:pointer;overflow:visible; }
.tk-board-status-cell.open { z-index:5000; }
.tk-board-status-cell.privaicy,.tk-board-status-cell.matching,.tk-board-status-cell.klassifizierung,.tk-board-status-cell.datenschutzaufgabe,.tk-board-status-cell.inbearbeitung,.tk-board-status-cell.bittepruefen,.tk-board-status-cell.ueberarbeiten,.tk-board-status-cell.bereit,.tk-board-status-cell.versendet,.tk-board-status-cell.spam,.tk-board-status-cell.unknown { background:var(--surface);color:#0f172a; }
.tk-board-status-cell:hover { filter:none;background:#f8fafc; }
.tk-board-status-pill { display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:24px;padding:4px 10px;border-radius:999px;background:var(--tk-status-bg,#f1f5f9);border:1px solid var(--tk-status-border,#e2e8f0);color:var(--tk-status-color,#475569);font-size:11.5px;font-weight:500;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box; }
.tk-board-status-cell:hover .tk-board-status-pill,.tk-board-status-cell.open .tk-board-status-pill { background:color-mix(in srgb,var(--tk-status-bg,#f1f5f9) 72%,#fff);border-color:color-mix(in srgb,var(--tk-status-color,#475569) 32%,#e2e8f0); }
.tk-board-status-menu { display:none;position:absolute;top:calc(100% + 6px);left:50%;transform:translateX(-50%);z-index:5000;width:310px;grid-template-columns:1fr 1fr;gap:6px;padding:8px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 18px 44px rgba(15,23,42,.22);text-transform:none;letter-spacing:0; }
.tk-board-status-cell.open .tk-board-status-menu { display:grid; }
.tk-board-status-opt { min-width:0;border:1px solid var(--tk-status-border,#e2e8f0);border-radius:999px;padding:8px 10px;font-family:inherit;font-size:11.5px;font-weight:400;text-align:center;cursor:pointer;color:var(--tk-status-color,#475569);background:var(--tk-status-bg,#f1f5f9);box-shadow:none;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease; }
.tk-board-status-opt:hover { filter:none;background:color-mix(in srgb,var(--tk-status-bg,#f1f5f9) 72%,#fff);border-color:color-mix(in srgb,var(--tk-status-color,#475569) 34%,#e2e8f0);transform:none; }
.tk-board-status-opt[aria-current="true"] { box-shadow:0 0 0 2px color-mix(in srgb,var(--tk-status-color,#475569) 16%,transparent); }
.tk-board-status-divider { grid-column:1/-1;height:1px;background:#e2e8f0;margin:3px 0; }
.tk-board-status-edit { grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:7px;border:0;border-radius:9px;background:#f8fafc;color:#0f172a;padding:9px 10px;font-family:inherit;font-size:12px;font-weight:400;cursor:pointer; }
.tk-board-status-edit:hover { background:#eef2f7; }
.tk-board-status-opt.privaicy,.tk-board-status-opt.matching,.tk-board-status-opt.klassifizierung,.tk-board-status-opt.datenschutzaufgabe,.tk-board-status-opt.inbearbeitung,.tk-board-status-opt.bittepruefen,.tk-board-status-opt.ueberarbeiten,.tk-board-status-opt.bereit,.tk-board-status-opt.versendet,.tk-board-status-opt.spam,.tk-board-status-opt.unknown { background:var(--tk-status-bg,#f1f5f9);color:var(--tk-status-color,#475569); }
.tk-board-muted { font-size:12px;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-board-email { font-size:12px;color:#0073ea;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-board-empty-row { padding:16px 14px;font-size:12px;color:var(--text-3);background:var(--surface);border-bottom:none; }
.tk-board-group--customers .tk-board-table { min-width:2182px; }
.tk-board-row--customer > div,.tk-board-row--customer .tk-board-cell { padding-left:10px;padding-right:10px; }
.tk-card--customers { cursor:pointer; }
.tk-card--customers.is-expanded { background:#f8fafc; }
.tk-card--customers.is-expanded > div:not(.tk-board-status-cell) { background:#f8fafc; }
.tk-card--customers .tk-board-cell--title { flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;text-align:left; }
.tk-card--customers .tk-board-title { text-align:left;flex:0 1 auto;width:auto;min-width:0; }
.tk-customer-contact-count { flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 7px;border-radius:999px;background:#e5e7eb;color:#0f172a;font-size:11px;font-weight:400;line-height:1; }
.tk-customer-expand-btn { width:24px;height:24px;border:0;border-radius:7px;background:transparent;color:#64748b;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0; }
.tk-customer-expand-btn:hover:not(:disabled) { background:#eef2f7;color:#0f172a; }
.tk-customer-expand-btn.is-open svg { transform:rotate(90deg); }
.tk-customer-expand-btn:disabled { opacity:.22;cursor:default; }
.tk-customer-onboarding-cell { justify-content:center;text-align:center;color:#fff;font-size:12px;font-weight:400;align-self:stretch; }
.tk-customer-onboarding-cell span { display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-customer-onboarding-cell.onboarding-active { background:#38bdf8;color:#fff; }
.tk-customer-onboarding-cell.onboarding-done { background:#16a34a;color:#fff; }
.tk-customer-onboarding-cell.onboarding-inactive { background:#dc2626;color:#fff; }
.tk-customer-onboarding-cell.onboarding-unknown { background:#94a3b8;color:#fff; }
.tk-customer-type-cell { justify-content:center;text-align:center;color:#fff;font-size:12px;font-weight:400;align-self:stretch; }
.tk-customer-type-cell span { display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-customer-type-cell.type-mandant { background:#16a34a;color:#fff; }
.tk-customer-type-cell.type-audit { background:#7c3aed;color:#fff; }
.tk-customer-type-cell.type-special { background:#1e3a8a;color:#fff; }
.tk-customer-type-cell.type-audit-old { background:#f59e0b;color:#fff; }
.tk-customer-type-cell.type-online { background:#dc2626;color:#fff; }
.tk-customer-type-cell.type-successor { background:#38bdf8;color:#fff; }
.tk-customer-type-cell.type-unknown { background:#94a3b8;color:#fff; }
.tk-customer-rating-cell { justify-content:center;text-align:center;color:#fff;font-size:12px;font-weight:400;align-self:stretch; }
.tk-customer-rating-cell.rating-a { background:#16a34a;color:#fff; }
.tk-customer-rating-cell.rating-b { background:#f59e0b;color:#fff; }
.tk-customer-rating-cell.rating-unknown { background:#94a3b8;color:#fff; }
.tk-card--customers:hover .tk-customer-onboarding-cell,.tk-card--customers:hover .tk-customer-type-cell,.tk-card--customers:hover .tk-customer-rating-cell { opacity:.94;filter:saturate(.88) brightness(.96); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-onboarding-cell.onboarding-active { background:#38bdf8;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-onboarding-cell.onboarding-done { background:#16a34a;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-onboarding-cell.onboarding-inactive { background:#dc2626;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-onboarding-cell.onboarding-unknown { background:#94a3b8;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-mandant { background:#16a34a;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-audit { background:#7c3aed;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-special { background:#1e3a8a;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-audit-old { background:#f59e0b;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-online { background:#dc2626;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-successor { background:#38bdf8;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-type-cell.type-unknown { background:#94a3b8;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-rating-cell.rating-a { background:#16a34a;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-rating-cell.rating-b { background:#f59e0b;border-right-color:var(--border); }
.tk-board-row.tk-card.tk-card--customers:hover .tk-customer-rating-cell.rating-unknown { background:#94a3b8;border-right-color:var(--border); }
.tk-customer-value,.tk-customer-link-value { display:block;min-width:0;width:100%;max-width:100%;box-sizing:border-box;font-size:12px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center; }
.tk-customer-link-value { text-decoration:none; }
.tk-customer-link-value:hover { text-decoration:underline; }
.tk-customer-domain-value,.tk-customer-link-value { color:#0073ea; }
.tk-customer-account-manager-cell .tk-customer-value,.tk-customer-dsb-cell .tk-customer-value { color:#0f172a; }
.tk-customer-user-btn { position:relative;width:34px;height:34px;border:0;border-radius:999px;background:transparent;padding:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .14s ease,transform .14s ease; }
.tk-customer-user-btn:hover { background:#eef2f7; }
.tk-customer-user-btn:active { transform:scale(.97); }
.tk-customer-user-btn .global-user-av { width:28px;height:28px;font-size:10.5px;box-shadow:0 1px 6px rgba(15,23,42,.13); }
.tk-customer-user-btn::after { content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%) translateY(3px);z-index:6500;max-width:220px;padding:6px 9px;border-radius:7px;background:#0f172a;color:#fff;font-size:11.5px;font-weight:400;line-height:1.25;white-space:nowrap;box-shadow:0 12px 28px rgba(15,23,42,.26);opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease; }
.tk-customer-user-btn::before { content:"";position:absolute;left:50%;bottom:calc(100% + 3px);transform:translateX(-50%) translateY(3px);z-index:6501;border:5px solid transparent;border-top-color:#0f172a;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease; }
.tk-customer-user-btn:hover::after,.tk-customer-user-btn:focus-visible::after,.tk-customer-user-btn:hover::before,.tk-customer-user-btn:focus-visible::before { opacity:1;transform:translateX(-50%) translateY(0); }

/* Unified user avatars */
.global-user-av,
.user-av-sm,
.avatar.user-av,
.users-card-avatar,
.profile-hero-av,
.welcome-user-av,
.tk-ticket-chat-avatar.user,
.fb-user-chip-av {
  --user-av-a:#0A938C;
  --user-av-b:#14b8a6;
  --user-av-c:#0f766e;
  --user-av-ring:rgba(20,184,166,.32);
  position:relative;
  isolation:isolate;
  overflow:hidden;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.72) 0 9%, rgba(255,255,255,.26) 10% 18%, transparent 34%),
    linear-gradient(142deg,var(--user-av-a) 0%,var(--user-av-b) 52%,var(--user-av-c) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.42),
    inset 0 -10px 18px rgba(15,23,42,.15),
    0 0 0 2px rgba(255,255,255,.9),
    0 3px 12px rgba(15,23,42,.16),
    0 0 0 5px var(--user-av-ring);
  text-shadow:0 1px 2px rgba(15,23,42,.22);
  letter-spacing:.02em;
  font-weight:800;
}
.global-user-av::before,
.user-av-sm::before,
.avatar.user-av::before,
.users-card-avatar::before,
.profile-hero-av::before,
.welcome-user-av::before,
.tk-ticket-chat-avatar.user::before,
.fb-user-chip-av::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    linear-gradient(155deg,rgba(255,255,255,.34) 0 22%,transparent 23% 54%,rgba(15,23,42,.16) 55% 100%),
    radial-gradient(circle at 78% 82%,rgba(255,255,255,.22),transparent 42%);
  mix-blend-mode:soft-light;
}
.global-user-av::after,
.user-av-sm::after,
.avatar.user-av::after,
.users-card-avatar::after,
.profile-hero-av::after,
.welcome-user-av::after,
.tk-ticket-chat-avatar.user::after,
.fb-user-chip-av::after {
  content:"";
  position:absolute;
  inset:2px;
  border-radius:inherit;
  border:1px solid rgba(255,255,255,.34);
  pointer-events:none;
  z-index:1;
}
.global-user-av.role-Admin,
.user-av-sm.role-Admin,
.avatar.user-av.role-Admin,
.users-card-avatar.role-Admin,
.profile-hero-av.role-Admin,
.welcome-user-av.role-Admin,
.tk-ticket-chat-avatar.role-Admin,
.fb-user-chip-av.role-Admin {
  --user-av-a:#ef4444;
  --user-av-b:#dc2626;
  --user-av-c:#991b1b;
  --user-av-ring:rgba(239,68,68,.25);
}
.global-user-av.role-Moderator,
.user-av-sm.role-Moderator,
.avatar.user-av.role-Moderator,
.users-card-avatar.role-Moderator,
.profile-hero-av.role-Moderator,
.welcome-user-av.role-Moderator,
.tk-ticket-chat-avatar.role-Moderator,
.fb-user-chip-av.role-Moderator {
  --user-av-a:#7c3aed;
  --user-av-b:#8b5cf6;
  --user-av-c:#5b21b6;
  --user-av-ring:rgba(124,58,237,.24);
}
.global-user-av.role-Experte,
.user-av-sm.role-Experte,
.avatar.user-av.role-Experte,
.users-card-avatar.role-Experte,
.profile-hero-av.role-Experte,
.welcome-user-av.role-Experte,
.tk-ticket-chat-avatar.role-Experte,
.fb-user-chip-av.role-Experte {
  --user-av-a:#047857;
  --user-av-b:#059669;
  --user-av-c:#065f46;
  --user-av-ring:rgba(5,150,105,.23);
}
.global-user-av.role-Gast,
.user-av-sm.role-Gast,
.avatar.user-av.role-Gast,
.users-card-avatar.role-Gast,
.profile-hero-av.role-Gast,
.welcome-user-av.role-Gast,
.tk-ticket-chat-avatar.role-Gast,
.fb-user-chip-av.role-Gast {
  --user-av-a:#94a3b8;
  --user-av-b:#64748b;
  --user-av-c:#475569;
  --user-av-ring:rgba(100,116,139,.20);
}
.global-user-av.role-Benutzer,
.user-av-sm.role-Benutzer,
.avatar.user-av.role-Benutzer,
.users-card-avatar.role-Benutzer,
.profile-hero-av.role-Benutzer,
.welcome-user-av.role-Benutzer,
.tk-ticket-chat-avatar.role-Benutzer,
.fb-user-chip-av.role-Benutzer {
  --user-av-a:#0A938C;
  --user-av-b:#14b8a6;
  --user-av-c:#0f766e;
  --user-av-ring:rgba(20,184,166,.32);
}
.profile-hero-av {
  border:4px solid var(--surface);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.3),
    inset 0 -18px 30px rgba(15,23,42,.13),
    0 0 0 2px rgba(255,255,255,.95),
    0 10px 28px rgba(10,147,140,.22),
    0 0 0 7px var(--user-av-ring);
}
.global-user-btn { border:0;background:transparent; }
.global-user-btn:hover,.global-user-btn.active { background:rgba(255,255,255,.16);border-color:transparent; }
.global-user-btn .global-user-av {
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.72) 0 9%, rgba(255,255,255,.26) 10% 18%, transparent 34%),
    linear-gradient(142deg,var(--user-av-a) 0%,var(--user-av-b) 52%,var(--user-av-c) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.34),
    inset 0 -10px 18px rgba(15,23,42,.15),
    0 2px 10px rgba(15,23,42,.16);
}
.global-user-btn .global-user-av::before {
  background:
    radial-gradient(circle at 68% 30%,rgba(255,255,255,.36) 0 4px,transparent 5px),
    radial-gradient(circle at 35% 72%,rgba(255,255,255,.24) 0 3px,transparent 4px),
    linear-gradient(155deg,rgba(255,255,255,.30) 0 22%,transparent 23% 54%,rgba(15,23,42,.14) 55% 100%);
  mix-blend-mode:soft-light;
}
.global-user-btn .global-user-av::after { border-color:rgba(255,255,255,.24); }
.tk-board-row--customer .tk-board-cell { justify-content:center;text-align:center; }
.tk-board-row--customer .tk-board-cell > .tk-customer-value,.tk-board-row--customer .tk-board-cell > .tk-customer-link-value { flex:1 1 0;min-width:0; }
.tk-board-row--customer .tk-board-cell--title { justify-content:flex-start;text-align:left; }
.tk-board-row--customer .tk-board-cell--title .tk-board-title { text-align:left; }
.tk-customer-contacts-row { position:relative;width:100%;min-width:100%;box-sizing:border-box;background:#fbfdff;border-bottom:1px solid var(--border);overflow-x:auto; }
.tk-customer-contacts-row::before { content:"";position:absolute;left:1px;top:-1px;bottom:8px;width:2px;background:var(--tk-group-accent,var(--accent));z-index:2;pointer-events:none;border-radius:0 0 999px 999px; }
.tk-customer-contacts-inner { position:relative;margin-left:42px;padding:8px 12px 12px 0;overflow:visible; }
.tk-customer-contacts-table { min-width:980px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;overflow:visible;box-shadow:0 1px 2px rgba(15,23,42,.03); }
.tk-customer-contact-head,.tk-customer-contact-line { display:grid;grid-template-columns:minmax(130px,.8fr) minmax(120px,.7fr) minmax(180px,1fr) minmax(220px,1.2fr) minmax(150px,.8fr) minmax(130px,.75fr) minmax(180px,1fr) minmax(140px,.8fr);align-items:center; }
.tk-customer-contact-head { position:relative;background:#fff;color:#0f172a;font-size:11.5px;font-weight:400;border-bottom:1px solid #e2e8f0;border-radius:8px 8px 0 0;overflow:hidden; }
.tk-customer-contact-head > div,.tk-customer-contact-line > div { min-width:0;padding:8px 10px;border-right:1px solid #e2e8f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tk-customer-contact-head > div:last-child,.tk-customer-contact-line > div:last-child { border-right:0; }
.tk-customer-contact-head > div,.tk-customer-contact-line > div { text-align:center;justify-content:center; }
.tk-customer-contact-line { position:relative;color:#0f172a;font-size:12px;border-bottom:1px solid #eef2f7;transition:background .12s;overflow:visible; }
.tk-customer-contact-line::before { content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--tk-group-accent,var(--accent));z-index:3;pointer-events:none; }
.tk-customer-contact-line::after { content:"";position:absolute;left:-42px;top:calc(50% - 9px);width:42px;height:18px;background:transparent;border-left:2px solid var(--tk-group-accent,var(--accent));border-bottom:2px solid var(--tk-group-accent,var(--accent));border-radius:0 0 0 13px;z-index:2;pointer-events:none;box-sizing:border-box; }
.tk-customer-contact-line:hover { background:#f8fafc; }
.tk-customer-contact-line:last-child { border-bottom:0;border-radius:0 0 8px 8px; }
.tk-customer-contact-line a { color:#0073ea;text-decoration:none; }
.tk-customer-contact-line a:hover { text-decoration:underline; }
.tk-customer-contact-empty { padding:14px 16px;color:#64748b;font-size:12px; }
@media(max-width:1100px){
  .tk-board-row { grid-template-columns:minmax(240px,1fr) 118px 170px 130px 116px 104px 120px; }
  .tk-board-row--customer { grid-template-columns:230px 106px 150px 80px 138px 130px 124px 118px 136px 98px 90px 130px 100px 160px 210px; }
  .tk-board-row > :nth-child(8) { display:none; }
  .tk-board-row--customer > :nth-child(7) { display:flex; }
  .tk-board-row--customer > :nth-child(8) { display:flex; }
  .tk-board-row--customer > :nth-child(9) { display:none; }
}
@media(max-width:760px){
  .tk-body { padding:12px; }
  .tk-ticket-search { margin:-12px -12px 0;padding:12px 12px 14px; }
  .tk-ticket-search-field { flex:1 1 auto;max-width:none; }
  .tk-ticket-search-field > svg { left:12px; }
  .tk-board-row { grid-template-columns:1fr;gap:5px;align-items:flex-start; }
  .tk-board-row--customer { grid-template-columns:1fr; }
  .tk-board-row--head { display:none; }
  .tk-board-cell { width:100%;border-right:none;padding:7px 12px; }
  .tk-board-cell::before { content:attr(data-label);width:86px;flex-shrink:0;font-size:10px;font-weight:800;color:var(--text-3);text-transform:uppercase;letter-spacing:.05em; }
  .tk-board-cell--title::before { display:none; }
}
.tk-group-hd { display:flex;align-items:center;gap:7px;padding:14px 4px 6px;font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.6px;color:var(--text-3);flex-shrink:0;user-select:none; }
.tk-group-hd:first-child { padding-top:2px; }
.tk-group-dot { width:7px;height:7px;border-radius:50%;flex-shrink:0; }
.tk-group-dot--privaicy { background:#ec4899; }

/* ── Monday-style Timeline Feed ── */
.tl-feed { padding:16px 24px 4px;display:flex;flex-direction:column; }
.tl-entry { position:relative;padding-bottom:16px; }
.tl-hdr { display:flex;align-items:center;gap:10px;padding:0 0 10px; }
.tl-icon { width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:#fff; }
.tl-icon--blue { background:#1c6fef; }
.tl-icon--pink { background:#ff158a; }
.tl-icon--orange { background:#f59e0b; }
.tl-icon--teal { background:#14b8a6; }
.tl-icon--assistant-logo { background:#fff;border:1px solid var(--border);box-shadow:0 1px 4px rgba(15,23,42,.08);overflow:hidden; }
.tl-icon--assistant-logo img { width:19px;height:19px;object-fit:contain; }
.tl-label { font-size:13px;font-weight:400;color:var(--text-3);flex:1;min-width:0; }
.tl-date { font-size:11.5px;color:var(--text-3);flex-shrink:0; }
.tl-card { background:var(--surface);border:1.5px solid var(--border);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:8px;margin-left:38px; }
.tl-row { display:flex;align-items:center;gap:9px;min-width:0; }
.tl-row--muted { color:var(--text-3); }
.tl-avatar { width:28px;height:28px;border-radius:50%;background:#bfdbfe;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0;text-transform:uppercase; }
.tl-from { font-size:13px;font-weight:600;color:var(--text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-to-val { font-size:12px;color:var(--text-3);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-atts { display:flex;flex-wrap:wrap;gap:5px; }
.tl-att-link { display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:400;color:#0f172a;text-decoration:none;background:rgba(28,111,239,.13);border:1px solid rgba(28,111,239,.22);border-radius:6px;padding:2px 8px;transition:background .12s,border-color .12s;cursor:pointer; }
.tl-att-link:hover { background:rgba(28,111,239,.22);border-color:rgba(28,111,239,.38);color:#0f172a; }
.tl-subject { font-size:13.5px;font-weight:700;color:var(--text); }
.tl-body { font-size:13px;color:#0f172a;line-height:1.7;white-space:pre-wrap;max-height:none;overflow:visible; }
#tl-email-subject,#tl-email-body,.tl-email-indent { margin-left:37px; }
#tl-email-atts { margin-left:37px;display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:8px; }
.tl-atts-icon { width:18px;height:22px;display:flex;align-items:center;justify-content:center;color:#64748b; }
.tl-atts-list { min-width:0;display:flex;flex-wrap:wrap;gap:6px; }
.tl-row--logo { padding-bottom:2px;margin-bottom:2px; }
.tl-pl-logo { width:20px;height:20px;border-radius:5px;object-fit:contain;flex-shrink:0; }
.tl-pl-name { font-size:13px;font-weight:700;color:var(--text); }
.tl-reply-display { font-size:13px;color:#0f172a;line-height:1.7; }
.tl-reply-indent { margin-left:29px; }
.tl-classification-card { position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-left:29px;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:#fff; }
.tl-classification-hint { font-size:12px;color:#475569;line-height:1.35; }
.tl-classification-suggestion-title { margin-top:14px;font-size:12px;color:#475569;line-height:1.35; }
.tl-classification-suggestions { display:grid;grid-template-columns:1fr 1fr;gap:9px;width:100%;margin-top:10px; }
.tl-classification-suggestion { position:relative;display:flex;flex-direction:column;min-width:0;border:1px solid #e2e8f0;border-radius:9px;background:#fff;color:#0f172a;padding:0;font-family:inherit;text-align:left;cursor:default;transition:border-color .14s,background .14s,box-shadow .14s,transform .14s;overflow:hidden;box-shadow:none; }
.tl-classification-suggestion:hover { border-color:#d8b4fe;background:#fbf8ff;box-shadow:0 8px 22px rgba(15,23,42,.08);transform:translateY(-1px); }
.tl-classification-suggestion.is-executed { opacity:.56;background:#f8fafc; }
.tl-classification-suggestion.is-executed:hover { transform:none;box-shadow:none;border-color:#e2e8f0;background:#f8fafc; }
.tl-classification-suggestion.is-recommended { border:0;border-radius:12px;background:#7c3aed;padding:6px 6px 8px;color:#fff; }
.tl-classification-suggestion.is-recommended:hover { background:#6d28d9;box-shadow:0 10px 26px rgba(124,58,237,.24); }
.tl-classification-suggestion-inner { display:flex;flex-direction:column;align-items:stretch;gap:0;min-width:0;background:transparent;border:0;border-radius:0;overflow:visible;flex:1; }
.tl-classification-suggestion.is-recommended .tl-classification-suggestion-inner { background:#fff;border:1px solid rgba(255,255,255,.52);border-radius:9px;overflow:hidden; }
.tl-classification-suggestion.is-recommended:hover .tl-classification-suggestion-inner { border-color:rgba(255,255,255,.78); }
.tl-classification-suggestion-head { padding:12px 13px 8px;font-size:13px;font-weight:500;color:#0f172a;line-height:1.25;padding-right:76px; }
.tl-classification-suggestion:not(.is-recommended) .tl-classification-suggestion-head { padding-right:13px; }
.tl-classification-suggestion-meta { display:flex;flex-wrap:wrap;gap:6px;padding:0 13px 9px; }
.tl-classification-suggestion-chip { display:inline-flex;align-items:center;max-width:100%;min-width:0;border-radius:999px;background:#f1f5f9;border:1px solid #e2e8f0;color:#334155;padding:3px 7px;font-size:10.5px;font-weight:500;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tl-classification-suggestion-chip.type-document_review,.tl-classification-suggestion-chip.type-document_generation { background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9; }
.tl-classification-suggestion-chip.type-av_contract_check { background:#f5f3ff;border-color:#c4b5fd;color:#6d28d9; }
.tl-classification-suggestion-chip.type-template_provision { background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9; }
.tl-classification-suggestion-chip.basis { gap:4px;background:rgba(124,58,237,.11);border-color:rgba(124,58,237,.22);color:#0f172a;border-radius:6px;padding:3px 8px;font-weight:400; }
.tl-classification-suggestion-chip.basis span { overflow:hidden;text-overflow:ellipsis; }
.tl-classification-suggestion-chip.basis.is-link { text-decoration:none;cursor:pointer; }
.tl-classification-suggestion-chip.basis.is-link:hover { background:rgba(124,58,237,.18);border-color:rgba(124,58,237,.34);color:#0f172a; }
.tl-suggestion-meta-kv { display:grid;grid-template-columns:64px 1fr;gap:8px 10px;padding:0 13px 10px;align-items:start; }
.tl-suggestion-meta-key { color:#64748b;font-size:11px;line-height:1.4; }
.tl-suggestion-inputs { display:flex;flex-wrap:wrap;gap:6px;min-width:0; }
.tl-suggestion-input-chip { display:inline-flex;align-items:center;gap:5px;max-width:100%;border:1px solid #ddd6fe;background:#f5f3ff;color:#0f172a;border-radius:7px;padding:4px 7px;font-size:11px;font-weight:400;line-height:1;text-decoration:none; }
.tl-suggestion-input-chip span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-suggestion-input-chip.is-link:hover { background:#ede9fe;border-color:#c4b5fd; }
.tl-suggestion-input-x { border:0;background:transparent;color:#64748b;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;cursor:pointer;font-size:12px;line-height:1; }
.tl-suggestion-input-x:hover { background:#ddd6fe;color:#0f172a; }
.tl-suggestion-input-add { width:24px;height:24px;border:1px dashed #c4b5fd;background:#fff;color:#7c3aed;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:15px;line-height:1; }
.tl-suggestion-input-add:hover { background:#f5f3ff;border-style:solid; }
.tl-suggestion-checklist-chip { display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;border:1px solid #ddd6fe;background:#f5f3ff;color:#4c1d95;border-radius:7px;padding:4px 7px;font-size:11px;font-weight:400;line-height:1.2; }
.tl-suggestion-checklist-chip span:last-child { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-suggestion-checklist-chip.is-done { background:#ecfdf5;border-color:#bbf7d0;color:#166534; }
.tl-suggestion-checklist-icon { width:14px;height:14px;flex:0 0 14px;display:inline-flex;align-items:center;justify-content:center;border:1px solid currentColor;border-radius:4px;font-size:10px;line-height:1; }
.tl-suggestion-output-select { display:inline-flex;align-items:center;gap:7px;font-size:11.5px;color:#334155;line-height:1.2; }
.tl-suggestion-output-select input { width:14px;height:14px;margin:0;accent-color:#7c3aed; }
.tl-suggestion-action-title { color:#0f172a;font-size:11.5px;line-height:1.35;min-width:0; }
.tl-suggestion-detail { padding:9px 13px 10px;color:#475569;font-size:11.5px;line-height:1.45; }
.tl-suggestion-detail + .tl-suggestion-detail { padding-top:0; }
.tl-suggestion-detail strong { color:#0f172a;font-weight:600; }
.tk-suggestion-input-pop { position:fixed;z-index:10050;width:min(520px,calc(100vw - 32px));background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 18px 44px rgba(15,23,42,.18);padding:14px;display:none; }
.tk-suggestion-input-pop.is-open { display:block; }
.tk-suggestion-input-pop h4 { font-size:14px;font-weight:500;color:#0f172a;margin-bottom:10px; }
.tk-suggestion-input-link { display:flex;gap:8px;margin-bottom:12px; }
.tk-suggestion-input-link input { flex:1;border:1px solid #d7dce5;border-radius:9px;padding:9px 10px;font:inherit;font-size:12px;outline:none; }
.tk-suggestion-input-link input:focus { border-color:#1c6fef;box-shadow:0 0 0 3px rgba(28,111,239,.12); }
.tk-suggestion-input-link button,.tk-suggestion-doc-btn { border:1px solid #d7dce5;background:#fff;border-radius:9px;padding:8px 10px;font:inherit;font-size:12px;cursor:pointer;color:#0f172a; }
.tk-suggestion-input-link button:hover,.tk-suggestion-doc-btn:hover { border-color:#93c5fd;background:#eff6ff; }
.tk-suggestion-doc-list { max-height:230px;overflow:auto;display:grid;gap:6px; }
.tk-suggestion-doc-btn { display:flex;align-items:center;justify-content:flex-start;gap:8px;text-align:left;min-width:0; }
.tk-suggestion-doc-btn span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-suggestion-person { display:inline-flex;align-items:center;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;padding:0 5px;font-weight:500;white-space:nowrap; }
.tl-classification-suggestion-rule { height:1px;background:#edf2f7;margin:0 13px; }
.tl-classification-suggestion-desc { display:block;color:#475569;font-size:11.5px;line-height:1.45;padding:8px 13px 10px;min-height:46px; }
.tl-classification-suggestion-foot { display:flex;align-items:center;justify-content:flex-start;gap:8px;margin-top:auto;padding:0 13px 12px; }
.tl-classification-suggestion-action { display:inline-flex;align-items:center;justify-content:center;border-radius:8px;background:#f5f3ff;border:1px solid #ddd6fe;color:#6d28d9;padding:6px 10px;font-size:11.5px;font-weight:500;line-height:1;font-family:inherit;cursor:pointer;transition:background .14s,border-color .14s,color .14s; }
.tl-suggestion-btn-spinner { width:10px;height:10px;border-radius:999px;border:2px solid currentColor;border-right-color:transparent;margin-right:6px;animation:tkSpin .72s linear infinite; }
.tl-classification-suggestion.is-running { opacity:.72;background:#f8fafc; }
.tl-classification-suggestion-action:disabled { cursor:default;background:#e2e8f0;border-color:#cbd5e1;color:#64748b; }
.tl-classification-suggestion.is-recommended .tl-classification-suggestion-action { background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9; }
.tl-classification-suggestion:hover .tl-classification-suggestion-action { background:#7c3aed;border-color:#7c3aed;color:#fff; }
.tl-classification-suggestion.is-recommended:hover .tl-classification-suggestion-action { background:#7c3aed;border-color:#7c3aed;color:#fff;box-shadow:0 3px 10px rgba(124,58,237,.2); }
.tl-classification-suggestion-action::after { content:"";margin-left:0; }
.tl-classification-suggestion-rec { display:block;margin:7px auto 0;color:#fff;font-size:10.5px;font-weight:500;line-height:1;text-align:center; }
.tl-av-activity { border:1px solid #dbeafe;background:#f8fbff;border-radius:12px;padding:12px 13px;margin-top:10px; }
.tl-av-activity-top { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px; }
.tl-av-activity-title { font-size:13px;font-weight:500;color:#0f172a;line-height:1.25; }
.tl-av-activity-state { display:inline-flex;align-items:center;gap:6px;border-radius:999px;background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;padding:4px 8px;font-size:11px;font-weight:500;white-space:nowrap; }
.tl-av-activity-state.is-done { background:#ecfdf5;color:#047857;border-color:#bbf7d0; }
.tl-av-activity-state.is-error { background:#fef2f2;color:#dc2626;border-color:#fecaca; }
.tl-av-activity-spinner { width:11px;height:11px;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:tkSpin .75s linear infinite; }
.tl-av-activity-state.is-done .tl-av-activity-spinner,.tl-av-activity-state.is-error .tl-av-activity-spinner { display:none; }
.tl-av-activity-basis { display:flex;align-items:center;gap:6px;margin-bottom:10px;color:#475569;font-size:11.5px;line-height:1.35; }
.tl-av-activity-steps { display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px; }
.tl-av-step { display:flex;align-items:center;gap:6px;min-width:0;border:1px solid #e2e8f0;border-radius:8px;background:#fff;padding:7px 8px;color:#64748b;font-size:11px;line-height:1.2; }
.tl-av-step-dot { width:7px;height:7px;border-radius:999px;background:#cbd5e1;flex-shrink:0; }
.tl-av-step.active { border-color:#bfdbfe;color:#1d4ed8;background:#eff6ff; }
.tl-av-step.active .tl-av-step-dot { background:#1d4ed8;box-shadow:0 0 0 3px rgba(29,78,216,.12); }
.tl-av-step.done { color:#047857;background:#f0fdf4;border-color:#bbf7d0; }
.tl-av-step.done .tl-av-step-dot { background:#10b981; }
.tl-av-step.warn,.tl-av-step.error { color:#b45309;background:#fffbeb;border-color:#fde68a; }
.tl-av-step.warn .tl-av-step-dot,.tl-av-step.error .tl-av-step-dot { background:#f59e0b; }
.tl-av-report-row { margin-top:10px;padding-top:10px;border-top:1px solid #dbeafe;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#0f172a;font-size:12px; }
.tl-av-report-btn { display:inline-flex;align-items:center;gap:6px;border:1px solid #bfdbfe;background:#fff;color:#1d4ed8;border-radius:8px;padding:6px 9px;font-size:11.5px;font-family:inherit;cursor:pointer; }
.tl-av-report-btn:hover { background:#eff6ff;border-color:#60a5fa; }
.tl-text-activity { border:1px solid #e2e8f0;background:#fff;border-radius:12px;padding:12px 13px;margin-top:10px; }
.tl-text-activity-kind { margin-top:4px;color:#64748b;font-size:11.5px;line-height:1.25; }
.tl-text-activity-body { margin-top:10px;border-top:1px solid #eef2f7;padding-top:10px;color:#0f172a;font-size:12.5px;line-height:1.55; }
.tl-text-generated { white-space:normal; }
.tl-text-generated.md-block { line-height:1.68; }
.tl-text-generated.md-block p { margin:0 0 10px; }
.tl-text-generated.md-block p:last-child { margin-bottom:0; }
.tl-text-generated.md-block h1,.tl-text-generated.md-block h2,.tl-text-generated.md-block h3,.tl-text-generated.md-block h4 { margin:14px 0 8px;color:#0f172a;font-weight:600;line-height:1.28; }
.tl-text-generated.md-block h1 { font-size:16px; }
.tl-text-generated.md-block h2 { font-size:15px; }
.tl-text-generated.md-block h3,.tl-text-generated.md-block h4 { font-size:14px; }
.tl-text-generated.md-block ul,.tl-text-generated.md-block ol { margin:8px 0 12px 22px;padding-left:16px; }
.tl-text-generated.md-block li { margin:4px 0;padding-left:3px; }
.tl-text-generated.md-block li > p { margin:0 0 5px; }
.tl-text-generated.md-block strong { font-weight:600;color:#0f172a; }
.tl-text-generated.md-block blockquote { margin:10px 0;padding:8px 10px;border-left:3px solid #bfdbfe;background:#eff6ff;color:#334155;border-radius:8px; }
.tl-text-generated.is-streaming { color:#0f172a; }
.tl-text-cursor { display:inline-block;width:7px;height:15px;margin-left:2px;vertical-align:-2px;background:#1c6fef;border-radius:2px;animation:tkBlink 1s steps(2,start) infinite; }
@keyframes tkBlink { 50% { opacity:.15; } }
.tl-text-loading { color:#64748b; }
.tl-text-error { color:#b91c1c;background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:8px 9px; }
.tl-text-model { margin-top:10px;color:#94a3b8;font-size:10.5px; }
.tl-template-result { margin-top:10px;display:flex; }
.tl-card--prep { border-color:#e9d5ff;background:linear-gradient(135deg,#f0e7ff 0%,#faf5ff 50%,#fff 100%); }
.tl-prep-activity { border:0;background:transparent;border-radius:0;padding:2px 0 0;margin-top:10px; }
.tl-prep-heading { color:#2e1065;font-size:13.5px;font-weight:600;line-height:1.35;margin:0 0 8px; }
.tl-prep-manual-note { margin:0 0 10px;color:#5b21b6;background:rgba(255,255,255,.64);border:1px solid rgba(196,181,253,.7);border-radius:9px;padding:8px 10px;font-size:11.5px;line-height:1.35; }
.tl-prep-steps { display:grid;gap:9px;margin-top:10px; }
.tl-prep-step { border:1px solid #e2e8f0;background:#fff;border-radius:10px;padding:10px 11px; }
.tl-prep-step.is-prepared { border-color:#ddd6fe;background:rgba(255,255,255,.92); }
.tl-prep-step.is-manual { border-color:#fed7aa;background:#fffaf5; }
.tl-prep-step-head { display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;margin-bottom:8px; }
.tl-prep-step-index { color:#7c3aed;background:#f5f3ff;border:1px solid #ddd6fe;border-radius:999px;padding:3px 7px;font-size:10.5px;line-height:1;font-weight:500;white-space:nowrap; }
.tl-prep-step-title { color:#0f172a;font-size:13px;font-weight:500;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-prep-step-state { color:#475569;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:3px 7px;font-size:10.5px;line-height:1;white-space:nowrap; }
.tl-prep-step.is-prepared .tl-prep-step-state { color:#5b21b6;background:#f5f3ff;border-color:#ddd6fe; }
.tl-prep-step.is-manual .tl-prep-step-state { color:#92400e;background:#fffbeb;border-color:#fde68a; }
.tl-prep-step-body { color:#1e293b;font-size:12.5px;line-height:1.62; }
.tl-prep-step-body p { margin:0 0 8px; }
.tl-prep-step-body p:last-child { margin-bottom:0; }
.tl-prep-step-body ul,.tl-prep-step-body ol { margin:8px 0 10px 20px;padding-left:16px; }
.tl-prep-step-body li { margin:4px 0;padding-left:3px; }
.tl-prep-step-body strong { font-weight:650;color:#0f172a; }
.tl-prep-step-attachments { display:flex;flex-wrap:wrap;gap:6px;margin-top:9px;padding-top:9px;border-top:1px solid #eef2f7; }
.tl-classification-main { min-width:0;display:flex;flex-direction:column;gap:3px; }
.tl-classification-title { font-size:12px;font-weight:700;color:#0f172a; }
.tl-classification-sub { font-size:11.5px;color:#64748b;line-height:1.35; }
.tl-classification-badge-wrap { position:relative;flex-shrink:0;min-width:0; }
.tl-classification-badge { display:flex;align-items:center;gap:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:8px;background:#f5f3ff;color:#6d28d9;border:1px solid #ddd6fe;padding:6px 10px;font-size:11.5px;font-weight:500;cursor:pointer; }
.tl-classification-badge:hover { border-color:#c4b5fd;background:#ede9fe;color:#5b21b6; }
.tl-classification-overridden { display:inline-flex;align-items:center;border-radius:999px;background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;padding:3px 7px;font-size:10.5px;font-weight:650; }
.tl-classification-pop { position:absolute;left:0;top:calc(100% + 7px);z-index:850;width:420px;max-width:min(420px,70vw);border:1px solid var(--border);border-radius:12px;background:#fff;box-shadow:0 18px 44px rgba(15,23,42,.18);padding:10px;display:none; }
.tl-classification-pop.is-open { display:block; }
.tl-classification-pop-title { font-size:11px;font-weight:750;color:#64748b;margin:0 0 8px; }
.tl-classification-pop-grid { display:grid;grid-template-columns:1fr 1fr;gap:6px; }
.tl-classification-pop-btn { min-width:0;border:1px solid #fde68a;border-radius:8px;background:#fffbeb;color:#92400e;padding:7px 8px;text-align:left;font-size:12px;font-weight:400;font-family:inherit;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-classification-pop-btn:hover { border-color:#f59e0b;background:#fef3c7;color:#78350f; }
.tl-classification-pop-btn.active { border-color:#1c6fef;background:#eff6ff;color:#1d4ed8; }
.tl-feedback-row { display:flex;align-items:center;justify-content:flex-start;gap:6px;margin-top:10px;padding-top:10px;border-top:1px solid var(--border); }
.tl-feedback-btn { width:28px;height:28px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:#64748b;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .12s; }
.tl-feedback-btn:hover { border-color:#1c6fef;background:rgba(28,111,239,.08);color:#1c6fef; }
.tl-feedback-btn.active { border-color:#1c6fef;background:rgba(28,111,239,.14);color:#1c6fef;box-shadow:0 0 0 3px rgba(28,111,239,.08); }
.tl-feedback-row.has-selection .tl-feedback-btn:not(.active) { opacity:.36;background:#f8fafc;color:#94a3b8; }
.tl-feedback-row.has-selection .tl-feedback-btn:not(.active):hover { opacity:.7;border-color:var(--border);background:#f8fafc;color:#64748b; }
/* Prüfbericht attachment chip inside timeline card — sits above the message */
#tl-reply-atts { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--border); }
.tl-att-chip { display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:8px;border:1.5px solid var(--border);background:var(--bg);font-size:12px;color:var(--text);transition:border-color .15s,box-shadow .15s;max-width:260px; }
.tl-att-chip:hover { border-color:var(--accent);box-shadow:0 2px 8px rgba(0,0,0,.07); }
.tl-att-chip--report { border-color:rgba(194,24,91,.3);background:rgba(194,24,91,.04); }
/* Collapse/expand for long timeline card content */
.tl-collapse-wrap { position:relative; }
.tl-collapse-wrap.tl-collapsed { max-height:220px;overflow:hidden; }
.tl-collapse-wrap.tl-collapsed::after { content:'';position:absolute;bottom:0;left:0;right:0;height:60px;background:linear-gradient(transparent,var(--surface));pointer-events:none; }
.tl-expand-btn { display:block;width:100%;border:none;background:none;padding:6px 0 2px;font-size:12px;color:var(--accent);cursor:pointer;text-align:center;border-top:1px solid var(--border);margin-top:4px; }
.tl-expand-btn:hover { text-decoration:underline; }
.tl-reply-display p { margin:0 0 0.5em; }
.tl-reply-display p:last-child { margin-bottom:0; }
.tl-reply-display ul,.tl-reply-display ol { margin:0.3em 0 0.5em 1.4em;padding:0; }
.tl-reply-display li { margin:0.2em 0; }
.tl-reply-display strong { font-weight:700; }
.tl-reply-display em { font-style:italic; }
.tl-feed.tk-hide-entity-highlights .tk-entity-mark { background:transparent;box-shadow:none;padding:0;color:inherit; }
.tl-entry.tk-timeline-hidden { display:none !important; }
.tl-entry.is-ai-hidden { opacity:.48; }
.tl-entry.is-ai-hidden .tl-card { background:#f8fafc;border-style:dashed; }
.tl-entry.is-ai-hidden .tl-card::after { content:"Für KI ausgeblendet";position:absolute;right:12px;bottom:10px;font-size:10.5px;color:#64748b;background:#fff;border:1px solid #e2e8f0;border-radius:999px;padding:3px 8px; }
/* Timeline connector line between entries (only shown when reply entry is visible) */
.tl-feed .tl-entry { position:relative; }
.tl-feed.tl-has-reply .tl-entry:not(:last-child)::after { content:'';position:absolute;left:13px;top:28px;bottom:0;width:2px;background:var(--border);border-radius:1px; }
.tl-feed.tl-has-reply .tl-entry.tl-entry--before-draft::after { background:transparent;width:0;border-left:2px dashed #cbd5e1;bottom:-34px;border-radius:0; }
.tl-entry--draft { margin-top:30px;padding-top:4px; }
.tl-entry--draft .tl-date { display:none; }
.tl-entry--draft::before,.tl-entry--draft::after { display:none; }
.tl-draft-user-meta { display:flex;flex-direction:column;gap:2px;min-width:0; }
.tl-draft-user-email { font-size:11.5px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.tl-draft-card { margin-left:29px;border:1px solid #d8e0ea;border-radius:12px;background:#fff;overflow:hidden;box-shadow:none;transition:border-color .15s; }
.tl-draft-card:focus-within { border-color:#cbd5e1;box-shadow:none; }
.tl-draft-top { display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid #e2e8f0;background:linear-gradient(180deg,#fff,#f8fafc); }
.tl-draft-title { display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:650;color:#0f172a; }
.tl-draft-title::before { display:none; }
.tl-draft-state { font-size:11px;color:#64748b;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:3px 8px;white-space:nowrap; }
.tl-draft-fields { display:flex;flex-direction:column;background:#fff;border-bottom:1px solid #e2e8f0; }
.tl-draft-field { display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;gap:10px;min-height:38px;padding:0 12px;border-bottom:1px solid #eef2f7; }
.tl-draft-field:last-child { border-bottom:none; }
.tl-draft-field label { font-size:11.5px;font-weight:650;color:#64748b; }
.tl-draft-field input { min-width:0;border:0;outline:none;background:transparent;color:#0f172a;font-family:inherit;font-size:13px; }
.tl-draft-address-wrap { min-width:0;display:flex;align-items:center;gap:10px; }
.tl-draft-address-wrap input { flex:1; }
.tl-draft-address-actions { display:inline-flex;align-items:center;gap:10px;flex:0 0 auto; }
.tl-draft-address-toggle { border:0;background:transparent;color:#2563eb;font-family:inherit;font-size:12px;font-weight:500;line-height:1;cursor:pointer;padding:3px 0;border-radius:5px; }
.tl-draft-address-toggle:hover { color:#1d4ed8;text-decoration:underline; }
.tl-draft-address-toggle.active { color:#1d4ed8; }
.tl-draft-toolbar { display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 10px;border-bottom:1px solid #e2e8f0;background:#f8fafc; }
.tl-draft-shortcut,.tl-draft-attach { display:inline-flex;align-items:center;justify-content:center;gap:5px;height:28px;border:1px solid #d8e0ea;border-radius:8px;background:#fff;color:#334155;padding:0 9px;font-size:11.5px;font-weight:650;font-family:inherit;cursor:pointer;transition:all .12s; }
.tl-draft-shortcut { min-width:30px;padding:0 8px; }
.tl-draft-toolbar-sep { width:1px;height:18px;background:#d8e0ea;margin:0 2px;flex:0 0 auto; }
.tl-draft-shortcut:hover,.tl-draft-attach:hover { border-color:#1c6fef;color:#1c6fef;background:#eff6ff; }
.tl-draft-attach { margin-left:0; }
.tl-draft-input { width:100%;min-height:420px;resize:vertical;border:0;padding:18px 18px 20px;font-family:inherit;font-size:14px;line-height:1.75;color:#0f172a;background:#fff;outline:none;box-sizing:border-box; }
.tl-draft-input::placeholder { color:#94a3b8; }
.tl-draft-editor { overflow:auto;white-space:normal;word-break:break-word; }
.tl-draft-editor:empty::before { content:attr(data-placeholder);color:#94a3b8;pointer-events:none; }
.tl-draft-editor p { margin:0 0 .7em; }
.tl-draft-editor p:last-child { margin-bottom:0; }
.tl-draft-editor ul,.tl-draft-editor ol { margin:.35em 0 .8em 1.4em;padding-left:1.1em; }
.tl-draft-editor li { margin:.2em 0; }
.tl-draft-editor strong,.tl-draft-editor b { font-weight:700; }
.tl-draft-editor em,.tl-draft-editor i { font-style:italic; }
.tl-draft-atts { display:flex;align-items:flex-start;gap:8px;padding:10px 12px;border-bottom:1px solid #e2e8f0;background:#fff; }
.tl-draft-atts-icon { width:18px;height:24px;display:flex;align-items:center;justify-content:center;color:#64748b;flex:0 0 auto; }
.tl-draft-atts-list { min-width:0;display:flex;flex-wrap:wrap;gap:6px; }
.tl-draft-att-chip { display:inline-flex;align-items:center;gap:5px;max-width:260px;min-height:24px;padding:3px 6px 3px 8px;border:1px solid rgba(28,111,239,.24);border-radius:6px;background:rgba(28,111,239,.14);color:#0f172a;font-size:11.5px;font-weight:400;line-height:1.2; }
.tl-draft-att-chip span { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.tl-draft-att-remove { width:18px;height:18px;border:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:transparent;color:#334155;cursor:pointer;padding:0;transition:background .12s,color .12s; }
.tl-draft-att-remove:hover { background:rgba(15,23,42,.12);color:#0f172a; }
.tl-draft-send-row { display:flex;justify-content:flex-end;padding:10px 12px;border-top:1px solid #e2e8f0;background:#f8fafc; }
.tl-draft-send-btn { display:inline-flex;align-items:center;gap:7px;height:34px;border:1px solid #0f172a;border-radius:9px;background:#0f172a;color:#fff;padding:0 13px;font-size:12px;font-weight:650;font-family:inherit;cursor:pointer;transition:background .14s,border-color .14s,color .14s; }
.tl-draft-send-btn:hover:not(:disabled) { background:#111827;border-color:#111827; }
.tl-draft-send-btn:disabled { border-color:#d8e0ea;background:#f1f5f9;color:#94a3b8;cursor:not-allowed; }
.tl-draft-send-btn svg { opacity:.85; }
.tl-icon--teal { background:#0d9488; }
.tl-icon--gray { background:#64748b; }
.tl-update-actions { display:flex;align-items:center;gap:6px;margin-top:2px; }
.tl-use-btn { display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;color:#0d9488;background:rgba(13,148,136,.08);border:1px solid rgba(13,148,136,.25);border-radius:6px;padding:3px 8px;cursor:pointer;transition:background .12s; }
.tl-use-btn:hover { background:rgba(13,148,136,.15); }
.tl-refresh-btn { display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;color:var(--text-3);background:transparent;border:none;cursor:pointer;padding:2px 4px;border-radius:5px;transition:color .12s; }
.tl-refresh-btn:hover { color:var(--text); }
/* Kebab (three-dot) menu on privAIcy timeline entries */
.tl-card { position:relative; }
.tl-kebab { position:absolute;top:8px;right:10px; }
.tl-kebab-btn { width:26px;height:26px;border:none;background:transparent;cursor:pointer;border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--text-3);padding:0;transition:background .12s,color .12s; }
.tl-kebab-btn:hover { background:var(--hover);color:var(--text); }
.tl-kebab-menu { position:absolute;right:0;top:30px;background:var(--surface);border:1.5px solid var(--border);border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.13);z-index:200;min-width:130px;padding:4px; }
.tl-kebab-menu button { display:flex;align-items:center;gap:7px;width:100%;text-align:left;padding:7px 12px;border:none;background:transparent;cursor:pointer;font-size:13px;color:var(--text);border-radius:6px;transition:background .1s; }
.tl-kebab-menu button:hover { background:var(--hover); }
.tl-kebab-menu button.tl-danger { color:#0f172a; }
.tl-kebab-menu button.tl-danger:hover { background:var(--hover);color:#0f172a; }
.tl-kebab-menu button:disabled { color:#94a3b8;cursor:not-allowed; }
.tl-kebab-menu button:disabled:hover { background:transparent;color:#94a3b8; }
/* Force reply textarea wrapper always hidden — content shown in tl-reply-display */
#tk-reply-wrap { display:none !important; }
.tk-group-dot--matching { background:#9ca3af; }
.tk-group-dot--inbearbeitung { background:#f59e0b; }
.tk-group-dot--bittepruefen { background:#f97316; }
.tk-group-dot--ueberarbeiten { background:#f43f5e; }
.tk-group-dot--bereit { background:#22c55e; }
.tk-group-dot--versendet { background:#16a34a; }
.tk-group-dot--unknown { background:var(--text-3); }
.tk-group-cnt { margin-left:auto;background:var(--bg);border:1px solid var(--border);border-radius:20px;padding:0 7px;line-height:18px;font-size:10px;color:var(--text-3); }

/* ── Card modifiers ── */
.tk-card--dim:not(.tk-board-row) { opacity:.6; }
.tk-card--dim:not(.tk-board-row):hover { opacity:1; }
.tk-card--dim:not(.tk-board-row).selected { opacity:1; }
.tk-card-email { font-size:10px;color:var(--text-3);margin-left:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:120px; }


/* ── Generating state (step progress) ── */
.tk-gen-steps { display:flex;align-items:center;gap:0;background:linear-gradient(135deg,var(--accent-lt),rgba(var(--accent-rgb),0.04));border:1.5px solid var(--accent);border-radius:11px;padding:12px 16px;margin-bottom:10px;flex-wrap:wrap;gap:4px 0; }
.tk-gs-step { display:flex;align-items:center;gap:6px;flex-shrink:0; }
.tk-gs-label { font-size:11.5px;font-weight:600;color:var(--text-2);transition:color .2s; }
.tk-gs-arrow { color:var(--border);margin:0 4px;flex-shrink:0; }
.tk-gs-dot { width:9px;height:9px;border-radius:50%;border:1.5px solid var(--border);background:transparent;flex-shrink:0;transition:border-color .2s,background .2s; }
.tk-gs-dot--pending { border-color:var(--border);background:transparent; }
.tk-gs-dot--active { border:none;background:transparent; }
.tk-gs-spin-svg { color:var(--accent);animation:tk-spin-dot .75s linear infinite;display:block; }
.tk-gs-dot--done { border-color:#10b981;background:#10b981; }
.tk-gs-dot--warn { border-color:#f59e0b;background:#f59e0b; }
.tk-gs-step--active .tk-gs-label { color:var(--accent); }
.tk-gs-step--done .tk-gs-label { color:#10b981; }
.tk-gs-step--warn .tk-gs-label { color:#d97706; }
@keyframes tk-spin-dot { to { transform:rotate(360deg); } }
/* Intent stream panel */
.tk-intent-stream { border:1px solid rgba(var(--accent-rgb),.22);border-radius:10px;overflow:hidden;margin-bottom:10px; }
.tk-iss-hdr { display:flex;align-items:center;justify-content:space-between;padding:7px 12px;cursor:pointer;user-select:none;gap:8px;background:rgba(var(--accent-rgb),.04); }
.tk-iss-hdr:hover { background:rgba(var(--accent-rgb),.09); }
.tk-iss-title { display:flex;align-items:center;gap:7px;font-size:11px;font-weight:700;color:var(--text-2);text-transform:uppercase;letter-spacing:.4px; }
.tk-iss-pulse { width:6px;height:6px;border-radius:50%;background:var(--accent);flex-shrink:0; }
.tk-iss-pulse--live { animation:tk-iss-blink 1.1s ease-in-out infinite; }
@keyframes tk-iss-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.tk-iss-chevron { color:var(--text-3);transition:transform .2s;flex-shrink:0; }
.tk-iss-chevron--open { transform:rotate(180deg); }
.tk-iss-intent-badge { display:inline-flex;align-items:center;font-size:10px;font-weight:700;font-family:ui-monospace,'Cascadia Code',monospace;color:var(--accent);background:rgba(var(--accent-rgb),.12);border:1px solid rgba(var(--accent-rgb),.28);border-radius:20px;padding:1px 8px;letter-spacing:.02em; }
.tk-iss-body { overflow:hidden; }
.tk-iss-pre { margin:0;padding:10px 14px 12px;font-size:11.5px;line-height:1.65;color:var(--text-2);font-family:ui-monospace,'Cascadia Code','Fira Code',monospace;max-height:220px;overflow-y:auto;white-space:pre-wrap;word-break:break-word;border-top:1px solid rgba(var(--accent-rgb),.12);background:var(--bg); }

/* ── AV analysis result in ticket panel ── */
.tk-av-result { margin-bottom:10px; }
.tk-av-result .av-report-widget { border-radius:10px;border:1.5px solid var(--border);overflow:hidden; }
.tk-av-upload-prompt { display:flex;align-items:center;gap:12px;background:var(--surface-2);border:1.5px dashed var(--accent);border-radius:10px;padding:13px 15px; }
.tk-av-upload-prompt-text { flex:1;font-size:12.5px;color:var(--text-2);line-height:1.5; }
.tk-av-upload-prompt-text strong { color:var(--text);display:block;margin-bottom:2px; }
.tk-av-upload-btn { font-size:12px;font-weight:700;color:var(--accent);background:transparent;border:1.5px solid var(--accent);border-radius:7px;padding:6px 12px;cursor:pointer;white-space:nowrap;flex-shrink:0;transition:all .15s; }
.tk-av-upload-btn:hover { background:var(--accent);color:#fff; }

/* ── Error state banner ── */
.tk-gen-error { display:flex;align-items:flex-start;gap:12px;background:#fff7ed;border:1.5px solid #fdba74;border-radius:11px;padding:14px 16px;margin-bottom:10px; }
.tk-gen-error-icon { width:36px;height:36px;border-radius:9px;background:#fed7aa;color:#c2410c;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px; }
.tk-gen-error-body { flex:1;min-width:0; }
.tk-gen-error-title { font-size:13.5px;font-weight:800;color:#9a3412;margin-bottom:3px; }
.tk-gen-error-sub { font-size:12px;color:#c2410c;line-height:1.5; }
.tk-gen-error-btn { font-size:11.5px;font-weight:700;color:#9a3412;background:transparent;border:1.5px solid #fdba74;border-radius:7px;padding:6px 12px;cursor:pointer;white-space:nowrap;flex-shrink:0;transition:all .15s;align-self:center; }
.tk-gen-error-btn:hover { background:#9a3412;color:#fff;border-color:#9a3412; }

/* ═══════════════════════════════════════════════════════════
   AUDIT VIEW
═══════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   AUDIT — complete redesign
═══════════════════════════════════════════════════════════ */
#audit-view { display: none; flex-direction: column; flex: 1; overflow: hidden; background: var(--bg); }
#audit-view.active { display: flex; }
.audit-detail-wrap { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.audit-detail-wrap.active { display: flex; }
.audit-overview-wrap { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

/* ── Topbar (matches feedback layout) ── */
.audit-topbar {
  padding: 20px 28px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0;
}
.audit-topbar-left { display: flex; flex-direction: column; gap: 2px; }
.audit-topbar-title { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.audit-topbar-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.audit-topbar-right { display: flex; align-items: center; gap: 8px; }
.btn-audit-create {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px;
  border-radius: 11px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; border: none; cursor: pointer;
  white-space: nowrap; box-shadow: 0 4px 14px rgba(37,99,235,.28); transition: opacity .15s;
}
.btn-audit-create:hover { opacity: .88; }

/* ── Search & filter bar ── */
.audit-filter-bar {
  margin: 12px 28px 0;
  padding: 10px 16px; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
  display: flex; align-items: center; gap: 14px; flex-shrink: 0; flex-wrap: wrap;
}
.audit-search-wrap { position: relative; flex: 1; min-width: 160px; max-width: 280px; }
.audit-search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.audit-search-input {
  width: 100%; padding: 7px 10px 7px 32px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; background: var(--bg); color: var(--text); font-family: inherit; box-sizing: border-box;
}
.audit-search-input:focus { outline: none; border-color: var(--accent); }
.audit-toolbar-divider { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.audit-toolbar-group { display: flex; align-items: center; gap: 7px; }
.audit-toolbar-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.audit-seg-ctrl {
  display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--bg);
}
.audit-seg-btn {
  padding: 5px 11px; font-size: 12px; font-weight: 500; cursor: pointer;
  border: none; background: transparent; color: var(--text-2); transition: all .12s;
  border-right: 1px solid var(--border); white-space: nowrap;
}
.audit-seg-btn:last-child { border-right: none; }
.audit-seg-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.audit-seg-btn:hover:not(.active) { background: var(--surface-2); color: var(--text); }

/* ── Overview body ── */
.audit-body { flex: 1; overflow-y: auto; padding: 16px 28px 28px; display: flex; flex-direction: column; gap: 20px; }

/* ── Cards ── */
.audit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 14px; }
.audit-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column;
}
.audit-card:hover { border-color: var(--accent); box-shadow: 0 4px 18px rgba(37,99,235,.10); }
.audit-card-accent { height: 4px; background: linear-gradient(90deg,#3b82f6,#6366f1); flex-shrink: 0; }
.audit-card-accent.complete  { background: linear-gradient(90deg,#22c55e,#16a34a); }
.audit-card-accent.archived  { background: #e2e8f0; }
.audit-card-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.audit-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.audit-card-name { font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.3; }
.audit-card-date { font-size: 11px; color: var(--text-2); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.audit-progress-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.audit-progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg,#3b82f6,#6366f1); transition: width .4s; }
.audit-progress-fill.complete { background: linear-gradient(90deg,#22c55e,#16a34a); }
.audit-progress-label { font-size: 11px; color: var(--text-2); margin-top: 3px; display: flex; justify-content: space-between; }
.audit-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.audit-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .01em;
}
.audit-status-active   { background: #dbeafe; color: #1d4ed8; }
.audit-status-completed { background: #dcfce7; color: #15803d; }
.audit-status-archived  { background: #f1f5f9; color: #64748b; }
.audit-card-people { display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.audit-person-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }
.audit-person-label { font-weight: 700; color: var(--text-2); min-width: 52px; }
.audit-person-val { color: var(--text); font-weight: 500; }

/* ── Empty state ── */
.audit-empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.audit-empty-icon { font-size: 38px; margin-bottom: 12px; }
.audit-empty-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* ── Detail header ── */
.audit-detail-header {
  display: flex; align-items: center; gap: 0; padding: 0 20px 0 16px;
  height: 56px; flex-shrink: 0; flex-wrap: nowrap;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.audit-header-progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0 16px; }
.audit-header-progress-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.audit-header-progress-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg,#14b8a6,#0d9488); transition: width .4s; }
.audit-header-progress-label { font-size: 11px; font-weight: 600; color: #0d9488; white-space: nowrap; flex-shrink: 0; }
.btn-audit-back {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px 0 4px; height: 100%;
  border: none; border-right: 1.5px solid var(--border); background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer;
  flex-shrink: 0; transition: color .12s, background .12s;
}
.btn-audit-back:hover { color: var(--text); background: var(--surface-2); }
.btn-audit-back svg { opacity: .7; }
.audit-detail-title {
  font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0; max-width: 240px; padding: 0 16px;
  border-right: 1.5px solid var(--border); height: 100%;
  display: flex; align-items: center;
}
.audit-detail-actions { display: flex; align-items: center; }
.btn-audit-report {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px; margin-right: 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent); font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .12s;
}
.btn-audit-report:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.audit-report-modal {
  display: none; position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,.45); align-items: center; justify-content: center;
}
.audit-report-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: 100%; max-width: 460px; box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.audit-report-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.audit-report-title { font-size: 15px; font-weight: 800; color: var(--text); }
.audit-report-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.audit-report-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.audit-report-field { display: flex; flex-direction: column; gap: 5px; }
.audit-report-field label { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.audit-report-field input,
.audit-report-field textarea {
  width: 100%; padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.audit-report-field textarea { min-height: 82px; resize: vertical; }
.audit-report-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.audit-report-error { color: #dc2626; font-size: 12px; min-height: 16px; }
.btn-audit-report-primary,
.btn-audit-report-secondary {
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.btn-audit-report-primary { border: none; background: var(--accent); color: #fff; }
.btn-audit-report-primary:disabled { opacity: .6; cursor: wait; }
.audit-report-spinner {
  display: none; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: audit-report-spin .75s linear infinite; flex-shrink: 0;
}
.btn-audit-report-primary.loading {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-audit-report-primary.loading .audit-report-spinner { display: inline-block; }
@keyframes audit-report-spin { to { transform: rotate(360deg); } }
.btn-audit-report-secondary { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
/* ── "..." more menu ── */
.audit-more-menu { position: relative; }
.btn-audit-more {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: all .12s;
}
.btn-audit-more:hover { background: var(--surface-2); color: var(--text); }
.audit-more-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 5px); z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 160px;
  padding: 5px; overflow: hidden;
}
.audit-more-dropdown.open { display: flex; flex-direction: column; }
.audit-more-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 7px; border: none; background: none;
  font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; text-align: left;
  transition: background .1s;
}
.audit-more-item:hover { background: var(--surface-2); }
.audit-more-item.danger { color: #dc2626; }
.audit-more-item.danger:hover { background: #fee2e2; }
.audit-more-sep { height: 1px; background: var(--border); margin: 3px 0; }

/* ── Collapsible info strip ── */
.audit-info-strip {
  flex-shrink: 0; margin: 0 28px 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.audit-info-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-2); font-family: inherit; text-align: left;
  transition: background .1s;
}
.audit-info-toggle:hover { background: var(--surface-2); }
.audit-info-chevron { transition: transform .2s; flex-shrink: 0; }
.audit-info-chevron.open { transform: rotate(180deg); }
.audit-info-toggle-label { font-weight: 600; color: var(--text); font-size: 12px; }
.audit-info-summary { font-size: 11px; color: var(--text-2); flex: 1; }
.audit-info-body { display: none; border-top: 1px solid var(--border); }
.audit-info-body.open { display: block; }
.audit-info-cols {
  display: flex; gap: 0; border-top: none;
}
/* ── Metadata table ── */
.audit-meta-grid {
  display: table; flex: 1; margin: 14px 20px; border-collapse: collapse;
  align-self: flex-start; width: auto;
}
.audit-meta-item {
  display: table-row;
}
.audit-meta-label {
  display: table-cell; font-size: 11px; font-weight: 600; color: var(--text-2);
  padding: 5px 16px 5px 0; white-space: nowrap; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.audit-meta-item:last-child .audit-meta-label,
.audit-meta-item:last-child .audit-meta-val { border-bottom: none; }
.audit-meta-val {
  display: table-cell; font-size: 12px; font-weight: 600; color: var(--text);
  padding: 5px 0; white-space: nowrap; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
/* ── Participants panel ── */
.audit-participants-panel {
  min-width: 210px; max-width: 260px; border-left: 1px solid var(--border);
  padding: 14px 18px; display: flex; flex-direction: column; gap: 8px;
}
.audit-participants-title {
  font-size: 10px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 2px;
}
.audit-participant-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--bg); border-radius: 8px; border: 1px solid var(--border);
}
.audit-participant-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-lt);
  color: var(--accent); font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase;
}
.audit-participant-info { flex: 1; min-width: 0; }
.audit-participant-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audit-participant-role { font-size: 10px; color: var(--text-2); }
.audit-online-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; flex-shrink: 0;
  transition: background .3s;
}
.audit-online-dot.online {
  background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.3);
}

/* ── Progress strip ── */
.audit-progress-strip {
  margin: 0 28px 12px; padding: 12px 16px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
  flex-shrink: 0;
}
.audit-progress-strip-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin-bottom: 5px; }
.audit-progress-strip-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg,#3b82f6,#6366f1); transition: width .4s; }
.audit-progress-strip-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); }

/* ── Question area + sidebar ── */
.audit-content-wrap { flex: 1; display: flex; overflow: hidden; position: relative; }
.audit-question-area { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.audit-q-sidebar {
  width: 0; flex-shrink: 0; overflow: hidden;
  border-left: none; background: var(--surface);
  display: flex; flex-direction: column;
  transition: width .22s ease, border-color .22s;
}
.audit-q-sidebar.open { width: 260px; border-left: 1px solid var(--border); }
.audit-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.audit-sidebar-title { font-size: 12px; font-weight: 700; color: var(--text); }
.audit-sidebar-close {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px; border: none;
  background: none; color: var(--text-2); cursor: pointer;
}
.audit-sidebar-close:hover { background: var(--surface-2); color: var(--text); }
.audit-sidebar-list { flex: 1; overflow-y: auto; padding: 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.audit-sidebar-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px;
  border-radius: 7px; cursor: pointer; border: none; background: none;
  text-align: left; font-family: inherit; width: 100%; transition: background .1s;
}
.audit-sidebar-item:hover { background: var(--surface-2); }
.audit-sidebar-item.active { background: var(--accent-lt); }
.audit-sidebar-item.active .asb-id { color: var(--accent); }
.audit-sidebar-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0;
}
.audit-sidebar-dot.answered { background: #22c55e; }
.audit-sidebar-dot.active   { background: var(--accent); }
.asb-id { font-size: 10px; font-family: monospace; font-weight: 700; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }
.asb-text { font-size: 11px; color: var(--text); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.audit-sidebar-cat {
  padding: 10px 8px 3px; font-size: 10px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--border);
  margin-top: 2px;
}
.audit-sidebar-cat:first-child { border-top: none; margin-top: 0; padding-top: 4px; }
.audit-q-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.04);
}
.audit-q-card-top { padding: 32px 36px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(160deg, var(--surface) 60%, #f8f9ff 100%); }
.audit-q-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.audit-q-id {
  background: var(--accent-lt); color: var(--accent); font-family: monospace;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}
.audit-q-num { font-size: 11px; color: var(--text-2); }
.audit-q-cat {
  font-size: 10px; font-weight: 700; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .05em; background: var(--surface-2); padding: 2px 8px; border-radius: 20px;
}
.audit-q-text { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.45; overflow-wrap: break-word; word-break: break-word; }
.audit-q-followup {
  margin-top: 10px; background: #eff6ff; border-left: 3px solid #3b82f6;
  border-radius: 0 8px 8px 0; padding: 8px 12px; font-size: 12px; color: #1e40af;
}
.audit-q-followup-label { font-weight: 700; font-size: 10px; color: #3b82f6; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }

/* ── Answer form ── */
.audit-answer-form { padding: 28px 36px 32px; display: flex; flex-direction: column; gap: 22px; }
.audit-gast-hint {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px; font-size: 12px; color: var(--text-2);
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.audit-field-label { font-size: 10.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .07em; }
.audit-field-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
/* Reset button to reload template */
.audit-reset-tpl {
  font-size: 10px; color: var(--text-3); cursor: pointer; display: flex; align-items: center; gap: 3px;
  padding: 2px 7px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2);
  transition: color .12s, border-color .12s;
}
.audit-reset-tpl:hover { color: var(--accent); border-color: var(--accent); }
.audit-reset-tpl.has-tpl { color: var(--accent); border-color: var(--accent); background: var(--accent-lt); }
/* Textarea base */
.audit-answer-ta, .audit-notes-ta, .audit-rec-ta {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text); font-size: 13.5px; line-height: 1.65;
  font-family: inherit; resize: none; overflow: hidden; box-sizing: border-box;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.audit-answer-ta { min-height: 130px; background: #f0f9ff; border-color: #bae6fd; overflow-y: auto; }
.audit-notes-ta  { min-height: 52px; }
.audit-rec-ta    { min-height: 80px; overflow-y: auto; }
.audit-rec-ta.ai-content { background: #faf5ff; border-color: #ddd6fe; font-size: 14px; line-height: 1.75; }
.audit-answer-ta:focus { outline: none; border-color: #7dd3fc; box-shadow: 0 0 0 3px rgba(125,211,252,.18); background: #e0f2fe; }
.audit-notes-ta:focus, .audit-rec-ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
/* Template state */
.audit-rec-ta[data-tpl] { background: #f0f9ff; border-color: #bae6fd; color: #0c4a6e; font-style: italic; }
.audit-rec-ta[data-tpl]:focus { border-color: var(--accent); }
/* AI generating state */
@keyframes _rec-border-pulse { 0%,100%{border-color:#93c5fd} 50%{border-color:#3b82f6} }
.audit-rec-ta[data-generating] { animation: _rec-border-pulse 1.4s ease-in-out infinite; border-color:#93c5fd; }
/* AI Queue */
@keyframes _spin { to{transform:rotate(360deg)} }
@keyframes _fade-in { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.ai-rec-status { display:flex; align-items:center; gap:7px; padding:5px 2px; min-height:22px; }
.ai-rec-status-spinner { width:13px; height:13px; border:2px solid #bfdbfe; border-top-color:#3b82f6; border-radius:50%; animation:_spin .7s linear infinite; flex-shrink:0; }
.ai-rec-status-label { font-size:11px; color:var(--text-2); }
.ai-rec-status-label strong { color:var(--text); }
/* Minimal chip shown while queue has active jobs */
.ai-queue-chip {
  display:inline-flex; align-items:center; gap:8px; padding:6px 12px;
  background:var(--accent-lt); border:1px solid #bfdbfe; border-radius:20px;
  font-size:11px; color:var(--accent); font-weight:500; animation:_fade-in .2s ease;
}
.ai-queue-chip-label { color:var(--text); font-weight:600; }
/* Stale hint */
.ai-stale-hint { animation:_fade-in .25s ease; }
.stale-hint-inner {
  display:flex; align-items:center; gap:12px; padding:12px 16px;
  background:#fffbeb; border:1.5px solid #fcd34d; border-radius:14px;
  box-shadow: 0 2px 10px rgba(245,158,11,.12);
}
.stale-hint-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.stale-hint-title { font-size:12.5px; font-weight:700; color:#92400e; }
.stale-hint-sub { font-size:11px; color:#a16207; }
.btn-regen {
  display:flex; align-items:center; gap:6px; padding:7px 14px;
  border-radius:10px; border:none; background:linear-gradient(135deg,#d97706,#b45309);
  color:#fff; font-size:12px; font-weight:700; cursor:pointer;
  transition:all .14s; font-family:inherit; white-space:nowrap; flex-shrink:0;
  box-shadow: 0 2px 8px rgba(180,83,9,.25);
  letter-spacing:.01em;
}
.btn-regen:hover { transform:translateY(-1px); box-shadow: 0 4px 12px rgba(180,83,9,.35); }
.btn-regen-inline {
  display:inline-flex; align-items:center; gap:4px; padding:3px 9px;
  border-radius:7px; border:1.5px solid #d8b4fe; background:transparent;
  color:#7c3aed; font-size:10px; font-weight:600; cursor:pointer;
  transition:all .12s; font-family:inherit;
}
.btn-regen-inline:hover { background:#f3e8ff; border-color:#a78bfa; }
.audit-tpl-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #0369a1; background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 4px;
  padding: 1px 5px;
}
/* Risk section */
.audit-risk-section { display: flex; flex-direction: column; gap: 10px; }
.audit-risk-header { display: none; }
.audit-risk-label { font-size: 10px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.audit-risk-pills { display: flex; gap: 12px; flex-wrap: wrap; }
.audit-risk-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 130px; height: 90px; border-radius: 16px; font-size: 12.5px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; transition: all .18s cubic-bezier(.34,1.56,.64,1);
  text-align: center; line-height: 1.3; gap: 7px; font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.audit-risk-pill::before { content: ''; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px transparent; transition: box-shadow .18s; }
.audit-risk-pill:disabled { opacity: .28; cursor: not-allowed; filter: grayscale(70%); pointer-events: none; box-shadow: none; }
.audit-risk-pill.low      { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.audit-risk-pill.low::before  { background: #22c55e; }
.audit-risk-pill.medium   { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.audit-risk-pill.medium::before { background: #f59e0b; }
.audit-risk-pill.high     { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.audit-risk-pill.high::before { background: #f43f5e; }
.audit-risk-pill.selected { transform: scale(1.06); z-index: 1; font-weight: 700; }
.audit-risk-pill.low.selected    { background: #dcfce7; border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2), 0 4px 12px rgba(34,197,94,.15); }
.audit-risk-pill.low.selected::before { box-shadow: 0 0 0 3px rgba(34,197,94,.3); }
.audit-risk-pill.medium.selected { background: #fef3c7; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2), 0 4px 12px rgba(245,158,11,.15); }
.audit-risk-pill.medium.selected::before { box-shadow: 0 0 0 3px rgba(245,158,11,.3); }
.audit-risk-pill.high.selected   { background: #ffe4e6; border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244,63,94,.2), 0 4px 12px rgba(244,63,94,.15); }
.audit-risk-pill.high.selected::before { box-shadow: 0 0 0 3px rgba(244,63,94,.3); }
.audit-risk-pill.unknown     { background: #f8fafc; color: #64748b; border-color: #cbd5e1; }
.audit-risk-pill.unknown::before { background: #94a3b8; }
.audit-risk-pill.unknown.selected { background: #f1f5f9; border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.2), 0 4px 12px rgba(148,163,184,.15); }
.audit-risk-pill.unknown.selected::before { box-shadow: 0 0 0 3px rgba(148,163,184,.3); }
.audit-risk-pill:hover:not(.selected):not(:disabled) { transform: scale(1.03); box-shadow: 0 4px 14px rgba(0,0,0,.1); }
/* Two-column layout for question + notes/risk */
.audit-q-two-col { display: grid; grid-template-columns: 55% 45%; border-bottom: 1px solid var(--border); }
.audit-q-left { padding: 32px 36px 28px; background: linear-gradient(160deg, var(--surface) 60%, #f8f9ff 100%); display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.audit-q-right-col { border-left: 1px solid var(--border); padding: 22px 24px; display: flex; flex-direction: column; gap: 0; background: var(--bg); min-width: 0; }
.audit-q-right-top { flex: 1; display: flex; flex-direction: column; }
.audit-q-right-top .audit-answer-ta { flex: 1; min-height: 100px; }
.audit-q-right-bottom { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.audit-answer-form-bottom { padding: 22px 36px 28px; display: flex; flex-direction: column; gap: 18px; }
/* Fine bar — static, not risk-dependent */
.audit-fine-bar {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 7px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.audit-fine-amount { font-weight: 700; color: var(--text); }
.audit-fine-article { font-size: 10.5px; color: var(--text-2); margin-left: auto; }

/* ── Form nav (inside card) ── */
.audit-form-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px;
}
.audit-nav-pos-inline { font-size: 12px; color: var(--text-2); font-weight: 500; }
.btn-audit-nav {
  display: flex; align-items: center; gap: 6px; padding: 9px 20px;
  border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  transition: all .15s; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.btn-audit-nav:hover { background: var(--surface-2); box-shadow: 0 2px 8px rgba(0,0,0,.1); transform: translateY(-1px); }
.btn-audit-nav:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-audit-nav.primary { background: linear-gradient(135deg,var(--accent),#1d4ed8); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(37,99,235,.3); }
.btn-audit-nav.primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(37,99,235,.4); transform: translateY(-1px); }
/* ── Legacy footer (hidden) ── */
.audit-nav-footer { display: none; }
.btn-audit-save { display: none; }
.btn-audit-save { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn-audit-save:hover { background: var(--border); }
.btn-audit-save.dirty { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.btn-audit-save.dirty:hover { background: #bbf7d0; }
.audit-nav-center { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.btn-audit-sidebar-toggle {
  display: flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .12s; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.btn-audit-sidebar-toggle:hover, .btn-audit-sidebar-toggle.active { background: #f0fdfa; color: #0d9488; border-color: #99f6e4; }

/* ── Question management ── */
.audit-mgmt-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.audit-mgmt-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; user-select: none; }
.audit-mgmt-header:hover { background: var(--surface-2); }
.audit-mgmt-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.audit-mgmt-count { font-size: 11px; color: var(--text-2); }
.audit-mgmt-body { display: none; border-top: 1px solid var(--border); }
.audit-mgmt-card.open .audit-mgmt-body { display: block; }

/* ── Freigegebene Kunden Card ── */
.ac-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ac-card-header { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; cursor: pointer; user-select: none; transition: background .12s; }
.ac-card-header:hover { background: var(--surface-2); }
.ac-card-header-left { display: flex; align-items: center; gap: 12px; }
.ac-card-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-lt);
  color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ac-card-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.ac-card-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.ac-card-header-right { display: flex; align-items: center; gap: 10px; }
.ac-badge { background: var(--accent-lt); color: var(--accent);
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.ac-chevron { color: var(--text-3); transition: transform .2s; }
.ac-card.open .ac-chevron { transform: rotate(180deg); }
.ac-card-body { display: none; border-top: 1px solid var(--border); }
.ac-card.open .ac-card-body { display: block; }
.ac-add-row { display: flex; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ac-input { flex: 1; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--text); background: var(--surface); font-family: inherit; outline: none;
  transition: border-color .15s; }
.ac-input:focus { border-color: var(--accent); }
.ac-btn-add { display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: opacity .15s; white-space: nowrap; }
.ac-btn-add:hover { opacity: .88; }
.ac-err-bar { padding: 9px 16px; background: #fef2f2; border-bottom: 1px solid #fecaca;
  color: #dc2626; font-size: 12.5px; }
.ac-list-empty { padding: 32px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.ac-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); transition: background .1s; }
.ac-item:last-child { border-bottom: none; }

/* ── Audit Modernisierung: angelehnt an Ticket-UI ───────────────────────── */
#audit-view.active {
  background:#f6f7fb;
}
.audit-overview-wrap {
  background:#f6f7fb;
}
.audit-topbar {
  min-height:64px;
  padding:0 28px;
  background:#fff;
  border-bottom:1px solid #d8e0ea;
  box-shadow:0 1px 4px rgba(15,23,42,.04);
}
.audit-topbar-title {
  font-size:18px;
  font-weight:600;
  letter-spacing:0;
  color:#0f172a;
}
.audit-topbar-sub {
  font-size:12.5px;
  color:#64748b;
  margin-top:1px;
}
.btn-audit-create {
  height:38px;
  padding:0 15px;
  border-radius:10px;
  background:#0073ea;
  box-shadow:none;
  font-weight:650;
}
.btn-audit-create:hover { background:#0f172a; opacity:1; }
.audit-filter-bar {
  margin:16px 28px 0;
  padding:10px 12px;
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.035);
}
.audit-search-wrap {
  max-width:360px;
}
.audit-search-input {
  height:36px;
  border-color:#d8e0ea;
  border-radius:9px;
  background:#f8fafc;
  font-size:13px;
}
.audit-search-input:focus {
  background:#fff;
  border-color:#0073ea;
  box-shadow:0 0 0 3px rgba(0,115,234,.08);
}
.audit-toolbar-label {
  color:#64748b;
  letter-spacing:.04em;
}
.audit-seg-ctrl {
  height:34px;
  border-color:#d8e0ea;
  border-radius:9px;
  background:#f8fafc;
}
.audit-seg-btn {
  padding:0 12px;
  color:#64748b;
  font-weight:550;
}
.audit-seg-btn.active {
  background:#0073ea;
  color:#fff;
}
.audit-body {
  padding:16px 28px 28px;
  gap:16px;
}
.audit-grid {
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:12px;
}
.audit-card {
  position:relative;
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.035);
  transition:border-color .16s,box-shadow .16s,transform .16s;
}
.audit-card:hover {
  border-color:#0073ea;
  box-shadow:0 10px 26px rgba(15,23,42,.08);
  transform:translateY(-1px);
}
.audit-card-accent {
  height:3px;
  background:#0073ea;
}
.audit-card-accent.complete { background:#22c55e; }
.audit-card-body {
  padding:14px 15px 15px;
  gap:12px;
}
.audit-card-name {
  font-size:14px;
  font-weight:700;
  color:#0f172a;
}
.audit-card-date {
  color:#94a3b8;
}
.audit-progress-bar {
  height:5px;
  background:#e2e8f0;
}
.audit-progress-fill {
  background:#0073ea;
}
.audit-progress-fill.complete {
  background:#22c55e;
}
.audit-progress-label,
.audit-person-row {
  color:#64748b;
}
.audit-status-badge {
  border-radius:999px;
  padding:3px 10px;
  font-size:10.5px;
}
.audit-status-active { background:#dbeafe;color:#1d4ed8; }
.audit-status-completed { background:#dcfce7;color:#15803d; }
.audit-card-people {
  padding-top:9px;
}
.audit-empty {
  min-height:260px;
  border:1px dashed #cbd5e1;
  border-radius:12px;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.audit-list-shell {
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.04);
  overflow:hidden;
}
.audit-list-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:13px 16px;
  border-bottom:1px solid #e2e8f0;
  background:#fff;
}
.audit-list-summary-title {
  font-size:13px;
  font-weight:700;
  color:#0f172a;
}
.audit-list-summary-sub {
  margin-top:2px;
  font-size:11.5px;
  color:#64748b;
}
.audit-list-summary-kpis {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.audit-list-kpi {
  min-width:72px;
  padding:7px 10px;
  border:1px solid #e2e8f0;
  border-radius:9px;
  background:#f8fafc;
}
.audit-list-kpi-val {
  font-size:15px;
  font-weight:750;
  color:#0f172a;
  line-height:1.1;
}
.audit-list-kpi-label {
  margin-top:2px;
  font-size:10px;
  font-weight:650;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.audit-table-head,
.audit-table-row {
  display:grid;
  grid-template-columns:minmax(240px,1.7fr) 120px 190px minmax(120px,.9fr) minmax(120px,.9fr) 120px 132px;
  gap:12px;
  align-items:center;
}
.audit-table-head {
  padding:9px 16px;
  background:#f8fafc;
  color:#64748b;
  font-size:10px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
  border-bottom:1px solid #e2e8f0;
}
.audit-table-group + .audit-table-group {
  border-top:1px solid #dbe4ef;
}
.audit-table-group-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
  background:#f1f5f9;
  color:#334155;
  font-size:12px;
  font-weight:750;
}
.audit-table-group-count {
  color:#64748b;
  font-size:11px;
  font-weight:650;
}
.audit-table-row {
  min-height:68px;
  padding:12px 16px;
  border-top:1px solid #eef2f7;
  cursor:pointer;
  transition:background .14s, box-shadow .14s;
}
.audit-table-row:first-child { border-top:none; }
.audit-table-row:hover {
  background:#f8fbff;
  box-shadow:inset 3px 0 0 #0073ea;
}
.audit-row-main {
  min-width:0;
}
.audit-row-customer {
  color:#0f172a;
  font-size:13.5px;
  font-weight:750;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.audit-row-sub {
  margin-top:3px;
  display:flex;
  align-items:center;
  gap:6px;
  color:#94a3b8;
  font-size:11px;
}
.audit-row-id {
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  color:#64748b;
}
.audit-table-muted {
  color:#475569;
  font-size:12px;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.audit-table-muted.light { color:#94a3b8; }
.audit-row-progress {
  min-width:0;
}
.audit-row-progress-top {
  display:flex;
  justify-content:space-between;
  gap:8px;
  color:#334155;
  font-size:11.5px;
  font-weight:650;
}
.audit-row-progress-bar {
  height:6px;
  margin-top:6px;
  border-radius:999px;
  background:#e2e8f0;
  overflow:hidden;
}
.audit-row-progress-fill {
  height:100%;
  width:0;
  border-radius:999px;
  background:#0073ea;
}
.audit-row-progress-fill.complete { background:#16a34a; }
.audit-row-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.audit-row-btn,
.audit-row-icon-btn {
  height:32px;
  border:1px solid #d8e0ea;
  border-radius:8px;
  background:#fff;
  color:#334155;
  font-family:inherit;
  font-size:12px;
  font-weight:650;
  cursor:pointer;
  transition:background .12s,border-color .12s,color .12s;
}
.audit-row-btn {
  padding:0 10px;
}
.audit-row-icon-btn {
  width:34px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.audit-row-btn:hover,
.audit-row-icon-btn:hover {
  border-color:#0073ea;
  background:#eff6ff;
  color:#0073ea;
}
.audit-dashboard-modal {
  display:none;
  position:fixed;
  inset:0;
  z-index:4200;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15,23,42,.48);
  backdrop-filter:blur(4px);
}
.audit-dashboard-card {
  width:min(960px,100%);
  max-height:min(760px,calc(100vh - 48px));
  display:flex;
  flex-direction:column;
  border:1px solid rgba(226,232,240,.95);
  border-radius:14px;
  background:#fff;
  box-shadow:0 30px 80px rgba(15,23,42,.24);
  overflow:hidden;
}
.audit-dashboard-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px 20px;
  border-bottom:1px solid #e2e8f0;
  background:#fff;
}
.audit-dashboard-title {
  color:#0f172a;
  font-size:18px;
  font-weight:750;
  letter-spacing:0;
}
.audit-dashboard-sub {
  margin-top:5px;
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  color:#64748b;
  font-size:12px;
}
.audit-dashboard-sub:empty { display:none; margin-top:0; }
.audit-dashboard-body {
  padding:18px 20px 20px;
  overflow:auto;
  background:#f6f7fb;
}
.audit-dashboard-grid {
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:14px;
}
.audit-dash-panel {
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.035);
}
.audit-dash-panel.pad { padding:14px; }
.audit-dash-panel-title {
  font-size:12px;
  font-weight:750;
  color:#0f172a;
  margin-bottom:10px;
}
.audit-dash-kpis {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
.audit-dash-kpi {
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
  padding:11px 12px;
}
.audit-dash-kpi-num {
  color:#0f172a;
  font-size:22px;
  font-weight:800;
  line-height:1;
}
.audit-dash-kpi-label {
  margin-top:5px;
  color:#64748b;
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.audit-dash-risk-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.audit-dash-risk {
  border-radius:9px;
  padding:10px;
  font-size:11px;
  font-weight:700;
}
.audit-dash-risk strong {
  display:block;
  font-size:19px;
  line-height:1.05;
  margin-bottom:3px;
}
.audit-dash-risk.low { background:#dcfce7;color:#15803d; }
.audit-dash-risk.medium { background:#fef3c7;color:#a16207; }
.audit-dash-risk.high { background:#fee2e2;color:#b91c1c; }
.audit-dash-risk.unknown { background:#e2e8f0;color:#475569; }
.audit-dash-progress-wide {
  height:9px;
  border-radius:999px;
  background:#e2e8f0;
  overflow:hidden;
}
.audit-dash-progress-fill {
  height:100%;
  border-radius:999px;
  background:#0073ea;
}
.audit-dash-matrix-wrap {
  display:grid;
  grid-template-columns:72px 1fr;
  gap:8px 10px;
  align-items:stretch;
}
.audit-dash-matrix-y {
  grid-row:2;
  display:grid;
  grid-template-rows:repeat(3,54px);
  gap:6px;
}
.audit-dash-matrix-y span,
.audit-dash-matrix-x span {
  display:flex;
  align-items:center;
  justify-content:center;
  color:#64748b;
  font-size:10px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.audit-dash-matrix-axis {
  grid-column:2;
  color:#64748b;
  font-size:10.5px;
  font-weight:750;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.audit-dash-matrix-body {
  grid-column:2;
  grid-row:2;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-template-rows:repeat(3,54px);
  gap:6px;
}
.audit-dash-matrix-cell {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.72);
  color:#0f172a;
  font-size:18px;
  font-weight:850;
  line-height:1;
}
.audit-dash-matrix-cell small {
  margin-top:3px;
  color:rgba(15,23,42,.58);
  font-size:9.5px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.audit-dash-matrix-x {
  grid-column:2;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}
.audit-dash-matrix-side-label {
  grid-column:1;
  grid-row:2;
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  color:#64748b;
  font-size:10.5px;
  font-weight:750;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.audit-dash-matrix-note {
  margin-top:10px;
  color:#64748b;
  font-size:11.5px;
  line-height:1.45;
}
.audit-dash-meta-list {
  display:grid;
  gap:8px;
}
.audit-dash-meta-row {
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:9px 0;
  border-bottom:1px solid #eef2f7;
  font-size:12px;
}
.audit-dash-meta-row:last-child { border-bottom:none; }
.audit-dash-meta-row span:first-child {
  color:#64748b;
  font-weight:650;
}
.audit-dash-meta-row span:last-child {
  color:#0f172a;
  font-weight:650;
  text-align:right;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.audit-dash-category-list {
  display:grid;
  gap:8px;
}
.audit-dash-category {
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border:1px solid #e2e8f0;
  border-radius:9px;
  background:#f8fafc;
}
.audit-dash-category-name {
  color:#334155;
  font-size:12px;
  font-weight:650;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.audit-dash-category-count {
  color:#0f172a;
  font-size:12px;
  font-weight:800;
}
.audit-dashboard-footer {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  padding:14px 20px;
  border-top:1px solid #e2e8f0;
  background:#fff;
}
.audit-dashboard-footer-actions {
  display:flex;
  gap:8px;
}
.audit-dash-btn {
  height:36px;
  padding:0 13px;
  border-radius:9px;
  border:1px solid #d8e0ea;
  background:#fff;
  color:#334155;
  font-family:inherit;
  font-size:12.5px;
  font-weight:700;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:7px;
}
.audit-dash-btn:hover {
  border-color:#0073ea;
  background:#eff6ff;
  color:#0073ea;
}
.audit-dash-btn.primary {
  border-color:#0073ea;
  background:#0073ea;
  color:#fff;
}
.audit-dash-btn.primary:hover {
  border-color:#0f172a;
  background:#0f172a;
  color:#fff;
}
.audit-dash-loading {
  min-height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#64748b;
  font-size:13px;
}
@media (max-width:1100px) {
  .audit-table-head,
  .audit-table-row {
    grid-template-columns:minmax(220px,1.6fr) 110px 170px minmax(110px,.8fr) 110px;
  }
  .audit-table-head > :nth-child(5),
  .audit-table-row > :nth-child(5),
  .audit-table-head > :nth-child(6),
  .audit-table-row > :nth-child(6) { display:none; }
}
@media (max-width:760px) {
  .audit-list-summary { align-items:flex-start; flex-direction:column; }
  .audit-list-summary-kpis { justify-content:flex-start; }
  .audit-table-head { display:none; }
  .audit-table-row {
    grid-template-columns:1fr;
    gap:8px;
    align-items:stretch;
  }
  .audit-row-actions { justify-content:flex-start; }
  .audit-dashboard-modal { padding:12px; }
  .audit-dashboard-grid,
  .audit-dash-kpis,
  .audit-dash-risk-grid { grid-template-columns:1fr; }
  .audit-dash-matrix-wrap { grid-template-columns:52px 1fr; }
  .audit-dashboard-footer { align-items:stretch; flex-direction:column; }
  .audit-dashboard-footer-actions { width:100%; flex-direction:column; }
  .audit-dash-btn { justify-content:center; width:100%; }
}
.audit-detail-wrap {
  background:#f6f7fb;
}
.audit-detail-header {
  height:64px;
  padding:0 18px;
  background:#fff;
  border-bottom:1px solid #d8e0ea;
  box-shadow:0 1px 4px rgba(15,23,42,.04);
}
.btn-audit-back {
  height:38px;
  padding:0 12px;
  border:1px solid #d8e0ea;
  border-radius:10px;
  color:#334155;
  background:#fff;
}
.btn-audit-back:hover {
  border-color:#0073ea;
  background:#eff6ff;
  color:#0073ea;
}
.audit-detail-title {
  height:auto;
  max-width:320px;
  padding:0 18px;
  border-right:none;
  font-size:16px;
  font-weight:600;
  color:#0f172a;
}
.audit-header-progress {
  padding:0 12px;
}
.audit-header-progress-bar {
  height:7px;
  border-radius:999px;
  background:#e2e8f0;
}
.audit-header-progress-fill {
  background:#0073ea;
}
.audit-header-progress-label {
  color:#334155;
  font-size:11.5px;
}
.btn-audit-sidebar-toggle,
.btn-audit-report,
.btn-audit-more {
  height:36px;
  border-radius:10px;
  border-color:#d8e0ea;
  background:#fff;
  color:#334155;
  box-shadow:none;
}
.btn-audit-sidebar-toggle:hover,
.btn-audit-sidebar-toggle.active,
.btn-audit-report:hover,
.btn-audit-more:hover {
  border-color:#0073ea;
  background:#eff6ff;
  color:#0073ea;
}
.btn-audit-report {
  background:#0073ea;
  color:#fff;
  border-color:#0073ea;
}
.btn-audit-report:hover {
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}
.audit-info-strip {
  margin:14px 28px 12px;
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.035);
}
.audit-info-toggle {
  padding:11px 14px;
}
.audit-info-toggle-label {
  font-weight:650;
}
.audit-meta-grid {
  margin:14px 18px;
}
.audit-meta-label,
.audit-meta-val {
  border-color:#e2e8f0;
}
.audit-participants-panel {
  border-left-color:#e2e8f0;
}
.audit-participant-row {
  background:#f8fafc;
  border-color:#e2e8f0;
  border-radius:9px;
}
.audit-content-wrap {
  padding:0 28px 24px;
  gap:14px;
}
.audit-question-area {
  padding:0;
}
.audit-q-card {
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
  box-shadow:0 2px 16px rgba(15,23,42,.045);
}
.audit-q-two-col {
  grid-template-columns:minmax(0,52%) minmax(0,48%);
  border-bottom-color:#e2e8f0;
}
.audit-q-left {
  padding:26px 28px;
  background:#fff;
}
.audit-q-right-col {
  padding:22px 22px;
  background:#f8fafc;
  border-left-color:#e2e8f0;
}
.audit-q-header {
  gap:8px;
}
.audit-q-id,
.audit-q-cat {
  border-radius:7px;
}
.audit-q-id {
  background:#eff6ff;
  color:#0073ea;
}
.audit-q-cat {
  background:#f1f5f9;
  color:#64748b;
}
.audit-q-text {
  font-size:18px;
  font-weight:650;
  line-height:1.5;
}
.audit-q-followup {
  background:#eff6ff;
  border-left-color:#0073ea;
  border-radius:8px;
}
.audit-answer-form-bottom {
  padding:20px 28px 24px;
  gap:16px;
}
.audit-field-label {
  color:#64748b;
}
.audit-answer-ta,
.audit-notes-ta,
.audit-rec-ta {
  border:1px solid #d8e0ea;
  border-radius:10px;
  background:#fff;
  font-size:13px;
  line-height:1.6;
}
.audit-answer-ta {
  background:#fff;
}
.audit-rec-ta.ai-content {
  background:#fbfaff;
  border-color:#d8d5ff;
}
.audit-answer-ta:focus,
.audit-notes-ta:focus,
.audit-rec-ta:focus {
  border-color:#0073ea;
  box-shadow:0 0 0 3px rgba(0,115,234,.08);
}
.audit-risk-pills {
  gap:8px;
}
.audit-risk-pill {
  width:118px;
  height:72px;
  border-radius:12px;
  box-shadow:none;
  border-width:1.5px;
  font-size:12px;
}
.audit-form-nav {
  margin-top:2px;
}
.btn-audit-nav {
  border-radius:10px;
  box-shadow:none;
}
.btn-audit-nav.primary {
  background:#0073ea;
  box-shadow:none;
}
.btn-audit-nav.primary:hover:not(:disabled) {
  background:#0f172a;
  box-shadow:none;
}
.audit-q-sidebar.open {
  width:300px;
  border-left:0;
}
.audit-q-sidebar {
  border:1px solid #d8e0ea;
  border-radius:12px;
  background:#fff;
}
.audit-sidebar-header {
  border-bottom-color:#e2e8f0;
}
.audit-sidebar-item {
  border-radius:8px;
}
.audit-sidebar-item.active {
  background:#eff6ff;
}
.audit-sidebar-item.active .asb-id {
  color:#0073ea;
}
.audit-sidebar-dot.active {
  background:#0073ea;
}
.audit-mgmt-card,
.ac-card {
  border-color:#d8e0ea;
  border-radius:12px;
  box-shadow:0 1px 4px rgba(15,23,42,.035);
}
.audit-mgmt-header,
.ac-card-header {
  background:#fff;
}
.audit-mgmt-header:hover,
.ac-card-header:hover {
  background:#f8fafc;
}
.ac-card-icon,
.ac-badge {
  background:#eff6ff;
  color:#0073ea;
}
@media(max-width:1050px){
  .audit-q-two-col { grid-template-columns:1fr; }
  .audit-q-right-col { border-left:0;border-top:1px solid #e2e8f0; }
  .audit-content-wrap { padding:0 16px 18px; }
  .audit-filter-bar { margin:14px 16px 0; }
}
.ac-item:hover { background: #fafbfc; }
.ac-item-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-lt);
  color: var(--accent); font-size: 13px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; }
.ac-item-body { flex: 1; min-width: 0; }
.ac-item-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ac-item-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.ac-item-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.ac-item:hover .ac-item-actions { opacity: 1; }
.ac-action-btn { display: flex; align-items: center; gap: 4px; padding: 5px 10px;
  border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: background .1s; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.ac-action-btn:hover { background: var(--surface-2); color: var(--text); }
.ac-action-btn.danger { color: #dc2626; border-color: #fecaca; }
.ac-action-btn.danger:hover { background: #fef2f2; }
.ac-item-edit-row { display: none; flex: 1; gap: 6px; align-items: center; }
.ac-item-edit-row.active { display: flex; }
.ac-item-name-wrap.editing { display: none; }
.ac-item-edit-input { flex: 1; padding: 6px 10px; border: 1.5px solid var(--accent);
  border-radius: 7px; font-size: 13px; font-family: inherit; color: var(--text); outline: none; background: var(--surface); }
.ac-save-btn { padding: 5px 12px; background: var(--accent); color: #fff; border: none;
  border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.ac-cancel-btn { padding: 5px 10px; background: none; border: 1px solid var(--border);
  border-radius: 7px; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--text-2); }
.audit-q-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.audit-q-table th { padding: 8px 12px; text-align: left; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.audit-q-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.audit-q-table tr:last-child td { border-bottom: none; }
.audit-q-table tr:hover td { background: var(--surface-2); }
.btn-aq-edit { padding: 3px 8px; border-radius: 5px; font-size: 11px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.btn-aq-edit:hover { border-color: var(--accent); color: var(--accent); }

/* ── Chat widget ── */
.audit-start-widget { background: var(--surface); border-radius: 12px; padding: 18px 20px; max-width: 420px; }
.audit-widget-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.audit-widget-sub { font-size: 12px; color: var(--text-2); margin-bottom: 14px; }
.audit-widget-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--text); background: var(--bg); box-sizing: border-box; margin-bottom: 10px; }
.audit-widget-input:focus { outline: none; border-color: var(--accent); }
.btn-audit-widget-submit { width: 100%; padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--accent); color: #fff; border: none; cursor: pointer; }
.btn-audit-widget-submit:hover { background: #1d4ed8; }
.btn-audit-widget-submit:disabled { opacity: .5; cursor: not-allowed; }
.audit-cred-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px 16px; margin-top: 10px; }
.audit-cred-title { font-size: 12px; font-weight: 700; color: #15803d; margin-bottom: 8px; }
.audit-cred-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.audit-cred-key { font-size: 12px; color: #166534; }
.audit-cred-val { font-family: monospace; font-size: 13px; font-weight: 700; color: #14532d; background: #dcfce7; padding: 2px 8px; border-radius: 4px; }
.audit-existing-box {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 14px 16px; margin-top: 10px;
}
.audit-existing-title { font-size: 12px; font-weight: 700; color: #1d4ed8; margin-bottom: 6px; }
.btn-audit-open { margin-top: 10px; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; border: none; cursor: pointer; }

/* ── Audit list widget ── */
.audit-list-widget { min-width: 300px; max-width: 480px; }
.alw-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.alw-count { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 2px 8px; border-radius: 20px; }
.alw-open-all { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; }
.alw-open-all:hover { text-decoration: underline; }
.alw-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.alw-row {
  display: flex; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s;
}
.alw-row:last-child { border-bottom: none; }
.alw-row:hover { background: var(--surface-2); }
.alw-accent { width: 3px; flex-shrink: 0; background: linear-gradient(180deg,#3b82f6,#6366f1); }
.alw-accent.complete { background: linear-gradient(180deg,#22c55e,#16a34a); }
.alw-accent.archived { background: #e2e8f0; }
.alw-body { flex: 1; padding: 10px 14px; display: flex; flex-direction: column; gap: 5px; }
.alw-top { display: flex; align-items: center; gap: 8px; }
.alw-name { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alw-progress-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.alw-progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg,#3b82f6,#6366f1); transition: width .4s; }
.alw-progress-fill.complete { background: linear-gradient(90deg,#22c55e,#16a34a); }
.alw-meta { display: flex; gap: 8px; font-size: 10px; color: var(--text-2); justify-content: space-between; }

/* ── Audit context widgets (summary / risks / participants) ── */
.acw-wrap { min-width: 300px; max-width: 480px; display: flex; flex-direction: column; }
.acw-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.acw-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.acw-sub { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.acw-body {
  display: flex; align-items: center; gap: 20px; padding: 16px 20px;
}
.acw-progress-ring-wrap { position: relative; flex-shrink: 0; }
.acw-pct-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 13px; font-weight: 800; color: var(--text);
}
.acw-stats { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.acw-stat-row { display: flex; justify-content: space-between; gap: 16px; }
.acw-stat-lbl { font-size: 11px; color: var(--text-2); }
.acw-stat-val { font-size: 12px; font-weight: 700; color: var(--text); }
.acw-risk-section { padding: 0 20px 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.acw-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-bottom: 8px; }
.acw-risk-list { display: flex; flex-direction: column; gap: 4px; }
.acw-risk-row { display: flex; align-items: center; gap: 8px; }
.acw-risk-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.acw-risk-lbl { font-size: 12px; color: var(--text); flex: 1; }
.acw-risk-val { font-size: 12px; font-weight: 700; color: var(--text); }
.acw-footer { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.acw-btn { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; border: none; cursor: pointer; }
.acw-btn:hover { opacity: .88; }
/* Picker */
.acw-picker-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.acw-picker-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: none; background: none; cursor: pointer; border-bottom: 1px solid var(--border);
  text-align: left; transition: background .1s;
}
.acw-picker-row:last-child { border-bottom: none; }
.acw-picker-row:hover { background: var(--surface-2); }
.acw-picker-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.acw-picker-pct { font-size: 11px; font-weight: 700; color: var(--text-2); }
/* Risk items */
.acw-risk-items { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.acw-risk-item { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.acw-risk-item:last-child { border-bottom: none; }
.acw-ri-head { display: flex; align-items: center; gap: 8px; }
.acw-ri-id { font-size: 11px; font-weight: 700; color: var(--text-2); font-family: monospace; }
.acw-ri-badge { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.acw-ri-q { font-size: 12px; color: var(--text); line-height: 1.4; }
.acw-ri-ans { font-size: 11px; color: var(--text-2); line-height: 1.4; padding: 4px 8px; background: var(--surface-2); border-radius: 6px; border-left: 2px solid var(--border); }
/* Participants */
.acw-parts-list { display: flex; flex-direction: column; }
.acw-part-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.acw-part-row:last-child { border-bottom: none; }
.acw-pw-placeholder { color: var(--text-2); letter-spacing: 2px; }
.acw-cred-block { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.acw-cred-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.acw-cred-label { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.acw-cred-val { font-size: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; font-family: monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acw-cred-copy { padding: 3px 8px; font-size: 12px; background: none; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text-2); transition: background .1s; }
.acw-cred-copy:hover { background: var(--surface-2); }
