
    :root {
      --ink: #07162e;
      --muted: #617087;
      --bg: #eef4fb;
      --panel: #ffffff;
      --line: #d7e0ec;
      --blue: #2563eb;
      --blue-soft: #e9f1ff;
      --green: #16a36f;
      --green-soft: #e8f8f0;
      --red: #e04757;
      --red-soft: #fff0f2;
      --amber: #f3a12f;
      --amber-soft: #fff5df;
      --violet: #8b5cf6;
      --violet-soft: #f2ecff;
      --cyan: #16a7b5;
      --cyan-soft: #e7f8fa;
      font-family: Inter, "Segoe UI", Arial, sans-serif;
      color-scheme: light;
    }

    * { box-sizing: border-box; }

    html,
    body {
      width: 100%;
      height: 100%;
      margin: 0;
      overflow: hidden;
      background:
        linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px),
        var(--bg);
      background-size: 38px 38px;
      color: var(--ink);
    }

    .shell {
      width: 100vw;
      height: 100vh;
      display: grid;
      place-items: center;
      overflow: hidden;
      padding: 10px;
    }

    .stage {
      position: relative;
      width: 680px;
      height: 430px;
      transform-origin: left top;
      overflow: hidden;
      border: 1px solid rgba(7, 22, 46, 0.18);
      background:
        radial-gradient(circle at 64% 16%, rgba(37, 99, 235, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 245, 252, 0.96));
      box-shadow: 0 24px 58px rgba(18, 42, 78, 0.18);
      isolation: isolate;
    }

    .stage::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background-image:
        linear-gradient(rgba(37, 99, 235, 0.052) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.052) 1px, transparent 1px);
      background-size: 28px 28px;
      animation: grid-drift 18s linear infinite;
    }

    .paused .stage,
    .paused .stage *,
    .paused .stage::before {
      animation-play-state: paused !important;
    }

    .app {
      position: absolute;
      inset: 12px 12px 38px 12px;
      z-index: 2;
      display: grid;
      grid-template-rows: 30px 32px 1fr 68px;
      overflow: hidden;
      border: 1px solid #cfd9e7;
      background: #ffffff;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    .titlebar {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      align-items: center;
      gap: 10px;
      min-width: 0;
      padding: 0 12px;
      border-bottom: 1px solid #e2e8f2;
      background: #fbfdff;
    }

    .doc-title {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      color: var(--ink);
      font-size: 11px;
      line-height: 1;
      font-weight: 860;
    }

    .doc-title i::before {
      content: "\21c4";
      display: grid;
      place-items: center;
      width: 18px;
      height: 18px;
      border: 1px solid rgba(37, 99, 235, 0.26);
      border-radius: 5px;
      color: var(--blue);
      background: var(--blue-soft);
      font-family: Inter, "Segoe UI", Arial, sans-serif;
      font-style: normal;
      font-size: 12px;
      line-height: 1;
    }

    .doc-title b {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .doc-title span {
      color: var(--muted);
      font-size: 9.5px;
      font-weight: 780;
    }

    .window-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #7b889b;
      font-size: 16px;
      line-height: 1;
    }

    .chips {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 0 8px;
      border-bottom: 1px solid #e2e8f2;
      background: #f8fbff;
      overflow: hidden;
    }

    .chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      height: 17px;
      border-radius: 999px;
      padding: 0 6px;
      background: var(--soft);
      color: var(--color);
      font-size: 7.35px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
      animation: chip-live 4.8s ease-in-out infinite;
      animation-delay: var(--delay);
    }

    .chip b {
      color: inherit;
      font-size: 7.8px;
      font-weight: 950;
    }

    .chip::before {
      content: "";
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--color);
      box-shadow: 0 0 9px color-mix(in srgb, var(--color), transparent 35%);
    }

    .chip.edit { --color: var(--blue); --soft: var(--blue-soft); --delay: 0s; }
    .chip.rewrite { --color: #db2777; --soft: #ffeaf4; --delay: 0.35s; }
    .chip.add { --color: var(--green); --soft: var(--green-soft); --delay: 0.7s; }
    .chip.remove { --color: var(--red); --soft: var(--red-soft); --delay: 1.05s; }
    .chip.move { --color: #a855f7; --soft: var(--violet-soft); --delay: 1.4s; }
    .chip.format { --color: var(--amber); --soft: var(--amber-soft); --delay: 1.75s; }
    .chip.renumber { --color: var(--violet); --soft: var(--violet-soft); --delay: 2.1s; }

    .workspace {
      position: relative;
      min-height: 0;
      display: grid;
      grid-template-columns: 1fr 1fr 116px;
      gap: 8px;
      padding: 8px;
      background: #f2f6fb;
      overflow: hidden;
    }

    .pane {
      position: relative;
      min-width: 0;
      overflow: hidden;
      border: 1px solid #e0e7f1;
      background: #ffffff;
      box-shadow: 0 8px 18px rgba(18, 42, 78, 0.06);
      transition: opacity 300ms ease, transform 460ms ease;
      transform-origin: center center;
    }

    .stage.is-inline .pane.old {
      opacity: 0.18;
    }

    .stage.is-inline .pane.new {
      transform: translateX(-132px) scaleX(1.86);
      z-index: 12;
    }

    .pane-head {
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 0 10px;
      border-bottom: 1px solid #edf2f7;
      color: #8a97a9;
      font-size: 8px;
      line-height: 1;
      font-weight: 800;
    }

    .page {
      position: absolute;
      left: 20px;
      right: 20px;
      top: 44px;
      bottom: 18px;
      overflow: hidden;
      background: #ffffff;
      border: 1px solid #e2e8f2;
      box-shadow: 0 12px 26px rgba(18, 42, 78, 0.08);
      padding: 18px 22px;
    }

    .paperwork {
      position: absolute;
      left: 22px;
      top: 18px;
      font-size: 11px;
      line-height: 1;
      font-weight: 950;
      color: var(--ink);
    }

    .paperwork::before {
      content: "";
      display: inline-block;
      width: 12px;
      height: 12px;
      margin-right: 4px;
      vertical-align: -2px;
      border-radius: 50%;
      border: 2px solid var(--ink);
      box-shadow: inset 0 0 0 3px #ffffff;
    }

    .contract-title {
      margin: 58px 0 0;
      color: var(--ink);
      font-size: 13px;
      line-height: 1.12;
      font-weight: 900;
      text-align: center;
    }

    .meta-grid {
      position: absolute;
      right: 18px;
      top: 14px;
      width: 94px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      border: 1px solid #dbe4ef;
      font-size: 6.5px;
      color: #4f6075;
      background: #fbfdff;
    }

    .meta-grid span {
      min-height: 13px;
      padding: 3px 4px;
      border-right: 1px solid #dbe4ef;
      border-bottom: 1px solid #dbe4ef;
      overflow: hidden;
      white-space: nowrap;
    }

    .body-lines {
      margin-top: 18px;
      display: grid;
      gap: 5px;
    }

    .line {
      position: relative;
      height: 5px;
      border-radius: 999px;
      background: #dce7f4;
      overflow: visible;
    }

    .line:nth-child(1) { width: 88%; }
    .line:nth-child(2) { width: 72%; }
    .line:nth-child(3) { width: 94%; }
    .line:nth-child(4) { width: 82%; margin-left: 12px; }
    .line:nth-child(5) { width: 58%; }
    .line:nth-child(6) { width: 86%; }
    .line:nth-child(7) { width: 76%; margin-left: 9px; }
    .line:nth-child(8) { width: 90%; }

    .mark {
      background: var(--mark-bg);
      box-shadow: inset 3px 0 0 var(--mark);
      animation: mark-pulse 4.2s ease-in-out infinite;
      animation-delay: var(--delay);
    }

    .mark::after {
      content: attr(data-note);
      position: absolute;
      right: 0;
      top: -11px;
      color: var(--mark);
      font-size: 6.8px;
      line-height: 1;
      font-weight: 950;
      white-space: nowrap;
    }

    .add { --mark: var(--green); --mark-bg: rgba(22, 163, 111, 0.2); --delay: 0.1s; }
    .del { --mark: var(--red); --mark-bg: rgba(224, 71, 87, 0.18); --delay: 0.55s; }
    .fmt { --mark: var(--blue); --mark-bg: rgba(37, 99, 235, 0.16); --delay: 1s; }
    .num { --mark: var(--amber); --mark-bg: rgba(243, 161, 47, 0.2); --delay: 1.45s; }

    .table {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 2px;
      width: 82%;
      margin-top: 8px;
    }

    .cell {
      height: 8px;
      border: 1px solid #cbd8e8;
      background: #f0f6fc;
    }

    .cell.hot {
      border-color: var(--cyan);
      background: rgba(22, 167, 181, 0.15);
      animation: cell-live 4.6s ease-in-out infinite;
    }

    .scan-band {
      position: absolute;
      left: 0;
      top: 31px;
      z-index: 18;
      width: 52%;
      height: calc(100% - 31px);
      pointer-events: none;
      background:
        linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.16), rgba(22, 167, 181, 0.32), rgba(255, 255, 255, 0.58), rgba(22, 167, 181, 0.2), transparent);
      mix-blend-mode: multiply;
      filter: blur(0.2px);
      transform: translateX(-105%);
      animation: scan-x 4.9s ease-in-out infinite;
    }

    .scan-band::after {
      content: "";
      position: absolute;
      inset: 0;
      background:
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px 8px);
      opacity: 0.54;
    }

    .scan-line {
      position: absolute;
      left: 10px;
      right: 10px;
      top: 84px;
      z-index: 19;
      height: 2px;
      border-radius: 999px;
      pointer-events: none;
      background: linear-gradient(90deg, transparent, rgba(22, 167, 181, 0.95), transparent);
      box-shadow: 0 0 16px rgba(22, 167, 181, 0.58);
      animation: scan-y 3.3s ease-in-out infinite;
    }

    .target-ring {
      position: absolute;
      z-index: 21;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 2px solid var(--ring, var(--green));
      background: color-mix(in srgb, var(--ring, var(--green)), transparent 78%);
      box-shadow: 0 0 18px color-mix(in srgb, var(--ring, var(--green)), transparent 38%);
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.82);
      animation: ring-pop 4.8s ease-in-out infinite;
      animation-delay: var(--delay);
    }

    .target-ring.r1 { left: 398px; top: 134px; --ring: var(--green); --delay: 0s; }
    .target-ring.r2 { left: 510px; top: 185px; --ring: var(--red); --delay: 0.9s; }
    .target-ring.r3 { left: 426px; top: 279px; --ring: var(--cyan); --delay: 1.8s; }

    .analysis-pill {
      position: absolute;
      left: 50%;
      top: 34px;
      z-index: 32;
      display: flex;
      align-items: center;
      gap: 6px;
      height: 24px;
      min-width: 128px;
      padding: 0 9px;
      border: 1px solid rgba(22, 167, 181, 0.34);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.9);
      color: #0e6b76;
      font-size: 8px;
      line-height: 1;
      font-weight: 950;
      box-shadow: 0 12px 22px rgba(18, 42, 78, 0.12);
      transform: translateX(-50%);
      animation: analysis-glow 2.7s ease-in-out infinite;
      pointer-events: none;
    }

    .analysis-pill::before {
      content: "";
      width: 9px;
      height: 9px;
      border-radius: 50%;
      border: 2px solid rgba(22, 167, 181, 0.25);
      border-top-color: var(--cyan);
      animation: spin 1.2s linear infinite;
    }

    .analysis-pill span {
      width: 30px;
      height: 3px;
      border-radius: 999px;
      overflow: hidden;
      background: #d7eef2;
    }

    .analysis-pill span::before {
      content: "";
      display: block;
      width: 42%;
      height: 100%;
      border-radius: inherit;
      background: var(--cyan);
      animation: pill-progress 1.8s ease-in-out infinite;
    }

    .change-list {
      min-width: 0;
      border-left: 1px solid #dfe7f2;
      background: #ffffff;
      padding: 9px 8px;
      overflow: hidden;
    }

    .change-list h2 {
      margin: 0;
      color: var(--ink);
      font-size: 9.7px;
      line-height: 1.1;
      font-weight: 930;
    }

    .change-list small {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-size: 7.6px;
      line-height: 1;
      font-weight: 760;
    }

    .change-card {
      position: relative;
      min-height: 46px;
      margin-top: 6px;
      border: 1px solid #edf2f7;
      border-left: 3px solid var(--card-color);
      border-radius: 6px;
      background: var(--card-soft);
      padding: 6px 7px 5px;
      overflow: hidden;
      animation: card-live 4.8s ease-in-out infinite;
      animation-delay: var(--delay);
    }

    .change-card::before {
      content: attr(data-index);
      display: inline-block;
      margin-right: 4px;
      color: var(--muted);
      font-size: 7.4px;
      font-weight: 900;
    }

    .change-card strong {
      color: var(--card-color);
      font-size: 7.8px;
      line-height: 1;
      font-weight: 950;
    }

    .change-card p {
      margin: 5px 0 0;
      color: #42536a;
      font-size: 6.8px;
      line-height: 1.18;
      font-weight: 700;
    }

    .change-card.edit { --card-color: var(--blue); --card-soft: #f7fbff; --delay: 0.2s; }
    .change-card.format { --card-color: var(--amber); --card-soft: var(--amber-soft); --delay: 0.8s; }
    .change-card.rewrite { --card-color: #db2777; --card-soft: #fff4fa; --delay: 1.4s; }
    .change-card.added { --card-color: var(--green); --card-soft: var(--green-soft); --delay: 2s; }

    .footer-metrics {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      padding: 7px 8px 8px;
      background: #eef4fb;
    }

    .metric {
      position: relative;
      min-width: 0;
      overflow: hidden;
      border: 1px solid #dce5f0;
      background: #ffffff;
      padding: 6px 10px 8px;
      box-shadow: 0 9px 18px rgba(18, 42, 78, 0.06);
    }

    .metric::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 3px;
      background: var(--metric-color);
      transform: scaleX(var(--meter, 0.2));
      transform-origin: left center;
      transition: transform 120ms linear;
    }

    .metric strong {
      display: block;
      color: var(--ink);
      font-size: 18px;
      line-height: 1;
      font-weight: 950;
      letter-spacing: 0;
    }

    .metric span {
      display: block;
      margin-top: 4px;
      color: #738197;
      font-size: 9px;
      line-height: 1.12;
      font-weight: 800;
    }

    .metric:nth-child(1) { --metric-color: var(--blue); }
    .metric:nth-child(2) { --metric-color: var(--green); }
    .metric:nth-child(3) { --metric-color: var(--red); }

    .mode {
      position: static;
      display: grid;
      grid-template-columns: 50px 50px;
      gap: 4px;
      align-items: center;
    }

    .mode span {
      min-height: 18px;
      display: grid;
      place-items: center;
      border: 1px solid #dbe4ef;
      border-radius: 4px;
      background: #ffffff;
      color: #33465f;
      padding: 0 4px;
      font-size: 7px;
      line-height: 1;
      font-weight: 900;
      white-space: nowrap;
    }

    .mode span.is-active {
      border-color: var(--blue);
      background: var(--blue);
      color: #ffffff;
      box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
    }

    .inline-note {
      position: absolute;
      left: 88px;
      right: 134px;
      bottom: 88px;
      z-index: 30;
      display: grid;
      grid-template-columns: 76px 1fr 56px;
      gap: 8px;
      align-items: center;
      min-height: 42px;
      border: 1px solid rgba(37, 99, 235, 0.22);
      background: rgba(255, 255, 255, 0.94);
      padding: 8px 10px;
      box-shadow: 0 16px 32px rgba(18, 42, 78, 0.16);
      opacity: 0;
      transform: translateY(12px);
      transition: opacity 260ms ease, transform 260ms ease;
    }

    .stage.is-inline .inline-note {
      opacity: 1;
      transform: translateY(0);
    }

    .inline-note strong {
      color: var(--blue);
      font-size: 9px;
      line-height: 1;
      font-weight: 950;
    }

    .inline-note span {
      color: #34465e;
      font-size: 8.4px;
      line-height: 1.2;
      font-weight: 760;
    }

    .inline-note b {
      display: grid;
      place-items: center;
      height: 24px;
      border-radius: 999px;
      background: var(--green-soft);
      color: var(--green);
      font-size: 8px;
      line-height: 1;
      font-weight: 950;
    }

    .runner {
      position: absolute;
      z-index: 35;
      left: 0;
      top: 0;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      opacity: 0;
      background: var(--run);
      box-shadow: 0 0 18px color-mix(in srgb, var(--run), transparent 24%);
      pointer-events: none;
    }

    .runner::after {
      content: "";
      position: absolute;
      inset: -8px;
      border: 1px solid var(--run);
      border-radius: 50%;
      animation: pulse 1.5s ease-in-out infinite;
    }

    .runner.add { --run: var(--green); }
    .runner.del { --run: var(--red); }
    .runner.table-run { --run: var(--cyan); }

    .progress {
      position: absolute;
      left: 20px;
      right: 58px;
      bottom: 12px;
      z-index: 45;
      height: 4px;
      border-radius: 999px;
      overflow: hidden;
      background: rgba(7, 22, 46, 0.12);
    }

    .progress span {
      display: block;
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green), var(--amber), var(--red));
      box-shadow: 0 0 14px rgba(37, 99, 235, 0.28);
    }

    .controls {
      position: absolute;
      right: 14px;
      bottom: 8px;
      z-index: 48;
      display: flex;
      gap: 5px;
    }

    .control {
      width: 28px;
      height: 24px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(37, 99, 235, 0.36);
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.9);
      color: var(--ink);
      font-size: 12px;
      line-height: 1;
      font-weight: 950;
      cursor: pointer;
    }

    @keyframes grid-drift {
      from { background-position: 0 0, 0 0; }
      to { background-position: 56px 28px, -28px 56px; }
    }

    @keyframes chip-live {
      0%, 100% { transform: translateY(0); filter: saturate(1); }
      48%, 66% { transform: translateY(-1px); filter: saturate(1.35); }
    }

    @keyframes scan-x {
      0%, 8% { transform: translateX(-110%); opacity: 0; }
      18%, 72% { opacity: 0.92; }
      92%, 100% { transform: translateX(206%); opacity: 0; }
    }

    @keyframes scan-y {
      0%, 100% { transform: translateY(-42px); opacity: 0; }
      15%, 70% { opacity: 0.95; }
      62% { transform: translateY(188px); }
    }

    @keyframes mark-pulse {
      0%, 100% { transform: translateX(0); filter: saturate(1); }
      42%, 64% { transform: translateX(3px); filter: saturate(1.35); }
    }

    @keyframes cell-live {
      0%, 100% { transform: scale(1); filter: saturate(1); }
      42%, 64% { transform: scale(1.04); filter: saturate(1.4); }
    }

    @keyframes ring-pop {
      0%, 14%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.82); }
      28%, 60% { opacity: 0.96; transform: translate(-50%, -50%) scale(1.12); }
      76% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
    }

    @keyframes card-live {
      0%, 100% { transform: translateX(0); }
      42%, 62% { transform: translateX(4px); }
    }

    @keyframes pulse {
      0%, 100% { transform: scale(0.9); opacity: 0.35; }
      50% { transform: scale(1.18); opacity: 0.9; }
    }

    @keyframes analysis-glow {
      0%, 100% { box-shadow: 0 12px 22px rgba(18, 42, 78, 0.12); }
      50% { box-shadow: 0 14px 30px rgba(22, 167, 181, 0.26); }
    }

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

    @keyframes pill-progress {
      0%, 100% { transform: translateX(-15%); }
      50% { transform: translateX(150%); }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation: none !important;
        transition: none !important;
      }
    }
  