:root {
  --bg: #F1ECE2; --paper: #FBF7EE; --ink: #0E1F2A; --ink-soft: #33414C;
  --muted: #6B7884; --line: #E3DCCB; --navy: #0F2A2E; --navy-2: #0B2226;
  --mint: #A6E9DF; --mint-2: #7FD9CB; --accent: #FF6A3D; --chip: #EFE9DA;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(circle at 18% -8%, rgba(166,233,223,.22), transparent 42%),
                    radial-gradient(circle at 100% 0%, rgba(255,106,61,.07), transparent 38%);
  background-attachment: fixed;
}
.page { max-width: 920px; margin: 0 auto; padding: 28px 24px 72px; }

/* topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 9px; background: var(--navy);
  display: grid; place-items: center; color: var(--mint);
  font-weight: 800; font-size: 14px; letter-spacing: .04em;
}
.brand b { display: block; font-size: 13px; color: var(--ink); letter-spacing: .04em; }
.brand span { font-size: 10px; color: var(--muted); letter-spacing: .2em; text-transform: uppercase; }
.brand a { text-decoration: none; color: inherit; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: var(--mint); font-size: 11px; font-weight: 600;
  padding: 7px 13px; border-radius: 999px; letter-spacing: .03em;
}
.status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--muted);
  box-shadow: 0 0 0 4px rgba(107,120,132,.18); transition: all .3s ease;
}
.status.ok .dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(166,233,223,.22); }
.status.down .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(255,106,61,.18); }

/* intro */
.eyebrow { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
h1 { font-weight: 800; font-size: 40px; line-height: 1.02; letter-spacing: -.02em; margin: 12px 0 12px; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 15px; color: var(--ink-soft); max-width: 60ch; margin: 0 0 30px; }
.lede b { color: var(--ink); font-weight: 600; }
.muted { color: var(--muted); }

/* card */
.card {
  background: var(--paper); border-radius: 22px; padding: 26px 28px;
  box-shadow: 0 1px 0 rgba(14,31,42,.04), 0 18px 40px -28px rgba(14,31,42,.25);
  margin-bottom: 20px; position: relative; border: 1px solid rgba(227,220,203,.6);
  animation: rise .5s cubic-bezier(.2,.7,.2,1) both;
}
.card:nth-of-type(2) { animation-delay: .07s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.step-no {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  background: var(--navy); color: var(--mint); display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
}
.card-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.card.locked { opacity: .55; filter: saturate(.6); pointer-events: none; }
.card.locked .step-no { background: var(--chip); color: var(--muted); }

/* fields */
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field span { font-size: 12px; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.field input, .field textarea {
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input::placeholder { color: #aeb6bd; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--mint-2); outline-offset: 1px; border-color: var(--navy); }
.divider { height: 1px; background: var(--line); margin: 22px 0 18px; border: 0; }

.check {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.check input { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; }

/* dropzone */
.dropzone {
  border: 1.5px dashed var(--mint-2); border-radius: 16px; background: rgba(166,233,223,.07);
  padding: 26px 20px; text-align: center; cursor: pointer; transition: all .18s ease;
}
.dropzone:hover { background: rgba(166,233,223,.16); border-color: var(--navy); }
.dropzone.drag { background: rgba(166,233,223,.28); border-color: var(--navy); transform: scale(1.005); }
.dropzone svg { width: 30px; height: 30px; color: var(--navy); margin-bottom: 8px; }
.dropzone .dz-main { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dropzone .dz-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--chip);
  border-radius: 999px; padding: 6px 8px 6px 13px; font-size: 12px; font-weight: 600; color: var(--ink);
}
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; border-radius: 50%; }
.chip button:hover { color: var(--accent); }

textarea {
  width: 100%; font-family: inherit; font-size: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  resize: vertical; line-height: 1.5; transition: border-color .15s ease;
}
textarea:focus { outline: 2px solid var(--mint-2); outline-offset: 1px; border-color: var(--navy); }
textarea#notes { min-height: 96px; }
textarea#material { min-height: 240px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.label-line { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 7px; }
.label-line .lbl { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.label-line .meta { font-size: 11px; color: var(--muted); }

/* buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--navy); color: var(--mint); border: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: .01em;
  padding: 12px 20px; border-radius: 12px; text-decoration: none;
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--navy-2); }
.btn:focus-visible { outline: 3px solid var(--mint-2); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--chip); }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: none; }
.btn.loading .spin { display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* console (dark card) */
.console { background: var(--navy); border-radius: 22px; padding: 22px 24px; color: #EAF6F4; }
.console .eyebrow { color: var(--mint); }
.console pre {
  margin: 12px 0 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
  line-height: 1.55; color: #CFE7E3; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow: auto;
}
.console pre a { color: var(--mint); }
.footnote { font-size: 11.5px; color: var(--muted); margin-top: 20px; text-align: center; }
.footnote code { background: var(--chip); padding: 2px 6px; border-radius: 6px; font-size: 11px; }

/* ---------- dashboard ---------- */
.list-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 16px; }
.list-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.search { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; margin-bottom: 18px; }
.search:focus { outline: 2px solid var(--mint-2); border-color: var(--navy); }
.rows { display: flex; flex-direction: column; gap: 10px; }
.prop { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--paper); border: 1px solid rgba(227,220,203,.6); border-radius: 16px; padding: 16px 18px; }
.prop-title { font-weight: 700; font-size: 15px; }
.prop-meta { margin-top: 5px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.prop-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 600; }
.back:hover { color: var(--navy); }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.pill.sent, .pill.viewed { background: #DDEFEA; color: #0B5; }
.pill.accepted { background: #CFF3E6; color: #067A52; }
.pill.expired { background: #F6DDD3; color: #B23B1A; }

/* ---------- detalhe / abas ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 20px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--accent); }
.pane { display: none; } .pane.on { display: block; animation: rise .3s ease both; }
.codeview { background: var(--navy); color: #CFE7E3; border-radius: 14px; padding: 18px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: pre-wrap; max-height: 520px; overflow: auto; }
.asset { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 22px 0 10px; }
.md { width: 100%; min-height: 340px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.md:focus { outline: 2px solid var(--mint-2); border-color: var(--navy); }
.warn { background: #FCEEE7; border: 1px solid #F3C9B8; color: #8A3415; padding: 11px 14px; border-radius: 12px; font-size: 12.5px; margin-bottom: 14px; }
.rec { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rec-audio { height: 36px; max-width: 100%; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-time { font-variant-numeric: tabular-nums; }
.rec-msg { font-size: 12px; }
.rec-transcript { width: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; }
.chip [data-tx], .chip [data-rm] { background: none; border: 0; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; }
.chip [data-tx]:hover { filter: brightness(1.2); }
.chip [data-rm] { color: var(--muted); font-size: 16px; }
.chip [data-rm]:hover { color: var(--accent); }

/* modal de transcrição */
.tx-overlay { position: fixed; inset: 0; background: rgba(14,31,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.tx-modal { background: var(--paper); border-radius: 18px; max-width: 620px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px -20px rgba(14,31,42,.5); }
.tx-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tx-head b { font-size: 14px; }
.tx-close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.tx-close:hover { color: var(--accent); }
.tx-body { padding: 18px 20px; overflow: auto; font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: var(--ink-soft); }

@media (max-width: 640px) {
  h1 { font-size: 32px; }
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .page { padding: 22px 16px 56px; }
  .prop { flex-direction: column; align-items: flex-start; }
}

/* ── split editor | preview ─────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; align-items: start; }
.split .editor { min-width: 0; }
.split .preview { position: sticky; top: 20px; height: calc(100vh - 40px); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 18px 40px -28px rgba(14,31,42,.25); }
.split .preview iframe { width: 100%; height: calc(100% - 33px); border: 0; display: block; background: #fff; }
.preview-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper); height: 33px; }
.preview-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint-2); }
.preview-bar.rendering .dot { background: var(--accent); animation: pulse 1s infinite; }
.preview-bar.error .dot { background: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }
.view-toggle { display: none; }
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .split .preview { position: static; height: 70vh; }
  .view-toggle { display: inline-flex; gap: 6px; margin-bottom: 12px; }
  .split.show-preview .editor { display: none; }
  .split:not(.show-preview) .preview { display: none; }
}
/* diff por seção */
.diff-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--paper); transition: border-color .15s, opacity .15s; }
.diff-card.accepted { border-color: var(--mint-2); }
.diff-card.rejected { opacity: .5; border-style: dashed; }
.diff-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.diff-actions { display: inline-flex; gap: 6px; }
.diff-body { margin-top: 8px; font-size: 13px; }
.d-add { color: #0a7d5a; } .d-del { color: #b2402f; } .d-edit { color: #9a6b00; }
.diff-intact { margin-top: 12px; font-size: 12px; color: #0a7d5a; background: rgba(166,233,223,.18); border-radius: 10px; padding: 8px 12px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.sm:disabled { opacity: .5; cursor: default; }
/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--navy); color: var(--mint); padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #7a1f15; color: #ffd9d2; }
/* dashboard vazio */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .btn { margin-top: 14px; }
/* stepper (wizard) */
.wz-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 22px; font-size: 12px; }
.wz-step { color: var(--muted); font-weight: 600; }
.wz-step.on { color: var(--ink); }
.wz-step.done { color: var(--mint-2); }
.wz-step.done::before { content: "✓ "; }
.wz-sep { flex: 0 0 24px; height: 2px; background: var(--line); }
.wz-pane { display: none; } .wz-pane.on { display: block; animation: rise .4s both; }
/* página em full width (usada no editor split p/ leitura confortável) */
.page.wide { max-width: none; padding-left: 32px; padding-right: 32px; }
