@font-face {
  font-family: KrakenApple;
  src: url('assets/SFArabic.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #080608;
  --panel: #151014;
  --line: rgba(225, 176, 194, .11);
  --muted: #a0949c;
  --text: #eee8ec;
  --red: #d53958;
  --font: KrakenApple, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
@supports (height: 100dvh) { body { height: 100dvh; } }
.no-script { position: fixed; z-index: 210; bottom: 28px; left: 20px; right: 20px; color: #cbb7c3; text-align: center; font-size: 13px; }
button, input, textarea, select { font: inherit; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
button, input, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #ce8298; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .35; }
button:not(:disabled) { transition: color .18s, background .18s, border-color .18s, transform .18s; }
button:not(:disabled):active { transform: translateY(1px); }
svg { width: 18px; height: 18px; stroke-width: 1.6; vertical-align: middle; flex-shrink: 0; }
button > span[data-icon] { display: inline-flex; align-items: center; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 550; }
kbd { font: 10px var(--font); color: #96868f; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The canvas and its fallback share one subdued crimson atmosphere. */
.atmosphere { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 43% 48%, rgba(113, 13, 40, .23), transparent 56%), radial-gradient(ellipse at 78% 68%, rgba(68, 9, 28, .19), transparent 49%), var(--bg); }
.atmosphere canvas { display: block; width: 100%; height: 100%; opacity: .72; }
.atmosphere-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 44%, transparent 20%, rgba(8, 6, 8, .65) 100%), linear-gradient(180deg, rgba(8, 6, 8, .28), transparent 42%, rgba(8, 6, 8, .62)); }
.app-shell, .workspace, .chat-view { height: 100%; min-height: 0; }
.app-shell { position: relative; }
.workspace { width: 100%; }
.chat-view { position: relative; display: flex; flex-direction: column; }
.chat-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.welcome { position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.kraken-mark { position: relative; display: block; overflow: hidden; mix-blend-mode: screen; flex-shrink: 0; pointer-events: none; }
.kraken-mark img { position: absolute; width: 107%; height: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); mix-blend-mode: screen; }
.welcome-mark { width: 76px; height: 55px; filter: drop-shadow(0 0 9px rgba(210, 24, 49, .16)); animation: float-mark 5.6s ease-in-out infinite; }
.chat-view.has-messages .welcome { display: none; }
.composer-area { position: relative; z-index: 1; width: min(560px, calc(100% - 96px)); flex-shrink: 0; margin: 16px auto 49px; }
.composer { display: flex; align-items: flex-end; gap: 12px; padding: 13px 13px 13px 17px; border: 1px solid rgba(195, 129, 151, .15); border-radius: 17px; background: rgba(22, 14, 20, .87); box-shadow: 0 8px 38px rgba(0, 0, 0, .17), inset 0 1px 0 rgba(255, 255, 255, .02); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(203, 113, 142, .44); box-shadow: 0 8px 38px rgba(0, 0, 0, .2), 0 0 0 3px rgba(181, 43, 82, .035); }
.composer textarea { display: block; flex: 1; min-width: 0; width: 100%; min-height: 27px; max-height: 160px; padding: 2px 0; border: 0; resize: none; background: transparent; color: #eee5eb; font-size: 12px; line-height: 23px; }
.composer textarea::placeholder { color: #a18e99; }
.attach-inline { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid rgba(195, 129, 151, .16); border-radius: 9px; color: #b995aa; }
.attach-inline svg { width: 16px; height: 16px; transition: transform .2s ease; }
.attach-inline:hover svg, .attach-inline[aria-expanded='true'] svg { transform: rotate(90deg); }
.attach-inline svg { width: 15px; height: 15px; }
.attach-inline:hover { border-color: rgba(203, 113, 142, .44); background: rgba(199, 91, 137, .12); color: #f1d5e1; }
.typing-indicator { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; }
.typing-indicator i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #d27096; animation: typing-pulse 1.05s ease-in-out infinite; }
.typing-indicator i:nth-child(2) { animation-delay: .14s; }
.typing-indicator i:nth-child(3) { animation-delay: .28s; }
.send-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border: 1px solid rgba(239, 104, 143, .14); border-radius: 9px; background: #51182a; color: #efd0dc; }
.send-button:not(:disabled):hover { background: #6a2037; }
.send-button svg { width: 15px; height: 15px; stroke-width: 1.8; }
.send-button.is-loading { opacity: 1; background: #6a2037; }
.send-spinner { width: 13px; height: 13px; border: 2px solid rgba(239, 208, 220, .35); border-top-color: #efd0dc; border-radius: 50%; animation: send-spin .75s linear infinite; }
.composer-foot { margin-top: 10px; color: #8f7c88; text-align: center; font-size: 9px; letter-spacing: .06px; }
.context-tray { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.context-tray:empty { display: none; }
.context-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(34, 17, 27, .9); color: #c9a5b5; font-size: 10px; }
.context-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-chip svg { width: 13px; height: 13px; }
.context-chip button { flex-shrink: 0; padding: 0 2px; color: #c79bab; font-size: 15px; line-height: 17px; }

/* History and every secondary action live behind the single workspace button. */
.menu-trigger { position: fixed; z-index: 5; left: 22px; bottom: 22px; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(193, 147, 168, .1); border-radius: 12px; background: rgba(21, 13, 19, .7); color: #a58d9b; }
.menu-trigger svg { width: 17px; height: 17px; }
.menu-trigger:hover, .menu-trigger[aria-expanded='true'] { color: #e3bccd; border-color: rgba(196, 111, 144, .28); background: #25121e; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: #ae94a2; flex-shrink: 0; }
.icon-button:hover { color: #f0d8e2; background: rgba(205, 116, 152, .08); }
.icon-button svg { width: 16px; height: 16px; }
dialog { padding: 0; width: min(670px, calc(100vw - 64px)); max-height: calc(100vh - 80px); border: 1px solid rgba(190, 126, 153, .18); border-radius: 18px; background: #151015; color: var(--text); box-shadow: 0 24px 100px rgba(0, 0, 0, .62); }
dialog:not([open]) { display: none; }
dialog::backdrop { background: rgba(5, 2, 5, .56); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.workspace-panel { position: fixed; inset: auto auto 68px 22px; margin: 0; width: min(320px, calc(100vw - 44px)); max-height: calc(100vh - 104px); border-radius: 17px; background: rgba(23, 15, 22, .98); overflow: auto; }
.workspace-panel::backdrop { background: rgba(5, 2, 5, .23); backdrop-filter: none; -webkit-backdrop-filter: none; }
.quick-add-menu { position: fixed; inset: auto auto 111px max(22px, calc(50% - 280px)); margin: 0; width: min(320px, calc(100vw - 44px)); max-height: calc(100vh - 150px); border-radius: 16px; background: rgba(32, 30, 31, .985); border-color: rgba(220, 192, 204, .16); overflow: auto; }
.quick-add-menu::backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.quick-add-list { display: grid; gap: 2px; padding: 8px; }
.quick-add-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 36px; padding: 8px 10px; border-radius: 8px; color: #e3dce0; text-align: left; font-size: 12px; }
.quick-add-item:hover, .quick-add-item:focus-visible { background: rgba(198, 92, 135, .18); color: #fff2f7; outline: none; }
.quick-add-item svg { width: 17px; height: 17px; flex: 0 0 auto; color: #d9cbd2; }
.quick-add-item kbd { margin-left: auto; color: #a99aa2; font: 11px var(--font); }
.quick-add-chevron { margin-left: auto; color: #a99aa2; font-size: 21px; line-height: 12px; }
.quick-add-chevron-down { color: #b1d9ff; font-size: 18px; }
.panel-content { padding: 13px 11px 10px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 9px 9px; }
.panel-heading h2 { color: #ded0d8; font-size: 13px; font-weight: 550; letter-spacing: -.1px; }
.menu-section { display: grid; gap: 2px; }
.menu-section > h3, .menu-section > h4, .menu-section > p { padding: 7px 10px; color: #997b8b; font-size: 9px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.menu-item { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c4b3be; text-align: left; font-size: 11px; }
.menu-item svg { width: 15px; height: 15px; color: #b2859a; }
.menu-item:hover, .menu-item.active { color: #f0dce6; background: rgba(198, 92, 135, .08); }
.menu-shortcut { margin-left: auto; color: #8f7180; font-size: 9px; }
.menu-separator { height: 1px; margin: 9px 7px; border: 0; background: var(--line); }
.menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px 2px; color: #8f7784; font-size: 9px; }
.local-status { display: inline-flex; align-items: center; gap: 6px; color: #b496a4; font-size: 9px; }
.status-dot { display: inline-block; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #bf768e; box-shadow: 0 0 7px rgba(185, 64, 103, .16); }
.nav-count { min-width: 19px; margin-left: auto; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; color: #bb94a5; font-size: 9px; line-height: 17px; text-align: center; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 7px 3px 10px; color: #a58296; font-size: 8px; letter-spacing: 1.1px; }
.history-heading .icon-button { width: 25px; height: 25px; }
.history-heading svg { width: 13px; height: 13px; }
.history-search { width: calc(100% - 12px); margin: 5px 6px 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #100b10; color: var(--text); font-size: 11px; }
.history-search::placeholder { color: #8d7684; }
.history { max-height: 150px; overflow: auto; }
.history-empty { padding: 9px 10px; color: #9c8492; font-size: 10px; line-height: 1.8; }
.history-item { display: flex; align-items: center; margin-bottom: 2px; border-radius: 8px; }
.history-item:hover, .history-item.selected { background: rgba(198, 92, 135, .06); }
.history-item > button:first-child { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 9px 10px; color: #bca6b4; text-align: left; font-size: 10px; }
.history-item > button:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item > button:first-child svg { width: 13px; height: 13px; color: #947385; }
.delete-chat { display: grid; place-items: center; width: 27px; height: 27px; margin-right: 3px; color: #977080; opacity: .55; }
.history-item:hover .delete-chat, .history-item:focus-within .delete-chat { opacity: 1; }
.delete-chat svg { width: 12px; height: 12px; }

/* Conversation content stays narrow and lets the surrounding space breathe. */
.messages { width: min(650px, 100%); margin: auto; padding: 70px 34px 12px; }
.messages:empty { display: none; }
.message { margin-bottom: 31px; }
.message-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: #d7becb; font-size: 11px; }
.message-avatar { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(166, 108, 135, .1); border-radius: 8px; background: #251720; color: #d7b3c3; font-size: 9px; }
.message-avatar img { width: 16px; height: 16px; object-fit: contain; border-radius: 4px; }
.message.assistant .message-avatar { background: #351421; color: #df779b; }
.message-head small { color: #a08191; font-size: 9px; }
.message time { margin-left: auto; color: #9a7e8c; font-size: 9px; }
.message-body { padding-left: 33px; color: #cbb7c3; font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-body { color: #e6d8e1; }
.message-actions { display: flex; gap: 8px; padding-left: 33px; margin-top: 8px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; color: #a48294; font-size: 10px; }
.text-button:hover { color: #e0b7ca; }
.text-button svg { width: 12px; height: 12px; }
.message-attachment { display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 33px); margin: 10px 0 0 33px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(49, 22, 36, .45); color: #c49aaf; font-size: 10px; overflow-wrap: anywhere; }
.message-attachment svg { width: 13px; height: 13px; }

/* Library, settings and future connections appear only in their options sheet. */
.options-sheet { width: min(780px, calc(100vw - 64px)); max-height: calc(100vh - 80px); overflow: hidden; }
.options-sheet[open] { display: flex; flex-direction: column; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-shrink: 0; padding: 20px 27px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { color: #e1ccd8; font-size: 15px; letter-spacing: -.2px; }
.sheet-header p { margin-top: 4px; color: #a78a9b; font-size: 10px; }
.secondary-view { min-height: 0; overflow: auto; padding: 27px; }
.section-eyebrow { margin-bottom: 9px; color: #b28da1; font-size: 8px; letter-spacing: 1.7px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-heading h1 { color: #ead9e3; font-size: 25px; letter-spacing: -.7px; }
.page-heading p, .page-intro { margin-top: 8px; color: #b298a9; font-size: 11px; line-height: 1.8; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; padding: 9px 13px; border: 1px solid rgba(220, 137, 171, .19); border-radius: 8px; background: #713047; color: #f3d8e4; font-size: 10px; }
.primary-button:hover { background: #893b56; }
.secondary-button { background: #261720; color: #d0a7bb; border-color: var(--line); }
.secondary-button:hover { background: #34202c; }
.primary-button svg, .secondary-button svg { width: 14px; height: 14px; }
.search-box { display: flex; align-items: center; gap: 9px; max-width: 400px; padding: 10px 12px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 9px; background: #100b10; color: #a68396; }
.search-box:focus-within { border-color: #8a4d68; }
.search-box input { min-width: 0; width: 100%; border: 0; background: none; color: #e7d1df; font-size: 11px; }
.search-box input::placeholder { color: #9c7e8f; }
.search-box svg { width: 15px; height: 15px; }
.library-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #a38194; font-size: 9px; }
.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skill-card { display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, #21131d, #181017); }
.skill-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.suggestion-icon { display: inline-flex; padding: 7px; border-radius: 8px; background: rgba(202, 103, 147, .07); color: #d49ab6; }
.suggestion-icon svg { width: 15px; height: 15px; }
.skill-tag { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; color: #bc8fa5; font-size: 7px; letter-spacing: .8px; }
.skill-card h2 { margin-bottom: 7px; color: #e3cedb; font-size: 14px; font-weight: 500; }
.skill-card p { margin-bottom: 19px; color: #b192a5; font-size: 10px; line-height: 1.8; }
.skill-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.skill-card-footer > span { color: #a17a90; font-size: 9px; }
.skill-card-footer button { display: flex; align-items: center; gap: 5px; color: #d7a9c0; font-size: 10px; }
.skill-card-footer button:hover { color: #fff0f7; }
.skill-card-footer svg { width: 12px; height: 12px; }
.library-note { display: flex; gap: 8px; margin-top: 20px; color: #a6889a; font-size: 10px; line-height: 1.9; }
.library-note svg { width: 14px; height: 14px; margin-top: 2px; }
.empty-state { grid-column: 1 / -1; padding: 30px; border: 1px dashed #583044; border-radius: 12px; color: #bea0b1; font-size: 11px; text-align: center; }
.connection-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 19px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #24131e; }
.connection-banner > span { color: #d096b1; }
.connection-banner strong { color: #e4c6d7; font-size: 12px; font-weight: 500; }
.connection-banner p { margin-top: 4px; color: #b490a5; font-size: 10px; line-height: 1.8; }
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.connection-card { min-width: 0; padding: 19px 16px; border: 1px solid var(--line); border-radius: 12px; background: #1c111a; }
.provider-logo { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 18px; border-radius: 10px; background: #311b28; color: #d6a3be; font-size: 23px; }
.provider-logo.codex { font: 19px monospace; }
.connection-card h2 { color: #e4ccda; font-size: 14px; }
.connection-card p { min-height: 65px; margin-top: 7px; color: #b38da5; font-size: 10px; line-height: 1.9; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 17px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; color: #bd92a9; font-size: 8px; }
.connection-state::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #ae6c8b; }
.roadmap { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 25px; color: #bb91a8; font-size: 10px; }
.roadmap span { display: flex; align-items: center; gap: 7px; }
.roadmap b { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #62384e; border-radius: 50%; color: #d8a6bf; font-size: 9px; font-weight: 400; }
.connection-details { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); color: #b58fa7; font-size: 10px; line-height: 1.9; }
.connection-details strong { color: #d7b3c8; font-weight: 500; }
.settings-panel { padding: 0 20px; border: 1px solid var(--line); border-radius: 13px; background: #1c111a; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 23px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h2 { color: #dfc5d5; font-size: 12px; font-weight: 500; }
.setting-row p { margin-top: 5px; color: #b48da4; font-size: 10px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 35px; height: 20px; flex-shrink: 0; border: 1px solid #61364c; border-radius: 12px; background: #35202e; cursor: pointer; transition: background .2s; }
.switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #bd94ab; transition: transform .2s; }
.switch:checked { background: #973b60; }
.switch:checked::before { transform: translateX(15px); background: #f2d5e5; }
.about-card { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 13px 0; color: #b18ba2; }
.about-card .kraken-mark { width: 46px; height: 34px; }
.about-card strong { color: #dfbdd2; font-size: 12px; }
.about-card p { margin-top: 4px; font-size: 9px; }
.about-card > span { margin-left: auto; font-size: 9px; }

/* Source text stays plain text inside a scrollable, keyboard-accessible dialog. */
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 25px; border-bottom: 1px solid var(--line); }
.modal-header h2 { color: #e5cbdc; font-size: 20px; letter-spacing: -.5px; }
.modal-header p { margin-top: 6px; color: #b28aa3; font-size: 10px; overflow-wrap: anywhere; }
.modal-body { max-height: calc(100vh - 230px); padding: 22px 25px; overflow: auto; }
.modal-body > .page-intro { margin: 0 0 19px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 11px; padding: 16px 25px; border-top: 1px solid var(--line); }
.desktop-offer { text-align: center; }
.desktop-offer-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 17px; border: 1px solid rgba(220, 137, 171, .22); border-radius: 15px; background: rgba(112, 48, 71, .32); color: #efb4ca; }
.desktop-offer-mark svg { width: 25px; height: 25px; }
.desktop-offer h3 { color: #f0dbe5; font-size: 18px; font-weight: 550; }
.desktop-offer p { max-width: 450px; margin: 11px auto 0; color: #b99eac; font-size: 11px; line-height: 1.8; }
.desktop-offer .desktop-offer-note { color: #d8aec1; }
.skill-source { margin: 0; color: #c0a2b5; font: 11px/1.9 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.file-details { margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); }
.file-details summary { color: #d4aec5; font-size: 11px; cursor: pointer; overflow-wrap: anywhere; }
.file-details pre { margin-top: 13px; }
.picker-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.picker-row input { width: 16px; height: 16px; flex-shrink: 0; accent-color: #c25786; }
.picker-row strong { display: block; color: #e2c5d8; font-size: 12px; font-weight: 500; }
.picker-row small { display: block; margin-top: 4px; color: #ae839e; font-size: 10px; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 110px)); padding: 11px 16px; border: 1px solid #694055; border-radius: 10px; background: #271521; box-shadow: 0 8px 35px #0008; color: #e6c9dc; font-size: 11px; }
.toast.error { border-color: #a24c69; background: #3b182a; }
.busy { opacity: .6; pointer-events: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { border-radius: 4px; background: #9e657c40; }
::selection { color: #fff; background: #9f436466; }

/* Static visibility does not depend on a compositor animation being scheduled. */
body.showing-splash .app-shell, body.showing-splash .menu-trigger { visibility: hidden; pointer-events: none; }
body.is-intro-active { overflow: hidden; }
.particle-intro { position: fixed; z-index: 160; inset: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 48%, rgba(228, 30, 37, .12), transparent 27%), #080608; opacity: 1; transition: opacity .62s ease; }
.particle-intro.is-done { opacity: 0; pointer-events: none; }
.particle-intro canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.splash { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: rgba(8, 6, 8, .12); transition: opacity .65s ease; }
.splash-content { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 28px; margin-top: -28px; border-radius: 24px; isolation: isolate; }
.splash-content::before { content: ''; position: absolute; z-index: -1; width: 230px; height: 210px; left: 50%; top: -42px; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(194, 15, 43, .08), transparent 69%); pointer-events: none; }
.splash-content:focus-visible { outline: 1px solid rgba(206, 130, 152, .55); outline-offset: 6px; }
.splash-content:not(:disabled):active { transform: none; }
.splash-mark { width: 116px; height: 84px; margin: 0 auto 12px; filter: drop-shadow(0 0 10px rgba(218, 19, 46, .15)); animation: float-mark 5.6s ease-in-out infinite; }
.shimmer-text { color: #fff; font-size: 26px; font-weight: 520; letter-spacing: -.65px; line-height: 1.25; background: linear-gradient(100deg, #fff 0%, #fff 40%, #a2aab7 48%, #f5f7fc 53%, #fff 60%, #fff 100%); background-size: 250% 100%; background-position: -100% 50%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: silver-pass 5.2s ease-in-out infinite; }
.splash.leaving { opacity: 0; pointer-events: none; }
.splash.dismissed { display: none; }
body.entering-workspace .app-shell { animation: workspace-in .8s ease-out; }
body.auth-locked .splash, body.auth-locked .app-shell { visibility: hidden; pointer-events: none; }
.account-gate { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 28px; background: rgba(8, 6, 8, .2); }
.account-card { width: min(410px, 100%); padding: 30px; border: 1px solid rgba(219, 139, 171, .2); border-radius: 20px; background: rgba(23, 15, 22, .96); box-shadow: 0 24px 100px rgba(0, 0, 0, .62); }
.account-eyebrow { margin-bottom: 10px; color: #bd91a7; font-size: 9px; letter-spacing: 1.8px; }
.account-card h1 { color: #f0dce7; font-size: 26px; letter-spacing: -.7px; }
.account-lead { margin-top: 8px; color: #b79aaa; font-size: 11px; line-height: 1.8; }
.account-form { display: grid; gap: 8px; margin-top: 22px; }
.account-form label { color: #d6b8c8; font-size: 10px; }
.account-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #100b10; color: var(--text); font-size: 12px; }
.account-form input:focus { border-color: #a45776; }
.account-form .primary-button { margin-top: 4px; }
.account-actions { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.text-link { color: #d5a6bc; font-size: 10px; }
.text-link:hover { color: #fff0f7; }
.account-feedback { min-height: 18px; margin-top: 14px; color: #d8a7ba; font-size: 10px; line-height: 1.6; }
.account-feedback.error { color: #f39aab; }
.account-security { display: block; margin-top: 14px; color: #8f7785; font-size: 9px; line-height: 1.65; text-align: center; }
.created-code { margin-top: 18px; padding: 13px; border: 1px solid rgba(210, 126, 159, .3); border-radius: 10px; background: #281622; color: #f2d4e1; font: 11px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.created-code button { display: block; margin-top: 9px; color: #e5aac0; font: 10px var(--font); }
.created-code .primary-button { width: 100%; margin-top: 13px; color: #160d13; font: 600 11px var(--font); }
.profile-card { margin-top: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 13px; background: #1c111a; }
.profile-card h2 { color: #dfc5d5; font-size: 12px; font-weight: 500; }
.profile-card p { margin-top: 5px; color: #a9899b; font-size: 10px; line-height: 1.7; }
.profile-row { display: flex; gap: 8px; margin-top: 12px; }
.profile-row input { min-width: 0; flex: 1; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #100b10; color: var(--text); font-size: 11px; }
.profile-row button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #291824; color: #d3a6ba; font-size: 10px; }
.profile-row button:hover { background: #3b2230; }
body.authenticated .account-gate { display: none; }
@media (max-width: 450px) { .account-gate { padding: 18px; } .account-card { padding: 23px; } .profile-row { align-items: stretch; flex-direction: column; } }
@keyframes float-mark { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes send-spin { to { transform: rotate(360deg); } }
@keyframes typing-pulse { 0%, 60%, 100% { transform: translateY(0); opacity: .38; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes silver-pass { 0%, 15% { background-position: -100% 50%; } 75%, 100% { background-position: 200% 50%; } }
@keyframes workspace-in { from { transform: translateY(6px) scale(1.003); } to { transform: translateY(0) scale(1); } }

@media (max-height: 580px) {
  .welcome { top: 40%; }
  .composer-area { margin-bottom: 31px; }
  .messages { padding-top: 49px; }
  .options-sheet, dialog { max-height: calc(100vh - 52px); }
  .sheet-header { padding-top: 15px; padding-bottom: 15px; }
  .secondary-view { padding-top: 22px; }
  .history { max-height: 110px; }
}
@media (max-width: 680px) {
  .composer-area { width: calc(100% - 84px); max-width: 560px; }
  .options-sheet, dialog { width: calc(100vw - 40px); }
  .workspace-panel { width: min(320px, calc(100vw - 44px)); }
  .sheet-header { padding-left: 22px; padding-right: 22px; }
  .secondary-view { padding: 23px 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading h1 { font-size: 23px; }
  .connection-grid { grid-template-columns: 1fr; }
  .connection-card p { min-height: 0; }
  .provider-logo { margin-bottom: 13px; }
  .connection-card { padding: 18px; }
  .setting-row { gap: 15px; }
  .settings-panel { padding: 0 16px; }
  .modal-header, .modal-body { padding: 20px; }
  .modal-footer { padding: 14px 20px; }
}
@media (max-width: 450px) {
  .composer-area { width: calc(100% - 38px); margin-bottom: calc(83px + env(safe-area-inset-bottom)); }
  .menu-trigger { left: max(22px, env(safe-area-inset-left)); bottom: calc(22px + env(safe-area-inset-bottom)); }
  .workspace-panel { bottom: calc(68px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 104px - env(safe-area-inset-bottom)); }
  .composer textarea, .search-box input, .history-search { font-size: 16px; }
  .welcome { top: 40%; }
  .messages { padding: 47px 20px 8px; }
  .message-body, .message-actions { padding-left: 0; }
  .message-attachment { margin-left: 0; }
  .skill-grid { grid-template-columns: 1fr; }
  .library-meta > span:last-child { display: none; }
  .setting-row { align-items: flex-start; }
  .setting-row .secondary-button { padding: 8px; font-size: 9px; }
  .about-card > span { max-width: 72px; text-align: right; }
  .modal-footer { flex-wrap: wrap; }
  .toast { bottom: 72px; max-width: calc(100vw - 38px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
