/* oglas.ponudnik.eu: one phone-width column, Ponudnik brand (Ink, Construction Orange, Paper),
   Inter for the UI and Archivo for titles, as in EHC.Client/static/brand. Tap targets 48 px,
   form fields 16 px so iOS does not zoom. */
:root {
  --bg: #F7F5F1; --surface: #FFFFFF; --ink: #15171B; --muted: #6A665F; --line: #E5E0D7;
  --orange: #F26A1B; --orange-deep: #C9530F; --orange-tint: #FDE9DC;
  --good: #2D7A4C; --good-tint: #E3F2E8; --bad: #B3261E; --bad-tint: #FBE6E4;
  --frame: #15171B;
  --display: "Archivo", "Inter", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #101114; --surface: #1A1C20; --ink: #F1EEE8; --muted: #A29E97; --line: #2C2F35;
  --orange: #F47A33; --orange-deep: #F59A62; --orange-tint: #3A2416;
  --good: #63C08A; --good-tint: #17301F; --bad: #F2857C; --bad-tint: #3A1A18;
  --frame: #000000; color-scheme: dark } }

* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); -webkit-text-size-adjust: 100% }
.app { max-width: 520px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) }
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px }
.bar img { width: 30px; height: 30px; flex: none }
.bar h1 { font: 800 19px/1.2 var(--display); margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.icon-btn { border: 0; background: var(--surface); color: var(--ink); min-width: 44px; height: 44px; border-radius: 12px; font: 600 15px var(--body); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); padding: 0 12px; flex: none }
h2 { font: 700 12.5px/1.3 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 10px }
.stack { display: grid; gap: 10px }
.card { background: var(--surface); border-radius: 14px; padding: 14px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0 }
a.card, button.card { display: block; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; text-decoration: none }
.t { font-weight: 600 }
.s, .note { color: var(--muted); font-size: 13.5px }
.row { display: flex; gap: 12px; align-items: center; min-width: 0 }
.grow { flex: 1; min-width: 0 }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; min-height: 50px; padding: 0 16px; font: 600 16px var(--body); cursor: pointer; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); width: 100%; text-decoration: none }
.btn.primary { background: var(--orange); color: #fff; box-shadow: none }
.btn.primary:active { background: var(--orange-deep) }
.btn:disabled { opacity: .5; cursor: not-allowed }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px }
.field { display: grid; gap: 6px }
.field span { font-size: 13.5px; font-weight: 600 }
.field input { font: 16px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 50px; padding: 0 14px; width: 100% }
.err { background: var(--bad-tint); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 14px }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--orange-tint); color: var(--orange-deep); white-space: nowrap }
.pill.ok { background: var(--good-tint); color: var(--good) }
.pill.no { background: var(--bad-tint); color: var(--bad) }
.pill.q { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line) }
.prog { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px }
.prog i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .3s linear }
.thumbs { display: flex; flex: none }
.thumbs img, .thumbs span { width: 34px; height: 60px; object-fit: cover; border-radius: 6px; border: 2px solid var(--surface); margin-left: -12px; background: var(--line) }
.thumbs > :first-child { margin-left: 0 }
.drop { position: relative; display: grid; place-items: center; gap: 4px; text-align: center; padding: 22px 16px; border-radius: 14px; border: 2px dashed var(--orange); background: var(--orange-tint); cursor: pointer }
.drop strong { font: 800 18px var(--display) }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer }
.vthumb { width: 54px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--frame); flex: none }
.group-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline }
.group-h .q { font-weight: 600; font-size: 14.5px }
.takes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px }
.take { display: grid; gap: 4px; text-decoration: none; color: inherit; min-width: 0 }
.take .im { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--frame) }
.take .im img { width: 100%; height: 100%; object-fit: cover; display: block }
.take .im .dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.7); color: #fff; font: 600 11px var(--body); padding: 1px 5px; border-radius: 4px }
.take .nm { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.player { width: 100%; max-height: 62vh; aspect-ratio: 9 / 16; background: var(--frame); border-radius: 16px; display: block; object-fit: contain }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px }
.kv dt { color: var(--muted) }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere }
.words { font-size: 16px; line-height: 1.6 }
.words span { cursor: pointer; border-radius: 4px; padding: 0 1px }
.words span.low { text-decoration: underline dotted var(--muted) }
.words span.on { background: var(--orange-tint); color: var(--orange-deep) }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20 }
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

/* --- editor ------------------------------------------------------------------------------ */
.preview { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px }
.frame { position: relative; width: min(100%, 300px, 30vh); aspect-ratio: 9 / 16; background: var(--frame); border-radius: 18px; overflow: hidden; color: #fff }
.frame .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000 }
.frame .layer { position: absolute; inset: 0 }
.safe { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(242,106,27,.28) 0 6px, rgba(242,106,27,.12) 6px 12px); pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 3 }
.frame.showsafe .safe { opacity: 1 }
.safe span { position: absolute; left: 8px; font-size: 9.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px #000 }
/* Captions: an approximation of the ad project's four looks (Captions5.tsx) */
.cap { position: absolute; left: 7%; right: 7%; text-align: center; z-index: 4; pointer-events: none }
.cap .kick { display: inline-block; background: #F26A1B; color: #fff; font: 700 10px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; padding: 5px 7px; border-radius: 4px; margin-bottom: 6px }
.cap .txt { font: 700 17px/1.2 var(--body); text-shadow: 0 2px 10px rgba(0,0,0,.7); text-wrap: balance }
.cap .acc { color: #FF8A3D }
.cap.st-sticker .txt { display: inline-block; background: #fff; color: #15171B; text-shadow: none; padding: 6px 10px; border-radius: 8px; transform: rotate(-2deg); box-shadow: 0 6px 18px rgba(0,0,0,.3) }
.cap.st-sticker .acc { color: #C9530F }
.cap.st-words .txt { font-size: 21px; font-weight: 800 }
.cap.st-bold .txt { font: 800 22px/1.05 var(--display); text-transform: uppercase }
.cap.st-bold .acc { color: #15171B; background: #F26A1B; padding: 0 4px; border-radius: 3px; text-shadow: none }
.ctaCard { z-index: 2; background: rgba(21,23,27,.55); display: grid; align-content: center; justify-items: center; gap: 12px; padding: 0 10%; text-align: center }
.ctaCard img { width: 64% }
.ctaCard .line { font: 800 20px/1.2 var(--display); text-wrap: balance }
.ctaCard .cnote { font-size: 12px; opacity: .9 }
.ctaCard .url { font-weight: 700; background: #F26A1B; padding: 8px 14px; border-radius: 10px; font-size: 14px }
.ctrl { display: flex; gap: 10px; align-items: center; width: 100% }
.play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; font-size: 16px; cursor: pointer; flex: none }
.time { font: 500 13px var(--body); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 84px; text-align: right }
.segs { display: flex; gap: 3px; flex: 1; min-width: 0; height: 44px; position: relative }
.seg { border: 0; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: 600 11px var(--body); color: var(--ink); cursor: pointer; padding: 0 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0 }
.seg.sel { box-shadow: inset 0 0 0 2px var(--orange); background: var(--orange-tint) }
.head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); pointer-events: none; border-radius: 1px }
.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); margin-top: 16px }
.tabs button { flex: 1; border: 0; background: transparent; min-height: 40px; padding: 0 2px; border-radius: 9px; font: 600 13.5px var(--body); color: var(--muted); cursor: pointer }
.tabs button[aria-selected="true"] { background: var(--orange); color: #fff }
.takesRow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory }
.takeBtn { flex: 0 0 132px; scroll-snap-align: start; display: grid; gap: 4px; text-align: left; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px; padding: 6px; cursor: pointer; color: var(--ink); font: inherit }
.takeBtn.sel { box-shadow: inset 0 0 0 2px var(--orange); background: var(--orange-tint) }
.takeBtn img, .takeBtn .noimg { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: var(--frame); display: block }
.takeBtn .tl { font-size: 12px; font-weight: 600 }
.takeBtn .tq { font-size: 11.5px; color: var(--muted); line-height: 1.3 }
.words span.in { background: var(--orange-tint); color: var(--orange-deep) }
.words span.out { color: var(--muted) }
.seg2 { display: inline-flex; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 3px; gap: 3px }
.seg2 button { border: 0; background: transparent; border-radius: 8px; padding: 6px 10px; font: 600 13px var(--body); color: var(--muted); cursor: pointer }
.seg2 button.on { background: var(--orange); color: #fff }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font: 500 13.5px var(--body); min-height: 40px; padding: 0 12px; border-radius: 999px; cursor: pointer }
.chip:disabled { opacity: .5 }
.chat { display: grid; gap: 8px }
.msg { font-size: 14px; line-height: 1.4; padding: 10px 12px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere }
.msg.me { background: var(--orange); color: #fff; justify-self: end }
.msg.ai { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); justify-self: start }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px }
@keyframes spin { to { transform: rotate(360deg) } }
.chip.on { background: var(--orange); color: #fff; box-shadow: none }
input[type=range] { width: 100%; accent-color: var(--orange); min-height: 32px }
.icon-btn:disabled { opacity: .35 }
/* effects in the preview */
.shadeL { z-index: 1; pointer-events: none }
.shadeL.sh-bottom { background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 45%) }
.shadeL.sh-top { background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 45%) }
.flashL { z-index: 5; background: #fff; opacity: 0; pointer-events: none }
.pdfL { z-index: 2; overflow: hidden; background: radial-gradient(80% 50% at 50% 50%, rgba(242,106,27,.13) 0%, transparent 70%) }
.pdfMove { position: absolute; inset: 0 }
.pdfPage { position: absolute; background: #fff; border-radius: 3px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.55), 0 3px 9px rgba(0,0,0,.35) }
.pdfPage img { width: 100%; height: 100%; display: block }
.ring { position: absolute; border: 2px solid #F26A1B; border-radius: 5px; box-shadow: 0 0 12px rgba(242,106,27,.4); opacity: 0 }
/* marking the total on the offer */
.offerPick { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line) }
.offerPick img { width: 100%; display: block; pointer-events: none }
.offerPick .box { position: absolute; border: 3px solid #F26A1B; border-radius: 6px; background: rgba(242,106,27,.12); pointer-events: none }
label.btn { cursor: pointer }
/* publish tab */
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px }
.check .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700 }
.check.ok .ic { background: var(--good-tint); color: var(--good) }
.check.no .ic { background: var(--bad-tint); color: var(--bad) }
.check.warn .ic { background: var(--orange-tint); color: var(--orange-deep) }
textarea { font: 16px/1.4 var(--body); resize: vertical }
.tabs button { font-size: 12.5px }
