:root {
  --ui-font: "Segoe UI", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --studio-header-bg: #333333;
  --studio-options-bg: #2d2d2d;
  --studio-toolbar-bg: #3c3c3c;
  --studio-panel-bg: #3c3c3c;
  --studio-workspace-bg: #606060;
  --studio-chassis-bg: #535353;
  --studio-border-dark: #1a1a1a;
  --studio-border-med: #2a2a2a;
  --studio-border-light: #505050;
  --studio-text: #cccccc;
  --studio-text-muted: #888888;
  
  /* Visteras Collage Brand Color */
  --collage-purple: #a855f7;
  --collage-purple-light: #c084fc;
  --collage-purple-dark: #9333ea;
  --collage-purple-bg: rgba(168, 85, 247, 0.18);
  /* @visteras/ui accent hook + token overrides (packages/ui never hardcodes an accent) */
  --visteras-accent: var(--collage-purple);
  --visteras-accent-hover: var(--collage-purple-light);
  --visteras-on-accent: #ffffff;
  --vui-tab-font-size: 11px;
  --vui-new-tab-font-size: 15px;
  
  --page-width: 8.5in;
  --page-height: 11in;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px !important;
}

@media screen {
  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--studio-chassis-bg);
    color: var(--studio-text);
    color-scheme: dark;
    overflow: hidden;
    font-family: var(--ui-font);
  }

  #visteras_app_container {
    display: grid;
    grid-template:
      "menu menu menu" 28px
      "options options options" 45px
      "tools workarea panels" 1fr
      "status status status" 24px
      / 36px 1fr 310px;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--studio-chassis-bg);
  }
}

#visteras_menu_bar, #tools_top, #tools_left, #sidepanels, #tools_bottom {
  font-family: var(--ui-font);
  font-size: 11px;
}

/* 1. Main Top Menu Bar */
#visteras_menu_bar {
  grid-area: menu;
  display: flex;
  align-items: stretch;
  height: var(--vui-menu-bar-height);
  background: var(--studio-header-bg);
  border-bottom: 1px solid #222222;
  padding: 0 var(--vui-menu-bar-padding-x);
  user-select: none;
  z-index: 3000;
}

.menu_group {
  display: flex;
  align-items: stretch;
}

.menu_entry {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: 100%;
}

.menu_entry_title {
  display: flex;
  align-items: center;
  padding: var(--vui-menu-title-padding);
  font-family: var(--ui-font);
  font-size: var(--vui-menu-font-size);
  font-weight: 400;
  line-height: normal;
  color: #cccccc;
  cursor: pointer;
  border-radius: 0;
  box-sizing: border-box;
  height: 100%;
  transition: background 0.12s, color 0.12s;
}

.menu_entry_title:hover {
  background: #505050;
  color: #ffffff;
}

.menu_entry.open .menu_entry_title {
  background: var(--collage-purple);
  color: #ffffff;
}

.menu_dropdown_list {
  display: none;
  position: absolute;
  top: var(--vui-menu-bar-height);
  left: 0;
  min-width: 190px;
  background: #3c3c3c;
  border: 1px solid #505050;
  padding: var(--vui-menu-dropdown-padding);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 3001;
}

.menu_entry.open > .menu_dropdown_list {
  display: block;
}

.menu_dropdown_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--vui-menu-item-padding);
  color: #cccccc;
  font-size: var(--vui-menu-font-size);
  line-height: var(--vui-menu-item-line-height);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
}

.menu_dropdown_item:hover:not(.disabled) {
  background: var(--collage-purple);
  color: #ffffff;
}

.menu_dropdown_item.disabled {
  color: #666666;
  cursor: default;
}

.menu_dropdown_separator {
  height: 0;
  border: none;
  border-top: 1px solid #505050;
  margin: var(--vui-menu-separator-margin);
}

.menu_dropdown_shortcut {
  font-size: var(--vui-menu-shortcut-font-size);
  color: #888888;
  margin-left: var(--vui-menu-shortcut-gap);
}

.menu_dropdown_item:hover:not(.disabled) .menu_dropdown_shortcut {
  color: #ffffff;
}

.menu_right_controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visteras_switch_btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #242424;
  border: 1px solid #383838;
  border-radius: 2px;
  color: #aaaaaa;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.visteras_switch_btn:hover {
  background: #333333;
  border-color: #555555;
  color: #ffffff;
}

/* 2. Top Options Bar */
#tools_top {
  grid-area: options;
  display: flex;
  align-items: center;
  height: 45px;
  background-color: var(--studio-options-bg);
  border-bottom: 1px solid var(--studio-border-dark);
  padding: 0 12px 0 0;
  user-select: none;
  z-index: 500;
}

.visteras_collage_logo_wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 4px;
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 1px;
  cursor: pointer;
  flex-shrink: 0;
}

.visteras_collage_logo_wrap img {
  height: 28px;
  width: auto;
  vertical-align: middle;
  flex-shrink: 0;
}

.visteras_collage_logo_wrap.logo-omarchy-active img,
.visteras_collage_logo_wrap img.logo-omarchy-active {
  filter: brightness(0) saturate(100%) invert(44%) sepia(85%) saturate(2975%) hue-rotate(248deg) brightness(101%) contrast(95%) !important;
}

.visteras_collage_logo_wrap .logo_text {
  font-size: 14px;
  color: #ffffff;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.visteras_collage_logo_wrap .logo_bold {
  font-weight: 700;
}

.visteras_collage_logo_wrap .logo_light {
  font-weight: 100;
  opacity: 0.7;
}

.visteras_top_divider {
  width: 1px;
  height: 22px;
  background: #3c3c3c;
  margin: 0 8px;
  flex-shrink: 0;
}

/* Print Button styled like Publish: Purple accent */
.btn_visteras_purple {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--collage-purple);
  border: 1px solid var(--collage-purple-light);
  border-radius: 2px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn_visteras_purple:hover {
  background: var(--collage-purple-light);
  color: #ffffff;
}

.btn_visteras_secondary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #333333;
  border: 1px solid #444444;
  border-radius: 2px;
  color: #cccccc;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn_visteras_secondary:hover {
  background: #444444;
  border-color: #666666;
  color: #ffffff;
}

.options_actions_right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 3. Left Toolbar */
#tools_left {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 36px;
  height: 100%;
  background-color: var(--studio-toolbar-bg);
  border-right: 1px solid var(--studio-border-dark);
  padding: 6px 0;
  user-select: none;
  z-index: 100;
}

.tool_btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #cccccc;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.tool_btn:hover {
  background-color: #505050;
  color: #ffffff;
}

.tool_btn.active {
  background-color: #242424;
  border: 1px solid #1a1a1a;
  border-left: 2px solid var(--collage-purple);
  color: #ffffff;
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.6);
}

.tool_btn svg {
  display: block;
  pointer-events: none;
}

.tool_btn.active svg {
  stroke: var(--collage-purple-light) !important;
}

/* 4. Middle Workspace & Scalable Viewport */
#workarea {
  grid-area: workarea;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--studio-workspace-bg);
  padding: 0;
  overflow: hidden;
  position: relative;
  border: none;
  user-select: none;
}

/* Document tabs bar */
.document_tabs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vui-tab-bar-height);
  background-color: #242424;
  border-bottom: 1px solid #181818;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 1000;
  user-select: none;
  cursor: default !important;
}

.document_tabs * {
  cursor: default !important;
}

.document_tabs::-webkit-scrollbar {
  height: 3px;
}

.document_tabs::-webkit-scrollbar-thumb {
  background: #444444;
}

.document_tab {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--vui-tab-padding-x);
  height: 100%;
  font-size: var(--vui-tab-font-size);
  color: #999999;
  background-color: #202020;
  border-right: 1px solid #1a1a1a;
  border-top: var(--vui-tab-accent-width) solid transparent;
  cursor: pointer !important;
  white-space: nowrap;
  max-width: var(--vui-tab-max-width);
  min-width: var(--vui-tab-min-width);
  box-sizing: border-box;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.document_tab * {
  cursor: pointer !important;
}

.document_tab:hover:not(.active) {
  background-color: #2c2c2c;
  color: #cccccc;
}

.document_tab.active {
  background-color: #383838;
  color: #ffffff;
  border-top: var(--vui-tab-accent-width) solid var(--visteras-accent);
}

.document_tab .tab_title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
  margin-right: var(--vui-tab-title-gap);
}

.document_tab .tab_zoom {
  font-size: var(--vui-tab-zoom-font-size);
  color: #777777;
  margin-right: 6px;
  flex-shrink: 0;
}

.document_tab.active .tab_zoom {
  color: #aaaaaa;
}

.document_tab .tab_dirty {
  color: var(--collage-purple, #a855f7);
  font-weight: bold;
  margin-left: 2px;
}

.document_tab .tab_close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--vui-tab-close-size);
  height: var(--vui-tab-close-size);
  border-radius: 50%;
  font-size: var(--vui-tab-close-font-size);
  color: #888888;
  flex-shrink: 0;
  cursor: pointer !important;
  transition: background-color 0.15s, color 0.15s;
}

.document_tab .tab_close:hover {
  background-color: #555555;
  color: #ffffff;
}

.document_tabs .new_tab_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--vui-new-tab-size);
  height: var(--vui-new-tab-size);
  padding: 0;
  border: 0;
  background: transparent;
  color: #888888;
  font-size: var(--vui-new-tab-font-size);
  line-height: 1;
  cursor: pointer !important;
  flex-shrink: 0;
  transition: background-color 0.15s, color 0.15s;
}

.document_tabs .new_tab_btn:hover {
  background-color: #2c2c2c;
  color: #ffffff;
}

.canvas_viewport {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  will-change: transform;
}

.letter-page {
  position: relative;
  width: 8.5in;
  min-width: 8.5in;
  max-width: 8.5in;
  height: 11in;
  min-height: 11in;
  max-height: 11in;
  background-color: #ffffff;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  box-sizing: border-box;
  font-family: var(--ui-font);
}

.collage-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 0;
  padding: 0;
  background-color: #ffffff;
  grid-auto-flow: dense;
  z-index: 50;
}

.collage-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.collage-item.is-panning,
.collage-item:active {
  cursor: grabbing;
}

.tile-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tile-spinner.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner-svg {
  animation: visteras-spin 0.85s linear infinite;
}

@keyframes visteras-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.collage-item img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease-out;
  user-select: none;
}

.collage-item img.loaded {
  opacity: 1;
}

.image-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 200;
  cursor: default;
}

.collage-item:hover .image-controls,
.collage-item:focus-within .image-controls {
  opacity: 1;
}

.tile-icon-btn {
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.tile-icon-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-icon-btn:hover {
  background: var(--collage-purple);
  border-color: var(--collage-purple-light);
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
}

/* Tile Zoom Slider Popover */
.tile-zoom-popover {
  position: absolute;
  bottom: calc(50% + 28px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 18, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 220px;
  max-width: 90%;
  pointer-events: auto;
  user-select: none;
  cursor: default;
}

.tile-zoom-popover.hidden {
  display: none !important;
}

.tile-zoom-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #999999;
}

.tile-zoom-val {
  color: #ffffff;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 500;
}

.tile-zoom-slider {
  width: 100%;
  accent-color: var(--collage-purple-light);
  height: 4px;
  cursor: pointer;
  margin: 2px 0 0;
}

/* Layer Overlays */
#texture-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  z-index: 105;
  display: none;
}

#paint-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 120;
  display: none;
}

/* Text Overlay */
.text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 110;
  padding: 4px 8px;
  border: 2px dashed transparent;
  font-weight: bold;
  color: #212529;
  cursor: grab;
  touch-action: none;
  transition: border-color 0.2s ease;
  white-space: nowrap;
  display: none;
  line-height: 1;
  user-select: none;
}

.text-overlay:hover, .text-overlay.active {
  border-color: var(--collage-purple);
  background: rgba(168, 85, 247, 0.1);
}

/* Empty State Initial Screen */
.generate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1e1e1e;
  font-family: var(--ui-font);
  z-index: 300;
  gap: 14px;
  border-radius: 2px;
  box-sizing: border-box;
  padding: 32px;
}

.generate-hero-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.generate-overlay h3,
.generate-overlay p,
.generate-overlay button {
  font-family: var(--ui-font);
}

.generate-overlay.hidden {
  display: none;
}

/* 5. Right Sidepanels */
#sidepanels {
  grid-area: panels;
  display: flex;
  flex-direction: column;
  width: 310px;
  height: 100%;
  background-color: var(--studio-panel-bg);
  border-left: 1px solid var(--studio-border-dark);
  overflow: hidden auto;
  user-select: none;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: #4f4f4f #282828;
}

#sidepanels::-webkit-scrollbar {
  width: 8px;
}
#sidepanels::-webkit-scrollbar-track {
  background: #282828;
}
#sidepanels::-webkit-scrollbar-thumb {
  background-color: #4a4a4a;
  border-radius: 4px;
  border: 2px solid #282828;
}

.sidepanel_pane {
  display: none;
  flex-direction: column;
  width: 100%;
}

.sidepanel_pane.active {
  display: flex;
}

.panel_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background-color: #333333;
  border-bottom: 1px solid #222222;
  font-size: 11px;
  font-weight: 700;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.panel_header .panel_badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--collage-purple-bg);
  color: var(--collage-purple-light);
  border: 1px solid var(--collage-purple);
  border-radius: 2px;
}

.panel_section {
  border-bottom: 1px solid #282828;
}

.panel_section_header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background-color: #282828;
  border-top: 1px solid #202020;
  font-size: 11px;
  font-weight: 600;
  color: #aaaaaa;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.panel_section_header:hover {
  background-color: #303030;
  color: #ffffff;
}

.panel_section_arrow {
  display: inline-block;
  font-size: 8px;
  color: #777777;
  transition: transform 0.15s;
  width: 10px;
}

.panel_section.collapsed .panel_section_arrow {
  transform: rotate(-90deg);
}

.panel_section_body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  background-color: #2b2b2b;
}

.panel_section.collapsed .panel_section_body {
  display: none;
}

.panel_field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.panel_label {
  font-size: 10px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.panel_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.panel_input, .panel_select {
  width: 100%;
  padding: 4px 6px;
  background: #242424;
  border: 1px solid #444444;
  border-radius: 2px;
  color: #cccccc;
  font-family: var(--ui-font);
  font-size: 11px;
  outline: none;
}

.panel_input:focus, .panel_select:focus {
  border-color: var(--collage-purple);
}

.panel_range {
  width: 100%;
  accent-color: var(--collage-purple);
}

.panel_checkbox_row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #cccccc;
  cursor: pointer;
  padding: 2px 0;
}

.panel_checkbox_row input[type="checkbox"], .panel_checkbox_row input[type="radio"] {
  accent-color: var(--collage-purple);
  cursor: pointer;
}

.panel_btn_full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 12px;
  border-radius: 2px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

/* Tag filter badges */
.tag-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  background: #222222;
  border: 1px solid #444444;
  border-radius: 2px;
  font-size: 10px;
  color: #aaaaaa;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.tag-badge:hover {
  background: #333333;
  color: #ffffff;
}

.tag-badge.active {
  background: var(--collage-purple);
  border-color: var(--collage-purple-light);
  color: #ffffff;
}

/* Layout cards in panel */
.layout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #242424;
  border: 1px solid #383838;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.12s;
}

.layout-card:hover {
  border-color: var(--collage-purple);
  background: #2d2d2d;
}

.layout-card.active {
  border-color: var(--collage-purple);
  background: var(--collage-purple-bg);
  color: #ffffff;
}

/* Saved Collage Items with Thumbnails */
.saved-collage-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: #242424;
  border: 1px solid #383838;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 6px;
}

.saved-collage-card:hover {
  border-color: var(--collage-purple);
  background: #2a2a2a;
}

.saved-collage-thumb-wrapper {
  width: 44px;
  height: 57px;
  flex-shrink: 0;
  background: #141414;
  border: 1px solid #333333;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.saved-collage-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.saved-collage-no-thumb {
  font-size: 8px;
  color: #666666;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 500;
}

.saved-collage-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.saved-collage-title {
  font-size: 12px;
  font-weight: 600;
  color: #eeeeee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-collage-meta {
  font-size: 10px;
  color: #888888;
  display: flex;
  gap: 6px;
}

.saved-collage-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Multi-select color chips */
.color-chip-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.color-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: #242424;
  border: 1px solid #3c3c3c;
  border-radius: 2px;
  font-size: 10px;
  color: #aaaaaa;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.color-chip:hover {
  background: #2e2e2e;
  border-color: #555555;
  color: #ffffff;
}

.color-chip.active {
  border-color: var(--collage-purple);
  background: rgba(168, 85, 247, 0.2);
  color: #ffffff;
}

.color-chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #242424;
  border: 1px solid #383838;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.preset-card:hover {
  background: #2c2c2c;
  border-color: var(--collage-purple);
}

.preset-card.active {
  background: var(--collage-purple-bg);
  border-color: var(--collage-purple);
  color: #ffffff;
}

.pixabay-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: #777777;
}

.pixabay-source-badge a {
  color: #888888;
  text-decoration: none;
}
.pixabay-source-badge a:hover {
  color: var(--collage-purple-light);
  text-decoration: underline;
}

/* 6. Status Bar */
#tools_bottom {
  grid-area: status;
  display: flex;
  align-items: center;
  height: 24px;
  background-color: var(--studio-header-bg);
  border-top: 1px solid var(--studio-border-dark);
  padding: 0 10px;
  font-size: 11px;
  color: #cccccc;
  user-select: none;
  z-index: 100;
}

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

.status_tag {
  color: #888888;
}

.status_tag_val,
.status_tag_purple,
#status-layout-text,
#status-bar-text {
  color: #cccccc;
  font-weight: 500;
}

.status_zoom_badge {
  background: #242424;
  border: 1px solid #3c3c3c;
  border-radius: 2px;
  color: #cccccc;
  font-family: var(--ui-font);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.status_zoom_badge:hover {
  background: #333333;
  color: #ffffff;
  border-color: #555555;
}

.status_info_right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cccccc;
}

/* Print Rules for 8.5x11in letter sheets */
@media print {
  @page {
    size: 8.5in 11in;
    margin: 0;
  }

  html, body {
    background: #ffffff !important;
    width: 8.5in !important;
    height: 11in !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #visteras_app_container {
    display: block !important;
    width: 8.5in !important;
    height: 11in !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  #visteras_menu_bar, #tools_top, #tools_left, #sidepanels, #tools_bottom, .image-controls, .generate-overlay {
    display: none !important;
    visibility: hidden !important;
  }

  #workarea {
    display: block !important;
    background: none !important;
    border: none !important;
    width: 8.5in !important;
    height: 11in !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    position: static !important;
  }

  .canvas_viewport {
    position: static !important;
    transform: none !important;
    display: block !important;
    width: 8.5in !important;
    height: 11in !important;
  }

  .letter-page {
    width: 8.5in !important;
    height: 11in !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  .text-overlay {
    border: none !important;
    background: none !important;
  }
}
