/* Ad Maker layout. Colors, font and base components come from house-style.css. */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.mark { width: 31px; height: 20px; fill: var(--ink); }
.name { font-weight: 700; font-size: 22px; letter-spacing: -0.03em; line-height: 1; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.intro {
  padding: 56px 24px 40px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end;
}
.intro p { margin: 0; font-size: 17px; max-width: 440px; }

.layout { display: grid; grid-template-columns: 340px 1fr; }
.panel {
  border-right: 1px solid var(--line); padding: 4px 24px 40px;
  position: sticky; top: 61px; align-self: start; max-height: calc(100vh - 61px); overflow-y: auto;
}
.panel section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.panel section:last-child { border: 0; }
.panel h2 { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-bottom: 14px; }

.drop {
  display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px;
  border: 1px dashed var(--line-strong); border-radius: var(--r); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--ink); background: var(--surface); }
.thumb {
  width: 52px; height: 52px; border-radius: var(--r-sm); flex: none; overflow: hidden;
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb img:not([src]), .thumb img[src=''] { visibility: hidden; }
.drop-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.drop-text small { color: var(--muted); font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.field small { color: var(--muted); font-weight: 400; }
.field .input { font-size: 14px; font-weight: 400; }
select.input { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
.row { display: flex; gap: 8px; }
.row .icon-btn { flex: none; width: 42px; height: 42px; border-radius: var(--r-sm); }

.colors { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatch {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--pill); font-size: 13px; font-weight: 600;
}
.swatch input { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.swatch input::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 50%; }
.swatch input::-moz-color-swatch { border: 1px solid var(--line); border-radius: 50%; }

main { padding: 24px 24px 48px; min-width: 0; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.player { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 200px; }

/* timeline slider */
input[type='range'] { flex: 1; appearance: none; height: 4px; border-radius: 4px; background: var(--surface-2); cursor: pointer; }
input[type='range']::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--ink);
}
input[type='range']::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); }

.gallery { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(var(--card-min, 220px), 1fr)); }
.gallery.square { --card-min: 270px; }
.gallery.wide { --card-min: 380px; }
.ad { padding: 10px; }
.stage { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.stage canvas { display: block; width: 100%; height: 100%; }
.ad .meta { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px 2px; gap: 8px; }
.ad .meta b { font-size: 14px; font-weight: 600; }
.ad .meta .btn { padding: 7px 12px; font-size: 13px; }
.progress { position: absolute; inset: auto 0 0 0; height: 4px; background: rgba(0, 0, 0, 0.3); display: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--glow); }
.ad.recording .progress { display: block; }
.note { font-size: 13px; margin-top: 20px; }

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; gap: 16px; padding: 36px 16px 28px; }
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 4px 16px 24px; }
  main { padding: 20px 16px 40px; }
  .top { padding: 12px 16px; }
}

textarea.input { resize: vertical; min-height: 64px; line-height: 1.45; }
.ai { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 4px; }
.ai-status { font-size: 13px; margin: 0; }
.ai-status:empty { display: none; }
.ad .title { display: flex; flex-direction: column; min-width: 0; }
.ad .title small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
