:root {
  color-scheme: dark;
  --canvas: #08090d;
  --sidebar: rgba(12, 13, 19, 0.94);
  --surface: #11131a;
  --surface-raised: #171923;
  --surface-soft: #1c1e29;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f5f3fa;
  --text-soft: #c9c6d3;
  --muted: #777483;
  --purple: #a97aff;
  --purple-strong: #8b5cf6;
  --pink: #f390cf;
  --green: #56d491;
  --red: #ff6f86;
  --amber: #f4c46b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--text); font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { overflow: hidden; }
button, select, textarea { font: inherit; }
button, select, label { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; }
.hidden { display: none !important; }

.ambient { position: fixed; pointer-events: none; z-index: 0; border-radius: 50%; filter: blur(90px); opacity: .13; }
.ambient-one { width: 390px; height: 390px; background: #7846d8; left: 33%; top: -260px; }
.ambient-two { width: 320px; height: 320px; background: #e26ab9; right: -230px; bottom: -190px; opacity: .08; }

.app-shell { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-columns: 224px minmax(520px, 1fr) 306px; }
.sidebar, .settings-panel { background: var(--sidebar); backdrop-filter: blur(22px); }

/* Left navigation */
.sidebar { border-right: 1px solid var(--line); padding: 20px 14px 14px; display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 22px; }
.brand-mark { position: relative; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; overflow: hidden; background: linear-gradient(145deg, #b692ff, #7550df); box-shadow: 0 8px 26px rgba(139, 92, 246, .28); }
.brand-mark i, .brand-mark b { position: absolute; display: block; background: #fff; border-radius: 99px; transform: rotate(-32deg); }
.brand-mark i { width: 7px; height: 21px; left: 11px; top: 6px; }
.brand-mark b { width: 7px; height: 14px; left: 20px; top: 9px; opacity: .72; }
.brand strong, .brand small, .account-card strong, .account-card small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.02em; }
.brand small { color: #696675; font-size: 9px; margin-top: 3px; letter-spacing: .12em; }
.new-chat { width: 100%; border: 1px solid rgba(169, 122, 255, .26); background: linear-gradient(135deg, rgba(139, 92, 246, .19), rgba(139, 92, 246, .07)); color: #e7dcff; border-radius: 11px; padding: 11px 12px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; transition: .2s; }
.new-chat:hover { border-color: rgba(169, 122, 255, .5); transform: translateY(-1px); background: linear-gradient(135deg, rgba(139, 92, 246, .28), rgba(139, 92, 246, .1)); }
.new-chat span { font-size: 17px; font-weight: 400; }
.new-chat i { margin-left: auto; color: #716b81; font-size: 9px; font-style: normal; font-weight: 500; }
.nav-label { color: #565361; font-size: 9px; text-transform: uppercase; letter-spacing: .15em; font-weight: 700; margin: 22px 9px 8px; }
.side-nav { display: grid; gap: 3px; }
.nav-item { width: 100%; border: 1px solid transparent; background: transparent; color: #85818f; padding: 10px 9px; border-radius: 10px; text-align: left; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 7px; font-size: 11px; }
.nav-item span { color: #625e6d; text-align: center; font-size: 13px; }
.nav-item b { font-weight: 600; }
.nav-item.active { position: relative; color: #f2edf9; background: linear-gradient(90deg, rgba(169,122,255,.13), rgba(169,122,255,.035)); border-color: rgba(169,122,255,.1); }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--purple); box-shadow: 0 0 13px var(--purple); }
.nav-item.active span { color: #be9cff; }
.nav-item.active i { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 4px rgba(169,122,255,.09); }
.nav-item em { color: #54515c; font-size: 8px; font-style: normal; }
.favorites-entry { width: 100%; margin-top: 16px; padding: 9px 10px; display: grid; grid-template-columns: 20px 1fr auto; gap: 7px; align-items: center; border: 1px solid rgba(169,122,255,.12); border-radius: 9px; background: rgba(169,122,255,.045); color: #a49cae; text-align: left; font-size: 10px; }
.favorites-entry:hover { color: #e2d7f5; border-color: rgba(169,122,255,.28); background: rgba(169,122,255,.09); }
.favorites-entry span { color: #c38ff3; font-size: 15px; }.favorites-entry b { font-weight: 650; }.favorites-entry i { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: #201b29; color: #a98ada; text-align: center; font-size: 8px; font-style: normal; }
.history-section { flex: 1; min-height: 100px; margin-top: 12px; padding: 13px 4px 0; border-top: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.section-label { display: flex; justify-content: space-between; align-items: center; color: #5e5a68; text-transform: uppercase; letter-spacing: .12em; font-size: 9px; font-weight: 800; margin-bottom: 9px; }
.section-label button { border: 0; background: transparent; color: #686273; padding: 0; font-size: 8px; letter-spacing: .02em; }
.section-label button:hover, .section-label button.active { color: #b99bea; }
.section-label button:disabled { color: #45414c; }
.history-list { flex: 1; display: grid; align-content: start; gap: 2px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.history-item { min-width: 0; border: 0; color: #888491; background: transparent; text-align: left; border-radius: 8px; padding: 7px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 6px; font-size: 10px; transition: .15s; }
.history-item b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.history-item:hover { background: rgba(255,255,255,.035); color: #d7d3dc; }
.history-item.legacy { color: #696471; }
.history-type { display: inline-flex; padding: 3px 5px; border-radius: 5px; font-size: 7px; color: #9ebeff; background: rgba(80,140,255,.09); }
.history-type.video { color: #d2a2ff; background: rgba(169,122,255,.1); }.history-type.audio { color: #71d6b0; background: rgba(86,212,145,.09); }.history-type.chat { color: #7ec8ff; background: rgba(57,146,255,.12); }
.more-history-button { width: 100%; margin-top: 5px; padding: 7px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #14151c; color: #76717e; font-size: 8px; }.more-history-button:hover, .more-history-button.has-more { color: #bda9dc; border-color: rgba(169,122,255,.17); }
.muted { color: #575461; font-size: 10px; padding: 8px; }
.account-card { padding: 13px 5px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 32px 1fr 23px; gap: 9px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, #292531, #1b1921); color: #cbb2ff; border: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.account-card strong { font-size: 10px; color: #d1cdd7; }
.account-card small { color: #5c5965; font-size: 8px; margin-top: 3px; }
.account-card button { border: 0; background: transparent; color: #65616f; padding: 4px; }

/* Main workspace */
.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: 72px 1fr auto; background: linear-gradient(180deg, rgba(255,255,255,.012), transparent 24%); }
.topbar { padding: 0 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.breadcrumb { color: #666271; font-size: 9px; margin-bottom: 5px; }
.breadcrumb span { color: #8d8798; }
.breadcrumb i { margin: 0 5px; font-style: normal; }
h1 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
h1 em { margin-left: 7px; color: #5b5765; font-size: 9px; font-style: normal; font-weight: 500; letter-spacing: .04em; }
.topbar-meta { display: flex; align-items: center; gap: 13px; }
.status-pill { color: #9c98a4; font-size: 9px; display: flex; align-items: center; }
.status-pill i, .route-state i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-right: 7px; box-shadow: 0 0 0 4px rgba(244,196,107,.08); }
.status-pill.online i, .route-state.online i { background: var(--green); box-shadow: 0 0 0 4px rgba(86,212,145,.08); }
.divider { width: 1px; height: 28px; background: var(--line); }
.points-pill { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; }
.points-pill small { grid-column: 1; color: #5f5b68; font-size: 8px; }
.points-pill strong { grid-column: 1; font-size: 12px; }
.points-pill > i { grid-column: 2; grid-row: 1 / 3; font-style: normal; color: #7c7587; background: rgba(255,255,255,.035); border: 1px solid var(--line); padding: 5px 7px; border-radius: 7px; font-size: 8px; }
.points-pill b { color: #c8aaff; }
.chat-feed { min-height: 0; overflow-y: auto; padding: 30px max(34px, 6vw) 20px; scrollbar-width: thin; scrollbar-color: #2b2833 transparent; }
.history-load-indicator { max-width: 780px; min-height: 24px; margin: -18px auto 10px; display: grid; place-items: center; color: #625d6c; font-size: 8px; letter-spacing: .02em; }
.history-load-indicator[hidden] { display: none; }
.welcome-card { max-width: 720px; margin: clamp(20px, 6vh, 75px) auto 0; text-align: center; }
.welcome-art { position: relative; width: 96px; height: 72px; margin: 0 auto 12px; }
.welcome-art > i { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; font-size: 22px; color: white; text-shadow: 0 0 24px #fff; font-style: normal; }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.orb-a { width: 52px; height: 52px; left: 10px; top: 10px; background: radial-gradient(circle at 30% 25%, #d7beff, #7450d6 58%, transparent 70%); opacity: .78; }
.orb-b { width: 48px; height: 48px; right: 8px; top: 6px; background: radial-gradient(circle at 40% 30%, #ffc0e8, #bb5b9c 58%, transparent 70%); opacity: .68; }
.orb-c { width: 38px; height: 38px; left: 31px; bottom: 2px; background: radial-gradient(circle at 30% 20%, #a6d9ff, #525bd2 62%, transparent 72%); opacity: .72; }
.welcome-kicker { color: #8f72c3; font-size: 8px; font-weight: 800; letter-spacing: .18em; margin-bottom: 9px; }
.welcome-card h2 { margin: 0 0 9px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.055em; font-weight: 670; background: linear-gradient(100deg, #fff, #c9bdde 78%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome-card > p { margin: 0 auto 27px; color: #777281; font-size: 11px; }
.prompt-suggestions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; text-align: left; }
.prompt-suggestions button { min-width: 0; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); color: #aaa4b1; border-radius: 13px; padding: 12px; display: grid; grid-template-columns: 24px 1fr 13px; gap: 8px; align-items: center; transition: .2s ease; }
.prompt-suggestions button:hover { transform: translateY(-2px); border-color: rgba(169,122,255,.28); background: linear-gradient(145deg, rgba(169,122,255,.11), rgba(255,255,255,.016)); box-shadow: 0 14px 34px rgba(0,0,0,.2); }
.prompt-suggestions i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: #1d1b26; color: #8973b2; font-size: 8px; font-style: normal; }
.prompt-suggestions span, .prompt-suggestions b, .prompt-suggestions small { min-width: 0; display: block; }
.prompt-suggestions b { color: #d5d0dc; font-size: 10px; font-weight: 650; margin-bottom: 4px; }
.prompt-suggestions small { color: #65606d; font-size: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prompt-suggestions em { color: #60596a; font-style: normal; font-size: 10px; }
.message { max-width: 780px; margin: 0 auto 22px; }
.message-conversation { display: grid; gap: 10px; }
.message.user { display: flex; justify-content: flex-end; }
.user-bubble { max-width: 82%; padding: 12px 14px; color: #d6d1dd; background: linear-gradient(135deg, rgba(139,92,246,.19), rgba(139,92,246,.08)); border: 1px solid rgba(169,122,255,.15); border-radius: 15px 15px 4px 15px; font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.message-conversation > .user-bubble { justify-self: end; }
.prompt-mention { display: inline-flex; align-items: center; max-width: 260px; margin: 0 2px; padding: 1px 6px; border-radius: 6px; color: #7ec8ff; background: rgba(57,146,255,.13); border: 1px solid rgba(80,165,255,.18); line-height: 1.45; vertical-align: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-card { overflow: hidden; background: rgba(17,19,26,.86); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.job-head { min-height: 48px; padding: 0 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.job-title { display: flex; gap: 9px; align-items: center; font-size: 10px; }
.job-title strong { color: #dad6df; }
.job-status { color: var(--amber); font-size: 8px; padding: 4px 7px; border: 1px solid rgba(244,196,107,.16); background: rgba(244,196,107,.07); border-radius: 99px; }
.job-status.succeeded { color: var(--green); border-color: rgba(86,212,145,.18); background: rgba(86,212,145,.07); }
.job-status.failed { color: var(--red); border-color: rgba(255,111,134,.18); background: rgba(255,111,134,.07); }
.job-meta { color: #696572; font-size: 8px; text-align: right; }
.job-head-side { display: flex; align-items: center; gap: 9px; }
.favorite-button, .library-favorite { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #171820; color: #716b79; font-size: 15px; }.favorite-button:hover, .library-favorite:hover, .favorite-button.active, .library-favorite.active { color: #f099ce; border-color: rgba(240,144,205,.28); background: rgba(240,144,205,.08); }.favorite-button:disabled { opacity: .4; }
.job-body { padding: 14px; }
.job-timeline { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 10px; color: #625e6d; font-size: 8px; }
.job-timeline span { display: inline-flex; gap: 4px; }
.job-timeline b { color: #8f8998; font-weight: 550; }
.job-progress { height: 3px; overflow: hidden; background: #23242d; border-radius: 9px; }
.job-progress i { display: block; width: 35%; height: 100%; background: linear-gradient(90deg, var(--purple-strong), var(--pink)); border-radius: inherit; animation: loading 1.4s infinite ease-in-out; }
@keyframes loading { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }
.job-images { height: 360px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); overflow: hidden; border-radius: 11px; background: #090a0e; }
.job-images img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; border-radius: 11px; background: #090a0e; cursor: zoom-in; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.job-images img:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 14px 34px rgba(0,0,0,.32); }
.job-images img:focus-visible { outline: 2px solid rgba(187,151,255,.72); outline-offset: 3px; }
.job-images video { width: 100%; height: 100%; min-height: 0; display: block; object-fit: contain; border-radius: 11px; background: #050609; }
.job-images.audio-results { height: auto; min-height: 116px; padding: 18px; display: flex; align-items: center; background: linear-gradient(135deg, #11131b, #0b0c11); border: 1px solid var(--line); }
.job-images audio { width: 100%; min-width: 0; accent-color: var(--purple); }
.result-actions { display: flex; gap: 7px; margin-top: 11px; }
.result-actions a, .result-actions button { border: 1px solid var(--line); background: #1a1b23; color: #aaa5b1; border-radius: 8px; padding: 7px 10px; font-size: 9px; text-decoration: none; }
.result-actions a:hover, .result-actions button:hover { color: white; border-color: var(--line-strong); }
.job-error { color: #ffa6b5; background: rgba(255,111,134,.07); border: 1px solid rgba(255,111,134,.15); border-radius: 9px; padding: 11px; font-size: 10px; line-height: 1.5; }
.chat-response { padding: 18px 19px; border: 1px solid rgba(126,200,255,.14); border-radius: 12px; background: linear-gradient(145deg, rgba(33,48,70,.38), rgba(18,22,31,.72)); color: #dddbe2; font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

/* Prompt composer */
.composer-wrap { padding: 10px max(34px, 6vw) 16px; background: linear-gradient(180deg, transparent, rgba(8,9,13,.86) 24%); }
.composer { position: relative; max-width: 780px; margin: 0 auto; padding: 13px 14px 12px; background: linear-gradient(150deg, rgba(26,27,37,.98), rgba(17,18,25,.98)); border: 1px solid var(--line-strong); border-radius: 17px; box-shadow: 0 22px 60px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.018); transition: .2s; }
.composer::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: linear-gradient(110deg, transparent 8%, rgba(169,122,255,.22), transparent 44%); opacity: 0; transition: .25s; }
.composer:focus-within { border-color: rgba(169,122,255,.32); box-shadow: 0 24px 65px rgba(0,0,0,.46), 0 0 0 3px rgba(139,92,246,.045); }
.composer:focus-within::before { opacity: 1; }
.composer.error { animation: composer-shake .3s ease; border-color: rgba(255,111,134,.48); }
@keyframes composer-shake { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 70% { transform: translateX(4px); } }
.composer-label { display: flex; justify-content: space-between; align-items: center; }
.composer-label span { color: #aea8b6; font-size: 9px; font-weight: 700; }
.composer-label small { color: #5e5a67; font-size: 8px; }
.prompt-editor { width: 100%; min-height: 70px; max-height: 210px; overflow-y: auto; background: transparent; border: 0; outline: 0; color: #eeeaf2; padding: 10px 1px 8px; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-editor:empty::before { content: attr(data-placeholder); color: #55515f; pointer-events: none; }
.prompt-editor .prompt-mention { cursor: default; user-select: all; }
.mention-menu { position: absolute; z-index: 12; left: 14px; bottom: 58px; width: min(360px, calc(100% - 28px)); max-height: 220px; overflow-y: auto; padding: 6px; background: rgba(20,22,31,.98); border: 1px solid rgba(118,174,255,.22); border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.48); }
.mention-option { width: 100%; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 8px; border: 0; border-radius: 8px; color: #b9b5c0; background: transparent; text-align: left; }
.mention-option:hover, .mention-option.active { color: #eef6ff; background: rgba(68,151,255,.12); }
.mention-option > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #75bdff; background: rgba(68,151,255,.13); font-size: 12px; }
.mention-option b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.mention-option small { color: #686d79; font-size: 8px; }
.composer-footer { min-height: 36px; display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; border-top: 1px solid rgba(255,255,255,.05); padding-top: 10px; }
.composer-tools { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.upload-button, .text-tool { border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #817c8a; border-radius: 8px; padding: 7px 9px; font-size: 9px; transition: .16s; }
.upload-button:hover, .text-tool:hover { color: #ccb9ee; border-color: rgba(169,122,255,.23); background: rgba(169,122,255,.07); }
.upload-button span, .text-tool span { color: #ab86e8; margin-right: 3px; }
.char-count { color: #4f4c58; font-size: 8px; margin-left: 2px; }
.generate-wrap { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.generate-wrap > small { max-width: 104px; color: #625d6a; font-size: 8px; line-height: 1.35; text-align: right; }
.generate-wrap > small.ready { color: #9181ab; }
.generate-wrap > small.error { color: #e78799; }
.generate-button { min-width: 156px; min-height: 40px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: linear-gradient(115deg, #9c6cf4, #7452dd); color: white; padding: 8px 13px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; font-weight: 750; box-shadow: 0 10px 26px rgba(112,72,204,.25); transition: .2s ease; }
.generate-button > * { position: relative; z-index: 1; }
.generate-button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,.2), transparent 62%); transform: translateX(-120%); transition: .45s; }
.generate-button:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 13px 32px rgba(112,72,204,.34); }
.generate-button:hover::after { transform: translateX(120%); }
.generate-button:active { transform: translateY(0); }
.generate-button:disabled { opacity: .62; cursor: wait; filter: saturate(.55); transform: none; }
.generate-button b { margin-left: 3px; padding: 4px 7px; color: #f4edff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.13); border-radius: 999px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.button-stars { font-size: 9px; color: #fff; }
.generate-button.loading .button-stars { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer-hint { max-width: 780px; margin: 7px auto 0; color: #504d57; font-size: 8px; text-align: center; }
.composer-hint span { color: #756987; margin-right: 3px; }
.reference-tray { max-width: 780px; margin: 0 auto 7px; display: flex; gap: 7px; flex-wrap: wrap; }
.reference-chip { max-width: 270px; display: grid; grid-template-columns: 36px 1fr auto; gap: 7px; align-items: center; padding: 6px; background: #161720; border: 1px solid var(--line); border-radius: 10px; }
.reference-chip img, .reference-chip video, .reference-file-icon { width: 36px; height: 36px; object-fit: cover; border-radius: 7px; }
.reference-chip video { display: block; background: #050609; }
.reference-file-icon { display: grid; place-items: center; color: #85c7ff; background: rgba(68,151,255,.12); font-size: 12px; }
.reference-preview-trigger { cursor: pointer; transition: .16s; }.reference-preview-trigger:hover { outline: 2px solid rgba(126,200,255,.35); transform: scale(1.03); }
.reference-info { min-width: 0; display: grid; gap: 3px; }
.reference-name { border: 0; background: transparent; color: #c7c2cc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; text-align: left; padding: 0; }
.reference-meta { display: flex; gap: 6px; align-items: center; color: #65616d; font-size: 7px; }
.reference-type { padding: 2px 5px; border-radius: 4px; color: #70baff; background: rgba(68,151,255,.1); }
.reference-chip select { grid-column: 2; border: 0; background: #20212b; color: #8b8693; border-radius: 6px; padding: 3px; font-size: 8px; }
.remove-reference { border: 0; background: transparent; color: #65616d; padding: 4px; }
.remove-reference:hover { color: var(--red); }

/* Right settings */
.settings-panel { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); padding: 20px 17px; scrollbar-width: thin; scrollbar-color: #292731 transparent; }
.settings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.settings-head div small, .settings-head div span { display: block; }
.settings-head small { color: #5e5968; font-size: 7px; letter-spacing: .15em; margin-bottom: 3px; }
.settings-head span { font-size: 13px; font-weight: 700; }
.settings-head button { width: 28px; height: 28px; border: 1px solid var(--line); background: #16171f; color: #77717f; border-radius: 8px; font-size: 14px; }
.model-card { display: grid; grid-template-columns: 37px 1fr auto; gap: 9px; align-items: center; padding: 10px; margin-bottom: 16px; border: 1px solid rgba(169,122,255,.16); background: linear-gradient(120deg, rgba(139,92,246,.1), rgba(139,92,246,.025)); border-radius: 11px; }
.model-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #a67bf0, #6251c6); color: white; font-size: 9px; font-weight: 800; box-shadow: 0 7px 18px rgba(95,70,180,.2); }
.model-card strong, .model-card small { display: block; }
.model-card strong { color: #ddd7e5; font-size: 10px; }
.model-card small { color: #6b6673; font-size: 8px; margin-top: 3px; }
.model-card > span { color: #9d7ed0; background: rgba(169,122,255,.09); border-radius: 5px; padding: 4px 6px; font-size: 7px; }
.setting-block { margin-bottom: 14px; }
.setting-block label { display: block; color: #77717f; font-size: 9px; font-weight: 650; margin: 0 0 6px 2px; }
.setting-block select { width: 100%; min-height: 40px; appearance: none; outline: 0; color: #c7c1ce; background-color: #16171f; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%238e8798' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; border: 1px solid var(--line); border-radius: 14px !important; background-clip: padding-box; padding: 9px 36px 9px 12px; font-size: 9px; transition: .16s; }
.setting-hint { display: block; margin: 7px 2px 0; color: #716b7a; font-size: 8px; line-height: 1.45; }
.setting-block select:focus { border-color: rgba(169,122,255,.35); box-shadow: 0 0 0 3px rgba(169,122,255,.045); }
.setting-block select:disabled { opacity: .72; }
.setting-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-card { margin-top: 7px; padding: 9px; background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 8px; }
.route-state { display: block; color: #aaa5b0; font-size: 8px; }
.route-card small { display: block; color: #5c5864; font-size: 7px; margin: 5px 0 0 13px; line-height: 1.4; }
.cost-card, .capability-card { border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 11px; padding: 11px; margin-top: 5px; }
.cost-head { padding-bottom: 8px; margin-bottom: 8px !important; border-bottom: 1px solid var(--line); }
.cost-card > div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 9px; }
.cost-card span { color: #77727e; }
.cost-card strong { color: #c4a5f6; font-size: 11px; }
.cost-card b { color: #918b98; font-size: 8px; font-weight: 500; }
.cost-card small { color: #5b5763; font-size: 7px; }
.capability-card { margin-top: 12px; }
.capability-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: #807b87; font-size: 8px; }
.capability-card li span { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 5px; color: var(--green); background: rgba(86,212,145,.07); border-radius: 5px; font-size: 7px; }
.billing-card p { margin: 0; color: #a99eb6; font-size: 9px; line-height: 1.55; }
.privacy-note { display: flex; gap: 8px; align-items: center; padding: 11px 4px; margin-top: 6px; color: #625e6a; }
.privacy-note > span { color: #7c6a99; }
.privacy-note p, .privacy-note b, .privacy-note small { display: block; margin: 0; }
.privacy-note b { color: #77727f; font-size: 8px; }
.privacy-note small { color: #514e57; font-size: 7px; margin-top: 3px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 22px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; max-width: min(420px, calc(100vw - 30px)); color: #e9e4ed; background: rgba(30,30,39,.96); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 14px; font-size: 9px; box-shadow: var(--shadow); transition: .2s; backdrop-filter: blur(16px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: #ffb2bf; border-color: rgba(255,111,134,.32); }

/* Full-resolution image preview */
.image-preview-layer { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 28px; background: rgba(2,3,6,.9); backdrop-filter: blur(18px); }
.image-preview-dialog { position: relative; width: min(1280px, 96vw); height: min(920px, 94vh); display: grid; grid-template-rows: minmax(0,1fr) auto; overflow: hidden; background: #0d0e14; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; box-shadow: 0 40px 120px rgba(0,0,0,.72); }
.image-preview-stage { position: relative; min-height: 0; overflow: auto; display: grid; place-items: center; place-content: center; background: radial-gradient(circle at center, #171922, #08090d 72%); scrollbar-width: thin; scrollbar-color: #494353 transparent; }
.image-preview-stage > [hidden] { display: none !important; }
.image-preview-stage img { grid-area: 1 / 1; justify-self: center; align-self: center; margin: auto; }
.image-preview-stage img { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; object-fit: contain; object-position: 50% 50%; transform: scale(1); transform-origin: center center; transition: transform .08s linear; }
.image-preview-stage video { position: absolute; inset: 12px auto auto 12px; width: calc(100% - 24px); height: calc(100% - 24px); min-width: 0; min-height: 0; max-width: none; max-height: none; display: block; margin: 0; object-fit: contain; object-position: 50% 50%; background: #050609; }.image-preview-stage audio { position: absolute; left: 50%; top: 50%; width: min(720px,calc(100% - 80px)); min-width: min(280px,calc(100% - 40px)); max-width: calc(100% - 40px); margin: 0; transform: translate(-50%,-50%); accent-color: var(--purple); }
.image-preview-stage canvas { position: absolute; z-index: 1; inset: 12px auto auto 12px; width: calc(100% - 24px); height: calc(100% - 24px); display: block; pointer-events: none; clip-path: inset(0 0 58px 0); background: #050609; }
.video-preview-play { grid-area: 1 / 1; z-index: 3; place-self: center; width: 72px; height: 72px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; padding: 0 0 0 5px; color: #fff; background: rgba(18,15,28,.78); box-shadow: 0 14px 42px rgba(0,0,0,.45); font-size: 28px; cursor: pointer; backdrop-filter: blur(8px); transition: transform .16s, background .16s; }
.video-preview-play:hover { transform: scale(1.08); background: rgba(111,73,219,.92); }
.image-preview-stage.video-landscape video, .image-preview-stage.video-portrait video { width: calc(100% - 24px); height: calc(100% - 24px); max-width: none; max-height: none; aspect-ratio: auto; }
.image-preview-dialog footer { min-height: 54px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); }
.image-preview-dialog footer span { min-width: 0; overflow: hidden; color: #8d8794; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.image-preview-dialog footer b { margin-left: auto; color: #b59ae0; font-size: 9px; font-weight: 650; }
.image-preview-dialog footer small { flex: 0 0 auto; color: #5f5a68; font-size: 8px; }
.image-preview-dialog footer a { flex: 0 0 auto; color: #d6c7ef; background: rgba(139,92,246,.15); border: 1px solid rgba(169,122,255,.22); border-radius: 10px; padding: 8px 12px; text-decoration: none; font-size: 9px; }
.image-preview-close { position: absolute; z-index: 2; right: 14px; top: 14px; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(11,12,17,.78); color: #ddd6e6; font-size: 21px; backdrop-filter: blur(12px); }

/* History and favorites library */
.library-layer { z-index: 55; }
.library-dialog { width: min(1120px,96vw); height: min(820px,92vh); display: flex; flex-direction: column; overflow: hidden; background: #101118; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 35px 100px rgba(0,0,0,.58); }
.library-tabs { min-height: 48px; display: flex; align-items: end; gap: 5px; padding: 0 23px; border-bottom: 1px solid var(--line); }.library-tabs button { height: 47px; padding: 0 17px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #706a77; font-size: 10px; }.library-tabs button.active { color: #d4c4ed; border-bottom-color: var(--purple); }
.library-toolbar { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 9px 23px; border-bottom: 1px solid var(--line); background: rgba(139,92,246,.025); }.library-toolbar label { display: flex; align-items: center; gap: 6px; color: #918a98; font-size: 9px; }.library-toolbar span { margin-right: auto; color: #625d69; font-size: 8px; }.library-toolbar button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #181921; color: #a49dab; font-size: 8px; }.library-toolbar button.danger { color: #d98a98; border-color: rgba(255,111,134,.15); }.library-toolbar button:disabled { opacity: .4; }
.library-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); grid-auto-rows: max-content; align-content: start; align-items: start; gap: 12px; padding: 16px 23px; }.library-empty { grid-column: 1/-1; padding: 80px 20px; color: #69636f; text-align: center; font-size: 10px; }
.library-card { min-width: 0; min-height: 302px; overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 302px; border: 1px solid var(--line); border-radius: 13px; background: #15161e; }.library-card-head { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 6px 9px; }.library-card-head .library-favorite { width: 28px; height: 28px; }.library-card-head input { accent-color: var(--purple); }
.library-card-actions { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 5px; }
.library-card-action { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: #171820; color: #817a89; text-decoration: none; font-size: 15px; line-height: 1; }
.library-card-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.library-card-action:hover { color: #d9c9f0; border-color: rgba(169,122,255,.28); background: rgba(139,92,246,.09); }.library-card-action.library-remove:hover { color: #f3a2b0; border-color: rgba(255,111,134,.26); background: rgba(255,111,134,.08); }.library-card-action.disabled { opacity: .35; pointer-events: none; }
.library-media { position: relative; width: 100%; height: 150px; display: grid; place-items: center; overflow: hidden; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #090a0f; color: #857e8d; }.library-media img, .library-media video { width: 100%; height: 100%; transition: .18s; }.library-media img { object-fit: cover; }.library-media video { object-fit: contain; object-position: center; background: #050609; }.library-media:hover img { filter: brightness(1.08); transform: scale(1.015); }.library-media:hover video { filter: brightness(1.08); }.library-play { position: absolute; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(12,13,19,.75); color: white; font-style: normal; }.library-audio { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: rgba(86,212,145,.08); color: #72dcb3; font-size: 24px; font-style: normal; }.library-media span { position: absolute; bottom: 26px; font-size: 8px; }
.library-media.library-text { display: block; padding: 14px; text-align: left; overflow: auto; cursor: text; }.library-media.library-text p { margin: 0; color: #bdb8c5; font-size: 9px; line-height: 1.65; white-space: pre-wrap; }
.library-video-frame { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; background: #050609; }.library-video-frame.video-landscape { width: 100%; height: auto; max-height: 100%; aspect-ratio: 21 / 9; }.library-video-frame.video-portrait { width: auto; height: 100%; max-width: 100%; aspect-ratio: 9 / 16; }
.library-info { padding: 11px; }.library-info > strong { display: block; height: 31px; overflow: hidden; color: #bcb6c2; font-size: 9px; line-height: 1.55; }.library-info small { display: block; margin-top: 7px; color: #5e5965; font-size: 7px; }.library-details { display: grid; gap: 5px; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.05); }.library-details span { min-width: 0; display: grid; grid-template-columns: 43px minmax(0,1fr); gap: 5px; color: #5f5a66; font-size: 7px; }.library-details b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8f8997; font-weight: 550; }
.library-pagination { min-height: 58px; flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 23px; border-top: 1px solid var(--line); background: #111219; }.library-pagination > span { color: #696471; font-size: 8px; }.library-pagination > div, .library-pagination nav { display: flex; align-items: center; gap: 5px; }.library-pagination button { min-width: 31px; height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #181920; color: #89828f; font-size: 8px; }.library-pagination nav button { padding: 0; }.library-pagination button:hover:not(:disabled), .library-pagination button.active { color: #dfd0f5; border-color: rgba(169,122,255,.28); background: rgba(139,92,246,.13); }.library-pagination button:disabled { opacity: .35; }
.confirm-layer { z-index: 68; }.confirm-dialog { width: min(390px,calc(100vw - 30px)); padding: 28px; text-align: center; background: #12131a; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.68); }.confirm-icon { width: 52px; height: 52px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 16px; color: #ef98c9; background: rgba(240,144,205,.09); border: 1px solid rgba(240,144,205,.15); font-size: 24px; }.confirm-dialog small { color: #8b6683; font-size: 7px; letter-spacing: .16em; }.confirm-dialog h2 { margin: 6px 0 9px; font-size: 18px; }.confirm-dialog p { margin: 0; color: #817b88; font-size: 9px; line-height: 1.65; }.confirm-dialog > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }.confirm-dialog button { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #191a22; color: #9b94a1; font-size: 9px; }.confirm-dialog button.danger { color: #ffdce4; border-color: rgba(255,111,134,.25); background: rgba(255,111,134,.13); }.confirm-dialog button:disabled { opacity: .55; }

/* Authentication */
.auth-screen { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; background: #090a0f; }
.auth-screen.hidden { display: none; }
.auth-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; background: radial-gradient(circle at 60% 28%, rgba(172,115,255,.28), transparent 25%), radial-gradient(circle at 28% 58%, rgba(225,102,183,.14), transparent 24%), linear-gradient(145deg, #15121f, #0b0c12 62%); border-right: 1px solid var(--line); }
.auth-visual::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
.auth-brand { position: absolute; top: 38px; left: 42px; display: flex; align-items: center; gap: 11px; font-size: 14px; }
.auth-art { position: absolute; width: 260px; height: 260px; left: 50%; top: 42%; transform: translate(-50%,-50%); }
.auth-art::before, .auth-art::after, .auth-art span, .auth-art b { content: ""; position: absolute; border-radius: 48% 52% 53% 47%; filter: blur(1px); }
.auth-art::before { width: 150px; height: 165px; left: 28px; top: 34px; background: radial-gradient(circle at 30% 25%, #ddc5ff, #7b4ad8 52%, #352050 72%); transform: rotate(-18deg); box-shadow: 0 28px 80px rgba(135,75,222,.3); }
.auth-art::after { width: 132px; height: 145px; right: 18px; top: 48px; background: radial-gradient(circle at 35% 25%, #ffc1e5, #b45295 54%, #47213b 75%); transform: rotate(22deg); opacity: .86; }
.auth-art span { width: 115px; height: 116px; left: 73px; bottom: 23px; background: radial-gradient(circle at 35% 20%, #b7d8ff, #5556cc 56%, #27255d 76%); z-index: 2; transform: rotate(12deg); opacity: .92; }
.auth-art > i { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; font-style: normal; font-size: 42px; color: white; text-shadow: 0 0 32px white; }
.auth-visual > p { position: relative; z-index: 2; margin: 0 0 12px; font-size: clamp(24px,3vw,38px); line-height: 1.22; letter-spacing: -.05em; font-weight: 650; }
.auth-visual > small { position: relative; z-index: 2; color: #786c87; font-size: 8px; letter-spacing: .22em; }
.auth-card { width: min(390px, calc(100% - 50px)); margin: auto; }
.auth-mobile-brand { display: none; }
.auth-kicker { color: #9472cf; font-size: 8px; letter-spacing: .2em; font-weight: 800; margin-bottom: 10px; }
.auth-card h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.045em; }
.auth-card > p { color: #696572; font-size: 10px; margin: 0 0 28px; }
.auth-card > label, .small-dialog > label { display: block; color: #8a8491; font-size: 9px; font-weight: 650; margin: 14px 0 7px 2px; }
.phone-field, .code-field, .password-field { min-height: 45px; display: flex; align-items: center; background: #12141b; border: 1px solid var(--line-strong); border-radius: 11px; transition: .18s; }
.phone-field:focus-within, .code-field:focus-within, .password-field:focus-within { border-color: rgba(169,122,255,.42); box-shadow: 0 0 0 3px rgba(169,122,255,.055); }
.phone-field span { padding: 0 12px; border-right: 1px solid var(--line); color: #928b9a; font-size: 11px; }
.phone-field input, .code-field input, .password-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #eeeaf3; padding: 0 12px; font-size: 12px; }
.phone-field input::placeholder, .code-field input::placeholder, .password-field input::placeholder { color: #4f4b57; }
.code-field button { margin-right: 5px; padding: 8px 10px; border: 1px solid rgba(169,122,255,.18); border-radius: 8px; background: rgba(169,122,255,.08); color: #b99ae9; font-size: 9px; }
.code-field button:disabled { opacity: .5; }
.login-button { width: 100%; min-height: 45px; margin-top: 18px; display: flex; justify-content: center; align-items: center; gap: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: linear-gradient(115deg,#9d6df5,#7452dc); color: white; font-size: 11px; font-weight: 750; box-shadow: 0 13px 30px rgba(111,73,201,.25); }
.login-button i { font-style: normal; font-size: 14px; }
.dev-login { margin-top: 22px; padding: 13px; background: rgba(255,255,255,.018); border: 1px solid var(--line); border-radius: 11px; }
.dev-login > span { display: block; color: #6f6978; font-size: 8px; margin-bottom: 9px; }
.dev-login > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.dev-login button { border: 1px solid var(--line); border-radius: 7px; background: #171820; color: #a19aa8; padding: 7px; font-size: 8px; }
.dev-login button:hover { color: #cbb2f5; border-color: rgba(169,122,255,.23); }
.dev-login small { display: block; color: #504c56; font-size: 7px; margin-top: 8px; }
.auth-security { color: #4f4b56; font-size: 7px; text-align: center; margin-top: 18px; }
.credential-layer { z-index: 72; }
.credential-dialog input { box-sizing: border-box; height: 42px; font-size: 11px; }
.credential-dialog .primary-action { margin-top: 22px; }
.credential-logout-button { width: 100%; margin-top: 9px; padding: 10px; border: 1px solid rgba(255,111,134,.18); border-radius: 9px; background: rgba(255,111,134,.055); color: #df8998; font-size: 9px; }
.credential-logout-button:hover { border-color: rgba(255,111,134,.32); background: rgba(255,111,134,.1); color: #ffb5c1; }
.credential-error { margin-top: 13px; padding: 9px 11px; border: 1px solid rgba(255,111,134,.28); border-radius: 9px; background: rgba(255,111,134,.08); color: #ffb2bf; font-size: 9px; line-height: 1.55; }
.credential-error.hidden { display: none; }
.temporary-password-value { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; margin: 18px 0 4px; padding: 9px 9px 9px 13px; border: 1px solid rgba(169,122,255,.24); border-radius: 10px; background: rgba(139,92,246,.08); }
.temporary-password-value code { min-width: 0; overflow: auto; color: #e3d6f8; font-size: 13px; white-space: nowrap; }
.temporary-password-value button { padding: 8px 12px; border: 1px solid rgba(169,122,255,.24); border-radius: 8px; background: rgba(139,92,246,.13); color: #cbb4ef; font-size: 8px; }

/* Admin and wallet dialogs */
.modal-layer { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 26px; background: rgba(3,4,7,.76); backdrop-filter: blur(12px); }
.admin-dialog { width: min(1080px,96vw); height: min(760px,92vh); display: flex; flex-direction: column; overflow: hidden; background: #101118; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 35px 100px rgba(0,0,0,.58); }
.dialog-head { min-height: 76px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--line); }
.dialog-head small, .small-dialog > small { display: block; color: #755d9d; font-size: 7px; letter-spacing: .18em; margin-bottom: 5px; }
.dialog-head h2, .small-dialog h2 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.dialog-head button, .dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #171820; color: #817b89; font-size: 17px; }
.admin-tabs { min-height: 43px; display: flex; gap: 4px; align-items: flex-end; padding: 0 22px; border-bottom: 1px solid var(--line); }
.admin-tabs button { position: relative; height: 42px; padding: 0 13px; border: 0; background: transparent; color: #68636f; font-size: 9px; }
.admin-tabs button.active { color: #d2c9dc; }
.admin-tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--purple); border-radius: 2px 2px 0 0; }
.admin-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.admin-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 18px 22px 12px; }
.admin-stats article { padding: 14px; background: linear-gradient(145deg,rgba(255,255,255,.03),rgba(255,255,255,.012)); border: 1px solid var(--line); border-radius: 11px; }
.admin-stats span, .admin-stats strong, .admin-stats small { display: block; }
.admin-stats span { color: #75707c; font-size: 8px; }
.admin-stats strong { color: #ddd7e5; font-size: 20px; margin: 8px 0 5px; }
.admin-stats article:last-child strong { color: #bea1eb; }
.admin-stats small { color: #4f4c55; font-size: 7px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 22px 12px; }
.admin-search { width: min(300px,50%); min-height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); background: #15161d; border-radius: 9px; }
.admin-search span { color: #686370; }
.admin-search input, .create-user-panel input, .create-user-panel select, .small-dialog input { width: 100%; border: 1px solid var(--line); outline: 0; background: #15161d; color: #d4ceda; border-radius: 8px; padding: 9px 10px; font-size: 9px; }
.admin-search input { border: 0; padding: 0; background: transparent; }
.admin-toolbar > button, .create-user-panel > button, .primary-action { border: 1px solid rgba(169,122,255,.25); background: rgba(139,92,246,.16); color: #c8adf2; border-radius: 8px; padding: 9px 12px; font-size: 9px; font-weight: 650; }
.create-user-panel { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr .7fr auto auto; gap: 7px; padding: 11px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(139,92,246,.035); }
.create-user-panel .ghost { color: #77717f; border-color: var(--line); background: #171820; }
.user-table-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0 22px 20px; }
.user-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.user-table th { position: sticky; top: 0; z-index: 1; padding: 11px 9px; background: #101118; border-bottom: 1px solid var(--line); color: #5e5a65; text-align: left; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.user-table td { padding: 11px 9px; border-bottom: 1px solid rgba(255,255,255,.045); color: #8f8996; font-size: 8px; vertical-align: middle; }
.user-table th:first-child { width: 22%; }.user-table th:nth-child(2){width:13%}.user-table th:nth-child(3){width:11%}.user-table th:nth-child(4){width:11%}.user-table th:nth-child(5){width:10%}.user-table th:nth-child(6){width:18%}
.user-cell { display: flex; gap: 8px; align-items: center; }
.user-cell > span { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 9px; background: #1c1924; color: #b295dc; font-weight: 750; }
.user-cell b, .user-cell small { display: block; }
.user-cell b { color: #c9c3cf; font-size: 9px; margin-bottom: 3px; }
.user-cell small { color: #5d5963; font-size: 7px; }
.role-badge, .status-badge { display: inline-block; padding: 4px 7px; border-radius: 6px; font-size: 7px; }
.role-badge { color: #af92db; background: rgba(169,122,255,.08); }.status-badge.active { color: #69cc93; background: rgba(86,212,145,.07); }.status-badge.disabled { color: #dc7889; background: rgba(255,111,134,.07); }
.table-select { max-width: 105px; border: 1px solid var(--line); background: #171820; color: #aaa3b0; border-radius: 6px; padding: 5px 6px; font-size: 7px; }
.user-actions { display: flex; gap: 5px; justify-content: flex-end; }
.user-actions button { border: 1px solid var(--line); background: #171820; color: #88818f; border-radius: 6px; padding: 5px 7px; font-size: 7px; white-space: nowrap; }
.user-actions button.primary { color: #baa0e1; border-color: rgba(169,122,255,.16); }
.table-empty { padding: 30px !important; text-align: center !important; color: #5f5a66 !important; }
.small-dialog { position: relative; width: min(390px,calc(100vw - 30px)); padding: 25px; background: #111219; border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.dialog-close { position: absolute; right: 16px; top: 16px; }
.small-dialog > p { margin: 7px 0 18px; color: #77717d; font-size: 9px; }
.primary-action { width: 100%; margin-top: 18px; padding: 11px; background: linear-gradient(115deg,#9568ea,#7050d3); color: white; }
.wallet-summary { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 11px; padding: 13px; border: 1px solid rgba(169,122,255,.14); background: rgba(169,122,255,.055); border-radius: 10px; }
.wallet-summary span { color: #77717e; font-size: 8px; }.wallet-summary strong { color: #c8a9f5; font-size: 17px; }
.ledger-list { max-height: 280px; overflow-y: auto; display: grid; }
.ledger-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.ledger-item b { color: #aaa4b0; font-size: 8px; }.ledger-item strong { grid-row: 1/3; grid-column: 2; align-self: center; font-size: 10px; }.ledger-item strong.positive { color: var(--green); }.ledger-item strong.negative { color: var(--red); }.ledger-item small { color: #55515b; font-size: 7px; }
.logout-button { width: 100%; margin-top: 16px; padding: 9px; border: 1px solid rgba(255,111,134,.15); background: rgba(255,111,134,.045); color: #d77b8b; border-radius: 8px; font-size: 8px; }
.account-security-button { width: 100%; margin-top: 16px; padding: 9px; border: 1px solid rgba(169,122,255,.18); background: rgba(139,92,246,.07); color: #bba2e2; border-radius: 8px; font-size: 8px; }
.account-security-button + .logout-button { margin-top: 8px; }

/* Generation records */
.admin-records-pane { overflow: hidden; }
.record-stats { padding-bottom: 10px; }
.record-filters { display: grid; grid-template-columns: 1.3fr repeat(3,.9fr) repeat(2,1fr) 1.8fr auto; gap: 8px; align-items: end; padding: 4px 22px 14px; border-bottom: 1px solid var(--line); }
.record-filters label { min-width: 0; }
.record-filters label > span { display: block; margin: 0 0 6px 2px; color: #625d69; font-size: 7px; }
.record-filters select, .record-filters input { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--line); outline: 0; border-radius: 9px; background: #15161d; color: #aaa4b0; padding: 0 9px; font-size: 8px; color-scheme: dark; }
.record-filters select:focus, .record-filters input:focus { border-color: rgba(169,122,255,.34); box-shadow: 0 0 0 3px rgba(169,122,255,.05); }
.record-filters button { height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #171820; color: #817a88; padding: 0 11px; font-size: 8px; white-space: nowrap; }
.record-author-summary { display: flex; gap: 7px; min-height: 37px; overflow-x: auto; padding: 7px 22px 5px; scrollbar-width: thin; }.record-author-summary:empty { display: none; }.record-author-summary button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.015); color: #77717d; padding: 6px 9px; font-size: 7px; }.record-author-summary button:hover { color: #b59bdc; border-color: rgba(169,122,255,.2); }.record-author-summary b { color: #a59daa; font-weight: 650; }
.record-table-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0 22px; }
.record-table { width: 100%; min-width: 920px; border-collapse: collapse; table-layout: fixed; }
.record-table th { position: sticky; top: 0; z-index: 1; padding: 10px 8px; background: #101118; border-bottom: 1px solid var(--line); color: #5e5965; text-align: left; font-size: 7px; letter-spacing: .06em; }
.record-table td { padding: 11px 8px; border-bottom: 1px solid rgba(255,255,255,.045); color: #8d8793; font-size: 8px; vertical-align: middle; }
.record-table th:nth-child(1){width:15%}.record-table th:nth-child(2){width:14%}.record-table th:nth-child(3){width:23%}.record-table th:nth-child(4){width:10%}.record-table th:nth-child(5){width:12%}.record-table th:nth-child(6){width:7%}.record-table th:nth-child(7){width:12%}.record-table th:nth-child(8){width:7%}
.record-author b, .record-author small, .record-model b, .record-model small { display: block; }
.record-author b, .record-model b { color: #bbb4c1; font-size: 8px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-author small, .record-model small { color: #5f5965; font-size: 7px; }
.record-type-dot { display: inline-block; min-width: 28px; margin-left: 5px; padding: 3px 5px; border-radius: 5px; color: #ad92d6; background: rgba(139,92,246,.08); text-align: center; font-size: 7px; }
.record-prompt { max-width: 100%; display: -webkit-box; overflow: hidden; color: #8f8995; line-height: 1.55; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.record-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; background: rgba(244,196,107,.07); color: #d0a958; font-size: 7px; }
.record-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.record-status.succeeded { color: #66ca90; background: rgba(86,212,145,.07); }.record-status.failed { color: #dc7889; background: rgba(255,111,134,.07); }
.record-view-button { border: 1px solid rgba(169,122,255,.17); border-radius: 7px; background: rgba(139,92,246,.08); color: #b094d8; padding: 6px 8px; font-size: 7px; }
.record-footer { min-height: 52px; display: flex; justify-content: space-between; align-items: center; padding: 8px 22px; border-top: 1px solid var(--line); color: #625d68; font-size: 8px; }
.record-footer > div, .record-footer nav { display: flex; gap: 5px; }
.record-footer button { min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #171820; color: #77717d; padding: 0 8px; font-size: 8px; }.record-footer button.active { color: #d2c2eb; border-color: rgba(169,122,255,.28); background: rgba(139,92,246,.12); }.record-footer button:disabled { opacity: .35; }
.record-detail-layer { z-index: 54; }
.record-detail-dialog { width: min(920px,94vw); height: min(780px,92vh); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: #101118; box-shadow: 0 35px 100px rgba(0,0,0,.64); }
.record-detail-content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 28px; }
.record-detail-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 18px; }
.record-detail-summary article { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }.record-detail-summary span, .record-detail-summary strong { display: block; }.record-detail-summary span { color: #5e5964; font-size: 7px; margin-bottom: 7px; }.record-detail-summary strong { color: #bdb6c4; font-size: 9px; word-break: break-word; }
.record-detail-section { margin-top: 16px; }.record-detail-section > h3 { margin: 0 0 9px; color: #8c8493; font-size: 9px; }.record-detail-section > p { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #14151c; color: #aaa3b0; font-size: 9px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.record-timeline { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }.record-timeline div { padding: 10px 12px; border-left: 2px solid rgba(169,122,255,.25); background: rgba(139,92,246,.035); border-radius: 0 8px 8px 0; }.record-timeline span, .record-timeline b { display: block; }.record-timeline span { color: #5f5965; font-size: 7px; margin-bottom: 5px; }.record-timeline b { color: #a49daa; font-size: 8px; }
.record-media-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }.record-media-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #14151c; }.record-media-preview { width: 100%; height: 150px; display: grid; place-items: center; overflow: hidden; border: 0; background: #08090d; color: #897d98; }.record-media-preview img, .record-media-preview video { width: 100%; height: 100%; object-fit: contain; object-position: center; }.record-media-preview audio { width: 85%; }.record-media-card footer { min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 7px 9px; }.record-media-card footer span { min-width: 0; flex: 1; overflow: hidden; color: #77717d; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; }.record-media-card footer button, .record-media-card footer a { border: 1px solid var(--line); border-radius: 6px; background: #191a21; color: #9a84ba; padding: 5px 7px; text-decoration: none; font-size: 7px; }
.record-media-preview.record-text-result { display: block; padding: 13px; overflow: auto; text-align: left; cursor: text; }.record-text-result p { margin: 0; color: #c5c0cb; font-size: 8px; line-height: 1.6; white-space: pre-wrap; }
.record-reference-list, .record-attempt-list { display: grid; gap: 7px; }.record-reference, .record-attempt { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.015); }.record-reference b, .record-reference small, .record-attempt b, .record-attempt small { display: block; }.record-reference b, .record-attempt b { color: #9e97a5; font-size: 8px; margin-bottom: 4px; }.record-reference small, .record-attempt small { color: #5c5661; font-size: 7px; }.record-reference button { border: 1px solid rgba(169,122,255,.18); border-radius: 7px; background: rgba(139,92,246,.08); color: #a98bd5; padding: 6px 8px; font-size: 7px; }.record-error { border-color: rgba(255,111,134,.15) !important; background: rgba(255,111,134,.035) !important; color: #d98998 !important; }

/* Dynamic catalog management */
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.catalog-toolbar small, .catalog-toolbar strong, .catalog-toolbar span { display: block; }
.catalog-toolbar small { color: #70598f; font-size: 7px; letter-spacing: .16em; margin-bottom: 4px; }.catalog-toolbar strong { color: #d2ccd8; font-size: 11px; }.catalog-toolbar span { color: #57525d; font-size: 7px; margin-top: 4px; }
.catalog-toolbar > div:last-child { display: flex; gap: 7px; }
.catalog-toolbar button { border: 1px solid rgba(169,122,255,.2); background: rgba(139,92,246,.11); color: #baa0e3; border-radius: 8px; padding: 8px 10px; font-size: 8px; }
.catalog-content { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 22px 22px; display: grid; gap: 18px; }
.catalog-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }.catalog-section-head span { color: #8d8794; font-size: 9px; font-weight: 650; }.catalog-section-head small { color: #55515b; font-size: 7px; }
.admin-model-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.admin-model-card { padding: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.018); border-radius: 11px; }
.admin-model-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; }
.admin-model-head > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg,#9669e5,#5c4db8); color: white; font-style: normal; font-size: 8px; font-weight: 800; }
.admin-model-head strong, .admin-model-head small { display: block; }.admin-model-head strong { color: #d0cad6; font-size: 9px; }.admin-model-head small { color: #5e5964; font-size: 7px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-model-head button, .spec-actions button { border: 1px solid var(--line); background: #171820; color: #7f7985; border-radius: 6px; padding: 5px 7px; font-size: 7px; }
.admin-model-meta { display: flex; gap: 6px; margin-top: 10px; }.admin-model-meta span { color: #7a7282; background: #171820; border: 1px solid var(--line); border-radius: 5px; padding: 4px 6px; font-size: 7px; }
.spec-list { margin-top: 10px; border-top: 1px solid var(--line); }.spec-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 1px; border-bottom: 1px solid rgba(255,255,255,.035); }.spec-row b,.spec-row small { display: block; }.spec-row b { color: #99929f; font-size: 8px; }.spec-row small { color: #55515a; font-size: 7px; margin-top: 3px; }.spec-actions { display: flex; gap: 4px; }
.spec-add { border: 1px dashed rgba(169,122,255,.18); background: rgba(139,92,246,.045); color: #8873a7; border-radius: 6px; padding: 6px 8px; font-size: 7px; }
.route-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }.route-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }.route-table th { padding: 9px; background: #14151c; color: #5b5661; font-size: 7px; text-align: left; }.route-table td { padding: 10px 9px; border-top: 1px solid var(--line); color: #8c8692; font-size: 7px; }.route-table td:first-child b,.route-table td:first-child small { display: block; }.route-table td:first-child b { color: #b9b2bf; font-size: 8px; }.route-table td:first-child small { color: #554f5b; margin-top: 3px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.route-table th:first-child { width: 20%; }.route-table th:nth-child(2){width:14%}.route-table th:last-child{width:14%}
.health-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border-radius: 5px; color: #77717d; background: #171820; }.health-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #69636f; }.health-badge.healthy { color: #69c990; background: rgba(86,212,145,.06); }.health-badge.healthy::before { background: var(--green); }.health-badge.unhealthy { color: #dc7a8b; background: rgba(255,111,134,.06); }.health-badge.unhealthy::before { background: var(--red); }
.route-actions { display: flex; gap: 4px; justify-content: flex-end; }.route-actions button { border: 1px solid var(--line); background: #171820; color: #817a87; border-radius: 6px; padding: 5px 7px; font-size: 7px; }.route-actions button.test { color: #aa8fd3; border-color: rgba(169,122,255,.15); }

/* Encrypted JSON backups */
.backup-admin-pane { overflow: hidden; }
.backup-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.backup-toolbar small,.backup-toolbar strong,.backup-toolbar span { display: block; }.backup-toolbar small { color: #70598f; font-size: 7px; letter-spacing: .16em; }.backup-toolbar strong { margin-top: 4px; color: #d2ccd8; font-size: 12px; }.backup-toolbar span { margin-top: 5px; color: #5d5863; font-size: 8px; }
.backup-toolbar button { border: 1px solid rgba(169,122,255,.25); border-radius: 9px; background: rgba(139,92,246,.15); color: #c2a8e9; padding: 9px 13px; font-size: 8px; }.backup-toolbar button:disabled { opacity: .5; }
.backup-status { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 16px 22px; }.backup-status article { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); }.backup-status span,.backup-status strong,.backup-status small { display: block; }.backup-status span { color: #625d68; font-size: 7px; }.backup-status strong { margin: 7px 0 5px; color: #c2bbc8; font-size: 11px; }.backup-status small { color: #57525c; font-size: 7px; }.backup-status small.backup-error { color: #d47a89; }
.backup-table-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0 22px 20px; }.backup-table { width: 100%; min-width: 760px; border-collapse: collapse; }.backup-table th { position: sticky; top: 0; padding: 10px 9px; border-bottom: 1px solid var(--line); background: #101118; color: #5d5863; text-align: left; font-size: 7px; }.backup-table td { padding: 11px 9px; border-bottom: 1px solid rgba(255,255,255,.045); color: #918a98; font-size: 8px; }.backup-fingerprint { color: #6e6873 !important; font-family: ui-monospace,Consolas,monospace; }.backup-restore-button { border: 1px solid rgba(255,111,134,.15); border-radius: 7px; background: rgba(255,111,134,.045); color: #d37b8a; padding: 6px 9px; font-size: 7px; }
.backup-restore-dialog p { line-height: 1.7; }.backup-restore-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.backup-restore-actions button { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #171820; color: #817a87; font-size: 8px; }.backup-restore-actions button:last-child { border-color: rgba(255,111,134,.2); background: rgba(255,111,134,.08); color: #df8392; }
.catalog-editor-layer { z-index: 46; }.catalog-editor { max-height: 92vh; overflow-y: auto; }.route-editor { width: min(560px,calc(100vw - 30px)); }
.catalog-editor textarea { width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--line); outline: 0; background: #15161d; color: #d4ceda; border-radius: 8px; padding: 9px 10px; font-size: 9px; line-height: 1.5; }
.catalog-editor select { width: 100%; border: 1px solid var(--line); outline: 0; background: #15161d; color: #d4ceda; border-radius: 8px; padding: 9px 10px; font-size: 9px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }.editor-grid.three { grid-template-columns: repeat(3,1fr); }.editor-grid.four { grid-template-columns: repeat(4,1fr); }.editor-grid label { margin-top: 14px; }
.editor-divider { color: #716a79; border-top: 1px solid var(--line); padding-top: 13px; margin-top: 17px; font-size: 8px; font-weight: 700; }
.secret-hint { color: #564f5d; font-size: 7px; margin-top: 5px; }.check-line { display: flex !important; gap: 7px; align-items: center; }.check-line input { width: auto; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 205px 1fr; }
  .settings-panel { display: none; }
  .prompt-suggestions { max-width: 620px; margin-left: auto; margin-right: auto; }
  .library-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .record-filters { grid-template-columns: repeat(4,1fr); }.record-search { grid-column: span 2; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; height: auto; display: block; }
  .sidebar { min-height: auto; height: 58px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }
  .new-chat, .nav-label, .side-nav, .history-section, .account-card { display: none; }
  .workspace { min-height: calc(100vh - 58px); grid-template-rows: 64px minmax(360px, 1fr) auto; }
  .topbar { padding: 0 16px; }
  .topbar-meta .divider, .topbar-meta .points-pill { display: none; }
  .chat-feed { padding: 22px 14px 15px; }
  .job-images { height: 250px; }
  .welcome-card { margin-top: 16px; }
  .prompt-suggestions { grid-template-columns: 1fr; max-width: 360px; }
  .composer-wrap { padding: 8px 12px 14px; }
  .composer-footer { align-items: stretch; flex-direction: column; }
  .generate-wrap { justify-content: flex-end; }
  .generate-wrap > small { display: none; }
  .generate-button { flex: 1; }
  .image-preview-layer { padding: 10px; }
  .image-preview-dialog { width: 100%; height: 92vh; border-radius: 15px; }
  .composer-tools { justify-content: space-between; }
  .char-count { display: none; }
  .auth-screen { display: block; overflow-y: auto; padding: 28px 0; }
  .auth-visual { display: none; }
  .auth-card { margin: 20px auto; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 38px; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-dialog { height: 94vh; }
  .create-user-panel { grid-template-columns: 1fr 1fr; }
  .user-table { min-width: 850px; }
  .admin-model-list { grid-template-columns: 1fr; }
  .record-filters { grid-template-columns: 1fr 1fr; }.record-search { grid-column: span 2; }.record-detail-summary, .record-timeline { grid-template-columns: 1fr 1fr; }.record-media-grid { grid-template-columns: 1fr 1fr; }.record-footer { align-items: stretch; flex-direction: column; gap: 9px; }.record-footer > div { justify-content: center; }
  .catalog-toolbar { align-items: flex-start; gap: 10px; }.catalog-toolbar > div:last-child { flex-direction: column; }
  .backup-status { grid-template-columns: 1fr; }.backup-toolbar { align-items: flex-start; gap: 10px; }.backup-toolbar > div { min-width: 0; }
  .editor-grid.three, .editor-grid.four { grid-template-columns: 1fr; gap: 0; }
  .library-dialog { width: 100%; height: 94vh; }.library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 14px; }.library-toolbar { flex-wrap: wrap; }.library-toolbar span { width: 100%; order: 2; }.library-media { height: 170px; }.library-pagination { align-items: stretch; flex-direction: column; }.library-pagination > span { text-align: center; }.library-pagination > div { justify-content: center; }
}
