/* Axadle Social Studio — modal UI (the image itself is drawn in social-studio.js). */
.atp-ss-lock, .atp-ss-lock body { overflow: hidden; }
.atp-ss { --ss-bg: #0b1626; --ss-panel: #0f1d31; --ss-line: rgba(148, 178, 222, .16); --ss-text: #e8eef7; --ss-muted: #8fa2bd; --ss-accent: #3b9eff;
  color: var(--ss-text); font-family: Inter, system-ui, sans-serif; inset: 0; position: fixed; z-index: 100000; }
.atp-ss[hidden] { display: none; }
.atp-ss-backdrop { background: rgba(2, 6, 14, .72); backdrop-filter: blur(6px); inset: 0; opacity: 0; position: absolute; transition: opacity .18s ease; }
.atp-ss.is-open .atp-ss-backdrop { opacity: 1; }
.atp-ss-dialog { background: var(--ss-bg); display: flex; flex-direction: column; inset: 0; opacity: 0; overflow: hidden; position: absolute; transform: translateY(12px); transition: opacity .18s ease, transform .18s ease; }
.atp-ss.is-open .atp-ss-dialog { opacity: 1; transform: none; }
.atp-ss *, .atp-ss *::before, .atp-ss *::after { box-sizing: border-box; }
.atp-ss button { font-family: inherit; letter-spacing: normal; line-height: 1.2; text-transform: none; }

.atp-ss-head { align-items: center; border-bottom: 1px solid var(--ss-line); display: flex; gap: 1rem; justify-content: space-between; padding: .85rem 1rem; }
.atp-ss-eyebrow { color: var(--ss-accent); display: block; font-size: .62rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.atp-ss-title { color: #fff; font-size: 1.05rem; font-weight: 800; line-height: 1.25; margin: .15rem 0 0; }
.atp-ss-title small { color: var(--ss-muted); display: block; font-size: .72rem; font-weight: 600; }
.atp-ss-x { align-items: center; background: rgba(255, 255, 255, .06); border: 1px solid var(--ss-line); border-radius: 50%; color: #fff; cursor: pointer; display: inline-flex; flex: 0 0 auto; height: 40px; justify-content: center; width: 40px; }
.atp-ss-x:hover { background: rgba(255, 255, 255, .12); }

.atp-ss-body { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.atp-ss-stage { align-items: center; background:
    radial-gradient(60% 60% at 50% 40%, rgba(59, 158, 255, .08), transparent 70%),
    repeating-conic-gradient(#0d192b 0% 25%, #0a1524 0% 50%) 50% / 22px 22px;
  display: flex; flex-direction: column; gap: .5rem; justify-content: center; padding: 1rem; }
.atp-ss-canvas-wrap { align-items: center; display: flex; height: min(52vh, 460px); justify-content: center; width: 100%; }
.atp-ss-canvas-wrap canvas { display: block; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55)); height: 100%; object-fit: contain; width: 100%; }
.atp-ss-size { color: var(--ss-muted); font-size: .68rem; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: .06em; margin: 0; }

.atp-ss-controls { display: grid; gap: 1.1rem; padding: 1rem 1rem 1.25rem; }
.atp-ss-group h3 { align-items: baseline; color: #fff; display: flex; font-size: .74rem; font-weight: 850; gap: .45rem; letter-spacing: .1em; margin: 0 0 .6rem; text-transform: uppercase; }
.atp-ss-group h3 span { color: var(--ss-muted); font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: none; }

/* Template tiles */
.atp-ss-templates { display: grid; gap: .5rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.atp-ss-tpl { background: var(--ss-panel); border: 1.5px solid var(--ss-line); border-radius: 12px; color: var(--ss-text); cursor: pointer; display: flex; flex-direction: column; gap: .45rem; padding: .45rem .45rem .55rem; text-align: center; transition: border-color .15s ease, transform .15s ease; }
.atp-ss-tpl span { font-size: .68rem; font-weight: 700; line-height: 1.2; }
.atp-ss-tpl i { aspect-ratio: 4 / 5; border-radius: 7px; display: block; overflow: hidden; position: relative; }
.atp-ss-tpl:hover { transform: translateY(-1px); }
.atp-ss-tpl.is-active { border-color: var(--ss-accent); box-shadow: 0 0 0 3px rgba(59, 158, 255, .2); }
.t-photo { background: linear-gradient(180deg, transparent 35%, rgba(4, 10, 20, .95)), linear-gradient(135deg, #5b7aa6, #23395b); }
.t-photo::after { background: #fff; border-radius: 2px; bottom: 18%; box-shadow: 0 7px 0 #fff, 0 14px 0 rgba(255,255,255,.6); content: ""; height: 4px; left: 12%; position: absolute; width: 70%; }
.t-breaking { background: linear-gradient(180deg, #5b7aa6 0 48%, #e11d48 48% 58%, #07111f 58%); }
.t-breaking::after { background: #fff; border-radius: 2px; box-shadow: 0 7px 0 #fff; content: ""; height: 4px; left: 12%; position: absolute; top: 68%; width: 70%; }
.t-quote { background: radial-gradient(80% 60% at 20% 15%, rgba(59,158,255,.45), transparent), #0b1626; }
.t-quote::before { color: #3b9eff; content: "\201C"; font: 600 2.4rem/1 Georgia, serif; left: 10%; position: absolute; top: 4%; }
.t-quote::after { background: #fff; border-radius: 2px; box-shadow: 0 7px 0 #fff, 0 14px 0 rgba(255,255,255,.6); content: ""; height: 3px; left: 12%; position: absolute; top: 50%; width: 72%; }
.t-editorial { background: #f7f5f0; }
.t-editorial::before { background: linear-gradient(135deg, #5b7aa6, #23395b); border-radius: 4px; content: ""; height: 42%; left: 10%; position: absolute; right: 10%; top: 16%; }
.t-editorial::after { background: #121212; border-radius: 2px; box-shadow: 0 7px 0 #121212; content: ""; height: 4px; left: 10%; position: absolute; top: 68%; width: 70%; }

/* Format chips */
.atp-ss-chips { display: grid; gap: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.atp-ss-chip { align-items: center; background: var(--ss-panel); border: 1.5px solid var(--ss-line); border-radius: 12px; color: #fff; cursor: pointer; display: flex; font-size: .82rem; font-weight: 800; gap: .55rem; padding: .6rem .7rem; text-align: left; }
.atp-ss-chip small { color: var(--ss-muted); display: block; font-size: .64rem; font-weight: 600; margin-left: auto; }
.atp-ss-chip b { border: 2px solid currentColor; border-radius: 3px; display: inline-block; flex: 0 0 auto; opacity: .8; }
.f-square { height: 16px; width: 16px; } .f-portrait { height: 18px; width: 14px; } .f-story { height: 20px; width: 11px; } .f-link { height: 11px; width: 20px; }
.atp-ss-chip.is-active { border-color: var(--ss-accent); background: rgba(59, 158, 255, .1); }
.atp-ss-chip.is-active b { color: var(--ss-accent); opacity: 1; }

/* Photos */
.atp-ss-photos { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.atp-ss-thumb, .atp-ss-upload, .atp-ss-nophoto { align-items: center; background: var(--ss-panel) center / cover no-repeat; border: 2px solid var(--ss-line); border-radius: 10px; cursor: pointer; display: inline-flex; flex: 0 0 auto; flex-direction: column; gap: .15rem; height: 64px; justify-content: center; width: 64px; }
.atp-ss .atp-ss-upload, .atp-ss .atp-ss-nophoto { color: var(--ss-muted); font-size: .62rem; font-weight: 700; }
.atp-ss-upload:hover, .atp-ss-nophoto:hover { color: #fff; }
.atp-ss-thumb.is-active, .atp-ss-nophoto.is-active { border-color: var(--ss-accent); box-shadow: 0 0 0 3px rgba(59, 158, 255, .22); }
.atp-ss-sliders { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; margin-top: .75rem; }
.atp-ss-sliders label { display: grid; gap: .3rem; }
.atp-ss-sliders span { color: var(--ss-text); font-size: .7rem; font-weight: 700; }
.atp-ss-sliders small { color: var(--ss-muted); font-weight: 600; }
.atp-ss input[type="range"] { accent-color: var(--ss-accent); width: 100%; }

/* Text */
.atp-ss-field { display: grid; gap: .3rem; }
.atp-ss-field > span { align-items: baseline; color: var(--ss-text); display: flex; font-size: .7rem; font-weight: 700; justify-content: space-between; }
.atp-ss-field small { color: var(--ss-muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.atp-ss-field textarea, .atp-ss-field input { background: #081221; border: 1.5px solid var(--ss-line); border-radius: 10px; color: #fff; font: 600 .92rem/1.45 Inter, system-ui, sans-serif; padding: .6rem .75rem; resize: vertical; width: 100%; }
.atp-ss-field textarea:focus, .atp-ss-field input:focus { border-color: var(--ss-accent); outline: none; box-shadow: 0 0 0 3px rgba(59, 158, 255, .18); }
.atp-ss-row { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; margin-top: .6rem; }
.atp-ss-accents { align-items: center; display: flex; gap: .5rem; margin-top: .75rem; }
.atp-ss-accents span { color: var(--ss-muted); font-size: .7rem; font-weight: 700; margin-right: .2rem; }
.atp-ss-accents button { background: var(--c); border: 2px solid rgba(255, 255, 255, .15); border-radius: 50%; cursor: pointer; height: 28px; width: 28px; }
.atp-ss-accents button.is-active { box-shadow: 0 0 0 2px var(--ss-bg), 0 0 0 4px var(--c); }

/* Actions */
.atp-ss-actions { align-items: center; background: rgba(8, 16, 30, .96); border-top: 1px solid var(--ss-line); display: flex; gap: .5rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); position: relative; }
.atp-ss-btn { align-items: center; border-radius: 12px; cursor: pointer; display: inline-flex; font-size: .86rem; font-weight: 800; gap: .45rem; justify-content: center; min-height: 48px; padding: 0 1rem; transition: filter .15s ease, background .15s ease; }
.atp-ss-btn.is-ghost { background: transparent; border: 1.5px solid var(--ss-line); color: #fff; }
.atp-ss-btn.is-ghost:hover { background: rgba(255, 255, 255, .06); }
.atp-ss-btn.is-primary { background: linear-gradient(180deg, #ff3b5c, #e11d48); border: 0; box-shadow: 0 10px 24px rgba(225, 29, 72, .35); color: #fff; flex: 1; }
.atp-ss-btn.is-primary:hover { filter: brightness(1.08); }
.atp-ss-btn[hidden] { display: none; }
.atp-ss-toast { background: #16a34a; border-radius: 999px; bottom: calc(100% + .6rem); color: #fff; font-size: .78rem; font-weight: 700; left: 50%; opacity: 0; padding: .5rem .95rem; pointer-events: none; position: absolute; transform: translate(-50%, 6px); transition: opacity .2s ease, transform .2s ease; white-space: nowrap; }
.atp-ss-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .atp-ss-btn.is-ghost span { display: none; }
  .atp-ss-btn.is-ghost { padding: 0 .9rem; }
}

/* Desktop: centred dialog, preview left, controls right. */
@media (min-width: 900px) {
  .atp-ss-dialog { border: 1px solid var(--ss-line); border-radius: 22px; box-shadow: 0 40px 120px rgba(0, 0, 0, .6); height: min(860px, calc(100vh - 48px)); inset: 50% auto auto 50%; max-width: 1180px; transform: translate(-50%, calc(-50% + 12px)); width: calc(100vw - 48px); }
  .atp-ss.is-open .atp-ss-dialog { transform: translate(-50%, -50%); }
  .atp-ss-head { padding: 1rem 1.4rem; }
  .atp-ss-title { font-size: 1.2rem; }
  .atp-ss-title small { display: inline; margin-left: .4rem; }
  .atp-ss-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); overflow: hidden; }
  .atp-ss-stage { border-right: 1px solid var(--ss-line); min-height: 0; padding: 1.5rem; position: relative; }
  .atp-ss-canvas-wrap { height: auto; inset: 1.5rem 1.5rem 2.75rem; position: absolute; width: auto; }
  .atp-ss-size { bottom: 1rem; left: 0; position: absolute; right: 0; text-align: center; }
  .atp-ss-controls { align-content: start; overflow-y: auto; padding: 1.25rem 1.4rem 1.5rem; }
  .atp-ss-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atp-ss-actions { justify-content: flex-end; padding: .9rem 1.4rem; }
  .atp-ss-btn.is-primary { flex: 0 0 auto; min-width: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  .atp-ss-dialog, .atp-ss-backdrop, .atp-ss-tpl { transition: none; }
}
