/* Oskaras Board — tema escuro com acentos 80s/90s (magenta + ciano). */

:root {
  --bg: #0c0a12;
  --bg-2: #13101c;
  --panel: #17131f;
  --card: #211b2e;
  --card-hover: #29223a;
  --input: #100d18;
  --line: #2c2540;
  --line-2: #3d3456;
  --text: #f2eff9;
  --muted: #a7a0bd;
  --dim: #716a89;
  --magenta: #ff2d95;
  --magenta-2: #ff63b0;
  --magenta-soft: rgba(255, 45, 149, 0.14);
  --cyan: #2de2e6;
  --cyan-soft: rgba(45, 226, 230, 0.13);
  --yellow: #ffd23f;
  --green: #4ade80;
  --orange: #ff9f43;
  --purple: #b197fc;
  --red: #ff5c6c;
  --gray: #8f8aa6;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Century Gothic", "Questrial", "Josefin Sans", "Futura", "Avenir Next", "Avenir", "Trebuchet MS", var(--font);
  --topbar-h: 58px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 110% -10%, rgba(255, 45, 149, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(45, 226, 230, 0.07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--cyan); }
a:hover { color: #7ff0f2; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::selection { background: var(--magenta); color: #fff; }

/* ------------------------------------------------------------------ wordmark */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: 0.16em;
  color: #fff;
  text-decoration: none;
  text-shadow: 3px 3px 0 var(--magenta);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.wordmark:hover { color: #fff; }
.wordmark-lg { font-size: 2.6rem; text-shadow: 5px 5px 0 var(--magenta); }

/* ------------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap; min-height: 38px;
}
.btn:hover { background: var(--card-hover); border-color: var(--dim); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--magenta); border-color: var(--magenta); color: #fff; box-shadow: 2px 2px 0 rgba(45, 226, 230, .55); }
.btn-primary:hover { background: var(--magenta-2); border-color: var(--magenta-2); color: #fff; }
.btn-cyan { background: transparent; border-color: var(--cyan); color: var(--cyan); }
.btn-cyan:hover { background: var(--cyan-soft); color: var(--cyan); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--card); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(255, 92, 108, .5); color: var(--red); }
.btn-danger:hover { background: rgba(255, 92, 108, .12); color: var(--red); }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: .86rem; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn {
  position: relative; border: 1px solid transparent; background: transparent; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.15rem; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--card); border-color: var(--line); }
.link-btn { background: none; border: none; color: var(--cyan); cursor: pointer; padding: 0; font-size: .85rem; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ formulários */
label { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], input[type=url], input:not([type]), select, textarea {
  width: 100%; background: var(--input); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 9px 11px; color: var(--text); margin-top: 4px; min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
label input, label select, label textarea { font-weight: 400; font-size: .95rem; letter-spacing: normal; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--magenta-soft); }
input::placeholder, textarea::placeholder { color: var(--dim); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type=checkbox] { accent-color: var(--magenta); width: 18px; height: 18px; vertical-align: middle; }
.check-label { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; font-size: .92rem; cursor: pointer; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-4 { grid-column: 1 / -1; }
.form-error { color: var(--red); min-height: 1.2em; margin: 6px 0; font-size: .9rem; }
.hint { color: var(--dim); font-size: .8rem; font-weight: 400; }
.field { margin-bottom: 14px; }

/* ------------------------------------------------------------------ login */
.login-view { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(380px, 100%); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 18px; padding: 34px 26px 26px; box-shadow: var(--shadow); display: grid; gap: 12px;
  position: relative; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--magenta), var(--cyan)); }
.login-card .wordmark { text-align: center; margin-bottom: 2px; }
.login-sub { text-align: center; color: var(--muted); margin: 0 0 10px; font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }

/* ------------------------------------------------------------------ topo */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(12, 10, 18, .88); backdrop-filter: blur(10px);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--magenta), var(--cyan) 60%, transparent); }
.topbar-sub { color: var(--muted); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.badge-count {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--magenta); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--magenta), #7b2ff7); color: #fff; font-weight: 700; font-size: .8rem;
  flex: none; letter-spacing: .02em;
}
.avatar-sm { width: 22px; height: 22px; font-size: .62rem; }
.avatar-btn { border: none; background: none; padding: 2px; cursor: pointer; border-radius: 50%; }

/* dropdowns */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); min-width: 240px; overflow: hidden;
}
.dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-panel { width: min(380px, calc(100vw - 24px)); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 460px); overflow-y: auto; }
.notif-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-item:hover { background: var(--card); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif-item.unread .notif-dot { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.notif-item.unread .notif-text { color: var(--text); }
.notif-text { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.notif-time { color: var(--dim); font-size: .75rem; margin-top: 2px; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--dim); }
.user-panel-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; }
.user-panel-head small { color: var(--dim); }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 11px 14px; cursor: pointer; color: var(--text); text-decoration: none; font-size: .92rem; }
.menu-item:hover { background: var(--card); color: var(--text); }

/* ------------------------------------------------------------------ filtros */
.filters { display: flex; gap: 8px; align-items: center; padding: 12px 16px 2px; flex-wrap: wrap; }
.filters input, .filters select { margin-top: 0; width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.filters input[type=search] { flex: 1 1 240px; max-width: 380px; }
.filters select { flex: 0 1 190px; }
.phase-nav { display: none; gap: 6px; overflow-x: auto; padding: 8px 12px 2px; scrollbar-width: none; }
.phase-nav::-webkit-scrollbar { display: none; }
.phase-chip { flex: none; border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 5px 11px; font-size: .8rem; cursor: pointer; color: var(--muted); }
.phase-chip.active { border-color: var(--magenta); color: #fff; background: var(--magenta-soft); }
.phase-chip b { color: var(--text); margin-left: 3px; font-weight: 700; }

/* ------------------------------------------------------------------ quadro */
.board {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 12px 16px 18px;
  height: calc(100dvh - var(--topbar-h) - 56px); scroll-snap-type: x proximity; scroll-padding: 0 16px;
  overscroll-behavior-x: contain;
}
.board::-webkit-scrollbar { height: 10px; }
.board::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; }
.column {
  flex: 0 0 296px; display: flex; flex-direction: column; max-height: 100%; min-height: 0;
  background: rgba(23, 19, 31, .92); border: 1px solid var(--line); border-radius: 14px; scroll-snap-align: start;
  position: relative;
}
.column::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; border-radius: 2px; background: var(--phase-accent, var(--magenta)); opacity: .9; }
.column:nth-child(3n+2) { --phase-accent: var(--cyan); }
.column:nth-child(3n) { --phase-accent: var(--yellow); }
.column-head { padding: 12px 12px 9px; border-bottom: 1px solid var(--line); }
.column-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: .02em; }
.column-count { margin-left: auto; background: var(--line); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-family: var(--font); }
.column-desc { color: var(--dim); font-size: .78rem; margin-top: 2px; }
.column-body { flex: 1; overflow-y: auto; padding: 9px; display: flex; flex-direction: column; gap: 9px; min-height: 70px; }
.column-body:empty::before { content: "Nenhum card aqui"; color: var(--dim); font-size: .82rem; text-align: center; padding: 18px 6px; border: 1px dashed var(--line-2); border-radius: 10px; }
.column-body::-webkit-scrollbar { width: 8px; }
.column-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

/* card */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; cursor: pointer;
  position: relative; transition: border-color .15s, background .15s, transform .08s; user-select: none;
  -webkit-user-select: none; flex: none;
}
.card:hover { border-color: var(--line-2); background: var(--card-hover); }
.card:focus-visible { outline: 2px solid var(--cyan); }
.card.type-sitcom { box-shadow: inset 3px 0 0 var(--magenta); }
.card.type-clipe { box-shadow: inset 3px 0 0 var(--cyan); }
.card.type-ideia { box-shadow: inset 3px 0 0 var(--yellow); }
.card.type-outro { box-shadow: inset 3px 0 0 var(--gray); }
.card-ghost { opacity: .35; border-style: dashed; }
.card-chosen { border-color: var(--magenta); }
.card-drag { transform: rotate(2deg); box-shadow: var(--shadow); }
.card-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 7px; margin-bottom: 8px; background: #000; }
.card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: .74rem; }
.card-id { margin-left: auto; color: var(--dim); }
.ep { color: var(--muted); font-weight: 700; }
.card-title { font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.card-chars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.mini-chip { font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: var(--cyan-soft); color: #9ff3f5; border: 1px solid rgba(45, 226, 230, .25); }
.mini-chip.guest { background: transparent; color: var(--muted); border-color: var(--line-2); }
.card-foot { display: flex; align-items: center; gap: 9px; margin-top: 9px; color: var(--muted); font-size: .76rem; flex-wrap: wrap; }
.card-foot .voted { color: var(--magenta-2); font-weight: 700; }
.card-foot .due.overdue { color: var(--red); font-weight: 700; }
.card-foot .done-all { color: var(--green); }
.card-foot .avatar { margin-left: auto; }
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }

.type-badge { font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.tb-sitcom { background: var(--magenta-soft); color: var(--magenta-2); }
.tb-clipe { background: var(--cyan-soft); color: var(--cyan); }
.tb-ideia { background: rgba(255, 210, 63, .14); color: var(--yellow); }
.tb-outro { background: rgba(143, 138, 166, .16); color: var(--gray); }

/* etiquetas */
.label-pill { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 5px; color: #12101a; min-height: 8px; min-width: 28px; }
.lc-magenta { background: var(--magenta); color: #fff; }
.lc-cyan { background: var(--cyan); }
.lc-yellow { background: var(--yellow); }
.lc-green { background: var(--green); }
.lc-orange { background: var(--orange); }
.lc-purple { background: var(--purple); }
.lc-red { background: var(--red); }
.lc-gray { background: var(--gray); }

/* FAB (mobile) */
.fab { display: none; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; width: 58px; height: 58px; border-radius: 50%; border: none; background: var(--magenta); color: #fff; font-size: 1.8rem; box-shadow: 3px 3px 0 var(--cyan), var(--shadow); cursor: pointer; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(6, 4, 12, .74); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-start; padding: 4vh 16px; overflow-y: auto;
  overscroll-behavior: contain;
}
.modal {
  width: min(880px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: var(--shadow); position: relative; margin-bottom: 4vh;
}
.modal-head { position: sticky; top: 0; z-index: 3; background: var(--bg-2); border-radius: 18px 18px 0 0; padding: 14px 18px 0; border-bottom: 1px solid var(--line); }
.modal-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-title { margin: 8px 0 10px; font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; font-family: var(--font-display); }
.modal-close { margin-left: auto; }
.modal-head-row .card-id { margin-left: 4px; }
.phase-pill { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); color: var(--text); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.modal-actions .move-group { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.modal-actions .move-group select { margin: 0; min-height: 34px; padding-top: 4px; padding-bottom: 4px; width: auto; max-width: 210px; }
.toggle-on { border-color: var(--magenta); background: var(--magenta-soft); color: var(--magenta-2); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 12px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--magenta); }
.tab .tab-n { color: var(--dim); font-weight: 500; margin-left: 3px; }
.modal-body { padding: 18px; }
.updated-banner { margin: 0 0 14px; padding: 9px 12px; border-radius: 10px; background: var(--cyan-soft); border: 1px solid rgba(45, 226, 230, .35); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.section { margin-bottom: 22px; }
.section-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px; color: var(--text); }
.section-title .hint { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.save-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  padding: 12px 18px; margin: 10px -18px -18px; background: rgba(19, 16, 28, .96); border-top: 1px solid var(--magenta);
  border-radius: 0 0 18px 18px;
}
.save-bar .hint { margin-right: auto; color: var(--magenta-2); }
.meta-line { color: var(--dim); font-size: .8rem; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* falas fixas */
.falas { display: grid; gap: 8px; }
.fala-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: start; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--magenta); border-radius: 10px; padding: 8px; }
.fala-row input, .fala-row textarea { margin-top: 0; }
.fala-row textarea { min-height: 42px; }
.fala-num { font-size: .72rem; color: var(--dim); font-weight: 700; margin-bottom: 3px; }
.fala-tools { display: flex; flex-direction: column; gap: 4px; }
.fala-tools .btn { min-height: 28px; padding: 2px 8px; }
.empty-note { color: var(--dim); font-size: .88rem; padding: 10px 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { border: 1px solid var(--line-2); background: var(--input); color: var(--muted); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .88rem; }
.chip-toggle[aria-pressed="true"] { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: .86rem; }
.chip button { border: none; background: none; color: var(--dim); cursor: pointer; padding: 0 4px; font-size: 1rem; line-height: 1; }
.chip button:hover { color: var(--red); }
.chip-input { display: flex; gap: 6px; margin-top: 8px; }
.chip-input input { margin-top: 0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--bg-2); }

/* checklist */
.checklist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.check-item:hover { background: var(--card); }
.check-item.done .check-text { color: var(--dim); text-decoration: line-through; }
.check-text { flex: 1; overflow-wrap: anywhere; }
.progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--magenta), var(--cyan)); width: 0; transition: width .3s; }

/* comentários */
.comments { display: grid; gap: 12px; margin-bottom: 16px; }
.comment { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.comment-box { background: var(--card); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 9px 12px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 3px; }
.comment-head strong { font-size: .9rem; }
.comment-head time { color: var(--dim); font-size: .76rem; }
.comment-head .link-btn { margin-left: auto; color: var(--dim); }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mention { color: var(--magenta-2); font-weight: 700; }
.composer { display: grid; gap: 8px; position: sticky; bottom: 0; background: var(--bg-2); padding-top: 8px; }
.composer textarea { margin: 0; min-height: 70px; }
.composer-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer-row .btn-primary { margin-left: auto; }
.mention-chip { border: 1px dashed var(--line-2); background: none; color: var(--muted); border-radius: 999px; padding: 2px 9px; font-size: .78rem; cursor: pointer; }
.mention-chip:hover { color: var(--magenta-2); border-color: var(--magenta); }

/* anexos */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.att { background: var(--card); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; display: flex; flex-direction: column; }
.att-media { background: #000; aspect-ratio: 16 / 11; display: grid; place-items: center; overflow: hidden; }
.att-media img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.att-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.att-media .att-icon { font-size: 2.4rem; }
.att-audio { padding: 8px; background: var(--panel); }
.att-audio audio { width: 100%; }
.att-info { padding: 8px 10px; font-size: .8rem; display: grid; gap: 2px; }
.att-name { font-weight: 600; overflow-wrap: anywhere; font-size: .86rem; }
.att-sub { color: var(--dim); }
.att-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 10px 10px; }
.upload-zone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); margin-bottom: 14px; transition: border-color .15s, background .15s; }
.upload-zone.drag { border-color: var(--magenta); background: var(--magenta-soft); }
.upload-zone input[type=file] { display: none; }
.upload-list { display: grid; gap: 6px; margin-top: 10px; text-align: left; }
.upload-item { font-size: .82rem; }
.upload-item .progress { margin: 3px 0 0; }
.delivered { background: linear-gradient(135deg, rgba(255, 45, 149, .10), rgba(45, 226, 230, .08)); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; margin-bottom: 18px; }
.delivered video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; display: block; }
.delivered-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.delivered-row select { width: auto; flex: 1 1 220px; margin: 0; }

/* publicação */
.pub-list { display: grid; gap: 10px; }
.pub-row { display: grid; grid-template-columns: 120px 150px 1fr 150px auto; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 10px; }
.pub-row input, .pub-row select { margin: 0; }
.pub-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pub-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
.pub-status-dot.agendado { background: var(--yellow); }
.pub-status-dot.publicado { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pub-meta { grid-column: 1 / -1; font-size: .75rem; color: var(--dim); display: flex; gap: 10px; flex-wrap: wrap; }

/* histórico */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tl-icon { font-size: 1.05rem; text-align: center; }
.tl-text { overflow-wrap: anywhere; }
.tl-text strong { color: var(--text); }
.tl-note { margin-top: 4px; padding: 5px 9px; border-left: 2px solid var(--magenta); color: var(--muted); font-style: italic; background: var(--card); border-radius: 0 6px 6px 0; }
.tl-time { color: var(--dim); font-size: .75rem; }
.tl-item details { margin-top: 4px; font-size: .84rem; color: var(--muted); }
.tl-item summary { cursor: pointer; color: var(--cyan); }

/* diálogos */
.dialog-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(6, 4, 12, .72); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.dialog { width: min(480px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog.wide { width: min(720px, 100%); }
.dialog h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.15rem; }
.dialog p { color: var(--muted); margin: 0 0 12px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.secret-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--input); border: 1px solid var(--cyan); border-radius: 9px; padding: 10px 12px; overflow-wrap: anywhere; user-select: all; color: var(--cyan); font-size: .92rem; }
pre.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--input); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; overflow-x: auto; font-size: .82rem; color: var(--muted); white-space: pre; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.list-rows { display: grid; gap: 8px; }
.list-row { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; flex-wrap: wrap; }
.list-row .grow { flex: 1; min-width: 160px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; background: #241d33; border: 1px solid var(--line-2); border-left: 4px solid var(--cyan); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .92rem; animation: toast-in .2s ease-out; overflow-wrap: anywhere; }
.toast.clickable { cursor: pointer; }
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast.notif { border-left-color: var(--magenta); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line-2); border-top-color: var(--magenta); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ admin */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; font-family: var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.table tr.inactive td { color: var(--dim); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--line); color: var(--muted); }
.pill.ok { background: rgba(74, 222, 128, .15); color: var(--green); }
.pill.err { background: rgba(255, 92, 108, .15); color: var(--red); }
.pill.admin { background: var(--magenta-soft); color: var(--magenta-2); }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.channel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.channel.on { border-color: rgba(74, 222, 128, .45); }
.channel small { color: var(--dim); overflow-wrap: anywhere; }
.inline-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-items: end; }
.inline-form .btn { height: 40px; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 900px) {
  .pub-row { grid-template-columns: 1fr 1fr; }
  .pub-row .pub-name { grid-column: 1 / -1; }
  .pub-row .pub-url { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --topbar-h: 54px; }
  body { font-size: 15px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-sub { display: none; }
  #btn-new { display: none; }
  .fab { display: grid; place-items: center; }
  .filters { padding: 10px 12px 0; gap: 6px; }
  .filters input[type=search] { flex: 1 1 100%; max-width: none; }
  .filters select { flex: 1 1 calc(50% - 6px); }
  .phase-nav { display: flex; }
  .board { padding: 10px 12px 90px; gap: 10px; scroll-snap-type: x mandatory; scroll-padding: 0 12px; height: calc(100dvh - var(--topbar-h) - 136px); }
  .column { flex-basis: calc(100vw - 36px); }
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; border: none; min-height: 100dvh; margin: 0; width: 100%; }
  .modal-head { border-radius: 0; padding: 10px 14px 0; padding-top: calc(10px + env(safe-area-inset-top)); }
  .modal-body { padding: 14px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .save-bar { margin: 10px -14px -24px; border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-title { font-size: 1.2rem; }
  .modal-actions .move-group { margin-left: 0; width: 100%; }
  .modal-actions .move-group select { flex: 1; max-width: none; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .fala-row { grid-template-columns: 1fr auto; }
  .fala-row .fala-text { grid-column: 1 / -1; grid-row: 2; }
  .fala-tools { flex-direction: row; }
  .att-grid { grid-template-columns: 1fr 1fr; }
  .dialog-backdrop { align-items: end; padding: 0; }
  .dropdown-panel { position: fixed; left: 10px; right: 10px; top: calc(var(--topbar-h) + 6px); width: auto; min-width: 0; }
  .notif-panel { width: auto; }
  input, select, textarea, label input, label select, label textarea { font-size: 16px; } /* evita zoom no iOS */
  .dialog { border-radius: 18px 18px 0 0; width: 100%; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .wordmark { font-size: 1.25rem; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td { border: none; padding: 3px 4px; }
  .table td.actions-cell { grid-column: 1 / -1; }
  .table .actions { justify-content: flex-start; }
}
@media (hover: none) {
  .card:hover { background: var(--card); border-color: var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
