/* Authenticated customer workspace. Public pages and the admin shell keep their styles. */
body.user-panel {
  --up-bg: #f6faff;
  --up-card: #ffffff;
  --up-soft: #edf5ff;
  --up-ink: #0b1746;
  --up-muted: #5b7198;
  --up-line: #e0e9f6;
  --up-blue: #075bff;
  --up-dark: #12326a;
  --up-shadow: 0 8px 28px #244e8507;
  --bg: var(--up-bg);
  --sidebar: var(--up-bg);
  --surface: var(--up-soft);
  --hover: #e7f0ff;
  --text: var(--up-ink);
  --muted: var(--up-muted);
  --line: var(--up-line);
  --accent: var(--up-blue);
  --danger: #b12642;
  --success: #0a8056;
  --shadow: 0 16px 50px #183d6b14;
  background: var(--up-bg);
  color: var(--up-ink);
}
:root[data-theme=dark] body.user-panel {
  --up-bg: #101b30;
  --up-card: #17263f;
  --up-soft: #203451;
  --up-ink: #eff5ff;
  --up-muted: #b1c4e1;
  --up-line: #344b6a;
  --up-blue: #8dbbff;
  --up-dark: #17458d;
  --hover: #294261;
  --danger: #ffb2bd;
  --success: #8ee4c1;
  --shadow: 0 16px 50px #0003;
  color-scheme: dark;
}
body.user-panel #shell {
  --chat-bg: var(--up-bg);
  --chat-card: var(--up-card);
  --chat-ink: var(--up-ink);
  --chat-muted: var(--up-muted);
  --chat-line: var(--up-line);
  --chat-blue: var(--up-blue);
  --chat-user: var(--up-soft);
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(0, 1fr) clamp(286px, 23vw, 390px);
  grid-template-rows: 80px minmax(0, 1fr);
  grid-template-areas: "topbar topbar" "content sidebar";
  width: 100%;
  height: 100dvh;
  min-height: 320px;
  overflow: hidden;
}
body.user-panel #app-header {
  grid-area: topbar;
  direction: rtl;
  height: 80px;
  min-width: 0;
  padding: 12px 30px;
  gap: 20px;
  background: var(--up-card);
  border-bottom: 1px solid var(--up-line);
  z-index: 5;
}
body.user-panel a {text-decoration:none}
body.user-panel .header-title {display:flex;align-items:center;gap:14px;white-space:nowrap;font-size:21px;color:var(--up-ink)}
body.user-panel .header-title img, body.user-panel .header-cube {width:36px;height:40px;object-fit:contain}
body.user-panel .header-cube .ui-icon {width:36px;height:36px}
body.user-panel .header-profile {display:flex;margin-inline-start:auto;align-items:center;gap:12px}
body.user-panel .header-profile-button {display:flex;align-items:center;gap:12px;min-height:44px;font-size:14px;text-align:start}
body.user-panel .header-profile-button .avatar {width:44px;height:44px;background:var(--up-soft);color:var(--up-ink)}
body.user-panel .header-profile-button small {display:block;margin-top:3px;font-size:12px}
body.user-panel .header-profile-button .ui-icon {width:21px;height:21px}
body.user-panel .header-divider {height:28px;width:1px;background:var(--up-line)}
body.user-panel .header-account, body.user-panel .header-profile .unavailable-control {display:none}
body.user-panel .header-entitlements {display:flex;align-items:center;gap:16px;margin-inline-start:auto;min-width:0;font-size:12px}
body.user-panel #header-plan {color:var(--up-blue);background:var(--up-soft);border-radius:12px;padding:5px 10px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.user-panel #header-quota {display:flex;align-items:center;gap:10px;color:var(--up-muted);white-space:nowrap}
body.user-panel .header-upgrade {border:1px solid var(--up-line);border-radius:12px;padding:9px 13px;background:var(--up-soft);color:var(--up-blue);font-size:12px;min-height:40px}
body.user-panel progress {accent-color:var(--up-blue);height:7px;width:100px;max-width:100%;border:0;border-radius:6px;overflow:hidden;background:var(--up-soft)}
body.user-panel progress::-webkit-progress-bar {background:var(--up-soft);border-radius:6px}
body.user-panel progress::-webkit-progress-value {background:var(--up-blue);border-radius:6px}
body.user-panel #sidebar-toggle {display:grid;color:var(--up-muted);width:40px;min-width:40px}
body.user-panel #sidebar {
  grid-area: sidebar;
  direction: rtl;
  position: relative;
  inset: auto;
  transform: none;
  visibility: visible;
  width: auto;
  min-width: 0;
  padding: 22px 22px 18px;
  gap: 16px;
  background: var(--up-bg);
  border: 0;
  border-inline-end: 1px solid var(--up-line);
}
body.user-panel #sidebar>.brand, body.user-panel #account-menu {display:none}
body.user-panel #new-chat {min-height:52px;width:100%;justify-content:center;border:1px solid #075bff;border-radius:13px;background:#075bff;color:#fff;font-size:16px;box-shadow:0 5px 16px #075bff0c}
body.user-panel #new-chat:hover, body.user-panel .button.primary:hover {background:#034bda}
body.user-panel #history-search {height:52px;border-radius:13px;background:var(--up-card);font-size:13px;padding-inline-start:45px}
body.user-panel .search-label .search-icon {inset-inline-start:16px}
body.user-panel .history-heading {min-height:34px;color:var(--up-ink);font-size:14px;padding:0 3px}
body.user-panel .history-heading .icon-button {color:var(--up-muted);min-width:40px;width:40px}
body.user-panel #history-list {min-height:0;scrollbar-width:thin;border-radius:12px}
body.user-panel .history-row {display:grid;grid-template-columns:44px minmax(0,1fr) 58px;align-items:center;border-radius:0;min-height:57px;margin:0;background:var(--up-card);border-bottom:1px solid var(--up-line)}
body.user-panel .history-row.active, body.user-panel .history-row:hover {background:var(--up-soft)}
body.user-panel .history-link {grid-column:2;grid-row:1;min-width:0;padding:12px 2px;font-size:12px;line-height:1.8}
body.user-panel .history-actions {grid-column:1;grid-row:1;width:44px;min-width:44px;min-height:44px;padding:10px;color:var(--up-ink)}
body.user-panel .history-time {display:block;grid-column:3;grid-row:1;font-size:10px;text-align:center;color:var(--up-muted);white-space:nowrap}
body.user-panel .sidebar-bottom {border-color:var(--up-line);padding-top:14px;gap:4px}
body.user-panel .sidebar-settings {display:flex;justify-content:flex-start;align-items:center;gap:12px;min-height:48px;font-size:13px;padding:10px 5px;color:var(--up-ink)}
body.user-panel .sidebar-settings>span:nth-child(2) {flex:1}
body.user-panel #main {grid-area:content;direction:rtl;min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--up-bg);overflow:hidden}
body.user-panel #account-alert {flex-shrink:0;background:var(--up-soft);color:var(--up-ink);padding:10px 28px;font-size:12px;line-height:1.9;border-color:var(--up-line)}
body.user-panel .chat-only {display:flex}
body.user-panel #chat-view {min-height:0;flex:1}
body.user-panel #message-scroll {min-height:0;padding:25px 34px 10px;scrollbar-width:thin;scroll-padding-block-end:30px;background:#fcfcfc}
:root[data-theme=dark] body.user-panel #message-scroll {background:var(--up-bg)}
body.user-panel .welcome {max-width:1200px;margin:clamp(36px,10vh,108px) auto 30px;text-align:center}
body.user-panel .welcome-mark {display:grid;place-items:center;width:58px;height:64px;border:0;background:transparent;margin:0 auto 20px}
body.user-panel .welcome-mark img {width:48px;height:54px;object-fit:contain}
body.user-panel .welcome h1 {font-size:clamp(24px,2vw,34px);line-height:1.9;margin:8px 0 10px;color:var(--up-ink)}
body.user-panel .welcome>p {max-width:620px;margin:0 auto 32px;font-size:16px;line-height:2;color:var(--up-muted)}
body.user-panel .suggestions {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;width:100%;margin:30px auto 0}
body.user-panel .suggestions .topic-card {display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:13px;text-align:start;padding:20px;min-height:206px;border:1px solid var(--up-line);border-radius:14px;background:var(--up-card);box-shadow:var(--up-shadow);font-size:13px;line-height:1.9;color:var(--up-ink)}
body.user-panel .topic-card>.ui-icon, body.user-panel .topic-card .topic-icon {width:45px;height:45px;padding:10px;border-radius:12px;background:var(--up-soft);color:var(--up-blue);flex-basis:auto}
body.user-panel .topic-card:nth-child(2)>.ui-icon {color:#7934d6;background:#f3ebff}
body.user-panel .topic-card:nth-child(3)>.ui-icon {color:#b46b00;background:#fff4e0}
body.user-panel .topic-card:nth-child(4)>.ui-icon {color:#008774;background:#e3f8f2}
body.user-panel .topic-card:nth-child(2) .topic-icon {color:#b46b00;background:#fff4e0}
body.user-panel .topic-card:nth-child(3) .topic-icon {color:#7934d6;background:#f3ebff}
body.user-panel .topic-card:nth-child(4) .topic-icon {color:#008774;background:#e3f8f2}
body.user-panel .topic-card strong {font-size:15px}
body.user-panel .topic-card>span {color:var(--up-muted);font-size:13px}
body.user-panel .suggestions .topic-card:hover {border-color:#9dc3ff;background:var(--up-soft)}
body.user-panel .message-column {width:100%;max-width:1060px;margin:auto}
body.user-panel .message {gap:14px;margin:24px 0;min-width:0;display:flex;align-items:flex-start}
body.user-panel .message.user+.message.assistant {margin-top:40px}
body.user-panel .message-avatar {display:none}
body.user-panel .message-avatar .ui-icon {width:24px;height:24px}
body.user-panel .message-avatar img {width:26px;height:29px}
body.user-panel .user-bubble {background:#def3e5;color:var(--up-blue);border-radius:22px;max-width:80%;padding:6px 16px;font-family:"Vazir",Tahoma,sans-serif;font-size:15px;font-weight:700;line-height:1.6;white-space:normal}
:root[data-theme=dark] body.user-panel .user-bubble {background:#21483b;color:var(--up-blue)}
body.user-panel .assistant-message-content {width:100%;max-width:100%;min-width:0;flex:1}
body.user-panel .assistant-bubble {background:transparent;border:0;border-radius:0;max-width:calc(100% - 56px);width:fit-content;padding:0;min-width:0;flex:0 1 auto;box-shadow:none}
body.user-panel .assistant-message-content>.assistant-bubble {max-width:100%}
body.user-panel .message-meta {display:none}
body.user-panel .message[data-generation-state=pending] .user-meta, body.user-panel .message[data-generation-state=failed] .user-meta {display:flex}
body.user-panel .assistant-message-content>.message-controls {margin-top:8px;margin-inline:0}
body.user-panel .answer-content>:first-child {margin-top:0}
body.user-panel .answer-content {font-family:"Vazir",Tahoma,sans-serif;font-size:16px;font-weight:700;line-height:1.9;text-align:start;color:#0d0d0d}
:root[data-theme=dark] body.user-panel .answer-content {color:var(--up-ink)}
body.user-panel .answer-content h1, body.user-panel .answer-content h2, body.user-panel .answer-content h3 {font-size:1.12em;line-height:1.9;margin:16px 0 10px}
body.user-panel .answer-content a {color:var(--up-blue);text-decoration:underline;overflow-wrap:anywhere}
body.user-panel .answer-content pre {background:var(--up-bg);border:1px solid var(--up-line);font-size:13px}
body.user-panel .answer-content blockquote {border-inline-start:3px solid var(--up-line);margin-inline:0;padding-inline:16px;color:var(--up-muted)}
body.user-panel .answer-content th {background:var(--up-soft)}
body.user-panel .answer-line-chart {margin:20px 0;padding:16px;border:1px solid var(--up-line);border-radius:16px;background:var(--up-card);overflow:hidden;max-width:100%}
body.user-panel .answer-line-chart[hidden] {display:none}
body.user-panel .answer-line-chart figcaption {display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-weight:700;margin-bottom:8px}
body.user-panel .answer-code-copy {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:6px 12px;border:1px solid var(--up-line);border-radius:9px;background:var(--up-card);color:var(--up-blue);font-family:"Vazir",Tahoma,sans-serif;font-size:12px;font-weight:700;white-space:nowrap}
body.user-panel .answer-code-copy .ui-icon {width:16px;height:16px}
body.user-panel .answer-code-copy:hover {background:var(--up-soft)}
body.user-panel .answer-code-copy:focus-visible {outline:2px solid var(--up-blue);outline-offset:2px}
body.user-panel .answer-line-chart figcaption>.answer-code-copy {margin-inline-start:auto}
body.user-panel .answer-code-block {max-width:100%;min-width:0;margin-block:14px}
body.user-panel .answer-code-actions {display:flex;justify-content:flex-end;margin-bottom:6px}
body.user-panel .answer-code-block>pre {margin:0}
body.user-panel .answer-line-chart svg {display:block;width:100%;height:auto;direction:ltr;overflow:visible}
body.user-panel .answer-line-chart svg text {font-family:"Vazir",Tahoma,sans-serif;font-weight:700;font-size:14px;fill:var(--up-ink);unicode-bidi:plaintext}
body.user-panel .answer-line-chart .chart-grid {stroke:var(--up-line);stroke-width:1}
body.user-panel .answer-line-chart .chart-axis {stroke:var(--up-muted);stroke-width:1}
body.user-panel .answer-line-chart .chart-series {stroke-width:2.5;stroke-linejoin:round;vector-effect:non-scaling-stroke}
body.user-panel .answer-line-chart .chart-series-0 {color:#175cd3;stroke:#175cd3}
body.user-panel .answer-line-chart .chart-series-1 {color:#087f6c;stroke:#087f6c}
body.user-panel .answer-line-chart .chart-series-2 {color:#a34c00;stroke:#a34c00}
body.user-panel .answer-line-chart .chart-series-3 {color:#7839b0;stroke:#7839b0}
body.user-panel .answer-line-chart .chart-point {fill:currentColor;stroke-width:0}
body.user-panel .answer-line-chart .chart-legend {display:flex;flex-wrap:wrap;gap:8px 20px}
body.user-panel .answer-line-chart .chart-key::before {content:"";display:inline-block;width:18px;border-top:3px solid currentColor;margin-inline-end:6px}
body.user-panel .answer-line-chart summary {cursor:pointer;color:var(--up-muted);margin-top:10px;font-size:13px}
body.user-panel .answer-line-chart table {min-width:0;width:100%}
@media(max-width:600px) {body.user-panel .answer-line-chart svg text {font-size:24px}}
body.user-panel .message-meta {color:var(--up-muted);font-size:11px;margin-top:12px}
body.user-panel .message-controls {display:flex;direction:ltr;justify-content:flex-start;gap:0;margin-top:12px}
body.user-panel .message-controls .message-action {height:32px;min-height:32px;min-width:32px;width:32px;padding:8px;color:#858c92;border-radius:6px}
body.user-panel .message-controls .message-action .ui-icon {width:16px;height:16px;flex-basis:16px}
body.user-panel .message-controls .message-action[aria-pressed=true] {color:var(--up-blue);background:var(--up-soft)}
body.user-panel .answer-source-link {margin-top:10px;padding:4px 0;color:var(--up-muted);font-size:12px}
body.user-panel .message-controls .message-action:hover {background:var(--up-soft)}
body.user-panel .source-list {font-size:12px;background:var(--up-bg);border-color:var(--up-line);line-height:1.9}
body.user-panel .thinking-bubble {min-height:66px;max-width:500px;font-size:14px;color:var(--up-muted)}
body.user-panel .thinking-dots {display:none;direction:ltr;align-items:center;gap:3px;height:1em;margin-inline-start:8px;vertical-align:middle}
body.user-panel .thinking-message[data-api-accepted=true][data-generation-state=pending] .thinking-dots {display:inline-flex}
body.user-panel .thinking-dot {width:5px;height:5px;border-radius:50%;background:currentColor;animation:user-panel-thinking-bounce 1s ease-in-out infinite}
body.user-panel .thinking-dot:nth-child(2) {animation-delay:.15s}
body.user-panel .thinking-dot:nth-child(3) {animation-delay:.3s}
@keyframes user-panel-thinking-bounce {0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}
@media(prefers-reduced-motion:reduce) {body.user-panel .thinking-dot {animation:none}}

body.user-panel .composer-wrap {max-width:none;width:100%;padding:8px 30px max(10px,env(safe-area-inset-bottom));flex-shrink:0;background:var(--up-bg)}
body.user-panel #composer {display:flex;width:50%;min-width:min(100%,360px);margin-inline:auto;align-items:center;gap:15px;min-height:76px;padding:10px 14px;border-radius:20px;border:1px solid var(--up-line);background:var(--up-card);box-shadow:0 4px 24px #22497508}
body.user-panel #composer:focus-within {border-color:#87aff4;box-shadow:0 0 0 3px #075bff10}
body.user-panel #message-input {min-height:42px;max-height:180px;padding:8px;font-size:15px;line-height:1.8;background:transparent}
body.user-panel #send-message, body.user-panel #stop-message {width:54px;height:54px;min-width:54px;min-height:54px;padding:0;margin:0;border-radius:50%;background:var(--up-dark);color:#fff;border:1px solid var(--up-dark);box-shadow:0 3px 9px #173c7012}
body.user-panel #send-message .ui-icon {width:24px;height:24px}
body.user-panel #stage:not(.sr-only) {font-size:12px;color:var(--up-muted);margin:0 4px 8px}
body.user-panel .disclaimer {font-size:10px;line-height:1.9;color:var(--up-muted);margin:7px 0 0}
body.user-panel #jump-bottom {bottom:125px;background:var(--up-card);color:var(--up-ink);border-color:var(--up-line)}
body.user-panel #panel-view {padding:28px 32px 42px;flex:1;min-width:0;min-height:0;overflow:auto;scrollbar-width:thin}
body.user-panel .panel-content {max-width:1360px;margin-inline:auto;min-width:0}
body.user-panel .user-page-heading {margin:0 0 25px}
body.user-panel .user-page-heading h1 {font-size:27px;line-height:1.8;margin:0 0 4px}
body.user-panel .user-page-heading p {font-size:13px;color:var(--up-muted);margin:0;line-height:1.9}
body.user-panel .panel-nav {display:flex;flex-wrap:nowrap;gap:0;background:var(--up-card);border:1px solid var(--up-line);border-radius:12px;margin:0 0 24px;padding:0 4px;overflow-x:auto;scrollbar-width:thin}
body.user-panel .panel-nav a {display:flex;align-items:center;justify-content:center;flex:1;gap:10px;padding:16px 12px;min-height:56px;white-space:nowrap;border:0;border-bottom:2px solid transparent;font-size:13px;color:var(--up-muted);text-decoration:none}
body.user-panel .panel-nav a[aria-current=page] {color:var(--up-blue);background:var(--up-soft);border-bottom-color:var(--up-blue);border-radius:9px 9px 0 0}
body.user-panel .panel-nav a:hover {color:var(--up-blue);background:var(--up-soft)}
body.user-panel .user-settings-grid {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(270px,1fr);align-items:start;gap:22px}
body.user-panel .user-card {min-width:0;border:1px solid var(--up-line);border-radius:15px;padding:24px;background:var(--up-card);box-shadow:var(--up-shadow);margin-bottom:22px}
body.user-panel .user-settings-grid>.user-card {margin-bottom:0}
body.user-panel .user-card h2 {display:flex;align-items:center;gap:10px;font-size:17px;margin:0 0 8px;line-height:1.9}
body.user-panel .user-card h2>.ui-icon {color:var(--up-blue)}
body.user-panel .user-card>p {font-size:13px;line-height:2;color:var(--up-muted);margin:4px 0 20px}
body.user-panel .user-card-heading>p {font-size:13px;line-height:2;color:var(--up-muted);margin:4px 0 20px}
body.user-panel .user-profile-identity {display:flex;align-items:center;gap:15px;margin:22px 0;flex-wrap:wrap}
body.user-panel .user-profile-identity .avatar {width:64px;height:64px;background:var(--up-soft);color:var(--up-blue)}
body.user-panel .user-profile-identity .avatar .ui-icon {width:32px;height:32px}
body.user-panel .user-profile-identity .ltr {color:var(--up-muted);font-size:12px}
body.user-panel .user-session-row {display:flex;align-items:center;gap:16px;justify-content:space-between;flex-wrap:wrap;padding:16px;border:1px solid var(--up-line);border-radius:10px;margin:16px 0;font-size:13px;line-height:2}
body.user-panel .user-card .form {gap:20px;margin-top:24px}
body.user-panel .form label {font-size:13px;gap:9px;color:var(--up-ink);line-height:1.8}
body.user-panel .form input, body.user-panel .form select, body.user-panel .form textarea, body.user-panel .user-filter-form select, body.user-panel .user-filter-form input {min-height:46px;border-color:var(--up-line);border-radius:9px;background:var(--up-card);font-size:13px;padding:10px 12px}
body.user-panel .form input:disabled, body.user-panel input[readonly] {background:var(--up-bg);opacity:1;color:var(--up-muted)}
body.user-panel .password-field input {padding-inline-end:58px}
body.user-panel .button {background:var(--up-soft);border-color:var(--up-line);border-radius:10px;padding:11px 20px;font-size:13px;min-height:46px;color:var(--up-ink)}
body.user-panel .button.primary {background:#075bff;border-color:#075bff;color:#fff;box-shadow:0 5px 13px #075bff09}
body.user-panel .button.danger {color:var(--danger)}
body.user-panel .button:disabled {opacity:.55;box-shadow:none}
body.user-panel .form>.button.primary {justify-self:start;min-width:165px}
body.user-panel .user-preferences-card label {display:grid;gap:10px;font-size:13px;margin-top:20px}
body.user-panel .user-preferences-card select {width:100%;background:var(--up-card);min-height:46px;font-size:13px}
body.user-panel .user-password-card, body.user-panel .user-sessions-card, body.user-panel .user-subscription-card, body.user-panel .user-usage-card, body.user-panel .user-orders-card {grid-column:1/-1}
body.user-panel .user-password-card .form {max-width:none}
body.user-panel .user-password-card .button.primary {width:100%;justify-self:stretch}
body.user-panel .user-card .definition-list {font-size:13px;gap:15px 20px;margin:20px 0}
body.user-panel .user-card .definition-list dd {color:var(--up-ink)}
body.user-panel .user-card .definition-list dt {color:var(--up-muted)}
body.user-panel .user-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 22px}
body.user-panel .user-metrics>.user-metric {position:relative;background:var(--up-card);border:1px solid var(--up-line);border-radius:13px;min-width:0;min-height:130px;padding:20px;box-shadow:var(--up-shadow);color:var(--up-muted);font-size:13px;text-align:start}
body.user-panel .user-metric strong {display:block;font-size:29px;line-height:1.6;color:var(--up-ink);margin:8px 0 0}
body.user-panel .user-metric>.ui-icon {float:inline-end;width:44px;height:44px;padding:10px;border-radius:12px;background:var(--up-soft);color:var(--up-blue);margin-inline-start:8px}
body.user-panel .user-metric:nth-child(1)>.ui-icon {background:#fff0f3;color:#c2385b}
body.user-panel .user-metric:nth-child(2)>.ui-icon {background:#fff5df;color:#b47908}
body.user-panel .user-metric:nth-child(3)>.ui-icon {background:#e7f8f0;color:#048251}
body.user-panel .user-subscription-card .button {width:100%}
body.user-panel .user-subscription-card {position:relative;isolation:isolate;overflow:hidden}
body.user-panel .user-subscription-card::after {content:"";position:absolute;z-index:-1;inset-inline-end:30px;top:50px;width:230px;height:250px;background:url('/assets/product/brand-cube.svg') center/contain no-repeat;opacity:.06;pointer-events:none}
body.user-panel .user-settings-grid:has(>.user-usage-card) {grid-template-columns:minmax(0,1fr) minmax(0,1.4fr)}
body.user-panel .user-settings-grid>.user-usage-card {grid-column:auto}
body.user-panel .user-progress {margin:16px 0}
body.user-panel .user-progress-track {height:8px;border-radius:8px;background:var(--up-soft);overflow:hidden;direction:rtl}
body.user-panel .user-progress-fill {display:block;height:100%;background:#075bff;border-radius:8px;max-width:100%}
body.user-panel .user-usage-chart {width:100%;max-width:100%;min-width:0;padding-top:14px}
body.user-panel .user-usage-chart svg {display:block;width:100%;height:auto;max-height:310px;color:var(--up-blue)}
body.user-panel .user-usage-chart text {font:12px Vazir,Tahoma,sans-serif;fill:var(--up-muted)}
body.user-panel .user-usage-chart circle {fill:var(--up-blue);stroke:var(--up-card);stroke-width:2px}
body.user-panel .user-usage-chart .usage-grid-line {stroke:var(--up-line);stroke-width:1px}
body.user-panel .user-filter-form {display:flex;flex-wrap:wrap;gap:14px;align-items:end;margin:0 0 22px}
body.user-panel .user-filter-form label {display:grid;gap:7px;font-size:12px;color:var(--up-muted);min-width:130px}
body.user-panel .user-filter-form input {width:100%;max-width:200px}
body.user-panel .user-pagination {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:20px;font-size:12px;color:var(--up-muted)}
body.user-panel .user-empty-state {padding:42px 20px;text-align:center;border:1px solid var(--up-line);border-radius:12px;background:var(--up-card)}
body.user-panel .user-empty-state>.ui-icon {display:block;width:68px;height:68px;padding:16px;color:#6b9be7;background:var(--up-soft);border-radius:50%;margin:0 auto 20px}
body.user-panel .user-empty-state h2, body.user-panel .user-empty-state h3 {justify-content:center;font-size:18px;line-height:1.9}
body.user-panel .user-empty-state p {color:var(--up-muted);font-size:13px;line-height:2;max-width:600px;margin:8px auto 20px}
body.user-panel .table-scroll {border:1px solid var(--up-line);border-radius:12px;overflow-x:auto;max-width:100%;scrollbar-width:thin}
body.user-panel table {font-size:12px}
body.user-panel th {background:var(--up-soft);color:var(--up-muted);font-weight:700;white-space:nowrap}
body.user-panel th, body.user-panel td {padding:16px 14px;border-bottom-color:var(--up-line);vertical-align:middle;line-height:1.9}
body.user-panel tbody tr:last-child td {border-bottom:0}
body.user-panel .status-pill {border:0;background:var(--up-soft);border-radius:9px;padding:4px 9px;font-size:11px;color:var(--up-ink)}
body.user-panel .footer-note {border:1px solid var(--up-line);border-radius:13px;background:var(--up-soft);padding:18px 22px;font-size:12px;line-height:2.1;margin:20px 0}
body.user-panel #dialog {background:var(--up-card);border-color:var(--up-line);color:var(--up-ink);border-radius:18px;max-width:calc(100vw - 32px);box-shadow:var(--shadow)}
body.user-panel #dialog::backdrop {background:#10254070;backdrop-filter:blur(3px)}
body.user-panel #dialog .menu-list {gap:7px}
body.user-panel #dialog .menu-list a, body.user-panel #dialog .menu-list button {font-size:14px;border:1px solid transparent}
body.user-panel #dialog .menu-list a:hover, body.user-panel #dialog .menu-list button:hover {background:var(--up-soft)}
body.user-panel #toast {background:var(--up-card);border-color:var(--up-line);color:var(--up-ink);max-width:calc(100vw - 32px)}
body.user-panel :is(button,a,input,select,textarea):focus-visible {outline:3px solid var(--up-blue);outline-offset:3px}
body.user-panel .field-error {color:var(--danger)}
body.user-panel .ltr {unicode-bidi:isolate;overflow-wrap:anywhere}
body.user-panel.sidebar-collapsed #shell {grid-template-columns:minmax(0,1fr);grid-template-areas:"topbar" "content"}
body.user-panel.sidebar-collapsed #sidebar {display:none}
:root[data-chat-motion=off] body.user-panel *, :root[data-chat-motion=off] body.user-panel *::after {transition:none!important;animation:none!important;scroll-behavior:auto!important}
@media(min-width:1920px) {body.user-panel .welcome {margin-top:13vh}body.user-panel #panel-view {padding:36px 42px}}
@media(min-width:768px) and (max-width:1199px) {
  body.user-panel #shell {grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:72px minmax(0,1fr)}
  body.user-panel #app-header {height:72px;padding-inline:18px;gap:12px}
  body.user-panel .header-title {font-size:16px;gap:10px}
  body.user-panel .header-entitlements {gap:8px}
  body.user-panel #header-quota progress {display:none}
  body.user-panel .header-upgrade {display:none}
  body.user-panel #sidebar {padding:18px 15px}
  body.user-panel .header-profile-button {font-size:12px;gap:8px}
  body.user-panel #panel-view {padding:24px 20px 35px}
  body.user-panel .user-settings-grid, body.user-panel .user-settings-grid:has(>.user-usage-card) {grid-template-columns:minmax(0,1fr)}
  body.user-panel .suggestions {grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  body.user-panel .suggestions .topic-card {min-height:174px;padding:17px}
  body.user-panel #message-scroll {padding-inline:22px}
  body.user-panel .user-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:767px) {
  body.user-panel #shell {grid-template-columns:minmax(0,1fr);grid-template-rows:64px minmax(0,1fr);grid-template-areas:"topbar" "content"}
  body.user-panel #app-header {height:64px;padding:8px 11px;gap:7px}
  body.user-panel .header-title {font-size:13px;gap:8px;white-space:normal;line-height:1.8;flex:1}
  body.user-panel .header-title img, body.user-panel .header-cube {width:26px;height:30px;flex-shrink:0}
  body.user-panel .header-profile {margin-inline-start:0;gap:0}
  body.user-panel .header-profile-button {padding:0;gap:0}
  body.user-panel .header-profile-button .avatar {width:38px;height:38px}
  body.user-panel #header-account-name, body.user-panel .header-profile-button small, body.user-panel .header-profile-button>[data-icon=chevron-down], body.user-panel .header-divider, body.user-panel .header-entitlements, body.user-panel .header-upgrade, body.user-panel #environment {display:none!important}
  body.user-panel #sidebar-toggle {width:38px;min-width:38px;height:44px}
  body.user-panel #sidebar {display:flex;position:fixed;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:12;width:310px;max-width:88vw;grid-area:auto;transform:translateX(105%);visibility:hidden;padding:18px 16px;border-inline-end:1px solid var(--up-line);box-shadow:var(--shadow);transition:transform .16s ease,visibility .16s ease}
  body.user-panel.drawer-open #sidebar {transform:none;visibility:visible}
  body.user-panel.sidebar-collapsed #sidebar {display:flex}
  body.user-panel #drawer-shade {z-index:11;background:#10254070}
  body.user-panel #new-chat {font-size:15px;min-height:48px}
  body.user-panel .history-link {font-size:12px}
  body.user-panel #message-scroll {padding:12px 13px 0}
  body.user-panel .welcome {margin:35px auto 24px}
  body.user-panel .welcome h1 {font-size:23px;line-height:1.9}
  body.user-panel .welcome>p {font-size:13px;line-height:2;margin-bottom:23px}
  body.user-panel .welcome-mark {width:45px;height:50px;margin-bottom:14px}
  body.user-panel .welcome-mark img {width:38px;height:43px}
  body.user-panel .suggestions {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:20px}
  body.user-panel .suggestions .topic-card {min-height:178px;padding:14px;gap:10px;border-radius:12px}
  body.user-panel .topic-card strong {font-size:12px}
  body.user-panel .topic-card>span {font-size:11px;line-height:1.9}
  body.user-panel .topic-card>.ui-icon {width:38px;height:38px;padding:9px}
  body.user-panel .message {gap:7px;margin:17px 0}
  body.user-panel .message-avatar {width:32px;height:32px;min-width:32px}
  body.user-panel .message-avatar .ui-icon {width:20px;height:20px}
  body.user-panel .user-bubble {font-size:14px;max-width:85%;padding:6px 16px}
  body.user-panel .assistant-message-content, body.user-panel .assistant-bubble {max-width:100%}
  body.user-panel .message-controls .message-action {width:40px;min-width:40px;height:40px;min-height:40px;padding:12px}
  body.user-panel .answer-content {font-size:14px;line-height:2}
  body.user-panel .answer-content pre {font-size:11px;padding:12px}
  body.user-panel .composer-wrap {padding:7px 10px max(8px,env(safe-area-inset-bottom))}
  body.user-panel #composer {min-height:65px;gap:7px;padding:7px 9px;border-radius:17px}
  body.user-panel #message-input {font-size:13px;max-height:130px;padding:6px 3px}
  body.user-panel #send-message, body.user-panel #stop-message {width:46px;height:46px;min-width:46px;min-height:46px}
  body.user-panel #send-message .ui-icon {width:21px;height:21px}
  body.user-panel .disclaimer {font-size:9px;line-height:1.8;margin-top:5px}
  body.user-panel #account-alert {padding:8px 14px;font-size:11px}
  body.user-panel #panel-view {padding:22px 13px 30px}
  body.user-panel .user-page-heading {margin-bottom:20px}
  body.user-panel .user-page-heading h1 {font-size:23px}
  body.user-panel .user-page-heading p {font-size:12px}
  body.user-panel .panel-nav {margin-bottom:18px;justify-content:flex-start;padding-inline:2px}
  body.user-panel .panel-nav a {flex:0 0 auto;min-width:88px;min-height:55px;padding:12px 13px;gap:7px;font-size:12px}
  body.user-panel .panel-nav .ui-icon {width:18px;height:18px;flex-basis:18px}
  body.user-panel .user-settings-grid, body.user-panel .user-settings-grid:has(>.user-usage-card) {grid-template-columns:minmax(0,1fr);gap:17px}
  body.user-panel .user-card {padding:20px 17px;border-radius:13px;margin-bottom:17px}
  body.user-panel .user-card h2 {font-size:16px}
  body.user-panel .user-card>p {font-size:12px}
  body.user-panel .form>.button.primary {width:100%;justify-self:stretch}
  body.user-panel .user-metrics {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:17px}
  body.user-panel .user-metrics>.user-metric {padding:14px 12px;min-height:119px;font-size:11px;border-radius:12px}
  body.user-panel .user-metric strong {font-size:26px}
  body.user-panel .user-metric>.ui-icon {width:34px;height:34px;padding:8px;margin-inline-start:3px}
  body.user-panel .user-card .definition-list {grid-template-columns:minmax(90px,1fr) minmax(0,1.5fr);gap:14px 10px;font-size:12px}
  body.user-panel .user-card .definition-list dd {margin-bottom:0}
  body.user-panel .user-filter-form {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  body.user-panel .user-filter-form label {min-width:0}
  body.user-panel .user-filter-form input {max-width:none}
  body.user-panel .user-filter-form .button {grid-column:1/-1}
  body.user-panel .user-empty-state {padding:30px 14px}
  body.user-panel .user-empty-state p {font-size:12px}
  body.user-panel .footer-note {padding:16px;font-size:11px}
  body.user-panel th, body.user-panel td {padding:13px 10px;font-size:11px}
  body.user-panel #dialog {padding:32px 20px 22px}
}
@media(prefers-reduced-motion:reduce) {
  body.user-panel *, body.user-panel *::before, body.user-panel *::after {transition:none!important;animation:none!important;scroll-behavior:auto!important}
}
