@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap");

:root {
  --bg: #140A0A;
  --panel: #180D0D;
  --panel-2: #1B0F0F;
  --sidebar: #100707;
  --border: #2A1A1A;
  --text: #F2E9E9;
  --muted: #BD9C9C;
  --accent: #D14B4B;
  --accent-2: #FF9B9B;
  --scrollbar-track: #120808;
  --scrollbar-thumb: #7A2A2A;
  --scrollbar-thumb-2: #B53C3C;
  --scrollbar-thumb-hover: #D14B4B;
  --chat-width: 760px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
  background: linear-gradient(180deg, var(--scrollbar-thumb), var(--scrollbar-thumb-2));
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), var(--scrollbar-thumb));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(96, 32, 32, 0.35) 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(82, 22, 22, 0.3) 0%, transparent 60%),
    var(--bg);
}

body.settings-reduce-motion *,
body.settings-reduce-motion *::before,
body.settings-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.settings-compact .chat {
  gap: 12px;
}

body.settings-compact .workspace-panel {
  padding-top: 8px;
  padding-bottom: 10px;
}

body.settings-compact .msg,
body.settings-compact .composer,
body.settings-compact .composer-meta,
body.settings-compact .attachment-list {
  padding-left: 12px;
  padding-right: 12px;
}

.app {
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.app.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.app.home-mode,
.app.home-mode.sidebar-collapsed {
  grid-template-columns: 1fr;
}

.app.home-mode .sidebar {
  display: none;
}

.app.home-mode .topbar {
  display: none;
}

.app.home-mode .main {
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.app.incognito-chat-theme:not(.home-mode) {
  --bg: #14191f;
  --panel: #1a2027;
  --panel-2: #222a33;
  --sidebar: #171d24;
  --border: #35414d;
  --text: #edf2f6;
  --muted: #95a1ae;
  --accent: #2c3641;
  --accent-2: #c7d0d8;
  --scrollbar-track: #161c22;
  --scrollbar-thumb: #4b5866;
  --scrollbar-thumb-2: #63707d;
  --scrollbar-thumb-hover: #74818f;
  color-scheme: dark;
}

.app.incognito-chat-theme:not(.home-mode) .sidebar {
  background: linear-gradient(180deg, #1b2128 0%, #141a21 100%);
}

.app.incognito-chat-theme:not(.home-mode) .main {
  background: linear-gradient(180deg, rgba(18, 23, 29, 0.98) 0%, rgba(13, 17, 22, 0.98) 100%);
}

.app.incognito-chat-theme:not(.home-mode) .topbar,
.app.incognito-chat-theme:not(.home-mode) .composer-wrap {
  background: rgba(20, 26, 32, 0.94);
}

.app.incognito-chat-theme:not(.home-mode) .rok-logo-img {
  filter: grayscale(1) brightness(1.18) contrast(0.96);
}

.app.incognito-chat-theme:not(.home-mode) .rok-logo-topbar,
.app.incognito-chat-theme:not(.home-mode) .chat-welcome-logo {
  filter: grayscale(1) brightness(1.18) contrast(0.96) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.app.incognito-chat-theme:not(.home-mode) .title-text-logo {
  color: #d7dee6;
}

.app.incognito-chat-theme:not(.home-mode) button {
  border-color: #465260;
  background: linear-gradient(135deg, #313b47 0%, #222a33 100%);
  color: #eef2f5;
}

.app.incognito-chat-theme:not(.home-mode) button.ghost,
.app.incognito-chat-theme:not(.home-mode) .topbar-mode-btn,
.app.incognito-chat-theme:not(.home-mode) .sidebar-toggle-btn,
.app.incognito-chat-theme:not(.home-mode) .side-btn,
.app.incognito-chat-theme:not(.home-mode) .session-delete-btn,
.app.incognito-chat-theme:not(.home-mode) .workspace-tab,
.app.incognito-chat-theme:not(.home-mode) .workspace-mini-btn.ghost,
.app.incognito-chat-theme:not(.home-mode) .composer-plus-btn,
.app.incognito-chat-theme:not(.home-mode) .composer-tray-btn,
.app.incognito-chat-theme:not(.home-mode) .correct-me-btn {
  background: rgba(35, 43, 53, 0.92);
  border-color: #44515f;
  color: #d1dae3;
}

.app.incognito-chat-theme:not(.home-mode) .topbar-mode-btn.is-active,
.app.incognito-chat-theme:not(.home-mode) .workspace-tab.active,
.app.incognito-chat-theme:not(.home-mode) .composer-tray-btn.is-active,
.app.incognito-chat-theme:not(.home-mode) .side-item.active,
.app.incognito-chat-theme:not(.home-mode) .correct-me-btn:hover {
  background: #4c5967;
  border-color: #647383;
  color: #f5f8fb;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.app.incognito-chat-theme:not(.home-mode) .topbar-mode-btn:hover,
.app.incognito-chat-theme:not(.home-mode) .sidebar-toggle-btn:hover,
.app.incognito-chat-theme:not(.home-mode) .side-btn:hover,
.app.incognito-chat-theme:not(.home-mode) .side-item:hover,
.app.incognito-chat-theme:not(.home-mode) .session-delete-btn:hover,
.app.incognito-chat-theme:not(.home-mode) .workspace-tab:hover,
.app.incognito-chat-theme:not(.home-mode) .chat-welcome-chip:hover,
.app.incognito-chat-theme:not(.home-mode) .chat-welcome-chip:focus-visible,
.app.incognito-chat-theme:not(.home-mode) .composer-plus-btn.is-open,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-btn:hover,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-option:hover {
  background: #38434f;
  border-color: #52606d;
  color: #f3f6f9;
}

.app.incognito-chat-theme:not(.home-mode) .chat-welcome-title,
.app.incognito-chat-theme:not(.home-mode) .workspace-panel-title,
.app.incognito-chat-theme:not(.home-mode) .story-canvas-title {
  color: #f0f4f8;
}

.app.incognito-chat-theme:not(.home-mode) .chat-welcome-subtitle,
.app.incognito-chat-theme:not(.home-mode) .workspace-panel-hint,
.app.incognito-chat-theme:not(.home-mode) .story-canvas-status,
.app.incognito-chat-theme:not(.home-mode) .composer-model-label,
.app.incognito-chat-theme:not(.home-mode) .cooldown {
  color: #9aa6b3;
}

.app.incognito-chat-theme:not(.home-mode) .chat-welcome-chip,
.app.incognito-chat-theme:not(.home-mode) .knowledge-item,
.app.incognito-chat-theme:not(.home-mode) .bubble.story-status,
.app.incognito-chat-theme:not(.home-mode) .compacting-bar {
  background: rgba(34, 42, 52, 0.84);
  border-color: #43505d;
  color: #aeb9c6;
}

.app.incognito-chat-theme:not(.home-mode) .knowledge-count-badge,
.app.incognito-chat-theme:not(.home-mode) .knowledge-scope {
  background: rgba(52, 63, 75, 0.9);
  border: 1px solid #52606e;
  color: #d0d8e1;
}

.app.incognito-chat-theme:not(.home-mode) .knowledge-delete-btn {
  color: #8f9bab;
}

.app.incognito-chat-theme:not(.home-mode) .knowledge-delete-btn:hover {
  color: #e1e8ef;
}

.app.incognito-chat-theme:not(.home-mode) .workspace-tabs-top {
  border-bottom-color: #2e3944;
  background: rgba(20, 26, 32, 0.96);
}

.app.incognito-chat-theme:not(.home-mode) .workspace-panel {
  background: linear-gradient(180deg, rgba(21, 27, 33, 0.98) 0%, rgba(15, 20, 25, 0.98) 100%);
}

.app.incognito-chat-theme:not(.home-mode) .model-panel {
  background:
    radial-gradient(560px 260px at 50% 16%, rgba(92, 107, 122, 0.18) 0%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, rgba(22, 28, 34, 0.98) 0%, rgba(15, 20, 25, 0.98) 100%);
}

.app.incognito-chat-theme:not(.home-mode) .msg .avatar {
  background: #313b46;
  color: #d3dbe3;
  border-color: #465260;
}

.app.incognito-chat-theme:not(.home-mode) .msg.user .avatar {
  background: #38434f;
  color: #dce3ea;
  border-color: #4d5967;
}

.app.incognito-chat-theme:not(.home-mode) .msg.user .bubble {
  background: #232b34;
  border-color: #3a4652;
  color: #edf1f5;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.app.incognito-chat-theme:not(.home-mode) .msg.system .bubble {
  background: rgba(29, 36, 44, 0.74);
  border-color: #4c5967;
  color: #9ba6b3;
}

.app.incognito-chat-theme:not(.home-mode) .compacting-progress {
  background: #8f9cab;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown a {
  color: #b9c7d6;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown code,
.app.incognito-chat-theme:not(.home-mode) .bubble.markdown pre,
.app.incognito-chat-theme:not(.home-mode) .bubble.markdown details,
.app.incognito-chat-theme:not(.home-mode) .story-canvas,
.app.incognito-chat-theme:not(.home-mode) .story-canvas-body,
.app.incognito-chat-theme:not(.home-mode) .composer-field,
.app.incognito-chat-theme:not(.home-mode) .composer-tray,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-menu,
.app.incognito-chat-theme:not(.home-mode) textarea {
  background: #202831;
  border-color: #3a4652;
  color: #edf1f5;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown blockquote {
  background: #1b222a;
  border-left-color: #4a5664;
  color: #9ba6b3;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown hr,
.app.incognito-chat-theme:not(.home-mode) .bubble.markdown th,
.app.incognito-chat-theme:not(.home-mode) .bubble.markdown td,
.app.incognito-chat-theme:not(.home-mode) .bubble.markdown details[open] summary,
.app.incognito-chat-theme:not(.home-mode) .story-canvas-header,
.app.incognito-chat-theme:not(.home-mode) .composer-field-rail,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-group + .composer-model-picker-group {
  border-color: #3f4b57;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown th {
  background: #29323c;
  color: #dce3ea;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown tr:nth-child(even) td {
  background: rgba(37, 45, 55, 0.72);
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown summary,
.app.incognito-chat-theme:not(.home-mode) .bubble.markdown sup,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-group-label {
  color: #66717e;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown del {
  color: #7f8a96;
}

.app.incognito-chat-theme:not(.home-mode) .bubble.markdown mark {
  background: rgba(94, 107, 121, 0.52);
  color: #f3f6f9;
}

.app.incognito-chat-theme:not(.home-mode) .story-canvas-header {
  background: #242d36;
}

.app.incognito-chat-theme:not(.home-mode) .story-canvas-toggle,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-btn {
  background: #2b343e;
  border-color: #45515f;
  color: #eef2f6;
}

.app.incognito-chat-theme:not(.home-mode) .composer-field {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.app.incognito-chat-theme:not(.home-mode) .composer-field:focus-within,
.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-btn:focus,
.app.incognito-chat-theme:not(.home-mode) textarea:focus {
  border-color: #667585;
  box-shadow: 0 0 0 3px rgba(109, 122, 136, 0.32);
}

.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-chevron {
  border-top-color: #b7c0ca;
}

.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-option {
  color: #d8e0e8;
}

.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-option.is-active {
  background: #3a4551;
  border-color: #566576;
}

.app.incognito-chat-theme:not(.home-mode) .composer-model-picker-option-lock {
  border-color: #5a6571;
  background: #2c343d;
  color: #cdd5de;
}

.app.incognito-chat-theme:not(.home-mode) button.stop-mode {
  border-color: #5a6776;
  background: linear-gradient(135deg, #45515f 0%, #2b343d 100%);
  color: #f1f5f8;
}

.app.incognito-chat-theme:not(.home-mode) button.stop-mode::before {
  background: #f1f5f8;
}

.app.incognito-chat-theme:not(.home-mode) .send-ready {
  animation: send-pulse-incognito 2s ease-in-out infinite;
}

@keyframes send-pulse-incognito {
  0%, 100% { box-shadow: 0 0 0 0 rgba(116, 129, 143, 0); }
  50% { box-shadow: 0 0 0 4px rgba(116, 129, 143, 0.24); }
}

.app.is-hidden {
  display: none;
}

.app.is-ban-locked {
  pointer-events: none;
  user-select: none;
}

.ban-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(96, 32, 32, 0.3) 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(82, 22, 22, 0.26) 0%, transparent 60%),
    rgba(8, 12, 18, 0.94);
}

.ban-overlay[hidden] {
  display: none;
}

.ban-overlay-card {
  width: min(620px, 100%);
  padding: 28px 24px;
  border-radius: 16px;
  border: 1px solid #4F2A2A;
  background: linear-gradient(180deg, rgba(14, 21, 30, 0.98) 0%, rgba(10, 16, 24, 0.96) 100%);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(226, 173, 173, 0.07);
  text-align: center;
}

.ban-overlay-card h2 {
  margin: 0;
  color: #F4DADA;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.35;
  letter-spacing: 0.2px;
}

.server-down {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(96, 32, 32, 0.35) 0%, transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(82, 22, 22, 0.3) 0%, transparent 60%),
    var(--bg);
}

.server-down[hidden] {
  display: none;
}

.server-down-card {
  width: min(620px, 100%);
  padding: 34px 30px 28px;
  border-radius: 18px;
  border: 1px solid #4B2B2B;
  background: linear-gradient(180deg, rgba(15, 20, 26, 0.96) 0%, rgba(12, 17, 24, 0.95) 100%);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(198, 221, 241, 0.06);
  text-align: center;
}

.server-down-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #4A2626;
  background: rgba(170, 58, 58, 0.14);
  color: #F6B4B4;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.server-down-logo {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.server-down-logo .title-beta {
  font-size: 14px;
}

.server-down-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.8vw, 26px);
  letter-spacing: 0.2px;
}

.server-down-card p {
  margin: 0 auto;
  max-width: 46ch;
  color: #D7B6B6;
  font-size: 16px;
  line-height: 1.55;
}

.server-down-meta {
  margin: 10px auto 0;
  max-width: 50ch;
  color: #B88F8F;
  font-size: 13px;
  line-height: 1.45;
}

.server-down-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.server-down-btn {
  min-width: 132px;
  padding: 11px 15px;
  border-radius: 12px;
}

.server-down-btn.ghost {
  background: rgba(13, 20, 29, 0.74);
  border-color: #492D2D;
  color: #F0D5D5;
}

.server-down-btn.ghost:hover {
  background: rgba(16, 24, 35, 0.86);
}

.server-down-why-btn {
  margin-top: 12px;
  border: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #E69E9E;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.server-down-why-btn:hover {
  color: #FFC6C6;
  filter: none;
}

.server-down-why-panel {
  margin: 10px auto 0;
  max-width: 52ch;
  padding: 10px 11px;
  border: 1px solid #492A2A;
  border-radius: 10px;
  background: rgba(12, 18, 27, 0.74);
  color: #DBB8B8;
  font-size: 12px;
  line-height: 1.55;
}

.workspace-apply-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 9, 14, 0.72);
  backdrop-filter: blur(4px);
}

.workspace-apply-card {
  width: min(700px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #4F2A2A;
  background: linear-gradient(180deg, rgba(14, 21, 30, 0.98) 0%, rgba(10, 16, 24, 0.96) 100%);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(180, 206, 231, 0.08);
}

.workspace-apply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-apply-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #5A2A2A;
  background: rgba(209, 75, 75, 0.14);
  color: #F4CACA;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.workspace-apply-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #4D2A2A;
  background: #271212;
  color: #E6C4C4;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.workspace-apply-close:hover {
  background: #351717;
  border-color: #5E3333;
}

.workspace-apply-title {
  margin: 0;
  font-size: clamp(20px, 2.7vw, 24px);
  line-height: 1.2;
  color: #F8E0E0;
}

.workspace-apply-intro {
  margin: 0;
  color: #D1A8A8;
  font-size: 13px;
  line-height: 1.55;
}

.workspace-apply-preview {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #4A2525;
  background: rgba(8, 13, 20, 0.92);
  color: #F0CDCD;
  max-height: min(44vh, 360px);
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.52;
  font-size: 13px;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.workspace-apply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.workspace-apply-btn {
  min-width: 132px;
  padding: 11px 14px;
  border-radius: 12px;
}

.workspace-apply-btn.ghost {
  background: rgba(13, 20, 29, 0.72);
  border-color: #4D2C2C;
  color: #F2D4D4;
}

.workspace-apply-btn.ghost:hover {
  background: rgba(17, 26, 38, 0.86);
}

.workspace-route-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 9, 14, 0.72);
  backdrop-filter: blur(4px);
}

.workspace-route-card {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #4F2A2A;
  background: linear-gradient(180deg, rgba(14, 21, 30, 0.98) 0%, rgba(10, 16, 24, 0.96) 100%);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(180, 206, 231, 0.08);
}

.workspace-route-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-route-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #5A2A2A;
  background: rgba(209, 75, 75, 0.14);
  color: #F4CACA;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.workspace-route-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #4D2A2A;
  background: #271212;
  color: #E6C4C4;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.workspace-route-close:hover {
  background: #351717;
  border-color: #5E3333;
}

.workspace-route-title {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.2;
  color: #F8E0E0;
}

.workspace-route-prompt {
  margin: 0;
  color: #D1A8A8;
  font-size: 13px;
  line-height: 1.55;
}

.workspace-route-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.workspace-route-btn {
  min-width: 148px;
  padding: 11px 14px;
  border-radius: 12px;
}

.workspace-route-btn.ghost {
  background: rgba(13, 20, 29, 0.72);
  border-color: #4D2C2C;
  color: #F2D4D4;
}

.workspace-route-btn.ghost:hover {
  background: rgba(17, 26, 38, 0.86);
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 9, 14, 0.72);
  backdrop-filter: blur(4px);
}

.legal-modal[hidden] {
  display: none;
}

.legal-card {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #4F2A2A;
  background: linear-gradient(180deg, rgba(14, 21, 30, 0.98) 0%, rgba(10, 16, 24, 0.96) 100%);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(226, 173, 173, 0.07);
  overflow: hidden;
}

.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.legal-title {
  font-size: 18px;
  font-weight: 700;
  color: #F7D9D9;
}

.legal-subtitle {
  font-size: 11px;
  color: #B88F8F;
  margin-top: 2px;
}

.legal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #4D2A2A;
  background: #271212;
  color: #E6C4C4;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.legal-close:hover {
  background: #351717;
  border-color: #5E3333;
}

.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-tab {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #432323;
  background: #1B0D0D;
  color: #D8B8B8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.legal-tab.active {
  border-color: #5A2A2A;
  background: rgba(209, 75, 75, 0.16);
  color: #F4CACA;
}

.legal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px 2px 2px;
  color: #E8C8C8;
  font-size: 12px;
  line-height: 1.6;
}

.legal-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-panel h3 {
  margin: 0;
  font-size: 14px;
  color: #F2D6D6;
}

.legal-panel p {
  margin: 0;
}

.legal-panel ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.legal-panel li {
  margin: 0;
  color: #E2BEBE;
}


.sidebar {
  min-width: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  transition: padding 180ms ease, border-color 180ms ease, max-width 250ms ease, opacity 200ms ease;
}

.app.sidebar-collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  overflow: hidden;
  pointer-events: none;
}

.side-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.rok-logo-img {
  height: 40px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

.home-logo .rok-logo-img {
  height: 80px;
}

.topbar .rok-logo-img {
  height: 44px;
}

.rok-logo-topbar {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.brand-btn {
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  background: transparent;
}

.brand-btn:hover {
  filter: brightness(1.08);
}

.side-btn {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #412323;
  background: #241111;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.side-btn:hover {
  filter: brightness(1.08);
}

.side-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-tabs-section {
  gap: 8px;
}

.side-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.side-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.side-item:hover {
  background: #1C0F0F;
  border-color: #361F1F;
}

.side-item.active {
  background: #251111;
  border-color: #412222;
}

.side-sessions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.side-session-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.side-session-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-delete-btn {
  width: 34px;
  min-width: 34px;
  border-radius: 8px;
  border: 1px solid #412222;
  background: #221010;
  color: #DAC2C2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, visibility 120ms ease, background 120ms ease, border-color 120ms ease;
}

.session-delete-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.side-session-row:hover .session-delete-btn,
.side-session-row:focus-within .session-delete-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.session-delete-btn:hover,
.session-delete-btn:focus-visible {
  background: #321C1C;
  border-color: #4F2D2D;
  outline: none;
}

.side-session-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-session-time {
  font-size: 11px;
  color: var(--muted);
}

.side-empty {
  padding: 6px 4px;
  font-size: 12px;
  color: var(--muted);
}

.side-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
}

.main {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: rgba(13, 17, 23, 0.72);
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: blur(12px);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-mode-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: rgba(15, 17, 23, 0.72);
  border-color: #442424;
  color: #d9b5b5;
}

.topbar-mode-btn.is-active {
  background: rgba(209, 75, 75, 0.16);
  border-color: #8a3c3c;
  color: #f2d8d8;
}

.topbar-mode-btn:hover {
  background: rgba(21, 25, 34, 0.92);
}

.sidebar-toggle-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1A0E0E;
  border-color: #3A2020;
  color: #E7C9C9;
}

.sidebar-toggle-btn span {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-toggle-btn:hover {
  background: #241313;
  border-color: #4A2727;
  color: var(--text);
}

.title {
  font-size: 16px;
  font-weight: 600;
}

.title-text-logo {
  color: #8B0F0F;
  letter-spacing: 0.6px;
}

.title-beta {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
  vertical-align: middle;
}

.model-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #361F1F;
  background: #1A0F0F;
}

.model-switch-label {
  font-size: 11px;
  color: #C39E9E;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.model-select {
  border: 1px solid #4A2A2A;
  border-radius: 999px;
  padding: 4px 10px;
  min-width: 172px;
  background: #170B0B;
  color: #F2D4D4;
  font-size: 12px;
  font-family: "Sora", "Segoe UI", sans-serif;
  outline: none;
}

.model-select:focus {
  border-color: #B04949;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.35);
}

.chat {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.chat-welcome {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  width: min(520px, 90vw);
  text-align: center;
  pointer-events: auto;
}

.chat-welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.chat-welcome-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.chat-welcome-title {
  font-size: 20px;
  font-weight: 700;
  color: #f4dcdc;
  margin: 0;
}

.chat-welcome-subtitle {
  font-size: 12px;
  line-height: 1.45;
  color: #bfa3a3;
  margin: 0;
}

.chat-welcome-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chat-welcome-chip {
  border: 1px solid #3f2323;
  background: rgba(13, 20, 29, 0.6);
  color: #e0bcbc;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.chat-welcome-chip:hover,
.chat-welcome-chip:focus-visible {
  border-color: #6b3a3a;
  background: rgba(17, 26, 36, 0.72);
  color: #f0d0d0;
  outline: none;
}


.main.workspace-mode .chat {
  display: none !important;
}

.workspace-tabs {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.workspace-tabs-top {
  padding: 8px 14px 6px;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid #2A1717;
  background: rgba(13, 18, 26, 0.82);
  flex: 0 0 auto;
}

.workspace-tabs-top[hidden] {
  display: none;
}

.workspace-tabs-sidebar {
  padding: 0;
  display: grid;
  gap: 6px;
  background: transparent;
}

.workspace-tabs-sidebar[hidden] {
  display: none;
}

.workspace-tab {
  width: 100%;
  padding: 7px 11px;
  text-align: left;
  white-space: nowrap;
  border-radius: 10px;
  border: 1px solid #392020;
  background: rgba(23, 11, 11, 0.72);
  color: #D8B8B8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.workspace-tabs-top .workspace-tab {
  width: auto;
}

.workspace-tab:hover {
  filter: brightness(1.08);
}

.workspace-tab.active {
  border-color: #5A2A2A;
  background: rgba(209, 75, 75, 0.16);
  color: #F4CACA;
}

.workspace-panel {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 18, 26, 0.92) 0%, rgba(9, 14, 20, 0.96) 100%);
}

.workspace-panel[hidden] {
  display: none;
}

.model-panel {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 22px clamp(14px, 3vw, 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(560px 260px at 50% 16%, rgba(110, 39, 39, 0.24) 0%, rgba(8, 12, 18, 0) 72%),
    linear-gradient(180deg, rgba(8, 12, 18, 0.78) 0%, rgba(8, 12, 18, 0.94) 100%);
}

.model-panel[hidden] {
  display: none;
}

.model-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.36);
  pointer-events: none;
}

.model-panel-shell {
  width: min(520px, 100%);
  max-height: min(74vh, 560px);
  min-height: 0;
  border-radius: 16px;
  border: 1px solid #522D2D;
  background: linear-gradient(180deg, rgba(14, 21, 31, 0.98) 0%, rgba(10, 16, 24, 0.96) 100%);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(49, 18, 18, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: model-popup-in 170ms ease;
}

.model-panel-head {
  border-radius: 12px;
  border: 1px solid #502929;
  background: rgba(10, 17, 25, 0.86);
  padding: 11px 12px;
}

.model-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #F7D9D9;
  line-height: 1.1;
}

.model-panel-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #CA9E9E;
  line-height: 1.5;
}

.model-panel-current {
  font-size: 12px;
  color: #ECC6C6;
  border-radius: 11px;
  border: 1px solid #5A2727;
  background: rgba(39, 11, 11, 0.72);
  padding: 10px 11px;
}

.model-option-list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(44vh, 290px);
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.model-option-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #5D3232;
  border-radius: 12px;
  background: rgba(13, 22, 32, 0.9);
  color: #F0D0D0;
  padding: 13px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease, transform 130ms ease;
}

.model-option-btn:focus {
  border-color: #B04949;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.35);
  outline: none;
}

.model-option-btn:hover {
  border-color: #7A4848;
  background: rgba(43, 18, 18, 0.95);
  transform: translateY(-1px);
  filter: none;
}

.model-option-btn.is-active {
  border-color: #8D2E2E;
  background: rgba(94, 15, 15, 0.24);
}

.model-option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.model-option-name {
  font-size: 13px;
  font-weight: 700;
  color: #F6D8D8;
}

.model-option-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25px;
  text-transform: uppercase;
  color: #D89696;
  border: 1px solid rgba(143, 68, 68, 0.7);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(48, 13, 13, 0.55);
}

.model-option-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #D2A6A6;
}

.workspace-document-shell {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.workspace-document-shell[hidden] {
  display: none;
}

.workspace-panel-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #352020;
  background: rgba(10, 16, 24, 0.72);
  flex: 0 0 auto;
}

.workspace-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: #F2D6D6;
  line-height: 1;
}

.workspace-panel-hint {
  font-size: 10px;
  color: #B88E8E;
  line-height: 1.4;
}

.workspace-panel-tools {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workspace-panel-stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.workspace-doc-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid #4A2525;
  background: rgba(11, 17, 26, 0.76);
  color: #DCB5B5;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.workspace-doc-chip[data-tone="saved"] {
  border-color: #B04949;
  background: rgba(209, 75, 75, 0.16);
  color: #F4CACA;
}

.workspace-doc-chip[data-tone="error"] {
  border-color: #6B3939;
  background: rgba(152, 62, 80, 0.16);
  color: #F2BEBE;
}

.workspace-panel-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.workspace-mini-btn {
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.workspace-mini-btn.ghost {
  background: rgba(12, 18, 27, 0.68);
  border-color: #4D2A2A;
}

.workspace-mini-btn:disabled {
  opacity: 0.45;
}

.workspace-editor {
  flex: 0 0 auto;
  min-height: 220px;
  height: clamp(220px, 42vh, 430px);
  max-height: 54vh;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #442424;
  margin: 0;
  padding: 14px;
  color: #F5D8D8;
  background: rgba(9, 14, 21, 0.88);
  outline: none;
  resize: none;
  overflow: auto;
  line-height: 1.62;
  font-size: 13px;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.workspace-editor:focus {
  border-color: #B04949;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.45), inset 0 0 0 1px rgba(209, 75, 75, 0.25);
}

.workspace-assistant {
  flex: 1;
  min-height: 120px;
  border-radius: 12px;
  border: 1px solid #442222;
  background: rgba(8, 13, 20, 0.84);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-assistant[hidden] {
  display: none;
}

.workspace-assistant-head {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #3A1B1B;
  background: rgba(10, 16, 24, 0.66);
}

.workspace-assistant-toggle {
  width: 100%;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: #E8C4C4;
  padding: 1px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  line-height: 1;
  font-weight: 600;
}

.workspace-assistant-toggle:hover {
  background: transparent;
  filter: none;
}

.workspace-assistant-chevron {
  color: #B98E8E;
  font-size: 11px;
  transform: rotate(0deg);
  transition: transform 180ms ease;
}

.workspace-assistant:not(.is-collapsed) .workspace-assistant-chevron {
  transform: rotate(90deg);
}

.workspace-assistant-heading {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workspace-assistant-title {
  font-size: 12px;
  color: #E8C9C9;
  font-weight: 600;
  line-height: 1;
}

.workspace-assistant-subtitle {
  font-size: 11px;
  color: #B88E8E;
  line-height: 1.2;
}

.workspace-assistant-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #C19595;
  font-size: 11px;
}

.workspace-assistant-status-text {
  color: #BD9292;
}

.workspace-assistant-suggest-btn {
  flex: 0 0 auto;
  min-width: 138px;
  border-radius: 10px;
  border: 1px solid #512A2A;
  background: rgba(13, 21, 31, 0.82);
  color: #E4BFBF;
  font-size: 11px;
  font-weight: 700;
  padding: 9px 10px;
}

.workspace-assistant-suggest-btn:hover {
  background: rgba(18, 28, 40, 0.9);
  border-color: #6D3A3A;
  filter: none;
}

.workspace-assistant-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #9F6F6F;
}

.workspace-assistant-dot.idle {
  background: #9E6E6E;
}

.workspace-assistant-dot.generating {
  background: #CA6B6B;
  box-shadow: 0 0 0 0 rgba(202, 107, 107, 0.5);
  animation: workspace-dot-pulse 1.15s ease-out infinite;
}

.workspace-assistant-dot.applied {
  background: #CF6F6F;
}

.workspace-assistant-dot.pending {
  background: #E46A6A;
}

.workspace-assistant-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 11px;
  max-height: 100%;
  opacity: 1;
  transition: max-height 180ms ease, opacity 160ms ease, padding 140ms ease;
}

.workspace-assistant.is-fade-in .workspace-assistant-body {
  animation: workspace-assistant-fade-in 160ms ease;
}

.workspace-assistant-body::before,
.workspace-assistant-body::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  height: 14px;
  z-index: 2;
  pointer-events: none;
}

.workspace-assistant-body::before {
  top: 0;
  margin-bottom: -14px;
  background: linear-gradient(180deg, rgba(8, 13, 20, 0.96) 0%, rgba(8, 13, 20, 0) 100%);
}

.workspace-assistant-body::after {
  bottom: 0;
  margin-top: -14px;
  background: linear-gradient(0deg, rgba(8, 13, 20, 0.96) 0%, rgba(8, 13, 20, 0) 100%);
}

.workspace-assistant.is-collapsed .workspace-assistant-body {
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.workspace-assistant-grid {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.workspace-assistant-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.workspace-assistant-row dt {
  margin: 0;
  font-size: 11px;
  color: #B98E8E;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.workspace-assistant-row dd {
  margin: 0;
  font-size: 12px;
  color: #EDCECE;
  line-height: 1.45;
}

.workspace-assistant-summary {
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #452222;
  background: rgba(10, 16, 24, 0.7);
  color: #DCB7B7;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
}

.workspace-assistant-suggestions {
  border: 1px solid #452222;
  border-radius: 10px;
  background: rgba(10, 16, 24, 0.7);
  padding: 9px 10px;
  display: grid;
  gap: 9px;
}

.workspace-assistant-suggestion-section h4 {
  margin: 0 0 5px;
  font-size: 11px;
  color: #C79D9D;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.workspace-assistant-suggestion-section ul {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
}

.workspace-assistant-suggestion-section li {
  color: #E8C8C8;
  font-size: 12px;
  line-height: 1.45;
}

.workspace-assistant-footnote {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid #3A1B1B;
  font-size: 11px;
  color: #A97E7E;
}

.sandbox-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(300px, 360px);
  gap: 10px;
}

.sandbox-shell[hidden] {
  display: none;
}

.sandbox-files-shell,
.sandbox-chat-shell {
  min-height: 0;
  border-radius: 12px;
  border: 1px solid #352020;
  background: rgba(8, 13, 20, 0.76);
  overflow: hidden;
}

.sandbox-files-shell {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(11, 8, 8, 0.92) 0%, rgba(10, 12, 18, 0.82) 100%);
}

.sandbox-files-head {
  border: 0;
  border-bottom: 1px solid #3A1B1B;
  border-radius: 0;
}

.sandbox-files-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 2px;
  padding: 8px 6px;
}

.sandbox-file-btn {
  width: 100%;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: transparent;
  color: #E8C7C7;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.sandbox-file-btn:disabled {
  opacity: 0.78;
  cursor: wait;
}

.sandbox-file-btn:hover {
  border-color: #402222;
  background: rgba(30, 13, 13, 0.76);
}

.sandbox-file-btn.is-active {
  border-color: #4C2626;
  border-left-color: #B04949;
  background: rgba(209, 75, 75, 0.12);
  box-shadow: inset 0 0 0 1px rgba(176, 73, 73, 0.16);
}

.sandbox-file-path {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  color: #F7D9D9;
  word-break: break-word;
  font-family: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", monospace;
}

.sandbox-file-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sandbox-file-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #4D2828;
  background: rgba(34, 17, 17, 0.82);
  color: #D7B4B4;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sandbox-file-badge[data-tone="working"] {
  border-color: rgba(176, 73, 73, 0.72);
  background: rgba(176, 73, 73, 0.16);
  color: #FFD0D0;
}

.sandbox-file-badge[data-tone="queued"] {
  border-color: rgba(111, 87, 87, 0.72);
  background: rgba(92, 66, 66, 0.16);
  color: #DAB9B9;
}

.sandbox-file-badge[data-tone="update"] {
  border-color: rgba(176, 123, 73, 0.72);
  background: rgba(176, 123, 73, 0.14);
  color: #F0D0B0;
}

.sandbox-file-badge[data-tone="create"] {
  border-color: rgba(85, 160, 104, 0.72);
  background: rgba(85, 160, 104, 0.14);
  color: #D0F0D7;
}

.sandbox-file-badge[data-tone="delete"] {
  border-color: rgba(176, 73, 73, 0.72);
  background: rgba(176, 73, 73, 0.14);
  color: #FFCECE;
}

.sandbox-file-meta {
  font-size: 10px;
  color: #BE9595;
}

.sandbox-main-shell {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sandbox-editor-shell {
  min-height: 0;
  border-radius: 12px;
  border: 1px solid #352020;
  background: rgba(8, 13, 20, 0.76);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sandbox-field-label {
  font-size: 10px;
  font-weight: 700;
  color: #CFA6A6;
  letter-spacing: 0.03em;
}

.sandbox-file-path-input,
.sandbox-file-editor {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #442424;
  background: rgba(9, 14, 21, 0.88);
  color: #F5D8D8;
  outline: none;
}

.sandbox-file-path-input {
  padding: 9px 10px;
  font-size: 11px;
  font-family: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", monospace;
}

.sandbox-file-editor {
  flex: 0 0 auto;
  min-height: 300px;
  height: clamp(320px, 56vh, 680px);
  padding: 12px;
  resize: none;
  overflow: auto;
  line-height: 1.55;
  font-size: 12px;
  font-family: Consolas, "SFMono-Regular", "Cascadia Code", monospace;
}

.sandbox-file-path-input:focus,
.sandbox-file-editor:focus {
  border-color: #B04949;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.45), inset 0 0 0 1px rgba(209, 75, 75, 0.25);
}

.sandbox-activity-shell {
  border-radius: 12px;
  border: 1px solid #432121;
  background: linear-gradient(180deg, rgba(28, 12, 12, 0.82) 0%, rgba(12, 16, 24, 0.92) 100%);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.sandbox-activity-shell[data-state="success"] {
  border-color: rgba(85, 160, 104, 0.56);
}

.sandbox-activity-shell[data-state="error"],
.sandbox-activity-shell[data-state="stopped"] {
  border-color: rgba(176, 73, 73, 0.56);
}

.sandbox-activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sandbox-activity-list {
  display: grid;
  gap: 8px;
}

.sandbox-activity-step {
  border-radius: 10px;
  border: 1px solid #392020;
  background: rgba(9, 14, 20, 0.74);
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}

.sandbox-activity-step[data-state="active"] {
  border-color: rgba(176, 73, 73, 0.72);
  background: rgba(176, 73, 73, 0.1);
}

.sandbox-activity-step[data-state="done"] {
  border-color: rgba(85, 160, 104, 0.42);
  background: rgba(85, 160, 104, 0.08);
}

.sandbox-activity-step[data-state="error"],
.sandbox-activity-step[data-state="stopped"] {
  border-color: rgba(176, 73, 73, 0.72);
  background: rgba(176, 73, 73, 0.1);
}

.sandbox-activity-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sandbox-activity-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #755353;
  flex: 0 0 auto;
}

.sandbox-activity-step[data-state="active"] .sandbox-activity-step-dot {
  background: #E06A6A;
  box-shadow: 0 0 0 4px rgba(224, 106, 106, 0.14);
  animation: sandboxActivityPulse 1.35s ease-in-out infinite;
}

.sandbox-activity-step[data-state="done"] .sandbox-activity-step-dot {
  background: #6BC18A;
  box-shadow: 0 0 0 4px rgba(107, 193, 138, 0.12);
}

.sandbox-activity-step[data-state="error"] .sandbox-activity-step-dot,
.sandbox-activity-step[data-state="stopped"] .sandbox-activity-step-dot {
  background: #E06A6A;
}

.sandbox-activity-step-title {
  font-size: 11px;
  font-weight: 700;
  color: #F2D6D6;
  line-height: 1.35;
}

.sandbox-activity-step-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #4A2828;
  color: #D7B5B5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sandbox-activity-step[data-state="active"] .sandbox-activity-step-badge {
  border-color: rgba(176, 73, 73, 0.72);
  color: #FFD6D6;
}

.sandbox-activity-step[data-state="done"] .sandbox-activity-step-badge {
  border-color: rgba(85, 160, 104, 0.56);
  color: #D7F2DF;
}

.sandbox-activity-step-detail {
  font-size: 10px;
  line-height: 1.5;
  color: #C8A3A3;
}

.sandbox-chat-shell {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(11, 8, 8, 0.92) 0%, rgba(10, 12, 18, 0.84) 100%);
}

.sandbox-chat-head {
  border: 0;
  border-bottom: 1px solid #3A1B1B;
  border-radius: 0;
}

.sandbox-chat-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sandbox-empty-state {
  border-radius: 10px;
  border: 1px dashed #4A2525;
  background: rgba(13, 19, 28, 0.68);
  color: #C79E9E;
  font-size: 11px;
  line-height: 1.5;
  padding: 10px;
}

.sandbox-empty-state-rich {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border-style: solid;
  background: linear-gradient(180deg, rgba(15, 22, 32, 0.94) 0%, rgba(9, 13, 20, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.sandbox-empty-title {
  color: #f2dddd;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sandbox-empty-copy {
  margin: 0;
  color: #d7b4b4;
  font-size: 12px;
  line-height: 1.65;
}

.sandbox-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sandbox-empty-btn {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(132, 63, 63, 0.35);
  background: rgba(255, 255, 255, 0.03);
  color: #f0d0d0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.sandbox-empty-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 111, 111, 0.6);
  background: rgba(180, 33, 33, 0.12);
  color: #fff4f4;
}

.sandbox-empty-btn[data-tone="primary"] {
  border-color: rgba(189, 88, 88, 0.58);
  background: rgba(121, 27, 27, 0.24);
}

.sandbox-empty-note {
  color: #b99393;
  font-size: 11px;
  line-height: 1.6;
}

.sandbox-chat-msg {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.sandbox-chat-msg.user {
  justify-items: end;
}

.sandbox-chat-label {
  font-size: 10px;
  font-weight: 700;
  color: #C99D9D;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sandbox-chat-msg .sandbox-chat-bubble {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid #452424;
  background: rgba(11, 17, 24, 0.78);
  color: #ECD2D2;
  box-shadow: none;
}

.sandbox-chat-msg.user .sandbox-chat-bubble {
  background: rgba(82, 28, 28, 0.54);
  border-color: #6A3030;
}

.sandbox-chat-bubble.is-pending {
  color: #D7B1B1;
  border-style: dashed;
}

.sandbox-chat-compose {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #3A1B1B;
  background: rgba(9, 14, 21, 0.94);
}

.sandbox-chat-input {
  width: 100%;
  min-height: 96px;
  max-height: 220px;
  resize: none;
  border-radius: 12px;
  border: 1px solid #442424;
  background: rgba(9, 14, 21, 0.88);
  color: #F5D8D8;
  padding: 11px 12px;
  line-height: 1.55;
  font-size: 12px;
  outline: none;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.sandbox-chat-input:focus {
  border-color: #B04949;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.45), inset 0 0 0 1px rgba(209, 75, 75, 0.25);
}

.sandbox-chat-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sandbox-changes-shell {
  margin: 4px 0 0;
  border-radius: 10px;
  border: 1px solid #3A1B1B;
  background: rgba(9, 14, 21, 0.62);
  overflow: hidden;
}

.sandbox-changes-head {
  padding: 10px 12px;
  border-bottom: 1px solid #3A1B1B;
  display: grid;
  gap: 4px;
}

.sandbox-changes-list {
  display: grid;
}

.sandbox-change-row {
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  border-top: 1px solid rgba(58, 27, 27, 0.82);
  background: rgba(8, 12, 18, 0.88);
}

.sandbox-change-row:first-child {
  border-top: 0;
}

.sandbox-change-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sandbox-change-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.sandbox-change-path-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sandbox-change-path {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: #F4D9D9;
  word-break: break-word;
  font-family: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", monospace;
}

.sandbox-change-action {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #4D2828;
  background: rgba(34, 17, 17, 0.82);
  color: #D7B4B4;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sandbox-change-action[data-tone="create"] {
  border-color: rgba(85, 160, 104, 0.72);
  background: rgba(85, 160, 104, 0.14);
  color: #D0F0D7;
}

.sandbox-change-action[data-tone="update"] {
  border-color: rgba(176, 123, 73, 0.72);
  background: rgba(176, 123, 73, 0.14);
  color: #F0D0B0;
}

.sandbox-change-action[data-tone="delete"] {
  border-color: rgba(176, 73, 73, 0.72);
  background: rgba(176, 73, 73, 0.14);
  color: #FFCECE;
}

.sandbox-change-lines {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(104, 71, 71, 0.72);
  background: rgba(24, 18, 18, 0.8);
  color: #C8A3A3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sandbox-change-reason {
  font-size: 10px;
  line-height: 1.45;
  color: #B88E8E;
}

.sandbox-change-side {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.sandbox-change-stats {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sandbox-change-plus {
  color: #62D08B;
}

.sandbox-change-minus {
  color: #E98686;
}

.sandbox-change-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sandbox-change-mini-btn {
  appearance: none;
  border: 1px solid rgba(91, 53, 53, 0.82);
  border-radius: 999px;
  background: rgba(25, 18, 18, 0.92);
  color: #E6CACA;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sandbox-change-mini-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(209, 75, 75, 0.72);
  background: rgba(47, 21, 21, 0.96);
}

.sandbox-change-preview {
  border-radius: 10px;
  border: 1px solid rgba(75, 42, 42, 0.85);
  background: rgba(10, 14, 20, 0.94);
  overflow: hidden;
}

.sandbox-change-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.sandbox-change-preview-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.sandbox-change-preview-pane {
  min-width: 0;
  border-right: 1px solid rgba(75, 42, 42, 0.75);
}

.sandbox-change-preview-pane:last-child {
  border-right: 0;
}

.sandbox-change-preview-pane[data-tone="create"] .sandbox-change-preview-label,
.sandbox-change-preview-pane[data-tone="proposed"] .sandbox-change-preview-label {
  color: #D0F0D7;
}

.sandbox-change-preview-pane[data-tone="delete"] .sandbox-change-preview-label {
  color: #FFCECE;
}

.sandbox-change-preview-label {
  padding: 9px 12px 8px;
  border-bottom: 1px solid rgba(75, 42, 42, 0.75);
  background: rgba(20, 16, 16, 0.94);
  color: #F4D9D9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sandbox-change-preview-code {
  margin: 0;
  padding: 12px;
  max-height: 260px;
  overflow: auto;
  background: rgba(8, 11, 16, 0.96);
  color: #D9C9C9;
  font-size: 11px;
  line-height: 1.55;
  font-family: "IBM Plex Mono", "SFMono-Regular", "Cascadia Code", monospace;
}

.sandbox-change-preview-note {
  padding: 9px 12px 11px;
  border-top: 1px solid rgba(75, 42, 42, 0.75);
  background: rgba(15, 16, 22, 0.92);
  color: #AF8B8B;
  font-size: 10px;
  line-height: 1.5;
}

.sandbox-setup-note {
  padding: 9px 12px 11px;
  border-top: 1px solid rgba(58, 27, 27, 0.82);
  background: rgba(8, 12, 18, 0.88);
  color: #A97E7E;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .sandbox-shell {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .sandbox-chat-shell {
    grid-column: 1 / -1;
    min-height: 320px;
  }
}

@media (max-width: 860px) {
  .sandbox-shell {
    grid-template-columns: 1fr;
  }

  .sandbox-files-shell {
    max-height: 220px;
  }
}

@media (max-width: 700px) {
  .sandbox-chat-compose-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sandbox-file-editor {
    height: 300px;
  }

  .sandbox-change-row {
    gap: 12px;
  }

  .sandbox-change-head {
    flex-direction: column;
  }

  .sandbox-change-side,
  .sandbox-change-stats {
    align-self: flex-start;
  }

  .sandbox-change-side {
    justify-items: start;
  }

  .sandbox-change-controls {
    justify-content: flex-start;
  }

  .sandbox-change-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sandbox-change-preview-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(75, 42, 42, 0.75);
  }

  .sandbox-change-preview-pane:last-child {
    border-bottom: 0;
  }
}

@keyframes sandboxActivityPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(224, 106, 106, 0.14);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 7px rgba(224, 106, 106, 0.06);
  }
}

.home-screen {
  flex: 1;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  isolation: isolate;
  overflow-x: clip;
  overflow-y: auto;
  padding: clamp(16px, 3vw, 32px) clamp(14px, 3vw, 30px) clamp(18px, 3vw, 28px);
  background:
    radial-gradient(1200px 680px at 12% -14%, rgba(132, 39, 39, 0.33) 0%, transparent 64%),
    radial-gradient(980px 620px at 88% 0%, rgba(113, 26, 26, 0.26) 0%, transparent 66%),
    linear-gradient(180deg, rgba(9, 14, 20, 0.16) 0%, rgba(8, 12, 17, 0.3) 100%),
    transparent;
}

.home-screen[hidden] {
  display: none;
}

#homeScreen .hs-nav,
#homeScreen .hs-hero,
#homeScreen .hs-footer {
  display: none;
}

.rok-home-shell {
  width: min(1180px, 100%);
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(24px, 4vw, 40px);
  position: relative;
  z-index: 2;
}

.rok-home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.rok-home-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.rok-home-logo {
  height: clamp(52px, 6vw, 78px);
  width: auto;
  display: block;
}

.rok-home-brand-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(157, 72, 72, 0.42);
  background: rgba(20, 10, 12, 0.84);
  color: #efc2c2;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rok-home-top-links,
.rok-home-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.rok-home-top-link,
.rok-home-footer-link {
  color: #d8b3b3;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.rok-home-top-link:hover,
.rok-home-footer-link:hover {
  color: #fff2f2;
}

.rok-home-footer-link {
  padding: 0;
  border: 0;
  background: transparent;
}

.rok-home-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.rok-home-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  max-width: 720px;
}

.rok-home-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(150, 72, 72, 0.38);
  background: rgba(17, 10, 12, 0.78);
  color: #efbdbd;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rok-home-title {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.94;
  letter-spacing: -0.05em;
  color: #fff4f2;
  max-width: 10ch;
  text-wrap: balance;
}

.rok-home-subtitle {
  margin: 0;
  max-width: 58ch;
  color: #d9b8b8;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}

.rok-home-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.rok-home-cta {
  min-width: 220px;
}

.rok-home-secondary-btn {
  min-width: 180px;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(173, 102, 102, 0.42);
  background: rgba(255, 255, 255, 0.03);
  color: #f6d8d8;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.rok-home-secondary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(233, 145, 145, 0.62);
  background: rgba(185, 42, 42, 0.14);
  color: #fff4f4;
}

.rok-home-trust-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rok-home-trust-card {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(132, 63, 63, 0.24);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.rok-home-trust-title {
  display: block;
  margin-bottom: 6px;
  color: #fff0f0;
  font-size: 14px;
  font-weight: 700;
}

.rok-home-trust-card p {
  margin: 0;
  color: #d6b8b8;
  font-size: 13px;
  line-height: 1.65;
}

.rok-home-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rok-home-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rok-home-panel {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(128, 53, 53, 0.34);
  background:
    linear-gradient(180deg, rgba(28, 14, 18, 0.96) 0%, rgba(13, 17, 24, 0.9) 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.rok-home-panel-muted {
  background:
    linear-gradient(180deg, rgba(20, 11, 14, 0.9) 0%, rgba(11, 15, 22, 0.84) 100%);
}

.rok-home-panel-label {
  margin-bottom: 14px;
  color: #f1cfcf;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rok-home-feature-list,
.rok-home-example-list {
  display: grid;
  gap: 12px;
}

.rok-home-feature,
.rok-home-example {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(132, 63, 63, 0.28);
  background: rgba(255, 255, 255, 0.025);
}

.rok-home-feature-title {
  display: block;
  margin-bottom: 6px;
  color: #fff0f0;
  font-size: 15px;
  font-weight: 700;
}

.rok-home-feature p,
.rok-home-example {
  margin: 0;
  color: #d6b8b8;
  font-size: 14px;
  line-height: 1.65;
}

.rok-home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
  color: #b58e8e;
}

.rok-home-footer-copy {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .rok-home-main {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .rok-home-copy {
    max-width: none;
  }

  .rok-home-side {
    width: 100%;
    max-width: 680px;
  }

  .rok-home-trust-grid {
    grid-template-columns: 1fr;
  }

  .rok-home-title {
    max-width: 11ch;
  }
}

@media (max-width: 720px) {
  .rok-home-shell {
    min-height: auto;
  }

  .rok-home-top,
  .rok-home-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .rok-home-top-links,
  .rok-home-footer-links {
    flex-wrap: wrap;
    gap: 12px;
  }

  .rok-home-title {
    font-size: clamp(34px, 12vw, 56px);
  }

  .rok-home-subtitle {
    font-size: 15px;
  }

  .rok-home-secondary-btn,
  .rok-home-cta {
    width: 100%;
    justify-content: center;
  }
}

@media (max-height: 820px) {
  .rok-home-shell {
    gap: 20px;
  }

  .rok-home-title {
    font-size: clamp(38px, 6vw, 68px);
  }

  .rok-home-subtitle {
    line-height: 1.6;
  }

  .rok-home-panel {
    padding: 16px;
    border-radius: 22px;
  }
}

.home-card {
  width: min(1140px, 100%);
  min-height: calc(100vh - 52px);
  min-height: calc(100dvh - 52px);
  border: 0;
  border-radius: 0;
  padding: clamp(4px, 1vw, 10px);
  text-align: center;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  z-index: 2;
}

.home-card-minimal {
  min-height: auto;
  justify-content: flex-start;
  gap: clamp(12px, 2vw, 18px);
  padding-top: clamp(10px, 1.8vw, 18px);
}

.home-card-minimal .home-middle {
  max-width: 760px;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 30px);
}

.home-card-clean {
  width: 100%;
  min-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 0 clamp(16px, 2.4vw, 28px);
}

.home-header-clean {
  position: relative;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.home-subtitle-clean {
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #4B2A2A;
  background: rgba(11, 17, 24, 0.62);
  color: #D7B2B2;
  font-size: 11px;
  letter-spacing: 0.72px;
  text-transform: uppercase;
}

.home-main-title-top {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding-top: 8px;
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.08;
  z-index: 4;
  pointer-events: none;
  text-align: center;
}

.home-logo-edge-left {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 4;
}

.home-logo-edge-left .rok-logo-img {
  height: clamp(54px, 6vw, 86px);
  width: auto;
}

.home-logo-corner-clean {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
}

.home-logo-corner-clean .rok-logo-img {
  height: clamp(44px, 4.8vw, 66px);
  width: auto;
}

.home-hero-clean {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  position: relative;
}

.home-hero-clean h1 {
  margin: 0;
}

.home-hero-clean p {
  margin: 0;
  max-width: 58ch;
  color: #DDBDBD;
  font-size: clamp(14px, 1.9vw, 17px);
  line-height: 1.66;
}

.home-prompt-row-clean {
  margin-top: 4px;
  justify-content: center;
  gap: 10px;
}

.home-why-clean {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.home-why-title {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #C8A5A5;
}

.home-why-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.home-why-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #4C2D2D;
  background: rgba(13, 20, 29, 0.74);
  color: #E2BFBF;
  font-size: 11px;
  line-height: 1;
}

.home-hero-clean .home-cta {
  margin-top: 2px;
  min-width: 226px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid #5A2424;
  background: linear-gradient(135deg, #C91D1D 0%, #951414 100%);
  color: #2A0707;
  box-shadow: 0 10px 24px rgba(185, 31, 31, 0.38), inset 0 1px 0 rgba(255, 202, 202, 0.34);
}

.home-hero-clean .home-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(185, 31, 31, 0.48), inset 0 1px 0 rgba(255, 202, 202, 0.42);
}

.home-hero-clean .home-prompt-pill {
  border: 1px solid #4E2D2D;
  background: rgba(12, 18, 26, 0.72);
  color: #E0BFBF;
  padding: 8px 12px;
}

.home-hero-clean .home-copyright-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #3D2121;
  gap: 7px 12px;
}

.home-hero-clean .home-copyright {
  color: #B88C8C;
}

.home-footer-clean {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.home-middle-main {
  margin-top: 0;
}

.home-corner-logo {
  position: absolute;
  top: 0;
  right: 0;
  padding: clamp(6px, 1.2vw, 12px);
  z-index: 3;
}

.home-corner-logo .home-logo {
  margin: 0;
}

.home-corner-logo .home-logo .rok-logo-img {
  height: clamp(44px, 4vw, 64px);
  width: auto;
}

.home-bottom-minimal {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-mini-pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.home-mini-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #4A2B2B;
  background: rgba(11, 17, 24, 0.7);
  color: #DDBBBB;
  font-size: 11px;
  line-height: 1;
}

.home-bg-demo {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.home-bg-demo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(13, 17, 23, 0.02) 0%, rgba(13, 17, 23, 0.3) 100%),
    linear-gradient(180deg, rgba(13, 17, 23, 0.2) 0%, rgba(13, 17, 23, 0.34) 100%);
}

.home-bg-chat {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: clamp(44px, 8vh, 94px) clamp(22px, 5vw, 84px) clamp(30px, 8vh, 76px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  opacity: 0.6;
}

.home-bg-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  opacity: 0;
}

.home-bg-line.user {
  justify-content: flex-end;
}

.home-bg-line.bot {
  justify-content: flex-start;
}

.home-bg-line.cards {
  align-items: flex-start;
}

.home-bg-chip {
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid #472C2C;
  background: rgba(10, 15, 24, 0.75);
  color: #C89F9F;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2px;
}

.home-bg-bubble {
  max-width: min(980px, 72vw);
  border: 1px solid #412323;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(11, 17, 24, 0.7);
  color: #E8C7C7;
  font-size: 13px;
  line-height: 1.45;
}

.home-bg-line.user .home-bg-bubble {
  border-color: #502424;
  color: #F2D2D2;
}

.home-bg-cards-bubble {
  max-width: min(1060px, 80vw);
}

.home-bg-gen-line {
  font-size: 12px;
  color: #C89F9F;
  margin-bottom: 8px;
}

.home-bg-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-bg-card {
  opacity: 0;
  transform: translateY(8px);
  border: 1px solid #492A2A;
  border-radius: 9px;
  padding: 8px 9px;
  background: rgba(13, 22, 33, 0.78);
  color: #E8C6C6;
  font-size: 12px;
  line-height: 1.35;
}

.home-bg-card strong {
  color: #E5AEAE;
  margin-right: 4px;
}

.home-bg-card:nth-child(1) {
  animation: none;
}

.home-bg-card:nth-child(2) {
  animation: none;
}

.home-bg-card:nth-child(3) {
  animation: none;
}

.home-bg-card:nth-child(4) {
  animation: none;
}

.home-bg-card:nth-child(5) {
  animation: none;
}

.home-bg-type {
  display: inline-block;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  border-right: 2px solid rgba(242, 198, 198, 0.9);
}

.home-bg-type-user {
  animation: none;
}

.home-bg-type-bot {
  animation: none;
}

.home-bg-chat.is-animating .home-bg-line.user {
  animation: demo-user-line 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-line.bot:not(.cards) {
  animation: demo-bot-line 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-line.cards {
  animation: demo-cards-line 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-gen-line {
  animation: demo-gen-line 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-type-user {
  animation:
    demo-user-type 12s linear 1,
    demo-caret 700ms step-end infinite;
}

.home-bg-chat.is-animating .home-bg-type-bot {
  animation:
    demo-bot-type 12s linear 1,
    demo-caret 700ms step-end infinite;
}

.home-bg-chat.is-animating .home-bg-card:nth-child(1) {
  animation: demo-card-1 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-card:nth-child(2) {
  animation: demo-card-2 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-card:nth-child(3) {
  animation: demo-card-3 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-card:nth-child(4) {
  animation: demo-card-4 12s linear 1;
}

.home-bg-chat.is-animating .home-bg-card:nth-child(5) {
  animation: demo-card-5 12s linear 1;
}

.home-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: min(980px, 100%);
  margin: 0 auto;
}

.home-subtitle {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #C6A3A3;
}

.home-middle {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(20px, 3.2vw, 30px) clamp(18px, 3.8vw, 34px);
  border: 1px solid #522B2B;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(11, 17, 24, 0.74) 0%, rgba(10, 15, 22, 0.6) 100%);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(226, 173, 173, 0.07);
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
}

.home-middle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(360px, 72%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent 0%, rgba(224, 157, 157, 0.65) 50%, transparent 100%);
}

.home-bottom {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.home-block {
  width: 100%;
  border: 1px solid #422424;
  border-radius: 16px;
  background: rgba(10, 15, 22, 0.62);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  padding: 15px 15px 16px;
  height: 100%;
}

.home-eyebrow {
  display: inline-block;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  border: 1px solid #412525;
  background: rgba(209, 75, 75, 0.12);
  color: #EDA9A9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.home-logo {
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  margin-bottom: 0;
  letter-spacing: 0.35px;
}

.home-logo .title-beta {
  font-size: 13px;
}

.home-status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.home-status-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #492D2D;
  background: rgba(13, 20, 29, 0.8);
  color: #E1C1C1;
  font-size: 11px;
  line-height: 1;
}

.home-status-chip.live {
  border-color: #5A2A2A;
  background: rgba(209, 75, 75, 0.14);
  color: #F4CACA;
}

.home-card h1 {
  margin: 0;
  font-size: clamp(30px, 4.7vw, 46px);
  line-height: 1.2;
  letter-spacing: 0.3px;
  text-wrap: balance;
}

.home-card p {
  margin: 0;
  max-width: 68ch;
  color: #DAB9B9;
  line-height: 1.68;
  font-size: clamp(14px, 1.8vw, 16px);
  text-wrap: pretty;
}

.home-cta {
  margin-top: 6px;
  min-width: 210px;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid #4C1B1B;
  background: linear-gradient(135deg, #B51717 0%, #8F1111 100%);
  color: #260505;
  box-shadow:
    0 10px 22px rgba(181, 23, 23, 0.45),
    inset 0 1px 0 rgba(255, 196, 196, 0.35);
}

.home-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 24px rgba(181, 23, 23, 0.55),
    inset 0 1px 0 rgba(255, 196, 196, 0.4);
}

.home-prompt-row {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
}

.home-prompt-pill {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #522F2F;
  background: rgba(13, 20, 29, 0.76);
  color: #DCB8B8;
  font-size: 11px;
  line-height: 1;
}

/* Final, high-specificity middle stack styling for the clean home layout. */
#homeScreen .home-subtitle-clean {
  margin-top: 0;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #593030;
  background: rgba(13, 20, 29, 0.72);
  color: #E5C3C3;
  font-size: 11px;
  letter-spacing: 0.78px;
  text-transform: uppercase;
}

#homeScreen .home-hero-clean {
  max-width: 820px;
  min-height: calc(100dvh - 20px);
  padding-top: clamp(62px, 9vh, 96px);
  padding-bottom: clamp(12px, 4vh, 26px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  align-items: stretch;
  justify-items: center;
}

#homeScreen .home-hero-clean p {
  max-width: 62ch;
  color: #E3C2C2;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.64;
}

#homeScreen .home-hero-clean .home-cta {
  min-width: 238px;
  padding: 14px 22px;
  border-radius: 999px;
  align-self: center;
}

#homeScreen .home-hero-clean .home-prompt-row-clean {
  gap: 10px;
}

#homeScreen .home-hero-clean .home-prompt-pill {
  padding: 9px 13px;
  border: 1px solid #5A3434;
  background: rgba(13, 20, 29, 0.74);
  color: #E7C9C9;
  font-size: 11px;
}

#homeScreen .home-why-clean {
  margin-top: 4px;
  gap: 10px;
}

#homeScreen .home-why-title {
  font-size: 11px;
  letter-spacing: 0.85px;
  color: #D6B0B0;
}

#homeScreen .home-why-row {
  gap: 9px;
}

#homeScreen .home-why-chip {
  padding: 8px 12px;
  border: 1px solid #583434;
  background: rgba(14, 22, 33, 0.78);
  color: #E8CACA;
  font-size: 11px;
}

#homeScreen .home-hero-clean .home-copyright-row {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #442525;
}

#homeScreen .home-hero-clean .home-copyright {
  color: #C39C9C;
}

#homeScreen .home-hero-clean .home-legal-link {
  color: #F0C8C8;
}

#homeScreen .home-copy-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  align-self: start;
  justify-self: center;
}

#homeScreen .home-cta-mid {
  justify-self: center;
  align-self: center;
}

#homeScreen .home-bottom-middle {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  align-self: end;
  justify-self: center;
}

.home-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: left;
  align-items: stretch;
  margin-top: 0;
}

.home-tile {
  border: 1px solid #492B2B;
  border-radius: 12px;
  padding: 14px 13px;
  background: rgba(12, 19, 28, 0.74);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.home-tile:hover {
  transform: translateY(-1px);
  border-color: #6B3333;
  background: rgba(13, 22, 34, 0.82);
}

.home-tile h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.home-tile p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.home-eyebrow-secondary {
  margin-top: 0;
}

.home-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-top: 0;
}

.home-strip-item {
  border: 1px solid #432A2A;
  border-radius: 10px;
  padding: 12px 11px;
  background: rgba(11, 17, 25, 0.74);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.home-strip-item:hover {
  transform: translateY(-1px);
  border-color: #5C3333;
  background: rgba(12, 19, 28, 0.82);
}

.home-strip-item strong {
  font-size: 12px;
  color: #F8DCDC;
}

.home-strip-item span {
  font-size: 11px;
  color: #B79494;
}

.home-copyright {
  margin-top: 0;
  grid-column: 1 / -1;
  padding-top: 2px;
  font-size: 11px;
  color: #A37676;
  text-align: center;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

.home-copyright-row {
  margin-top: 0;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}

.home-legal-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

.home-legal-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #E6B9B9;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.home-legal-link:hover {
  color: #FFD1D1;
  filter: none;
}

.home-legal-sep {
  color: #7E5555;
  font-size: 11px;
}

/* Polish pass for the original home layout (top/middle/bottom). */
#homeScreen .home-card {
  width: min(1120px, 100%);
  min-height: calc(100dvh - 56px);
  gap: clamp(18px, 2.4vw, 30px);
  padding: clamp(6px, 1vw, 10px);
}

#homeScreen .home-top {
  gap: 10px;
  position: relative;
}

#homeScreen .home-logo {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 5;
}

#homeScreen .home-logo .rok-logo-img {
  height: clamp(78px, 8vw, 96px);
}

#homeScreen .home-subtitle {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #553333;
  background: rgba(12, 18, 26, 0.72);
  color: #E0BFBF;
  letter-spacing: 0.78px;
}

#homeScreen .home-status-row {
  gap: 10px;
}

#homeScreen .home-status-chip {
  border-color: #563030;
  background: rgba(12, 18, 27, 0.76);
  color: #E2BFBF;
}

#homeScreen .home-middle {
  max-width: 940px;
  gap: 14px;
  padding: clamp(22px, 3.4vw, 34px) clamp(18px, 3.6vw, 36px);
  border: 1px solid #5A3131;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12, 18, 27, 0.82) 0%, rgba(10, 15, 23, 0.74) 100%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(231, 184, 184, 0.08);
}

#homeScreen .home-card h1 {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: 0.2px;
}

#homeScreen .home-card p {
  max-width: 62ch;
  color: #E2C2C2;
  font-size: clamp(15px, 1.95vw, 18px);
  line-height: 1.66;
}

#homeScreen .home-cta {
  min-width: 230px;
  border-radius: 999px;
  padding: 14px 22px;
  border: 1px solid #632A2A;
  background: linear-gradient(135deg, #CC2323 0%, #981919 100%);
  color: #2A0707;
  box-shadow: 0 11px 26px rgba(193, 35, 35, 0.42), inset 0 1px 0 rgba(255, 209, 209, 0.38);
}

#homeScreen .home-prompt-row {
  gap: 10px;
  margin-top: 6px;
}

#homeScreen .home-prompt-pill {
  padding: 9px 13px;
  border: 1px solid #5A3434;
  background: rgba(14, 22, 32, 0.78);
  color: #E6C7C7;
}

#homeScreen .home-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 980px;
}

#homeScreen .home-block {
  border: 1px solid #4F3030;
  background: linear-gradient(180deg, rgba(12, 18, 27, 0.72) 0%, rgba(10, 15, 23, 0.64) 100%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

#homeScreen .home-grid,
#homeScreen .home-strip {
  gap: 12px;
}

#homeScreen .home-tile,
#homeScreen .home-strip-item {
  border-color: #543232;
  background: rgba(13, 21, 31, 0.78);
}

#homeScreen .home-copyright-row {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid #3F2525;
}

#homeScreen .home-copyright {
  color: #BF9696;
}

#homeScreen .home-legal-links {
  flex-wrap: wrap;
  justify-content: center;
}

#homeScreen .home-legal-link {
  color: #EFCACA;
}

#homeScreen .home-legal-link:hover {
  color: #FFD8D8;
}

/* ============================================================
   NEW HOMESCREEN  (.hs-*)
   ============================================================ */

#homeScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 20% -10%, rgba(160, 30, 30, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 700px 500px at 85% 10%, rgba(110, 18, 18, 0.16) 0%, transparent 65%),
    #0a0606;
}

/* subtle grid texture */
#homeScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px) 0 0 / 32px 32px;
}

/* large blurred glow orb behind hero */
#homeScreen::after {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(180, 25, 25, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── NAV ── */
.hs-nav {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 3vw, 40px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.hs-nav-brand {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.hs-nav-logo {
  height: clamp(36px, 4vw, 48px);
  width: auto;
  display: block;
}

.hs-nav-links {
  display: flex;
  gap: 6px;
}

.hs-nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #2A1818;
  background: rgba(255,255,255,0.03);
  color: #C49A9A;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: border-color 130ms, color 130ms, background 130ms;
}

.hs-nav-link:hover {
  border-color: #5A2A2A;
  color: #F0D0D0;
  background: rgba(255,255,255,0.06);
}

/* ── HERO ── */
.hs-hero {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 48px);
  gap: 0;
  animation: hs-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hs-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #3A1E1E;
  background: rgba(180, 25, 25, 0.08);
  color: #C47A7A;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: hs-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.hs-title {
  margin: 0 0 20px;
  font-size: clamp(52px, 8vw, 96px);
  line-height: 1.0;
  letter-spacing: -1px;
  animation: hs-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.hs-title-rok {
  display: block;
  background: linear-gradient(135deg, #FF5555 0%, #CC1111 45%, #8B0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 20px rgba(200, 20, 20, 0.4));
}

.hs-title-tag {
  display: block;
  color: #F2E9E9;
  font-size: 0.55em;
  font-weight: 400;
  letter-spacing: 0px;
  opacity: 0.9;
}

.hs-title-fametext {
  display: block;
  color: #F2E9E9;
  font-size: 0.10em;
  font-weight: 200;
  letter-spacing: 0px;
  opacity: 0.9;
}

.hs-sub {
  margin: 0 0 36px;
  color: #9A7070;
  font-size: clamp(14px, 1.6vw, 17px);
  max-width: 52ch;
  line-height: 1.65;
  animation: hs-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.hs-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid #6B2020;
  background: linear-gradient(135deg, #D42020 0%, #9A1414 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(180, 20, 20, 0.4), inset 0 1px 0 rgba(255,200,200,0.2);
  transition: transform 120ms, box-shadow 120ms, filter 120ms;
  margin-bottom: 32px;
  animation: hs-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.hs-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(180, 20, 20, 0.55);
  filter: brightness(1.08);
}

.hs-cta-arrow {
  font-size: 18px;
  transition: transform 120ms;
}

.hs-cta:hover .hs-cta-arrow {
  transform: translateX(3px);
}

.hs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  animation: hs-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

/* reuse existing .home-prompt-pill but override for new screen */
#homeScreen .home-prompt-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #2E1818;
  background: rgba(255,255,255,0.03);
  color: #B08080;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 130ms, color 130ms, background 130ms;
}

#homeScreen .home-prompt-pill:hover {
  border-color: #6A2A2A;
  color: #F0D0D0;
  background: rgba(180, 25, 25, 0.1);
}

/* ── FOOTER ── */
.hs-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 3vw, 40px);
  border-top: 1px solid rgba(255,255,255,0.04);
  animation: hs-rise 0.5s ease 0.3s both;
}

.hs-footer-copy {
  font-size: 11px;
  color: #5A3535;
}

.hs-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5A3535;
  font-size: 11px;
}

.hs-footer-link {
  background: none;
  border: none;
  color: #7A4848;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  transition: color 120ms;
}

.hs-footer-link:hover {
  color: #D08080;
}

/* ============================================================
   END NEW HOMESCREEN
   ============================================================ */

.msg {
  width: 100%;
  max-width: var(--chat-width);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: rise 180ms ease-out;
  position: relative;
}

.msg-time {
  position: absolute;
  bottom: 2px;
  right: 28px;
  font-size: 10px;
  color: #5a3a3a;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  white-space: nowrap;
}

.msg:hover .msg-time {
  opacity: 1;
}

.msg.user {
  justify-content: flex-end;
}

.msg.system {
  justify-content: center;
}

.bot-stack {
  width: min(760px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.thinking-block {
  border: none;
  border-left: 2px solid #3A2020;
  background: transparent;
  padding-left: 12px;
}

.thinking-block[hidden] {
  display: none;
}

.thinking-block.is-streaming {
  border-left-color: #3A2020;
}

.thinking-summary {
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #d8a7a7;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}

.thinking-summary::-webkit-details-marker {
  display: none;
}

.thinking-summary::marker {
  display: none;
}

.thinking-summary-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.thinking-summary-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(209, 75, 75, 0.22);
  background: rgba(209, 75, 75, 0.12);
  color: #d8a7a7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.thinking-summary-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  color: #e3c3c3;
}

.thinking-summary-arrow {
  flex: none;
  margin-left: auto;
  color: #c09393;
  font-size: 14px;
  line-height: 1;
  transition: transform 160ms ease;
}

.thinking-block[open] .thinking-summary-arrow {
  transform: rotate(90deg);
}

.thinking-body {
  margin: 0;
  padding: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #d9b1b1;
  border-top: none;
}
.avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #2D0F0F;
  color: #F2BFBF;
  border: 1px solid #461B1B;
}

.msg.user .avatar {
  background: #301B1B;
  color: #E5C9C9;
  border-color: #422424;
}

.msg.bot .avatar {
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

.avatar-gif {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-gif.is-thinking {
  transform: scale(1.18);
  transform-origin: center;
}

.bubble {
  max-width: min(680px, 88vw);
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 14px;
  /* bot: no bubble */
  background: transparent;
  border: none;
  padding-left: 0;
  padding-right: 0;
}

.msg.user .bubble {
  background: #1B0D0D;
  border: 1px solid #3A2222;
  border-radius: 18px;
  padding: 10px 16px;
  color: var(--text);
}

.msg.system .bubble {
  background: transparent;
  border: 1px dashed #402A2A;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px 14px;
}

.compacting-bar {
  width: 100%;
  max-width: var(--chat-width);
  margin: 8px auto;
  padding: 10px 16px;
  background: rgba(209, 75, 75, 0.08);
  border: 1px solid rgba(209, 75, 75, 0.2);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  animation: rise 180ms ease-out;
}

.compacting-text {
  margin: 0 0 8px;
}

.compacting-progress {
  width: 0%;
  height: 2px;
  border-radius: 999px;
  background: #d14b4b;
  animation: compacting-progress 2.5s linear forwards;
}

.bubble.plain {
  white-space: pre-wrap;
}

.bubble.markdown {
  white-space: normal;
  position: relative;
}

.bubble.markdown h1,
.bubble.markdown h2,
.bubble.markdown h3 {
  margin: 0 0 10px;
}

.bubble.markdown p {
  margin: 0 0 10px;
}

.bubble.markdown p:last-child {
  margin-bottom: 0;
}

.bubble.markdown ul,
.bubble.markdown ol {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.bubble.markdown li {
  margin: 4px 0;
}

.bubble.markdown a {
  color: #FC7D7D;
}

.bubble.markdown a.external-link::after {
  content: "\2197";
  font-size: 0.7em;
  margin-left: 2px;
  opacity: 0.6;
  vertical-align: super;
}

.bubble.markdown code {
  background: #170B0B;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #361F1F;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
}

.bubble.markdown pre {
  background: #170B0B;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #361F1F;
  overflow-x: auto;
  margin: 10px 0;
}

.bubble.markdown pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

.bubble.markdown blockquote {
  margin: 10px 0;
  padding: 6px 12px;
  border-left: 3px solid #402A2A;
  background: #190C0C;
  color: var(--muted);
}

.bubble.markdown hr {
  border: none;
  border-top: 1px solid #361F1F;
  margin: 14px 0;
}

.bubble.markdown img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

.bubble.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.92em;
}

.bubble.markdown th,
.bubble.markdown td {
  border: 1px solid #361F1F;
  padding: 6px 10px;
  text-align: left;
}

.bubble.markdown th {
  background: #1B0D0D;
  font-weight: 600;
  color: #e0bfbf;
}

.bubble.markdown tr:nth-child(even) td {
  background: rgba(20, 10, 10, 0.4);
}

.bubble.markdown details {
  margin: 8px 0;
  border: 1px solid #361F1F;
  border-radius: 8px;
  background: #170B0B;
}

.bubble.markdown summary {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  color: #cfa3a3;
  user-select: none;
}

.bubble.markdown details[open] summary {
  border-bottom: 1px solid #361F1F;
}

.bubble.markdown details > *:not(summary) {
  padding: 8px 12px;
}

.bubble.markdown sup {
  font-size: 0.75em;
  color: #cfa3a3;
}

.bubble.markdown sub {
  font-size: 0.75em;
}

.bubble.markdown mark {
  background: rgba(255, 200, 60, 0.2);
  color: #f4dcdc;
  padding: 1px 3px;
  border-radius: 2px;
}

.bubble.markdown del {
  color: #8a6a6a;
  text-decoration: line-through;
}

/* KaTeX overrides for dark theme */
.bubble.markdown .katex {
  color: var(--text);
  font-size: 1.05em;
}

.bubble.markdown .katex-display {
  margin: 12px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

.bubble.markdown .katex-display > .katex {
  text-align: center;
}

.bubble.markdown .katex .merror {
  color: #ff9090;
}

/* Smooth fade-in when bot message transitions from streaming to final */
.bubble-reveal {
  animation: bubble-reveal 250ms ease-out;
}

@keyframes bubble-reveal {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* Code block wrapper + copy button */
.code-block-wrapper {
  position: relative;
  margin: 10px 0;
}
.code-block-wrapper pre {
  margin: 0;
}
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #361F1F;
  background: #1E0E0E;
  color: #bfa3a3;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease, color 120ms ease, border-color 120ms ease;
}
.code-block-wrapper:hover .code-copy-btn {
  opacity: 1;
}
.code-copy-btn:hover {
  color: #f4dcdc;
  border-color: #5a3030;
}

.code-lang-label {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #6a4a4a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
}

/* Bubble copy button for bot messages */
.bubble-copy-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #361F1F;
  background: transparent;
  color: #8a6a6a;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.msg.bot:hover .bubble-copy-btn,
.msg.bot .bubble.markdown:hover .bubble-copy-btn {
  opacity: 1;
}
.bubble-copy-btn:hover {
  color: #f4dcdc;
  border-color: #5a3030;
  background: rgba(30, 14, 14, 0.5);
}

/* Regenerate button for last bot message */
.regenerate-btn {
  display: inline-block;
  margin-top: 8px;
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #361F1F;
  background: transparent;
  color: #8a6a6a;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.msg.bot:hover .regenerate-btn {
  opacity: 1;
}
.regenerate-btn:hover {
  color: #f4dcdc;
  border-color: #5a3030;
  background: rgba(30, 14, 14, 0.5);
}

/* Chat search bar */
.chat-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(20, 10, 10, 0.7);
  border-bottom: 1px solid rgba(100, 50, 50, 0.3);
  flex-shrink: 0;
}

.chat-search-bar[hidden] {
  display: none !important;
}

.chat-search-input {
  flex: 1;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #361F1F;
  background: rgba(15, 6, 6, 0.8);
  color: var(--text);
  font-size: 13px;
  font-family: "Sora", "Segoe UI", sans-serif;
  outline: none;
  transition: border-color 120ms ease;
}

.chat-search-input:focus {
  border-color: #5a3030;
}

.chat-search-count {
  font-size: 11px;
  color: #8a6a6a;
  white-space: nowrap;
  min-width: 3em;
  text-align: center;
}

.chat-search-nav {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #361F1F;
  background: transparent;
  color: #bfa3a3;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.chat-search-nav:hover {
  background: rgba(30, 14, 14, 0.5);
  color: #f4dcdc;
}

.chat-search-close {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid #361F1F;
  background: transparent;
  color: #bfa3a3;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.chat-search-close:hover {
  background: rgba(60, 20, 20, 0.6);
  color: #ff9090;
}

.chat-search-highlight {
  background: rgba(255, 200, 60, 0.3);
  border-radius: 2px;
  outline: 1px solid rgba(255, 200, 60, 0.5);
}

.chat-search-highlight.chat-search-current {
  background: rgba(255, 160, 40, 0.5);
  outline: 2px solid rgba(255, 180, 60, 0.8);
}

/* Scroll-to-bottom FAB */
.scroll-fab {
  position: fixed;
  bottom: 90px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #361F1F;
  background: rgba(20, 10, 10, 0.9);
  color: #cfa3a3;
  font-size: 18px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: background 150ms ease, color 150ms ease, opacity 200ms ease, transform 200ms ease;
  opacity: 1;
  transform: translateY(0);
}

.scroll-fab[hidden] {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.scroll-fab:hover {
  background: rgba(40, 20, 20, 0.95);
  color: #f4dcdc;
}

/* Drag-and-drop file overlay */
.chat-drop-active {
  position: relative;
}

.chat-drop-active::after {
  content: "Drop files here to attach";
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 4, 4, 0.85);
  border: 2px dashed #5a3030;
  border-radius: 12px;
  color: #cfa3a3;
  font-size: 16px;
  font-weight: 600;
  font-family: "Sora", "Segoe UI", sans-serif;
  pointer-events: none;
}

/* Sidebar session rename input */
.side-session-rename-input {
  width: 100%;
  padding: 2px 4px;
  border: 1px solid #5a3030;
  border-radius: 4px;
  background: #170B0B;
  color: #f4dcdc;
  font-size: 12px;
  font-family: "Sora", "Segoe UI", sans-serif;
  outline: none;
}

.side-session-rename-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(209, 75, 75, 0.2);
}

/* Knowledge list in sidebar */
.knowledge-count-badge {
  display: inline-block;
  font-size: 10px;
  background: rgba(209, 75, 75, 0.2);
  color: #cfa3a3;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

.side-knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.knowledge-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(20, 10, 10, 0.3);
  font-size: 11px;
  line-height: 1.4;
  color: #b09090;
}

.knowledge-scope {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(209, 75, 75, 0.28);
  background: rgba(209, 75, 75, 0.08);
  color: #d7aaaa;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.knowledge-fact {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.knowledge-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #5a3030;
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity 150ms ease, color 100ms ease;
}

.knowledge-item:hover .knowledge-delete-btn {
  opacity: 1;
}

.knowledge-delete-btn:hover {
  color: #d14b4b;
}

/* "Correct Me" button on bot message bubbles */
.correct-me-btn {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(209, 75, 75, 0.1);
  border: 1px solid rgba(209, 75, 75, 0.2);
  color: #9a6060;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease, background 150ms ease, color 150ms ease;
  z-index: 2;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.msg.bot:hover .correct-me-btn {
  opacity: 1;
}

.correct-me-btn:hover {
  background: rgba(209, 75, 75, 0.2);
  color: #d14b4b;
}

/* Correction Modal */
.correction-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: correction-fade-in 150ms ease-out;
}

@keyframes correction-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.correction-modal {
  background: #1a0e0e;
  border: 1px solid #361f1f;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.correction-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #e8c0c0;
  margin-bottom: 6px;
}

.correction-modal-hint {
  font-size: 12px;
  color: #8a6060;
  margin-bottom: 14px;
  line-height: 1.4;
}

.correction-modal-input {
  width: 100%;
  background: #120a0a;
  border: 1px solid #361f1f;
  border-radius: 8px;
  color: #e0b0b0;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "Sora", "Segoe UI", sans-serif;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.correction-modal-input:focus {
  border-color: #d14b4b;
  box-shadow: 0 0 0 2px rgba(209, 75, 75, 0.15);
}

.correction-modal-input::placeholder {
  color: #5a3030;
}

.correction-modal-charcount {
  text-align: right;
  font-size: 11px;
  color: #5a3030;
  margin-top: 4px;
}

.correction-modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.correction-modal-cancel {
  background: none;
  border: 1px solid #361f1f;
  color: #8a6060;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: "Sora", "Segoe UI", sans-serif;
}

.correction-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #b08080;
}

.correction-modal-cancel:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.correction-modal-submit {
  background: #d14b4b;
  border: none;
  color: #fff;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 500;
}

.correction-modal-submit:disabled {
  background: #5a2020;
  color: #8a5050;
  cursor: not-allowed;
}

.correction-modal-submit:not(:disabled):hover {
  background: #e05555;
}

.customize-rok-modal {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.customize-rok-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.customize-rok-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bf8c8c;
  margin-bottom: 6px;
}

.customize-rok-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 4px;
}

.customize-rok-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #331d1d;
  background: linear-gradient(180deg, rgba(28, 15, 15, 0.96) 0%, rgba(20, 10, 10, 0.94) 100%);
}

.customize-rok-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customize-rok-section-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a27373;
}

.customize-rok-section-title {
  margin: 0;
  font-size: 15px;
  color: #edd9d9;
}

.customize-rok-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customize-rok-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customize-rok-label {
  font-size: 12px;
  font-weight: 600;
  color: #e9cccc;
}

.customize-rok-help {
  font-size: 11px;
  line-height: 1.45;
  color: #986e6e;
}

.customize-rok-field-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customize-rok-textarea {
  min-height: 120px;
}

.customize-rok-accent-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.customize-rok-color-input {
  width: 56px;
  height: 42px;
  padding: 0;
  border: 1px solid #361f1f;
  border-radius: 10px;
  background: #120a0a;
  cursor: pointer;
}

.customize-rok-color-input::-webkit-color-swatch-wrapper {
  padding: 6px;
}

.customize-rok-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.customize-rok-accent-text {
  text-transform: lowercase;
}

.customize-rok-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customize-rok-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--swatch-color);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.customize-rok-swatch:hover {
  transform: translateY(-1px);
}

.customize-rok-swatch.is-active {
  border-color: #f4d2d2;
  box-shadow:
    0 0 0 2px rgba(20, 10, 10, 0.95),
    0 0 0 4px var(--swatch-color);
}

.customize-rok-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.customize-rok-toggle-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customize-rok-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #331d1d;
  background: rgba(18, 10, 10, 0.9);
}

.customize-rok-toggle input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.customize-rok-toggle input:disabled {
  cursor: not-allowed;
}

.customize-rok-toggle input:disabled + .customize-rok-toggle-copy {
  opacity: 0.55;
}

.customize-rok-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.customize-rok-toggle-copy strong {
  font-size: 12px;
  color: #f0dfdf;
}

.customize-rok-toggle-copy span {
  font-size: 11px;
  line-height: 1.45;
  color: #936b6b;
}

.customize-rok-select {
  appearance: none;
}

.customize-rok-btns {
  margin-top: 0;
}

@media (max-width: 720px) {
  .customize-rok-modal {
    width: min(100vw - 20px, 760px);
    max-height: min(92vh, 860px);
    padding: 16px;
  }

  .customize-rok-field-grid {
    grid-template-columns: 1fr;
  }

  .customize-rok-field-footer {
    flex-direction: column;
  }

  .customize-rok-btns {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .customize-rok-btns > * {
    flex: 1 1 160px;
  }
}

.pixel-painting-settings-label {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #d8a7a7;
}

.pixel-painting-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pixel-painting-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid #361f1f;
  border-radius: 10px;
  background: #120a0a;
  color: #e0b0b0;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.pixel-painting-mode-option:hover {
  border-color: #5a3030;
  background: #180d0d;
}

.pixel-painting-mode-option.is-active {
  border-color: #d14b4b;
  background: rgba(209, 75, 75, 0.14);
  transform: translateY(-1px);
}

.pixel-painting-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(209, 75, 75, 0.22);
  background: rgba(209, 75, 75, 0.14);
  color: #f0c5c5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.pixel-painting-mode-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pixel-painting-mode-title {
  font-size: 13px;
  font-weight: 700;
  color: #f3d6d6;
}

.pixel-painting-mode-desc {
  font-size: 11px;
  line-height: 1.35;
  color: #a97878;
}

.pixel-painting-reference-hint {
  margin-top: 6px;
  margin-bottom: 10px;
}

.pixel-painting-reference-card {
  border: 1px dashed #4a2a2a;
  border-radius: 12px;
  background: #110909;
  padding: 12px;
}

.pixel-painting-reference-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pixel-painting-reference-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #4a2a2a;
  background: #1a0f0f;
  flex: 0 0 auto;
}

.pixel-painting-reference-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pixel-painting-reference-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1d3d3;
  overflow-wrap: anywhere;
}

.pixel-painting-reference-meta {
  font-size: 11px;
  line-height: 1.35;
  color: #9e7676;
}

.pixel-painting-reference-empty {
  font-size: 12px;
  color: #8a6060;
  line-height: 1.4;
}

.pixel-painting-reference-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pixel-painting-reference-input {
  display: none;
}

/* Typing indicator — clean 3-dot bounce */
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 2px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) { animation-delay: 0ms; }
.typing-dots span:nth-child(2) { animation-delay: 180ms; }
.typing-dots span:nth-child(3) { animation-delay: 360ms; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.bubble.story-status {
  max-width: none;
  font-size: 12px;
  color: var(--muted);
  border-style: dashed;
  background: rgba(12, 18, 27, 0.76);
}

.story-canvas {
  width: 100%;
  border: 1px solid #432323;
  border-radius: 12px;
  background: #170B0B;
  overflow: hidden;
}

.story-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #361F1F;
  background: #1E0E0E;
}

.story-canvas-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.story-canvas-title {
  font-size: 12px;
  font-weight: 700;
  color: #F2D6D6;
}

.story-canvas-status {
  font-size: 11px;
  color: #C09595;
}

.story-canvas-toggle {
  border: 1px solid #4F2A2A;
  background: #271111;
  color: #E6C8C8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.story-canvas-toggle:hover {
  filter: brightness(1.08);
}

.story-canvas-body {
  margin: 0;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
  font-family: "Sora", "Segoe UI", sans-serif;
  color: #F0D3D3;
  background: #170B0B;
}

.story-canvas.expanded .story-canvas-body {
  max-height: min(72vh, 760px);
}

.composer-wrap {
  border-top: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.95);
  padding: 12px 0 calc(18px + env(safe-area-inset-bottom, 0px));
  position: sticky;
  bottom: 0;
}

.composer {
  max-width: var(--chat-width);
  min-width: 0;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.composer-field {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: stretch;
  border-radius: 12px;
  border: 1px solid #301f1f;
  background: #170b0b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 75, 75, 0.2);
}

.composer-field-textarea,
.composer-field textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  max-height: 180px;
  padding: 12px 8px 12px 14px;
  border: none !important;
  border-radius: 12px 0 0 12px;
  background: transparent !important;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-y: auto;
  box-shadow: none !important;
}

.composer-field-textarea:focus,
.composer-field textarea:focus {
  border: none !important;
  box-shadow: none !important;
}

.composer-field-rail {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 10px 8px 8px;
  flex-shrink: 0;
  border-left: 1px solid rgba(90, 50, 50, 0.45);
}

.composer-model-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  padding-bottom: 1px;
}

.composer-toolbox {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.composer-plus-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
  color: #EACCCC;
}

.composer-plus-btn.is-open {
  border-color: #5A3232;
  background: #211010;
}

.composer-tray {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 124px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #4F2A2A;
  background: #170B0B;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 12;
}

.composer-tray[hidden] {
  display: none;
}

.composer-tray-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  font-size: 12px;
}

.composer-model-label {
  font-size: 11px;
  font-weight: 600;
  color: #6eb4ff;
  letter-spacing: 0.04em;
  user-select: none;
  line-height: 1;
}

.composer-model-picker {
  position: relative;
  flex-shrink: 0;
}

.composer-model-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: min(228px, 46vw);
  padding: 6px 28px 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(90, 50, 50, 0.55);
  background: rgba(18, 8, 8, 0.9);
  color: #f0e4e4;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  line-height: 1.25;
  box-shadow: none;
  filter: none;
}

.composer-model-picker-btn:hover {
  border-color: #5a3a3a;
  filter: brightness(1.05);
}

.composer-model-picker-btn:focus {
  outline: none;
  border-color: #754242;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.35);
}

.composer-model-picker-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.composer-model-picker-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.composer-model-picker-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-model-picker-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -2px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #b8b8b8;
  pointer-events: none;
}

.composer-model-picker-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: min(248px, 90vw);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #4f2a2a;
  background: #170b0b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  z-index: 14;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composer-model-picker-menu[hidden] {
  display: none !important;
}

.composer-model-picker-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.composer-model-picker-group + .composer-model-picker-group {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(197, 143, 143, 0.16);
}

.composer-model-picker-group-label {
  padding: 4px 10px 2px;
  color: #c9aaaa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.composer-model-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #f0e4e4;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
  filter: none;
}

.composer-model-picker-option:hover {
  background: rgba(209, 75, 75, 0.12);
  filter: none;
}

.composer-model-picker-option.is-active {
  border-color: #754242;
  background: rgba(209, 75, 75, 0.18);
}

.composer-model-picker-option-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.composer-model-picker-option-lock {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid #6b4010;
  border-radius: 999px;
  color: #f2c177;
  background: rgba(255, 160, 50, 0.12);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.composer-model-picker-option-label {
  flex: 1;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .composer-field {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-field-textarea,
  .composer-field textarea {
    border-radius: 12px 12px 0 0;
  }

  .composer-field-rail {
    border-left: none;
    border-top: 1px solid rgba(90, 50, 50, 0.45);
    justify-content: flex-end;
    padding: 8px 10px 10px;
  }
}

/* Legacy home-screen skin (map hs-* layout to old UI look) */
#homeScreen {
  justify-content: center;
  gap: clamp(18px, 3vh, 28px);
}

#homeScreen .home-bg-demo {
  display: block !important;
}

#homeScreen #homeWorkspacePreview[hidden] {
  display: block !important;
}

#homeScreen .hs-nav {
  position: absolute;
  top: clamp(8px, 2vh, 14px);
  left: clamp(10px, 2vw, 20px);
  right: clamp(10px, 2vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 6;
  padding: 0;
  border: 0;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

#homeScreen .hs-nav-brand {
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: default;
}

#homeScreen .hs-nav-logo {
  height: clamp(40px, 6vw, 56px);
  width: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.38));
}

#homeScreen .hs-nav-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  overflow: hidden;
}

#homeScreen .hs-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #4a2a2a;
  background: rgba(11, 18, 27, 0.72);
  color: #dcb9b9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 1;
  transition: border-color 120ms, color 120ms, background 120ms;
}

#homeScreen .hs-nav-link:hover {
  background: rgba(15, 24, 35, 0.84);
  border-color: #664040;
}

@media (max-width: 720px) {
  #homeScreen .hs-nav {
    justify-content: center;
  }

  #homeScreen .hs-nav-links {
    justify-content: center;
  }

  #homeScreen .hs-nav-link {
    padding: 6px 10px;
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  #homeScreen .hs-nav {
    align-items: center;
    justify-content: center;
    row-gap: 6px;
  }

  #homeScreen .hs-nav-brand,
  #homeScreen .hs-nav-links {
    flex: 1 1 100%;
    display: flex;
    justify-content: center;
  }

  #homeScreen .hs-nav-links {
    gap: 6px;
  }

  #homeScreen .hs-nav-logo {
    height: clamp(32px, 8vw, 44px);
  }
}

#homeScreen .hs-hero {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: min(760px, 100%);
  margin: clamp(56px, 10vh, 90px) auto 0;
  padding: clamp(24px, 4vw, 36px) clamp(18px, 4vw, 36px);
  border: 1px solid #5e3535;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(12, 19, 29, 0.82) 0%, rgba(10, 16, 24, 0.74) 100%);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 201, 201, 0.08);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.9vh, 16px);
  overflow: hidden;
  animation: none;
}

#homeScreen .hs-hero::before,
#homeScreen .hs-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(34px);
  opacity: 0.2;
}

#homeScreen .hs-hero::before {
  width: 180px;
  height: 180px;
  right: -60px;
  top: -70px;
  background: rgba(190, 58, 58, 0.62);
  animation: home-float-1 14s ease-in-out infinite;
}

#homeScreen .hs-hero::after {
  width: 220px;
  height: 220px;
  left: -80px;
  bottom: -100px;
  background: rgba(143, 45, 45, 0.52);
  animation: home-float-2 18s ease-in-out infinite;
}

#homeScreen .hs-kicker {
  padding: 0;
  border: 0;
  background: transparent;
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #c6a3a3;
  animation: none;
}

#homeScreen .hs-title {
  margin: 0;
  font-size: clamp(42px, 6.1vw, 64px);
  line-height: 1.06;
  letter-spacing: 0.2px;
  animation: none;
}

#homeScreen .hs-title-rok,
#homeScreen .hs-title-tag {
  display: inline;
  background: none;
  -webkit-text-fill-color: initial;
  color: #f4dcdc;
  filter: none;
  font-weight: 700;
}

#homeScreen .hs-title-tag {
  margin-left: 6px;
  font-size: inherit;
  opacity: 1;
}

#homeScreen .hs-sub {
  margin: 0 auto;
  max-width: 52ch;
  font-size: clamp(13px, 1.35vw, 15px);
  line-height: 1.62;
  color: #d8b4b4;
  animation: none;
}

#homeScreen .hs-cta {
  align-self: center;
  margin-top: 4px;
  min-width: 214px;
  border-radius: 999px;
  border: 1px solid #6a2d2d;
  padding: 13px 20px;
  background: linear-gradient(135deg, #cc2d2d 0%, #961717 100%);
  color: #260505;
  box-shadow:
    0 12px 28px rgba(177, 31, 31, 0.46),
    inset 0 1px 0 rgba(255, 220, 220, 0.36);
  position: relative;
  animation: none;
}

#homeScreen .hs-cta::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 72%;
  height: 14px;
  transform: translateX(-50%);
  background: rgba(198, 50, 50, 0.4);
  filter: blur(12px);
  border-radius: 999px;
  pointer-events: none;
}

#homeScreen .hs-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 24px rgba(181, 23, 23, 0.55),
    inset 0 1px 0 rgba(255, 196, 196, 0.4);
  filter: none;
}

#homeScreen .hs-cta-arrow {
  display: inline-block;
}

#homeScreen .hs-nav-link[href*="docs"]::after {
  content: "→";
  margin-left: 6px;
  font-size: 12px;
}

#homeScreen .hs-pills {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  animation: none;
}

#homeScreen .hs-footer {
  width: min(760px, 100%);
  margin: 10px auto 0;
  padding-top: 10px;
  border-top: 1px solid #402727;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: none;
}

#homeScreen .hs-footer-copy {
  color: #b98e8e;
  font-size: 11px;
}

#homeScreen .hs-footer-links {
  color: #b98e8e;
  font-size: 11px;
  gap: 8px;
}

#homeScreen .hs-footer-links span {
  color: #7b5555;
}

#homeScreen .hs-footer-link {
  color: #e8c1c1;
}

#homeScreen .hs-footer-link:hover {
  color: #ffd8d8;
}

#homeScreen .hs-nav,
#homeScreen .hs-hero,
#homeScreen #homeWorkspacePreview,
#homeScreen .hs-footer {
  order: 0;
}

#homeScreen .hs-hero {
  order: 1;
}

#homeScreen #homeWorkspacePreview {
  order: 2;
}

#homeScreen .hs-footer {
  order: 3;
}

.composer-tray-btn.is-active {
  border-color: #754242;
  background: rgba(209, 75, 75, 0.14);
  color: #F2D8D8;
}
.file-input {
  display: none;
}

.attachment-list {
  max-width: var(--chat-width);
  margin: 8px auto 0;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: var(--text);
  overflow: hidden;
}

.attachment-card.image-card {
  width: 80px;
  height: 80px;
}

.attachment-thumb {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
}

.attachment-card.pasted-card {
  width: 140px;
  height: 80px;
  padding: 24px 10px 8px;
  background: #202020;
}

.attachment-badge {
  position: absolute;
  top: 6px;
  left: 8px;
  border-radius: 999px;
  border: 1px solid #4a4a4a;
  background: #2b2b2b;
  color: #b7b7b7;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
}

.attachment-preview-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
  color: #c8c8c8;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.attachment-card.file-card {
  width: 140px;
  min-height: 80px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.attachment-file-icon {
  font-size: 16px;
  line-height: 1;
}

.attachment-file-name {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-file-size {
  font-size: 11px;
  color: var(--muted);
}

.attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: rgba(15, 15, 15, 0.9);
  color: #d0d0d0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.attachment-remove:hover {
  color: #ffffff;
  background: rgba(35, 35, 35, 0.95);
  filter: none;
}

textarea {
  flex: 1;
  min-height: 44px;
  max-height: 180px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #301F1F;
  background: #170B0B;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  outline: none;
  overflow-y: auto;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 75, 75, 0.2);
}

button {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #361A1A;
  background: linear-gradient(135deg, var(--accent), #8B0F0F);
  color: #220606;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.07);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

button.brand-btn {
  border: 0;
  padding: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

button.brand-btn:hover {
  filter: brightness(1.08);
}

button.stop-mode {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #3F2727;
  background: linear-gradient(135deg, #FF6B6B, #D54B4B);
  color: #2D0A0A;
  font-size: 16px;
  line-height: 1;
}

button.stop-mode::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #2D0A0A;
}

button.stop-mode:hover {
  filter: brightness(1.05);
}

/* Send button ready pulse */
.send-ready {
  animation: send-pulse 2s ease-in-out infinite;
}

@keyframes send-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(209, 75, 75, 0); }
  50% { box-shadow: 0 0 0 4px rgba(209, 75, 75, 0.15); }
}

.composer-meta {
  max-width: var(--chat-width);
  margin: 4px auto 0;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.cooldown {
  color: var(--accent-2);
  min-height: 16px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes compacting-progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes workspace-dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(202, 107, 107, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(202, 107, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(202, 107, 107, 0);
  }
}

@keyframes workspace-assistant-fade-in {
  from {
    opacity: 0.5;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes model-popup-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes demo-user-line {
  0%,
  4% {
    opacity: 0;
  }
  5%,
  30% {
    opacity: 1;
  }
  31%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-bot-line {
  0%,
  30% {
    opacity: 0;
  }
  31%,
  66% {
    opacity: 1;
  }
  67%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-cards-line {
  0%,
  57% {
    opacity: 0;
  }
  58%,
  93% {
    opacity: 1;
  }
  94%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-user-type {
  0%,
  7% {
    width: 0;
  }
  22%,
  30% {
    width: 64ch;
  }
  31%,
  100% {
    width: 0;
  }
}

@keyframes demo-bot-type {
  0%,
  34% {
    width: 0;
  }
  52%,
  66% {
    width: 92ch;
  }
  67%,
  100% {
    width: 0;
  }
}

@keyframes demo-gen-line {
  0%,
  58% {
    opacity: 0;
  }
  59%,
  92% {
    opacity: 1;
  }
  93%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-card-1 {
  0%,
  61% {
    opacity: 0;
    transform: translateY(8px);
  }
  64%,
  92% {
    opacity: 1;
    transform: translateY(0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes demo-card-2 {
  0%,
  65% {
    opacity: 0;
    transform: translateY(8px);
  }
  68%,
  92% {
    opacity: 1;
    transform: translateY(0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes demo-card-3 {
  0%,
  69% {
    opacity: 0;
    transform: translateY(8px);
  }
  72%,
  92% {
    opacity: 1;
    transform: translateY(0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes demo-card-4 {
  0%,
  73% {
    opacity: 0;
    transform: translateY(8px);
  }
  76%,
  92% {
    opacity: 1;
    transform: translateY(0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes demo-card-5 {
  0%,
  77% {
    opacity: 0;
    transform: translateY(8px);
  }
  80%,
  92% {
    opacity: 1;
    transform: translateY(0);
  }
  93%,
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes demo-caret {
  0%,
  49% {
    border-right-color: rgba(242, 198, 198, 0.9);
  }
  50%,
  100% {
    border-right-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-bg-line,
  .home-bg-type,
  .home-bg-gen-line,
  .home-bg-card {
    animation: none !important;
    opacity: 1;
  }

  .home-bg-type {
    width: auto;
    border-right: 0;
  }

  .home-bg-card {
    transform: none;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    position: relative;
  }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 320px);
    z-index: 125;
    transform: translateX(-104%);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 150ms ease;
    box-shadow: 24px 0 38px rgba(0, 0, 0, 0.45);
  }

  .app.sidebar-collapsed .sidebar {
    padding: 18px 14px;
    border-right-color: var(--border);
    overflow-y: auto;
  }

  .app::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(4, 6, 10, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
  }

  .app.mobile-sidebar-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .app.mobile-sidebar-open::after {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace-tabs-top {
    display: flex;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
    width: 36px;
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .home-bg-chat {
    padding: 42px 16px 24px;
    opacity: 0.46;
  }

  .home-bottom {
    grid-template-columns: 1fr;
    max-width: 860px;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-mode-btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }

  .top-left {
    min-width: 0;
    gap: 8px;
  }

  #homeScreen .home-nav {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  #homeScreen .home-nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .model-switch {
    gap: 6px;
    padding: 3px 6px;
  }

  .model-switch-label {
    display: none;
  }

  .model-select {
    min-width: 124px;
    max-width: 42vw;
    padding: 4px 8px;
    font-size: 11px;
  }

  .server-down-card {
    padding: 24px 18px;
  }

  .server-down-badge {
    margin-bottom: 8px;
  }

  .server-down-logo {
    font-size: 28px;
  }

  .server-down-title {
    font-size: 20px;
  }

  .server-down-card p {
    font-size: 14px;
  }

  .server-down-meta {
    font-size: 12px;
  }

  .server-down-actions {
    margin-top: 14px;
    gap: 8px;
  }

  .server-down-why-panel {
    font-size: 11px;
    padding: 9px 10px;
  }

  .workspace-apply-modal {
    padding: 12px;
  }

  .workspace-apply-card {
    gap: 10px;
    padding: 14px 12px;
    border-radius: 14px;
  }

  .workspace-apply-title {
    font-size: 19px;
  }

  .workspace-apply-preview {
    max-height: min(46vh, 320px);
    font-size: 12px;
  }

  .workspace-apply-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .workspace-apply-btn {
    width: 100%;
  }

  .workspace-route-modal {
    padding: 12px;
  }

  .workspace-route-card {
    gap: 10px;
    padding: 14px 12px;
    border-radius: 14px;
  }

  .workspace-route-title {
    font-size: 19px;
  }

  .workspace-route-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .workspace-route-btn {
    width: 100%;
  }

  .legal-card {
    padding: 14px 12px;
    border-radius: 14px;
    max-height: min(88vh, 680px);
  }

  .legal-title {
    font-size: 16px;
  }

  .legal-tabs {
    gap: 6px;
  }

  .legal-tab {
    padding: 7px 9px;
    font-size: 11px;
  }

  .home-card {
    width: 100%;
    min-height: calc(100vh - 28px);
    min-height: calc(100dvh - 28px);
    padding: 2px 0 6px;
    gap: 12px;
  }

  .home-card-clean {
    width: 100%;
    min-height: 100%;
    gap: 0;
    padding: 0 10px;
  }

  .home-header-clean {
    min-height: 0;
  }

  .home-main-title-top {
    top: 0;
    padding-top: 6px;
    font-size: clamp(22px, 7vw, 32px);
  }

  .home-logo-edge-left .rok-logo-img {
    height: 48px;
  }

  .home-hero-clean {
    margin: 0 auto;
    min-height: calc(100dvh - 16px);
    padding-top: 56px;
    padding-bottom: 10px;
    gap: 0;
  }

  .home-hero-clean p {
    font-size: 14px;
    line-height: 1.6;
  }

  .home-hero-clean .home-cta {
    min-width: 198px;
    padding: 12px 16px;
  }

  .home-hero-clean .home-prompt-row-clean {
    gap: 8px;
  }

  .home-hero-clean .home-prompt-pill {
    padding: 7px 10px;
    font-size: 10px;
  }

  .home-why-clean {
    gap: 7px;
  }

  .home-why-row {
    gap: 7px;
  }

  .home-why-chip {
    font-size: 10px;
    padding: 6px 9px;
  }

  .home-card-minimal {
    gap: 10px;
    padding-top: 12px;
  }

  .home-middle {
    margin: 2px auto;
    gap: 7px;
    padding: 14px 10px;
    border-radius: 14px;
  }

  .home-card-minimal .home-middle {
    padding: 14px 12px;
  }

  .home-corner-logo {
    padding: 6px;
  }

  .home-corner-logo .home-logo .rok-logo-img {
    height: 44px;
  }

  .home-mini-pill {
    font-size: 10px;
    padding: 6px 9px;
  }

  .home-screen {
    padding: 12px 12px 14px;
  }

  .home-block {
    width: 100%;
    padding: 10px;
    border-radius: 14px;
  }

  .home-subtitle {
    font-size: 11px;
  }

  .home-copy-top {
    gap: 8px;
  }

  .home-bottom-middle {
    gap: 8px;
  }

  .home-bg-bubble {
    max-width: min(92vw, 600px);
    font-size: 12px;
  }

  .home-bg-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-logo {
    font-size: 25px;
  }

  .home-card h1 {
    font-size: 20px;
  }

  #homeScreen .home-card {
    min-height: calc(100dvh - 26px);
    gap: 12px;
  }

  #homeScreen .home-logo .rok-logo-img {
    height: 56px;
  }

  #homeScreen .home-middle {
    padding: 16px 12px;
    border-radius: 14px;
    gap: 10px;
  }

  #homeScreen .home-card p {
    font-size: 14px;
    line-height: 1.58;
  }

  #homeScreen .home-cta {
    min-width: 192px;
    padding: 12px 16px;
  }

  #homeScreen .home-prompt-pill {
    padding: 7px 10px;
    font-size: 10px;
  }

  #homeScreen .home-legal-links {
    white-space: normal;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-strip {
    grid-template-columns: 1fr;
  }

  .bot-stack {
    width: min(92vw, 760px);
  }

  .story-canvas-body {
    max-height: 190px;
    font-size: 13px;
  }

  .story-canvas.expanded .story-canvas-body {
    max-height: 60vh;
  }

  .workspace-tabs-top {
    padding-left: 14px;
    padding-right: 14px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .workspace-panel {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .model-panel {
    padding: 14px 12px 16px;
  }

  .model-panel-shell {
    width: 100%;
    max-height: min(72vh, 520px);
    border-radius: 14px;
    gap: 10px;
    padding: 12px;
  }

  .model-option-list {
    max-height: min(42vh, 260px);
  }

  .model-option-btn {
    padding: 10px 11px;
    gap: 5px;
  }

  .workspace-document-shell {
    gap: 8px;
  }

  .workspace-panel-head {
    width: 100%;
    padding: 8px 9px;
    gap: 6px;
  }

  .workspace-panel-tools {
    align-items: stretch;
    gap: 7px;
  }

  .workspace-panel-actions {
    width: 100%;
    justify-content: stretch;
  }

  .workspace-mini-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 9px;
    font-size: 10px;
  }

  .workspace-tab {
    padding: 8px 10px;
    font-size: 11px;
  }

  .workspace-editor {
    border-radius: 10px;
    min-height: 200px;
    height: clamp(200px, 36vh, 350px);
    max-height: 48vh;
    font-size: 12px;
  }

  .workspace-assistant {
    min-height: 110px;
  }

  .workspace-assistant-head {
    padding: 8px 9px;
    gap: 6px;
  }

  .workspace-assistant-suggest-btn {
    min-width: 118px;
    padding: 8px 9px;
    font-size: 10px;
  }

  .workspace-assistant-toggle {
    padding: 1px 0;
  }

  .workspace-assistant-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .msg,
  .composer,
  .composer-meta {
    padding-left: 14px;
    padding-right: 14px;
  }

  button {
    padding: 12px 12px;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-mode-btn {
    padding: 0 10px;
    font-size: 10px;
  }

  .home-logo .rok-logo-img {
    height: 60px;
  }

  #homeScreen .home-logo .rok-logo-img {
    height: 42px;
  }

  #homeScreen .home-subtitle {
    font-size: 10px;
    padding: 5px 8px;
  }

  #homeScreen .home-middle {
    padding: 14px 10px;
  }

  .home-main-title-top {
    top: 0;
    padding-top: 4px;
    font-size: clamp(20px, 7vw, 28px);
  }

  .home-logo-edge-left .rok-logo-img {
    height: 36px;
  }

  .home-subtitle-clean {
    padding: 5px 8px;
    font-size: 10px;
  }

  .topbar .rok-logo-img {
    height: 36px;
  }

  .workspace-tabs-top {
    padding: 8px 10px 7px;
    gap: 6px;
  }

  .workspace-tab {
    padding: 7px 8px;
    font-size: 10px;
  }

  .model-panel {
    padding: 10px 8px 12px;
  }

  .model-panel-shell {
    padding: 10px;
    border-radius: 12px;
  }

  .model-option-btn {
    padding: 9px 10px;
  }

  .workspace-panel,
  .msg,
  .composer,
  .composer-meta,
  .attachment-list {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workspace-editor {
    min-height: 168px;
    height: clamp(168px, 34vh, 250px);
    max-height: 44vh;
  }

  .workspace-doc-chip {
    padding: 4px 7px;
    font-size: 9px;
  }

  .workspace-mini-btn {
    padding: 7px 8px;
    font-size: 10px;
  }
}

@media (max-height: 760px) {
  .topbar {
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: 10px;
  }

  .workspace-panel {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .workspace-editor {
    min-height: 160px;
    height: clamp(160px, 33vh, 250px);
    max-height: 42vh;
  }

  .workspace-assistant {
    min-height: 96px;
  }

  .model-panel {
    padding: 10px 12px 12px;
  }

  .model-panel-shell {
    max-height: min(80vh, 480px);
  }

  .home-card {
    gap: 12px;
    min-height: calc(100vh - 28px);
    min-height: calc(100dvh - 28px);
  }

  .home-middle {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

/* Home Refresh: hierarchy, texture, glow, nav, and preview */
#homeScreen.home-screen {
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(18px, 3vw, 32px);
  background:
    radial-gradient(1200px 700px at 52% 12%, rgba(165, 38, 38, 0.24) 0%, transparent 62%),
    radial-gradient(860px 560px at 8% 88%, rgba(120, 28, 28, 0.14) 0%, transparent 65%),
    radial-gradient(860px 540px at 92% 14%, rgba(130, 34, 34, 0.14) 0%, transparent 66%),
    linear-gradient(180deg, rgba(8, 11, 17, 0.96) 0%, rgba(10, 12, 18, 0.98) 100%);
}

#homeScreen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 34px 34px;
  opacity: 0.26;
}

#homeScreen::after {
  content: "";
  position: absolute;
  inset: -25% -12%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 38%, rgba(204, 61, 61, 0.16) 0%, rgba(204, 61, 61, 0) 52%),
    radial-gradient(circle at 72% 62%, rgba(166, 45, 45, 0.14) 0%, rgba(166, 45, 45, 0) 48%);
  filter: blur(24px);
  animation: home-bg-shift 18s ease-in-out infinite alternate;
}

#homeScreen .home-nav {
  position: absolute;
  top: clamp(8px, 2vh, 14px);
  left: clamp(10px, 2vw, 20px);
  right: clamp(10px, 2vw, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 6;
}

#homeScreen .home-nav-brand {
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: default;
}

#homeScreen .home-nav-brand .rok-logo-img {
  height: clamp(40px, 6vw, 56px);
  width: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.38));
}

#homeScreen .home-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#homeScreen .home-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #4a2a2a;
  background: rgba(11, 18, 27, 0.72);
  color: #dcb9b9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
}

#homeScreen .home-nav-link:hover {
  background: rgba(15, 24, 35, 0.84);
  border-color: #664040;
}

#homeScreen .home-card {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  min-height: 0;
  padding: clamp(56px, 10vh, 90px) 0 0;
  justify-content: flex-start;
  align-items: center;
  gap: clamp(18px, 3vh, 28px);
}

#homeScreen .home-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 34%;
  width: min(760px, 84vw);
  height: min(420px, 46vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(205, 66, 66, 0.2) 0%, rgba(205, 66, 66, 0.02) 42%, rgba(205, 66, 66, 0) 68%);
  filter: blur(26px);
}

#homeScreen .home-middle {
  width: min(760px, 100%);
  border: 1px solid #5e3535;
  border-radius: 22px;
  padding: clamp(24px, 4vw, 36px) clamp(18px, 4vw, 36px);
  background:
    linear-gradient(180deg, rgba(12, 19, 29, 0.82) 0%, rgba(10, 16, 24, 0.74) 100%);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 201, 201, 0.08);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.9vh, 16px);
  position: relative;
  overflow: hidden;
}

#homeScreen .home-middle::before,
#homeScreen .home-middle::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(34px);
  opacity: 0.2;
}

#homeScreen .home-middle::before {
  width: 180px;
  height: 180px;
  right: -60px;
  top: -70px;
  background: rgba(190, 58, 58, 0.62);
  animation: home-float-1 14s ease-in-out infinite;
}

#homeScreen .home-middle::after {
  width: 220px;
  height: 220px;
  left: -80px;
  bottom: -100px;
  background: rgba(143, 45, 45, 0.52);
  animation: home-float-2 18s ease-in-out infinite;
}

#homeScreen .home-hero-badge {
  align-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #623636;
  background: rgba(170, 52, 52, 0.16);
  color: #efbebe;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.86px;
  text-transform: uppercase;
}

#homeScreen .home-card h1 {
  margin: 0;
  font-size: clamp(42px, 6.1vw, 64px);
  line-height: 1.06;
  letter-spacing: 0.2px;
}

#homeScreen .home-card p {
  margin: 0 auto;
  max-width: 52ch;
  font-size: clamp(13px, 1.35vw, 15px);
  line-height: 1.62;
  color: #d8b4b4;
}

#homeScreen .home-cta {
  align-self: center;
  margin-top: 4px;
  min-width: 214px;
  border-radius: 999px;
  border: 1px solid #6a2d2d;
  padding: 13px 20px;
  background: linear-gradient(135deg, #cc2d2d 0%, #961717 100%);
  color: #260505;
  box-shadow:
    0 12px 28px rgba(177, 31, 31, 0.46),
    inset 0 1px 0 rgba(255, 220, 220, 0.36);
  position: relative;
}

#homeScreen .home-cta::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 72%;
  height: 14px;
  transform: translateX(-50%);
  background: rgba(198, 50, 50, 0.4);
  filter: blur(12px);
  border-radius: 999px;
  pointer-events: none;
}

#homeScreen .home-prompt-row {
  margin-top: 8px;
  gap: 10px;
}

#homeScreen .home-prompt-pill {
  border: 1px solid #5f3939;
  background: rgba(13, 21, 31, 0.8);
  color: #e4c4c4;
  padding: 8px 12px;
  font-size: 11px;
}

#homeScreen .home-preview {
  width: min(760px, 100%);
  border: 1px solid #513030;
  border-radius: 18px;
  padding: 12px;
  background: rgba(11, 18, 27, 0.72);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(12px) scale(0.99);
  transition: opacity 320ms ease, transform 340ms ease;
}

#homeScreen .home-preview.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#homeScreen .home-preview.is-hidden-preview {
  pointer-events: none;
}

#homeScreen .home-preview-title {
  margin: 0 0 9px;
  color: #d9afaf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

#homeScreen .home-preview-shell {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  border: 1px solid #422727;
  border-radius: 12px;
  overflow: hidden;
  min-height: 160px;
  background: rgba(8, 13, 21, 0.72);
}

#homeScreen .home-preview-side {
  border-right: 1px solid #3e2424;
  padding: 12px 10px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: rgba(10, 16, 24, 0.82);
}

#homeScreen .home-preview-side-item {
  min-height: 20px;
  border-radius: 8px;
  border: 1px solid #4b2d2d;
  background: linear-gradient(90deg, rgba(169, 63, 63, 0.24) 0%, rgba(169, 63, 63, 0.07) 100%);
  color: #dab8b8;
  font-size: 10px;
  line-height: 1.2;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
}

#homeScreen .home-preview-main {
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

#homeScreen .home-preview-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#homeScreen .home-preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b56b6b;
}

#homeScreen .home-preview-toolbar-title {
  margin-left: 4px;
  font-size: 11px;
  color: #d5b2b2;
}

#homeScreen .home-preview-example {
  display: grid;
  align-content: start;
  gap: 7px;
}

#homeScreen .home-preview-example-line {
  min-height: 18px;
  border-radius: 7px;
  border: 1px solid #3d2525;
  background: rgba(15, 23, 34, 0.7);
  color: #e9d0d0;
  padding: 3px 7px;
  line-height: 1.44;
  font-size: 11px;
  opacity: 0;
  transition: opacity 140ms ease;
  position: relative;
}

#homeScreen .home-preview-example-line.is-visible {
  opacity: 1;
}

#homeScreen .home-preview-example-line.is-typing::after {
  content: "";
  width: 1px;
  height: 0.95em;
  margin-left: 2px;
  display: inline-block;
  vertical-align: text-bottom;
  background: #f2cfcf;
  animation: home-preview-caret 700ms step-end infinite;
}

@keyframes home-preview-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

#homeScreen .home-bottom {
  width: min(760px, 100%);
  margin: 0 auto;
}

#homeScreen .home-copyright-row {
  border-top: 1px solid #402727;
  padding-top: 10px;
}

#homeScreen .home-copyright {
  color: #b98e8e;
}

#homeScreen .home-legal-link {
  color: #e8c1c1;
}

#homeScreen .home-legal-link:hover {
  color: #ffd8d8;
}

@keyframes home-bg-shift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-1.5%, 1.5%, 0) scale(1.03);
  }
}

@keyframes home-float-1 {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-8px, 10px, 0);
  }
}

@keyframes home-float-2 {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(10px, -8px, 0);
  }
}

@media (max-width: 900px) {
  #homeScreen .home-nav {
    top: 8px;
    left: 10px;
    right: 10px;
  }

  #homeScreen .home-nav-brand .rok-logo-img {
    height: 42px;
  }

  #homeScreen .home-nav-link {
    padding: 6px 10px;
    font-size: 10px;
  }

  #homeScreen .home-card {
    padding-top: 52px;
    gap: 14px;
  }

  #homeScreen .home-middle {
    border-radius: 16px;
    padding: 18px 12px;
  }

  #homeScreen .home-card h1 {
    font-size: clamp(30px, 7vw, 44px);
  }

  #homeScreen .home-preview-shell {
    grid-template-columns: 1fr;
  }

  #homeScreen .home-preview-side {
    border-right: 0;
    border-bottom: 1px solid #3e2424;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  #homeScreen::after,
  #homeScreen .home-middle::before,
  #homeScreen .home-middle::after {
    animation: none !important;
  }

  #homeScreen .home-preview {
    transition: none;
    transform: none;
  }

  #homeScreen .home-preview-example-line {
    transition: none;
  }

  #homeScreen .home-preview-example-line.is-typing::after {
    animation: none;
  }
}

/* -- Math Panel -- */
.math-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.math-panel[hidden] {
  display: none;
}

.desmos-container {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #ffffff;
}

/* Discreet standalone link */
.math-standalone-link {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 18;
  font-size: 11px;
  color: rgba(55, 74, 102, 0.72);
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: color 0.12s ease;
}
.math-standalone-link:hover {
  color: #1f4b7a;
}

/* Secret "rok" button - small, subtle, bottom-right corner */
.math-chat-toggle-btn {
  position: absolute;
  bottom: 18px;
  right: 18px;
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(45, 112, 179, 0.28);
  background: rgba(255, 255, 255, 0.92);
  color: #2d70b3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 24px rgba(45, 112, 179, 0.14);
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.math-chat-toggle-btn:hover {
  border-color: #2d70b3;
  background: rgba(45, 112, 179, 0.12);
  box-shadow: 0 14px 30px rgba(45, 112, 179, 0.2);
  transform: scale(1.08);
}
.math-chat-toggle-btn.is-active {
  background: rgba(45, 112, 179, 0.18);
  border-color: #2d70b3;
}

/* Sliding drawer */
.math-chat-drawer {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 320px;
  height: 420px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px 0 0 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: -8px -8px 28px rgba(15, 23, 42, 0.14);
  animation: math-drawer-slide-in 0.22s ease both;
}
.math-chat-drawer[hidden] { display: none; }

@keyframes math-drawer-slide-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.math-chat-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #dbe4ee;
}
.math-chat-drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: #18324f;
  letter-spacing: 0.3px;
}
.math-chat-close-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.math-chat-close-btn:hover { color: #0f172a; }

.math-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.math-chat-msg {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.math-chat-msg-user {
  align-self: flex-end;
  background: rgba(45, 112, 179, 0.14);
  border: 1px solid rgba(45, 112, 179, 0.24);
  color: #0f172a;
}
.math-chat-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  color: #1e293b;
}

.math-chat-msg.markdown {
  padding: 10px 12px;
}

.math-chat-msg.markdown h1,
.math-chat-msg.markdown h2,
.math-chat-msg.markdown h3,
.math-chat-msg.markdown h4 {
  margin: 0 0 0.5em;
  color: #18324f;
  font-size: 1em;
}

.math-chat-msg.markdown p {
  margin: 0 0 0.7em;
}

.math-chat-msg.markdown p:last-child {
  margin-bottom: 0;
}

.math-chat-msg.markdown ul,
.math-chat-msg.markdown ol {
  margin: 0 0 0.7em;
  padding-left: 1.2em;
}

.math-chat-msg.markdown li {
  margin-bottom: 0.25em;
}

.math-chat-msg.markdown a {
  color: #245c94;
}

.math-chat-msg.markdown code {
  padding: 0.14em 0.34em;
  border-radius: 6px;
  background: #eef4fb;
  color: #17314e;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92em;
}

.math-chat-msg.markdown pre {
  margin: 0 0 0.7em;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
}

.math-chat-msg.markdown pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.math-chat-msg.markdown blockquote {
  margin: 0 0 0.7em;
  padding-left: 10px;
  border-left: 3px solid #bfd1e6;
  color: #46617f;
}

.math-chat-msg.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.7em;
  font-size: 0.95em;
}

.math-chat-msg.markdown th,
.math-chat-msg.markdown td {
  border: 1px solid #d7e3f0;
  padding: 6px 8px;
  text-align: left;
}

.math-chat-msg.markdown th {
  background: #edf4fb;
}

.math-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #dbe4ee;
}
.math-chat-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font-size: 13px;
  padding: 8px 10px;
  font-family: inherit;
  outline: none;
}
.math-chat-input:focus {
  border-color: #2d70b3;
}
.math-chat-send-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #2d70b3;
  background: linear-gradient(135deg, #2d70b3 0%, #1f5f9d 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.math-chat-send-btn:hover { filter: brightness(1.1); }

.desmos-topbar-icon {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.desmos-topbar-icon:hover { opacity: 1; }

.desmos-topbar-folder-icon {
  color: #aaa;
  display: inline-flex;
  align-items: center;
}

/* ── Thinking burnout modal ─────────────────────────────────────────── */
.burnout-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 9, 14, 0.78);
  backdrop-filter: blur(5px);
}

.burnout-modal[hidden] {
  display: none;
}

.burnout-card {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 24px 24px;
  border-radius: 18px;
  border: 1px solid #5A3A1A;
  background: linear-gradient(180deg, rgba(22, 14, 6, 0.99) 0%, rgba(14, 10, 4, 0.97) 100%);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 190, 100, 0.07);
  text-align: center;
  animation: burnout-pop 0.22s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes burnout-pop {
  from { opacity: 0; transform: scale(0.88) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.burnout-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.burnout-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #6B4010;
  background: rgba(255, 160, 50, 0.12);
  color: #FFD08A;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.burnout-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid #4A2E0A;
  background: #1E1206;
  color: #D4A060;
  padding: 0;
  line-height: 1;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.burnout-close:hover {
  background: #2C1A09;
  border-color: #6B4010;
}

.burnout-emoji {
  margin: 8px 0 6px;
  line-height: 0;
  flex-shrink: 0;
}

.burnout-emoji-img {
  display: block;
  width: min(200px, 72vw);
  max-width: 100%;
  height: auto;
  max-height: min(220px, 40vh);
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 4px 14px rgba(255, 160, 50, 0.22));
}

.burnout-title {
  margin: 0;
  font-size: clamp(19px, 2.6vw, 23px);
  font-weight: 700;
  line-height: 1.25;
  color: #FFE0A8;
  letter-spacing: 0.1px;
}

.burnout-body {
  margin: 0;
  color: #C8A070;
  font-size: 14px;
  line-height: 1.6;
  max-width: 380px;
}

.burnout-reset {
  margin: 0;
  color: #8A6030;
  font-size: 12px;
  line-height: 1.4;
  min-height: 1em;
}

.burnout-btn {
  margin-top: 6px;
  padding: 11px 32px;
  border-radius: 12px;
  border: 1px solid #6B4010;
  background: linear-gradient(135deg, rgba(180, 90, 10, 0.35) 0%, rgba(140, 60, 5, 0.28) 100%);
  color: #FFD08A;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.burnout-btn:hover {
  background: linear-gradient(135deg, rgba(210, 110, 20, 0.45) 0%, rgba(170, 80, 10, 0.38) 100%);
  border-color: #8A5515;
}

/* ── First-run onboarding (get to know you) ───────────────────────── */
.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 18px;
}

.onboarding-modal[hidden] {
  display: none !important;
}

.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 14, 0.82);
  backdrop-filter: blur(6px);
}

.onboarding-card {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 18px;
  border-radius: 18px;
  border: 1px solid #4f2a2a;
  background: linear-gradient(180deg, rgba(14, 21, 30, 0.99) 0%, rgba(10, 14, 22, 0.97) 100%);
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(226, 173, 173, 0.06);
  animation: onboarding-pop 0.24s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes onboarding-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.onboarding-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #5a2a2a;
  background: rgba(209, 75, 75, 0.12);
  color: #f4caca;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.onboarding-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid #4d2a2a;
  background: #271212;
  color: #e6c4c4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.onboarding-close:hover {
  background: #351717;
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.onboarding-dot.is-active {
  background: rgba(209, 75, 75, 0.65);
  border-color: rgba(255, 200, 200, 0.25);
}

.onboarding-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.onboarding-slide[hidden] {
  display: none !important;
}

.onboarding-slide {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-step-kicker {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(209, 75, 75, 0.22);
  background: rgba(209, 75, 75, 0.08);
  color: #f1bdbd;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onboarding-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f7d9d9;
  line-height: 1.25;
}

.onboarding-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #c9a8a8;
  max-width: 48ch;
}

.onboarding-text strong {
  color: #e8d4d4;
  font-weight: 600;
}

.onboarding-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(86, 44, 44, 0.8);
  background:
    linear-gradient(180deg, rgba(24, 12, 12, 0.96) 0%, rgba(12, 17, 25, 0.96) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.onboarding-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 66, 66, 0.75);
  background: rgba(209, 75, 75, 0.08);
  color: #f4d6d6;
  font-size: 12px;
  font-weight: 600;
}

.onboarding-bubble-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
}

.onboarding-bubble-user {
  align-self: flex-end;
  background: rgba(73, 34, 34, 0.9);
  color: #f3dbdb;
  border: 1px solid rgba(118, 65, 65, 0.65);
}

.onboarding-bubble-rok {
  align-self: flex-start;
  background: rgba(16, 24, 35, 0.92);
  color: #d9c6c6;
  border: 1px solid rgba(75, 86, 111, 0.35);
}

.onboarding-feature-grid,
.onboarding-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-feature-card,
.onboarding-mode-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(88, 48, 48, 0.72);
  background: rgba(13, 18, 27, 0.8);
}

.onboarding-feature-card strong,
.onboarding-mode-card strong {
  color: #f5dede;
  font-size: 13px;
  font-weight: 700;
}

.onboarding-feature-card span,
.onboarding-mode-card span {
  color: #bfa3a3;
  font-size: 12px;
  line-height: 1.45;
}

.onboarding-mini-shell {
  display: grid;
  grid-template-columns: 24px 1fr;
  min-height: 152px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(82, 44, 44, 0.78);
  background: rgba(9, 12, 18, 0.92);
}

.onboarding-mini-sidebar {
  background: linear-gradient(180deg, #160909 0%, #0d0606 100%);
  border-right: 1px solid rgba(90, 40, 40, 0.35);
}

.onboarding-mini-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(77, 42, 42, 0.45);
  background: rgba(15, 17, 23, 0.92);
}

.onboarding-mini-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(99, 52, 52, 0.74);
  background: #1b1010;
  color: #e8c9c9;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(209, 75, 75, 0.06);
}

.onboarding-mini-logo {
  color: #dc4b4b;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.onboarding-mini-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: 18px;
}

.onboarding-mini-callout {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(97, 55, 55, 0.72);
  background: rgba(209, 75, 75, 0.08);
  color: #efcbcb;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.onboarding-mini-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-mini-list-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(82, 46, 46, 0.72);
  background: rgba(13, 18, 27, 0.8);
  color: #cfb2b2;
  font-size: 12px;
  text-align: center;
}

.onboarding-composer-preview {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(80, 45, 45, 0.72);
  background: rgba(8, 10, 16, 0.92);
}

.onboarding-composer-attach,
.onboarding-composer-model,
.onboarding-composer-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(82, 46, 46, 0.72);
  background: rgba(31, 16, 16, 0.92);
  color: #efcece;
  font-size: 12px;
  font-weight: 700;
}

.onboarding-composer-attach {
  width: 34px;
  padding: 0;
  font-size: 17px;
}

.onboarding-composer-input {
  min-width: 0;
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 34, 34, 0.68);
  background: rgba(18, 11, 11, 0.9);
  color: #9f8888;
  font-size: 12px;
}

.onboarding-composer-send {
  background: linear-gradient(135deg, #c43838 0%, #8a1e1e 100%);
  border-color: #8a3030;
  color: #1b0606;
}

.onboarding-visual-name {
  align-items: flex-start;
}

.onboarding-name-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-name-chip {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(104, 59, 59, 0.72);
  background: rgba(12, 18, 26, 0.92);
  color: #f1d8d8;
  font-size: 12px;
  font-weight: 700;
}

.onboarding-name-note {
  margin: 0;
  color: #bea4a4;
  font-size: 12px;
  line-height: 1.5;
}

.onboarding-name-label {
  display: block;
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #b88f8f;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.onboarding-name-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #4a2828;
  background: rgba(8, 10, 16, 0.85);
  color: #f5e8e8;
  font-size: 16px;
  outline: none;
}

.onboarding-name-input:focus {
  border-color: rgba(209, 75, 75, 0.55);
  box-shadow: 0 0 0 2px rgba(209, 75, 75, 0.15);
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(80, 40, 40, 0.35);
}

.onboarding-actions-spacer {
  flex: 1;
  min-width: 8px;
}

.onboarding-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #4d2a2a;
  background: #2a1515;
  color: #e8d0d0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.onboarding-btn.ghost {
  background: transparent;
  color: #b89090;
  border-color: rgba(120, 70, 70, 0.45);
}

.onboarding-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e0c8c8;
}

.onboarding-btn.primary {
  border-color: #8a3030;
  background: linear-gradient(135deg, #c43838 0%, #8a1e1e 100%);
  color: #1a0505;
}

.onboarding-btn.primary:hover {
  filter: brightness(1.06);
}

@media (max-width: 480px) {
  .onboarding-card {
    width: 100%;
    max-height: min(92vh, 760px);
  }

  .onboarding-feature-grid,
  .onboarding-mode-grid,
  .onboarding-mini-list {
    grid-template-columns: 1fr;
  }

  .onboarding-composer-preview {
    grid-template-columns: auto 1fr;
  }

  .onboarding-composer-model,
  .onboarding-composer-send {
    justify-content: center;
  }

  .onboarding-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .onboarding-actions-spacer {
    display: none;
  }

  .onboarding-btn {
    width: 100%;
    text-align: center;
  }
}

/* Guided onboarding tour overrides */
.onboarding-modal {
  padding: 0;
  place-items: stretch;
}

.onboarding-backdrop {
  background: rgba(5, 9, 14, 0.38);
  backdrop-filter: blur(4px);
}

.onboarding-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  border-radius: 20px;
  border: 1px solid rgba(234, 118, 118, 0.48);
  box-shadow:
    0 0 0 9999px rgba(5, 9, 14, 0.44),
    0 0 0 1px rgba(255, 219, 219, 0.08) inset,
    0 18px 40px rgba(0, 0, 0, 0.32);
  transition:
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 180ms ease;
  pointer-events: none;
}

.onboarding-guide {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(448px, calc(100vw - 32px));
  pointer-events: none;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.onboarding-guide.is-centered {
  align-items: center;
}

.onboarding-guide-orb-shell {
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  border: 1px solid rgba(208, 82, 82, 0.28);
  background:
    radial-gradient(circle at 35% 30%, rgba(214, 86, 86, 0.28) 0%, rgba(214, 86, 86, 0.08) 40%, rgba(8, 12, 19, 0.9) 100%);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 223, 223, 0.08);
}

.onboarding-guide-orb {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(209, 75, 75, 0.24));
}

.onboarding-card {
  width: min(360px, 100%);
  max-height: none;
  gap: 14px;
  padding: 18px 18px 16px;
  pointer-events: auto;
}

.onboarding-head {
  align-items: flex-start;
}

.onboarding-head-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.onboarding-step-inline {
  color: #cba7a7;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onboarding-progress {
  justify-content: flex-start;
}

.onboarding-body.onboarding-guide-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.onboarding-modal .onboarding-slide {
  display: none !important;
}

.onboarding-message-shell {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(93, 49, 49, 0.72);
  background:
    linear-gradient(180deg, rgba(18, 11, 11, 0.96) 0%, rgba(12, 16, 24, 0.96) 100%);
}

.onboarding-guide-text {
  max-width: none;
  min-height: 4.8em;
}

.onboarding-guide-caret {
  display: inline-block;
  width: 0.62ch;
  height: 1.05em;
  margin-left: 2px;
  border-radius: 999px;
  background: rgba(246, 214, 214, 0.92);
  vertical-align: text-bottom;
  animation: onboarding-caret-blink 0.92s steps(1) infinite;
}

@keyframes onboarding-caret-blink {
  0%, 48% {
    opacity: 1;
  }
  49%, 100% {
    opacity: 0.14;
  }
}

.onboarding-name-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onboarding-name-field[hidden] {
  display: none !important;
}

.onboarding-name-label {
  margin: 0;
}

.onboarding-name-note {
  margin: 0;
}

.onboarding-actions {
  padding-top: 6px;
}

@media (max-width: 720px) {
  .onboarding-guide {
    gap: 10px;
    width: min(100vw - 24px, 360px);
  }

  .onboarding-guide,
  .onboarding-guide.is-centered {
    flex-direction: column;
    align-items: flex-start;
  }

  .onboarding-guide-orb-shell {
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }

  .onboarding-guide-orb {
    width: 44px;
    height: 44px;
  }

  .onboarding-card {
    width: 100%;
  }

  .onboarding-guide-text {
    min-height: 5.4em;
  }
}

/* ROK Pictionary — home entry (homescreen button only) */
#homeScreen .hs-pictionary-cta {
  align-self: center;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(200, 140, 140, 0.45);
  background: rgba(40, 18, 18, 0.55);
  color: #f0d4d4;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

#homeScreen .hs-pictionary-cta:hover {
  background: rgba(70, 28, 28, 0.65);
  border-color: rgba(230, 170, 170, 0.55);
  transform: translateY(-1px);
}

/* ROK Pixel Painter - Image Generation */
.pixel-painting-container {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0;
}

.pixel-painting-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pixel-painting-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(209, 75, 75, 0.25);
  background: rgba(209, 75, 75, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.pixel-painting-title {
  font-weight: 600;
  color: var(--text);
}

.pixel-painting-progress {
  margin-bottom: 12px;
}

.pixel-painting-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.pixel-painting-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.pixel-painting-status {
  font-size: 13px;
  color: var(--text-2);
}

.pixel-painting-reference-note {
  margin: -4px 0 10px;
  font-size: 11px;
  color: var(--text-2);
}

.pixel-painting-preview {
  margin: 16px 0;
  text-align: center;
}

.pixel-painting-img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  image-rendering: pixelated;
}

.pixel-painting-controls {
  margin-top: 12px;
}

.pixel-painting-stop {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.pixel-painting-stop:hover {
  background: var(--accent);
  color: var(--bg);
}

.pixel-painting-stop:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pixel-painting-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pixel-painting-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.pixel-painting-save {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.pixel-painting-save:hover {
  opacity: 0.9;
}

.pixel-painting-save:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Final homescreen override: hide legacy layers and keep only the current shell. */
#homeScreen {
  justify-content: flex-start;
  gap: 0;
}

#homeScreen .home-bg-demo,
#homeScreen .hs-nav,
#homeScreen .hs-hero,
#homeScreen .hs-footer,
#homeScreen #homeWorkspacePreview {
  display: none !important;
}

#homeScreen .rok-home-shell {
  display: grid !important;
  width: min(1180px, 100%);
  min-height: auto;
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 28px) clamp(12px, 2.2vw, 24px);
  box-sizing: border-box;
}

#homeScreen .rok-home-top,
#homeScreen .rok-home-main,
#homeScreen .rok-home-footer {
  position: relative;
  z-index: 2;
}

/* Current home screen layout: centered generator hero plus scroll sections. */
#homeScreen {
  overflow-y: auto;
  scroll-behavior: smooth;
}

#homeScreen.home-screen {
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100%;
  height: auto;
  padding: 0;
  overflow: visible !important;
}

#homeScreen .rok-home-shell {
  display: block !important;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 30px) clamp(12px, 2.6vw, 28px) clamp(34px, 6vw, 64px);
  box-sizing: border-box;
}

#homeScreen .rok-home-main {
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 8vw, 108px);
  align-items: stretch;
}

#homeScreen .rok-home-hero {
  min-height: calc(100dvh - 132px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 5vw, 56px) 0 clamp(8px, 2vw, 18px);
}

#homeScreen .rok-home-hero-stack {
  width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3.2vw, 28px);
  text-align: center;
}

#homeScreen .rok-home-kicker {
  align-self: center;
}

#homeScreen .rok-home-generator {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  justify-content: center;
}

#homeScreen .rok-home-generator-gif {
  width: clamp(82px, 11vw, 132px);
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.34));
}

#homeScreen .rok-home-generator-copy {
  min-width: 0;
  text-align: left;
}

#homeScreen .rok-home-title {
  max-width: none;
  min-height: 2.25em;
  margin: 0;
  font-size: clamp(42px, 7.6vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

#homeScreen .rok-home-slogan-caret {
  display: inline-block;
  width: 0.13em;
  height: 0.9em;
  margin-left: 0.08em;
  transform: translateY(0.08em);
  border-radius: 999px;
  background: #f4cccc;
  animation: rok-home-caret-blink 850ms step-end infinite;
}

#homeScreen .rok-home-subtitle {
  max-width: 64ch;
  margin: 0;
  text-align: center;
}

#homeScreen .rok-home-actions {
  justify-content: center;
}

#homeScreen .rok-home-scroll-cue {
  color: #f1c6c6;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
  transition: opacity 120ms ease, transform 120ms ease;
}

#homeScreen .rok-home-scroll-cue:hover {
  opacity: 1;
  transform: translateY(1px);
}

#homeScreen .rok-home-section {
  scroll-margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: clamp(12px, 2vw, 20px);
}

#homeScreen .rok-home-section-muted {
  padding: clamp(24px, 4vw, 34px);
  border-radius: 28px;
  border: 1px solid rgba(143, 71, 71, 0.24);
  background: linear-gradient(180deg, rgba(24, 13, 16, 0.82) 0%, rgba(13, 17, 24, 0.74) 100%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

#homeScreen .rok-home-section-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(150, 72, 72, 0.3);
  background: rgba(17, 10, 12, 0.66);
  color: #efbcbc;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#homeScreen .rok-home-section-title {
  margin: 0;
  color: #fff4f2;
  font-size: clamp(26px, 4.6vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

#homeScreen .rok-home-card-grid,
#homeScreen .rok-home-runtime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#homeScreen .rok-home-runtime-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#homeScreen .rok-home-card,
#homeScreen .rok-home-runtime-card,
#homeScreen .rok-home-list-item {
  padding: 18px 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(132, 63, 63, 0.28);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#homeScreen .rok-home-card-title,
#homeScreen .rok-home-runtime-card h3 {
  display: block;
  margin: 0 0 8px;
  color: #fff0f0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#homeScreen .rok-home-card p,
#homeScreen .rok-home-runtime-card p {
  margin: 0;
  color: #d6b8b8;
  font-size: 14px;
  line-height: 1.72;
}

#homeScreen .rok-home-runtime-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(150, 72, 72, 0.28);
  background: rgba(17, 10, 12, 0.6);
  color: #efbcbc;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#homeScreen .rok-home-runtime-card h3 {
  margin-top: 0;
}

#homeScreen .rok-home-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#homeScreen .rok-home-list-item {
  color: #eed3d3;
  font-size: 15px;
  line-height: 1.68;
}

#homeScreen .rok-home-footer {
  margin-top: clamp(30px, 6vw, 54px);
}

@keyframes rok-home-caret-blink {
  0%, 46% {
    opacity: 1;
  }

  47%, 100% {
    opacity: 0;
  }
}

@media (max-width: 980px) {
  #homeScreen .rok-home-generator {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #homeScreen .rok-home-generator-copy {
    text-align: center;
  }

  #homeScreen .rok-home-card-grid,
  #homeScreen .rok-home-runtime-grid,
  #homeScreen .rok-home-list-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #homeScreen .rok-home-hero {
    min-height: calc(100dvh - 112px);
  }

  #homeScreen .rok-home-title {
    min-height: 2.8em;
    font-size: clamp(34px, 12vw, 58px);
  }

  #homeScreen .rok-home-subtitle {
    font-size: 15px;
  }

  #homeScreen .rok-home-section-title {
    font-size: clamp(24px, 9vw, 38px);
  }
}
