.trix-content .attachment-gallery > action-text-attachment,
.trix-content .attachment-gallery > .attachment {
  flex: 1 0 33%;
  padding: 0 0.5em;
  max-width: 33%;
}

.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
  flex-basis: 50%;
  max-width: 50%;
}

.trix-content action-text-attachment .attachment {
  padding: 0 !important;
  max-width: 100% !important;
}

/* Hide Link and Attach Files buttons */
trix-toolbar .trix-button-group--file-tools,
trix-toolbar .trix-button--icon-link {
  display: none;
}

/* In edit mode: toolbar sticks just below the nav header */
.script-editor trix-toolbar {
  position: sticky;
  top: var(--nav-height, 65px);
  z-index: 40;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

/* Icon opacity */
trix-toolbar .trix-button--icon::before {
  opacity: 0.6;
}
trix-toolbar .trix-button--icon:hover::before,
trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1;
}

/* Dark / warm: invert SVG icons */
html.dark trix-toolbar .trix-button--icon::before,
html.warm trix-toolbar .trix-button--icon::before {
  filter: invert(1);
  opacity: 0.8;
}
html.dark trix-toolbar .trix-button--icon:hover::before,
html.dark trix-toolbar .trix-button--icon.trix-active::before,
html.warm trix-toolbar .trix-button--icon:hover::before,
html.warm trix-toolbar .trix-button--icon.trix-active::before {
  filter: invert(1);
  opacity: 1;
}

/* Toolbar button theming */
trix-toolbar .trix-button {
  background-color: transparent;
  color: var(--color-text);
}
trix-toolbar .trix-button:hover {
  background-color: var(--color-surface-2);
}
trix-toolbar .trix-button.trix-active {
  background-color: #3b82f6;
  color: white;
}
trix-toolbar .trix-button:disabled {
  opacity: 0.3;
}
trix-toolbar .trix-button-group {
  border-color: var(--color-border);
}
trix-toolbar .trix-dialogs {
  background-color: var(--color-surface);
  border-color: var(--color-border);
}
trix-toolbar .trix-dialog__link-fields input {
  background-color: var(--color-input-bg);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Editor content */
trix-editor,
.trix-content {
  color: var(--color-text);
}

.trix-content a {
  color: #60a5fa;
}

.trix-content ol {
  list-style: decimal !important;
}

.trix-content ul {
  list-style: disc !important;
}

.trix-content blockquote {
  border-left-color: var(--color-border);
  color: var(--color-text-muted);
}

.trix-content code,
.trix-content pre {
  background-color: var(--color-surface-2);
  color: var(--color-text);
}
@import 'actiontext.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================================
   1. TOKENS
   ============================================================ */

:root {
  --sidebar-width: 4.5rem;

  --color-bg:              #f3f4f6;
  --color-surface:         #ffffff;
  --color-surface-2:       #f9fafb;
  --color-border:          #e5e7eb;
  --color-text:            #111827;
  --color-text-muted:      #6b7280;
  --color-nav:             #ffffff;
  --color-nav-border:      #e5e7eb;
  --color-nav-icon:        #6b7280;
  --color-nav-active:      #eff6ff;
  --color-nav-icon-active: #2563eb;
  --color-input-bg:        #ffffff;
}

html.dark {
  --color-bg:              #111827;
  --color-surface:         #1f2937;
  --color-surface-2:       #374151;
  --color-border:          #374151;
  --color-text:            #f9fafb;
  --color-text-muted:      #9ca3af;
  --color-nav:             #1f2937;
  --color-nav-border:      #374151;
  --color-nav-icon:        #9ca3af;
  --color-nav-active:      #374151;
  --color-nav-icon-active: #60a5fa;
  --color-input-bg:        #374151;
}

html.warm {
  --color-bg:              #2a1f14;
  --color-surface:         #362a1a;
  --color-surface-2:       #42321f;
  --color-border:          #5a4025;
  --color-text:            #f5e6d0;
  --color-text-muted:      #b89a6a;
  --color-nav:             #251a0f;
  --color-nav-border:      #5a4025;
  --color-nav-icon:        #b89a6a;
  --color-nav-active:      #4a3520;
  --color-nav-icon-active: #f59e0b;
  --color-input-bg:        #42321f;
}

/* ============================================================
   2. SEMANTIC UTILITIES
   ============================================================ */

.bg-theme      { background-color: var(--color-bg); }
.bg-surface    { background-color: var(--color-surface); }
.bg-surface-2  { background-color: var(--color-surface-2); }
.bg-nav        { background-color: var(--color-nav); }
.bg-nav-active { background-color: var(--color-nav-active); }
.bg-input      { background-color: var(--color-input-bg); }

.border-theme       { border-color: var(--color-border); }
.border-nav         { border-color: var(--color-nav-border); }
.border-theme-input { border-color: var(--color-border); }

.text-theme       { color: var(--color-text); }
.text-theme-muted { color: var(--color-text-muted); }
.text-nav-icon    { color: var(--color-nav-icon); }
.text-nav-active  { color: var(--color-nav-icon-active); }

/* ============================================================
   3. LAYOUT
   ============================================================ */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Hide sidebar before JS runs on mobile — prevents flash on load */
@media (max-width: 639px) {
  #side-nav:not(.nav-open)            { transform: translateX(-100%); }
  #side-nav.nav-right:not(.nav-open)  { transform: translateX(100%); }
  .main-content { padding-top: env(safe-area-inset-top); overflow-x: hidden;}
  table td {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
}

/* Mobile: safe-area top padding for notched devices */
@media (max-width: 639px) {
  .main-content {
    padding-top: env(safe-area-inset-top);
  }
}

/* Desktop: push main content past the sidebar */
@media (min-width: 639px) {
  #side-nav:not(.nav-right) ~ .main-content { margin-left: var(--sidebar-width); }
  #side-nav.nav-right ~ .main-content       { margin-left: 0; margin-right: var(--sidebar-width); }
}

/* ============================================================
   4. SIDE NAV — Structure
   ============================================================ */

#side-nav {
  width: var(--sidebar-width);
  min-height: 100vh;
  background-color: var(--color-nav);
  border-right: 1px solid var(--color-nav-border);
  padding-top: max(0px, calc(env(safe-area-inset-top) + 10px));
  padding-bottom: max(0px, calc(env(safe-area-inset-bottom) + 10px));
}

#side-nav.nav-right {
  left: auto !important;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--color-nav-border);
}

/* Links */
.side-nav-link-active   { background-color: var(--color-nav-active); color: var(--color-nav-icon-active); }
.side-nav-link-inactive { color: var(--color-nav-icon); }
.side-nav-link-inactive:hover { background-color: var(--color-nav-active); color: var(--color-text); }

.side-nav-link, .side-nav-btn { width: 100%; height: 3.25rem; flex-direction: column; gap: 1px; padding: 0 0.5rem; }
.side-nav-link i, .side-nav-btn i { font-size: 1.5rem; line-height: 1; }

.theme-option i { font-size: 1.0rem; }
.nav-version    { font-size: 0.8rem; }
.nav-pull-tab i, .nav-pull-tab span { font-size: 2.0rem; line-height: 1; }

/* Desktop: disable slide animation */
@media (min-width: 639px) {
  body:not(.nav-mobile) #side-nav    { transform: none !important; transition: none !important; }
  body:not(.nav-mobile) .nav-pull-tab { display: none; }
}

/* Mobile / PWA — larger touch targets */
@media (display-mode: standalone), (max-width: 639px) {
  #side-nav { width: auto; min-width: var(--sidebar-width); }
  .user-avatar { font-size: 1.5rem; }
  .btn-label   { display: none; }
}

/* ============================================================
   5. SIDE NAV — Tooltips & Popups
   ============================================================ */

/* Shared base */
.side-nav-tooltip, .user-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  right: auto;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border-radius: 9px;
}

/* Arrow pointing left → sidebar (default) */
.side-nav-tooltip::before, .user-tooltip::before {
  content: '';
  position: absolute;
  right: 100%; left: auto;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
}

/* nav-right: flip popups to the left */
#side-nav.nav-right .side-nav-tooltip,
#side-nav.nav-right .user-tooltip { left: auto; right: calc(100% + 10px); }

#side-nav.nav-right .side-nav-tooltip::before,
#side-nav.nav-right .user-tooltip::before { right: auto; left: 100%; border-right-color: transparent !important; }

/* Label tooltip */
.side-nav-tooltip {
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: #f9fafb;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.side-nav-tooltip::before                       { border-right-color: #111827; }
#side-nav.nav-right .side-nav-tooltip::before   { border-left-color: #111827; }

body:not(.nav-mobile) .side-nav-link:hover .side-nav-tooltip,
body:not(.nav-mobile) .side-nav-btn:hover .side-nav-tooltip,
body:not(.nav-mobile) .user-avatar-wrap:hover .side-nav-tooltip { opacity: 1; }


.theme-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}

.theme-option:hover         { background: var(--color-surface-2); color: var(--color-text); }
.theme-option--active       { color: var(--color-nav-icon-active) !important; font-weight: 600; }

[data-dark-mode-target="optChaos"].theme-option--active i {
  animation: spin-wobble 1.2s ease-in-out infinite alternate;
}

@keyframes spin-wobble {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.user-avatar-wrap { position: relative; cursor: pointer}

.user-tooltip {
  bottom: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  white-space: nowrap;
  padding: 10px 12px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  cursor: default;
  gap: 0;
}

.user-tooltip::before {
  top: auto; transform: none;
  bottom: 0.6rem;
  border-right-color: var(--color-surface);
}

#side-nav.nav-right .user-tooltip::before { border-right-color: transparent; border-left-color: var(--color-surface); }

.user-avatar-wrap.tooltip-open .user-tooltip { opacity: 1; pointer-events: auto; }

/* Row 1: sign-out + email */
.user-tooltip-top {
  display: flex; 
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
}

.user-tooltip-signout {
  display: inline-flex;  
  flex-shrink: 0;
  color: #f87171;
  transition: color 0.1s;
  line-height: 1;
}
.user-tooltip-signout:hover { color: #fca5a5; }
.user-tooltip-signout i { font-size: 1.3rem; line-height: 1; }

.user-tooltip-email {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Row 2: theme picker + version */
.user-tooltip-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.user-tooltip-themes {
  display: flex;
  gap: 2px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  padding: 2px;
}

/* Compact theme buttons inside user menu */
.user-theme-btn {
  width: 2rem !important;
  height: 2rem !important;
  padding: 0.3rem !important;
  border-radius: 6px;
  justify-content: center;
}
.user-theme-btn i { font-size: 1.05rem !important; }

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Nav text labels — always visible below icon ── */
.nav-mobile-badge {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
  pointer-events: none;
  margin-top: 2px;
}

/* ============================================================
   6. SIDE NAV — Mobile / Hamburger
   ============================================================ */

body.nav-mobile #side-nav {
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  top: 0; bottom: 0;
  min-height: 100dvh;
}

body.nav-mobile #side-nav.nav-right               { transform: translateX(100%); }
body.nav-mobile #side-nav.nav-open,
body.nav-mobile #side-nav.nav-right.nav-open      { transform: translateX(0); }
body.nav-mobile .main-content                      { margin-left: 0 !important; margin-right: 0 !important; }

/* Pull tab */
body.nav-mobile .nav-pull-tab {
  display: block !important;
  position: fixed;
  left: 0; right: auto;
  bottom: 1.5rem;
  z-index: 39;
  height: 3.2rem;
  background-color: var(--color-nav);
  border: 1px solid var(--color-nav-border);
  border-left: none;
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.5rem;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
  animation: pulse-tab 1s ease-in-out 0.5s 2;
}

body.nav-mobile .nav-pull-tab.nav-tab-right {
  left: auto !important; right: 0;
  border-left: 1px solid var(--color-nav-border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  animation: pulse-tab-right 1s ease-in-out 0.5s 2;
}

body.nav-mobile #side-nav.nav-open ~ .nav-pull-tab { opacity: 0; pointer-events: none; }

@keyframes pulse-tab       { 0%, 100% { transform: translateX(0); }  50% { transform: translateX(6px); } }
@keyframes pulse-tab-right { 0%, 100% { transform: translateX(0); }  50% { transform: translateX(-6px); } }

/* ── FAB + pull-tab group ── */

.nav-pull-tab-group {
  display: none;
  position: fixed;
  left: 0;
  bottom: 1.5rem;
  z-index: 39;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.nav-pull-tab-group.nav-tab-right { left: auto; right: 0; }
body.nav-mobile .nav-pull-tab-group { display: flex; }
body.nav-mobile #side-nav.nav-open ~ #nav-pull-tab-group { opacity: 0; pointer-events: none; transition: opacity 0.15s; }

/* Pull tab inside group — un-fix it, group is the fixed container */
.nav-pull-tab-group .nav-pull-tab {
  position: static !important;
  bottom: auto !important; left: auto !important; right: auto !important;
  display: flex !important;
  animation: none !important;
  border-radius: 0 6px 6px 0;
  border-left: none;
  border-right: 1px solid var(--color-nav-border);
}

.nav-pull-tab-group.nav-tab-right .nav-pull-tab {
  border-radius: 6px 0 0 6px;
  border-left: 1px solid var(--color-nav-border);
  border-right: none;
}

#avatar-new-idea-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: none;
}

#avatar-new-idea-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ============================================================
   7. COMPONENTS
   ============================================================ */

/* Folder list */
.folder-list { max-height: 14rem; overflow-y: auto; }

@media (max-width: 639px) {
  .folder-list { max-height: 7rem; }
}

/* ── Pagination ── */

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.pagination a,
.pagination span {
  color: var(--color-text-muted);
  @apply px-3 py-1 rounded-lg text-sm transition;
  padding: .25rem .45rem;
}

.pagination a:hover {
  background-color: var(--color-surface-2);
}

.pagination .current  { @apply px-3 py-1 rounded-lg text-sm bg-blue-600 text-white font-medium; }
.pagination .disabled { @apply px-3 py-1 rounded-lg text-sm cursor-default opacity-40; }

/* Mobile: hide text labels, show only symbols */
@media (max-width: 639px) {
  .pagination .first a::after    { content: "«"; }
  .pagination .last a::after     { content: "»"; }
  .pagination .prev a::after     { content: "‹"; }
  .pagination .next a::after     { content: "›"; }

  .pagination .first a,
  .pagination .last a,
  .pagination .prev a,
  .pagination .next a {
    font-size: 0;      /* hides original text */
  }

  .pagination .first a::after,
  .pagination .last a::after,
  .pagination .prev a::after,
  .pagination .next a::after {
    font-size: 0.875rem;
  }

  .pagination .first.disabled span,
  .pagination .last.disabled span,
  .pagination .prev.disabled span,
  .pagination .next.disabled span {
    font-size: 0;
  }

  .pagination .first.disabled span::after { content: "«"; font-size: 0.875rem; }
  .pagination .last.disabled span::after  { content: "»"; font-size: 0.875rem; }
  .pagination .prev.disabled span::after  { content: "‹"; font-size: 0.875rem; }
  .pagination .next.disabled span::after  { content: "›"; font-size: 0.875rem; }
}


/* Trix editor */
trix-toolbar {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  @apply sticky top-0 z-20;
}

trix-toolbar [data-trix-button] { @apply px-2 py-1; }
trix-editor { color: var(--color-text); }

.script-editor trix-toolbar      { left: 10rem; }
.avatar-section-body trix-toolbar { display: none !important; }
.avatar-section-body trix-editor  { @apply pt-0; min-height: 150px; }
.video-idea-form trix-editor      { padding-top: 0 !important; }

/* Focus / input — no browser box-shadow anywhere */
*:focus, *:focus-visible, *:focus-within { outline: none !important; box-shadow: none !important; }
input:focus, textarea:focus, select:focus { border-color: var(--color-nav-icon-active) !important; }

/* ============================================================
   8. TOASTS
   ============================================================ */

#toast-container {
  position: fixed;
  top: 20px;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  transition: opacity 0.15s;
  cursor: pointer;
}

body.nav-right #toast-container { left: calc((100vw - var(--sidebar-width)) / 2); }

.toast-item {
  width: max-content;
  max-width: 75vw;
  min-width: 40px;
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  pointer-events: auto;  
  backdrop-filter: blur(8px);
  animation: toast-in 0.35s ease-out forwards;
}

.toast-item .flex.items-center { padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.toast-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-item p   { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; overflow: visible; }

.toast-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background-color: currentColor;
  animation: toast-shrink var(--toast-duration, 3000ms) linear forwards;
}

.toast-item:hover .toast-bar   { animation-play-state: paused; }
.toast-icon-success, .border-green-600\/50 .toast-bar { color: #22c55e; }
.toast-icon-error,   .border-red-600\/50 .toast-bar   { color: #ef4444; }

@keyframes toast-in     { from { opacity: 0; transform: translateY(-12px) scale(0.97); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toast-out    { to   { opacity: 0; transform: translateY(-8px) scale(0.95); } }
@keyframes toast-shrink { from { width: 100%; } to { width: 0; } }

.toast-dismissing { animation: toast-out 0.3s ease forwards; }

/* Chaos dismiss modes */
.toast-chaos-dissolve  { animation: toast-chaos-dissolve  400ms ease forwards !important; }
.toast-chaos-evaporate { animation: toast-chaos-evaporate 700ms ease forwards !important; }
.toast-chaos-explode   { animation: toast-chaos-explode   450ms ease forwards !important; }
.toast-chaos-implode   { animation: toast-chaos-implode   350ms ease forwards !important; }
.toast-chaos-glitch    { animation: toast-chaos-glitch    500ms ease forwards !important; }
.toast-chaos-shatter   { animation: toast-chaos-shatter   500ms ease forwards !important; }
.toast-chaos-drain     { animation: toast-chaos-drain     600ms ease forwards !important; }

@keyframes toast-chaos-dissolve  { to { opacity: 0; filter: blur(8px); transform: scale(1.05); } }
@keyframes toast-chaos-evaporate { 0% { opacity: 1; transform: translateY(0) scaleY(1); filter: blur(0); } 60% { opacity: 0.4; transform: translateY(-30px) scaleY(0.6); filter: blur(3px); } 100% { opacity: 0; transform: translateY(-60px) scaleY(0); filter: blur(8px); } }
@keyframes toast-chaos-explode   { 0% { opacity: 1; transform: scale(1); filter: blur(0); } 40% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(2.5); filter: blur(6px); } }
@keyframes toast-chaos-implode   { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0); filter: blur(4px); } }
@keyframes toast-chaos-glitch    { 0% { opacity: 1; transform: translateX(0) skewX(0deg); clip-path: inset(0 0 0 0); } 20% { transform: translateX(-6px) skewX(-4deg); clip-path: inset(20% 0 30% 0); } 40% { transform: translateX(6px) skewX(4deg); clip-path: inset(60% 0 5% 0); } 60% { transform: translateX(-4px) skewX(-2deg); clip-path: inset(10% 0 70% 0); } 80% { transform: translateX(0); clip-path: inset(40% 0 20% 0); opacity: 0.3; } 100% { opacity: 0; transform: translateX(20px); clip-path: inset(50% 0 50% 0); } }
@keyframes toast-chaos-shatter   { 0% { opacity: 1; transform: scale(1) rotate(0deg); } 30% { transform: scale(1.08) rotate(1deg); } 60% { transform: scale(0.95) rotate(-2deg) skew(3deg, 1deg); filter: blur(1px); } 100% { opacity: 0; transform: scale(0.7) rotate(-8deg) skew(10deg, 5deg); filter: blur(5px); } }
@keyframes toast-chaos-drain     { 0% { opacity: 1; transform: scaleY(1) translateY(0); filter: saturate(1); } 50% { opacity: 0.6; transform: scaleY(0.6) translateY(10px); filter: saturate(0); } 100% { opacity: 0; transform: scaleY(0) translateY(20px); filter: saturate(0) blur(4px); } }

/* ============================================================
   9. AVATAR SPLIT SCREEN
   ============================================================ */

.avatar-split-panel {
  position: fixed;
  top: 0; bottom: 0; right: 0;
  left: var(--sidebar-width, 0);
  z-index: 40;
  background-color: rgba(0, 0, 0, 0.85);
  animation: fadeIn 0.15s ease;
}

body:has(#side-nav.nav-right) .avatar-split-panel:not(.avatar-split-mobile) {
  left: 0;
  right: var(--sidebar-width, 0);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.avatar-split-container { display: flex; height: 100vh; overflow: hidden; }

.avatar-split-left {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: scroll;
  background-color: var(--color-surface);
  padding: 2rem;
}

.avatar-split-handle { width: 6px; flex-shrink: 0; height: 100%; background-color: var(--color-border); }

.avatar-split-right {
  flex: 0 0 680px;
  width: 680px;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  background-color: var(--color-bg);
  padding: 1.5rem 2rem;
  border-left: 1px solid var(--color-border);
  box-sizing: border-box;
}

/* Avatar section icons */
.avatar-section-remove-icon { font-size: 0.9rem; }
.avatar-section-add-icon    { font-size: 1rem; }

/* Mobile: bottom-sheet */
@media (max-width: 639px) {
  .avatar-split-panel.avatar-split-mobile {
    top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    height: 100dvh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background-color: var(--color-bg);
    will-change: transform;
  }

  .avatar-split-panel.avatar-split-mobile .avatar-split-container { flex-direction: column; height: 100%; }

  .avatar-split-panel.avatar-split-mobile .avatar-split-left {
    flex: 1 1 0% !important; width: 100% !important; height: auto !important; min-height: 0 !important;
    overflow-y: auto; border-right: none; border-bottom: 1px solid var(--color-border);
    padding: 1rem; box-sizing: border-box;
  }

  .avatar-split-panel.avatar-split-mobile .avatar-split-handle {
    flex-shrink: 0 !important; width: 100% !important; height: 4px;
    background-color: var(--color-nav-icon);
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
  }

  .avatar-split-panel.avatar-split-mobile .avatar-split-right {
    flex: 0 0 auto !important; width: 100% !important; height: auto !important;
    overflow-y: visible !important; overflow-x: hidden;
    padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    border-left: none; box-sizing: border-box;
  }

  /* Use FAB on mobile instead */
  [data-action*="avatar-idea-split#open"] { display: none !important; }
}

/* ============================================================
   AVATAR-SPARK SPLIT — always vertical 80/20 (mobile + desktop)
   ============================================================ */

/* Panel: fixed fullscreen, always column layout */
.avatar-spark-panel {
  position: fixed;
  top: 0; bottom: 0;
  /* left/right set dynamically by JS to account for sidebar */
  z-index: 40;
  background-color: var(--color-bg);
}

.avatar-spark-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Top pane — 80% */
.avatar-spark-left {
  flex: 4 4 0%;
  overflow-y: auto;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem;
  box-sizing: border-box;
}

/* Drag handle */
.avatar-spark-handle {
  flex-shrink: 0;
  width: 100%;
  height: 4px;
  background-color: var(--color-nav-icon);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Bottom pane — 20% */
.avatar-spark-right {
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* Hide inline New Spark button on mobile — use FAB instead */
@media (max-width: 639px) {
  [data-action*="avatar-spark-split#open"] { display: none !important; }
}

/* Spark FAB — sits above the idea FAB in the pull-tab group */
#avatar-new-spark-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: none;
}

#avatar-new-spark-fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ============================================================
   10. spark ITEM
   ============================================================ */

/* Hide ctrl+Enter tip on mobile */
body.nav-mobile .ctrl-enter-tip {
  display: none;
}

/* Hide preview when expanded */
[data-controller~="spark-item"]:has([data-spark-item-target="expanded"]:not(.hidden)) .spark-preview { display: none; }

/* Tint toggle row when expanded */
[data-controller~="spark-item"]:has([data-spark-item-target="expanded"]:not(.hidden)) .spark-toggle-row { background-color: var(--color-surface-2); }

/* Swap short date → long datetime when expanded */
[data-controller~="spark-item"]:has([data-spark-item-target="expanded"]:not(.hidden)) .spark-date-short { display: none; }
[data-controller~="spark-item"]:has([data-spark-item-target="expanded"]:not(.hidden)) .spark-date-long  { display: inline; }
@import url('https://rsms.me/inter/inter.css');
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Firefox fix for login fields * /

input:-moz-autofill,
input:-moz-autofill:focus {
  box-shadow: 0 0 0 1000px var(--color-input-bg) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px var(--color-input-bg) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
}
