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

:root {
  --bg: #f5f8fa;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --border: #e1e8ed;
  --accent: #0e7c7b;
  --accent2: #0e7c7b;
  --accent-dark: #0a5c5b;
  --accent-light: #dff1f0;
  --green: #1fae7a;
  --red: #e25563;
  --yellow: #f0a23c;
  --blue: #4f8ef5;
  --purple: #8b5cf6;
  --green-light: #e7f7f0;
  --red-light: #fdecee;
  --yellow-light: #fdf1e0;
  --text: #182430;
  --muted: #7c8a96;
  --input-bg: #f7fafb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}

[data-theme="dark"] {
  --bg: #0d1117;
  --sidebar: #11161c;
  --panel: #151b22;
  --border: #262e37;
  --accent: #17a2a0;
  --accent2: #17a2a0;
  --accent-dark: #5eead4;
  --accent-light: #12302f;
  --green: #2fbf87;
  --red: #ef6672;
  --yellow: #f2b25c;
  --blue: #5b9df7;
  --purple: #a78bfa;
  --green-light: #10261c;
  --red-light: #3a1418;
  --yellow-light: #2e2210;
  --text: #e6edf0;
  --muted: #8b98a1;
  --input-bg: #0b0f14;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.45);
}

html, body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: var(--bg); color: var(--text); height: 100vh;
       margin: 0; overflow: hidden; font-size:14px; }

/* ── SCROLLBARS (themed to match light/dark) ── */
html { color-scheme: light; scrollbar-width: thin; scrollbar-color: var(--border) var(--panel); }
[data-theme="dark"] { color-scheme: dark; }
/* Chrome paints an opaque backdrop behind a cross-origin iframe whose color-scheme differs from ours, hiding the page behind Razorpay checkout in dark mode. */
.razorpay-container, .razorpay-checkout-frame { color-scheme: light; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Chrome (top bar, sidebar tree, tabs, buttons) shouldn't show a drag-selection highlight.
   Inputs, textareas, code blocks, and response bodies are left selectable for copy/paste. */
button { user-select: none; }

#app-root { display: flex; flex-direction: column; height: 100vh; min-height: 0; }

/* ── TOP BAR ── */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border);
          padding: 0 24px; height: 60px; display: flex; align-items: center;
          gap: 12px; flex-shrink: 0; user-select: none; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text); }
.logo-icon { width: 32px; height: 32px; background: var(--accent);
             border-radius: 9px; display: flex; align-items: center; justify-content: center;
             font-size: 15px; color: #fff; }
.topbar-sep { flex: 1; }
/* Same width as the sidebar so its right border continues the sidebar's divider up through the top bar.
   The negative margin cancels the top bar's left padding; 13px centres the 32px logo in the 58px rail. */
.topbar-brand { width: 260px; align-self: stretch; margin-left: -24px; padding-left: 13px; flex-shrink: 0;
                display: flex; align-items: center; border-right: 1px solid var(--border);
                overflow: hidden; transition: width .22s ease; }
.topbar-brand .logo-icon { flex-shrink: 0; }
.topbar-brand .logo-text { white-space: nowrap; transition: opacity .15s ease; }
html[data-sidebar="collapsed"] .topbar-brand { width: 58px; }
html[data-sidebar="collapsed"] .topbar-brand .logo-text { opacity: 0; }
.sidebar-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
                   border-radius: 8px; border: none; background: none; color: var(--text);
                   cursor: pointer; flex-shrink: 0; transition: background .15s ease; }
.sidebar-toggle:hover { background: var(--bg); }

/* ── LAYOUT ── */
.layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }
.content-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }

/* ── FOOTER ── */
.app-footer { position: relative; background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
              border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
              flex-shrink: 0; margin-top: 48px; }
.app-footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px;
                       background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent); }
.footer-top { display: flex; flex-wrap: wrap; gap: 32px; padding: 40px 32px 28px; }
.footer-brand { flex: 1 1 220px; min-width: 200px; }
.footer-links { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 24px; flex: 2 1 480px; }
.footer-links .footer-col { min-width: 0; }
.footer-brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-logo-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
                     background: linear-gradient(135deg, var(--accent), var(--accent-dark));
                     display: flex; align-items: center; justify-content: center;
                     font-size: 16px; color: #fff; box-shadow: 0 4px 14px rgba(14,124,123,.3); }
.footer-brand-name { font-size: 16.5px; font-weight: 800; color: var(--text); letter-spacing: -.2px; }
.footer-brand-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; max-width: 270px; margin: 0; }
.footer-col-title { font-size: 11px; font-weight: 700; color: var(--text); text-transform: uppercase;
                     letter-spacing: .8px; margin-bottom: 16px; position: relative; padding-bottom: 9px; }
.footer-col-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 20px; height: 2px;
                            background: var(--accent); border-radius: 2px; }
.footer-link { display: flex; align-items: center; width: fit-content; max-width: 100%; font-size: 13px; color: var(--muted);
               cursor: pointer; padding: 6px 0; text-decoration: none; transition: color .15s ease, transform .15s ease;
               overflow-wrap: anywhere; }
.footer-link:hover { color: var(--accent); transform: translateX(3px); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px;
                  padding: 18px 32px; border-top: 1px solid var(--border); font-size: 12.5px; }
.app-footer-powered { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.app-footer-powered-link { display: flex; align-items: center; gap: 8px; color: var(--muted);
                            text-decoration: none; transition: color .15s ease; }
.app-footer-powered-link:hover { color: var(--accent); }
.app-footer-powered img { height: 18px; width: auto; border-radius: 4px; }
@media (max-width: 620px) { .footer-links { grid-template-columns: repeat(2, 1fr); } }

/* ── SIDEBAR ── */
.sidebar { width: 260px; background: var(--sidebar); border-right: 1px solid var(--border);
           display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; user-select: none; }
.sidebar-top-nav { padding: 14px 10px 16px; flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.sidebar-version { flex-shrink: 0; padding: 15.3px 14px; border-top: 1px solid var(--border); }
.sidebar-version-badge { display: inline-flex; align-items: center; gap: 6px;
                          font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: var(--muted);
                          background: var(--bg); border: 1px solid var(--border); border-radius: 20px;
                          padding: 4px 10px; }
.sidebar-version-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.tree { flex: 1; overflow-y: auto; padding: 4px 10px; min-height: 0; }
.sidebar-backdrop { display: none; }

/* Desktop collapse to an icon rail. Only the width and label opacity animate; the row layout stays
   put so the icons don't jump. 58px = nav padding (10) + row padding (10) + icon (17) + the same on the right, + border. */
.sidebar { transition: width .22s ease; }
.sidebar-home .project-name { white-space: nowrap; transition: opacity .15s ease; }
.sidebar-home .caret { transition: opacity .15s ease; }
.sidebar-version-badge { transition: color .15s ease, background .15s ease, border-color .15s ease; }
html[data-sidebar="collapsed"] .sidebar { width: 58px; }
html[data-sidebar="collapsed"] .sidebar .project-name,
html[data-sidebar="collapsed"] .sidebar .caret { opacity: 0; }
html[data-sidebar="collapsed"] .sidebar .node-row:hover { transform: none; }
html[data-sidebar="collapsed"] .sidebar .sidebar-version { padding-left: 16px; }
html[data-sidebar="collapsed"] .sidebar .sidebar-version-badge { color: transparent; background: none; border-color: transparent; padding-left: 4px; }

/* ── RESPONSIVE (collapse the nav to a slide-in drawer on narrow screens) ── */
@media (max-width: 900px) {
    /* The drawer is always full width; a desktop collapse preference doesn't apply here. */
    html[data-sidebar="collapsed"] .sidebar { width: 260px; }
    html[data-sidebar="collapsed"] .sidebar .project-name,
    html[data-sidebar="collapsed"] .sidebar .caret { opacity: 1; }
    html[data-sidebar="collapsed"] .sidebar .sidebar-version { padding-left: 14px; }
    html[data-sidebar="collapsed"] .sidebar .sidebar-version-badge { color: var(--muted); background: var(--bg); border-color: var(--border); padding-left: 10px; }
    .topbar-brand, html[data-sidebar="collapsed"] .topbar-brand { width: auto; margin-left: 0; padding-left: 0; border-right: none; }
    html[data-sidebar="collapsed"] .topbar-brand .logo-text { opacity: 1; }
    .sidebar-toggle { order: -1; margin-left: -6px; }
    .sidebar { position: fixed; top: 60px; left: 0; bottom: 0; z-index: 45;
               transform: translateX(-100%); transition: transform .2s ease;
               box-shadow: 4px 0 24px rgba(16,24,40,.25); }
    .sidebar.sidebar-open { transform: translateX(0); }
    .sidebar-backdrop { display: block; position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
                         background: rgba(15,17,23,.45); z-index: 44; }
}
@media (max-width: 640px) {
    .profile-trigger .name { display: none; }
    .topbar { flex-wrap: wrap; height: auto; min-height: 60px; padding: 10px 16px; row-gap: 8px; }
    .topbar-sep { flex-basis: 100%; height: 0; }
    .sidebar { top: 96px; }
    .sidebar-backdrop { top: 96px; }
}
@media (max-width: 700px) {
    .page-body { flex-direction: column; }
    .sidebar-secondary { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ── PAGE (header + secondary sidebar + main scroll together as one page) ── */
.page-scroll { flex: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.page-body { display: flex; flex: 1 0 auto; min-height: 100%; }
.project-page-header { display: flex; flex-direction: column; gap: 4px;
                        padding: 4px 2px 16px; flex-shrink: 0;
                        animation: panelFadeIn .22s ease; }
.project-page-title { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.project-page-sub { font-size:14px; color: var(--muted); margin-top: 4px; }
.project-page-badges { display: flex; gap: 8px; flex-shrink: 0; }

/* ── SIDEBAR (SECONDARY) ── */
.sidebar-secondary { width: 230px; background: var(--sidebar); border-right: 1px solid var(--border);
                      display: flex; flex-direction: column; flex-shrink: 0;
                      padding: 10px; user-select: none; animation: panelSlideIn .22s ease; }

@keyframes panelSlideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes panelFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.node-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
            cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s; user-select: none; }
.node-row:hover { background: var(--bg); transform: translateX(3px); box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.node-row.active { background: var(--accent-light); box-shadow: inset 3px 0 0 0 var(--accent); }
.node-row.active:hover { box-shadow: inset 3px 0 0 0 var(--accent), 0 2px 8px rgba(16,24,40,.08); }
.node-row.active .project-name { color: var(--text); }

.project-node { margin-bottom: 4px; }
.project-row .project-icon { width: 17px; text-align: center; flex-shrink: 0; }
.project-row .project-name { flex: 1; font-weight: 600; font-size:14px; overflow: hidden;
                              text-overflow: ellipsis; white-space: nowrap; }
.demo-tag { font-size: 9px; color: var(--muted); flex-shrink: 0; }
.draft-tag { font-size: 9px; font-weight: 700; color: var(--yellow); flex-shrink: 0;
             text-transform: uppercase; letter-spacing: .03em; }

.badge-live, .badge-draft { font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
                             margin-left: 8px; text-transform: uppercase; letter-spacing: .03em; }
.badge-live  { background: var(--accent-light); color: var(--accent-dark); }
.badge-draft { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.group-node { margin-left: 16px; }
.group-row .group-name { flex: 1; font-size:14px; color: var(--text); overflow: hidden;
                          text-overflow: ellipsis; white-space: nowrap; }
.group-icon { width: 15px; text-align: center; flex-shrink: 0; color: var(--text); }
.group-icon.nav-icon svg { width: 15px; height: 15px; }

.endpoint-row { margin-left: 32px; margin-top: 4px; }
.endpoint-row.ungrouped { margin-left: 16px; }
.endpoint-row .method-pill { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
                          flex-shrink: 0; width: 36px; text-align: center; }
.pill-GET    {  color: #1fae7a; }
.pill-POST   {  color: #c5780f; }
.pill-PUT    {  color: #3b73e0; }
.pill-DELETE {  color: #d83b4c; }
.pill-PATCH  {  color: #8b5cf6; }
.endpoint-row .endpoint-name { font-size:14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-endpoint-row { margin-left: 0; color: var(--text); font-size:14px; font-weight: 600; }
.add-endpoint-row .project-icon { width: 16px; text-align: center; flex-shrink: 0; font-size:14px; }
.endpoint-row[draggable="true"] { cursor: grab; }
.group-row[draggable="true"] { cursor: grab; }
.group-node.drag-over { background: var(--accent-light); outline: 1px dashed var(--accent); border-radius: 4px; }
.project-row.drag-over { background: var(--accent-light); outline: 1px dashed var(--accent); border-radius: 4px; }
.ungrouped-drop { height: 4px; margin: 2px 16px; border-radius: 2px; transition: background .1s; }
.ungrouped-drop.drag-over { background: var(--accent-light); outline: 1px dashed var(--accent); }
.empty-tree { padding: 20px; text-align: center; color: var(--muted); font-size: 11px; }

.sidebar-home { margin-bottom: 2px; }
.sidebar-home .project-icon { font-size:14px; }
.nav-icon { display: flex; align-items: center; justify-content: center; color: var(--text); }
.nav-icon svg { width: 17px; height: 17px; display: block; }
.add-endpoint-row .nav-icon svg { width: 15px; height: 15px; }
.sidebar-projects-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase;
                           letter-spacing: .8px; padding: 10px 10px 4px; }

.add-endpoint-row.active { color: var(--accent-dark); }
.add-endpoint-row.active .nav-icon { color: var(--accent-dark); }
.row-chevron { margin-left: auto; font-size: 16px; line-height: 1; color: var(--accent-dark); flex-shrink: 0; }

/* ── MAIN CONTENT ── */
.main { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }

.notification-bell-wrap { position: relative; }
.notification-overlay { position: fixed; inset: 0; z-index: 40; background: transparent; }
.notification-bell { position: relative; display: flex; align-items: center; justify-content: center;
                      width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
                      background: var(--panel); color: var(--text); cursor: pointer; }
.notification-bell:hover { background: var(--input-bg); }
.notification-bell svg { width: 16px; height: 16px; }
.notification-bell-badge { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff;
                            border-radius: 10px; font-size: 9.5px; font-weight: 700; line-height: 1;
                            padding: 3px 4.5px; min-width: 14px; text-align: center; }
.notification-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: 400px; max-width: calc(100vw - 24px);
                          max-height: min(560px, calc(100vh - 90px)); background: var(--panel); border: 1px solid var(--border);
                          border-radius: 14px; box-shadow: 0 20px 48px -12px rgba(16,24,40,.28), 0 4px 12px rgba(16,24,40,.08);
                          z-index: 50; display: flex; flex-direction: column; overflow: hidden; animation: ndIn .14s ease-out; }
@keyframes ndIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nd-header { display: flex; justify-content: space-between; align-items: center; gap: 12px;
             padding: 16px 18px 14px; border-bottom: 1px solid var(--border); }
.nd-header-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.nd-count { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-light);
            padding: 2px 8px; border-radius: 999px; }
.nd-mark-read { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
                color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.nd-mark-read svg { width: 15px; height: 15px; }
.nd-mark-read:hover:not(:disabled) { background: var(--accent-light); }
.nd-mark-read:disabled { color: var(--muted); opacity: .6; cursor: default; }
.nd-list { overflow-y: auto; flex: 1; padding: 6px; }
.nd-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 28px 12px 12px;
           border-radius: 10px; cursor: pointer; transition: background .12s; }
.nd-item + .nd-item { margin-top: 2px; }
.nd-item:hover { background: var(--input-bg); }
.nd-item.unread { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.nd-item.unread:hover { background: color-mix(in srgb, var(--accent) 11%, var(--panel)); }
.nd-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nd-icon svg { width: 18px; height: 18px; }
.nd-body { flex: 1; min-width: 0; }
.nd-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.nd-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-item.unread .nd-title { font-weight: 700; }
.nd-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.nd-message { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 3px;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.nd-item.unread .nd-message { color: var(--text); opacity: .8; }
.nd-dot { position: absolute; right: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
          background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.nd-empty { text-align: center; padding: 36px 20px; }
.nd-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; background: var(--input-bg); color: var(--muted);
                 display: flex; align-items: center; justify-content: center; }
.nd-empty-icon svg { width: 22px; height: 22px; }
.nd-empty-title { font-size: 14px; font-weight: 700; color: var(--text); }
.nd-empty-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.nd-footer { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 13px;
             background: var(--panel); border: none; border-top: 1px solid var(--border); cursor: pointer;
             color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 600; }
.nd-footer svg { width: 15px; height: 15px; transition: transform .12s; }
.nd-footer:hover { background: var(--input-bg); }
.nd-footer:hover svg { transform: translateX(2px); }
.notification-toast-container { position: fixed; top: 72px; right: 20px; z-index: 60; display: flex;
                                  flex-direction: column; gap: 12px; width: 340px; max-width: calc(100vw - 40px); }
.notification-toast { position: relative; display: flex; align-items: flex-start; gap: 12px; overflow: hidden;
                       background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
                       box-shadow: 0 12px 32px rgba(16,24,40,.22), 0 2px 8px rgba(16,24,40,.12);
                       padding: 14px 14px 16px; cursor: pointer;
                       animation: notification-toast-in .28s cubic-bezier(.21,1.02,.73,1);
                       transition: transform .15s ease, box-shadow .15s ease; }
.notification-toast:hover { transform: translateY(-2px);
                             box-shadow: 0 16px 40px rgba(16,24,40,.28), 0 2px 8px rgba(16,24,40,.14); }
.notification-toast.tone-success { --toast-accent: var(--green); }
.notification-toast.tone-warning { --toast-accent: var(--yellow); }
.notification-toast.tone-danger  { --toast-accent: var(--red); }
.notification-toast-icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: flex;
                            align-items: center; justify-content: center; color: var(--toast-accent);
                            background: color-mix(in srgb, var(--toast-accent) 16%, var(--panel)); }
.notification-toast-icon svg { width: 17px; height: 17px; }
.notification-toast-body { flex: 1; min-width: 0; }
.notification-toast-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.notification-toast-title { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.1px; }
.notification-toast-close { background: none; border: none; color: var(--muted); cursor: pointer; line-height: 1;
                             padding: 3px; margin: -3px -3px 0 0; border-radius: 50%; flex-shrink: 0;
                             display: flex; align-items: center; justify-content: center;
                             transition: background .15s ease, color .15s ease; }
.notification-toast-close svg { width: 13px; height: 13px; }
.notification-toast-close:hover { color: var(--text); background: var(--input-bg); }
.notification-toast-message { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.notification-toast-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
                                 background: var(--toast-accent); border-radius: 0 0 14px 14px;
                                 animation: notification-toast-progress 8s linear forwards; opacity: .55; }
@keyframes notification-toast-in {
  from { opacity: 0; transform: translateX(24px) scale(.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes notification-toast-progress { from { width: 100%; } to { width: 0%; } }
.btn-link { background: none; border: none; color: var(--accent); font-size: 11.5px; font-weight: 600;
            cursor: pointer; padding: 0; }
.btn-link:hover:not(:disabled) { text-decoration: underline; }
.btn-link:disabled { color: var(--muted); cursor: default; }

/* ── MULTI-SELECT DROPDOWN ── */
.msd { position: relative; display: flex; flex-direction: column; min-width: 180px; }
.msd-trigger { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 37px;
               background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
               padding: 5px 10px; cursor: pointer; transition: border-color .12s; }
.msd-trigger:hover { border-color: var(--accent); }
.msd-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.msd-placeholder { color: var(--muted); font-size:14px; }
.msd-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-light);
            color: var(--accent-dark); font-size: 11.5px; font-weight: 600; padding: 3px 6px 3px 9px;
            border-radius: 6px; white-space: nowrap; }
.msd-chip-remove { background: none; border: none; padding: 0; margin: 0; color: inherit; font: inherit;
                    cursor: pointer; opacity: .7; font-size: 10px; line-height: 1; }
.msd-chip-remove:hover { opacity: 1; }
.msd-chip-remove:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 1px; opacity: 1; }
.msd-caret { margin-left: auto; font-size: 10px; color: var(--muted); flex-shrink: 0; }
.msd-overlay { position: fixed; inset: 0; z-index: 40; background: transparent; }
.msd-panel { position: absolute; top: calc(100% + 6px); left: 0; width: 100%; min-width: 220px; max-height: 300px;
             background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
             box-shadow: 0 8px 24px rgba(16,24,40,.15); z-index: 50; display: flex; flex-direction: column; }
.msd-search { padding: 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.msd-search input { margin: 0; }
.msd-options { overflow-y: auto; flex: 1; padding: 4px; }
.msd-option { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px;
              cursor: pointer; font-size:14px; color: var(--text); }
.msd-option:hover { background: var(--input-bg); }
.msd-option.selected { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }
.msd-option.highlighted { background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--accent); }
.msd-option-check { width: 12px; flex-shrink: 0; font-size: 11px; color: var(--accent); }
.msd-option-empty { padding: 12px 8px; text-align: center; font-size:14px; color: var(--muted); }
.msd-options:focus-visible { outline: none; }

/* ── PAGINATION ── */
.pagination-wrap { display: flex; justify-content: flex-end; padding: 10px 12px; }
.pagination { display: inline-flex; align-items: center; gap: 1px; background: var(--panel);
              border: 1px solid var(--border); border-radius: 999px; padding: 3px;
              box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.pagination-nav, .pagination-num { min-width: 22px; height: 22px; padding: 0 5px; border: none;
                                    background: none; border-radius: 50%; font-size: 11.5px; font-weight: 600;
                                    color: var(--text); cursor: pointer; display: flex; align-items: center;
                                    justify-content: center; transition: background .12s, color .12s; }
.pagination-nav { color: var(--muted); font-size: 12.5px; }
.pagination-num:hover, .pagination-nav:hover:not(:disabled) { background: var(--input-bg); }
.pagination-num.active { background: var(--accent-light); color: var(--accent-dark); border: 1px solid var(--accent); }
.pagination-nav:disabled { opacity: .35; cursor: not-allowed; }
.pagination-ellipsis { min-width: 14px; text-align: center; color: var(--muted); font-size: 11px; }

/* ── FILTER PANEL ── */
.filter-toggle-btn { display: flex; align-items: center; gap: 6px; }
.filter-panel { display: flex; flex-direction: column; gap: 16px; }
.filter-panel-row { display: flex; flex-wrap: wrap; gap: 16px; }
.filter-panel-actions { display: flex; gap: 10px; padding-top: 4px; border-top: 1px solid var(--border);
                         position: relative; z-index: 41; }

.notification-item-menu-wrap { position: relative; }
.notification-menu-btn { background: none; border: none; color: var(--muted); font-size: 16px; line-height: 1;
                          cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.notification-menu-btn:hover { background: var(--input-bg); color: var(--text); }
.notification-item-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 110px;
                           background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
                           box-shadow: 0 8px 24px rgba(16,24,40,.15); z-index: 20; overflow: hidden; }
.notification-item-menu-option { padding: 8px 12px; font-size:14px; font-weight: 600; color: var(--danger, #e5484d);
                                  cursor: pointer; }
.notification-item-menu-option:hover { background: var(--input-bg); }

/* ── NOTIFICATIONS PAGE ── */
.notif-header { display: flex; align-items: center; gap: 14px; padding-bottom: 18px;
                margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.notif-header-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-light);
                      color: var(--accent); display: flex; align-items: center; justify-content: center;
                      flex-shrink: 0; }
.notif-header-icon svg { width: 20px; height: 20px; }
.notif-header-text { flex: 1; min-width: 0; }
.notif-header-title { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.25; }
.notif-header-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notif-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.notif-icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
                   background: var(--panel); color: var(--muted); display: flex; align-items: center;
                   justify-content: center; cursor: pointer; transition: background .12s, color .12s; }
.notif-icon-btn:hover { background: var(--input-bg); color: var(--text); }
.notif-icon-btn svg { width: 16px; height: 16px; }

.notif-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
                      color: var(--muted); margin: 18px 0 8px; }
.notif-group-label:first-child { margin-top: 0; }
.notif-list { display: flex; flex-direction: column; gap: 8px; }

.notif-item { position: relative; display: flex; gap: 12px; align-items: flex-start;
              background: var(--input-bg); border: 1px solid var(--border); border-left: 3px solid transparent;
              border-radius: var(--radius); padding: 13px 16px 13px 14px; cursor: pointer;
              transition: box-shadow .12s, border-color .12s, transform .12s; }
.notif-item:hover { box-shadow: 0 4px 14px rgba(16,24,40,.09); transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.notif-item.unread { background: color-mix(in srgb, var(--accent) 6%, var(--panel));
                      border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
                      border-left-color: var(--accent); }
.notif-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
              justify-content: center; flex-shrink: 0; }
.notif-icon svg { width: 16px; height: 16px; }
.notif-body { flex: 1; min-width: 0; }
.notif-row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-item.unread .notif-title { font-weight: 700; }
.notif-meta { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.notif-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.notif-message { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.notif-item.unread .notif-message { color: var(--text); opacity: .85; }
.notif-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }


.notif-empty { text-align: center; padding: 56px 20px; }
.notif-empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--input-bg);
                     color: var(--muted); display: flex; align-items: center; justify-content: center;
                     margin: 0 auto 16px; }
.notif-empty-icon svg { width: 24px; height: 24px; }
.notif-empty h2 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.notif-empty p { font-size: 12.5px; color: var(--muted); }

.breadcrumb { display: none; }
.breadcrumb b { color: var(--text); }
.tabs { display: flex; background: var(--panel); border-bottom: 1px solid var(--border);
        padding: 0 24px; gap: 4px; flex-shrink: 0; user-select: none; }
.tab { padding: 12px 16px; cursor: pointer; font-size:14px; font-weight: 600; color: var(--muted);
        border-bottom: 2px solid transparent; transition: all .12s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { flex: 1; padding: 16px 24px 24px; animation: pageFadeIn .18s ease; }
.tab-content-fill { display: flex; flex-direction: column; }
/* min-height = header (35) + ListPageSize rows (10 × 47) + pagination footer (51), so a grid keeps its full-page height when filtered down to few or no rows */
.table-card-fill { flex: 1 0 auto; display: flex; flex-direction: column; margin-bottom: 0; min-height: 556px; }
.table-card-fill > table { flex-shrink: 0; }
.table-card-footer { margin-top: auto; border-top: 1px solid var(--border); }
.legal-content h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 22px 0 6px; }
.legal-content h3:first-of-type { margin-top: 0; }
.legal-content p { font-size: 13.5px; color: var(--text); line-height: 1.6; margin: 0; }
.legal-content a { color: var(--accent); }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── CONTENT CARD ── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 20px 24px; box-shadow: var(--shadow); margin-bottom: 16px; }

/* ── DATA TABLE (shared list/picker table styling) ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: var(--accent-light); border-bottom: 1px solid var(--border); }
.data-table th { text-align: left; padding: 10px 16px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.data-table td { padding: 10px 16px; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.data-table tbody tr:hover { background: var(--bg); }

.table-scroll { max-height: 400px; overflow-y: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--accent-light); }

/* ── DASHBOARD ── */
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.dash-title { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1100px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-cards { grid-template-columns: 1fr; } }

/* ── BILLING: PLAN GRID ── */
/* Same card design as the landing page's pricing section (.lp-plan in LandingController). */
/* Coverflow: every card sits in the same grid cell (so the stage is as tall as the tallest card)
   and is pushed sideways/shrunk by its distance --off / --abs from the active card. */
.plan-carousel { position: relative; padding: 0 0 8px; border-radius: 18px; outline: none;
                 background: radial-gradient(620px 260px at 50% 45%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.plan-carousel:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.plan-carousel-stage { display: grid; justify-items: center; align-items: center; overflow: hidden; padding: 14px 0 26px;
                       touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.plan-carousel-stage > .plan-card { grid-area: 1 / 1; width: 300px; max-width: calc(100vw - 64px);
    transform: translateX(calc(var(--off) * 58%)) scale(calc(1 - var(--abs) * 0.13));
    z-index: calc(10 - var(--abs)); filter: saturate(calc(1 - var(--abs) * 0.3));
    box-shadow: 0 18px 44px -16px rgba(16,24,40,.35);
    transition: transform .45s cubic-bezier(.22,.8,.26,1), opacity .45s, filter .45s, box-shadow .45s; cursor: pointer; }
/* Cards stay opaque so overlapping text never bleeds through; side cards are dimmed by a tint layer instead. */
.plan-carousel-stage > .plan-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: var(--bg); opacity: calc(var(--abs) * 0.32); transition: opacity .45s; }
.plan-carousel-stage > .plan-card:not(.is-active) > * { pointer-events: none; }
.plan-carousel-stage > .plan-card:not(.is-active):hover::after { opacity: calc(var(--abs) * 0.32 - 0.14); }
.plan-carousel-stage > .plan-card.is-active { cursor: default; box-shadow: 0 28px 60px -18px rgba(14,124,123,.5); }
.plan-carousel-stage > .plan-card[style*="--abs:3"], .plan-carousel-stage > .plan-card[style*="--abs:4"] { opacity: 0; pointer-events: none; }
.plan-carousel-controls { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; }
.plan-carousel-nav { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 999px;
                     background: var(--panel); border: 1px solid var(--border);
                     box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--accent) 55%, transparent); }
.plan-carousel-arrow { width: 22px; height: 22px; padding: 0; border-radius: 6px; cursor: pointer;
                       display: inline-flex; align-items: center; justify-content: center;
                       background: transparent; color: var(--muted); border: none;
                       transition: background .2s, color .2s; }
.plan-carousel-arrow svg { width: 14px; height: 14px; }
.plan-carousel-arrow:hover:not(:disabled) { background: var(--input-bg); color: var(--accent); }
.plan-carousel-arrow:disabled { opacity: .3; cursor: default; }
.plan-carousel-dots { display: flex; align-items: center; gap: 8px; }
.plan-carousel-dot { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: none; cursor: pointer;
                     background: var(--border); transition: width .3s, background .3s, transform .2s, box-shadow .3s; }
.plan-carousel-dot:hover:not(.active) { background: var(--muted); transform: scale(1.25); }
.plan-carousel-dot.active { width: 30px; background: linear-gradient(90deg, var(--accent), var(--accent-dark));
                            box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent),
                                        0 0 14px color-mix(in srgb, var(--accent) 60%, transparent); }
@media (max-width: 640px) {
  .plan-carousel-stage > .plan-card { transform: translateX(calc(var(--off) * 100%)) scale(calc(1 - var(--abs) * 0.1)); }
  .plan-carousel-stage > .plan-card:not(.is-active) { opacity: 0; }
}
.plan-card { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border);
             border-radius: 16px; padding: 24px 20px; }
.plan-card.highlighted { border: 2px solid var(--accent); box-shadow: 0 16px 40px -18px rgba(14,124,123,.45); }
.plan-card.current { border: 2px solid var(--accent); }
.plan-card-badge { position: absolute; top: -12px; left: 24px; background: var(--accent); color: #fff; font-size: 11.5px;
                   font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.plan-card h3 { font-size: 18px; margin: 0; color: var(--text); }
.plan-card-tagline { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.plan-card-price { display: flex; align-items: baseline; gap: 6px; margin: 18px 0; }
.plan-card-amount { font-size: 32px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.plan-card-interval { color: var(--muted); font-size: 14px; }
.plan-card-features { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; flex: 1; font-size: 13.5px; align-content: start; color: var(--text); }
.plan-card-features li { padding-left: 22px; position: relative; }
.plan-card-features li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.plan-card-features li.no { color: var(--muted); text-decoration: line-through; }
.plan-card-features li.no::before { content: "–"; color: var(--muted); }
.plan-card-features b { color: var(--text); }
.plan-card .btn { width: 100%; text-align: center; }
.plan-card .btn:disabled { opacity: .65; filter: none; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
             padding: 14px 16px; box-shadow: var(--shadow); }
.stat-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
             justify-content: center; font-size: 14px; flex-shrink: 0; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 10.5px; color: var(--muted); font-weight: 600;
              text-transform: uppercase; letter-spacing: .4px; }
.stat-trend { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; margin-top: 8px; }
.stat-trend-up { color: var(--green); }
.stat-trend-down { color: var(--red); }
.stat-trend-flat { color: var(--muted); }
.stat-trend-note { color: var(--muted); font-weight: 500; }
.stat-sparkline { display: block; width: 100%; height: 30px; margin-top: 8px; overflow: visible; }

.dash-cols { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }

/* ── ANALYTICS CHARTS ── */
.chart-empty-note { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--input-bg);
                    border: 1px dashed var(--border); color: var(--muted); font-size: 13px; text-align: center; }

.chart-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.chart-header-stat { font-size:14px; color: var(--muted); white-space: nowrap; }
.chart-header-stat b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }

.chart-legend { display: flex; gap: 18px; margin-bottom: 16px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.chart-legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

.trend-chart { display: flex; gap: 10px; }
.trend-axis { display: flex; flex-direction: column; justify-content: space-between; height: 140px;
              padding-bottom: 20px; font-size: 10px; color: var(--muted); text-align: right;
              font-variant-numeric: tabular-nums; flex-shrink: 0; }
.trend-plot { flex: 1; position: relative; min-width: 0; }
.trend-gridlines { position: absolute; top: 0; left: 0; right: 0; height: 140px; padding-bottom: 20px;
                    display: flex; flex-direction: column; justify-content: space-between; box-sizing: border-box; }
.trend-gridline { border-top: 1px solid var(--border); }
.trend-svg { position: absolute; top: 0; left: 0; right: 0; height: 140px; padding-bottom: 20px;
             box-sizing: border-box; overflow: visible; }
.trend-bars { position: relative; height: 140px; display: flex; align-items: stretch; padding-bottom: 20px; box-sizing: border-box; }
.trend-bar-col { flex: 1; position: relative; min-width: 0; cursor: default; border-radius: 3px;
                  transition: background .1s; }
.trend-bar-col:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.trend-day-label { position: absolute; bottom: -19px; left: 50%; transform: translateX(-50%);
                    font-size: 9px; color: var(--muted); white-space: nowrap; }
.trend-tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
                  background: var(--text); color: var(--panel); font-size: 10.5px; font-weight: 600; padding: 6px 10px;
                  border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s;
                  z-index: 5; text-align: center; line-height: 1.5; }
.trend-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
                          border: 5px solid transparent; border-top-color: var(--text); }
.trend-bar-col:hover .trend-tooltip { opacity: 1; }
.trend-marker { position: absolute; left: 50%; width: 8px; height: 8px; border-radius: 50%;
                 border: 2px solid var(--panel); transform: translate(-50%, 50%); box-shadow: 0 1px 2px rgba(16,24,40,.15); }

.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }

.meter-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 5px; }
.meter-sub { font-size:14px; color: var(--muted); margin-bottom: 16px; }
.meter-track { height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--green) 16%, var(--panel)); overflow: hidden; }
.meter-fill { height: 100%; background: var(--green); border-radius: 6px; transition: width .2s; }

.rank-rows { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-label { width: 100px; flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: var(--text);
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { flex: 1; height: 16px; background: var(--input-bg); border-radius: 4px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 4px; min-width: 3px; transition: width .2s; }
.rank-value { width: 32px; flex-shrink: 0; text-align: right; font-size: 11px; font-weight: 700;
              color: var(--muted); font-variant-numeric: tabular-nums; }

.proj-row { display: flex; align-items: center; gap: 14px; padding: 13px 0;
            border-bottom: 1px solid var(--border); }
.proj-row:last-child { border-bottom: none; padding-bottom: 0; }
.proj-avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-light);
               color: var(--accent-dark); font-size: 15px; font-weight: 700; display: flex;
               align-items: center; justify-content: center; flex-shrink: 0; }
.proj-info { flex: 1; min-width: 0; }
.proj-name { font-size:14px; font-weight: 600; display: flex; align-items: center;
             gap: 6px; margin-bottom: 2px; }
.proj-badge { font-size: 9px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
              text-transform: uppercase; letter-spacing: .3px; }
.badge-auth { background: var(--green-light); color: var(--green); }
.proj-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.proj-url  { font-size: 10.5px; color: var(--muted); font-family: monospace;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.recent-tool-row { display: flex; align-items: center; gap: 10px; padding: 10px 0;
                   border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px;
                   transition: background .1s; }
.recent-tool-row:last-child { border-bottom: none; padding-bottom: 0; }
.recent-tool-row:hover { background: var(--bg); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.rtrow-name { font-size:14px; font-weight: 500;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtrow-ctx  { font-size: 11px; color: var(--muted);
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtrow-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── FORM ELEMENTS ── */
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 10px; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; padding-left: 5px; }
input, select, textarea {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 9px 12px; font-size:14px;
  outline: none; font-family: inherit; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
input:disabled, select:disabled, textarea:disabled { color: var(--text); background: var(--panel); cursor: not-allowed; }

/* ── KEYBOARD FOCUS (global fallback; inputs keep their own ring above) ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.pagination-nav:focus-visible, .pagination-num:focus-visible, .theme-toggle:focus-visible,
.sidebar-toggle:focus-visible, .notification-bell:focus-visible, .notification-toast-close:focus-visible,
.modal-close:focus-visible {
    outline-offset: 1px;
}
input[type=checkbox]:disabled, input[type=radio]:disabled { cursor: not-allowed; opacity: .5; }
textarea { resize: vertical; min-height: 60px; }
select option { background: var(--panel); }

/* ── PASSWORD FIELD SHOW/HIDE TOGGLE ── */
.pw-field { position: relative; }
.pw-field input { padding-right: 38px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
             background: none; border: none; cursor: pointer; padding: 6px; line-height: 1;
             font-size: 14px; color: var(--muted); border-radius: 6px; }
.pw-toggle:hover { color: var(--text); }

/* ── SECTION HEADINGS ── */
.section-heading { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
                    letter-spacing: .8px; margin: 20px 0 12px; display: flex; align-items: center; gap: 8px; user-select: none; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── PARAMETER TABLE ── */
.param-table { width: 100%; border-collapse: collapse; font-size:14px; }
.param-table th { text-align: left; padding: 6px 8px; color: var(--muted); font-size: 10px;
                  font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.param-table td { padding: 6px 4px; vertical-align: top; border-bottom: 1px solid var(--border); }
.param-table input, .param-table select { padding: 6px 9px; font-size:14px; }
.param-table .req-cell { text-align: center; padding: 8px 4px; }
.param-table input[type=checkbox] { width: auto; }
.btn-del { background: none; border: 1px solid var(--border); border-radius: 7px;
           color: var(--muted); cursor: pointer; padding: 5px 10px; font-size: 11px; }
.btn-del:hover { border-color: var(--red); color: var(--red); }
.btn-add { background: none; border: 1px dashed var(--border); border-radius: 9px;
           color: var(--muted); cursor: pointer; padding: 9px 14px; font-size:14px; font-weight: 600;
           width: 100%; margin-top: 8px; transition: all .12s; }
.btn-add:hover { border-color: var(--accent); color: var(--accent); }

/* ── HEADER TABLE ── */
.kv-table { width: 100%; border-collapse: collapse; font-size:14px; }
.kv-table td { padding: 4px 4px; }
.kv-table input { padding: 6px 9px; font-size:14px; }

/* ── ACTION BUTTONS ── */
.actions { display: flex; gap: 10px; margin-top: 22px; }
.btn { padding: 9px 20px; border-radius: 9px; cursor: pointer; font-size:14px;
        font-weight: 600; border: none; transition: opacity .12s, background .12s; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(60%); pointer-events: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger  { background: var(--red); color: #fff; border: none; }
.btn-danger:hover { background: #d83b4c; }
.btn-secondary { background: none; border: 1px solid var(--accent); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-light); }

/* ── REQUEST BAR (Postman-style method + url + send) ── */
.request-bar { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-end; }
.request-field { display: flex; flex-direction: column; }
.request-field.method-field { flex-shrink: 0; }
.request-field.url-field { flex: 1; min-width: 0; }
.method-select { width: 110px; flex-shrink: 0; }
.btn-send { padding: 9px 20px; background: var(--accent); color: #fff; border: none;
            border-radius: 9px; cursor: pointer; font-weight: 700; font-size:14px;
            transition: background .12s; }
.btn-send:hover { background: var(--accent-dark); }
.btn-send:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) {
    .request-bar { flex-wrap: wrap; }
    .request-bar .url-field { order: 3; flex: 1 1 100%; }
}

/* ── REQUEST SUB-TABS (Postman-style: Params / Authorization / Headers / Body) ── */
.request-subtabs { display: flex; gap: 4px; margin: 18px 0 14px; border-bottom: 1px solid var(--border); }
.request-subtab { padding: 8px 14px; cursor: pointer; font-size: 11.5px; font-weight: 700; color: var(--muted);
                   border-bottom: 2px solid transparent; transition: all .12s; }
.request-subtab:hover { color: var(--text); }
.request-subtab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── NEW MCP SERVER WIZARD ── */
.wizard-layout { display: flex; gap: 24px; align-items: flex-start; }
.wizard-steps { display: flex; flex-direction: column; gap: 2px; width: 180px; flex-shrink: 0;
                background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.wizard-step-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
                     font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.wizard-step-item:hover { background: var(--bg); }
.wizard-step-item.active { background: var(--accent-light); color: var(--accent-dark); }
.wizard-step-item.done { color: var(--text); }
.wizard-step-num { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px;
                    border-radius: 50%; background: var(--border); color: var(--text); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.wizard-step-item.active .wizard-step-num { background: var(--accent); color: #fff; }
.wizard-step-item.done .wizard-step-num { background: var(--accent-light); color: var(--accent-dark); }
.wizard-content { flex: 1; min-width: 0; }
@media (max-width: 800px) {
    .wizard-layout { flex-direction: column; }
    .wizard-steps { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

/* ── REQUEST SETTINGS TAB (Postman-style) ── */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px;
                 padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size:14px; font-weight: 700; color: var(--text); }
.settings-desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; max-width: 480px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; padding-left: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; cursor: pointer; background: var(--border);
                  border-radius: 22px; transition: background .15s; }
.switch-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
                          background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }
.switch input:disabled + .switch-slider { opacity: .5; cursor: default; }

/* ── RESPONSE ── */
.response-panel { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.response-header { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
                    background: var(--input-bg); border-bottom: 1px solid var(--border); }
.status-badge { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.status-2xx { background: var(--green-light); color: var(--green); }
.status-4xx { background: var(--red-light); color: var(--red); }
.status-5xx { background: var(--yellow-light); color: var(--yellow); }
.elapsed { font-size: 11px; color: var(--muted); }
.response-body { background: var(--input-bg); padding: 14px; overflow: auto; max-height: 380px;
                  font-family: 'Courier New', monospace; font-size:14px; white-space: pre; line-height: 1.6; }

/* ── MCP INFO ── */
.mcp-url-box { background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius);
                padding: 12px 16px; font-family: monospace; font-size:14px; display: flex;
                align-items: center; gap: 10px; margin-bottom: 18px; }
.mcp-url-box .url { flex: 1; color: var(--accent-dark); font-weight: 600; }
.btn-copy { padding: 5px 12px; background: var(--panel); color: var(--accent-dark);
            border: 1px solid var(--border); border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; }
.btn-copy:hover { border-color: var(--accent); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

.plan-expired-block { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding: 20px; }
.plan-expired-card { max-width: 420px; text-align: center; background: var(--panel); border: 1px solid var(--border);
                      border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 32px; }
.plan-expired-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
                      margin: 0 auto 16px; background: color-mix(in srgb, var(--red) 15%, var(--panel)); color: var(--red); }
.plan-expired-card h2 { font-size: 19px; margin-bottom: 8px; color: var(--text); }
.plan-expired-card p { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.plan-expired-actions { display: flex; flex-direction: column; gap: 10px; }

.info-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
             padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.info-card h3 { font-size:14px; margin-bottom: 10px; color: var(--accent-dark); }
.info-card p { color: var(--muted); font-size:14px; line-height: 1.6; }
.code-block { background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: 9px;
                padding: 14px 16px; font-family: monospace; font-size:14px; white-space: pre;
                overflow-x: auto; margin-top: 10px; line-height: 1.6; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tool-chip { padding: 6px 12px; background: var(--accent-light); border-radius: 8px; font-size: 11px;
             color: var(--accent-dark); font-family: monospace; font-weight: 600; }

/* ── GUIDE STEP SCREENSHOTS ── */
/* Admin-uploaded per-step screenshots, stored in the DB and rendered via GuideScreenshotSlot.razor. */
.guide-screenshot-row { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.guide-screenshot-placeholder { position: relative; flex: 1; min-width: 140px; border: 1px dashed var(--border);
             border-radius: 8px; background: var(--input-bg); color: var(--muted); font-size: 11px;
             padding: 26px 10px; text-align: center; }
.guide-screenshot-placeholder img { display: block; max-width: 100%; border-radius: 6px; margin: 0 auto; }
.guide-screenshot-placeholder.has-image { padding: 0; border-style: solid; overflow: hidden; }
.guide-screenshot-admin-bar { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.guide-screenshot-admin-bar .btn-copy { display: inline-flex; align-items: center; justify-content: center;
             min-width: 68px; height: 26px; padding: 0 10px; box-sizing: border-box; margin: 0; }
.guide-screenshot-placeholder.has-image .guide-screenshot-admin-bar { position: absolute; bottom: 0; left: 0; right: 0;
             margin-top: 0; background: rgba(0,0,0,.55); padding: 6px; }
.guide-screenshot-placeholder.has-image .guide-screenshot-admin-bar .btn-copy { background: var(--accent); color: #fff; border-color: var(--accent); }
.guide-screenshot-placeholder.has-image .guide-screenshot-admin-bar .btn-copy:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.guide-screenshot-lightbox { position: fixed; inset: 0; background: rgba(15,17,23,.85); z-index: 2000;
             display: flex; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; }
.guide-screenshot-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px;
             box-shadow: 0 20px 50px rgba(0,0,0,.5); cursor: default; }
.guide-screenshot-lightbox-close { position: fixed; top: 20px; right: 24px; width: 36px; height: 36px;
             border-radius: 50%; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 16px;
             cursor: pointer; }
.guide-screenshot-lightbox-close:hover { background: rgba(255,255,255,.28); }
.gg-overlay { gap: 16px; padding: 40px 24px; animation: pageFadeIn .15s ease; }
.gg-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px;
             max-width: min(1200px, calc(100vw - 150px)); max-height: 100%; min-width: 0; }
.gg-figure img { max-height: calc(100vh - 140px); object-fit: contain; }
.gg-figure figcaption { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13.5px; text-align: center; }
.gg-counter { background: rgba(255,255,255,.15); padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.gg-counter:empty { display: none; }
.gg-nav { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: none; cursor: pointer;
          background: rgba(255,255,255,.15); color: #fff; font-size: 30px; line-height: 1; padding-bottom: 4px;
          display: flex; align-items: center; justify-content: center; transition: background .12s, transform .12s; }
.gg-nav:hover { background: rgba(255,255,255,.3); transform: scale(1.06); }
.gg-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .gg-overlay { padding: 56px 8px 24px; }
  .gg-figure { max-width: 100%; }
  .gg-nav { position: fixed; bottom: 20px; width: 44px; height: 44px; }
  .gg-prev { left: calc(50% - 56px); }
  .gg-next { right: calc(50% - 56px); }
}

/* ── MCP LOG DETAIL ── */
.log-detail-title { font-family: monospace; }
.log-detail-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
                    box-shadow: var(--shadow); overflow: hidden; }
.log-detail-section { padding: 20px 24px; }
.log-detail-section + .log-detail-section { border-top: 1px solid var(--border); }
.log-detail-section .section-heading { margin-top: 0; }
.log-detail-tool-name { padding: 2px 8px; background: var(--accent-light); border-radius: 6px;
             color: var(--accent-dark); font-family: monospace; font-weight: 600; }
.log-detail-title-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; width: 100%; margin-bottom: 6px; }
.log-detail-meta { color: var(--muted); font-size:14px; line-height: 1.5; }
.callout-error { background: color-mix(in srgb, var(--red) 10%, var(--panel)); border: 1px solid var(--red);
                  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; color: var(--red);
                  font-size:14px; line-height: 1.6; }
.callout-info { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1px solid var(--accent);
                  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; color: var(--text);
                  font-size:14px; line-height: 1.6; display: flex; align-items: center; justify-content: space-between;
                  gap: 12px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.detail-item label { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted);
                      text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.detail-item .value { font-size:14px; color: var(--text); word-break: break-word; line-height: 1.5; }
.detail-item .value.mono { font-family: monospace; font-size:14px; }
.block-label { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted);
               text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; padding-left: 0; }
.block-label:first-child { margin-top: 0; }

.group-list-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
                    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
                    margin-bottom: 8px; }
.group-list-item .gname { flex: 1; font-size:14px; font-weight: 600; }
.group-list-item .gcount { font-size: 11px; color: var(--muted); }

/* ── PROFILE MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(31,35,48,.4);
                  display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal-card { background: var(--panel); border-radius: var(--radius); box-shadow: 0 20px 40px rgba(31,35,48,.18);
              width: 380px; max-width: calc(100vw - 32px); padding: 28px; }
.modal-card-wide { width: 640px; max-width: calc(100vw - 40px); padding: 20px 24px; }
.modal-card h2 { font-size: 16px; margin: 0; color: var(--text); }
.modal-card p.muted { color: var(--muted); font-size:14px; margin: 6px 0 18px; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; line-height: 1;
               padding: 6px; margin: -6px -6px 0 0; border-radius: 50%; flex-shrink: 0;
               display: flex; align-items: center; justify-content: center;
               transition: background .15s ease, color .15s ease; }
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover { color: var(--text); background: var(--input-bg); }
/* ── VALIDATION MESSAGES (error / success / warning banners) ── */
.error-text, .success-text, .warning-text {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 13px; font-weight: 600; line-height: 1.5;
    margin-top: 10px; padding: 9px 12px; border-radius: 8px; border: 1px solid;
}
.error-text::before, .success-text::before, .warning-text::before {
    flex-shrink: 0; font-weight: 700; line-height: 1.5;
}
.error-text { color: var(--red); background: var(--red-light); border-color: var(--red); }
.error-text::before { content: "✕"; }
.success-text { color: var(--green); background: var(--green-light); border-color: var(--green); }
.success-text::before { content: "✓"; }
.warning-text { color: var(--yellow); background: var(--yellow-light); border-color: var(--yellow); }
.warning-text::before { content: "⚠"; }

/* ── CONFIRM DIALOG ── */
.confirm-card { width: 360px; max-width: calc(100vw - 32px); text-align: center; }
.confirm-icon { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%;
                background: var(--red-light); color: var(--red); font-size: 22px; font-weight: 700;
                display: flex; align-items: center; justify-content: center; }
.confirm-icon-success { background: var(--green-light); color: var(--green); }
.confirm-icon-warning { background: var(--yellow-light); color: var(--yellow); }
.confirm-icon-neutral { background: var(--accent-light); color: var(--accent-dark); }
.confirm-card h2 { text-align: center; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #d83b4c; }

/* ── API SUMMARY PAGE (endpoint-mcp tab) ── */
.api-summary-success { display:flex; align-items:center; gap:14px; padding:14px 18px;
                        background:var(--accent-light); border:1px solid var(--border);
                        border-radius:var(--radius); margin-bottom:22px; }
.api-summary-request { display:flex; align-items:center; gap:10px; padding:12px 16px;
                         background:var(--input-bg); border:1px solid var(--border);
                         border-radius:var(--radius); margin-bottom:14px; }
.api-summary-url { font-size:14px; color:var(--accent-dark); word-break:break-all; font-family:monospace; }
.api-summary-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px;
                     background:var(--panel); border:1px solid var(--border);
                     border-radius:var(--radius); padding:16px 18px; margin-bottom:4px; }
.api-summary-label { font-size:10px; color:var(--muted); font-weight:700;
                      text-transform:uppercase; letter-spacing:.6px; margin-bottom:5px; }
.type-pill { display:inline-block; padding:2px 7px; background:#e8f0fe; color:#3b73e0;
             border-radius:5px; font-size:10px; font-weight:700; font-family:monospace; }
.location-pill { display:inline-block; padding:2px 7px; background:var(--input-bg);
                  color:var(--muted); border-radius:5px; font-size:10px; font-weight:700;
                  border:1px solid var(--border); }

/* ── CONNECT GUIDE (how to use the MCP endpoint) ── */
.connect-card { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius);
                padding:18px; margin-bottom:12px; box-shadow:var(--shadow); }
.connect-card-header { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.connect-card-icon { width:34px; height:34px; border-radius:9px; background:var(--accent-light);
                      display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.connect-card h3 { font-size:14px; font-weight:700; color:var(--text); margin:0; }
.connect-card p { color:var(--muted); font-size:14px; line-height:1.6; margin-bottom:10px; }
.connect-card p:last-child { margin-bottom:0; }
.path-badge { display:inline-flex; align-items:center; gap:5px; padding:4px 10px;
              background:var(--input-bg); border:1px solid var(--border); border-radius:6px;
              font-size:10.5px; font-family:monospace; color:var(--muted); margin:0 4px 6px 0; }
.path-badge b { color:var(--text); font-weight:600; }
.step-list { list-style:none; margin:0 0 10px; padding:0; display:flex; flex-direction:column; gap:6px; }
.step-list li { display:flex; align-items:flex-start; gap:10px; font-size:14px; color:var(--muted); line-height:1.5; }
.step-num { width:20px; height:20px; border-radius:50%; background:var(--accent); color:#fff;
             font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; }

/* ── THEME TOGGLE (topbar) ── */
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
                border-radius: 50%; border: 1px solid var(--border); background: none; color: var(--muted);
                cursor: pointer; font-size: 15px; transition: background .12s, color .12s; flex-shrink: 0; }
.theme-toggle:hover { background: var(--bg); color: var(--text); }
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }

/* ── PROFILE TRIGGER (topbar) ── */
.profile-trigger { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px;
                    border-radius: 22px; cursor: pointer; transition: background .12s; user-select: none; }
.profile-trigger:hover { background: var(--bg); }
.profile-trigger .name { font-size:14px; font-weight: 600; color: var(--text); }
.plan-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
               text-transform: uppercase; letter-spacing: .3px; line-height: 1.5; }
.plan-badge-free { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.plan-badge-paid { background: var(--accent-light); color: var(--accent-dark); }
.avatar-circle { display: flex; align-items: center; justify-content: center; flex-shrink: 0;
                  border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-dark));
                  color: #fff; font-weight: 700; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; box-shadow: 0 4px 10px rgba(108,92,231,.3); }

/* ── PROFILE MODAL (specific) ── */
.profile-modal-card { width: 400px; max-width: calc(100vw - 32px); position: relative; padding: 22px 24px; }
.profile-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.profile-header h2 { font-size: 15px; margin-bottom: 2px; color: var(--text); }
.profile-header p.muted { margin: 0 0 6px; font-size: 11px; }
.profile-since-badge { display: inline-block; font-size: 9.5px; font-weight: 700; color: var(--accent-dark);
                        background: var(--accent-light); padding: 2px 9px; border-radius: 20px; letter-spacing: .2px; }
.profile-section { background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px;
                    padding: 14px 16px 12px; margin-bottom: 10px; }
:root:not([data-theme="dark"]) .profile-page .profile-section { background: var(--panel); }
.profile-section .section-heading { margin-top: 0; margin-bottom: 10px; }
.profile-section .form-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.profile-section .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) {
    .form-row, .form-row-3, .api-summary-grid,
    .profile-section .form-grid, .profile-section .form-grid.cols-3 {
        grid-template-columns: 1fr;
    }
}
.profile-section label { margin-bottom: 4px; }
.profile-section input { padding: 7px 10px; font-size:14px; }
.profile-section .actions { margin-top: 10px; }
.profile-section .actions .btn { padding: 7px 16px; font-size:14px; }
.profile-modal-card .avatar-lg { width: 44px; height: 44px; font-size: 16px; }

.picture-card { display: flex; flex-direction: column; align-items: center; text-align: center;
                border: 2px dashed transparent; border-radius: var(--radius); padding: 10px; transition: border-color .15s, background-color .15s; }
.picture-card-dragover { border-color: var(--accent); background: var(--accent-light); }
.picture-avatar-wrap { position: relative; width: 64px; height: 64px; cursor: pointer; display: block; padding-left: 0; }
.picture-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block;
                   border: 1px solid var(--border); }
.picture-avatar-empty { display: flex; align-items: center; justify-content: center;
                         background: var(--bg); color: var(--muted); }
.picture-avatar-empty svg { width: 24px; height: 24px; }
.picture-avatar-badge { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px;
                         border-radius: 50%; background: var(--accent); border: 2px solid var(--panel);
                         display: flex; align-items: center; justify-content: center; }
.picture-avatar-badge svg { width: 10px; height: 10px; }
.picture-caption { font-size: 11.5px; color: var(--muted); margin: 10px 0 16px; }
.picture-actions { display: flex; align-items: center; gap: 12px; }
.picture-upload-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.btn-link-danger { background: none; border: none; padding: 0; color: var(--red); font-size: 12px;
                    font-weight: 600; cursor: pointer; }
.btn-link-danger:hover { text-decoration: underline; }

.file-dropzone { position: relative; display: flex; flex-direction: column; align-items: center;
                  justify-content: center; gap: 6px; padding: 32px 20px; border: 2px dashed var(--border);
                  border-radius: var(--radius); background: var(--bg); text-align: center; cursor: pointer;
                  transition: border-color .15s, background .15s; }
.file-dropzone:hover { border-color: var(--accent); background: var(--accent-light); }
.file-dropzone.disabled { opacity: .6; pointer-events: none; }
.file-dropzone-icon { color: var(--accent); }
.file-dropzone-text { font-size: 14px; font-weight: 600; color: var(--text); }
.file-dropzone-text span { color: var(--accent); }
.file-dropzone-sub { font-size: 12px; color: var(--muted); }
.file-dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.picture-progress-track { width: 100%; max-width: 220px; height: 4px; border-radius: 99px;
                           background: var(--border); overflow: hidden; margin-top: 12px;
                           opacity: 0; transition: opacity .15s; }
.picture-progress-track.show { opacity: 1; }
.picture-progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 99px;
                          transition: width .4s ease; }
.picture-progress-track.show .picture-progress-fill { width: 100%; }
.profile-modal-card > .actions { margin-top: 6px; }

/* ── SUPPORT QUESTIONS ── */
.qa-nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent);
                color: #fff; font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
html[data-sidebar="collapsed"] .sidebar .qa-nav-count { display: none; }
.qa-counter { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.qa-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.qa-filter { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: var(--input-bg); gap: 2px; }
.qa-filter button { border: none; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
                    padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.qa-filter button:hover { color: var(--text); }
.qa-filter button.active { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.qa-search { max-width: 280px; flex: 1 1 200px; }
.qa-search-group { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 380px; margin: 0; }
.qa-search-group .qa-search { max-width: none; }
.qa-list { display: flex; flex-direction: column; gap: 12px; }
.qa-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--panel); }
.qa-item.unanswered { border-left: 3px solid var(--yellow); }
.qa-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.qa-tags { display: flex; gap: 6px; flex-shrink: 0; }
.qa-pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--input-bg);
           border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.qa-status { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.qa-status.open { background: color-mix(in srgb, var(--yellow) 16%, var(--panel)); color: var(--yellow); }
.qa-status.answered { background: color-mix(in srgb, var(--green) 16%, var(--panel)); color: var(--green); }
.qa-subject { font-size: 14.5px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.qa-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qa-message { font-size: 13.5px; color: var(--text); margin-top: 6px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.qa-asker { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qa-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-light); color: var(--accent-dark);
             font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-asker-name { font-size: 14px; font-weight: 700; color: var(--text); }
.qa-asker-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-when { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.qa-when svg { width: 14px; height: 14px; flex-shrink: 0; }
.qa-when b { color: var(--text); font-weight: 600; }
.qa-answer { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, var(--panel));
             border-left: 3px solid var(--accent); }
.qa-answer-head { font-size: 12px; font-weight: 600; color: var(--accent); }
.qa-answer .qa-message { margin-top: 4px; }
.qa-reply-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* ── SUPPORT TICKETS ── */
.ticket-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ticket-table td { font-size: 14px; vertical-align: middle; }
.ticket-table th { white-space: nowrap; }
.ticket-subject-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.ticket-subject { font-weight: 600; color: var(--text); }
.ticket-desc { color: var(--muted); min-width: 200px; }
.ticket-date { color: var(--muted); white-space: nowrap; font-size: 13px !important; }
.ticket-clip { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--muted); vertical-align: middle; }
.ticket-status { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.ticket-status.open { background: var(--yellow-light); color: var(--yellow); }
.ticket-status.in-progress { background: color-mix(in srgb, var(--blue) 14%, var(--panel)); color: var(--blue); }
.ticket-status.resolved { background: var(--green-light); color: var(--green); }
.ticket-status.closed { background: var(--input-bg); color: var(--muted); border: 1px solid var(--border); }
.ticket-status.expired { background: var(--red-light); color: var(--red); }

/* ── ADMIN BILLING ── */
.billing-kpi-value { font-size: 18px; overflow-wrap: anywhere; }
.billing-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.billing-select { width: auto; min-width: 130px; }
.billing-date-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; margin: 0; }
.billing-date-field input { width: auto; }
.billing-table td { font-size: 14px; color: var(--text); vertical-align: middle; }
.billing-user-name { font-weight: 600; white-space: nowrap; }
.billing-user-email { font-size: 12.5px; color: var(--muted); }
.billing-date { white-space: nowrap; color: var(--muted); }
.billing-warn { color: var(--yellow); font-weight: 600; }
.billing-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.billing-mono { font-family: monospace; font-size: 13px; white-space: nowrap; }
.billing-note { font-size: 11.5px; color: var(--yellow); font-weight: 600; margin-top: 3px; }
.billing-muted { color: var(--muted); font-weight: 500; }
.billing-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .billing-detail-grid { grid-template-columns: 1fr; } }
.billing-facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: 14px; }
.billing-facts dt { color: var(--muted); font-weight: 600; }
.billing-facts dd { margin: 0; color: var(--text); }
.billing-usage { display: flex; flex-direction: column; gap: 14px; }
.billing-usage-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.billing-usage .rank-track { height: 10px; }
.billing-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.billing-event { --dot: var(--muted); position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); }
.billing-event:last-child { border-left-color: transparent; padding-bottom: 0; }
.billing-event::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%;
                          background: var(--dot); box-shadow: 0 0 0 3px var(--panel); }
.billing-event-payment, .billing-event-upgrade { --dot: var(--green); }
.billing-event-renew, .billing-event-trial { --dot: var(--blue); }
.billing-event-downgrade, .billing-event-cancel { --dot: var(--yellow); }
.billing-event-ended { --dot: var(--red); }
.billing-event-title { font-size: 14px; font-weight: 600; color: var(--text); }
.billing-event-detail { font-size: 13px; color: var(--muted); margin-top: 2px; }
.billing-event-date { font-size: 12px; color: var(--muted); margin-top: 2px; }
.billing-event-failed { --dot: var(--red); }
.billing-event-refund { --dot: var(--yellow); }
.billing-event-admin { --dot: var(--accent); }
.billing-refunded { font-size: 11.5px; font-weight: 600; color: var(--yellow); margin-top: 2px; }
.billing-reason { font-size: 13px; color: var(--muted); max-width: 260px; }
.billing-chart-card { margin-bottom: 14px; }
.billing-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.billing-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 170px; margin-top: 16px; }
.billing-chart-col { display: flex; flex-direction: column; min-width: 0; }
.billing-chart-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.billing-chart-bar { width: 42%; max-width: 22px; background: var(--green); border-radius: 4px 4px 0 0; }
.billing-chart-bar.refund { background: var(--yellow); }
.billing-chart-label { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.billing-chart-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.billing-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.billing-chart-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--green); }
.billing-chart-swatch.refund { background: var(--yellow); }
.billing-actions { display: flex; flex-direction: column; gap: 10px; }
.billing-action { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
.billing-days { width: 80px; }
.billing-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); font-size: 14px; color: var(--text); }
.billing-confirm span { flex: 1; min-width: 200px; }
.billing-grant-msg { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--green); }
.billing-grant-msg.error { color: var(--red); }
.ticket-optional { font-weight: 400; color: var(--muted); }
.file-dropzone.dragover { border-color: var(--accent); background: var(--accent-light); }
.ticket-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ticket-files li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); }
.ticket-files li.removed .ticket-file-name { text-decoration: line-through; color: var(--muted); }
.ticket-file-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ticket-file-name { color: var(--accent); text-decoration: none; }
a.ticket-file-name:hover { text-decoration: underline; }
.ticket-file-size { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ticket-staff-tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-light); color: var(--accent-dark); }
@media (max-width: 640px) {
  .qa-search, .qa-search-group { max-width: none; }
  .qa-filter { width: 100%; }
  .qa-filter button { flex: 1; padding: 6px 4px; }
}
.qa-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.qa-actions .btn { padding: 5px 12px; font-size: 13px; }

/* ── HELP PAGE ── */
.help-page { max-width: 1000px; }
.help-alerts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.help-alerts > div { margin-bottom: 0 !important; }
@media (max-width: 900px) { .help-alerts { grid-template-columns: 1fr; } }

/* ── SETTINGS PAGE ── */
.set-section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px;
                     margin: 22px 2px 8px; }
.set-section-label:first-of-type { margin-top: 4px; }
.set-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-light); color: var(--accent);
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.set-icon svg { width: 18px; height: 18px; }
.set-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.set-list > .set-row:first-child { border-top: none; padding-top: 0; }
.set-list > .set-row:last-child { padding-bottom: 0; }
.set-row-title { font-size: 14px; font-weight: 600; color: var(--text); }
.set-row-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.set-row-sub b { color: var(--text); font-weight: 600; }
.set-row-btn { flex-shrink: 0; padding: 6px 14px; font-size: 13px; }
.set-app-avatar { width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--blue) 14%, var(--panel));
                  color: var(--blue); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.set-empty { font-size: 13px; color: var(--muted); padding: 14px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
@media (max-width: 640px) {
  .set-row { flex-wrap: wrap; }
  .set-row-btn { margin-left: 50px; }
}

/* ── ADMIN DASHBOARD ── */
.admin-hero { flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.admin-hero-actions { display: flex; gap: 8px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.admin-panel { margin-bottom: 0; display: flex; flex-direction: column; }
.admin-panel-body { flex: 1; display: flex; flex-direction: column; justify-content: center; margin-top: 14px; }
.admin-panel-body.rank-rows { gap: 14px; }
.admin-card-flush { padding: 0; margin-bottom: 0; overflow: hidden; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.admin-card-head .section-heading { flex: 1; }
.admin-card-foot { display: flex; justify-content: right; padding: 12px 20px; border-top: 1px solid var(--border); }
.admin-empty { padding: 28px 20px; text-align: center; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--border); }
.admin-table th, .admin-table td { padding: 10px 20px; }
.admin-table td { font-size: 13.5px; vertical-align: middle; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.admin-avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.admin-role { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--input-bg); color: var(--muted); border: 1px solid var(--border); }
.admin-role.admin { background: var(--accent-light); color: var(--accent-dark); border-color: transparent; }
.admin-bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.admin-bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.admin-bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; transition: opacity .12s; }
.admin-bar-col:hover .admin-bar { opacity: 1; }
.admin-bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .admin-hero-actions { width: 100%; }
  .admin-hero-actions .btn { flex: 1; }
}
/* ── SUPPORT TICKET CHAT ── */
.chat-scroll { min-height: 320px; background: var(--panel); }
.chat-thread { display: flex; flex-direction: column; gap: 40px; padding: 40px 40px 36px; }
.chat-msg { display: flex; align-items: flex-start; gap: 14px; max-width: 72%; }
.chat-msg.staff, .chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.staff .qa-avatar, .chat-msg.support .qa-avatar { background: var(--accent); color: #fff; }
.chat-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chat-msg.staff .chat-body, .chat-msg.mine .chat-body { align-items: flex-end; }
.chat-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chat-meta b { color: var(--text); font-weight: 600; }
.chat-bubble { padding: 16px 20px; border-radius: 18px 18px 18px 6px; background: color-mix(in srgb, var(--text) 2.5%, var(--panel)); border: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.chat-bubble .qa-message { margin-top: 0; font-size: 14.5px; line-height: 1.65; }
.chat-msg.staff .chat-bubble, .chat-msg.mine .chat-bubble { border-radius: 18px 18px 6px 18px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 12%, transparent); }
.chat-bubble .ticket-files { margin-top: 10px; }
.ticket-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ticket-image { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--input-bg); line-height: 0; transition: box-shadow .15s; }
.ticket-image:hover { box-shadow: var(--shadow); }
.ticket-image img { display: block; max-width: 280px; max-height: 220px; width: auto; height: auto; object-fit: contain; }
@media (max-width: 640px) { .ticket-image img { max-width: 100%; } }
.chat-system { align-self: center; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.chat-composer { display: flex; flex-direction: column; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--border); background: var(--panel); }
.chat-composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.chat-composer-resolved { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.chat-system b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .chat-msg { max-width: 100%; } .chat-thread { padding: 24px 16px; gap: 28px; } }
.ticket-detail-card { padding: 0; overflow: hidden; margin-bottom: 0; }
.ticket-back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 4px 0; margin-bottom: 14px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: color .15s; }
.ticket-back-arrow { display: inline-block; transition: transform .15s; }
.ticket-back-link:hover { color: var(--accent); }
.ticket-back-link:hover .ticket-back-arrow { transform: translateX(-3px); }
.ticket-hero-nav { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ticket-hero-nav .ticket-back-link { margin-bottom: 0; }
.ticket-hero-actions { display: flex; gap: 8px; }
.ticket-hero-actions .btn { padding: 5px 12px; font-size: 13px; }
.ticket-detail-card { border-radius: 14px; }
.ticket-detail-hero { position: relative; padding: 20px 32px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--panel)) 0%, var(--panel) 55%); }
.ticket-detail-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.ticket-detail-hero .ticket-back-link { margin-bottom: 16px; }
.ticket-detail-toprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-detail-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--accent-dark); background: var(--accent-light); padding: 3px 9px; border-radius: 6px; }
.ticket-detail-hero .ticket-status { font-size: 12px; padding: 4px 12px; }
.ticket-status-dot { display: inline-flex; align-items: center; gap: 7px; }
.ticket-status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.ticket-detail-subject { font-size: 22px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; color: var(--text); margin: 14px 0 12px; overflow-wrap: anywhere; }
.ticket-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.ticket-detail-asker { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.ticket-meta-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); opacity: .6; }
@media (max-width: 640px) { .ticket-detail-hero { padding: 16px 16px 18px; } .ticket-detail-subject { font-size: 19px; } }
