  :root {
    --bg-deep: #0f1115;
    --bg-mid: #171a1f;
    --surface: rgba(33, 37, 45, 0.76);
    --surface-solid: #20242c;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: #3a404b;
    --text: #eceff4;
    --muted: #a4adb9;
    --accent-start: #b6beca;
    --accent-end: #8f97a3;
    --accent: linear-gradient(135deg, #c9d0db 0%, #a8b0bc 45%, #8f98a5 100%);
    --accent-dim: rgba(168, 176, 188, 0.18);
    --success: #9bc5a1;
    --success-dim: rgba(155, 197, 161, 0.14);
    --danger: #d08f95;
    --danger-dim: rgba(208, 143, 149, 0.14);
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.42);
    --font: "Inter", "Satoshi", "SF Pro Display", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }

  :where(a, button, input, textarea, select, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid rgba(188, 197, 210, 0.85);
    outline-offset: 2px;
  }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 10000;
    padding: 10px 16px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
  }
  .skip-link:focus {
    left: 12px;
    outline: none;
    box-shadow: 0 0 0 3px rgba(176, 184, 198, 0.28);
  }

  * { box-sizing: border-box; }

  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-deep);
    -webkit-tap-highlight-color: rgba(56, 189, 248, 0.12);
  }

  .app-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(ellipse 100% 80% at 50% -30%, rgba(169, 177, 190, 0.16), transparent 55%),
      radial-gradient(ellipse 70% 50% at 100% 50%, rgba(125, 133, 145, 0.09), transparent 50%),
      radial-gradient(ellipse 60% 40% at 0% 80%, rgba(104, 112, 125, 0.08), transparent 45%),
      linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
  }

  .wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 20px 48px;
  }

  .header {
    margin-bottom: 28px;
    text-align: center;
  }

  .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--accent-dim), transparent);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    color: var(--accent);
  }

  h1 {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 4vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  .sub {
    margin: 0 auto;
    max-width: 34em;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .sub code {
    font-size: 0.84em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
  }

  .panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 22px 20px;
    margin-bottom: 28px;
  }

  .composer .block:last-of-type { margin-bottom: 0; }

  label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 8px;
  }

  input[type="password"], input[type="text"], textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface-solid);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.45;
  }

  input::placeholder, textarea::placeholder { color: rgba(139, 147, 158, 0.75); }

  input:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.16); }

  input:focus, textarea:focus {
    outline: none;
    border-color: rgba(94, 184, 255, 0.55);
    box-shadow: 0 0 0 3px var(--accent-dim);
  }

  .block { margin-bottom: 18px; }

  .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

  #send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #5eb8ff 0%, #3d9aed 100%);
    color: #0a0e14;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(61, 154, 237, 0.35);
    transition: transform 0.12s, filter 0.12s, box-shadow 0.12s;
  }

  #send-btn:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(61, 154, 237, 0.45);
  }

  #send-btn:active:not(:disabled) { transform: translateY(0); }

  #send-btn:disabled, .reply-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .sep {
    height: 1px;
    margin: 0 0 22px;
    border: none;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  }

  .history-section { margin-top: 8px; text-align: left; margin-left: 0; }

  .history-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  h2::before {
    content: "";
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--success));
  }

  #clear-all-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius-sm);
    background: var(--danger-dim);
    color: #fecaca;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }

  #clear-all-btn:hover {
    background: rgba(248, 113, 113, 0.22);
    border-color: rgba(248, 113, 113, 0.55);
  }

  /* Chat history - минималистичный черный стиль */
  .chat-history-container {
    display: flex;
    height: 100vh;
    background: var(--bg-deep);
  }

  .history-sidebar {
    width: 320px;
    background: var(--bg-mid);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px;
  }

  .history-sidebar h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
    font-family: var(--font);
  }

  /* Поиск */
  .history-search {
    margin-bottom: 12px;
  }

  .history-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
  }

  .history-search input::placeholder {
    color: var(--muted);
  }

  .history-search input:focus {
    border-color: var(--accent);
  }

  /* Кнопки управления */
  .history-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }

  .history-controls button {
    flex: 1;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
  }

  .history-controls button:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
  }

  .history-messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
  }

  .history-messages::-webkit-scrollbar {
    width: 4px;
  }

  .history-messages::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 2px;
  }

  /* Сообщение в истории с кнопками действий */
  .history-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.15s;
  }

  .history-item:hover {
    border-color: var(--accent);
  }

  .history-item-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    gap: 8px;
  }

  .history-item-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
  }

  .history-item-icon.ai {
    background: var(--success);
  }

  .history-item-text {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .history-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
  }

  .history-item:hover .history-item-actions {
    opacity: 1;
  }

  .history-item-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .history-item-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
  }

  .history-item-btn.delete:hover {
    background: var(--danger-dim);
    color: var(--danger);
  }

  /* Папки */
  .folder-section {
    margin-bottom: 12px;
  }

  .folder-header {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
  }

  .folder-header:hover {
    background: var(--surface);
  }

  .folder-icon {
    margin-right: 8px;
    font-size: 0.9rem;
    color: var(--accent);
  }

  .folder-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
  }

  .folder-content {
    margin-left: 16px;
    border-left: 2px solid var(--border);
    padding-left: 8px;
  }

  /* Текущий чат */
  .current-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
  }

  .current-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
  }

  .current-chat-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
  }

  .current-chat-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
  }

  /* Сообщения в чате */
  .chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .chat-message.user {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    margin-left: auto;
  }

  .chat-message.ai {
    background: var(--accent-dim);
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    margin-right: auto;
  }

  /* Строка ввода */
  .chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-mid);
  }

  .chat-input-area textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
  }

  .chat-input-area textarea:focus {
    border-color: var(--accent);
  }

  .chat-input-area textarea::placeholder {
    color: var(--muted);
  }

  .chat-input-area button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: var(--bg-deep);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
  }

  .chat-input-area button:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
  }

  .chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .conversation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s;
    border: 1px solid transparent;
    position: relative;
  }

  .conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .conversation-item.active {
    background: var(--accent-dim);
    border-color: rgba(94, 184, 255, 0.3);
  }

  .conversation-item-title {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
  }

  .conversation-item-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
  }

  .conversation-item-delete {
    opacity: 0;
    flex-shrink: 0;
    margin-left: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.15s;
    font-size: 0.8rem;
  }

  .conversation-item:hover .conversation-item-delete {
    opacity: 1;
  }

  .conversation-item-delete:hover {
    background: rgba(248, 113, 113, 0.2);
  }

  .conversation-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    border: 1px solid transparent;
    position: relative;
    min-height: 40px;
  }

  .conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .conversation-item.active {
    background: var(--accent-dim);
    border-color: rgba(94, 184, 255, 0.3);
  }

  .conversation-item-content {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
  }

  .conversation-item-title {
    font-size: 0.8rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    line-height: 1.2;
  }

  .conversation-item-title.editing {
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
  }

  .conversation-item-meta {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .conversation-item-actions {
    opacity: 0;
    flex-shrink: 0;
    display: flex;
    gap: 4px;
    transition: opacity 0.15s;
    min-width: 80px;
    justify-content: flex-end;
  }

  .conversation-item:hover .conversation-item-actions {
    opacity: 1;
  }

  .conversation-item-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .conversation-item-edit {
    background: rgba(94, 184, 255, 0.1);
    color: var(--accent);
  }

  .conversation-item-edit:hover {
    background: rgba(94, 184, 255, 0.2);
  }

  .conversation-item-folder {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
  }

  .conversation-item-folder:hover {
    background: rgba(139, 92, 246, 0.2);
  }

  .conversation-item-delete {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
  }

  .conversation-item-delete:hover {
    background: rgba(248, 113, 113, 0.2);
  }

  /* Folder styles */
  .folder-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
    border: 1px solid transparent;
    position: relative;
  }

  .folder-item:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .folder-item.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
  }

  .folder-item.drag-over {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    transform: scale(1.02);
  }

  .folder-icon {
    margin-right: 8px;
    font-size: 0.9rem;
    transition: transform 0.15s;
    color: #8b5cf6;
  }

  .folder-item.expanded .folder-icon {
    transform: rotate(90deg);
  }

  .folder-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .folder-name.editing {
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
  }

  .folder-actions {
    opacity: 0;
    display: flex;
    gap: 4px;
    transition: opacity 0.15s;
    flex-shrink: 0;
  }

  .folder-item:hover .folder-actions {
    opacity: 1;
  }

  .folder-action-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: background 0.15s;
    flex-shrink: 0;
  }

  .folder-edit {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
  }

  .folder-edit:hover {
    background: rgba(139, 92, 246, 0.2);
  }

  .folder-delete {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
  }

  .folder-delete:hover {
    background: rgba(248, 113, 113, 0.2);
  }

  .folder-content {
    margin-left: 16px;
    display: none;
    border-left: 2px solid rgba(139, 92, 246, 0.2);
    padding-left: 8px;
  }

  .folder-content.expanded {
    display: block;
  }

  .folder-drop-zone {
    min-height: 30px;
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(139, 92, 246, 0.6);
    font-size: 0.75rem;
    margin: 4px 0;
    transition: all 0.15s;
  }

  .folder-drop-zone.drag-over {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.5);
    color: #8b5cf6;
  }

  .new-folder-btn {
    width: 100%;
    padding: 6px 10px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .new-folder-btn:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
  }

  .new-folder-btn::before {
    content: "+";
    font-size: 0.9rem;
  }

  .chat-history-container {
    position: relative;
  }

  .chat-view {
    display: none;
  }

  .chat-view.active {
    display: block;
  }

  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
  }

  .empty-state h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
  }

  .empty-state p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .card {
    position: relative;
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    background: var(--surface);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .card:hover { border-color: rgba(255, 255, 255, 0.1); }

  .card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), rgba(110, 231, 168, 0.6));
    opacity: 0.85;
  }

  .card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-left: 6px;
  }

  .card .meta {
    font-size: 0.72rem;
    color: var(--muted);
    flex: 1;
    min-width: 0;
    line-height: 1.4;
  }

  .card .idea {
    position: relative;
    margin-bottom: 14px;
    padding: 12px 14px;
    padding-left: 14px;
    border-radius: var(--radius-sm);
    background: var(--success-dim);
    border: 1px solid rgba(110, 231, 168, 0.18);
    color: #c8f5dc;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .card .idea::before {
    content: "Idea";
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(110, 231, 168, 0.75);
    margin-bottom: 8px;
  }

  .card .questions {
    position: relative;
    margin-bottom: 4px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
    border: 1px solid rgba(94, 184, 255, 0.2);
    color: #c8e7ff;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    font-size: 0.92rem;
    min-height: 1em;
  }

  .card .questions:not(.loading-hint)::before {
    content: "AI plan";
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(94, 184, 255, 0.75);
    margin-bottom: 8px;
  }

  .card .questions.loading-hint::before {
    content: "Waiting";
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .card .questions:empty:not(.loading-hint) { display: none; }

  .card .err {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--danger-dim);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fecaca;
    font-size: 0.88rem;
  }

  .thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-left: 6px;
  }

  .turn {
    max-width: 95%;
    border-radius: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
  }

  .turn.user-turn {
    margin-left: auto;
    background: rgba(110, 231, 168, 0.08);
    border-color: rgba(110, 231, 168, 0.2);
  }

  .turn.ai-turn {
    margin-right: auto;
    background: rgba(94, 184, 255, 0.08);
    border-color: rgba(94, 184, 255, 0.18);
  }

  .turn-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .turn.user-turn .turn-label { color: rgba(110, 231, 168, 0.85); }
  .turn.ai-turn .turn-label { color: rgba(94, 184, 255, 0.85); }

  .turn-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-size: 0.9rem;
  }

  .reply-area {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    padding-left: 6px;
  }

  .reply-area[hidden] { display: none !important; }

  .reply-area label {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
  }

  .reply-send {
    margin-top: 12px;
    min-height: 42px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #6ee7a8 0%, #34d399 100%);
    color: #052e1f;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(52, 211, 153, 0.25);
    transition: filter 0.12s, transform 0.12s;
  }

  .reply-send:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
  }

  .loading-hint { color: var(--muted); font-style: italic; }

  .reply-inline-err {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--danger-dim);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fecaca;
    font-size: 0.82rem;
  }

  .reply-inline-err[hidden] { display: none !important; }

  .hint-bar {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
  }

  .hint-bar kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.76rem;
  }
  #landing[hidden], .workspace[hidden] { display: none !important; }

  .landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 80px;
  }

  .landing-inner {
    text-align: center;
    flex: 0 0 auto;
  }

  .landing-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--accent-dim), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--border);
    font-size: 1.35rem;
    color: var(--accent);
  }

  .landing-title {
    margin: 0 0 14px;
    font-size: clamp(1.65rem, 5vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: linear-gradient(135deg, var(--text) 0%, #a8d4ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }

  @supports not (background-clip: text) {
    .landing-title {
      -webkit-text-fill-color: unset;
      color: var(--text);
      background: none;
    }
  }

  .landing-lead {
    margin: 0 auto 28px;
    max-width: 38em;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.65;
  }

  .benefits {
    list-style: none;
    margin: 0 auto 8px;
    padding: 0;
    max-width: 440px;
    text-align: left;
  }

  .benefits li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
  }

  .b-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--success-dim);
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .benefits li strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.92rem;
  }

  .benefits li span:last-child {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.45;
  }

  .landing-cta {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0 16px;
    min-height: min(42vh, 360px);
  }

  #cta-enter-app {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 36px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #8b5cf6 100%);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  }

  #cta-enter-app:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.5);
  }

  #cta-enter-app:active {
    transform: translateY(0);
  }

  .landing-cta-hint {
    margin: 18px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    max-width: 280px;
    line-height: 1.4;
  }

  .workspace-top {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
  }

  #to-landing-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 999px;
    transition: color 0.15s, background 0.15s;
  }

  #to-landing-btn:hover {
    color: var(--accent);
    background: var(--accent-dim);
  }

  /* ChatGPT-like workspace layout: sidebar (left) + content (right) */
  #workspace .wrap { max-width: 1120px; }
  .workspace-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
    height: calc(100vh - 32px);
  }
  .workspace-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding-right: 4px;
    text-align: left; /* Ensure content is aligned to the left */
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    background: var(--surface);
  }
  .workspace-content { 
    flex: 1; 
    min-width: 0; 
    padding: 16px 20px;
    overflow-y: auto;
    max-height: calc(100vh - 32px);
  }
  #workspace .history-section { 
    margin-top: 0; 
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }
  .workspace-sidebar .history-header {
    margin-bottom: 12px;
  }
  .workspace-sidebar h2 {
    font-size: 0.85rem;
    margin: 0;
  }
  .clear-all-btn {
    font-size: 0.75rem;
    padding: 6px 10px;
    min-height: 32px;
  }

  @media (max-width: 980px) {
    #workspace .wrap { max-width: 680px; }
    .workspace-layout { flex-direction: column; }
    .workspace-sidebar {
      width: 100%;
      position: static;
      max-height: none;
      overflow: visible;
      padding-right: 0;
    }
    .workspace-sidebar {
      order: 2;
      margin-top: 20px;
    }
    .workspace-content {
      order: 1;
    }
  }

  @media (max-width: 640px) {
    .workspace-sidebar {
      margin-top: 16px;
    }
    .conversation-item {
      padding: 10px 12px;
    }
    .conversation-item-title {
      font-size: 0.85rem;
    }
    .conversation-item-meta {
      font-size: 0.7rem;
    }
    .new-chat-btn {
      padding: 10px 12px;
      font-size: 0.85rem;
    }
    .empty-state {
      padding: 40px 16px;
    }
    .empty-state h3 {
      font-size: 1.1rem;
    }
    .empty-state p {
      font-size: 0.85rem;
    }
  }

  /* Hidden on landing: floating “Ideavory” control; header logo is the home control. */
  body:not(.app-in-workspace) #top-menu-wrap {
    display: none !important;
  }

  .top-menu-wrap {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1100;
  }

  .to-menu-mini {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--muted);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.12s;
  }

  #btn-go-home.to-menu-mini::before {
    content: none;
  }

  #btn-go-home.to-menu-mini {
    font-size: 0.78rem;
    padding: 8px 14px;
    color: var(--text);
  }

  .to-menu-mini:hover {
    color: var(--accent);
    border-color: rgba(94, 184, 255, 0.35);
    background: rgba(22, 27, 38, 0.92);
    transform: translateY(-1px);
  }

  .top-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.15s, transform 0.15s;
  }

  .top-menu-dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .top-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.87rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
  }

  .top-menu-item:hover {
    background: var(--accent-dim);
    color: var(--accent);
  }

  .top-menu-item + .top-menu-item {
    border-top: 1px solid var(--border);
  }

  .top-menu-item .mi-icon {
    font-size: 1em;
    opacity: 0.75;
    flex-shrink: 0;
  }

  /* ── About modal ── */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  .modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-box {
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 16px 64px rgba(0,0,0,0.6);
    padding: 28px 28px 24px;
    max-width: 420px;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    width: 100%;
    transform: translateY(10px);
    transition: transform 0.2s;
  }

  .modal-backdrop.open .modal-box {
    transform: translateY(0);
  }

  .modal-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
  }

  .modal-body {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .modal-body strong { color: var(--text); }

  .modal-box--feedback {
    max-width: 460px;
    text-align: left;
  }

  .feedback-modal-lead {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .feedback-category-select {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.85);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
  }

  .feedback-textarea {
    width: 100%;
    min-height: 120px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
  }

  .feedback-textarea:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.55);
    outline-offset: 2px;
  }

  .feedback-error {
    color: #f87171;
    font-size: 0.82rem;
    margin: 0 0 10px;
    min-height: 1.2em;
  }

  .feedback-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .feedback-submit-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9) !important;
    color: #0f172a !important;
    border: none !important;
    font-weight: 600 !important;
  }

  .modal-close {
    appearance: none;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.87rem;
    padding: 8px 18px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
  }

  .modal-close:hover {
    background: var(--accent-dim);
    border-color: rgba(94, 184, 255, 0.4);
    color: var(--accent);
  }

  /* ── Request limit paywall ── */
  .paywall-backdrop {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  .paywall-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .auth-screen-backdrop {
    z-index: 950;
    background: radial-gradient(1200px 700px at 20% -10%, rgba(56, 189, 248, 0.12), transparent 60%),
      rgba(0, 0, 0, 0.82);
  }

  .paywall-box {
    position: relative;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 16px 64px rgba(0,0,0,0.7);
    padding: 32px 28px 26px;
    max-width: 400px;
    max-height: min(90vh, 640px);
    overflow-y: auto;
    width: 100%;
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.2s;
  }

  .paywall-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .paywall-close:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
  }

  .paywall-backdrop.open .paywall-box {
    transform: translateY(0);
  }

  .auth-screen-box {
    max-width: 520px;
    text-align: left;
  }

  .paywall-icon {
    font-size: 2rem;
    margin-bottom: 14px;
  }

  .paywall-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
  }

  .paywall-body {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .paywall-pro-link-wrap {
    margin: 14px 0 0;
  }

  .paywall-pro-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.82rem;
    color: #38bdf8;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .paywall-pro-link:hover {
    color: #7dd3fc;
  }

  .paywall-key-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }

  .paywall-key-row input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font: inherit;
    font-size: 0.87rem;
    outline: none;
  }

  .paywall-key-row input:focus {
    border-color: rgba(94, 184, 255, 0.5);
    box-shadow: 0 0 0 3px var(--accent-dim);
  }

  .paywall-key-row button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #5eb8ff 0%, #3d9aed 100%);
    color: #0a0e14;
    font: inherit;
    font-size: 0.87rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.12s;
  }

  .paywall-key-row button:hover { filter: brightness(1.08); }

  .paywall-link {
    font-size: 0.78rem;
    color: var(--muted);
  }

  .paywall-link a { color: var(--accent); }

  .paywall-auth-field {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-size: 0.87rem;
    outline: none;
    box-sizing: border-box;
  }

  .paywall-auth-field:focus {
    border-color: rgba(94, 184, 255, 0.5);
    box-shadow: 0 0 0 3px var(--accent-dim);
  }

  .paywall-submit-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #5eb8ff 0%, #3d9aed 100%);
    color: #0a0e14;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.12s;
  }

  .paywall-submit-btn:hover { filter: brightness(1.06); }

  .auth-oauth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .auth-oauth-btn {
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 8px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
  }

  .auth-oauth-btn:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.08);
  }

  .auth-divider {
    margin: 10px 0 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
    text-align: center;
  }

  .auth-divider span {
    position: relative;
    top: -10px;
    background: var(--surface-solid);
    color: var(--muted);
    font-size: 0.74rem;
    padding: 0 8px;
  }

  .auth-plan-highlight {
    margin: -6px 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.08);
    color: #cfeafe;
    font-size: 0.79rem;
    line-height: 1.45;
  }

  .auth-plan-highlight p {
    margin: 0;
  }

  .auth-start-new-idea-btn {
    width: 100%;
    min-height: 40px;
    margin-top: 8px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
  }

  .auth-code-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: stretch;
  }

  .auth-step-hint {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.79rem;
  }

  .auth-step-hint--compact {
    margin: 0 0 10px;
  }

  .auth-code-sent-to {
    margin: -2px 0 8px;
    color: #bae6fd;
    font-size: 0.75rem;
    min-height: 1.1em;
  }

  .auth-code-field {
    margin-bottom: 0;
    text-align: center;
    letter-spacing: 0.12em;
    font-weight: 700;
  }

  .auth-send-code-btn {
    border: none;
    border-radius: 10px;
    padding: 0 12px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
  }

  .auth-send-code-btn--full {
    width: 100%;
    min-height: 42px;
    margin-top: 2px;
  }

  .auth-send-code-btn:disabled,
  .paywall-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.66;
    filter: grayscale(0.05);
  }

  .auth-step-back-btn {
    margin-top: 8px;
    border: none;
    background: transparent;
    color: #b9c3d2;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .auth-remember-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 8px;
    color: var(--muted);
    font-size: 0.8rem;
  }

  .auth-legacy-details {
    margin: 8px 0 6px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 10px;
  }

  .auth-legacy-details > summary {
    cursor: pointer;
    color: #93c5fd;
    font-size: 0.78rem;
  }

  .auth-password-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
  }

  .auth-login-password-wrap {
    margin-top: 0;
    margin-bottom: 10px;
  }

  .auth-password-field {
    margin-bottom: 0;
  }

  .auth-password-eye {
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
  }

  .auth-error-line {
    color: #f87171;
    font-size: 0.82rem;
    min-height: 1.2em;
    margin: 8px 0 10px;
  }

  .auth-dev-code-line {
    color: #fbbf24;
    font-size: 0.76rem;
    margin: -2px 0 8px;
  }

  @media (max-width: 480px) {
    .top-menu-wrap { top: 10px; right: 10px; }
    .to-menu-mini { padding: 6px 10px; font-size: 0.74rem; }
  }

  .auth-switch-line {
    margin: 10px 0 2px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
  }

  .auth-switch-link {
    margin-left: 6px;
    border: none;
    background: transparent;
    color: #7dd3fc;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .auth-switch-link:hover {
    color: #bae6fd;
  }

  /* Header styles */
  .landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 31, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .header-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  a.logo {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
    outline-offset: 3px;
  }

  a.logo:hover .logo-text {
    color: #94a3b8;
  }

  a.logo:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.55);
  }

  .logo-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.35));
  }

  .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
  }

  .header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .nav-link {
    background: transparent;
    border: none;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: none;
  }

  a.nav-link:hover {
    color: #94a3b8;
  }

  .nav-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border: none;
    border-radius: 999px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  }

  .nav-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  }

  .nav-link-ghost {
    color: var(--muted) !important;
    font-size: 14px !important;
  }

  .nav-link-ghost:hover {
    color: #e2e8f0 !important;
  }

  /* Live stats (now above footer — less prominent on first paint) */
  .landing-stats {
    max-width: 960px;
    margin: 0 auto;
    padding: 96px 20px 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    text-align: left;
  }

  .landing-stats--footer {
    padding: 28px 20px 12px;
    margin-top: 0;
  }

  @media (max-width: 640px) {
    .landing-stats {
      grid-template-columns: 1fr;
      padding-top: 88px;
    }

    .landing-stats--footer {
      padding-top: 20px;
    }
  }

  .landing-stat-card {
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  }

  .reveal-section:not(.is-visible) .landing-stat-card {
    opacity: 0;
    transform: translateY(12px);
  }

  .reveal-section.is-visible .landing-stat-card {
    opacity: 1;
    transform: none;
  }

  .landing-stat-card:nth-child(1) { transition-delay: 0.05s; }
  .landing-stat-card:nth-child(2) { transition-delay: 0.1s; }
  .landing-stat-card:nth-child(3) { transition-delay: 0.15s; }

  .landing-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #38bdf8, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
  }

  .landing-stat-label {
    margin: 8px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .landing-stat-hint {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.85);
    line-height: 1.35;
  }

  .reveal-section {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .reveal-section.is-visible {
    opacity: 1;
    transform: none;
  }

  /* Hero section styles */
  .hero-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 96px 24px 72px;
    text-align: center;
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;
    padding: 8px 18px;
    margin-bottom: 28px;
  }

  .badge-icon {
    font-size: 15px;
  }

  .badge-text {
    font-size: 13px;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.88);
    letter-spacing: 0.01em;
  }

  .hero-title {
    font-size: clamp(2rem, 5.5vw, 3.35rem);
    font-weight: 800;
    line-height: 1.12;
    margin: 0 0 20px;
    color: var(--text);
    letter-spacing: -0.03em;
  }

  .hero-title-line {
    display: block;
    color: var(--text);
  }

  .gradient-text,
  .hero-title-gradient {
    display: block;
    margin-top: 4px;
    background: linear-gradient(90deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto 36px;
  }

  .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: center;
  }

  .btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #8b5cf6 100%);
    border: none;
    border-radius: 999px;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 28px;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.45);
  }

  .hero-trust {
    margin: 22px 0 0;
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.82);
    letter-spacing: 0.02em;
  }

  .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    border: 1px solid rgba(248, 250, 252, 0.35);
    border-radius: 999px;
    color: #f8fafc;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 26px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25) inset;
  }

  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(248, 250, 252, 0.5);
  }

  .btn-demo-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(248, 250, 252, 0.35);
    background: rgba(15, 23, 42, 0.45);
    flex-shrink: 0;
  }

  .btn-demo-play svg {
    display: block;
    margin-left: 2px;
    opacity: 0.95;
  }

  /* How it works section */
  .how-it-works-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 24px 72px;
    position: relative;
  }

  .section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.02em;
  }

  .section-subtitle {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
  }

  .cards-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    position: relative;
    flex-wrap: wrap;
  }

  @media (min-width: 900px) {
    .cards-container::before {
      content: "";
      position: absolute;
      left: 12%;
      right: 12%;
      top: 52px;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.25), transparent);
      pointer-events: none;
      z-index: 0;
    }
  }

  .step-card {
    flex: 1 1 260px;
    max-width: 340px;
    background: rgba(18, 24, 40, 0.85);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 28px 22px 26px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    z-index: 1;
  }

  .step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    border-color: rgba(148, 163, 184, 0.2);
  }

  .card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 18px;
  }

  .card-icon.yellow {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.35);
  }

  .card-icon.blue {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
  }

  .card-icon.green {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
  }

  .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text);
  }

  .card-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0;
  }

  .section-divider {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .section-divider hr {
    border: none;
    height: 1px;
    margin: 0;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.2), transparent);
  }

  /* Product visual (after 3 steps) */
  .product-showcase-section {
    max-width: 1040px;
    margin: 0 auto;
    padding: 56px 24px 48px;
    text-align: center;
  }

  .product-showcase-frame {
    margin-top: 28px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.35));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  }

  .showcase-browser-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .showcase-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .showcase-dot.r { background: #f87171; }
  .showcase-dot.y { background: #fbbf24; }
  .showcase-dot.g { background: #34d399; }

  .showcase-url {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    color: #64748b;
    font-family: ui-monospace, monospace;
  }

  .showcase-mock {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 280px;
    text-align: left;
  }

  @media (max-width: 720px) {
    .showcase-mock {
      grid-template-columns: 1fr;
    }
  }

  .showcase-mock-side {
    background: rgba(7, 11, 20, 0.65);
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .showcase-mock-main {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(56, 189, 248, 0.08), transparent 55%);
  }

  .showcase-fake-line {
    height: 10px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.12);
    max-width: 100%;
  }

  .showcase-fake-line.short { width: 55%; }
  .showcase-fake-line.mid { width: 78%; }

  .showcase-fake-msg {
    align-self: flex-start;
    max-width: 92%;
    padding: 12px 14px;
    border-radius: 14px 14px 14px 4px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.15);
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.45;
  }

  .showcase-fake-plan {
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(129, 140, 248, 0.35);
    background: rgba(99, 102, 241, 0.06);
    font-size: 0.72rem;
    color: #94a3b8;
  }

  /* Task focus analytics (personal) */
  .task-focus-section {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px 56px;
    text-align: center;
  }

  .task-focus-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
  }

  .task-focus-input {
    flex: 1 1 220px;
    max-width: 320px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
  }

  .task-focus-save {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transition: filter 0.15s, transform 0.12s;
  }

  .task-focus-save:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
  }

  .task-bars-wrap {
    margin-top: 28px;
    text-align: left;
    padding: 20px 20px 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
    min-height: 120px;
  }

  .task-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.78rem;
    color: var(--muted);
  }

  .task-bar-row:last-child {
    margin-bottom: 0;
  }

  .task-bar-date {
    width: 76px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
  }

  .task-bar-track {
    flex: 1;
    height: 22px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
    overflow: hidden;
  }

  .task-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.35), rgba(129, 140, 248, 0.75));
    transition: width 0.35s ease;
  }

  .task-bar-count {
    width: 36px;
    text-align: right;
    color: #7dd3fc;
    font-weight: 600;
  }

  /* Sidebar account footer */
  .ws-sidebar-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 4px 4px;
    margin-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
  }

  .ws-footer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.5);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
  }

  .ws-footer-btn:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
  }

  .ws-footer-btn--ghost {
    border-style: dashed;
    color: var(--muted);
  }

  .ws-footer-icon {
    font-size: 1rem;
    line-height: 1;
  }

  .ws-footer-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #account-summary-modal .modal-box,
  #task-tracker-modal .modal-box {
    max-width: 420px;
  }

  #personal-insights-modal .modal-box.modal-box--wide {
    position: relative;
    max-width: min(920px, 96vw);
    text-align: left;
  }

  #personal-insights-modal .modal-title {
    padding-right: 44px;
  }

  .personal-insights-modal-lead {
    margin-top: 0;
    margin-bottom: 16px;
    text-align: left;
  }

  .personal-insights-section--modal {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .personal-insights-head--modal {
    justify-content: flex-end;
    margin-bottom: 12px;
  }

  /* Floating notes: only in workspace; [hidden] must win over flex (see :not below) */
  .notes-floating-panel[hidden] {
    display: none !important;
  }

  /* Floating notes (over workspace — plan below, notes beside) */
  .notes-floating-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
  }

  .notes-floating-panel {
    position: fixed;
    z-index: 420;
    width: 380px;
    height: min(480px, 58vh);
    min-width: 260px;
    min-height: 240px;
    max-width: min(96vw, 520px);
    max-height: min(88vh, 720px);
    resize: both;
    overflow: hidden;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(129, 140, 248, 0.28);
    border-radius: 14px;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .notes-floating-panel.is-dragging {
    cursor: grabbing;
    user-select: none;
  }

  .notes-floating-panel.is-dragging * {
    user-select: none;
  }

  .notes-floating-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    cursor: grab;
    touch-action: none;
  }

  .notes-floating-header:active {
    cursor: grabbing;
  }

  .notes-floating-grip {
    width: 10px;
    margin-top: 4px;
    height: 18px;
    border-radius: 3px;
    background: repeating-linear-gradient(
      90deg,
      rgba(148, 163, 184, 0.35) 0 2px,
      transparent 2px 4px
    );
    flex-shrink: 0;
    opacity: 0.7;
  }

  .notes-floating-head-text {
    flex: 1;
    min-width: 0;
  }

  .notes-floating-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
  }

  .notes-floating-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.68rem;
    color: var(--muted);
    line-height: 1.35;
  }

  .notes-floating-actions {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    flex-shrink: 0;
  }

  .notes-floating-icon-btn {
    appearance: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
  }

  .notes-floating-dock-btn:hover {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
  }

  .notes-floating-close-btn {
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
    color: #fecaca;
  }

  .notes-floating-close-btn:hover {
    background: rgba(248, 113, 113, 0.22);
    color: #fff;
    border-color: rgba(248, 113, 113, 0.55);
  }

  .notes-floating-inner {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px;
    overflow: hidden;
  }

  .notes-shell {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
    min-width: 0;
  }

  .notes-sidebar {
    width: min(168px, 38%);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
  }

  .notes-new-btn {
    appearance: none;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.06);
    color: var(--accent);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }

  .notes-new-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.5);
  }

  .notes-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .notes-list-btn {
    width: 100%;
    text-align: left;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.45);
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
  }

  .notes-list-item.is-active .notes-list-btn {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.1);
  }

  .notes-list-btn:hover {
    border-color: rgba(148, 163, 184, 0.2);
  }

  .notes-list-title {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notes-list-meta {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notes-editor-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
  }

  .notes-title-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
  }

  .notes-title-input:disabled,
  .notes-body-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .notes-body-input {
    width: 100%;
    flex: 1;
    min-height: 120px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
    resize: vertical;
  }

  .notes-editor-actions {
    display: flex;
    justify-content: flex-end;
  }

  .notes-delete-btn {
    appearance: none;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: transparent;
    color: #fca5a5;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
  }

  .notes-delete-btn:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.12);
  }

  .notes-delete-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }

  @media (max-width: 640px) {
    .notes-shell {
      flex-direction: column;
      max-height: none;
    }

    .notes-sidebar {
      width: 100%;
      max-height: 36vh;
    }
  }

  /* Interactive demo section */
  .demo-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 80px;
  }

  .demo-container {
    display: flex;
    gap: 0;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  }

  .demo-panel {
    flex: 1;
    padding: 28px 26px 26px;
    min-width: 0;
  }

  .demo-divider {
    width: 1px;
    flex-shrink: 0;
    background: var(--border-strong);
  }

  .panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  .panel-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
  }

  .panel-icon-svg {
    width: 20px;
    height: 20px;
    color: #818cf8;
  }

  .panel-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
  }

  .panel-subtitle {
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 24px;
  }

  .demo-input {
    width: 100%;
    min-height: 160px;
    background: #0b1120;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 14px 16px;
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.55;
    resize: vertical;
    margin-bottom: 18px;
  }

  .demo-input:focus {
    outline: none;
    border-color: var(--accent-start);
  }

  .demo-input::placeholder {
    color: var(--muted);
  }

  .demo-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 18px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s, filter 0.15s;
  }

  .demo-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
  }

  .panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 20px;
  }

  .placeholder-icons {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    opacity: 0.35;
  }

  .placeholder-icon {
    font-size: 36px;
    color: var(--muted);
  }

  .placeholder-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
    text-align: center;
    max-width: 220px;
  }

  #workspace {
    min-height: 100vh;
  }

  /* Workspace design */
  .workspace-container {
    display: flex;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-deep);
    position: relative;
  }

  .ws-sidebar-backdrop {
    display: none;
    appearance: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 0;
    height: 0;
  }

  .workspace-container > .workspace-sidebar {
    width: 288px;
    flex-shrink: 0;
    position: relative;
    top: auto;
    max-height: none;
    overflow: hidden;
    background: #0f1419;
    border-right: 1px solid var(--border-strong);
    padding: 16px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: stretch;
    min-height: 0;
  }

  .ws-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 8px;
  }

  .ws-brand-row .ws-brand {
    padding: 0;
    flex: 1;
    min-width: 0;
  }

  .ws-sidebar-close {
    display: none;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .ws-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
  }

  .ws-mobile-bar {
    display: none;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top, 0px)) 14px 10px;
    border-bottom: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .ws-open-chats-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }

  .ws-open-chats-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.35);
  }

  .ws-open-chats-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  @media (max-width: 900px) {
    body.ws-sidebar-open {
      overflow: hidden;
    }

    .ws-sidebar-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      z-index: 180;
      width: 100%;
      height: 100%;
      background: rgba(2, 6, 23, 0.55);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s ease;
      cursor: pointer;
    }

    body.ws-sidebar-open .ws-sidebar-backdrop {
      opacity: 1;
      pointer-events: auto;
    }

    .workspace-container > .workspace-sidebar {
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      width: min(300px, 92vw);
      z-index: 190;
      max-height: none;
      padding-top: max(16px, env(safe-area-inset-top, 0px));
      transform: translateX(-105%);
      transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
      box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
    }

    body.ws-sidebar-open .workspace-container > .workspace-sidebar {
      transform: translateX(0);
    }

    .ws-sidebar-close {
      display: inline-flex;
    }

    .ws-mobile-bar {
      display: none !important;
    }

    .ws-open-chats-fab {
      display: inline-flex;
      bottom: max(108px, calc(12vh + env(safe-area-inset-bottom, 0px)));
    }

    #workspace .workspace-center {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    #workspace .input-area {
      position: sticky;
      bottom: 0;
      align-self: stretch;
      margin-top: auto;
    }

    #workspace .workspace-scroll-panel {
      padding-bottom: 12px;
    }
  }

  .ws-sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    margin-top: 4px;
  }

  .ws-sidebar-scroll .sidebar-title {
    position: sticky;
    top: 0;
    background: #0f1419;
    z-index: 1;
    padding-bottom: 6px;
  }

  .ws-history-notes-slot {
    flex-shrink: 0;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
  }

  .ws-notes-from-history-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background: rgba(56, 189, 248, 0.06);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
  }

  .ws-notes-from-history-btn:hover {
    background: rgba(56, 189, 248, 0.11);
    border-color: rgba(56, 189, 248, 0.38);
  }

  .ws-notes-from-history-icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .ws-notes-from-history-text {
    flex: 1;
    min-width: 0;
  }

  .ws-toolbar-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .ws-secondary-btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }

  .ws-secondary-btn:hover {
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--text);
    background: rgba(56, 189, 248, 0.06);
  }

.ws-subscriptions-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.55);
  background: rgba(30, 27, 75, 0.55);
  color: #e9d5ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.ws-plans-ic {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.95;
}

.ws-subscriptions-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  border-color: rgba(196, 181, 253, 0.65);
  background: rgba(49, 46, 129, 0.65);
}

  .ws-conversation-list.conversation-list .conversation-item {
    padding: 10px 8px;
  }

  .ws-conversation-list.conversation-list .conversation-item-title {
    font-size: 0.8rem;
  }

  .ws-conversation-list.conversation-list .conversation-item-meta {
    font-size: 0.68rem;
  }

  .ws-conversation-list .folder-drop-zone {
    font-size: 0.68rem;
    padding: 6px;
    margin-bottom: 6px !important;
  }

  .composer-extras {
    width: 100%;
    max-width: min(920px, 100%);
    margin: 10px auto 0;
    text-align: left;
  }

  .category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    align-items: center;
    opacity: 0.8;
  }

  .category-pills-hint {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.76rem;
    opacity: 0.72;
  }

  .workspace-category-select {
    width: 100%;
    min-height: 34px;
    margin: 0 0 6px;
    padding: 6px 10px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: color-mix(in srgb, var(--surface-solid) 92%, var(--bg-deep));
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
  }

  .workspace-category-select:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
  }

  .cat-pill {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.6);
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
  }

  .cat-pill:hover {
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--text);
  }

  .cat-pill.is-active {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
  }

  .composer-plan-model-row {
    display: block;
    margin-bottom: 10px;
  }

  .composer-plan-field {
    min-width: 0;
    text-align: left;
  }

  .composer-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 6px;
  }

  .workspace-plan-mode-select {
    appearance: none;
    width: 100%;
    min-height: 44px;
    padding: 8px 32px 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.9)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
      no-repeat right 10px center;
    color: #e2e8f0;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
  }

  .workspace-plan-mode-select:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.75);
    outline-offset: 2px;
  }

  .composer-plan-mode-select--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .composer-primary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    text-align: left;
  }

  .composer-mode-segments {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 0 auto 12px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.65);
  }

  .composer-mode-seg {
    appearance: none;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  }

  .composer-mode-seg:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
  }

  .composer-mode-seg.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
  }

  .composer-advanced {
    margin-top: 8px;
    text-align: left;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(11, 17, 32, 0.55);
  }

  .composer-advanced-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    user-select: none;
  }

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

  .composer-advanced-summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.2s ease;
    color: #38bdf8;
  }

  .composer-advanced[open] > .composer-advanced-summary::before {
    transform: rotate(90deg);
  }

  .composer-advanced-body {
    padding: 0 12px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
  }

  .composer-advanced-body .composer-extras {
    margin-top: 8px;
  }

  .composer-secondary {
    margin-top: 8px;
    text-align: center;
    padding: 0 4px 2px;
    border: none;
    background: transparent;
  }

  .input-hint {
    margin: 0;
    font-size: 0.76rem;
    color: rgba(148, 163, 184, 0.85);
    line-height: 1.45;
  }

  .input-hint-kbd {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.65);
    font-size: 0.7rem;
    font-family: inherit;
    font-weight: 600;
    color: #e2e8f0;
  }

  .workspace-ai-hint {
    margin: 8px auto 0;
    max-width: 40rem;
    font-size: 0.72rem;
    line-height: 1.45;
    color: rgba(148, 163, 184, 0.78);
  }

  .workspace-input-shell {
    position: relative;
    flex: 1;
    min-width: 0;
  }

  .workspace-input-shell--chrome {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(11, 17, 32, 0.92);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    overflow: hidden;
  }

  .workspace-input-shell--chrome .workspace-input {
    border: none;
    border-radius: 0;
    background: transparent;
    min-height: 72px;
    padding: 12px 14px 10px;
    box-shadow: none;
  }

  .workspace-input-shell--chrome .workspace-input:focus {
    outline: none;
    box-shadow: none;
  }

  .workspace-composer-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.35);
  }

  .workspace-composer-footer-left,
  .workspace-composer-footer-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .workspace-composer-footer-right {
    margin-left: auto;
  }

  .workspace-category-select--footer {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 180px;
    min-height: 32px;
    margin: 0;
    font-size: 0.76rem;
    border-radius: 999px;
    padding: 5px 12px;
    background: color-mix(in srgb, var(--bg-deep) 88%, black 12%);
    border: 1px solid var(--border);
  }

  .workspace-aim-select--footer {
    max-width: 168px;
  }

  .workspace-input-shell--chrome .workspace-inline-model {
    position: static;
    right: auto;
    bottom: auto;
    padding: 2px 5px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(2, 6, 23, 0.55);
    box-shadow: none;
  }

  .workspace-input-shell--chrome .workspace-stop-btn.is-visible {
    width: 40px;
    height: 40px;
    border-radius: 999px;
  }

  .workspace-inline-model {
    position: absolute;
    right: 10px;
    bottom: 9px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(2, 6, 23, 0.9);
    box-shadow: 0 2px 8px rgba(2, 6, 23, 0.28);
  }

  .workspace-inline-pro-badge {
    margin-left: 0;
    padding: 1px 6px;
    font-size: 0.54rem;
  }

  .workspace-model-select--inline {
    width: 58px;
    min-height: 24px;
    padding: 2px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.92);
  }

  @media (max-width: 820px) {
    .workspace-composer-footer {
      flex-direction: column;
      align-items: stretch;
    }

    .workspace-composer-footer-right {
      margin-left: 0;
      justify-content: flex-end;
    }
  }

  .workspace-onboarding {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    text-align: left;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }

  .workspace-onboarding-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e0f2fe;
  }

  .workspace-onboarding-steps {
    margin: 0 0 12px;
    padding-left: 1.2rem;
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.45;
  }

  .workspace-onboarding-dismiss {
    appearance: none;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.85);
    color: #bae6fd;
    cursor: pointer;
    transition: background 0.15s;
  }

  .workspace-onboarding-dismiss:hover {
    background: rgba(56, 189, 248, 0.12);
  }

  .composer-model-row {
    margin-bottom: 12px;
    text-align: left;
  }

  .workspace-model-select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
  }

  .workspace-model-select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
  }

  .composer-model-hint {
    margin: 8px 0 0;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.35;
  }

  .pro-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
  }

  .pricing-box {
    max-width: 520px;
    text-align: left;
  }

  .pricing-box--wide {
    max-width: 920px;
  }

  .pricing-tiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 12px;
  }

  @media (max-width: 820px) {
    .pricing-tiers {
      grid-template-columns: 1fr;
    }
  }

  .pricing-tier {
    padding: 14px 12px 10px;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.35);
  }

  .pricing-tier--dev {
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(88, 28, 135, 0.12);
  }

  .pricing-tier-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 700;
  }

  .pricing-social-proof {
    margin: -6px 0 12px;
    color: #c1c8d3;
    font-size: 0.8rem;
    text-align: left;
  }

  .pricing-beta-banner {
    margin: 4px 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 186, 73, 0.35);
    background: rgba(255, 186, 73, 0.08);
    color: #ffd48a;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.45;
    text-align: left;
  }

  .pricing-tier-benefits {
    margin: 0 0 14px;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.45;
  }

  .pricing-cards--tier {
    margin-bottom: 0;
  }

  .pricing-dev-link-wrap {
    margin: 12px 0 0;
    text-align: left;
  }

  .pricing-lead {
    text-align: left;
  }

  .pricing-benefits {
    margin: 0 0 18px;
    padding-left: 1.1rem;
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.45;
  }

  .pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  @media (max-width: 480px) {
    .pricing-cards {
      grid-template-columns: 1fr;
    }
  }

  .pricing-card {
    position: relative;
    padding: 16px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.55);
  }

  .pricing-card--featured {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.06);
  }

  .pricing-card-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #38bdf8;
  }

  .pricing-card-label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .pricing-card-price {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
  }

  .pricing-card-period {
    font-size: 0.9rem;
    color: var(--muted);
  }

  .pricing-card-note {
    margin: 6px 0 10px;
    font-size: 0.78rem;
    color: #64748b;
  }

  .pricing-checkout-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #0f172a;
  }

  .pricing-checkout-btn:hover {
    filter: brightness(1.06);
  }

  .pricing-checkout-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    filter: none;
  }

  .pricing-checkout-btn:hover:disabled {
    filter: none;
  }

  .pricing-checkout-btn--dev {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #f8fafc;
  }

  .account-dev-api-section {
    margin: 14px 0 10px;
    padding: 12px 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.45);
    font-size: 0.84rem;
    color: var(--muted);
  }

  .account-dev-api-lead {
    margin: 0 0 8px;
    color: var(--text);
    font-weight: 600;
  }

  .account-dev-api-endpoints {
    margin: 0 0 10px;
    font-size: 0.78rem;
    line-height: 1.4;
    word-break: break-word;
  }

  .account-dev-api-endpoints code {
    font-size: 0.76rem;
  }

  .account-generate-api-key-btn {
    display: inline-block;
    margin-bottom: 10px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(56, 189, 248, 0.12);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
  }

  .account-generate-api-key-btn:hover {
    filter: brightness(1.08);
  }

  .account-api-key-hint {
    margin: 0 0 6px;
    font-size: 0.78rem;
    color: #fbbf24;
  }

  .account-api-key-field {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(2, 6, 23, 0.55);
    color: var(--text);
    font-size: 0.75rem;
    font-family: ui-monospace, monospace;
  }

  .pricing-footnote {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 8px 0 0;
  }

  .account-plan-line {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 8px 0 14px;
  }

  .account-saved-links-section {
    margin: 0 0 14px;
    padding: 10px 12px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.35);
  }

  .account-saved-links-heading {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
  }

  .account-saved-links-empty {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
  }

  .account-saved-links-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
  }

  .account-saved-link-item {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  }

  .account-saved-link-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .account-saved-link-a {
    display: inline-block;
    font-size: 0.82rem;
    color: #38bdf8;
    word-break: break-word;
  }

  .account-saved-link-idea {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--muted);
  }

  .account-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .account-upgrade-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9) !important;
    color: #0f172a !important;
    border: none !important;
    font-weight: 600 !important;
  }

  .account-manage-billing-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text) !important;
  }

  .quick-suggestions-details {
    margin: 2px 0 0;
    text-align: left;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(11, 17, 32, 0.35);
  }

  .quick-suggestions-heading {
    margin: 0;
    padding: 10px 14px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
  }

  .quick-suggestions-details.quick-suggestions-details--hidden {
    display: none;
  }

  .quick-suggestions-details .quick-suggestions {
    padding: 0 10px 8px;
    margin-bottom: 0;
  }

  .ws-open-chats-fab {
    display: none;
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    z-index: 60;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
  }

  .ws-open-chats-fab:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(30, 41, 59, 0.95);
  }

  .ws-open-chats-fab:active {
    transform: scale(0.98);
  }

  .ws-open-chats-fab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .ws-open-chats-fab-label {
    line-height: 1;
  }

  .ws-attachment-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 0;
  }

  .ws-attachment-chips:empty {
    display: none;
  }

  .ws-att-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #bae6fd;
    max-width: 100%;
  }

  .ws-att-chip button {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0 2px;
    font-size: 1rem;
    line-height: 1;
  }

  .ws-att-chip button:hover {
    color: #fecaca;
  }

  .composer-bottom-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    margin-top: 6px;
  }

  .composer-actions-left {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .composer-tool-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .composer-tool-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f1f5f9;
  }

  .composer-tool-btn svg {
    width: 15px;
    height: 15px;
    display: block;
  }

  .composer-tool-btn.is-recording {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
    animation: pulse-rec 1.2s ease-in-out infinite;
  }

  @keyframes pulse-rec {
    50% { opacity: 0.75; }
  }

  .new-idea-cooldown {
    opacity: 0.55;
    pointer-events: none;
  }

  .ws-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px 8px;
  }

  .ws-brand-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
  }

  .ws-brand-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  .new-plan-btn {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #9333ea 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
    transition: transform 0.15s, filter 0.15s;
  }

  .new-plan-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
  }

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

  .sidebar-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    opacity: 0.9;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
  }

  .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .sidebar-icon {
    font-size: 18px;
  }

  .sidebar-text {
    flex: 1;
    font-size: 14px;
    color: var(--text);
  }

  .sidebar-count {
    font-size: 12px;
    color: var(--muted);
  }

  .sidebar-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 42px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
  }

  .sidebar-subitem:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .workspace-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .ws-focus-notify-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 14px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.35);
  }

  .ws-topbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }

  .ws-topbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
  }

  .ws-system-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.95);
  }

  .ws-system-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.85);
  }

  .ws-topbar-user {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }

  .ws-topbar-user:hover {
    border-color: rgba(167, 139, 250, 0.45);
    background: rgba(30, 41, 59, 0.65);
  }

  .ws-topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(145deg, #7c3aed 0%, #6366f1 100%);
    color: #fff;
    flex-shrink: 0;
  }

  .ws-topbar-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ws-focus-notify-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.6);
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .ws-focus-notify-btn:hover {
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--text);
  }

  .ws-export-plan-btn--locked {
    opacity: 0.72;
    border-style: dashed;
  }

  .ws-focus-notify-btn[aria-pressed="true"] {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: #e0f2fe;
  }

  .ws-focus-notify-ic {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.9;
  }

  .workspace-toast-stack {
    position: fixed;
    z-index: 440;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    pointer-events: none;
    max-width: min(360px, calc(100vw - 32px));
  }

  .workspace-toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
  }

  .workspace-toast--in {
    opacity: 1;
    transform: translateY(0);
  }

  .workspace-toast--out {
    opacity: 0;
    transform: translateY(6px);
  }

  .workspace-toast--success {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(6, 78, 59, 0.35);
  }

  .workspace-toast--error {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.25);
  }

  .workspace-toast--info {
    border-color: rgba(56, 189, 248, 0.3);
  }

  /* Focus mode: calmer UI while planning */
  body.workspace-focus-mode #top-menu-wrap {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    pointer-events: none;
    border: none;
  }

  body.workspace-focus-mode #workspace .workspace-container > .workspace-sidebar {
    display: none !important;
  }

  body.workspace-focus-mode #workspace .composer-mode-segments,
  body.workspace-focus-mode #workspace .composer-secondary {
    display: none !important;
  }

  body.workspace-focus-mode #workspace .workspace-center {
    max-width: min(920px, 100%);
  }

  body.workspace-focus-mode #workspace .workspace-scroll-panel {
    padding-top: 12px;
  }

  /* Focus mode: list is hidden — show Chats FAB on desktop; drawer + backdrop when open */
  body.workspace-focus-mode #workspace .ws-open-chats-fab {
    display: inline-flex !important;
  }

  body.workspace-focus-mode.ws-sidebar-open {
    overflow: hidden;
  }

  body.workspace-focus-mode.ws-sidebar-open .ws-sidebar-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 180;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    appearance: none;
    background: rgba(2, 6, 23, 0.55);
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
  }

  body.workspace-focus-mode.ws-sidebar-open #workspace .workspace-container > .workspace-sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 92vw);
    z-index: 190;
    max-height: none;
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
    padding-top: max(16px, env(safe-area-inset-top, 0px));
  }

  body.workspace-focus-mode #workspace .workspace-sidebar .ws-sidebar-close {
    display: inline-flex !important;
  }

  .workspace-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: min(920px, 100%);
    width: 100%;
    margin: 0 auto;
    min-height: 0;
    text-align: center;
    padding: 0 16px;
  }

  .workspace-scroll-panel {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 6px 10px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  }

  .workspace-scroll-panel::-webkit-scrollbar {
    width: 10px;
  }

  .workspace-scroll-panel::-webkit-scrollbar-track {
    background: transparent;
  }

  .workspace-scroll-panel::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }

  .workspace-scroll-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55);
    background-clip: padding-box;
  }

  .workspace-welcome {
    flex-shrink: 0;
    text-align: center;
    padding: 12px 8px 20px;
    max-width: 42rem;
    margin: 0 auto;
    width: 100%;
    transition: opacity 0.2s ease;
  }

  .workspace-welcome[hidden] {
    display: none !important;
  }

  .workspace-welcome-kicker {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.95);
    margin: 0 0 8px;
  }

  .workspace-welcome-title {
    font-size: clamp(1.35rem, 3.2vw, 2rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    line-height: 1.3;
  }

  .workspace-welcome-title .hero-title-gradient,
  .workspace-welcome-gradient {
    display: inline;
    margin-top: 0;
  }

  .workspace-welcome-title-plain {
    color: var(--text);
  }

  .workspace-welcome-sub {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--muted);
    margin: 0;
  }

  .workspace-chat-stack {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
  }

  .workspace-scroll-panel:focus {
    outline: none;
  }

  .workspace-msg-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
    text-align: left;
  }

  .workspace-msg-row--ai {
    flex-direction: row;
  }

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

  .workspace-ai-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.2), rgba(56, 189, 248, 0.12));
    border: 1px solid rgba(129, 140, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c7d2fe;
  }

  .workspace-ai-avatar svg {
    display: block;
    width: 22px;
    height: 22px;
  }

  .workspace-msg-row--ai .chat-message.ai {
    flex: 1;
    min-width: 0;
    margin: 0;
    max-width: none;
    position: relative;
  }

  .ai-msg-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 2px;
  }

  .ai-msg-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.45);
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .ai-msg-copy-btn:hover {
    color: var(--text);
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.08);
  }

  .ai-msg-copy-btn:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.55);
    outline-offset: 2px;
  }

  .ai-msg-copy-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
  }

  .workspace-msg-row--user .chat-message.user {
    max-width: min(92%, 52rem);
    margin: 0 0 0 auto;
  }

  .quick-suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 4px;
  }

  .quick-suggestions.quick-suggestions--hidden {
    display: none;
  }

  @media (max-width: 520px) {
    .quick-suggestions {
      grid-template-columns: 1fr;
    }
  }

  .suggestion-card {
    width: 100%;
    font: inherit;
    text-align: left;
    background: rgba(18, 24, 40, 0.9);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    color: inherit;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
  }

  .suggestion-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(30, 41, 59, 0.55);
  }

  .suggestion-card:active {
    transform: scale(0.99);
  }

  .suggestion-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.22);
  }

  .suggestion-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .suggestion-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
  }

  .suggestion-meta {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.92);
    letter-spacing: 0.02em;
  }

  .input-area {
    flex-shrink: 0;
    text-align: center;
    width: 100%;
    max-width: min(920px, 100%);
    margin: 0 auto;
    padding: 10px 6px max(14px, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.2) 0%, rgba(7, 11, 20, 0.88) 35%, rgba(7, 11, 20, 0.98) 100%);
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 2;
  }

  /* Questionnaire docked above the composer (not in chat scroll) */
  .composer-context-panel {
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    background: rgba(11, 17, 32, 0.92);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    max-height: min(42vh, 320px);
    overflow: auto;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    scroll-padding-bottom: 72px;
  }

  .input-area--questionnaire .composer-context-panel {
    max-height: min(58vh, 520px);
  }

  .composer-context-panel[hidden] {
    display: none !important;
  }

  .composer-context-panel--pulse {
    animation: composerPanelPulse 0.65s ease;
  }

  @keyframes composerPanelPulse {
    from {
      box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.35);
      border-color: rgba(56, 189, 248, 0.45);
    }
    to {
      box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
      border-color: rgba(56, 189, 248, 0.22);
    }
  }

  .composer-context-panel .qn-wrap {
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .composer-context-panel .qn-apply-btn {
    margin: 0;
  }

  .composer-context-panel .qn-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 0.88) 28%, rgba(11, 17, 32, 0.98) 100%);
    border-top: 1px solid rgba(56, 189, 248, 0.12);
  }

  .qn-plan-details {
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    margin: 0;
    padding: 0;
  }

  .qn-plan-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #94a3b8;
    user-select: none;
  }

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

  .qn-plan-summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.2s ease;
    color: #38bdf8;
  }

  .qn-plan-details[open] > .qn-plan-summary::before {
    transform: rotate(90deg);
  }

  .qn-plan-summary-hint {
    font-weight: 500;
    color: #64748b;
    font-size: 0.82rem;
  }

  .qn-plan-details .qn-plan-preview {
    border-bottom: none;
  }

  .ai-composer-hint {
    font-size: 0.85rem !important;
    color: #7dd3fc !important;
    margin-top: 8px !important;
  }

  .workspace-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
  }

  .workspace-input {
    width: 100%;
    min-height: 60px;
    background: #0b1120;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 12px 14px 14px;
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.55;
    resize: none;
    margin-bottom: 0;
  }

  .workspace-send-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #8b5cf6 100%);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
    transition: transform 0.12s, filter 0.12s, opacity 0.12s;
  }

  .workspace-send-btn:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
  }

  .workspace-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
  }

  .workspace-send-btn.is-hidden {
    visibility: hidden;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .workspace-send-btn.workspace-send-btn--round {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    padding: 0;
  }

  .workspace-stop-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 14px;
    cursor: pointer;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
  }

  .workspace-stop-btn.is-visible {
    display: inline-flex;
  }

  .workspace-stop-btn:hover {
    background: rgba(185, 28, 28, 0.45);
    border-color: rgba(252, 165, 165, 0.55);
  }

  .workspace-stop-btn svg {
    display: block;
  }

  .ai-loading-bubble {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .ai-loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
  }

  .ai-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(180deg, #38bdf8, #6366f1);
    animation: aiDotBounce 1.1s ease-in-out infinite;
    opacity: 0.85;
  }

  .ai-loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
  }

  .ai-loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
  }

  @keyframes aiDotBounce {
    0%, 80%, 100% {
      transform: translateY(0);
      opacity: 0.45;
    }
    40% {
      transform: translateY(-5px);
      opacity: 1;
    }
  }

  .ai-loading-label {
    font-size: 0.88rem;
    color: #94a3b8;
    background: linear-gradient(90deg, #94a3b8, #38bdf8, #94a3b8);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: aiShimmer 2s ease-in-out infinite;
  }

  @keyframes aiShimmer {
    0% {
      background-position: 100% 0;
    }
    100% {
      background-position: -100% 0;
    }
  }

  .ai-msg-rich--in {
    animation: aiMsgFadeIn 0.4s ease;
  }

  @keyframes aiMsgFadeIn {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .workspace-send-btn svg {
    display: block;
  }

  .workspace-chat-messages {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: left;
    padding: 0 4px 4px;
    min-height: 0;
  }

  .workspace-chat-messages:empty {
    display: none;
  }

  .workspace-chat-messages:not(:empty) {
    display: block;
  }

  .workspace-chat-messages .chat-message {
    max-width: 100%;
  }

  .workspace-chat-messages .chat-message.ai {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    padding: 16px 18px;
    border-radius: 16px;
    line-height: 1.7;
    font-size: 0.98rem;
    max-width: 100%;
  }

  .workspace-chat-messages .chat-message.ai .ai-msg-rich {
    word-break: break-word;
  }

  .workspace-chat-messages .chat-message.ai .ai-para {
    margin: 0 0 0.9em;
    color: #e2e8f0;
  }

  .workspace-chat-messages .chat-message.ai .ai-para:last-child {
    margin-bottom: 0;
  }

  .workspace-chat-messages .chat-message.ai .ai-line {
    color: #94a3b8;
  }

  .workspace-chat-messages .chat-message.ai .ai-line-em {
    color: #ffffff;
    font-weight: 600;
  }

  .workspace-chat-messages .chat-message.ai .ai-line-heading {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: -0.01em;
    display: block;
    margin: 0.35em 0 0.2em;
  }

  .workspace-chat-messages .chat-message.ai .ai-para:first-child .ai-line-heading:first-child {
    margin-top: 0;
  }

  /* Structured: clarifying questions */
  .ai-block-questions {
    text-align: left;
  }

  .ai-q-intro {
    margin: 0 0 14px;
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .ai-q-list {
    margin: 0;
    padding-left: 1.35em;
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .ai-q-list li {
    margin-bottom: 10px;
  }

  /* Structured: questionnaire (table, 3 options + custom) */
  .qn-wrap {
    text-align: left;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(11, 17, 32, 0.65);
    overflow: hidden;
  }

  .qn-intro {
    margin: 0;
    padding: 14px 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  }

  .qn-plan-preview {
    padding: 12px 16px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.45);
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #cbd5e1;
  }

  .qn-plan-preview .ai-para {
    margin: 0 0 10px;
  }

  .qn-plan-preview .ai-para:last-child {
    margin-bottom: 0;
  }

  .qn-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .qn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: #cbd5e1;
  }

  .qn-table th,
  .qn-table td {
    border: 1px solid rgba(148, 163, 184, 0.12);
    padding: 10px 12px;
    vertical-align: top;
  }

  .qn-table th {
    background: rgba(15, 23, 42, 0.55);
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .qn-table .qn-num {
    width: 2.25rem;
    text-align: center;
    color: #64748b;
    font-variant-numeric: tabular-nums;
  }

  .qn-table .qn-prompt {
    min-width: 140px;
    max-width: 280px;
    line-height: 1.45;
    color: #e2e8f0;
  }

  .qn-table .qn-opt {
    min-width: 100px;
    max-width: 160px;
  }

  .qn-opt-label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    line-height: 1.35;
  }

  .qn-opt-label input {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #38bdf8;
  }

  .qn-opt-text {
    color: #94a3b8;
    font-size: 0.8rem;
  }

  .qn-table .qn-own {
    min-width: 120px;
    max-width: 200px;
  }

  .qn-custom-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
    font-size: 0.82rem;
  }

  .qn-custom-input::placeholder {
    color: #64748b;
  }

  .qn-custom-input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
  }

  .qn-actions {
    display: flex;
    gap: 10px;
    margin: 14px 16px 16px;
    flex-wrap: wrap;
  }

  .qn-apply-btn,
  .qn-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 190px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .workspace-msg-row--ai .chat-message.ai:has(.qn-wrap--flow) {
    background: linear-gradient(
      155deg,
      rgba(99, 102, 241, 0.07) 0%,
      rgba(15, 23, 42, 0.2) 42%,
      transparent 100%
    );
    border: 1px solid rgba(129, 140, 248, 0.12);
    box-shadow: none;
  }

  .qn-wrap--compact.qn-wrap--flow {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .qn-whisper {
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(148, 163, 184, 0.82);
    font-weight: 400;
    margin: 0 0 12px;
    padding: 0;
  }

  .qn-plan-ghost {
    margin: 0 0 14px;
    border: none;
    background: transparent;
  }

  .qn-plan-ghost-sum {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.95);
    user-select: none;
    transition: color 0.15s ease;
  }

  .qn-plan-ghost-sum::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(100, 116, 139, 0.55);
    transform: translateY(1px);
    transition: transform 0.15s ease;
  }

  .qn-plan-ghost[open] > .qn-plan-ghost-sum {
    color: rgba(148, 163, 184, 1);
  }

  .qn-plan-ghost[open] > .qn-plan-ghost-sum::after {
    transform: rotate(180deg) translateY(-1px);
  }

  .qn-plan-ghost-sum::-webkit-details-marker {
    display: none;
  }

  .qn-plan-ghost-body {
    margin-top: 10px;
    padding: 10px 0 2px 12px;
    border-left: 2px solid rgba(129, 140, 248, 0.28);
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(203, 213, 225, 0.88);
    max-height: 9rem;
    overflow-y: auto;
  }

  .qn-plan-ghost-body .ai-para {
    margin: 0.35em 0;
  }

  .qn-mini {
    margin-top: 16px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
  }

  .qn-mini:first-of-type {
    margin-top: 4px;
  }

  .qn-mini-q {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  .qn-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .qn-chip {
    flex: 0 1 auto;
    max-width: 100%;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(226, 232, 240, 0.92);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  }

  .qn-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.38);
    color: #f1f5f9;
  }

  .qn-chip.is-selected {
    border-color: rgba(129, 140, 248, 0.55);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(56, 189, 248, 0.12) 100%);
    color: #f8fafc;
    box-shadow: 0 2px 14px rgba(99, 102, 241, 0.15);
  }

  .qn-chip--other {
    color: rgba(196, 181, 253, 0.95);
    border-color: rgba(167, 139, 250, 0.28);
    background: rgba(139, 92, 246, 0.06);
  }

  .qn-chip--other:hover {
    border-color: rgba(167, 139, 250, 0.45);
    color: #ede9fe;
  }

  .qn-chip--other.is-selected {
    border-color: rgba(167, 139, 250, 0.55);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(99, 102, 241, 0.1) 100%);
    box-shadow: 0 2px 14px rgba(139, 92, 246, 0.12);
    color: #f5f3ff;
  }

  .qn-mini-custom {
    display: none;
    width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    padding: 8px 2px 6px;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
  }

  .qn-mini-custom::placeholder {
    color: rgba(148, 163, 184, 0.65);
  }

  .qn-mini-custom:focus {
    outline: none;
    border-bottom-color: rgba(56, 189, 248, 0.55);
  }

  .qn-mini--custom-open .qn-mini-custom {
    display: block;
  }

  .qn-actions--compact {
    margin-top: 16px;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    padding: 0;
  }

  .qn-actions--compact .qn-send-btn.qn-send-btn--pill {
    flex: 0 0 auto;
    width: auto;
    min-width: 6.5rem;
    max-width: none;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(129, 140, 248, 0.4);
    color: #e0e7ff;
  }

  .qn-actions--compact .qn-send-btn.qn-send-btn--pill:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(129, 140, 248, 0.55);
    color: #fff;
  }

  .qn-send-btn {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(129, 140, 248, 0.42);
    color: #c7d2fe;
  }

  .qn-apply-btn:hover,
  .qn-send-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
  }

  @media (max-width: 720px) {
    .qn-table-scroll {
      overflow-x: visible;
    }

    .qn-table thead {
      display: none;
    }

    .qn-table tbody tr {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 14px 12px;
      margin-bottom: 12px;
      background: rgba(15, 23, 42, 0.55);
      border-radius: 12px;
      border: 1px solid rgba(148, 163, 184, 0.14) !important;
    }

    .qn-table tbody td {
      display: block;
      width: 100% !important;
      max-width: none !important;
      min-width: 0 !important;
      border: none !important;
      padding: 0 !important;
    }

    .qn-table tbody td::before {
      display: block;
      font-size: 0.68rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #8899aa;
      margin-bottom: 6px;
      content: attr(data-label);
    }

    .qn-opt-label {
      align-items: flex-start;
    }
  }

  /* Structured: action plan (ChatGPT-like wide card + table rows) */
  .action-plan-card {
    text-align: left;
    width: 100%;
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(11, 17, 32, 0.65);
    overflow: hidden;
  }

  .action-plan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.5);
    flex-wrap: wrap;
  }

  .action-plan-head-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
  }

  .ap-restore-hidden-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.45);
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
  }

  .ap-restore-hidden-btn:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(167, 139, 250, 0.55);
  }

  .action-plan-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
    margin: 0;
  }

  .action-plan-progress {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.25);
  }

  .action-plan-intro {
    margin: 0;
    padding: 14px 16px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #94a3b8;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  }

  .ap-phase {
    padding: 14px 16px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  }

  .ap-phase:last-child {
    border-bottom: none;
  }

  .ap-phase-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .ap-phase-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
  }

  .ap-phase-time {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
  }

  .ap-task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .ap-task-row {
    border-radius: 12px;
    border: 1px solid rgba(51, 65, 85, 0.6);
    background: rgba(15, 23, 42, 0.55);
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .ap-task-row:hover {
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.12);
  }

  .ap-task-cell {
    padding: 10px 12px;
  }

  .ap-task-inner-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
  }

  .ap-cb {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #38bdf8;
  }

  .ap-task-lines {
    flex: 1;
    min-width: min(100%, 11rem);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .ap-task-line {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #e2e8f0;
  }

  .ap-task-k {
    display: inline-block;
    min-width: 4.2rem;
    margin-right: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    vertical-align: top;
  }

  .ap-task-line-body {
    display: inline;
  }

  .ap-stuck-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
  }

  .ap-stuck-panel[hidden] {
    display: none !important;
  }

  .ap-stuck-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
  }

  .ap-stuck-note {
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.75);
    background: rgba(2, 6, 23, 0.4);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.84rem;
    resize: vertical;
    box-sizing: border-box;
  }

  .ap-task-text {
    flex: 1;
    min-width: min(100%, 12rem);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e2e8f0;
  }

  .ap-task-est {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    padding-top: 3px;
    flex-shrink: 0;
  }

  .ap-task-star {
    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a5b4fc;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
  }

  .ap-task-row:hover .ap-task-star,
  .ap-task-star:focus-visible {
    opacity: 1;
  }

  .ap-task-star:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
  }

  .ap-task-row--hidden {
    display: none;
  }

  .ap-status {
    flex-shrink: 0;
    margin-top: 2px;
    max-width: 9.5rem;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.75);
    background: rgba(2, 6, 23, 0.55);
    color: #e2e8f0;
    font-size: 0.76rem;
    cursor: pointer;
  }

  .ap-task-hide {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.65);
    background: transparent;
    color: #94a3b8;
    font-size: 0.76rem;
    cursor: pointer;
  }

  .ap-task-hide:hover {
    border-color: rgba(148, 163, 184, 0.5);
    color: #cbd5e1;
  }

  .ap-resources {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(51, 65, 85, 0.55);
    background: rgba(15, 23, 42, 0.35);
  }

  .ap-resources-title {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #a5b4fc;
    letter-spacing: 0.02em;
  }

  .ap-resources-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #cbd5e1;
  }

  .ap-res-item {
    margin-bottom: 6px;
  }

  .ap-res-link {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .ap-save-link-btn {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.1);
    color: #7dd3fc;
    font-size: 0.72rem;
    cursor: pointer;
  }

  .ap-save-link-btn:hover {
    background: rgba(56, 189, 248, 0.18);
  }

  .ap-task-resources {
    margin: 8px 0 0;
    padding: 0 0 0 12px;
    border-left: 2px solid rgba(99, 102, 241, 0.35);
    list-style: none;
    font-size: 0.8rem;
    color: #94a3b8;
  }

  .ap-task-resources li {
    margin: 4px 0;
  }

  .qn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
  }

  .workspace-input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
  }

  .workspace-input::placeholder {
    color: rgba(148, 163, 184, 0.75);
  }

  .input-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
  }

  /* Plan: UX, a11y, touch, status — additions */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nav-link-to-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .nav-link-to-hero:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.45);
    color: #fff;
  }

  .hero-link-demo {
    color: #7dd3fc;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .hero-link-demo:hover {
    color: #bae6fd;
  }

  .landing-footer {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 24px 48px;
  }

  .landing-footer-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--muted);
    text-align: center;
  }

  .landing-footer-text strong {
    color: #cbd5e1;
    font-weight: 600;
  }

  .landing-footer-links {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .landing-footer-links a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
  }

  .landing-footer-links a:hover {
    color: var(--text);
    border-bottom-color: var(--border);
  }

  .landing-footer-code {
    font-size: 0.78em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-strong);
  }

  .landing-stats-error {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
    padding: 0 12px;
  }

  .workspace-global-status {
    flex-shrink: 0;
    margin: 0 0 10px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #bae6fd;
  }

  .workspace-global-status--error {
    background: var(--danger-dim);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
  }

  .sidebar-empty-hint {
    margin: 0 0 12px;
    padding: 12px 14px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.45);
    border: 1px dashed rgba(148, 163, 184, 0.2);
    border-radius: 12px;
  }

  .header-nav .nav-link,
  .header-nav .nav-link-ghost,
  .header-nav .nav-link-to-hero {
    min-height: 44px;
    align-items: center;
    display: inline-flex;
    box-sizing: border-box;
  }

  .hero-buttons .btn-primary {
    min-height: 48px;
    min-width: 44px;
  }

  .task-focus-save {
    min-height: 44px;
  }

  .composer-tool-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .workspace-send-btn,
  .workspace-stop-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .ws-open-chats-btn {
    min-height: 44px;
  }

  .new-plan-btn,
.ws-secondary-btn,
.ws-subscriptions-btn {
    min-height: 44px;
  }

  .suggestion-card {
    min-height: 44px;
  }

  /* Personal idea analytics (localStorage) */
  .personal-insights-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 40px;
  }

  .personal-insights-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
  }

  .personal-insights-head .section-title {
    margin: 0;
    text-align: left;
  }

  .personal-insights-period {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .pi-period-btn {
    appearance: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.5);
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .pi-period-btn:hover {
    border-color: rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
  }

  .pi-period-btn.is-active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.2));
    border-color: rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
  }

  .personal-insights-lead {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
    text-align: left;
    max-width: 42rem;
  }

  .personal-insights-kpi {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
  }

  .pi-kpi-card {
    padding: 18px 22px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.55);
    min-width: 160px;
    text-align: left;
  }

  .pi-kpi-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 6px;
  }

  .pi-kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #38bdf8, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .pi-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  @media (max-width: 720px) {
    .pi-charts-grid {
      grid-template-columns: 1fr;
    }
  }

  .pi-chart-card {
    padding: 16px 18px 18px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(11, 17, 32, 0.5);
    text-align: left;
  }

  .pi-chart-title {
    margin: 0 0 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1;
  }

  .pi-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2px;
    height: 128px;
    padding: 4px 0 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .pi-bar-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
  }

  .pi-bar-fill {
    width: 100%;
    max-width: 14px;
    margin: 0 auto;
    min-height: 2px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, #38bdf8, #6366f1);
    opacity: 0.92;
  }

  .pi-bar-tick {
    font-size: 0.62rem;
    color: #64748b;
    margin-top: 6px;
    line-height: 1;
  }

  .pi-bar-chart--week .pi-bar-col {
    flex: 1 1 0;
  }

  .pi-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .pi-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) auto;
    gap: 10px;
    align-items: center;
    font-size: 0.84rem;
  }

  .pi-row-label {
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pi-row-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
  }

  .pi-row-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6);
    min-width: 4px;
  }

  .pi-row-fill--model {
    background: linear-gradient(90deg, #22c55e, #0ea5e9);
  }

  .pi-row-val {
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
    font-size: 0.8rem;
    min-width: 2ch;
    text-align: right;
  }

  .pi-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
  }

