    :root {
      --bg: #0a0f1e;
      --bg2: #0f172a;
      --surface: rgba(255,255,255,0.04);
      --border: rgba(255,255,255,0.08);
      --em: #10b981;
      --em-light: #34d399;
      --text: #e2e8f0;
      --muted: #94a3b8;
      --danger: #f87171;
      --radius: 18px;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: Inter, system-ui, sans-serif;
      background:
        radial-gradient(circle at top left, rgba(16,185,129,0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(59,130,246,0.12), transparent 22%),
        linear-gradient(180deg, #0a0f1e, #111827 55%, #0b1220);
      color: var(--text);
      min-height: 100vh;
    }
    a { color: inherit; text-decoration: none; }
    .shell {
      width: min(1100px, calc(100% - 32px));
      margin: 0 auto;
      padding: 32px 0 72px;
    }
    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 40px;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 800;
      letter-spacing: -.02em;
    }
    .brand-badge {
      width: 38px;
      height: 38px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--em), #059669);
      display: grid;
      place-items: center;
      box-shadow: 0 0 18px rgba(16,185,129,0.24);
      color: white;
      font-size: 18px;
    }
    .toplink {
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.03);
      color: var(--muted);
      padding: 10px 14px;
      border-radius: 999px;
      font-size: .92rem;
    }
    .hero {
      display: grid;
      grid-template-columns: 1.1fr .9fr;
      gap: 24px;
      align-items: start;
    }
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 28px;
      box-shadow: 0 26px 70px rgba(2,6,23,0.35);
      backdrop-filter: blur(16px);
    }
    h1 {
      margin: 0 0 14px;
      font-size: clamp(2rem, 5vw, 3.5rem);
      line-height: 1.03;
      letter-spacing: -.04em;
    }
    .lead {
      margin: 0;
      color: var(--muted);
      font-size: 1.02rem;
      max-width: 48ch;
    }
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin-top: 22px;
    }
    .fg { display: flex; flex-direction: column; gap: 8px; }
    .fg.full { grid-column: 1 / -1; }
    label {
      font-size: .84rem;
      font-weight: 700;
      color: #cbd5e1;
      letter-spacing: .02em;
    }
    input, textarea, button {
      font: inherit;
    }
    input, textarea {
      width: 100%;
      background: rgba(15,23,42,0.78);
      color: var(--text);
      border: 1px solid rgba(52,211,153,0.34);
      border-radius: 14px;
      padding: 14px 16px;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
    }
    input:focus, textarea:focus {
      border-color: var(--em-light);
      box-shadow: 0 0 0 4px rgba(16,185,129,0.12);
    }
    .actions {
      display: flex;
      gap: 12px;
      margin-top: 18px;
      flex-wrap: wrap;
    }
    .actions-inline {
      margin-top: 0;
      margin-bottom: 16px;
    }
    .actions-tight {
      margin-top: 12px;
    }
    .actions-doc {
      margin-top: 4px;
    }
    .btn {
      border: 0;
      border-radius: 14px;
      padding: 14px 18px;
      font-weight: 800;
      cursor: pointer;
      transition: transform .18s ease, box-shadow .18s ease;
    }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary {
      background: linear-gradient(135deg, var(--em-light), var(--em));
      color: #04111d;
      box-shadow: 0 18px 40px rgba(16,185,129,0.22);
    }
    .btn-secondary {
      background: rgba(255,255,255,0.04);
      color: var(--text);
      border: 1px solid var(--border);
    }
    .hint {
      margin-top: 14px;
      color: var(--muted);
      font-size: .9rem;
    }
    .info-list {
      display: grid;
      gap: 14px;
    }
    .info-item {
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.025);
      border-radius: 16px;
      padding: 16px;
    }
    .info-item strong {
      display: block;
      margin-bottom: 6px;
      color: #f8fafc;
      font-size: .96rem;
    }
    .result {
      margin-top: 28px;
      display: none;
    }
    .result.show { display: block; }
    .result-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 16px;
    }
    .status-pill, .meta-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border-radius: 999px;
      padding: 8px 12px;
      font-size: .84rem;
      font-weight: 700;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.05);
    }
    .status-pill.recibido { color: #fde68a; }
    .status-pill.en_revision { color: #fcd34d; }
    .status-pill.en_progreso { color: #86efac; }
    .status-pill.informe_emitido { color: #93c5fd; }
    .status-pill.cerrado { color: #cbd5e1; }
    .timeline {
      display: grid;
      gap: 14px;
      margin-top: 18px;
    }
    .sign-box {
      margin-top: 20px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: rgba(255,255,255,0.03);
      padding: 18px;
    }
    .sign-box.is-hidden { display: none; }
    .portal-eyebrow {
      margin: 0 0 10px;
      color: var(--em-light);
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
      font-size: .76rem;
    }
    .sign-box-title {
      display: block;
      font-size: 1.02rem;
    }
    .sign-box-copy {
      margin-top: 6px;
      color: #cbd5e1;
    }
    .info-item-compact {
      margin-bottom: 12px;
    }
    .fg-top-gap {
      margin-top: 10px;
    }
    .sign-consent-label {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      color: #cbd5e1;
      font-size: .86rem;
      font-weight: 600;
    }
    .sign-consent-checkbox {
      margin-top: 2px;
      width: 16px;
      height: 16px;
    }
    .aside-title {
      margin: 0 0 16px;
      font-size: 1.35rem;
    }
    .timeline-copy { color: #cbd5e1; }
    .timeline-empty-copy { color: #94a3b8; }
    .signed-document-fallback {
      padding: 32px;
      color: #64748b;
    }
    .sign-doc-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .sign-doc-item {
      border: 1px solid var(--border);
      border-radius: 14px;
      background: rgba(15,23,42,0.5);
      padding: 12px;
    }
    .sign-doc-title {
      font-weight: 800;
      color: #f8fafc;
      margin-bottom: 4px;
    }
    .sign-doc-meta {
      font-size: .86rem;
      color: var(--muted);
      margin-bottom: 10px;
    }
    .sign-doc-status {
      display: inline-flex;
      padding: 4px 9px;
      border-radius: 999px;
      font-size: .74rem;
      font-weight: 800;
      border: 1px solid var(--border);
      margin-bottom: 10px;
    }
    .sign-doc-status.pending {
      color: #fcd34d;
      background: rgba(113,63,18,0.28);
      border-color: rgba(252,211,77,0.25);
    }
    .sign-doc-status.signed {
      color: #86efac;
      background: rgba(6,78,59,0.28);
      border-color: rgba(52,211,153,0.24);
    }
    .sign-canvas-wrap {
      margin-top: 14px;
      border-radius: 14px;
      border: 1px dashed rgba(52,211,153,0.45);
      background: rgba(2,6,23,0.64);
      overflow: hidden;
    }
    #signatureCanvas {
      display: block;
      width: 100%;
      height: 210px;
      touch-action: none;
      cursor: crosshair;
    }
    .sign-note {
      margin-top: 8px;
      color: var(--muted);
      font-size: .82rem;
    }
    .sign-form {
      display: none;
      margin-top: 16px;
      border-top: 1px solid var(--border);
      padding-top: 14px;
    }
    .sign-form.show { display: block; }
    .timeline-item {
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.03);
      border-radius: 18px;
      padding: 18px;
    }
    .timeline-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: baseline;
      margin-bottom: 8px;
    }
    .timeline-head strong {
      font-size: 1rem;
      color: #f8fafc;
    }
    .timeline-head span {
      color: var(--muted);
      font-size: .82rem;
    }
    .feedback {
      display: none;
      margin-top: 14px;
      padding: 14px 16px;
      border-radius: 14px;
      font-weight: 700;
      border: 1px solid transparent;
    }
    .feedback.show { display: block; }
    .feedback.error {
      background: rgba(127,29,29,0.24);
      border-color: rgba(248,113,113,0.28);
      color: #fca5a5;
    }
    .feedback.ok {
      background: rgba(6,78,59,0.24);
      border-color: rgba(52,211,153,0.3);
      color: #86efac;
    }
    @media (max-width: 860px) {
      .hero { grid-template-columns: 1fr; }
      .form-grid, .result-grid { grid-template-columns: 1fr; }
      .sign-doc-grid { grid-template-columns: 1fr; }
      .topbar { align-items: flex-start; flex-direction: column; }
    }
