/* ── Provider & interactive tokens ───────────────────────────── */
:root {
  --chatgpt:    #10a37f;
  --claude:     #c8845a;
  --gemini:     #4285f4;
  --copilot:    #7b6fcc;
  --perplexity: #17b0a7;
  --lechat:     #f06830;
  --grok:       #aaaaaa;
  --deepseek:   #4d6bfe;
  --qwen:       #615ced;
  --kimi:       #059669;
  --zai:        #2563eb;

  --red-soft:  rgba(224,108,108,.12);
  --red:       #e06c6c;
}

:root[data-theme="light"] {
  --grok:      #555555;
  --red:       #903030;
  --red-soft:  rgba(144,48,48,.08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --grok:      #555555;
    --red:       #903030;
    --red-soft:  rgba(144,48,48,.08);
  }
}

/* ── Skip link ───────────────────────────────────────────────── */
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--text);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 0 0 var(--r) var(--r);
  text-decoration: none;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: top .15s ease-out;
}
.skip:focus {
  top: 0;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── App Layout Shell ────────────────────────────────────────── */
body.has-sidebar {
  overflow: hidden;
  height: 100vh;
  display: block;
}

.app-layout {
  display: flex;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

/* ── Left Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width .2s cubic-bezier(0.16, 1, 0.3, 1), transform .2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
  z-index: 100;
}

.sidebar.collapsed {
  width: 0;
  border-right: none;
  visibility: hidden;
  pointer-events: none;
}

/* Sidebar Header */
.sidebar-header {
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
}
.brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-text span {
  color: var(--gold);
}

.collapse-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, background .12s;
}
.collapse-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.collapse-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* Sidebar Action: New Prompt */
.sidebar-action-wrap {
  padding: 12px 14px 6px;
  flex-shrink: 0;
}
.new-prompt-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.new-prompt-btn:hover {
  background: var(--border);
  border-color: var(--gold-dim);
}
.new-prompt-btn-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd-hint {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-3, rgba(255,255,255,0.05));
  border: 1px solid var(--border-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.2;
}

/* Sidebar Search */
.sidebar-search-wrap {
  padding: 6px 14px 10px;
  flex-shrink: 0;
}
.sidebar-search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color .12s;
}
.sidebar-search:focus {
  border-color: var(--focus);
}
.sidebar-search:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.sidebar-search::placeholder {
  color: var(--text-3);
}

/* Sidebar Scrollable Sections */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.section-title-wrap,
button.section-title-wrap,
.section-title-btn {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  color: inherit;
  text-align: left;
  border-radius: 4px;
  transition: background .12s;
}
.section-title-wrap:hover,
button.section-title-wrap:hover,
.section-title-btn:hover {
  background: var(--surface-2);
}
.section-title-wrap:focus-visible,
button.section-title-wrap:focus-visible,
.section-title-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.section-title {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-badge {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
}
.section-clear-btn {
  font-size: 11px;
  color: var(--text-3);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.section-clear-btn:hover {
  color: var(--red);
  background: var(--red-soft);
}
.section-clear-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.history-footer {
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
}
.history-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.history-clear-btn:hover {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red-dim, rgba(224, 108, 108, 0.3));
}
.history-clear-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.history-clear-btn .clear-icon {
  font-size: 12px;
  line-height: 1;
}

.item-chevron {
  font-size: 10px;
  color: var(--text-3);
  display: inline-block;
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  position: relative;
  min-height: 34px;
  text-decoration: none;
}
.item-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.item-btn.active {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--gold);
}
.item-main-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: var(--text-xs);
  color: inherit;
  text-align: left;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.item-main-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.item-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.item-icon {
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}
.item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Action buttons accessible on hover and keyboard focus */
.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
  flex-shrink: 0;
  margin-left: 6px;
}
.item-btn:hover .item-actions,
.item-btn:focus-within .item-actions {
  opacity: 1;
  pointer-events: auto;
}
.action-sub-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: all .12s;
  padding: 0;
  line-height: 1;
}
.action-sub-btn:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}
.action-sub-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.action-sub-btn.delete:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-soft);
}

.item-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 10px;
  font-style: italic;
}
.prov-badge {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 3px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  background: var(--surface);
}
.lang-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  color: var(--text-2);
  width: 100%;
}
.lang-select {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}
.lang-select:focus { border-color: var(--focus); }
.lang-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ── Mobile Backdrop ─────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 95;
}

/* ── Main Workspace ──────────────────────────────────────────── */
.main-workspace {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Topbar */
.main-topbar {
  height: var(--header-h);
  min-height: var(--header-h);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.toggle-sidebar-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all .12s;
}
.toggle-sidebar-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: 6px 12px;
  border-radius: 100px;
  transition: color .12s, background .12s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--gold); background: var(--gold-glow); }

/* Theme Toggle Button in Topbar */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  transition: color .12s, background .12s, border-color .12s;
  flex-shrink: 0;
  margin-left: 4px;
}
.theme-toggle-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-2);
}
.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}

/* Topbar Dropdown with Smooth 180deg Rotation */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: var(--text-sm); color: var(--text-2);
  padding: 6px 12px; border-radius: 100px;
  display: flex; align-items: center; gap: 6px;
  transition: color .12s, background .12s;
}
.nav-dropdown-btn:hover { color: var(--text); background: var(--surface-2); }
.nav-dropdown-arrow {
  font-size: 10px;
  opacity: 0.7;
  display: inline-block;
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-dropdown.open .nav-dropdown-arrow {
  transform: rotate(180deg);
}
.nav-dropdown.open .nav-dropdown-btn {
  color: var(--gold);
  background: var(--gold-glow);
}
.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r); padding: 6px 0; min-width: 180px;
  box-shadow: 0 12px 36px rgba(0,0,0,.45); z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 7px 16px; font-size: var(--text-xs);
  color: var(--text-2); text-decoration: none;
  transition: color .1s, background .1s;
}
.nav-dropdown-menu a:hover { color: var(--gold); background: var(--surface-2); }

/* ── Clean Writing Canvas ────────────────────────────────────── */
.canvas-container {
  min-width: 0;
  flex: 1 0 auto;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

/* Hero */
.hero {
  text-align: center;
  padding-top: 10px;
}
.hero-tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 200;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-tagline em {
  font-style: italic;
  color: var(--gold);
  font-weight: 300;
}
.hero-sub {
  margin-top: 10px;
  font-size: var(--text-sm);
  color: var(--text-3);
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Clean Editor Area (No Outer Card Box) */
.editor-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prompt-textarea {
  width: 100%;
  min-height: 200px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-base);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.prompt-textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.prompt-textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.prompt-textarea::placeholder {
  color: var(--text-3);
  font-style: italic;
}

.editor-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 9px 16px;
  border-radius: var(--r);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .12s ease;
  line-height: 1.2;
}
.btn-primary {
  background: var(--btn-primary-bg, var(--gold));
  border: 1px solid var(--btn-primary-border, var(--gold));
  color: var(--btn-primary-text, #0f0f10);
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--btn-primary-hover, #dfb556);
}
.btn-primary.copied {
  background: #0a6c53;
  border-color: #0a6c53;
  color: #ffffff;
}
[data-theme="light"] .btn-primary {
  background: #d4a847;
  border-color: #bfa044;
  color: #141210;
  font-weight: 500;
}
[data-theme="light"] .btn-primary:hover {
  background: #e0b854;
  border-color: #af8f34;
}
[data-theme="light"] .btn-primary.copied {
  background: #0a6c53;
  border-color: #0a6c53;
  color: #ffffff;
}
[data-theme="light"] .btn-primary .btn-kbd {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.16);
  color: #141210;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn-primary {
    background: #d4a847;
    border-color: #bfa044;
    color: #141210;
    font-weight: 500;
  }
  :root:not([data-theme="dark"]) .btn-primary:hover {
    background: #e0b854;
    border-color: #af8f34;
  }
  :root:not([data-theme="dark"]) .btn-primary.copied {
    background: #0a6c53;
    border-color: #0a6c53;
    color: #ffffff;
  }
  :root:not([data-theme="dark"]) .btn-primary .btn-kbd {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.16);
    color: #141210;
  }
}
.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--border);
  border-color: var(--gold-dim);
}
.btn-ghost {
  background: none;
  border: 1px solid transparent;
  color: var(--text-3);
}
.btn-ghost:hover {
  color: var(--red);
  background: var(--red-soft);
}

.btn-kbd {
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.02em;
}
.kbd-cmd {
  font-size: 13.5px;
  line-height: 1;
  display: inline-block;
  margin-right: 2.5px;
  vertical-align: middle;
}
.btn-primary .btn-kbd {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #1a1714;
}
.btn-secondary .btn-kbd {
  background: var(--surface-3, rgba(255,255,255,0.06));
  border: 1px solid var(--border-2);
  color: var(--text-3);
}
[data-theme="light"] .btn-secondary .btn-kbd,
[data-theme="light"] .kbd-hint {
  background: rgba(0, 0, 0, 0.06);
  border-color: var(--border-2);
  color: var(--text-2);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn-secondary .btn-kbd,
  :root:not([data-theme="dark"]) .kbd-hint {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--border-2);
    color: var(--text-2);
  }
}
.btn-ghost .btn-kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.editor-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.active-badge {
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-glow);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--gold-dim);
  display: none;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.active-badge.show { display: inline-block; }

.char-counter,
.char-count {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ── Providers Section (11 AI Models) ────────────────────────── */
.providers-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lbl-heading {
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.providers-grid,
.providers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  list-style: none;
}

.p-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
  text-decoration: none;
}
.p-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  transform: translateY(-1px);
}
.p-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
}
.p-arrow {
  color: var(--text-3);
  font-size: 11px;
}

/* Provider Color Classes */
.pc-chatgpt    { --pc: var(--chatgpt); }
.pc-claude     { --pc: var(--claude); }
.pc-gemini     { --pc: var(--gemini); }
.pc-copilot    { --pc: var(--copilot); }
.pc-perplexity { --pc: var(--perplexity); }
.pc-lechat     { --pc: var(--lechat); }
.pc-grok       { --pc: var(--grok); }
.pc-deepseek   { --pc: var(--deepseek); }
.pc-qwen       { --pc: var(--qwen); }
.pc-kimi       { --pc: var(--kimi); }
.pc-zai        { --pc: var(--zai); }

/* ── SEO Grounded Footer ─────────────────────────────────────── */
footer {
  width: 100%;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  margin-top: 40px;
  background: var(--surface);
}
.footer-inner {
  width: 100%;
  max-width: 820px;
  padding: 36px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.footer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-heading {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 16px;
}
.footer-grid a {
  font-size: var(--text-sm);
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0;
  padding: 4px 0;
  transition: color .12s;
}
.footer-grid a:hover {
  color: var(--gold);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0;
  transition: color .12s;
}
.footer-links a:hover {
  color: var(--gold);
}
.footer-desc {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.6;
}
.footer-desc a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-desc a:hover {
  color: var(--gold);
}
.footer-copy {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}
.footer-made {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}
.footer-sep {
  width: 100%;
  height: 1px;
  background: var(--border);
}
.footer-doodle {
  display: block;
  margin: 12px auto 0;
  width: 160px;
  height: auto;
  opacity: .18;
  transition: opacity .3s;
  filter: invert(1) brightness(1.5);
}
.footer-doodle:hover {
  opacity: .35;
}
[data-theme="light"] .footer-doodle { filter: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .footer-doodle { filter: none; }
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  visibility: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 10px 18px;
  font-size: var(--text-sm);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  transition: opacity .2s ease, transform .25s cubic-bezier(.34,1.56,.64,1), visibility .25s;
  z-index: 300;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ── Library Page Components (Category Chips & Prompt Cards) ── */
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.cat {
  padding: 6px 14px;
  min-height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--text-xs);
  letter-spacing: 0;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transition: all .12s;
}
.cat:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--gold-glow);
}
.cat:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.cat.active {
  color: var(--gold);
  border-color: var(--gold);
  background: var(--gold-glow);
  font-weight: 500;
}

.prompt-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prompt-card {
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
.prompt-card:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.prompt-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.prompt-card.selected {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.prompt-card-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.prompt-card-preview {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.5;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prompt-card.selected .prompt-card-preview {
  -webkit-line-clamp: unset;
  color: var(--text-2);
}

.related-libs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-grid a {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--text-xs);
  text-decoration: none;
  transition: all .12s;
}
.related-grid a:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--gold-glow);
}

/* ── Responsive Drawer & Grid ────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.show {
    display: block;
  }
  .collapse-btn {
    display: none;
  }
  .providers-grid,
  .providers {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .main-topbar {
    padding: 0 8px;
    gap: 4px;
  }
  .topbar-left {
    gap: 8px;
  }
  .toggle-sidebar-btn {
    padding: 5px 8px;
    font-size: 14px;
  }
  .toggle-sidebar-btn #lblToggleSidebar {
    display: none;
  }
  .brand-link {
    font-size: 13px;
    white-space: nowrap;
  }
  .nav-links {
    gap: 3px;
    flex-shrink: 0;
  }
  .nav-link {
    padding: 4px 6px;
    font-size: 12px;
  }
  .nav-dropdown-btn {
    padding: 4px 6px;
    font-size: 12px;
    gap: 4px;
  }
  .theme-toggle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 14px;
    margin-left: 2px;
  }
  .canvas-container {
    padding: 20px 12px 40px;
  }
  .hero-tagline {
    font-size: 1.35rem;
    line-height: 1.25;
  }
  .hero-sub {
    font-size: 12px;
  }
  .providers-grid,
  .providers {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    padding: 28px 16px 40px;
  }
  .actions-group {
    width: 100%;
  }
  .btn-primary {
    flex: 1;
  }
}

/* ── Reduced Motion Accessibility ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
