/* Planejador de feed: coluna estilo celular (máx. 600px), cabeçalho fixo, grade 3×N, edição em bottom sheet. */
:root {
  --accent: #f25416; --accent-ink: #c93f0a; --head: #303030;
  --bg: #eeeeee; --surface: #ffffff; --fg: #262626; --muted: #67615c; --line: #dcd8d4; --ph: #e4e0dc;
  --overlay: rgba(30, 26, 24, .55);
  --ok: #1f7a4d; --warn: #9a6100; --info: #2f5fa8; --danger: #c0311f;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b1a; --surface: #282624; --fg: #f2efec; --muted: #a8a19a; --line: #3a3734; --ph: #34312e;
    --overlay: rgba(0, 0, 0, .65); --accent-ink: #ff8a5c; --ok: #5cc495; --warn: #f0b04a; --info: #86aef0; --danger: #ff7a66;
    color-scheme: dark;
  }
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); -webkit-text-size-adjust: 100% }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px }
[hidden] { display: none !important }

.wrap { max-width: 600px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 110px max(16px, env(safe-area-inset-left)) }
header.top { position: sticky; top: 0; z-index: 20; background: var(--head); color: #fff; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))); padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)) }
.top-row { display: flex; align-items: center; gap: 10px }
.brand { font-weight: 900; font-size: 15px; letter-spacing: .02em; white-space: nowrap }
.brand span { color: var(--accent) }
.client { flex: 1; min-width: 0; background: #3d3d3d; border: 0; border-radius: 6px; padding: 7px 8px; color: #fff }
.iconbtn { background: transparent; border: 1px solid #555; color: #ddd; border-radius: 6px; padding: 6px 10px }
.tabs { display: flex; gap: 6px; margin-top: 10px }
.tab { flex: 1; border: 1px solid #555; background: transparent; color: #ddd; border-radius: 6px; padding: 6px 0; font-weight: 500 }
.tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff }

.profile { display: flex; gap: 14px; align-items: center; margin: 16px 0 10px }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 19px; flex: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent) }
.profile b { display: block; font-size: 15px; word-break: break-all }
.profile small { color: var(--muted) }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface) }
.seg button { border: 0; background: transparent; padding: 6px 10px; font-size: 12px; color: var(--muted) }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg) }
.hint { font-size: 12px; color: var(--muted); flex: 1 1 180px }
.banner { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 10px 12px; margin: 12px 0; font-size: 13px }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))) }
@media (min-width: 600px) { .grid { margin: 0 } }
.tile { position: relative; aspect-ratio: 3/4; max-width: 100%; background: var(--ph); overflow: hidden; cursor: pointer; border: 0; padding: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none }
.tile .art { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 8px 8px 30px; color: #fff; font-weight: 700; font-size: 12px; line-height: 1.2; text-align: left; text-wrap: balance }
.tile .date { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums }
.tile .fmt { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)) }
.tile .st { position: absolute; bottom: 6px; right: 6px; font-size: 10px; font-weight: 600; color: #fff; padding: 1px 6px; border-radius: 999px }
.tile .warn { position: absolute; bottom: 6px; left: 6px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px }
.tile .cm { position: absolute; top: 30px; left: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px }
.tile.published { opacity: .55 }
.tile.target { outline: 3px solid var(--accent); outline-offset: -3px }
.tile.origin { opacity: .25 }
.ghost { position: fixed; z-index: 50; pointer-events: none; width: 120px; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; box-shadow: 0 14px 30px rgba(0,0,0,.35); transform: translate(-50%, -60%) scale(1.05); background: var(--ph) }
.ghost img { width: 100%; height: 100%; object-fit: cover }
.pressing { animation: press .35s ease-out }
@keyframes press { to { transform: scale(.94) } }
@media (prefers-reduced-motion: reduce) { .pressing { animation: none } }

.week { margin: 18px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600 }
.row { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; width: 100%; text-align: left }
.row .thumb { width: 44px; aspect-ratio: 3/4; border-radius: 4px; overflow: hidden; flex: none; background: var(--ph) }
.row .thumb img { width: 100%; height: 100%; object-fit: cover }
.row .meta { flex: 1; min-width: 0 }
.row .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.row .meta small { color: var(--muted); font-variant-numeric: tabular-nums }
.nets { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap }
.net { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; background: var(--bg); color: var(--muted); border: 1px solid var(--line) }
.net.full { color: var(--fg) }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor }

.fab { position: fixed; right: max(16px, calc(env(safe-area-inset-right) + 16px)); bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 25; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 600; box-shadow: 0 6px 18px rgba(242,84,22,.35) }

.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 40 }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 14px 14px 0 0; padding: 8px max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 20px) max(16px, env(safe-area-inset-left)); max-width: 640px; margin: 0 auto }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px }
.sheet h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; text-wrap: balance }
.sheet h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px }
.fields { display: grid; gap: 8px; min-width: 0 }
label.f { display: grid; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em }
label.f input, label.f select, label.f textarea, .input { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; width: 100%; min-width: 0 }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500; color: var(--muted) }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg) }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px }
.strip .m { position: relative; flex: none; width: 92px; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--ph) }
.strip .m img { width: 100%; height: 100%; object-fit: cover }
.strip .m .ctl { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: rgba(0,0,0,.55) }
.strip .m .ctl button { background: none; border: 0; color: #fff; padding: 4px 6px; font-size: 13px }
.strip .m .n { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 3px }
.addm { display: flex; gap: 6px; margin-top: 8px }
.addm input { flex: 1 }
.nettabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto }
.nettab { border: 0; background: transparent; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap }
.nettab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent) }
.nettab .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin-left: 5px; vertical-align: middle }
.nettab .dot.on { background: var(--ok) }
textarea.copy { width: 100%; min-height: 170px; resize: vertical; margin-top: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 15px; line-height: 1.5 }
.copyread { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-top: 10px; min-height: 60px }
.cbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted) }
.over { color: var(--danger); font-weight: 600 }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 8px 12px; font-size: 13px; font-weight: 500 }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff }
.btn.danger { color: var(--danger) }
.btn:disabled { opacity: .5; cursor: not-allowed }
.actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 18px; flex-wrap: wrap }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 }
.flag { font-size: 12px; border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: var(--bg); border-left: 4px solid var(--warn) }
.flag.bad { border-left-color: var(--danger) }
.flag.good { border-left-color: var(--ok) }
.thread { display: grid; gap: 8px }
.cmt { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 13px }
.cmt.client { border-left: 3px solid var(--accent) }
.cmt.internal { border: 1px dashed var(--line); background: transparent }
.cmt small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px }
.cmt .k { font-weight: 700 }
.list { display: grid; gap: 6px }
.li { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--bg); border-radius: 6px; padding: 8px 10px; font-size: 13px }
.li small { color: var(--muted); display: block }
.secret { word-break: break-all; font-family: ui-monospace, monospace; font-size: 12px; background: var(--bg); border: 1px dashed var(--accent); padding: 8px; border-radius: 6px; user-select: all }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 76px); z-index: 60; background: var(--head); color: #fff; border-radius: 8px; padding: 10px 14px; display: flex; gap: 14px; align-items: center; font-size: 13px; box-shadow: 0 8px 20px rgba(0,0,0,.25); width: max-content; max-width: min(440px, calc(100% - 32px)) }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700 }
.empty { padding: 30px 10px; text-align: center; color: var(--muted) }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 6px; border-radius: 8px }
.carousel > * { flex: none; width: 100%; scroll-snap-align: center; aspect-ratio: 4/5; object-fit: contain; background: #000; border-radius: 8px }
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px }
.login form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 12px }
.err { color: var(--danger); font-size: 13px; min-height: 1em }
