      :root {
        --azul: #18a6a6;
        --azul-escuro: #102a43;
        --azul-suave: #e8f7f7;
        --verde: #18a6a6;
        --vermelho: #b91c1c;
        --action-primary: #078f86;
        --action-primary-hover: #06756f;
        --action-secondary-bg: #e8f7f7;
        --action-secondary-text: #102a43;
        --action-danger: #b91c1c;
        --action-danger-hover: #991b1b;
        --action-record: #d51f26;
        --action-record-hover: #b91c1c;
        --action-disabled: #94a3b8;
        --action-focus: #14b8a6;
        --amarelo: #b7791f;
        --texto: #263238;
        --suave: #667085;
        --borda: #d8e4e8;
        --fundo: #f5f8fa;
        --branco: #fff;
        --app-header-bg: #e8f7f7;
        --app-header-text: #102a43;
      }

      * { box-sizing: border-box; }

      body {
        margin: 0;
        font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        color: var(--texto);
        background: linear-gradient(180deg, #edf7f7 0%, #f5f8fa 52%, #ffffff 100%);
      }

      .page { min-height: 100vh; padding: 22px; }

      .shell {
        max-width: 1320px;
        margin: 0 auto;
        background: var(--branco);
        border: 1px solid rgba(15, 94, 156, 0.12);
        border-radius: 22px;
        box-shadow: 0 22px 55px rgba(8, 52, 93, 0.12);
        overflow: hidden;
      }

      .login-screen {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 34px;
        position: relative;
        overflow: hidden;
        background:
          radial-gradient(circle at 12% 18%, rgba(24, 166, 166, .18), transparent 30%),
          radial-gradient(circle at 90% 85%, rgba(16, 42, 67, .13), transparent 34%),
          var(--fundo);
      }

      .login-screen::before {
        content: '';
        position: absolute;
        width: 360px;
        height: 360px;
        border: 72px solid rgba(24, 166, 166, .06);
        border-radius: 50%;
        right: -170px;
        top: -180px;
        pointer-events: none;
      }

      .login-card {
        width: 100%;
        max-width: 1460px;
        min-height: min(900px, calc(100vh - 68px));
        background: #fff;
        border: 1px solid rgba(16, 42, 67, .10);
        border-radius: 26px;
        box-shadow: 0 28px 70px rgba(16, 42, 67, .16);
        overflow: hidden;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 0;
        position: relative;
        z-index: 1;
      }

      .login-brand-panel {
        min-height: 720px;
        padding: clamp(54px, 6vw, 92px) clamp(48px, 6vw, 86px);
        color: #fff;
        background: radial-gradient(circle at 48% 28%, #123a5b 0%, #082842 45%, #061f36 100%);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        position: relative;
        overflow: hidden;
      }

      .login-brand-panel::after {
        content: '';
        position: absolute;
        width: 330px;
        height: 330px;
        border: 65px solid rgba(24,166,166,.14);
        border-radius: 50%;
        right: -175px;
        bottom: -165px;
      }

      .login-brand-panel::before {
        content: '';
        position: absolute;
        inset: auto auto -220px -170px;
        width: 520px;
        height: 520px;
        border-radius: 50%;
        background: rgba(24, 166, 166, .08);
      }

      .login-brand-logo {
        width: 100%;
        max-width: 560px;
        height: auto;
        object-fit: contain;
        display: block;
        position: relative;
        z-index: 1;
        margin-top: 58px;
      }

      .login-brand-copy { position: relative; z-index: 2; max-width: 610px; margin-bottom: 82px; }
      .login-brand-kicker { color: #35d0c6; font-size: 15px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 22px; }
      .login-brand-copy h2 { color: #fff; font-size: clamp(34px, 3.2vw, 47px); line-height: 1.18; margin-bottom: 24px; letter-spacing: -.025em; }
      .login-brand-copy p { color: rgba(255,255,255,.78); font-size: 20px; line-height: 1.65; margin: 0; max-width: 600px; }
      .login-brand-wave { position:absolute; left:-3%; bottom:5%; width:78%; height:220px; opacity:.72; z-index:1; pointer-events:none; }

      .login-form-panel {
        padding: clamp(54px, 7vw, 110px) clamp(48px, 6vw, 96px);
        display: flex;
        flex-direction: column;
        justify-content: center;
      }

      .login-form-panel h1 { font-size: clamp(32px, 3vw, 44px); margin-bottom: 10px; letter-spacing: -.025em; }
      .login-form-panel > .subtitle { font-size: 19px; }
      .login-form-mark { width: 108px; height: 108px; object-fit: contain; margin-bottom: 30px; border-radius: 22px; box-shadow: 0 10px 28px rgba(16,42,67,.10); }

      .login-card input { min-height: 62px; padding: 16px 18px; font-size: 17px; border-radius: 13px; }
      .login-card button { min-height: 62px; font-size: 17px; }

      .login-actions {
        display: grid;
        gap: 14px;
        margin-top: 26px;
      }
      .login-field { margin-top: 28px; }
      .login-field + .login-field { margin-top: 20px; }
      .login-input-wrap { position: relative; }
      .login-input-wrap input { width: 100%; padding-left: 58px; padding-right: 54px; }
      .login-input-icon { position:absolute; left:19px; top:50%; transform:translateY(-50%); width:23px; height:23px; color:#52667c; pointer-events:none; }
      .login-password-toggle { position:absolute; right:10px; top:50%; transform:translateY(-50%); width:44px; min-height:44px !important; padding:8px; background:transparent; color:#52667c; }
      .login-password-toggle:hover { transform:translateY(-50%); background:#eef7f7; }
      .login-primary { width:100%; background:#0eaaa2; color:#fff; font-size:19px !important; }
      .login-divider { display:flex; align-items:center; gap:20px; color:#667085; margin:28px 0 22px; }
      .login-divider::before, .login-divider::after { content:''; height:1px; flex:1; background:#d7e0e5; }
      .login-forgot { align-self:center; min-height:auto !important; padding:8px 14px; background:transparent; color:#07978f; font-size:17px !important; }
      .login-forgot:hover { transform:none; background:#effafa; }

      .topbar {
        display: flex;
        justify-content: space-between;
        gap: 18px;
        align-items: center;
        padding: 22px 26px;
        border-bottom: 1px solid #e5edf5;
        background: linear-gradient(135deg, #fff 0%, #f2f9ff 100%);
      }

      .master-topbar {
        background: #102a43;
        border: 0;
        color: #fff;
        padding: 20px 24px;
      }

      .master-brand { display: flex; align-items: center; gap: 22px; min-width: 0; }
      .master-brand-logo { width: 245px; max-width: 32vw; display: block; flex: 0 0 auto; }
      .master-brand-copy { border-left: 1px solid rgba(255,255,255,.25); padding-left: 22px; }
      .master-brand-copy h1 { color: #fff; font-size: 25px; }
      .master-brand-copy .subtitle { color: rgba(255,255,255,.68); }
      .master-topbar .badge { background: rgba(24,166,166,.2); color: #bff3f3; border: 1px solid rgba(114,214,214,.25); }
      .master-topbar .btn-light { background: rgba(255,255,255,.11); color: #fff; border: 1px solid rgba(255,255,255,.12); }
      .master-topbar .btn-light:hover { background: rgba(255,255,255,.18); }

      .logo {
        width: 230px;
        max-width: 58vw;
        display: block;
      }

      .badge {
        padding: 9px 14px;
        border-radius: 999px;
        background: var(--azul-suave);
        color: var(--azul-escuro);
        font-weight: 800;
        font-size: 13px;
        white-space: nowrap;
      }

      .top-actions {
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .main {
        display: grid;
        grid-template-columns: 360px 1fr;
        min-height: calc(100vh - 120px);
      }

      .sidebar {
        border-right: 1px solid #e5edf5;
        background: #fbfdff;
        padding: 20px;
      }

      .work {
        padding: 22px;
      }

      h1 {
        margin: 0;
        color: var(--azul-escuro);
        font-size: 31px;
      }

      h2 {
        margin: 0 0 12px;
        color: var(--azul-escuro);
        font-size: 20px;
      }

      .subtitle {
        color: var(--suave);
        margin-top: 7px;
        font-size: 15px;
      }

      .card {
        border: 1px solid var(--borda);
        border-radius: 14px;
        background: #fff;
        padding: 16px;
        margin-bottom: 16px;
      }

      .grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
      }

      .grid-5 {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 12px;
      }

      .grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
      }

      label {
        display: block;
        font-size: 12px;
        color: var(--suave);
        font-weight: 800;
        margin-bottom: 6px;
      }

      input, select, textarea {
        width: 100%;
        border: 1px solid var(--borda);
        border-radius: 12px;
        padding: 12px;
        font-size: 14px;
        outline: none;
        background: #fff;
        color: var(--texto);
      }

      input:focus, select:focus, textarea:focus {
        border-color: var(--azul);
        box-shadow: 0 0 0 4px rgba(15, 94, 156, 0.10);
      }

      textarea {
        min-height: 240px;
        resize: vertical;
        line-height: 1.55;
      }

      button {
        border: none;
        border-radius: 13px;
        padding: 14px 16px;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
        transition: 0.15s ease;
      }

      button:hover { filter: brightness(0.98); transform: translateY(-1px); }
      button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

      .btn-blue { background: var(--azul); color: #fff; }
      .btn-dark { background: #1f2937; color: #fff; }
      .btn-green { background: var(--verde); color: #fff; }
      .btn-red { background: var(--vermelho); color: #fff; }
      .btn-archive { background: #a16207; color: #fff; }
      .btn-record { background: #087f5b; color: #fff; }
      .btn-record-stop { background: #9a3412; color: #fff; }
      .btn-gray { background: #64748b; color: #fff; }
      .btn-light { background: var(--azul-suave); color: var(--azul-escuro); }

      html[data-runtime="web"] button:not(:disabled):hover { filter:brightness(.98);transform:translateY(-1px); }
      html[data-runtime="web"] button:disabled { opacity:.62;cursor:not-allowed;transform:none;box-shadow:none;background:var(--action-disabled)!important;border-color:var(--action-disabled)!important;color:#f8fafc!important; }
      html[data-runtime="web"] .btn-blue,html[data-runtime="web"] .btn-green { background:var(--action-primary);color:#fff; }
      html[data-runtime="web"] .btn-light { background:var(--action-secondary-bg);color:var(--action-secondary-text); }
      html[data-runtime="web"] .btn-red { background:var(--action-danger);color:#fff; }
      html[data-runtime="web"] .btn-record { background:var(--action-record);color:#fff; }
      html[data-runtime="web"] .btn-blue:not(:disabled):hover,html[data-runtime="web"] .btn-green:not(:disabled):hover { background:var(--action-primary-hover); }
      html[data-runtime="web"] .btn-red:not(:disabled):hover { background:var(--action-danger-hover); }
      html[data-runtime="web"] .btn-record:not(:disabled):hover { background:var(--action-record-hover); }

      .button-row {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
      }

      .status {
        background: var(--azul-suave);
        border-left: 6px solid var(--azul);
        border-radius: 13px;
        padding: 13px 15px;
        margin-bottom: 16px;
        font-size: 14px;
      }

      .busy-overlay {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 22px;
        background: rgba(8, 52, 93, 0.48);
        backdrop-filter: blur(4px);
      }

      .busy-overlay.visible { display: flex; }

      .busy-dialog {
        width: min(440px, 100%);
        padding: 30px 28px;
        border: 1px solid rgba(15, 94, 156, 0.18);
        border-radius: 22px;
        background: #fff;
        box-shadow: 0 28px 80px rgba(8, 52, 93, 0.28);
        text-align: center;
      }

      .busy-icon {
        width: 58px;
        height: 58px;
        margin: 0 auto 18px;
        border: 6px solid #dbeafe;
        border-top-color: var(--azul);
        border-radius: 50%;
        animation: busy-spin 0.85s linear infinite;
      }

      .busy-overlay.success .busy-icon,
      .busy-overlay.error .busy-icon {
        display: grid;
        place-items: center;
        border: none;
        animation: none;
        color: #fff;
        font-size: 31px;
        font-weight: 900;
      }

      .busy-overlay.success .busy-icon { background: var(--verde); }
      .busy-overlay.error .busy-icon { background: var(--vermelho); }
      .busy-overlay.success .busy-icon::after { content: '✓'; }
      .busy-overlay.error .busy-icon::after { content: '!'; }

      .busy-dialog h2 {
        margin-bottom: 9px;
        font-size: 24px;
      }

      .busy-dialog p {
        margin: 0;
        color: var(--suave);
        line-height: 1.5;
      }

      .busy-dialog .busy-note {
        margin-top: 14px;
        color: var(--azul-escuro);
        font-size: 13px;
        font-weight: 800;
      }

      .busy-dialog button {
        width: 100%;
        margin-top: 20px;
      }

      html[data-runtime="web"] .busy-overlay.recording-bootstrap .busy-dialog { border-color:rgba(213,31,38,.24); }
      html[data-runtime="web"] .busy-overlay.recording-bootstrap .busy-icon { border-color:#fee2e2;border-top-color:var(--action-record); }

      body.busy-open { overflow: hidden; }

      @keyframes busy-spin {
        to { transform: rotate(360deg); }
      }

      @media (prefers-reduced-motion: reduce) {
        .busy-icon { animation-duration: 1.8s; }
      }

      .warning {
        background: #fff7ed;
        border-left: 6px solid #f59e0b;
        color: #7c2d12;
        border-radius: 13px;
        padding: 13px 15px;
        margin-bottom: 16px;
        font-size: 14px;
      }

      .rec-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 14px;
        align-items: center;
      }

      .timer-wrap {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      .timer-info {
        min-width: 112px;
        text-align: right;
      }

      .recording-limit {
        margin-top: 3px;
        color: var(--suave);
        font-size: 12px;
        font-weight: 750;
        white-space: normal;
      }

      .dot {
        width: 15px;
        height: 15px;
        border-radius: 50%;
        background: #94a3b8;
      }

      .dot.recording {
        background: #dc2626;
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.12);
        animation: pulse 1.1s infinite;
      }

      .timer {
        color: var(--azul-escuro);
        font-size: 30px;
        font-weight: 900;
      }

      .wave {
        height: 78px;
        border: 1px solid #dbeafe;
        border-radius: 14px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 7px;
        margin: 16px 0;
        background: #fff;
      }

      .bar {
        width: 8px;
        height: 16px;
        border-radius: 999px;
        background: #93c5fd;
        transition: height 0.06s linear;
      }

      audio {
        width: 100%;
        margin-top: 12px;
      }

      .history-tools {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
      }

      .history-list {
        display: grid;
        gap: 10px;
        max-height: 620px;
        overflow-y: auto;
        padding-right: 4px;
      }

      .history-item {
        border: 1px solid #dbeafe;
        background: #fff;
        border-radius: 12px;
        padding: 12px;
        cursor: pointer;
      }

      .history-item.active {
        border-color: var(--azul);
        box-shadow: 0 0 0 3px rgba(15, 94, 156, 0.12);
      }

      .history-title {
        font-weight: 900;
        color: var(--azul-escuro);
        margin-bottom: 4px;
      }

      .history-meta {
        color: var(--suave);
        font-size: 12px;
        line-height: 1.35;
      }

      .tabs {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
      }

      .tab {
        background: #eef2f7;
        color: #334155;
        padding: 11px 13px;
      }

      .tab.active {
        background: var(--azul);
        color: #fff;
      }

      .tab.tab-pdf {
        background: #0f766e;
        color: #fff;
      }

      .tab.tab-pdf:hover { background: #115e59; }

      .panel { display: none; }
      .panel.active { display: block; }

      .result {
        min-height: 260px;
        border: 1px solid var(--borda);
        border-radius: 12px;
        padding: 15px;
        background: #fff;
        white-space: normal;
        line-height: 1.55;
      }

      .result[contenteditable="true"] { cursor: text; transition: border-color .15s ease, box-shadow .15s ease; }
      .result[contenteditable="true"]:hover { border-color: rgba(24, 166, 166, .6); }
      .result[contenteditable="true"]:focus {
        outline: none;
        border-color: var(--azul);
        box-shadow: 0 0 0 4px rgba(24, 166, 166, .11);
      }
      .result.result-dirty { border-color: var(--amarelo); box-shadow: 0 0 0 3px rgba(183, 121, 31, .10); }
      .result-edit-hint { margin: 9px 2px 0; color: var(--suave); font-size: 12px; }

      .result strong {
        font-weight: 800;
      }

      .clinical-review {
        color: var(--vermelho);
        font-weight: 900;
      }

      .clinical-field {
        margin: 0 0 14px;
      }

      .clinical-problem-heading {
        margin-bottom: 5px;
      }

      .clinical-problem-item {
        margin: 0 0 4px;
        padding-left: 20px;
        text-indent: -20px;
        font-weight: 400;
      }

      .clinical-hcvb-heading {
        margin: 18px 0 6px;
      }

      .clinical-hcvb-heading:first-child {
        margin-top: 0;
      }

      .clinical-hcvb-content,
      .clinical-hcvb-subsection {
        margin: 0 0 7px;
        font-weight: 400;
      }

      .clinical-section-title {
        margin: 22px 0 12px;
        padding-bottom: 7px;
        border-bottom: 1px solid var(--borda);
        color: var(--azul-escuro);
        font-size: 16px;
      }

      .clinical-section-title:first-child { margin-top: 0; }

      .audio-parts {
        display: grid;
        gap: 10px;
        margin-top: 12px;
      }

      .audio-part {
        border: 1px solid var(--borda);
        border-radius: 8px;
        padding: 10px;
        background: #f8fafc;
      }

      .audio-part-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 8px;
        color: var(--azul-escuro);
        font-size: 13px;
        font-weight: 800;
      }

      .audio-part-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
      .audio-part-delete { padding: 7px 10px; border-radius: 9px; font-size: 12px; }
      .audio-source { display: none; }
      .audio-player {
        display: grid;
        grid-template-columns: auto auto minmax(120px, 1fr) auto auto auto;
        align-items: center;
        gap: 10px;
        min-height: 58px;
        padding: 9px 12px;
        border-radius: 16px;
        background: #eef2f4;
      }
      .audio-player button { min-width: 44px; min-height: 40px; padding: 8px 10px; border-radius: 11px; }
      .audio-player.audio-unavailable { grid-template-columns: 1fr; opacity: .82; }
      .audio-unavailable-message { color:#991b1b; font-size:12px; font-weight:800; text-align:center; }
      .audio-play { background: var(--azul); color: #fff; font-size: 17px; }
      .audio-skip { background: #fff; color: var(--azul-escuro); border: 1px solid var(--borda); font-size: 12px; }
      .audio-speed { min-width: 54px !important; font-weight: 900; }
      .audio-time { min-width: 84px; text-align: center; color: var(--azul-escuro); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 800; }
      .audio-seek { width: 100%; padding: 0; accent-color: var(--azul); cursor: pointer; }
      .audio-seek:disabled { cursor: wait; opacity: .55; }

      .file-import {
        display: grid;
        gap: 8px;
        margin-top: 12px;
      }

      .file-import input {
        width: 100%;
      }

      .small {
        color: var(--suave);
        font-size: 12px;
      }

      .master-shell {
        max-width: 1180px;
        margin: 0 auto;
      }

      .master-grid {
        display: grid;
        grid-template-columns: minmax(420px, 500px) 1fr;
        gap: 18px;
        align-items: start;
      }

      .master-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
      }

      .master-form .full { grid-column: 1 / -1; }

      .required-mark { color: var(--vermelho); }
      .input-invalid {
        border-color: var(--vermelho) !important;
        box-shadow: 0 0 0 3px rgba(185, 28, 28, .10) !important;
        background: #fffafa !important;
      }
      .field-error-inline {
        margin-top: 5px;
        color: var(--vermelho);
        font-size: 12px;
        font-weight: 800;
      }

      .brand-preview {
        border: 1px solid var(--borda);
        border-top: 7px solid #078f86;
        border-radius: 14px;
        padding: 15px;
        background: #e8f7f7;
      }

      .brand-preview-head { display: flex; align-items: center; gap: 13px; }
      .brand-preview-logo {
        width: 66px;
        height: 66px;
        border-radius: 12px;
        object-fit: contain;
        background: #fff;
        border: 1px solid rgba(15, 23, 42, .1);
        padding: 6px;
      }
      .brand-preview-initial {
        display: grid;
        place-items: center;
        color: #fff;
        background: #078f86;
        font-size: 25px;
        font-weight: 900;
      }
      .brand-preview-name { color: #102a43; font-weight: 900; font-size: 17px; }
      .brand-preview-line { color: #475569; font-size: 12px; margin-top: 4px; }

      .client-identity { display: flex; gap: 11px; align-items: flex-start; }
      .client-logo { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--borda); border-radius: 10px; padding: 4px; background: #fff; }

      input[type="color"] {
        height: 46px;
        padding: 4px;
        cursor: pointer;
      }

      .master-summary {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-bottom: 16px;
      }

      .summary-card {
        border: 1px solid var(--borda);
        border-radius: 14px;
        background: #fff;
        padding: 15px;
      }

      .summary-number {
        display: block;
        color: var(--azul-escuro);
        font-size: 27px;
        font-weight: 900;
        margin-top: 5px;
      }

      .client-list { display: grid; gap: 11px; }

      .master-hero {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 22px;
        margin-bottom: 18px;
        border: 1px solid var(--borda);
        border-radius: 18px;
        background: linear-gradient(135deg, #fff 0%, #e8f7f7 100%);
        box-shadow: inset 5px 0 0 var(--azul);
      }

      .master-hero h2 { margin-bottom: 5px; font-size: 24px; }
      .master-hero button { min-width: 170px; }

      .master-toolbar {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) 220px auto;
        gap: 10px;
        align-items: center;
        margin-bottom: 16px;
      }

      .summary-card-action { cursor: pointer; transition: .16s ease; }
      .summary-card-action:hover { transform: translateY(-2px); border-color: #a7c7e5; }
      .summary-card-action:hover { border-color: rgba(24, 166, 166, .55); box-shadow: 0 10px 24px rgba(16,42,67,.06); }

      .client-card { transition: .16s ease; }
      .client-card:hover { border-color: #a7c7e5; box-shadow: 0 10px 25px rgba(8,52,93,.07); }
      .client-identity { display: flex; gap: 12px; align-items: flex-start; }
      .client-logo { width: 52px; height: 52px; border-radius: 12px; object-fit: contain; border: 1px solid var(--borda); background: #fff; }
      .client-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
      .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
      .status-dot.active { background: #16a34a; }
      .status-dot.draft { background: #f59e0b; }
      .status-dot.blocked { background: #dc2626; }
      .usage-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--cinza); font-size: .84rem; }
      .usage-track { height: 7px; border-radius: 999px; overflow: hidden; background: #e7eef6; margin-top: 10px; }
      .usage-track > span, .usage-fill { display: block; height: 100%; border-radius: inherit; background: var(--azul); }

      .editor-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        margin-bottom: 16px;
      }

      .stepper {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-bottom: 16px;
      }

      .step-button {
        text-align: left;
        background: #eef2f7;
        color: #526078;
        padding: 12px;
      }

      .step-button.active { background: var(--azul); color: #fff; }
      .step-button.done { background: #dcfce7; color: #166534; }
      .wizard-step { display: none; }
      .wizard-step.active { display: block; }

      .editor-footer {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        margin-top: 16px;
      }

      .editor-footer-right { display: flex; gap: 10px; }
      .master-save-toast {
        position:fixed;
        right:28px;
        bottom:28px;
        z-index:10050;
        min-width:300px;
        max-width:min(460px,calc(100vw - 32px));
        padding:16px 20px 16px 54px;
        border:1px solid #9bd7c2;
        border-radius:15px;
        background:#ecfdf5;
        color:#126548;
        box-shadow:0 18px 46px rgba(15,42,67,.20);
        font-size:14px;
        font-weight:800;
        line-height:1.4;
      }
      .master-save-toast::before {
        content:'✓';
        position:absolute;
        left:17px;
        top:50%;
        width:25px;
        height:25px;
        display:grid;
        place-items:center;
        border-radius:50%;
        background:#15906f;
        color:#fff;
        transform:translateY(-50%);
      }
      .master-save-toast.error { border-color:#f0aaaa;background:#fff3f3;color:#991b1b; }
      .master-save-toast.error::before { content:'!';background:#b91c1c; }
      .master-save-toast[hidden] { display:none; }

      .pdf-workspace {
        display: grid;
        grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
        gap: 22px;
        align-items: start;
      }

      .pdf-options { display: grid; gap: 12px; }
      .pdf-module-toggle { margin-bottom:18px; padding:16px 18px; border-color:#9fd9d2; background:#f2fbfa; }
      .pdf-module-toggle strong { display:block; margin-bottom:3px; color:var(--azul-escuro); }
      .pdf-module-settings[hidden] { display:none; }
      .check-row { display: flex; align-items: center; gap: 9px; color: var(--texto); font-size: 14px; }
      .check-row input { width: auto; }
      .pdf-premium-note { display:grid; gap:4px; padding:14px; border:1px solid #a8d8d2; border-radius:12px; background:#f1faf8; }
      .pdf-premium-note strong { color:#075f59; }
      .pdf-premium-note span { color:#526078; font-size:12px; line-height:1.45; }
      .pdf-palette-controls { margin:0; padding:15px; border:1px solid var(--borda); border-radius:13px; }
      .pdf-palette-controls legend { padding:0 7px; color:var(--azul-escuro); font-size:13px; font-weight:900; }
      .pdf-palette-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
      .pdf-palette-grid label { display:grid; grid-template-columns:1fr 52px; align-items:center; gap:9px; margin:0; padding:9px; border:1px solid #e1e9ed; border-radius:10px; }
      .pdf-palette-grid label span { color:#526078; font-size:11px; }
      .pdf-palette-grid input[type="color"] { width:52px; min-height:38px; height:38px; padding:3px; }
      .pdf-watermark-controls { margin:0; padding:15px; border:1px solid var(--borda); border-radius:13px; }
      .pdf-watermark-controls legend { padding:0 7px; color:var(--azul-escuro); font-size:13px; font-weight:900; }
      #mcWatermarkSettings { display:grid; gap:12px; margin-top:12px; padding-top:12px; border-top:1px solid var(--borda); }
      #mcWatermarkSettings[hidden] { display:none; }
      #mcWatermarkUploadRow { display:grid; gap:7px; }
      #mcWatermarkUploadRow[hidden] { display:none; }
      .watermark-source-options { display:grid; gap:9px; }
      .watermark-source-options label { display:flex; align-items:flex-start; gap:10px; margin:0; padding:12px; border:1px solid #d8e4e8; border-radius:11px; cursor:pointer; }
      .watermark-source-options label:has(input:checked) { border-color:var(--azul); background:color-mix(in srgb,var(--azul-suave) 55%,white); }
      .watermark-source-options input { width:18px; min-height:18px; margin-top:2px; }
      .watermark-source-options strong,.watermark-source-options small { display:block; }
      .watermark-source-options small { margin-top:3px; color:#667085; font-weight:600; line-height:1.35; }
      .watermark-upload-box { display:grid; grid-template-columns:92px 1fr; gap:12px; align-items:center; padding:12px; border:1px dashed #8fb8b4; border-radius:12px; background:#f6fbfa; }
      .watermark-upload-box img { width:92px; height:76px; padding:5px; border:1px solid #d7e3e7; border-radius:9px; background:#fff; object-fit:contain; }
      .watermark-file-button { display:inline-flex; width:auto; min-height:40px; align-items:center; justify-content:center; margin:0 0 7px; padding:9px 12px; border-radius:10px; background:var(--azul); color:#fff; cursor:pointer; }
      html[data-runtime="web"] .watermark-file-button { background:var(--action-primary); }
      .watermark-upload-box input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
      .pdf-watermark-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
      .pdf-watermark-grid input[type="range"] { min-height:42px; padding:0; accent-color:var(--azul); }

      .pdf-page {
        width: min(100%, 560px);
        aspect-ratio: 210 / 297;
        margin: 0 auto;
        background: var(--pdf-paper,#f8f4ec);
        border: 1px solid #cdd9e6;
        border-top: 12px solid var(--pdf-header-band,#24434a);
        padding: 24px 42px 76px;
        display: flex;
        flex-direction: column;
        color: #1e293b;
        position: relative;
        overflow: hidden;
        box-shadow:inset 0 -5px 0 var(--pdf-border-accent,#c9a96e),0 18px 45px rgba(8,52,93,.14);
      }

      .pdf-page::before,.pdf-page::after { content:''; position:absolute; top:0; bottom:54px; width:2px; background:var(--pdf-border-accent,#c9a96e); opacity:.82; pointer-events:none; }
      .pdf-page::before { left:20px; }
      .pdf-page::after { right:20px; }
      .pdf-head { display:flex; min-height:105px; flex-direction:column; align-items:flex-start; justify-content:flex-end; gap:10px; padding-bottom:13px; border-bottom:2px solid var(--pdf-border-accent,#c9a96e); position:relative; z-index:3; }
      .pdf-logo { width:195px; max-width:75%; height:68px; object-fit:contain; object-position:left center; }
      .pdf-title { margin:0; color:var(--pdf-header-band,#24434a); font-size:17px; font-weight:900; line-height:1.2; text-transform:uppercase; }
      .pdf-identification-preview { display:grid; grid-template-columns:1fr 1fr; gap:5px 13px; margin:14px 0 8px; padding:10px 0; border-bottom:1px solid var(--pdf-border-accent,#c9a96e); color:#405166; font-size:8px; line-height:1.4; position:relative; z-index:2; }
      .pdf-identification-preview strong { grid-column:1/-1; color:var(--pdf-header-band,#24434a); font-size:9px; text-transform:uppercase; }
      .pdf-body { flex:1; padding:5px 0 18px; position:relative; z-index:2; }
      .pdf-line { height: 4px; border-radius: 2px; background: #dfe6ee; margin: 7px 0; }
      .pdf-line.short { width: 62%; }
      .pdf-section-title { margin-top:12px; font-size:9px; font-weight:800; color:var(--pdf-header-band,#24434a); }
      .pdf-footer { margin:auto -42px -76px; min-height:66px; display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; padding:10px 42px 14px; border:0; background:var(--pdf-footer-band,#24434a); color:var(--pdf-footer-text,#ffffff); font-size:8px; position:relative; z-index:4; }
      .pdf-footer-preview-left { display:grid; gap:4px; min-width:0; }
      #pdfPreviewLinks,#pdfPreviewAddress,#pdfPreviewFooter { color:color-mix(in srgb,var(--pdf-footer-text,#ffffff) 78%,transparent); }
      .pdf-preview-page-number { align-self:end; white-space:nowrap; color:var(--pdf-footer-text,#ffffff); font-size:7px; }
      .pdf-preview-watermark { position:absolute; z-index:1; max-height:55%; object-fit:contain; pointer-events:none; opacity:var(--watermark-opacity,.08); }
      .pdf-preview-watermark.position-center { left:50%; top:55%; transform:translate(-50%,-50%); }
      .pdf-preview-watermark.position-top_left { left:10.5%; top:21%; }
      .pdf-preview-watermark.position-top_center { left:50%; top:21%; transform:translateX(-50%); }
      .pdf-preview-watermark.position-top_right { right:10.5%; top:21%; }
      .pdf-preview-watermark.position-bottom_left { left:10.5%; bottom:17%; }
      .pdf-preview-watermark.position-bottom_center { left:50%; bottom:17%; transform:translateX(-50%); }
      .pdf-preview-watermark.position-bottom_right { right:10.5%; bottom:17%; }
      @media(max-width:720px){ .pdf-palette-grid,.pdf-watermark-grid{grid-template-columns:1fr}.watermark-upload-box{grid-template-columns:1fr}.pdf-page{padding-left:30px;padding-right:30px}.pdf-footer{margin-left:-30px;margin-right:-30px;padding-left:30px;padding-right:30px}.pdf-page::before{left:14px}.pdf-page::after{right:14px} }

      .review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
      .review-card { padding: 14px; border: 1px solid var(--borda); border-radius: 13px; background: #f8fbfe; }
      .review-card strong { color: var(--azul-escuro); }

      .client-card {
        border: 1px solid var(--borda);
        border-radius: 14px;
        padding: 14px;
        background: #fff;
      }

      .client-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
      }

      .client-name { font-weight: 900; color: var(--azul-escuro); }
      .client-meta { margin-top: 5px; color: var(--suave); font-size: 12px; line-height: 1.45; }
      .client-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
      .client-actions button { padding: 9px 12px; font-size: 12px; }

      .idle-warning {
        position: fixed;
        right: 18px;
        bottom: 18px;
        z-index: 1000;
        max-width: 360px;
        background: #fff7ed;
        color: #7c2d12;
        border: 1px solid #fdba74;
        border-radius: 14px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
        padding: 14px 16px;
        display: none;
      }

      @keyframes pulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.18); }
        100% { transform: scale(1); }
      }
