:root {
  --ink: #1c1d19;
  --muted: #77786f;
  --line: #dedfd7;
  --paper: #f5f4ef;
  --panel: #fbfaf6;
  --olive: #727d4f;
  --olive-dark: #55603a;
  --sand: #d9ccb9;
  --stage: #171814;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }

.topbar {
  height: 76px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: #f9f8f3; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #aaa996;
  font: 22px/1 var(--serif); border-radius: 50%; position: relative;
}
.brand-mark::after { content: ''; position: absolute; inset: 4px; border: 1px solid #c8c6b7; border-radius: 50%; }
.brand span:last-child { display: grid; line-height: 1; }
.brand strong { font: 18px/1 var(--serif); letter-spacing: .19em; }
.brand small { margin-top: 5px; color: #7b7c70; font-size: 8px; letter-spacing: .24em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.privacy-pill { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: #62645a; font-size: 11px; }
.privacy-pill i, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #718552; box-shadow: 0 0 0 3px #e3e9dc; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.icon-button:hover { border-color: #aeb09f; background: #fff; }
.icon-button svg, .upload-icon svg, .music-icon svg, .export-button svg, .mute-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.workspace { display: grid; grid-template-columns: minmax(420px, 44%) minmax(440px, 56%); height: calc(100vh - 76px); }
.editor-panel { overflow-y: auto; padding: 30px clamp(26px, 4vw, 58px) 48px; background: var(--panel); border-right: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 27px; }
.eyebrow { color: var(--olive); font-size: 9px; font-weight: 700; letter-spacing: .22em; }
.panel-heading h1 { margin: 7px 0 0; font: 31px/1.1 var(--serif); font-weight: 400; }
.project-state { margin-top: 6px; padding: 7px 11px; border: 1px solid #d7d8ce; border-radius: 99px; color: #85867b; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.editor-section { padding: 23px 0; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.section-title > span { color: #9b9b8f; font: 12px/1 var(--serif); }
.section-title h2 { margin: 0; font-size: 12px; line-height: 1; text-transform: uppercase; letter-spacing: .14em; }
.section-title em { margin-left: auto; color: #9b9b8f; font-size: 10px; font-style: normal; }
.section-title.compact { margin-bottom: 13px; }
.smart-button { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 6px 9px; border: 1px solid #cfd1c3; border-radius: 99px; background: #f2f3eb; color: #69714f; font-size: 8px; font-weight: 700; cursor: pointer; }
.smart-button svg { width: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.smart-button:disabled { opacity: .4; cursor: default; }
.smart-button:not(:disabled):hover { border-color: var(--olive); background: #e9eddd; }
.section-title .smart-button + em { margin-left: 0; }

.drop-zone {
  min-height: 96px; display: flex; align-items: center; gap: 14px; padding: 18px;
  border: 1px dashed #c7c8bb; border-radius: 4px; background: #f5f4ed; cursor: pointer; transition: .2s ease;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--olive); background: #f0f1e8; transform: translateY(-1px); }
.upload-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 50%; background: #e6e7dd; color: var(--olive-dark); }
.drop-zone > span:nth-child(3) { display: grid; min-width: 0; }
.drop-zone strong { font-size: 12px; }
.drop-zone small { margin-top: 5px; color: #929387; font-size: 9px; }
.drop-zone kbd { margin-left: auto; color: #a0a195; font: 8px/1 var(--sans); text-transform: uppercase; }

.photo-list { display: grid; gap: 7px; margin-top: 10px; }
.photo-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 11px; align-items: center; padding: 7px; background: #f0efe8; border: 1px solid transparent; border-radius: 4px; }
.photo-item.excluded { opacity: .52; }
.photo-item:hover { border-color: #d2d3c7; }
.photo-item img, .photo-item video { width: 48px; height: 39px; object-fit: cover; border-radius: 2px; background: #262821; }
.photo-meta { min-width: 0; display: grid; gap: 4px; }
.photo-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; }
.photo-meta small { color: #96978b; font-size: 8px; }
.photo-meta small b { color: #68724b; font-weight: 700; }
.photo-actions { display: flex; gap: 2px; }
.photo-actions button { width: 25px; height: 25px; padding: 0; border: 0; background: transparent; color: #85867c; cursor: pointer; border-radius: 50%; }
.photo-actions button:hover { color: var(--ink); background: #deded4; }
.photo-actions button:disabled { opacity: .25; cursor: default; }
.analysis-panel { display: none; align-items: center; justify-content: space-between; gap: 16px; margin: -11px 0 20px; padding: 11px 12px; border: 1px solid #d5dac8; border-radius: 4px; background: #eef1e7; }
.analysis-panel.show { display: flex; }
.analysis-panel > div { display: flex; align-items: center; gap: 10px; }
.analysis-panel > div > span:last-child { display: grid; gap: 3px; }
.analysis-panel strong { font-size: 9px; }
.analysis-panel small { color: #7d806f; font-size: 8px; }
.analysis-score { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--olive); color: #fff; font: 12px/1 var(--serif); }
.analysis-panel button { border: 0; background: transparent; color: #6f735e; font-size: 8px; text-decoration: underline; cursor: pointer; }

.field-label { display: block; margin: 13px 0 7px; color: #77786e; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.text-field, .select-field { width: 100%; height: 41px; padding: 0 12px; border: 1px solid #d4d5ca; border-radius: 3px; background: #fffefa; color: var(--ink); outline: none; font-size: 11px; }
.text-field:focus, .select-field:focus { border-color: var(--olive); box-shadow: 0 0 0 2px #e9ebdf; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.format-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.format-button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 62px; padding: 0 5px; border: 1px solid #d5d6cc; border-radius: 3px; background: #fffefa; cursor: pointer; }
.format-button:hover { border-color: #aeb29c; }
.format-button.active { border-color: var(--olive); background: #f0f2e8; box-shadow: inset 0 0 0 1px var(--olive); }
.format-button i { display: block; border: 1.5px solid currentColor; color: #73756a; }
.format-button i.portrait { width: 10px; height: 17px; }
.format-button i.feed { width: 13px; height: 16px; }
.format-button i.square { width: 14px; height: 14px; }
.format-button span { display: grid; text-align: left; font-size: 9px; font-weight: 700; }
.format-button small { margin-top: 3px; color: #96978d; font-size: 8px; font-weight: 400; }
.select-field { margin-bottom: 7px; appearance: auto; font-size: 10px; }
.settings-row label:first-child { display: flex; justify-content: space-between; align-items: center; color: #6e7065; font-size: 10px; }
.settings-row label:first-child strong { color: var(--ink); font-size: 10px; }
input[type="range"] { --value: 35%; width: 100%; height: 3px; margin: 13px 0 20px; appearance: none; border-radius: 2px; background: linear-gradient(90deg, var(--olive) var(--value), #d9dacf var(--value)); }
input[type="range"]::-webkit-slider-thumb { width: 14px; height: 14px; appearance: none; border: 3px solid #fff; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 1px #a4a896; cursor: pointer; }
.music-heading { display: flex; align-items: center; justify-content: space-between; margin: 3px 0 10px; }
.music-heading span { color: #595b51; font-size: 10px; font-weight: 700; }
.music-heading em { color: #8c8e82; font-size: 8px; font-style: normal; }
.music-library { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 8px; }
.music-track { min-width: 0; height: 61px; display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 6px; padding: 6px; border: 1px solid #d7d8cd; border-radius: 3px; background: #fffefa; text-align: left; cursor: pointer; }
.music-track:hover { border-color: #adb09b; }
.music-track.active { border-color: var(--olive); background: #eef0e5; box-shadow: inset 0 0 0 1px var(--olive); }
.music-track i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e7e8df; color: #6e7556; font-size: 7px; font-style: normal; }
.music-track span { min-width: 0; display: grid; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; font-weight: 700; }
.music-track small { margin-top: 3px; overflow: hidden; color: #97988e; font-size: 7px; font-weight: 400; text-overflow: ellipsis; }
.music-row { display: grid; grid-template-columns: 36px 1fr 25px; align-items: center; gap: 10px; min-height: 56px; padding: 9px; border: 1px solid #d7d8cd; border-radius: 3px; background: #f7f6f1; cursor: pointer; }
.music-row:hover { background: #fff; border-color: #babcaa; }
.music-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e6e7dd; color: var(--olive-dark); }
.music-row > span:nth-child(3) { display: grid; gap: 4px; min-width: 0; }
.music-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.music-row small { color: #96978d; font-size: 8px; }
.add-music { font-size: 18px; color: #87887c; }

.preview-panel { min-width: 0; display: grid; grid-template-rows: 48px minmax(0, 1fr) 52px auto; background: var(--stage); color: #f4f2ea; position: relative; }
.preview-header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #2c2e28; color: #aeafa5; font-size: 8px; letter-spacing: .17em; }
.preview-header > div:first-child { display: flex; align-items: center; gap: 9px; }
.live-dot { display: inline-block; width: 6px; height: 6px; box-shadow: 0 0 0 3px #2d3528; }
.format-status { color: #7e8075; letter-spacing: .08em; }
.stage-area { min-height: 0; display: grid; place-items: center; padding: 22px; overflow: hidden; background: radial-gradient(circle at 50% 42%, #262821 0, #171814 58%); }
.canvas-shell { height: 100%; max-height: 70vh; max-width: 92%; aspect-ratio: 9 / 16; position: relative; overflow: hidden; background: #24251f; box-shadow: 0 24px 55px rgba(0,0,0,.45); transition: aspect-ratio .25s ease; }
#previewCanvas { width: 100%; height: 100%; display: block; }
.empty-message { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; background: linear-gradient(145deg, #24261f, #1e201b); }
.empty-message strong { margin-top: 24px; font: 21px/1.2 var(--serif); font-weight: 400; }
.empty-message small { max-width: 210px; margin-top: 9px; color: #84877b; font-size: 9px; line-height: 1.6; }
.empty-art { width: 92px; height: 70px; position: relative; }
.empty-art i { position: absolute; width: 48px; height: 58px; border: 1px solid #5c6052; background: #2b2e26; box-shadow: 0 8px 22px rgba(0,0,0,.2); }
.empty-art i:nth-child(1) { left: 0; top: 8px; transform: rotate(-9deg); }
.empty-art i:nth-child(2) { right: 0; top: 7px; transform: rotate(9deg); }
.empty-art i:nth-child(3) { left: 22px; top: 0; background: linear-gradient(140deg, #414536, #292c25); }
.big-play { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 54px; height: 54px; display: none; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: rgba(20,20,17,.42); color: #fff; backdrop-filter: blur(6px); cursor: pointer; }
.big-play:hover { transform: translate(-50%,-50%) scale(1.04); background: rgba(30,31,26,.72); }
.big-play svg, .transport-play svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.transport { display: grid; grid-template-columns: 36px auto 1fr 32px; align-items: center; gap: 12px; padding: 0 23px; border-top: 1px solid #2d2f29; border-bottom: 1px solid #2d2f29; }
.transport-play, .mute-button { display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #c7c8bd; cursor: pointer; }
.transport-play { width: 36px; height: 36px; border: 1px solid #3a3d35; border-radius: 50%; }
.transport-play:hover, .mute-button:hover { color: #fff; }
.transport-play .pause-symbol { display: none; }
.transport-play.playing .play-symbol { display: none; }
.transport-play.playing .pause-symbol { display: block; }
.timecode { color: #8c8f83; font-variant-numeric: tabular-nums; font-size: 9px; }
#timeline { margin: 0; height: 2px; background: linear-gradient(90deg, #c1c9a4 var(--value), #474a40 var(--value)); }
#timeline::-webkit-slider-thumb { width: 10px; height: 10px; border-color: var(--stage); background: #c1c9a4; }
.mute-button { width: 32px; height: 32px; }
.mute-button.muted { opacity: .35; }
.export-bar { min-height: 85px; display: flex; align-items: center; gap: 22px; justify-content: space-between; padding: 16px 23px; background: #1c1d19; }
.export-bar > div:first-child { min-width: 0; display: grid; gap: 5px; }
.export-bar strong { font-size: 11px; font-weight: 600; }
.export-bar span { color: #777a6f; font-size: 8px; }
.export-progress { display: none; width: min(260px, 34vw); height: 2px; margin-top: 3px; overflow: hidden; background: #393c34; }
.export-progress i { display: block; width: 0; height: 100%; background: #aebc82; transition: width .18s linear; }
.export-actions { display: flex; align-items: stretch; gap: 7px; }
.export-actions select { min-width: 114px; padding: 0 9px; border: 1px solid #3a3c35; border-radius: 2px; background: #242620; color: #c0c1b8; font-size: 8px; outline: none; }
.export-button { min-width: 150px; height: 44px; padding: 0 18px; border: 0; border-radius: 2px; background: #e6e2d5; color: #1f201c; cursor: pointer; }
.export-button:disabled { cursor: not-allowed; opacity: .38; }
.export-button:not(:disabled):hover { background: #f4f0e4; transform: translateY(-1px); }
.export-button span { color: inherit; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.button-label { display: flex; align-items: center; justify-content: center; gap: 9px; }
.button-busy { display: none; }
.export-button.exporting .button-label { display: none; }
.export-button.exporting .button-busy { display: inline; }
.compatibility-note { display: none; position: absolute; right: 23px; bottom: 4px; margin: 0; color: #927f60; font-size: 8px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 25px; transform: translate(-50%, 15px); padding: 12px 17px; border-radius: 3px; background: #f7f5ed; color: #262722; box-shadow: 0 12px 35px rgba(0,0,0,.24); font-size: 10px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  body { overflow: auto; }
  .topbar { height: 66px; padding: 0 18px; }
  .privacy-pill { display: none; }
  .workspace { display: block; height: auto; }
  .editor-panel { overflow: visible; padding: 25px 20px 35px; border-right: 0; }
  .preview-panel { min-height: 760px; grid-template-rows: 48px 560px 52px auto; }
  .canvas-shell { height: 520px; max-height: 520px; }
}

@media (max-width: 540px) {
  .grid-two { grid-template-columns: 1fr; gap: 24px; }
  .panel-heading h1 { font-size: 28px; }
  .preview-panel { min-height: 700px; grid-template-rows: 48px 500px 52px auto; }
  .canvas-shell { height: 460px; max-height: 460px; }
  .export-bar { align-items: stretch; flex-direction: column; gap: 12px; }
  .export-actions { display: grid; grid-template-columns: 1fr 1.3fr; }
  .export-button { width: 100%; }
  .format-status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
