.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: block;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

.offline-dot {
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
}

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

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pro-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

/* Main Workspace Container */
.app-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: stretch;
}

.workspace-grid.pro-active.no-file {
  grid-template-columns: minmax(0, 1fr);
}

.pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 210px);
  min-height: 460px;
  max-height: 740px;
}

.workspace-grid.pro-active .pane {
  height: calc(100vh - 122px);
  max-height: 820px;
}

/* Home View inside Left Pane */
.home-view {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow-y: auto;
}

.dropzone-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.dropzone {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 2 / 1;
  max-height: 100%;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  transition: background 0.15s ease, border-style 0.15s ease;
}

.dropzone.drag-over {
  border-style: solid;
  background: var(--surface-2);
}

.dz-meta-tl, .dz-meta-tr, .dz-meta-bl, .dz-meta-br {
  position: absolute;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.dz-meta-tl { top: 10px; left: 12px; }
.dz-meta-tr { top: 10px; right: 12px; }
.dz-meta-bl { bottom: 10px; left: 12px; }
.dz-meta-br { bottom: 10px; right: 12px; }

.dz-logo {
  width: 44px;
  height: 44px;
}

.dz-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dz-sub {
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 440px;
}

/* Primary & Secondary Buttons */
.btn-primary {
  background: var(--accent-bg);
  color: var(--accent-ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-weight: 600;
  font-size: 13px;
  transition: opacity 0.15s ease;
}

.btn-primary:hover {
  opacity: 0.86;
}

.btn-outline {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* Samples Strip */
.samples-section {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.samples-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sample-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sample-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.sample-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-tag {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* Side Static AD Slot (Inside Right Pane when no file is open) */
.side-ad-slot {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}

.ad-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--accent-bg);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  width: fit-content;
}

.side-ad-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}

.side-ad-box {
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.side-ad-title {
  font-size: 16px;
  font-weight: 700;
}

.side-ad-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.side-ad-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bottom Full-Width Static AD Dock */
.bottom-ad-dock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 92px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bottom-ad-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.bottom-ad-text {
  display: flex;
flex-direction: column;
  gap: 3px;
}

.bottom-ad-title {
  font-size: 14.5px;
  font-weight: 700;
}

.bottom-ad-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.bottom-ad-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Modals & Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 75vh;
  overflow-y: auto;
}

.setting-row {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: border-color 0.15s ease;
}

.setting-row:hover {
  border-color: var(--border-strong);
}

.setting-row.active {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.setting-label {
  font-weight: 600;
  font-size: 13.5px;
}

.setting-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.setting-val {
  font-size: 12px;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-strong);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 4px;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plan-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
}

.plan-card.active {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.plan-price {
  font-size: 18px;
  font-weight: 800;
  margin-top: 4px;
}

.app-footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-bg);
  color: var(--accent-ink);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  z-index: 80;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pane,
  .workspace-grid.pro-active .pane {
    height: auto;
    min-height: 360px;
    max-height: none;
  }
  .dropzone {
    aspect-ratio: 16 / 10;
  }
  .samples-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bottom-ad-dock {
    flex-direction: column;
    align-items: flex-start;
  }
  .bottom-ad-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
