* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, sans-serif; background: #111; color: #eee; min-height: 100vh; padding: 20px; }

h1 { font-size: 1.4rem; margin-bottom: 2px; text-align: center; }
.tagline { text-align: center; color: #555; font-size: 0.8rem; margin-bottom: 10px; }
.local-notice { text-align: center; color: #444; font-size: 0.7rem; margin-top: 32px; padding: 12px; }
.disclaimer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.disclaimer-modal {
  background: #1a1a1a; border: 1px solid #333; border-radius: 10px;
  padding: 32px 36px; max-width: 420px; text-align: center;
}
.disclaimer-modal h2 { font-size: 1.1rem; margin-bottom: 14px; color: #eee; }
.disclaimer-modal p { font-size: 0.85rem; color: #aaa; margin-bottom: 10px; line-height: 1.5; }
.disclaimer-modal strong { color: #eee; }
.disclaimer-modal button {
  margin-top: 14px; background: #1a6; color: #fff; border: none;
  padding: 10px 28px; border-radius: 6px; font-size: 0.9rem; cursor: pointer;
}
.disclaimer-modal button:hover { background: #1b7; }
.col-indicator {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding: 8px 14px; background: #161616; border-left: 3px solid #1a6;
  border-radius: 0 6px 6px 0;
}
.col-indicator-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.col-indicator .toolbar { flex: 1; margin-bottom: 0; }
.col-indicator button {
  background: none; color: #888; border: none; padding: 2px 6px;
  font-size: 1rem; cursor: pointer; line-height: 1;
}
.col-indicator button:hover { color: #eee; }
.col-indicator span {
  font-size: 0.85rem; color: #1a6; font-weight: 600; letter-spacing: 0.02em;
}
.col-indicator .col-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #1a6; flex-shrink: 0;
}

.toolbar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
  font-size: 0.8rem; color: #aaa; justify-content: center;
}
.toolbar .sep {
  width: 1px; height: 20px; background: #333; margin: 0 4px; flex-shrink: 0;
}
.toolbar label { cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.toolbar select, .toolbar input[type="number"] {
  background: #1a1a1a; color: #eee; border: 1px solid #333; padding: 4px 8px;
  border-radius: 4px; font-size: 0.8rem; outline: none;
}
.toolbar select:focus, .toolbar input[type="number"]:focus { border-color: #444; }
.toolbar input[type="text"] {
  background: #1a1a1a; color: #eee; border: 1px solid #333; padding: 4px 8px;
  border-radius: 4px; font-size: 0.8rem; width: 130px;
}
.toolbar input[type="text"]::placeholder { color: #555; }
.toolbar input[type="range"] { width: 80px; vertical-align: middle; }

input[type="range"] {
  appearance: none; -webkit-appearance: none;
  height: 4px; background: #333; border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 12px; height: 12px; background: #eee; border-radius: 50%;
  cursor: pointer; border: none;
}
input[type="range"]::-webkit-slider-thumb:hover { background: #1a6; }
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; background: #eee; border-radius: 50%;
  cursor: pointer; border: none;
}
input[type="range"]::-moz-range-thumb:hover { background: #1a6; }
input[type="range"]::-moz-range-track { background: #333; height: 4px; border-radius: 2px; }
.toolbar input[type="number"] { width: 52px; text-align: center; }
.toolbar input[type="checkbox"] {
  margin: 0; appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; background: #1a1a1a; border: 1px solid #444;
  border-radius: 3px; cursor: pointer; vertical-align: middle; flex-shrink: 0;
}
.toolbar input[type="checkbox"]:checked {
  background: #1a6; border-color: #1a6;
}
.toolbar input[type="checkbox"]:checked::after {
  content: '\2713'; color: #fff; font-size: 0.55rem;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.toolbar button {
  background: #222; color: #eee; border: 1px solid #444; padding: 4px 10px;
  border-radius: 4px; font-size: 0.8rem; cursor: pointer; white-space: nowrap;
}
.toolbar button:hover { background: #333; }
.toolbar .btn-primary {
  background: #1a6; border-color: #1a6; color: #fff; font-weight: 600;
}
.toolbar .btn-primary:hover { background: #1b7; }
.toolbar .btn-primary:disabled { opacity: 0.4; cursor: default; }
.batch-bar { margin-top: 16px; }
.batch-bar .batch-label { color: #666; font-size: 0.75rem; white-space: nowrap; }

.dropzone {
  border: 2px dashed #2a2a2a; border-radius: 10px; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
  min-height: 80px; background: #141414; margin-top: 16px;
}
.dropzone:hover { border-color: #444; background: #1a1a1a; }
.dropzone.over { border-color: #1a6; background: rgba(17, 170, 102, 0.05); }
.dropzone p { font-size: 0.85rem; color: #555; }

body.drag-over-window::after {
  content: ''; position: fixed; inset: 0; z-index: 999;
  border: 3px dashed #1a6; pointer-events: none; border-radius: 12px; margin: 8px;
}

.grid {
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;
}
.grid .card {
  width: 280px; flex-shrink: 0;
}
.card {
  position: relative;
  background: #161616; border-radius: 10px; padding: 10px;
  border: 1px solid #222;
}
.card .canvas-wrap { position: relative; }
.card canvas { width: 100%; border-radius: 6px; background: #000; display: block; }
.card .card-inputs {
  display: flex; flex-direction: column; gap: 5px; margin-top: 8px;
}
.card .text-row {
  display: flex; gap: 6px; align-items: center;
}
.card .text-row textarea {
  background: #111; color: #eee; border: 1px solid #2a2a2a; padding: 6px 10px;
  border-radius: 5px; font-size: 0.8rem; font-family: 'Plus Jakarta Sans', sans-serif; flex: 1; min-width: 0;
  resize: none; overflow: hidden; line-height: 1.4;
}
.card .text-row textarea:focus { border-color: #444; outline: none; }
.card .text-row input[type="number"] {
  background: #111; color: #999; border: 1px solid #2a2a2a; padding: 6px 2px;
  border-radius: 5px; font-size: 0.7rem; width: 38px; text-align: center;
}
.card .text-row input[type="number"]:focus { border-color: #444; outline: none; color: #eee; }
.card .card-inputs input::placeholder { color: #444; }
.adjust-header {
  display: flex; align-items: center; justify-content: space-between;
}
.fmt-reset {
  background: none; border: none; color: #444; font-size: 0.75rem;
  cursor: pointer; padding: 2px 4px;
}
.fmt-reset:hover { color: #999; }
.adjust-toggle {
  background: none; border: none; color: #555; font-size: 0.7rem;
  cursor: pointer; padding: 2px 0; text-align: left;
}
.adjust-toggle:hover { color: #999; }
.adjust-toggle::before { content: '\25B6 '; font-size: 0.5rem; }
.adjust-toggle.open::before { content: '\25BC '; }
.adjust-reset {
  background: none; border: none; color: #444; font-size: 0.6rem;
  cursor: pointer; padding: 2px 4px; display: none;
}
.adjust-reset:hover { color: #999; }
.adjust-header:has(.adjust-toggle.open) .adjust-reset { display: block; }
.adjust-panel { display: flex; flex-direction: column; gap: 4px; }
.adjust-row {
  display: flex; align-items: center; gap: 6px; font-size: 0.65rem; color: #777; cursor: default;
}
.adjust-row span:first-child { width: 55px; flex-shrink: 0; }
.adjust-row input[type="range"] { flex: 1; }
.adjust-val { width: 24px; text-align: right; color: #999; font-size: 0.6rem; }
.crop-btns {
  display: flex; gap: 4px; flex: 1;
}
.crop-btns button {
  background: #111; color: #666; border: 1px solid #2a2a2a; padding: 4px 0;
  border-radius: 5px; font-size: 0.65rem; cursor: pointer; flex: 1;
  font-family: system-ui, sans-serif; line-height: 1.2; text-align: center;
  transition: all 0.15s;
}
.crop-btns button:hover { background: #222; color: #ccc; }
.crop-btns button.active { background: #1a6; color: #fff; border-color: #1a6; }

.card .card-btn {
  position: absolute; z-index: 3;
  background: rgba(0,0,0,0.5); color: #888; border: none; border-radius: 50%;
  width: 24px; height: 24px; font-size: 0.7rem; cursor: pointer; line-height: 24px;
  text-align: center; padding: 0; transition: all 0.15s; opacity: 0;
}
.card:hover .card-btn { opacity: 1; }
.card .delete-btn { top: 8px; right: 8px; }
.card .delete-btn:hover { background: #c33; color: #fff; }
.card .dl-btn { top: 8px; right: 38px; }
.card .dl-btn:hover { background: #1a6; color: #fff; }
.card .swap-btn { top: 8px; right: 98px; }
.card .swap-btn:hover { background: #555; color: #fff; }
.card .dupe-btn { top: 8px; right: 68px; }
.card .dupe-btn:hover { background: #555; color: #fff; }
.card .drag-handle { top: 8px; left: 8px; cursor: grab; font-size: 0.65rem; }
.card .drag-handle:hover { background: #555; color: #fff; }
.card .drag-handle:active { cursor: grabbing; }
.card.drag-over { outline: 2px dashed #1a6; outline-offset: -2px; }

.col-shelf {
  margin-top: 28px; border-top: 1px solid #222; padding-top: 16px;
}
.col-shelf-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.col-shelf-header h3 { color: #777; font-size: 0.85rem; font-weight: 400; }
.col-add-btn {
  background: #222; color: #eee; border: 1px solid #444; width: 24px; height: 24px;
  border-radius: 50%; font-size: 1rem; cursor: pointer; line-height: 22px; text-align: center; padding: 0;
}
.col-add-btn:hover { background: #1a6; border-color: #1a6; }
.col-sort {
  display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 0.8rem; color: #777;
}
.col-sort select {
  background: #1a1a1a; color: #eee; border: 1px solid #333; padding: 2px 6px;
  border-radius: 4px; font-size: 0.8rem; outline: none; cursor: pointer;
}
.col-sort select:focus { border-color: #444; }
.col-list {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.col-item {
  width: 100px; cursor: pointer; text-align: center; position: relative;
}
.col-item:hover .col-thumb { border-color: #1a6; }
.col-thumb {
  width: 100px; height: 100px; border-radius: 6px; border: 2px solid #333;
  overflow: hidden; background: #000;
}
.col-thumb canvas {
  width: 100%; height: 100%; display: block;
}
.col-label {
  font-size: 0.7rem; color: #999; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.col-item.col-drop-target .col-thumb { border-color: #1a6; box-shadow: 0 0 8px rgba(26, 102, 68, 0.6); }
.col-item.active .col-thumb { border-color: #1a6; }
.col-item.active .col-label { color: #1a6; }
.col-item .col-check {
  position: absolute; top: 4px; left: 4px; z-index: 1;
  width: 16px; height: 16px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background: rgba(0,0,0,0.5); border: 1px solid #555; border-radius: 3px;
}
.col-item .col-check:checked {
  background: #1a6; border-color: #1a6;
}
.col-item .col-check:checked::after {
  content: '\2713'; color: #fff; font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.col-item .col-del {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,0.7); color: #fff; border: none; border-radius: 50%;
  width: 16px; height: 16px; font-size: 0.55rem; cursor: pointer; line-height: 16px;
  text-align: center; padding: 0; display: none;
}
.col-item:hover .col-del { display: block; }
.col-item .col-del:hover { background: #c33; }

.col-actions {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.col-actions button {
  background: #222; color: #eee; border: 1px solid #444; padding: 4px 12px;
  border-radius: 4px; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.col-actions button:hover { background: #333; }
.col-actions .del-selected { border-color: #744; }
.col-actions .del-selected:hover { background: #633; }
.col-actions span { color: #777; font-size: 0.75rem; }

.remix-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.remix-modal {
  background: #1a1a1a; border-radius: 10px; padding: 20px; max-width: 800px; width: 90%;
  max-height: 80vh; display: flex; flex-direction: column;
}
.remix-modal h2 { font-size: 1rem; color: #eee; margin-bottom: 12px; }
.remix-grid {
  display: flex; flex-wrap: wrap; gap: 8px; overflow-y: auto; flex: 1; padding: 4px;
}
.remix-item {
  width: 80px; cursor: pointer; position: relative;
}
.remix-item img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 4px;
  border: 2px solid #333; display: block;
}
.remix-item.selected img { border-color: #1a6; }
.remix-item .remix-check {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px; pointer-events: none;
  appearance: none; -webkit-appearance: none;
  background: rgba(0,0,0,0.5); border: 1px solid #555; border-radius: 3px;
}
.remix-item .remix-check:checked {
  background: #1a6; border-color: #1a6;
}
.remix-item .remix-check:checked::after {
  content: '\2713'; color: #fff; font-size: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.remix-item .remix-src {
  font-size: 0.5rem; color: #666; text-align: center; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.remix-footer {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px;
}
.remix-footer button {
  padding: 6px 16px; border-radius: 4px; font-size: 0.85rem; cursor: pointer; border: 1px solid #444;
}
.remix-footer .remix-cancel { background: #222; color: #eee; }
.remix-footer .remix-cancel:hover { background: #333; }
.remix-footer .remix-create { background: #1a6; color: #fff; border-color: #1a6; font-weight: 600; }
.remix-footer .remix-create:hover { background: #1b7; }
.remix-footer .remix-create:disabled { opacity: 0.4; cursor: default; }

.safe-zone.hidden { display: none; }
.safe-zone {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; border-radius: 6px; overflow: hidden; z-index: 0;
}
.safe-zone .zone {
  position: absolute; background: rgba(255, 80, 80, 0.06);
  border: 1px dashed rgba(255, 80, 80, 0.2);
}
.safe-zone .zone-top { top: 0; left: 0; width: 100%; height: 10%; border-bottom-style: dashed; }
.safe-zone .zone-right { top: 10%; right: 0; width: 12%; height: 90%; border-left-style: dashed; }

.img-dragger {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1; cursor: grab; border-radius: 6px;
}
.img-dragger.dragging { cursor: grabbing; }

.text-overlay {
  position: absolute; cursor: grab; user-select: none; z-index: 2;
  pointer-events: auto; border: 1px solid transparent;
}
.text-overlay.dragging { cursor: grabbing; border-color: rgba(255, 255, 255, 0.3); }
.text-overlay.width-focus { border-color: rgba(255, 255, 255, 0.3); }
.text-overlay.width-focus.snapped-x { border-left-color: rgba(100, 200, 255, 0.5); border-right-color: rgba(100, 200, 255, 0.5); }
.text-overlay.width-focus.snapped-y { border-top-color: rgba(100, 200, 255, 0.5); border-bottom-color: rgba(100, 200, 255, 0.5); }

/* video controls */
.video-controls {
  display: flex; flex-direction: column; gap: 4px; margin-top: 4px;
}
.trim-row {
  display: flex; align-items: center; gap: 6px; font-size: 0.65rem; color: #777;
}
.trim-row span { width: 28px; flex-shrink: 0; }
.trim-row input[type="range"] { flex: 1; }
.trim-row .trim-val { width: 36px; text-align: right; color: #999; }
.video-btns {
  display: flex; gap: 4px; align-items: center;
}
.video-btns button {
  background: #111; color: #666; border: 1px solid #2a2a2a; padding: 3px 8px;
  border-radius: 5px; font-size: 0.65rem; cursor: pointer; transition: all 0.15s;
}
.video-btns button:hover { background: #222; color: #ccc; }
.video-btns button.active { background: #1a6; color: #fff; border-color: #1a6; }
.video-btns .undo-btn { margin-left: auto; }
.video-timeline {
  position: relative; height: 36px; border-radius: 4px;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  display: flex;
}
.tl-segment {
  background: #2a2a2a; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background 0.15s;
  border-right: 1px solid #111;
  overflow: hidden; height: 100%;
}
.tl-segment span { font-size: 0.5rem; color: #555; white-space: nowrap; overflow: hidden; }
.tl-segment:hover { background: #333; }
.tl-segment.selected { background: #1a4a3a; outline: 1px solid #1a6; outline-offset: -1px; }
.tl-segment.selected span { color: #aaa; }
.tl-segment.drag-over { outline: 2px dashed #1a6; outline-offset: -2px; }
.tl-segment[draggable="true"] { cursor: grab; }
.tl-segment[draggable="true"]:active { cursor: grabbing; }
.tl-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #fff;
  z-index: 3; cursor: grab; pointer-events: auto;
}
.tl-playhead:active { cursor: grabbing; }
.tl-playhead::before {
  content: ''; position: absolute; top: -2px; left: -5px;
  width: 12px; height: 12px; background: #fff; border-radius: 50%;
  pointer-events: auto;
}
.video-badge {
  position: absolute; bottom: 8px; left: 8px; z-index: 3;
  background: rgba(0,0,0,0.6); color: #eee; padding: 2px 6px;
  border-radius: 3px; font-size: 0.6rem; pointer-events: none;
}
.export-progress {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
}
.export-progress p { color: #eee; font-size: 0.9rem; }
.export-bar {
  width: 300px; height: 6px; background: #333; border-radius: 3px; overflow: hidden;
}
.export-bar-fill {
  height: 100%; background: #1a6; border-radius: 3px; transition: width 0.2s;
}
.export-progress button {
  background: #333; color: #eee; border: 1px solid #555; padding: 6px 16px;
  border-radius: 4px; cursor: pointer; margin-top: 8px;
}
.export-progress button:hover { background: #444; }
