﻿:root {
  --app-font: "Bricolage Grotesque", Arial, sans-serif;
  --design-font: "Dongle", Arial, sans-serif;
  --template-blue-font: "Nunito", Arial, sans-serif;
  --template-blue-display-font: "Belanosima", Arial, sans-serif;

  --bg: #f3f3f3;
  --panel: #ffffff;
  --panel-2: #f7f7f7;
  --text: #222222;
  --muted: #777777;
  --border: #dddddd;
  --input: #ffffff;

  --fallback-card: #463a4c;
  --fallback-accent: #c79b75;
  --fallback-red: #d73a1c;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-grotesque/BricolageGrotesque-VariableFont_opsz,wdth,wght.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("assets/fonts/Nunito/Nunito-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Belanosima";
  src: url("assets/fonts/Belanosima/Belanosima-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Belanosima";
  src: url("assets/fonts/Belanosima/Belanosima-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body.dark {
  --bg: #18151d;
  --panel: #111111;
  --panel-2: #171717;
  --text: #f3edf7;
  --muted: #aaaaaa;
  --border: #333333;
  --input: #1f1f1f;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--app-font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.app {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 320px;
  height: 100vh;
  overflow: hidden;
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.panel-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-content {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-title-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.trial-badge {
  width: max-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(143, 215, 255, 0.26);
  border-radius: 999px;
  color: #8fd7ff;
  background: rgba(143, 215, 255, 0.08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-help-btn {
  width: auto;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.back-home-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.panel-help-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: #202024;
}

.trial-mode .trial-locked {
  opacity: 0.52;
  cursor: not-allowed;
}

.trial-mode .custom-template-area.trial-locked:hover,
.trial-mode .custom-template-area.trial-locked.is-dragging {
  border-color: var(--border);
  background: var(--input);
}

.trial-mode .custom-template-area.trial-locked::after {
  content: "Locked";
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(143, 215, 255, 0.1);
  color: #8fd7ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trial-download-panel {
  background:
    linear-gradient(135deg, rgba(143, 215, 255, 0.08), rgba(242, 166, 200, 0.06)),
    var(--panel);
}

.trial-download-btn {
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid rgba(143, 215, 255, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(143, 215, 255, 0.24), rgba(242, 166, 200, 0.18)),
    rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(143, 215, 255, 0.08),
    0 8px 22px rgba(143, 215, 255, 0.12);
}

.trial-download-btn:hover {
  border-color: rgba(143, 215, 255, 0.78);
  box-shadow:
    0 0 0 1px rgba(143, 215, 255, 0.16),
    0 10px 26px rgba(143, 215, 255, 0.18);
}

.warning-box {
  background: #fff3cd;
  color: #5f4700;
  border: 1px solid #ffe08a;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}

body.dark .warning-box {
  background: #2f2610;
  color: #ffe6a3;
  border-color: #6d571f;
}

.preview-wrap {
  height: 100vh;
  overflow: auto;
  padding: 24px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}

/* =====================
   PANEL UI
===================== */

label {
  font-size: 12px;
  font-weight: 800;
  display: block;
  margin-top: 10px;
  letter-spacing: 0.01em;
}

input,
select {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  box-sizing: border-box;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--app-font);
  font-weight: 700;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button,
textarea {
  font-family: var(--app-font);
  line-height: 1.2;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.95;
  filter: invert(1) grayscale(1) brightness(1.85);
  cursor: pointer;
  padding: 4px;
  margin-right: -2px;
  border-radius: 999px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

input[type="date"],
input[type="time"] {
  padding-right: 8px;
  background:
    linear-gradient(90deg, transparent calc(100% - 34px), rgba(255, 255, 255, 0.055) calc(100% - 34px)),
    var(--input);
}

input[type="date"]:hover,
input[type="time"]:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.color-options {
  display: flex;
  gap: 10px;
  margin: 8px 0 14px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible;
}

.color-btn {
  flex: 0 0 36px;
  width: 36px !important;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  border-radius: 999px;
  border: 8px solid #2b2b2b;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

.color-btn.active {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.color-blue { background: #64c8ef; }
.color-pink { background: #f5a0c7; }
.color-green { background: #90f000; }
.color-brown { background: #c79b75; }
.color-red { background: #cf3217; }
.color-purple { background: #a855f7; }

.scale-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.scale-tabs button {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 11px 0;
  cursor: pointer;
}

.scale-tabs button.active {
  background: #2b2b2b;
  color: #ffffff;
}

.export-btn,
.header-project-actions button,
.secondary-btn,
.reset-btn {
  width: 100%;
  padding: 12px;
  background: #e5e5e5;
  color: #111111;
  border: none;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.export-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.secondary-btn {
  margin-top: 10px;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
}

.reset-btn {
  margin-top: 8px;
  background: #3a1f1f;
  color: #ffffff;
  border: 1px solid #5a2b2b;
}

.header-project-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 112px));
  gap: 8px;
  justify-content: start;
  margin: 0;
}

.header-project-actions button {
  width: 100%;
  min-width: 0;
  height: 35px;
  padding: 9px 8px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  font-size: 12px;
}

.header-project-actions .reset-btn {
  margin-top: 0;
  background: #3a1f1f;
  color: #ffffff;
  border-color: #5a2b2b;
}

.custom-template {
  margin-top: 10px;
}

.custom-template-area {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 82px;
  margin: 0;
  padding: 18px 18px;
  box-sizing: border-box;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  overflow: hidden;
  transition: 0.15s ease;
}

.custom-template-area:hover,
.custom-template-area.is-dragging {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.035);
}

.custom-template-area.is-dragging {
  border-color: var(--fallback-accent);
  background: rgba(199, 155, 117, 0.08);
}

.custom-template-area strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.custom-template-area span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
  white-space: nowrap;
}

.custom-template-area.has-file strong {
  color: var(--text);
}

.custom-template-area.has-file span {
  color: var(--muted);
}

.project-helper {
  margin: -4px 0 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.export-helper {
  margin: 10px 0 0;
  line-height: 1.45;
}

.import-helper {
  margin: 9px 0 0;
  line-height: 1.45;
}

.day-control {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  align-items: center;
}

.stream-input {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  background: var(--panel);
}

.stream-block {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stream-block-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.preview-editable {
  cursor: pointer;
  transition: 0.15s ease;
}

.preview-editable:hover {
  filter: brightness(1.15);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.layout-mode-btn {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.layout-mode-btn.active {
  border-color: rgba(220, 169, 126, 0.75);
  background: rgba(220, 169, 126, 0.16);
  color: #ffd6b7;
}

.layout-mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.layout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.layout-actions button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.layout-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.schedule.layout-mode-active {
  user-select: none;
}

.schedule.layout-mode-active .left-list,
.schedule.layout-mode-active .stream-text,
.schedule.layout-mode-active .date-box,
.schedule.layout-mode-active .time,
.schedule.layout-mode-active .week,
.schedule.layout-mode-active .week-month,
.schedule.layout-mode-active .week-day,
.schedule.layout-mode-active .week .arrow,
.schedule.layout-mode-active .socials,
.schedule.layout-mode-active .credit {
  cursor: move;
}

.schedule.layout-mode-active .layout-selected {
  outline: 4px solid rgba(255, 212, 170, 0.95);
  outline-offset: 8px;
  box-shadow: 0 0 0 10px rgba(255, 178, 108, 0.18);
}

.schedule.layout-dragging {
  cursor: grabbing;
}

.schedule.export-mode .layout-selected {
  outline: 0;
  box-shadow: none;
}

.day-control.focused {
  outline: 2px solid #c79b75;
  box-shadow: 0 0 0 4px rgba(199, 155, 117, 0.2);
}

input.focused-input,
select.focused-input {
  outline: 2px solid #c79b75;
  box-shadow: 0 0 0 4px rgba(199, 155, 117, 0.2);
}

/* =====================
   PANEL SECTION UI
===================== */

.panel-section {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.panel-section label:first-of-type {
  margin-top: 0;
}

.panel-section .color-options {
  margin-bottom: 12px;
}

.panel-section .secondary-btn {
  margin-top: 10px;
}

.panel-section .reset-btn {
  margin-top: 10px;
}

.panel-section .header-project-actions .reset-btn {
  margin-top: 0;
}

/* Biar card schedule di dalam section tidak terlalu kontras */
.panel-section .day-control {
  background: var(--panel);
}

/* Sticky export lebih rapi */
.panel-sticky {
  padding: 14px 18px;
}

.panel-header {
  margin-bottom: 0;
}

.export-btn {
  margin-top: 8px;
}

/* =====================
   PREVIEW AUTO FIT LAYOUT
===================== */

.preview-wrap {
  height: 100vh;
  overflow: hidden;
  padding: 24px 24px 112px;
  box-sizing: border-box;

  display: flex;
  justify-content: center;
  align-items: center;
}

.schedule {
  transform: scale(var(--preview-scale, 1));
  transform-origin: center center;
}

/* Supaya export tetap ukuran asli, bukan ukuran preview */
.schedule.export-mode {
  transform: none !important;
}

.export-clone-host {
  position: fixed;
  left: -100000px;
  top: 0;
  z-index: 0;
  pointer-events: none;
}

/* =====================
   RESPONSIVE STACK MODE
   Preview pindah ke atas kalau layar sempit
===================== */

@media (max-width: 1200px) {
  .app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .preview-wrap {
    order: 1;
    height: 70vh;
    min-height: 0;
    overflow: hidden;
    padding: 16px 16px 100px;
  }

  .panel {
    order: 2;
    width: 100%;
    height: 30vh;
    border-right: none;
    border-top: 1px solid var(--border);
    overflow-y: auto;
  }

  .panel-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .panel-content {
    max-width: 760px;
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  .preview-wrap {
    height: 56vh;
    min-height: 0;
    padding: 12px 12px 150px;
  }

  .panel {
    height: 44vh;
  }

  .panel-content {
    max-width: 100%;
    padding: 14px;
  }

  .panel-sticky {
    padding: 12px 14px;
  }

}
/* =====================
   WEEKLY SCHEDULE CLEANER UI
===================== */

.day-control {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.day-control .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.day-control .row strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.day-control .row select {
  min-width: 140px;
}

.stream-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  padding: 0;
  margin: 0;
}

.panel-section #controls {
  margin-top: 8px;
}

.panel-section #controls .day-control {
  border-radius: 8px;
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}

.panel-section #controls .day-control .row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.panel-section #controls .day-control .row .day-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  min-width: 50px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
  line-height: 1;
}

.panel-section #controls .day-control .row .day-badge span {
  display: block;
  font-size: 20px;
  font-weight: 900;
}

.panel-section #controls .day-control .row .day-badge small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.panel-section #controls .mode-segments {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
}

.panel-section #controls .mode-segments button {
  width: auto;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.panel-section #controls .mode-segments button.active {
  background: #2b2b2b;
  color: var(--text);
}

.panel-section #controls .mode-segments button:hover {
  color: var(--text);
}

.panel-section #controls .stream-input {
  margin: 0;
  padding: 0;
}

.panel-section #controls .stream-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 7px 10px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.panel-section #controls .stream-block:first-child {
  margin-top: 0;
}

.panel-section #controls .stream-block-title {
  grid-column: 1 / -1;
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-section #controls .stream-block label {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-section #controls .stream-block input {
  height: 34px;
  margin: 0;
  padding: 0 10px;
  font-size: 12px;
}

.panel-section #controls .stream-block label:nth-of-type(1),
.panel-section #controls .stream-block input:nth-of-type(1) {
  grid-column: 1 / -1;
}

.panel-section #controls .stream-block input:nth-of-type(1) {
  margin-bottom: 3px;
}

.panel-section #controls .stream-block label:nth-of-type(2) {
  grid-column: 1;
  grid-row: 4;
}

.panel-section #controls .stream-block input:nth-of-type(2) {
  grid-column: 1;
  grid-row: 5;
}

.panel-section #controls .stream-block label:nth-of-type(3) {
  grid-column: 2;
  grid-row: 4;
}

.panel-section #controls .stream-block input:nth-of-type(3) {
  grid-column: 2;
  grid-row: 5;
  padding-right: 6px;
  border-color: rgba(255, 255, 255, 0.16);
}

.panel-section #controls .stream-input > label {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-section #controls .stream-input > input {
  height: 34px;
  margin: 0;
  padding: 0 9px;
  font-size: 12px;
}

/* =====================
   SUBTLE SCROLLBAR
===================== */

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* =====================
   UPLOAD AREA UI
===================== */

.upload-box {
  margin-top: 8px;
}

.upload-area {
  display: flex;
  flex-direction: column;
  gap: 6px;

  width: 100%;
  min-height: 82px;
  padding: 18px 16px;
  box-sizing: border-box;

  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);

  cursor: pointer;
  transition: 0.15s ease;
  overflow: hidden;
}

.upload-area:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.035);
}

.upload-area.is-dragging {
  border-color: var(--fallback-accent);
  background: rgba(199, 155, 117, 0.08);
}

.upload-area strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.upload-area span {
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-header .section-title {
  margin-bottom: 0;
}

.section-icon-btn {
  width: 32px;
  height: 32px;

  display: flex;
  justify-content: center;
  align-items: center;

  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--muted);

  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
}

.section-icon-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

.image-tools {
  margin-top: 14px;
}

.illustration-credit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.illustration-credit label {
  margin-top: 0;
}

.image-tools-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.image-tools-header.compact {
  margin-top: 8px;
  margin-bottom: 6px;
}

.image-tools-header label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.image-tools-header span {
  min-width: 48px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.range-row {
  display: block;
}

.range-row input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.range-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #30353d 0%, #676f79 var(--range-progress, 0%), var(--border) var(--range-progress, 0%));
}

.range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: #7b838d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.range-row input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}

.range-row input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #1a73e8;
}

.range-row input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: #1a73e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.range-row input[type="range"]:focus-visible {
  outline: 2px solid rgba(26, 115, 232, 0.35);
  outline-offset: 2px;
}

.upload-area.has-file strong {
  color: var(--text);
}

.upload-area.has-file span {
  color: var(--muted);
}
/* =====================
   SOCIAL MEDIA CONTROLS
===================== */

.social-settings {
  --social-surface: var(--panel);
  --social-card: var(--panel);
  --social-field: var(--input);
  --social-text: var(--text);
  --social-muted: var(--muted);
  --social-border: var(--border);
  --social-border-strong: rgba(255, 255, 255, 0.28);
  --social-accent: #8a8f98;

  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--social-border);
  border-radius: 10px;
  background: var(--social-surface);
  color: var(--social-text);
}

.social-settings-title {
  margin-bottom: 10px;
  color: var(--social-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-count-field {
  margin-bottom: 12px;
}

.social-count-field .hint {
  margin-top: 6px;
  font-size: 11px;
}

.social-count-field label,
.social-field label {
  margin: 0 0 6px;
  color: var(--social-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-settings input,
.social-settings select {
  height: 36px;
  margin-top: 0;
  padding: 0 12px;
  border: 1px solid var(--social-border);
  border-radius: 8px;
  background: var(--social-field);
  color: var(--social-text);
  font-size: 13px;
  font-weight: 700;
}

.social-settings input::placeholder {
  color: var(--social-muted);
}

.social-type-segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--social-border);
  border-radius: 8px;
  background: var(--social-field);
}

.social-type-segments button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: auto;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--social-muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.social-type-segments .platform-icon {
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  mask: var(--icon-url) center / contain no-repeat;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
}

.social-type-segments .platform-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.social-type-segments button.active {
  background: #2b2b2b;
  color: var(--social-text);
}

.social-type-segments button:hover {
  color: var(--social-text);
}

.social-settings input:focus,
.social-settings select:focus {
  outline: none;
  border-color: var(--fallback-accent);
  box-shadow: 0 0 0 3px rgba(199, 155, 117, 0.18);
}

.social-controls {
  margin-top: 0;
}

.social-control {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--social-border);
  border-radius: 8px;
  background: var(--social-card);
}

.social-control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--social-border);
}

.social-control-title span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--social-accent);
}

.social-field {
  margin-top: 10px;
}

.social-field:first-of-type {
  margin-top: 0;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.social-item .social-icon {
  flex: 0 0 auto;
  color: var(--fallback-red);
  margin-right: 0;
  min-width: 22px;
}

.social-item strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* =====================
   FLOATING PREVIEW TOOLBAR
===================== */

.preview-wrap {
  position: relative;
}

.preview-header {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 35;

  display: flex;
  align-items: flex-start;
  gap: 14px;

  width: min(520px, calc(100% - 48px));
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(10px);
}

.preview-header-group {
  min-width: 0;
  flex: 1;
}

.preview-header .zoom-group {
  flex: 0 0 210px;
}

.preview-header .section-title {
  margin-bottom: 7px;
}

.export-options {
  display: grid;
  gap: 10px;
}

.export-option-row {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.export-option-row span,
.export-option-row label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.format-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.format-dropdown {
  position: relative;
  z-index: 8;
}

.format-dropdown-btn,
.format-dropdown-option {
  width: 100%;
  height: 38px;
  border: 0;
  background: #1f1f1f;
  color: var(--text);
  font-family: var(--app-font);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.format-dropdown-btn {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.format-dropdown-chevron {
  position: absolute;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.9;
}

.format-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #1f1f1f;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.format-dropdown.open .format-dropdown-menu {
  display: block;
}

.format-dropdown-option {
  display: block;
  padding: 0 16px;
  text-align: center;
}

.format-dropdown-option:hover,
.format-dropdown-option.active {
  background: #303033;
  color: #ffffff;
}

.preview-export-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

.preview-header .scale-tabs {
  margin: 0;
  height: 36px;
}

.preview-header .scale-tabs button {
  padding: 0;
  font-size: 12px;
  font-weight: 900;
}

.preview-header .export-btn {
  margin: 0;
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.preview-header .preview-toolbar {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.preview-header .preview-toolbar button {
  height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.preview-header .preview-toolbar span {
  min-width: 44px;
  font-size: 12px;
}

.preview-toolbar {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 30;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.88);
  backdrop-filter: blur(10px);
}

.preview-toolbar button {
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 800;
  cursor: pointer;
}

.preview-toolbar span {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

/* =====================
   FLOATING PREVIEW NOTES
===================== */

.preview-notes {
  position: absolute;
  left: 24px;
  top: 24px;
  transform: none;
  z-index: 30;
  box-sizing: border-box;

  width: min(420px, calc(100% - 48px));
  max-height: 220px;
  overflow-y: auto;

  background: rgba(47, 38, 16, 0.92);
  color: #ffe6a3;
  border: 1px solid #6d571f;
  border-radius: 12px;

  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;

  backdrop-filter: blur(10px);
}

.preview-notes strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preview-notes ul {
  margin: 0;
  padding-left: 18px;
}

.preview-notes li {
  margin-bottom: 4px;
}

@media (max-width: 1200px) {
  .preview-header {
    right: 16px;
    bottom: 16px;
    box-sizing: border-box;
    width: min(520px, calc(100% - 32px));
  }

  .preview-notes {
    top: 16px;
    left: 16px;
    right: auto;
    bottom: auto;
    transform: none;
    width: min(420px, calc(100% - 32px));
    max-width: none;
  }

}

@media (max-width: 760px) {
  .preview-header {
    flex-direction: column;
    gap: 10px;
  }

  .preview-header-group {
    width: 100%;
  }

  .preview-export-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}

/* =====================
   THREE PANEL STUDIO LAYOUT
===================== */

.preview-wrap {
  position: relative;
  min-width: 0;
  padding: 28px;
  background: #17131c;
  overflow: hidden;
}

.right-panel .panel-content {
  display: flex;
  min-height: calc(100vh - 58px);
  flex-direction: column;
}

.right-panel .preview-header {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  display: block;
  width: auto;
  padding: 14px;
  border-radius: 12px;
  background: var(--panel-2);
  backdrop-filter: none;
}

.right-panel .export-panel {
  margin-top: auto;
}

.right-panel .preview-header-group {
  width: 100%;
}

.right-panel .preview-header .zoom-group {
  flex: none;
}

.right-panel .preview-export-row {
  grid-template-columns: 1fr;
  gap: 10px;
}

.right-panel .preview-header .scale-tabs,
.right-panel .preview-header .format-select {
  height: 38px;
}

.right-panel .preview-header .export-btn {
  height: 42px;
}

.right-panel .preview-header .preview-toolbar {
  display: grid;
  grid-template-columns: 38px minmax(52px, 1fr) 38px 64px;
  gap: 8px;
  height: auto;
}

.right-panel .preview-header .preview-toolbar button {
  height: 38px;
  padding: 0 10px;
}

.right-panel .preview-header .preview-toolbar span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
}

.right-panel .custom-template {
  margin-top: 0;
}

.right-panel .header-project-actions {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1320px) {
  .app {
    grid-template-columns: 320px minmax(0, 1fr) 300px;
  }
}

@media (max-width: 1200px) {
  .app {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 58vh 42vh auto;
    height: 100vh;
    overflow: hidden;
  }

  .preview-wrap {
    order: 1;
    height: auto;
    padding: 16px;
  }

  .panel {
    height: auto;
    border-right: 0;
    border-top: 1px solid var(--border);
  }

  .panel:first-child {
    order: 2;
    overflow-y: auto;
  }

  .right-panel {
    order: 3;
    border-left: 0;
    overflow-y: auto;
  }

  .right-panel .panel-content {
    min-height: 0;
  }
}

/* =====================
   CLEAN PANEL PASS
===================== */

.panel {
  background: #101012;
}

.panel-sticky {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: #101012;
}

.panel-content {
  padding: 18px 20px 24px;
}

.panel-section {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
}

.panel-section:first-child {
  padding-top: 0;
}

.panel-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-title,
.social-settings-title {
  margin-bottom: 12px;
  color: #a9a3b0;
}

.right-panel .preview-header {
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
}

.right-panel .export-panel {
  margin-top: auto;
  margin-bottom: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
}

.custom-template-area,
.upload-area {
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.header-project-actions button,
.preview-toolbar button,
.preview-toolbar span,
.scale-tabs,
input,
select,
.social-settings input,
.social-settings select {
  border-color: rgba(255, 255, 255, 0.1);
}

.day-control,
.panel-section #controls .day-control,
.social-control {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.018);
  box-shadow: none;
}

.panel-section #controls .stream-block-title {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.social-settings {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* =====================
   FLOATING SURFACE PASS
===================== */

.app {
  gap: 12px;
  padding: 10px;
  box-sizing: border-box;
  background: #0d0d10;
}

.panel {
  height: calc(100vh - 20px);
  border: 0;
  border-radius: 18px;
  background: #121215;
  overflow-y: auto;
  scrollbar-gutter: stable;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.panel:first-child,
.right-panel {
  border-right: 0;
  border-left: 0;
}

.panel-sticky {
  background: rgba(18, 18, 21, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.panel h2 {
  color: #f7f4fb;
}

.preview-wrap {
  height: calc(100vh - 20px);
  border-radius: 18px;
  background: #17131c;
}

.panel-section {
  padding-left: 2px;
  padding-right: 10px;
}

.custom-template-area,
.upload-area,
.day-control,
.panel-section #controls .day-control,
.social-control {
  border-radius: 10px;
}

@media (max-width: 1200px) {
  .app {
    padding: 8px;
    gap: 8px;
  }

  .panel,
  .preview-wrap {
    height: auto;
    border-radius: 16px;
  }

  .panel:first-child,
  .right-panel {
    border: 0;
  }
}

.panel .panel-content {
  padding-right: 14px;
}

.right-panel {
  overflow: hidden;
  scrollbar-gutter: auto;
}

.right-panel .panel-content {
  height: calc(100vh - 20px - 57px);
  min-height: 0;
  overflow: hidden;
}

.panel::-webkit-scrollbar {
  width: 4px;
}

.panel::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

.panel::-webkit-scrollbar-track {
  margin: 14px 0;
}

/* =====================
   MICRO INTERACTIONS
===================== */

.schedule {
  transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.schedule.preview-changing {
  opacity: 0.72;
  filter: saturate(0.9);
}

.day-control.mode-changing .stream-input,
.day-control.mode-changing .stream-block {
  animation: soft-enter 0.22s ease both;
}

.panel-section #controls .mode-segments {
  position: relative;
  overflow: hidden;
}

.panel-section #controls .mode-segments::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: calc((100% - 6px) / var(--mode-count, 2));
  border-radius: 7px;
  background: #2b2b2b;
  transform: translateX(calc(var(--mode-index, 0) * 100%));
  transition: transform 0.22s ease, width 0.22s ease;
  z-index: 0;
}

.panel-section #controls .mode-segments button {
  position: relative;
  z-index: 1;
  transition: color 0.18s ease, transform 0.18s ease;
}

.panel-section #controls .mode-segments button.active {
  background: transparent;
}

.panel-section #controls .mode-segments button:active {
  transform: scale(0.96);
}

.upload-area,
.custom-template-area {
  position: relative;
}

.upload-area::after,
.custom-template-area::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 1px rgba(199, 155, 117, 0.55), 0 0 24px rgba(199, 155, 117, 0.12);
  transition: opacity 0.18s ease;
}

.upload-area.is-dragging::after,
.custom-template-area.is-dragging::after {
  opacity: 1;
  animation: drag-pulse 1.2s ease-in-out infinite;
}

.toast-stack {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 60;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(25, 24, 28, 0.94);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(120, 210, 160, 0.3);
}

.toast-error {
  border-color: rgba(255, 120, 120, 0.35);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 6, 8, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #141317;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}

.modal-overlay.visible .modal-card {
  transform: translateY(0) scale(1);
}

.modal-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .secondary-btn,
.modal-actions .export-btn {
  margin: 0;
  height: 40px;
}

.message-card {
  text-align: center;
}

.message-card .modal-title {
  margin-bottom: 10px;
  text-align: center;
}

.message-card p {
  text-align: center;
}

.message-actions {
  grid-template-columns: 1fr;
}

.message-actions .message-ok {
  width: min(260px, 100%);
  justify-self: center;
}

.guide-card {
  width: min(560px, 100%);
}

.guide-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.guide-header .modal-title {
  margin: 0;
  color: #ffba60;
  text-align: center;
}

.guide-header .secondary-btn {
  height: 34px;
  margin: 0;
  padding: 0 10px;
}

.guide-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.guide-list li::marker {
  color: #d7d0dc;
  font-weight: 900;
}

.guide-list strong {
  color: var(--text);
}

.guide-list span {
  color: #d2ccd8;
}

.guide-actions {
  grid-template-columns: 1fr;
}

.guide-actions .guide-close {
  width: min(260px, 100%);
  justify-self: center;
}

.guide-actions button:disabled,
.guide-header button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@keyframes soft-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drag-pulse {
  0%, 100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1200px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto;
    overflow: visible;
    padding-bottom: 92px;
  }

  .preview-wrap {
    height: clamp(300px, 52vh, 520px);
    min-height: 300px;
    overflow: hidden;
  }

  .panel,
  .panel:first-child,
  .right-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .right-panel .panel-content {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .right-panel .export-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 90;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(18, 18, 21, 0.94);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(14px);
  }

  .right-panel .preview-export-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .right-panel .preview-header .export-btn,
  .right-panel .preview-header .scale-tabs,
  .right-panel .preview-header .format-select {
    height: 42px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .preview-wrap {
    height: clamp(240px, 42vh, 420px);
    min-height: 240px;
    padding: 12px;
  }

  .preview-notes {
    left: 12px;
    right: 12px;
    width: auto;
  }
}


