/* ======================================================================
   STUDIO — the listing form (js/screens/listingForm.js).

   Numbered white cards down the left, a sticky live preview on the right,
   and a sticky action bar. Everything an owner has to decide is a control
   they can see the whole of - a pill, a segment, a card - rather than a
   dropdown they have to open to discover.
   ====================================================================== */
:root { --studio-line: #e5e7eb; --studio-amber: #f59e0b; }

.studio { display: grid; gap: 14px; padding: 12px 16px 0; align-items: start; }
.studio-form { display: grid; gap: 12px; min-width: 0; }
.studio-card {
  background: #fff; border: 1px solid var(--studio-line); border-radius: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%); padding: 16px;
}
.studio-scan { border-style: dashed; background: var(--brand-100); border-color: var(--brand-300); }
.studio-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--steel-900);
}
.step-n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--steel-900); color: var(--brand-300); font-size: 13px; letter-spacing: 0;
}
.field-hint { font-size: 11.5px; color: var(--color-neutral-600); margin-top: 5px; line-height: 1.45; }
.field-muted { opacity: .55; }
.studio .field > label { font-weight: 500; color: var(--steel-900); }
.studio .input { background: #fff; min-height: 40px; }

/* Currency and unit adornments on inputs. */
.aed-input, .unit-input {
  display: flex; align-items: stretch; border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  background: #fff; overflow: hidden;
}
.aed-input:focus-within, .unit-input:focus-within { border-color: var(--brand-500); }
.aed-input .input, .unit-input .input { border: 0; border-radius: 0; flex: 1; min-width: 0; }
.aed-input .prefix, .aed-input .unit, .unit-input .unit {
  display: grid; place-items: center; padding: 0 10px; font-size: 12px; white-space: nowrap;
  background: var(--color-neutral-100); color: var(--color-neutral-700); border-right: 1px solid var(--color-divider);
  font-family: var(--font-heading); letter-spacing: .06em; text-transform: uppercase;
}
.aed-input .unit, .unit-input .unit { border-right: 0; border-left: 1px solid var(--color-divider); text-transform: none; letter-spacing: 0; font-family: var(--font-body); }

/* ---- Rate matrix ------------------------------------------------------------ */
.hire-models { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.hire-model {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--studio-line); border-radius: 999px; font-size: 13px; background: #fff;
}
.hire-model input { accent-color: var(--studio-amber); width: 16px; height: 16px; margin: 0; }
.hire-model small { color: var(--color-neutral-600); font-size: 11px; }
.hire-model.on { border-color: var(--steel-900); background: var(--color-neutral-100); }
.rate-card { border: 1px solid var(--studio-line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fafafa; }
.rate-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rate-card-head strong { font-family: var(--font-heading); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.rate-card-head span { font-size: 12px; color: var(--color-neutral-600); }
.scope-toggle { display: inline-flex; border: 1px solid var(--studio-line); border-radius: 6px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.scope-toggle button {
  border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-family: var(--font-heading);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-neutral-700);
}
.scope-toggle button + button { border-left: 1px solid var(--studio-line); }
.scope-toggle button.on { background: var(--steel-900); color: var(--brand-300); }
.rate-fields { display: grid; gap: 10px; }
.terms-row { margin-top: 4px; }

/* ---- Pills --------------------------------------------------------------------- */
.pill-group { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--studio-line); background: #fff; border-radius: 999px; padding: 7px 13px;
  font-size: 12.5px; cursor: pointer; color: var(--color-neutral-800); font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill small { font-size: 10.5px; color: var(--color-neutral-600); }
.pill:hover { border-color: var(--brand-500); }
.pill.on { background: var(--steel-900); border-color: var(--steel-900); color: var(--brand-300); }
.pill.on small { color: color-mix(in srgb, var(--brand-300) 70%, transparent); }
.pill.on::before { content: "✓"; font-weight: 700; }

/* ---- Photos ----------------------------------------------------------------- */
.dropzone {
  border: 2px dashed var(--color-neutral-400); border-radius: 8px; padding: 22px 16px; text-align: center;
  cursor: pointer; background: var(--color-neutral-100); display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--color-neutral-700); font-size: 13.5px; transition: border-color .12s ease, background .12s ease;
}
.dropzone svg { width: 28px; height: 28px; color: var(--color-neutral-500); }
.dropzone .browse { color: var(--brand-700); text-decoration: underline; }
.dropzone small { font-size: 11.5px; color: var(--color-neutral-600); }
.dropzone.is-over, .dropzone:focus-visible { border-color: var(--studio-amber); background: var(--brand-100); }
.photo-rail { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.photo-rail:empty { display: none; }
.rail-item {
  position: relative; margin: 0; width: 132px; border: 1px solid var(--studio-line); border-radius: 6px;
  overflow: hidden; background: #fff;
}
.rail-item .photo-preview { width: 100%; max-width: none; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; border: 0; display: block; }
.rail-item.is-cover { border-color: var(--studio-amber); box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-amber) 35%, transparent); }
.cover-badge {
  position: absolute; top: 6px; left: 6px; background: var(--studio-amber); color: var(--brand-ink);
  font-family: var(--font-heading); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 3px; font-weight: 600;
}
.set-cover {
  position: absolute; left: 6px; bottom: 6px; border: 0; background: rgb(20 24 29 / 78%); color: #fff;
  font-size: 10.5px; padding: 4px 8px; border-radius: 3px; cursor: pointer; font-family: inherit;
}
.set-cover:hover { background: var(--steel-900); }
.rail-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / 92%); color: var(--color-neutral-700); display: grid; place-items: center; cursor: pointer;
  opacity: 0; transition: opacity .12s ease;
}
.rail-remove svg { width: 14px; height: 14px; }
.rail-item:hover .rail-remove, .rail-item:focus-within .rail-remove, .rail-remove:focus-visible { opacity: 1; }
.rail-remove:hover { color: #dc2626; }
.rail-progress {
  position: absolute; inset: auto 0 0 0; background: rgb(20 24 29 / 70%); color: #fff; font-size: 10.5px;
  text-align: center; padding: 3px;
}
.rail-item.is-uploading .photo-preview { opacity: .7; }
@media (hover: none) { .rail-remove { opacity: 1; } }

/* ---- Location ---------------------------------------------------------------- */
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.map-toolbar label { margin: 0; }
.map-toolbar .btn { font-size: 12px; min-height: 34px; padding: 4px 12px; gap: 6px; }
.map-toolbar .btn svg { width: 15px; height: 15px; }
.studio .map-canvas { border-radius: 6px; }

/* ---- Preview -------------------------------------------------------------------- */
/* One card, full width of the rail - not a cell of the feed's grid. */
.studio-preview { pointer-events: none; display: block !important; }
.studio-preview .machine-card { margin: 0; width: 100%; }
.strength { margin-top: 14px; border-top: 1px solid var(--studio-line); padding-top: 12px; }
.strength-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--color-neutral-700); }
.strength-head b { font-family: var(--font-heading); font-size: 16px; color: var(--steel-900); }
.strength-bar { height: 8px; background: var(--color-neutral-200); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.strength-bar span { display: block; height: 100%; background: #dc2626; transition: width .25s ease, background .25s ease; }
.strength-bar span.is-fair { background: var(--studio-amber); }
.strength-bar span.is-strong { background: #16a34a; }

/* ---- Action bar ------------------------------------------------------------------- */
.studio-actions {
  position: sticky; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); margin-top: 14px;
  background: #fff; border-top: 1px solid var(--studio-line); box-shadow: 0 -4px 14px rgb(15 23 42 / 6%);
}
.studio-actions .btn { min-height: 46px; flex: 1; font-size: 14px; }
.studio-actions .btn-primary { background: var(--studio-amber); border-color: var(--studio-amber); color: var(--brand-ink); font-weight: 700; flex: 2; }
.studio-actions .btn-primary:hover { background: #d97706; }
.studio-actions .btn-danger { color: #b91c1c; }
.studio-actions .btn:disabled { opacity: .55; }
.delete-confirm {
  margin: 0 16px; padding: 12px 14px; border: 1px solid #fecaca; background: #fef2f2; border-radius: 8px; font-size: 12.5px;
  color: var(--color-neutral-800);
}

/* ---- Layout ------------------------------------------------------------------------ */
@media (min-width: 1024px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) 360px; gap: 20px;
    max-width: var(--content-max); margin: 12px auto 0; padding: 0 var(--content-gutter); width: 100%;
  }
  .studio-card { padding: 20px 22px; }
  .studio-side { position: sticky; top: calc(var(--nav-h) + 12px); }
  .rate-fields { grid-template-columns: 1fr 1fr; }
  .studio-actions {
    position: sticky; bottom: 0; max-width: var(--content-max); margin: 14px auto 32px; width: 100%;
    padding: 12px var(--content-gutter); justify-content: flex-end; border-radius: 0;
  }
  .studio-actions .btn { flex: 0 0 auto; min-width: 160px; padding-inline: 22px; }
  .studio-actions .btn-primary { flex: 0 0 auto; min-width: 200px; }
  .delete-confirm { max-width: var(--content-max); margin: 0 auto; }
  .ph > .studio + .studio-actions { order: 0; }
}
