/* ==========================================================================
   Tweet Studio - Modern Aesthetic Social Media Card Generator
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Montserrat:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --primary: #c5f58a;
  --primary-hover: #d7ffa9;
  --primary-glow: rgba(197, 245, 138, 0.28);
  --primary-subtle: rgba(197, 245, 138, 0.14);
  
  --bg-app: #0b1110;
  --bg-sidebar: #101915;
  --bg-card: #14211c;
  --bg-card-hover: #1b2d26;
  --bg-input: #0e1713;
  
  --border-subtle: rgba(211, 235, 217, 0.12);
  --border-medium: rgba(211, 235, 217, 0.22);
  --border-focus: #c5f58a;
  
  --text-primary: #f4f4e9;
  --text-secondary: #a9b5ac;
  --text-muted: #64756a;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Global 3px Sleek Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
  width: 3px !important;
  height: 3px !important;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18) !important;
  border-radius: 9999px !important;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary) !important;
}

::-webkit-scrollbar-corner {
  background: transparent !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Top Header Bar
   ========================================================================== */

.app-header {
  height: 64px;
  background: rgba(15, 20, 31, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #82b545);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1110;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-tag {
  font-size: 0.65rem;
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(29, 155, 240, 0.35);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header Center Switchers */
.header-controls-center {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.control-pill-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-pill-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.segmented-pill-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.pill-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem 0.95rem;
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  white-space: nowrap;
}

.pill-item svg {
  width: 14px;
  height: 14px;
}

.pill-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.pill-item.active {
  background: var(--primary);
  color: #0b1110;
  font-weight: 750;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Header Right Actions */
.header-actions-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #0b1110;
  font-weight: 750;
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #0b1110;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Main Studio Layout
   ========================================================================== */

.app-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left Sidebar (Dedicated Independent Scroll) */
.studio-sidebar {
  width: 420px;
  min-width: 380px;
  max-width: 460px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 1.25rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Polished Sidebar Panels */
.studio-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  transition: var(--transition);
}

.studio-panel:hover {
  border-color: var(--border-medium);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* Form Controls */
.control-row {
  margin-bottom: 0.9rem;
}

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

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.control-label-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.field-label {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  gap: 0.4rem;
}

.field-label i {
  color: var(--primary);
  font-size: 0.85rem;
}

.theme-title-text i {
  margin-right: 4px;
}

.mobile-pill i {
  margin-right: 4px;
}

.field-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
  background: #101c16;
}

.field-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem 0.85rem;
  font-size: 0.92rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
  resize: vertical;
  min-height: 86px;
  line-height: 1.5;
}

.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
  background: #101c16;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

/* Avatar Upload Showcase */
.avatar-showcase {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.avatar-preview-wrapper {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #000000;
}

.avatar-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  color: #ffffff;
}

.avatar-preview-wrapper:hover .avatar-hover-overlay {
  opacity: 1;
}

.avatar-hover-overlay svg {
  width: 22px;
  height: 22px;
}

.avatar-meta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.avatar-meta-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.avatar-btn-row {
  display: flex;
  gap: 0.4rem;
}

/* Verified Badge Switch Banner */
.verified-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: var(--primary-subtle);
  border: 1px solid rgba(197, 245, 138, 0.25);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-top: 0.75rem;
  transition: var(--transition);
}

.verified-status-banner.deactivated {
  background: var(--bg-input);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.verified-left-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.verified-status-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Multi-Tweets Tabs / Cards */
.tweets-tabs-nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
}

.tweet-tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tweet-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.tweet-tab-btn.active {
  background: var(--primary);
  color: #0b1110;
  border-color: var(--primary);
  font-weight: 750;
}

.tweet-editor-box {
  background: rgba(14, 24, 19, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  transition: var(--transition);
}

.tweet-editor-box.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 18px var(--primary-glow);
}

.tweet-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.tweet-tag-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tweet-actions-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tweet-char-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.35rem;
}

/* Theme Option Cards in Sidebar */
.theme-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.theme-card-box {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  background: var(--bg-input);
}

.theme-card-box:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.theme-card-box.active {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.theme-mini-mockup {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-mini-mockup.mock-dark {
  background-color: #000000;
  color: #ffffff;
}

.theme-mini-mockup.mock-light {
  background-color: #ffffff;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.1);
}

.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
}

.mock-line {
  height: 6px;
  border-radius: 3px;
  width: 50px;
}

.mock-dark .mock-line {
  background-color: #ffffff;
}

.mock-light .mock-line {
  background-color: #0f1419;
}

.theme-title-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-card-box.active .theme-title-text {
  color: var(--primary);
}

.theme-hex-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Styled Select Dropdown (Font Family & Options) - Enhanced Obsidian Luxury */
.styled-select-wrap {
  position: relative;
  width: 100%;
}

.styled-select,
.cc-select,
select.cc-dropdown {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-input, rgba(14, 23, 19, 0.95));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c5f58a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  border: 1.5px solid var(--border-subtle, rgba(211, 235, 217, 0.16));
  border-radius: var(--radius-sm, 12px);
  color: var(--text-primary, #f4f4e9);
  padding: 0.62rem 2.4rem 0.62rem 0.85rem;
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.styled-select:hover,
.cc-select:hover,
select.cc-dropdown:hover {
  border-color: rgba(197, 245, 138, 0.5);
  background-color: rgba(18, 30, 24, 0.98);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.styled-select:focus,
.cc-select:focus,
select.cc-dropdown:focus {
  border-color: var(--primary, #c5f58a);
  box-shadow: 0 0 0 3px var(--primary-subtle, rgba(197, 245, 138, 0.2)), 0 8px 24px rgba(0, 0, 0, 0.4);
  background-color: rgba(18, 30, 24, 0.98);
}

.styled-select option,
.cc-select option,
select.cc-dropdown option {
  background: #0d1612;
  color: #f4f4e9;
  padding: 10px 14px;
  font-size: 0.84rem;
}

.styled-select-wrap .select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.72rem;
  color: var(--primary, #c5f58a);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.styled-select-wrap:focus-within .select-arrow {
  color: var(--primary, #c5f58a);
  transform: translateY(-50%) rotate(180deg);
}

/* Universal Custom Dropdown System inside Tweet Generator */
.cc-dropdown-wrap {
  position: relative;
  width: 100%;
  user-select: none;
  box-sizing: border-box;
}

.cc-dropdown-trigger {
  width: 100%;
  min-height: 44px;
  background: rgba(14, 23, 19, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-subtle, rgba(211, 235, 217, 0.16));
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary, #f4f4e9);
  font-family: inherit;
  text-align: left;
  outline: none;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.cc-dropdown-trigger:hover {
  border-color: rgba(197, 245, 138, 0.45);
  background: rgba(18, 30, 24, 0.98);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.cc-dropdown-trigger[aria-expanded="true"],
.cc-dropdown-trigger:focus-visible {
  border-color: var(--primary, #c5f58a);
  background: rgba(18, 30, 24, 0.98);
  box-shadow: 0 0 0 3px rgba(197, 245, 138, 0.2), 0 8px 25px rgba(0, 0, 0, 0.45);
}

.cc-dropdown-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

/* Font Specimen Glyph Box on Trigger (Aa) */
.cc-dropdown-specimen {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(197, 245, 138, 0.12);
  border: 1px solid rgba(197, 245, 138, 0.28);
  color: var(--primary, #c5f58a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 750;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.cc-dropdown-trigger:hover .cc-dropdown-specimen {
  background: rgba(197, 245, 138, 0.2);
  border-color: var(--primary, #c5f58a);
  transform: scale(1.05);
}

.cc-dropdown-selected-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  line-height: 1.25;
  gap: 1px;
}

.cc-dropdown-selected-title,
.cc-dropdown-selected-text {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary, #f4f4e9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cc-dropdown-selected-sub {
  font-size: 11px;
  color: var(--text-muted, #728a7c);
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.cc-dropdown-chevron-icon {
  font-size: 12px;
  color: var(--primary, #c5f58a);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.85;
}

.cc-dropdown-trigger:hover .cc-dropdown-chevron-icon {
  opacity: 1;
}

.cc-dropdown-trigger[aria-expanded="true"] .cc-dropdown-chevron-icon {
  transform: rotate(180deg);
  opacity: 1;
}

.cc-dropdown-menu,
.cc-dropdown-listbox {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 100%;
  background: rgba(12, 20, 16, 0.98);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-subtle, rgba(211, 235, 217, 0.22));
  border-radius: 14px;
  padding: 6px;
  z-index: 9999;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(197, 245, 138, 0.12);
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: ccDropdownDropIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.cc-dropdown-menu[hidden],
.cc-dropdown-listbox[hidden] {
  display: none !important;
}

.cc-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
  user-select: none;
  font-size: 13px;
  font-weight: 550;
  color: #e5ece6;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.cc-dropdown-item:hover,
.cc-dropdown-item.focused {
  background: rgba(197, 245, 138, 0.1);
  color: var(--primary, #c5f58a);
  transform: translateX(2px);
}

.cc-dropdown-item.active {
  background: rgba(197, 245, 138, 0.16);
  color: var(--primary, #c5f58a);
  font-weight: 700;
  border-color: rgba(197, 245, 138, 0.3);
}

.cc-dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  flex: 1;
}

/* Item Specimen Glyph Box (Aa) */
.cc-dropdown-item-specimen {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cad5ce;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.cc-dropdown-item:hover .cc-dropdown-item-specimen,
.cc-dropdown-item.focused .cc-dropdown-item-specimen {
  background: rgba(197, 245, 138, 0.14);
  border-color: rgba(197, 245, 138, 0.3);
  color: var(--primary, #c5f58a);
  transform: scale(1.06);
}

.cc-dropdown-item.active .cc-dropdown-item-specimen {
  background: var(--primary, #c5f58a);
  border-color: var(--primary, #c5f58a);
  color: #0b1110;
  box-shadow: 0 2px 10px rgba(197, 245, 138, 0.35);
}

.cc-dropdown-item-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cc-dropdown-item-title {
  font-size: 13.5px;
  font-weight: 650;
  color: #f4f4e9;
  line-height: 1.3;
}

.cc-dropdown-item.active .cc-dropdown-item-title {
  color: var(--primary, #c5f58a);
  font-weight: 750;
}

.cc-dropdown-item-desc {
  font-size: 11px;
  color: var(--text-muted, #728a7c);
  line-height: 1.25;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-dropdown-item.active .cc-dropdown-item-desc {
  color: rgba(197, 245, 138, 0.75);
}

.cc-dropdown-check-icon {
  font-size: 12px;
  color: var(--primary, #c5f58a);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.cc-dropdown-item.active .cc-dropdown-check-icon {
  opacity: 1;
  transform: scale(1);
}

select.cc-dropdown-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Range Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.styled-range {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-input);
}

.range-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Segmented Buttons */
.segmented-box {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.seg-button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.seg-button.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Toggle Switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
}

.switch-label {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-medium);
  transition: var(--transition);
  border-radius: 24px;
}

.toggle-track:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: var(--transition);
  border-radius: 50%;
}

input:checked + .toggle-track {
  background-color: var(--primary);
}

input:checked + .toggle-track:before {
  transform: translateX(16px);
  background-color: #0b1110;
}

/* ==========================================================================
   Center Preview Canvas
   ========================================================================== */

.studio-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000000 !important;
  position: relative;
  overflow: hidden;
}

/* Canvas Viewport */
.canvas-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem 5rem;
  position: relative;
  background: #000000 !important;
  background-image: none !important;
}

.canvas-stage.gallery-view {
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem 9rem;
  overflow-y: auto;
}

/* Canva-style Vertical Cards Stream */
.cards-gallery-vertical-stream {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.25rem;
  width: 100%;
  margin: 0 auto;
}

.gallery-card-row-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.gallery-card-frame {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
}

.gallery-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0 4px;
}

.gallery-card-page-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.gallery-card-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Floating Bottom Control Dock */
.canvas-bottom-dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 23, 19, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.dock-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
  border-right: 1px solid var(--border-subtle);
}

.dock-nav-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.dock-view-mode {
  display: flex;
  background: rgba(10, 16, 13, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.dock-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.dock-pill:hover {
  color: var(--text-primary);
}

.dock-pill.active {
  background: var(--primary);
  color: #0b1110;
  font-weight: 750;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* ==========================================================================
   THE TWEET CARD (Pixel-perfect aesthetic matching the user's reference)
   ========================================================================== */

.card-outer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Card Element */
.tweet-card {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 16px;
  box-shadow: none !important;
  border: none !important;
}

/* ==========================================
   Aspect Ratio Proportions & Sizing
   ========================================== */

/* 1:1 Square */
.tweet-card.ratio-1-1 {
  aspect-ratio: 1 / 1;
  width: 520px;
  max-width: 82vw;
}

.tweet-card.ratio-1-1 .tweet-inner {
  padding: 56px 48px;
}

.tweet-card.ratio-1-1 .tweet-avatar-box {
  width: 62px;
  height: 62px;
}

.tweet-card.ratio-1-1 .tweet-author-name {
  font-size: 20px;
}

.tweet-card.ratio-1-1 .tweet-author-handle {
  font-size: 16px;
}

.tweet-card.ratio-1-1 .tweet-quote-text {
  font-size: 26px;
  margin-top: 28px;
}

/* 4:5 Portrait (Instagram Feed Post) */
.tweet-card.ratio-4-5 {
  aspect-ratio: 4 / 5;
  width: 480px;
  max-width: 80vw;
}

.tweet-card.ratio-4-5 .tweet-inner {
  padding: 64px 48px;
}

.tweet-card.ratio-4-5 .tweet-avatar-box {
  width: 66px;
  height: 66px;
}

.tweet-card.ratio-4-5 .tweet-author-name {
  font-size: 21px;
}

.tweet-card.ratio-4-5 .tweet-author-handle {
  font-size: 16.5px;
}

.tweet-card.ratio-4-5 .tweet-quote-text {
  font-size: 28px;
  margin-top: 32px;
}

/* 9:16 Story / Reel (Tall, Prominent, Social Media Story Proportions!) */
.tweet-card.ratio-9-16 {
  aspect-ratio: 9 / 16;
  height: min(720px, 78vh);
  width: auto;
  max-width: 90vw;
}

.tweet-card.ratio-9-16 .tweet-inner {
  padding: 72px 48px;
}

.tweet-card.ratio-9-16 .tweet-avatar-box {
  width: 70px;
  height: 70px;
}

.tweet-card.ratio-9-16 .tweet-author-name {
  font-size: 22px;
}

.tweet-card.ratio-9-16 .tweet-author-handle {
  font-size: 17px;
}

.tweet-card.ratio-9-16 .tweet-header-date,
.tweet-card.ratio-9-16 .tweet-header-dot {
  font-size: 17px;
}

.tweet-card.ratio-9-16 .tweet-badge-svg {
  width: 22px;
  height: 22px;
}

.tweet-card.ratio-9-16 .tweet-dots-icon svg {
  width: 24px;
  height: 24px;
}

.tweet-card.ratio-9-16 .tweet-quote-text {
  font-size: 32px;
  margin-top: 36px;
  line-height: 1.5;
}

.tweet-card.ratio-9-16 .tweet-engagements-bar {
  margin-top: 36px;
}

.tweet-card.ratio-9-16 .engagement-icon {
  width: 22px;
  height: 22px;
}

.tweet-card.ratio-9-16 .engagement-count {
  font-size: 15px;
}

/* ==========================================
   Themes: Dark (#000000) & Light (#ffffff)
   ========================================== */

/* Dark Theme (#000000) */
.tweet-card.theme-dark {
  background-color: #000000 !important;
  background: #000000 !important;
  color: #f7f9f9;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
}

.tweet-card.theme-dark .tweet-author-name {
  color: #f7f9f9;
}

.tweet-card.theme-dark .tweet-author-handle,
.tweet-card.theme-dark .tweet-dots-icon {
  color: #71767b;
}

.tweet-card.theme-dark .tweet-author-handle,
.tweet-card.theme-dark .tweet-header-dot,
.tweet-card.theme-dark .tweet-header-date,
.tweet-card.theme-dark .tweet-dots-icon {
  color: #71767b !important;
}

.tweet-card.theme-dark .tweet-quote-text {
  color: #f7f9f9;
}

.tweet-card.theme-dark .tweet-engagements-bar {
  color: #71767b;
}

/* Light Theme (#ffffff) */
.tweet-card.theme-light {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #0f1419;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
}

.tweet-card.theme-light .tweet-author-name {
  color: #0f1419 !important;
}

.tweet-card.theme-light .tweet-author-handle,
.tweet-card.theme-light .tweet-header-dot,
.tweet-card.theme-light .tweet-header-date,
.tweet-card.theme-light .tweet-dots-icon {
  color: #536471 !important;
}

.tweet-card.theme-light .tweet-quote-text {
  color: #0f1419 !important;
}

.tweet-card.theme-light .tweet-engagements-bar {
  color: #536471;
}

/* ==========================================
   Inner Content Structure
   ========================================== */

.tweet-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Default Centered Quote Card */
  box-sizing: border-box;
}

.tweet-inner.align-top {
  justify-content: flex-start;
  padding-top: 60px !important;
}

.tweet-content-container {
  width: 100%;
  max-width: 100%;
}

/* Header Row */
.tweet-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.tweet-profile-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tweet-avatar-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #16181c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tweet-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tweet-name-details {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.tweet-header-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 5px;
  row-gap: 2px;
  line-height: 1.3;
}

.tweet-author-name {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-family: inherit;
  white-space: nowrap;
}

/* Official Verified Badge */
.tweet-badge-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.tweet-badge-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tweet-author-handle,
.tweet-header-dot,
.tweet-header-date {
  font-weight: 400;
  line-height: 1.25;
  font-family: inherit;
  white-space: nowrap;
}

.tweet-header-dot {
  font-weight: 700;
  opacity: 0.8;
  margin: 0 1px;
}

.tweet-dots-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding-top: 2px;
  color: #71767b;
}

.tweet-dots-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Tweet Body / Text */
.tweet-quote-text {
  font-weight: 400;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  letter-spacing: -0.012em;
  margin-top: 18px;
}

/* Authentic Twitter / X Engagements Bar */
.tweet-engagements-bar {
  margin-top: 24px;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  user-select: none;
  font-size: 13.5px;
}

.engagement-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  line-height: 1;
  font-weight: 400;
}

.engagement-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
  display: block;
}

.engagement-count {
  font-size: 13px;
  font-family: inherit;
  letter-spacing: -0.01em;
  color: inherit;
}

.engagement-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.engagement-icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hover Action Bar for Gallery */
.gallery-card-actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Full Width Buttons */
.btn-full-width {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
}

/* CSV Upload Box in Sidebar */
.csv-upload-btn-wrapper {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.csv-upload-btn-wrapper .btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-medium);
  color: var(--text-primary);
  font-weight: 600;
  transition: var(--transition);
}

.csv-upload-btn-wrapper .btn:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}

/* CSV Modal Styles */
.csv-sample-download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--primary-subtle);
  border: 1px solid rgba(197, 245, 138, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
}

.sample-info-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
}

.sample-info-text strong {
  color: var(--primary);
  font-weight: 700;
}

.sample-info-text span {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.csv-drop-zone {
  border: 2px dashed var(--border-medium);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.csv-drop-zone:hover,
.csv-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.csv-drop-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.csv-drop-icon svg {
  width: 24px;
  height: 24px;
}

.csv-drop-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.csv-drop-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.csv-file-info-box {
  margin-top: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.csv-file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.csv-file-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.csv-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--primary-subtle);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.csv-preview-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 140px;
  overflow-y: auto;
}

.csv-preview-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Modals (CSV Import & Print Confirm)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.show .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.6);
  background: #062b1e;
  color: #6ee7b7;
}

.toast.info {
  border-color: rgba(197, 245, 138, 0.4);
  background: #0f1f18;
  color: var(--primary);
}

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

/* ==========================================================================
   PRINT STYLESHEET (@media print)
   ========================================================================== */

#print-staging-container {
  display: none;
}

@media print {
  @page {
    margin: 0;
    size: auto;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body.theme-dark, html.theme-dark {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffffff !important;
  }

  body.theme-light, html.theme-light {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f1419 !important;
  }

  .app-header,
  .studio-sidebar,
  .canvas-bottom-dock,
  .gallery-card-actions,
  .gallery-card-toolbar,
  .modal-backdrop,
  .toast-container,
  .no-print {
    display: none !important;
  }

  .app-workspace,
  .studio-canvas,
  .canvas-stage {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    width: 100% !important;
    overflow: visible !important;
  }

  #print-staging-container {
    display: block !important;
    width: 100% !important;
  }

  .print-page-wrapper {
    page-break-after: always;
    break-after: page;
    width: 100vw;
    height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .print-page-wrapper.theme-dark {
    background: #000000 !important;
    background-color: #000000 !important;
  }

  .print-page-wrapper.theme-light {
    background: #ffffff !important;
    background-color: #ffffff !important;
  }

  .print-page-wrapper:last-child {
    page-break-after: avoid;
    break-after: avoid;
  }

  .print-page-wrapper .tweet-card {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  .print-page-wrapper.theme-dark .tweet-card {
    background: #000000 !important;
    background-color: #000000 !important;
  }

  .print-page-wrapper.theme-light .tweet-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
  }

  .print-page-wrapper .tweet-inner {
    padding: 9vw !important;
  }

  .print-page-wrapper .tweet-quote-text {
    font-size: 32px !important;
    line-height: 1.5 !important;
  }
}

/* ==========================================================================
   Mobile Navigation & Switchers
   ========================================================================== */

.mobile-nav-bar {
  display: none;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 56px;
  z-index: 90;
  flex-direction: column;
}

.mobile-tabs-container {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.mobile-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-subtle);
}

.mobile-tab-btn svg {
  width: 17px;
  height: 17px;
}

.mobile-quick-scroll-bar {
  padding: 0.45rem 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-quick-scroll-bar::-webkit-scrollbar {
  display: none;
}

.mobile-quick-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.mobile-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-pill.active {
  background: var(--primary);
  color: #0b1110;
  border-color: var(--primary);
  font-weight: 750;
}

.mobile-pill-separator {
  width: 1px;
  height: 16px;
  background: var(--border-medium);
  margin: 0 0.2rem;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Tablets Landscape & Medium Screens */
@media (max-width: 1180px) {
  .studio-sidebar {
    width: 360px;
    min-width: 340px;
  }
}

/* Tablet Portrait & Mobile Screens (<= 900px) */
@media (max-width: 900px) {
  .app-header {
    height: 56px;
    padding: 0 0.85rem;
  }

  .header-controls-center {
    display: none; /* Controlled seamlessly via mobile-nav-bar */
  }

  .brand-tag {
    display: none;
  }

  .btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }

  .mobile-nav-bar {
    display: flex;
  }

  .app-workspace {
    position: relative;
    height: auto;
    min-height: calc(100vh - 120px);
    overflow: visible;
  }

  /* Dual View Mode Switching on Mobile: Preview vs Edit */
  .app-workspace.mobile-mode-preview .studio-sidebar {
    display: none !important;
  }

  .app-workspace.mobile-mode-preview .studio-canvas {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
  }

  .app-workspace.mobile-mode-edit .studio-canvas {
    display: none !important;
  }

  .app-workspace.mobile-mode-edit .studio-sidebar {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    border-right: none;
    height: 100% !important;
  }

  .canvas-stage {
    padding: 1.5rem 1rem 5rem;
  }

  /* Card responsive scaling */
  .tweet-card.ratio-1-1 {
    width: min(360px, 90vw);
  }

  .tweet-card.ratio-1-1 .tweet-inner {
    padding: 38px 28px;
  }

  .tweet-card.ratio-1-1 .tweet-avatar-box {
    width: 52px;
    height: 52px;
  }

  .tweet-card.ratio-1-1 .tweet-author-name {
    font-size: 18px;
  }

  .tweet-card.ratio-1-1 .tweet-author-handle {
    font-size: 14.5px;
  }

  .tweet-card.ratio-1-1 .tweet-quote-text {
    font-size: 22px;
    margin-top: 22px;
  }

  .tweet-card.ratio-4-5 {
    width: min(340px, 88vw);
  }

  .tweet-card.ratio-4-5 .tweet-inner {
    padding: 44px 28px;
  }

  .tweet-card.ratio-4-5 .tweet-avatar-box {
    width: 54px;
    height: 54px;
  }

  .tweet-card.ratio-4-5 .tweet-author-name {
    font-size: 18.5px;
  }

  .tweet-card.ratio-4-5 .tweet-author-handle {
    font-size: 14.5px;
  }

  .tweet-card.ratio-4-5 .tweet-quote-text {
    font-size: 23px;
    margin-top: 24px;
  }

  .tweet-card.ratio-9-16 {
    height: min(520px, 68vh);
    width: auto;
  }

  .tweet-card.ratio-9-16 .tweet-inner {
    padding: 48px 30px;
  }

  .tweet-card.ratio-9-16 .tweet-avatar-box {
    width: 56px;
    height: 56px;
  }

  .tweet-card.ratio-9-16 .tweet-author-name {
    font-size: 19px;
  }

  .tweet-card.ratio-9-16 .tweet-author-handle {
    font-size: 15px;
  }

  .tweet-card.ratio-9-16 .tweet-quote-text {
    font-size: 24px;
    margin-top: 26px;
  }

  /* Prevent Safari auto-zoom on input focus */
  .field-input,
  .field-textarea {
    font-size: 16px !important;
  }
}

/* Small Smartphone Screens (<= 480px) */
@media (max-width: 480px) {
  .app-header {
    padding: 0 0.65rem;
  }

  .brand-title span:first-child {
    font-size: 0.95rem;
  }

  .header-actions-right .btn-text {
    display: none; /* Compact icon buttons on small phones */
  }

  .header-actions-right .btn {
    padding: 0.45rem 0.65rem;
  }

  .canvas-stage {
    padding: 1rem 0.5rem 4.5rem;
  }

  .tweet-card.ratio-1-1 {
    width: min(360px, calc(100vw - 24px));
  }

  .tweet-card.ratio-1-1 .tweet-inner {
    padding: 24px 18px;
  }

  .tweet-card.ratio-1-1 .tweet-quote-text {
    font-size: 19px;
    margin-top: 16px;
  }

  .tweet-card.ratio-4-5 {
    width: min(340px, calc(100vw - 28px));
  }

  .tweet-card.ratio-4-5 .tweet-inner {
    padding: 28px 18px;
  }

  .tweet-card.ratio-4-5 .tweet-quote-text {
    font-size: 20px;
    margin-top: 18px;
  }

  .tweet-card.ratio-9-16 {
    height: min(480px, calc(100vh - 180px));
    width: auto;
    max-width: calc(100vw - 24px);
  }

  .tweet-card.ratio-9-16 .tweet-inner {
    padding: 30px 18px;
  }

  .tweet-card.ratio-9-16 .tweet-quote-text {
    font-size: 20px;
    margin-top: 18px;
  }

  .canvas-bottom-dock {
    bottom: 12px;
    padding: 4px 10px;
    max-width: calc(100% - 20px);
  }
}

@media (max-width: 360px) {
  .tweet-card.ratio-1-1 .tweet-inner,
  .tweet-card.ratio-4-5 .tweet-inner,
  .tweet-card.ratio-9-16 .tweet-inner {
    padding: 18px 14px;
  }
  .tweet-avatar-box {
    width: 44px !important;
    height: 44px !important;
  }
  .tweet-author-name {
    font-size: 16px !important;
  }
  .tweet-author-handle {
    font-size: 13px !important;
  }
}
