:root {
  --ink: #17201d;
  --muted: #69736e;
  --line: #dfe4e1;
  --paper: #ffffff;
  --canvas: #f3f5f3;
  --green: #123c34;
  --green-2: #1e5b4e;
  --green-soft: #e9f1ee;
  --gold: #cba66c;
  --danger: #a63c32;
  --shadow: 0 18px 55px rgba(23, 40, 34, 0.09);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Manrope", sans-serif; letter-spacing: -0.035em; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--green-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: "Manrope", sans-serif;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.brand-lockup--light { color: white; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 0.95fr);
}
.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 44px 54px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(145deg, rgba(10, 40, 33, 0.93), rgba(18, 65, 53, 0.76)),
    url("https://images.unsplash.com/photo-1600566753086-00f18fb6b3ea?auto=format&fit=crop&w=1600&q=80") center/cover;
}
.login-visual::after {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -110px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.025);
}
.login-copy {
  position: absolute;
  z-index: 1;
  left: 54px;
  bottom: 120px;
  max-width: 600px;
}
.login-copy .eyebrow { color: #d6bd93; }
.login-copy h1 { margin-bottom: 25px; font-size: clamp(52px, 6vw, 88px); line-height: .98; }
.login-copy > p:last-child { max-width: 540px; margin: 0; color: rgba(255,255,255,.8); font-size: 18px; line-height: 1.65; }
.login-note { position: absolute; left: 54px; bottom: 42px; color: rgba(255,255,255,.58); font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: 48px; background: #fafbf9; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin-bottom: 9px; font-size: 38px; }
.login-card > .muted { margin-bottom: 34px; }
.mobile-brand { display: none; margin-bottom: 44px; }

.field { display: grid; gap: 9px; margin-bottom: 18px; }
.field > span { font-size: 13px; font-weight: 700; }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid #cfd6d2;
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  background: white;
  transition: border .18s, box-shadow .18s;
}
.field input:focus, .field select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(30,91,78,.1); }
.form-error { min-height: 20px; margin: 0 0 12px; color: var(--danger); font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.button {
  min-height: 43px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  transition: transform .15s, background .15s, border .15s, opacity .15s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button--primary { color: white; background: var(--green); }
.button--primary:hover { background: #174a40; }
.button--secondary { border-color: #ccd5d1; background: white; }
.button--secondary:hover { border-color: #9eb0a8; }
.button--ghost { background: transparent; }
.button--wide { width: 100%; min-height: 52px; }
.text-button { padding: 4px; border: 0; cursor: pointer; color: var(--muted); background: transparent; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.topbar-actions { display: flex; align-items: center; gap: 24px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: #466259; font-size: 12px; font-weight: 700; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #2ea46e; box-shadow: 0 0 0 4px #dff3e9; }

.workspace { display: grid; min-height: calc(100vh - 72px); grid-template-columns: 286px 1fr; }
.property-rail { min-width: 0; padding: 27px 18px; border-right: 1px solid var(--line); background: #fafbf9; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 18px; }
.rail-heading h2 { margin: 0; font-size: 22px; }
.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 22px;
  background: white;
}
.property-list { display: grid; min-width: 0; gap: 7px; }
.property-item {
  min-width: 0;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  background: transparent;
}
.property-item:hover { background: #f0f3f0; }
.property-item.is-active { border-color: #cbd8d2; background: var(--green-soft); }
.property-item strong { display: block; width: 100%; margin-bottom: 5px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.property-item span { color: var(--muted); font-size: 11px; }
.rail-empty { display: grid; gap: 5px; padding: 25px 10px; color: var(--muted); font-size: 12px; }

.main-canvas { min-width: 0; padding: 35px clamp(25px, 4vw, 68px) 70px; }
.welcome-state { display: grid; min-height: calc(100vh - 180px); place-items: center; align-content: center; text-align: center; }
.welcome-icon { display: grid; width: 66px; height: 66px; place-items: center; margin-bottom: 25px; border-radius: 50%; color: white; background: var(--green); font-size: 32px; }
.welcome-state h1 { max-width: 640px; margin: 0 0 18px; font-size: clamp(34px, 4vw, 54px); }
.welcome-state > p:not(.eyebrow) { max-width: 610px; margin: 0 0 30px; color: var(--muted); line-height: 1.65; }

.project-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 29px; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 10px; color: #84908b; font-size: 12px; }
.breadcrumb b { font-weight: 400; }
.project-header h1 { margin: 0 0 12px; font-size: clamp(31px, 3.6vw, 49px); }
.project-facts { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.project-facts i { width: 3px; height: 3px; border-radius: 50%; background: #a8b1ad; }
.project-actions { display: flex; flex: 0 0 auto; gap: 9px; }

.preset-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
  padding: 21px 23px;
  border: 1px solid #cddbd5;
  border-radius: 12px;
  background: linear-gradient(105deg, #edf4f1, #f8faf9);
}
.preset-symbol { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 25px; }
.preset-copy h3 { margin: 0 0 5px; font-size: 17px; }
.preset-copy p:last-child { margin: 0; color: #617069; font-size: 12px; line-height: 1.5; }
.status-chip { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-chip--ready { color: #1a674c; background: #d9eee4; }
.status-chip--queued { color: #855c13; background: #f5e9cf; }
.example-link { color: var(--green); font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.example-link:hover { text-decoration: underline; }

.video-builder-panel { padding: 28px; }
.video-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.video-type-card {
  position: relative;
  min-height: 150px;
  padding: 16px;
  border: 1px solid #d9dfdc;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  background: #fbfcfb;
  transition: border .16s, background .16s, transform .16s;
}
.video-type-card:hover { border-color: #a9bab2; transform: translateY(-1px); }
.video-type-card.is-selected { border-color: var(--green-2); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green-2); }
.video-type-card strong { display: block; margin: 30px 0 7px; font-family: "Manrope", sans-serif; font-size: 13px; line-height: 1.25; }
.video-type-card small { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
.video-type-tag { position: absolute; top: 13px; left: 13px; padding: 4px 7px; border-radius: 999px; color: #496158; background: #edf1ef; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.video-type-card.is-selected .video-type-tag { color: white; background: var(--green); }
.director-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 30px 0 15px; padding-top: 25px; border-top: 1px solid var(--line); }
.director-heading h3 { margin: 0; font-size: 19px; }
.director-heading > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.video-control-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.video-control-grid .field { margin-bottom: 0; }
.format-and-audio { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, .8fr); gap: 20px; margin-top: 22px; }
.format-control > span { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.format-toggle { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 9px; background: #edf1ef; }
.format-toggle button { min-height: 42px; border: 0; border-radius: 7px; cursor: pointer; color: #65716c; background: transparent; font-size: 11px; font-weight: 800; }
.format-toggle button.is-active { color: white; background: var(--green); box-shadow: 0 4px 12px rgba(18,60,52,.16); }
.audio-control .field { margin: 0; }
.studio-toggles { display: flex; flex-wrap: wrap; gap: 18px 25px; margin-top: 20px; padding: 17px 0; border-top: 1px solid var(--line); }
.studio-toggles label { display: flex; align-items: center; gap: 9px; cursor: pointer; color: #44524c; font-size: 11px; font-weight: 650; }
.studio-toggles input { position: absolute; opacity: 0; pointer-events: none; }
.studio-toggles label > span { position: relative; width: 34px; height: 19px; border-radius: 999px; background: #cbd3cf; transition: background .18s; }
.studio-toggles label > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: white; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.studio-toggles input:checked + span { background: var(--green-2); }
.studio-toggles input:checked + span::after { transform: translateX(15px); }
.truth-strip { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 3px; color: #6c7772; font-size: 10px; }
.truth-strip b, .truth-strip span { padding: 6px 9px; border-radius: 6px; background: #f0f3f1; }
.truth-strip b { color: #285046; }

.panel { margin-bottom: 25px; padding: 25px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 3px 15px rgba(23,40,34,.025); }
.panel-heading, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2, .section-heading h2 { margin: 0; font-size: 22px; }
.panel-hint, .section-heading > p { margin: 0; color: var(--muted); font-size: 12px; }
.dropzone {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed #aebcb5;
  border-radius: 11px;
  cursor: pointer;
  color: var(--muted);
  background: #f8faf8;
  transition: background .18s, border .18s;
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--green-2); background: #eff5f2; }
.dropzone strong { color: var(--ink); font-size: 15px; }
.dropzone span:last-child { font-size: 12px; }
.upload-icon { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 3px; border: 1px solid #cad5d0; border-radius: 50%; color: var(--green-2); font-size: 20px; background: white; }
.upload-progress { margin-top: 17px; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e8edea; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green-2); transition: width .2s; }

.photo-workspace { margin: 34px 0; }
.room-groups { display: grid; gap: 20px; }
.room-group { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; }
.room-group-heading { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; border-bottom: 1px solid var(--line); background: #fafbf9; }
.room-group-heading strong { font-family: "Manrope", sans-serif; font-size: 14px; }
.room-group-heading span { color: var(--muted); font-size: 11px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; background: var(--line); }
.photo-card { min-width: 0; background: white; }
.photo-preview { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #e7ece9; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.photo-card:hover img { transform: scale(1.025); }
.photo-index { position: absolute; top: 10px; left: 10px; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; color: white; background: rgba(15,33,28,.76); font-size: 10px; font-weight: 800; backdrop-filter: blur(6px); }
.photo-info { padding: 13px; }
.photo-name { display: block; margin-bottom: 10px; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.photo-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 7px; }
.room-select { min-width: 0; height: 36px; padding: 0 9px; border: 1px solid #d5dcd8; border-radius: 7px; color: #34413c; background: white; font-size: 11px; }
.motion-select { min-width: 0; height: 36px; padding: 0 7px; border: 1px solid #d5dcd8; border-radius: 7px; color: #34413c; background: white; font-size: 10px; }
.delete-photo { width: 36px; height: 36px; border: 1px solid #ead9d6; border-radius: 7px; cursor: pointer; color: #a34d43; background: #fffafa; }

.jobs-panel { margin-top: 31px; }
.job-list { display: grid; gap: 9px; }
.job-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.job-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 8px; color: white; background: var(--green); }
.job-copy strong { display: block; margin-bottom: 4px; font-size: 13px; }
.job-copy span { color: var(--muted); font-size: 11px; }
.small-empty { padding: 20px 0 4px; color: var(--muted); font-size: 12px; text-align: center; }

.modal { width: min(560px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 14px; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(12,28,23,.48); backdrop-filter: blur(4px); }
.modal-card { padding: 27px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 25px; }
.modal-heading h2 { margin: 0; font-size: 27px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer; color: #6e7a75; background: #f0f3f1; font-size: 23px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 390px; padding: 13px 17px; border-radius: 9px; color: white; background: #193d35; box-shadow: 0 14px 35px rgba(0,0,0,.16); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #8d3b34; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 30px; }
  .mobile-brand { display: inline-flex; }
  .workspace { grid-template-columns: 1fr; }
  .property-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .property-list { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .project-header { align-items: flex-start; flex-direction: column; }
  .project-actions { width: 100%; }
  .project-actions .button { flex: 1; }
  .video-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar { height: 62px; padding: 0 16px; }
  .topbar .brand-mark { width: 32px; height: 32px; }
  .live-pill { display: none; }
  .workspace { min-height: calc(100vh - 62px); }
  .main-canvas { padding: 25px 15px 55px; }
  .property-rail { padding: 18px 10px; }
  .project-header h1 { font-size: 29px; }
  .project-facts { flex-wrap: wrap; }
  .preset-banner { grid-template-columns: auto 1fr; }
  .preset-banner .example-link { grid-column: 1 / -1; }
  .panel { padding: 18px; }
  .panel-heading, .section-heading { align-items: flex-start; flex-direction: column; }
  .panel-hint { line-height: 1.45; }
  .photo-grid { grid-template-columns: 1fr; }
  .video-type-grid, .video-control-grid, .format-and-audio { grid-template-columns: 1fr; }
  .format-toggle { grid-template-columns: 1fr; }
  .photo-controls { grid-template-columns: 1fr 1fr auto; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}
