:root {
  --bg-main: #0f172a;
  --bg-panel: #1e293b;
  --bg-card: #273548;
  --border-color: #334155;
  --border-light: #475569;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #0284c7;
  --accent-blue-hover: #0369a1;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* App Header */
header.app-header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
}

.brand-section h1 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-badge {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  font-weight: 900;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.dot-com {
  color: #38bdf8;
  font-weight: 700;
}

.brand-section .subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* View Mode Toggle Segmented Control */
.view-mode-toggle {
  display: inline-flex;
  background: #182234;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.mode-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Main Layout Modes */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Left: Form Editor Pane */
.editor-pane {
  width: 50%;
  min-width: 520px;
  max-width: 840px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: width 0.2s ease, max-width 0.2s ease;
}

.editor-toolbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

/* Workspace Focus Tabs */
.workspace-tabs {
  display: inline-flex;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.workspace-tab {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.workspace-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.workspace-tab.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Workspace Focus Filtering & Dedicated Full-Height Scroll Architecture */
.editor-pane[data-workspace="deliverables"] .card-section:not(#sec-items) {
  display: none !important;
}

.editor-pane[data-workspace="deliverables"] .editor-scroll {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
  flex: 1;
  min-height: 0;
  padding: 10px 16px 12px;
  gap: 0;
}

.editor-pane[data-workspace="deliverables"] #sec-items {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
  border-color: #0284c7;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.2);
}

.editor-pane[data-workspace="deliverables"] #sec-items .card-header,
.editor-pane[data-workspace="deliverables"] .deliverables-timeline-bar {
  flex-shrink: 0;
}

.editor-pane[data-workspace="deliverables"] .deliverables-card-body {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 14px;
}

.editor-pane[data-workspace="deliverables"] .deliverables-workspace {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  gap: 16px;
  overflow: hidden;
}

.editor-pane[data-workspace="deliverables"] .deliverables-rail {
  width: 320px;
  flex-shrink: 0;
  height: 100%;
  max-height: 100% !important;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-pane[data-workspace="deliverables"] .deliverables-main-stage {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 10px;
}

.editor-pane[data-workspace="deliverables"] .stage-nav-bar {
  flex-shrink: 0;
}

.editor-pane[data-workspace="deliverables"] #lineItemsContainer {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

.editor-pane[data-workspace="details"] .card-section:not(#sec-meta):not(#sec-contractor):not(#sec-client) {
  display: none !important;
}
.editor-pane[data-workspace="payment"] .card-section:not(#sec-rates):not(#sec-payment):not(#sec-tuning) {
  display: none !important;
}

/* Sticky Customization Map */
.customization-map {
  background: #182234;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.map-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.map-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.map-chip:hover {
  background: #273548;
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.map-chip.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.4);
}

.chip-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.chip-badge.edit {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.chip-badge.count {
  background: #059669;
  color: #ffffff;
}

/* Fullscreen Editor Mode */
.app-container.mode-fullscreen-editor .editor-pane {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  border-right: none;
}

.app-container.mode-fullscreen-editor .preview-pane {
  display: none !important;
}

.app-container.mode-fullscreen-editor .editor-scroll {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 32px 48px;
}

.app-container.mode-fullscreen-editor .editor-pane[data-workspace="deliverables"] .editor-scroll {
  max-width: 100% !important;
  margin: 0 !important;
  width: 100% !important;
  padding: 10px 18px 12px !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.app-container.mode-fullscreen-editor .editor-pane[data-workspace="deliverables"] .deliverables-rail {
  width: 340px;
}

/* Fullscreen Preview Mode */
.app-container.mode-fullscreen-preview .editor-pane {
  display: none !important;
}

.app-container.mode-fullscreen-preview .preview-pane {
  width: 100% !important;
  flex: 1;
}

.editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Editor Section Cards */
.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card-section.flash-highlight {
  animation: sectionFlash 1.8s ease;
}

@keyframes sectionFlash {
  0% {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.4), 0 4px 16px rgba(2, 132, 199, 0.3);
  }
  50% {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2), 0 4px 16px rgba(2, 132, 199, 0.15);
  }
  100% {
    border-color: var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
}

.card-header {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.card-header:hover {
  background: rgba(56, 189, 248, 0.08);
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-header-left h2 {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #38bdf8;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chevron {
  font-size: 11px;
  color: #94a3b8;
  transition: transform 0.2s ease;
  display: inline-block;
}

.card-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.quick-summary {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-section.collapsed .card-body {
  display: none;
}

.card-section.collapsed {
  border-color: #2b3a4e;
}

/* Badges for Customizable vs Calculated */
.badge-tag.editable {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1.5px 6px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  display: inline-block;
  vertical-align: middle;
}

.badge-tag.calculated {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1.5px 6px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  display: inline-block;
  vertical-align: middle;
}

.calc-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #182234;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 10px 14px;
}

/* Form Controls */
.form-row {
  display: flex;
  gap: 12px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.half {
  flex: 0.5;
}

label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: #182234;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #ffffff;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

textarea {
  resize: vertical;
  min-height: 125px;
  line-height: 1.45;
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn-primary {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
  background: #0369a1;
}

.btn-success {
  background: #059669;
  color: #ffffff;
}

.btn-success:hover {
  background: #047857;
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 5px 9px;
  font-size: 11px;
  border-radius: 4px;
}

/* Deliverables Centerpiece Workspace */
.deliverables-centerpiece-card {
  transition: all 0.2s ease;
}

.deliverables-mode-toggle {
  display: inline-flex;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.deliverables-mode-toggle .btn-mode {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deliverables-mode-toggle .btn-mode:hover {
  color: #ffffff;
}

.deliverables-mode-toggle .btn-mode.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.deliverables-timeline-bar {
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.deliverables-timeline-bar .timeline-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.timeline-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.timeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #182234;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.timeline-chip:hover {
  border-color: #38bdf8;
  color: #ffffff;
  background: #1e293b;
}

.timeline-chip.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.timeline-chip .chip-day {
  font-weight: 700;
  color: #38bdf8;
}

.timeline-chip.active .chip-day {
  color: #ffffff;
}

.timeline-chip .chip-total {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  opacity: 0.9;
  font-weight: 700;
  color: #34d399;
}

.timeline-chip.active .chip-total {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.25);
}

.timeline-add-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed #0284c7;
  border-radius: 6px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.timeline-add-chip:hover {
  background: rgba(2, 132, 199, 0.15);
  color: #ffffff;
  border-color: #38bdf8;
}

.deliverables-card-body {
  padding: 12px 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deliverables-workspace {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* Left Rail */
.deliverables-rail {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  height: 100%;
  max-height: 100%;
  padding-right: 6px;
  scrollbar-width: thin;
}

.deliverables-rail-item {
  background: #182234;
  border: 1px solid #2d3c52;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.deliverables-rail-item:hover {
  border-color: #475569;
  background: #1b263b;
}

.deliverables-rail-item.active {
  background: #172740;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.deliverables-rail-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #38bdf8;
  border-radius: 0 2px 2px 0;
}

.rail-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rail-day-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
}

.deliverables-rail-item.active .rail-day-badge {
  color: #ffffff;
}

.rail-subtotal {
  font-size: 11.5px;
  font-weight: 700;
  color: #34d399;
}

.rail-date-row {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
}

.rail-title-row {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-badges-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.rail-actions-row {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Right Main Stage */
.deliverables-main-stage {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 12px;
}

.stage-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #131d2e;
  border: 1px solid #2d3c52;
  border-radius: 8px;
  padding: 10px 16px;
  gap: 12px;
}

.stage-active-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.stage-day-badge {
  font-size: 11px;
  font-weight: 700;
  background: #0284c7;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
}

.stage-day-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.stage-subtotal-badge {
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

#lineItemsContainer {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

/* In Day Focus mode: show only active card */
.deliverables-workspace:not(.mode-all-days) #lineItemsContainer .line-item-card {
  display: none;
}

.deliverables-workspace:not(.mode-all-days) #lineItemsContainer .line-item-card.active-stage-card {
  display: flex;
}

/* In All Days mode: show all cards continuous */
.deliverables-workspace.mode-all-days .deliverables-rail {
  display: none;
}

.deliverables-workspace.mode-all-days .stage-nav-bar {
  display: none;
}

.deliverables-workspace.mode-all-days #lineItemsContainer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deliverables-workspace.mode-all-days #lineItemsContainer .line-item-card {
  display: flex !important;
}

/* Interactive Bullet List Editor */
.bullets-interactive-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.bullet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  border: 1px solid #2d3c52;
  border-radius: 6px;
  padding: 6px 10px;
  transition: border-color 0.15s ease;
}

.bullet-row:focus-within {
  border-color: #38bdf8;
}

.bullet-num {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  min-width: 22px;
  text-align: center;
}

.bullet-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
  color: #f1f5f9 !important;
}

.bullet-actions {
  display: flex;
  gap: 4px;
}

.btn-add-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed #0284c7;
  color: #38bdf8;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 4px;
}

.btn-add-bullet:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #ffffff;
  border-color: #38bdf8;
}

/* Line Items Editor */
.line-item-card {
  background: #182234;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.line-item-card:hover {
  border-color: #475569;
}

.line-item-card.flash-highlight {
  animation: sectionFlash 1.8s ease;
}

.line-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2d3c52;
  padding-bottom: 10px;
}

.line-item-title-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.2px;
}

.line-item-actions {
  display: flex;
  gap: 6px;
}

/* Fullscreen Editor Card Enhancements */
.app-container.mode-fullscreen-editor .deliverables-workspace {
  min-height: 0;
  height: 100%;
  gap: 20px;
}

.app-container.mode-fullscreen-editor .deliverables-rail {
  width: 330px;
  height: 100%;
  max-height: 100% !important;
}

.app-container.mode-fullscreen-editor .deliverables-rail-item {
  padding: 14px 16px;
}

.app-container.mode-fullscreen-editor .line-item-card {
  padding: 24px 28px;
  gap: 18px;
}

.app-container.mode-fullscreen-editor textarea {
  min-height: 160px;
  font-size: 13.5px;
}

.badges-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.badge-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  opacity: 0.55;
  transition: opacity 0.15s, transform 0.1s;
}

.badge-chip.active {
  opacity: 1;
  box-shadow: 0 0 0 1px #ffffff;
}

.chip-storefront { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.chip-3d { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.chip-admin { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.chip-pdf { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.chip-finishes { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.chip-adwords { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.chip-custom { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

/* Right: Preview Pane */
.preview-pane {
  flex: 1;
  background: #0b1120;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.preview-toolbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

/* Preview Mode Segmented Switch */
.btn-mode-toggle {
  display: inline-flex;
  background: #182234;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.btn-mode-toggle .btn-mode {
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-mode-toggle .btn-mode:hover {
  color: #ffffff;
}

.btn-mode-toggle .btn-mode.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

#btnToggleHighlight.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

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

.height-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.height-pill.fit {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid #059669;
}

.height-pill.overflow {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #dc2626;
}

.preview-viewport {
  flex: 1;
  overflow: auto;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: radial-gradient(#1e293b 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Paper Container */
.paper-wrapper {
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  transform-origin: top center;
  transition: transform 0.2s ease;
}

#previewFrame {
  width: 8.5in;
  height: 11in;
  border: none;
  display: block;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 900px) {
  header.app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    height: auto;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .editor-pane {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .app-container.mode-split .preview-pane {
    display: none;
  }
}

/* Custom Scrollbar Styling for Smooth Independent Scrolling */
.deliverables-rail::-webkit-scrollbar,
#lineItemsContainer::-webkit-scrollbar,
.deliverables-timeline-bar::-webkit-scrollbar,
.customization-map::-webkit-scrollbar,
.editor-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.deliverables-rail::-webkit-scrollbar-track,
#lineItemsContainer::-webkit-scrollbar-track,
.deliverables-timeline-bar::-webkit-scrollbar-track,
.customization-map::-webkit-scrollbar-track,
.editor-scroll::-webkit-scrollbar-track {
  background: #0b1120;
  border-radius: 4px;
}

.deliverables-rail::-webkit-scrollbar-thumb,
#lineItemsContainer::-webkit-scrollbar-thumb,
.deliverables-timeline-bar::-webkit-scrollbar-thumb,
.customization-map::-webkit-scrollbar-thumb,
.editor-scroll::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.deliverables-rail::-webkit-scrollbar-thumb:hover,
#lineItemsContainer::-webkit-scrollbar-thumb:hover,
.deliverables-timeline-bar::-webkit-scrollbar-thumb:hover,
.customization-map::-webkit-scrollbar-thumb:hover,
.editor-scroll::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

.deliverables-rail,
#lineItemsContainer,
.deliverables-timeline-bar,
.customization-map,
.editor-scroll {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0b1120;
}

/* Free Tier User & Quota Bar */
.studio-user-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
}

.studio-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 700;
  font-size: 10.5px;
}

.studio-user-pill {
  color: #e2e8f0;
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-provider-tag {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.studio-nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.studio-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.studio-nav-link.logout {
  color: #fca5a5;
}

.studio-nav-link.logout:hover {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.25);
}

/* Guest Mode & Ad Monetization Banner (Option A: Ad-Supported Free Mode) */
.studio-quota-pill.guest-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.studio-nav-link.ad-free-upgrade {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
}

.studio-nav-link.ad-free-upgrade:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.fi-ad-banner {
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fi-ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fi-ad-badge {
  background: #1e293b;
  color: #94a3b8;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
}

.fi-ad-remove-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: 10.5px;
  transition: color 0.15s ease;
}

.fi-ad-remove-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.fi-ad-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, #131e33 0%, #1e293b 100%);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 14px;
}

.fi-ad-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fi-ad-title {
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.fi-ad-desc {
  color: #94a3b8;
  font-size: 10.5px;
  line-height: 1.35;
}

.fi-ad-cta-btn {
  background: #0284c7;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.fi-ad-cta-btn:hover {
  background: #0369a1;
}

@media print {
  .fi-ad-banner, .app-header, .form-pane, .preview-toolbar {
    display: none !important;
  }
}

/* --- Email-Gated Desktop .msi Download Form (webdesigner.la Resume Pattern) --- */
.desktop-download-form {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.desktop-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.desktop-email-input {
  width: 170px;
  height: 30px;
  padding: 4px 24px 4px 10px;
  font-size: 11.5px;
  border: 1px solid #334155;
  border-right: none;
  border-radius: 6px 0 0 6px;
  background: #0f172a;
  color: #f8fafc;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.desktop-email-input::placeholder {
  color: #64748b;
}

.desktop-email-input:focus {
  border-color: #38bdf8;
  background: #1e293b;
}

.desktop-success-icon {
  display: none;
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: #10b981;
  font-weight: 800;
  font-size: 13px;
  pointer-events: none;
}

.desktop-download-btn {
  border-radius: 0 6px 6px 0 !important;
  height: 30px;
  padding: 0 10px !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.desktop-btn-spinner {
  display: none;
  font-weight: 700;
}



