@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("fonts/IBMPlexSansCondensed-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("fonts/IBMPlexSansCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #0a1728;
  --ink-soft: #405066;
  --rail: #07162a;
  --rail-deep: #04101f;
  --rail-muted: #8ea0b8;
  --rail-line: #20324a;
  --blue: #155f9f;
  --blue-deep: #0d4b82;
  --blue-light: #dbe8f2;
  --paper: #f2f5f7;
  --sheet: #fbfcfd;
  --line: #cbd4de;
  --line-dark: #9eacba;
  --danger: #9a2634;
  --danger-soft: #f5e2e5;
  --warning: #785800;
  --warning-soft: #f5ebc9;
  --success: #2c7a59;
  --motion-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --motion-fast: 140ms;
  --radius-small: 10px;
  --radius-control: 14px;
  --radius-panel: 20px;
  --surface-shadow: 0 14px 36px rgba(10, 33, 57, 0.08);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--rail-deep); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--rail-deep);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button { color: inherit; }

.app-frame {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: min(1320px, calc(100% - 40px));
  min-height: calc(100vh - 40px);
  margin: 20px auto;
  overflow: hidden;
  border: 1px solid #1c2c40;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(0, 7, 18, 0.42);
}

.control-rail {
  display: flex;
  min-height: 100%;
  padding: 38px 34px 28px;
  flex-direction: column;
  background: var(--rail);
  color: #f5f8fb;
}

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity-mark {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 7px;
  align-content: center;
  gap: 4px;
  border: 1px solid #426586;
  border-radius: var(--radius-small);
}

.identity-mark i {
  display: block;
  height: 2px;
  background: #d6e8f7;
}

.identity-mark i:nth-child(1) { width: 100%; }
.identity-mark i:nth-child(2) { width: 72%; }
.identity-mark i:nth-child(3) { width: 42%; }

.identity-name {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.07em;
  line-height: 1.08;
  text-transform: uppercase;
}

.rail-history { margin-top: 70px; }
.rail-history jelly-button { width: 100%; }

jelly-button[variant="rail"] .jelly-control {
  justify-content: flex-start;
  border-color: #35516e;
  background: #10243a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #edf5fb;
}

jelly-button[variant="rail"] .jelly-label {
  width: 100%;
  justify-content: space-between;
}

@media (hover: hover) and (pointer: fine) {
  jelly-button[variant="rail"]:hover .jelly-control:not(:disabled) {
    border-color: #6589aa;
    background: #18314b;
    box-shadow:
      0 12px 26px rgba(0, 7, 18, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}

.workflow {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 34px;
}

.workflow::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 5px;
  width: 1px;
  background: var(--rail-line);
  content: "";
}

.workflow-item {
  position: relative;
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 16px;
  padding: 12px 0;
  color: var(--rail-muted);
  transition: color 180ms ease;
}

.workflow-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border: 2px solid #52657c;
  border-radius: 4px;
  background: var(--rail);
  transition:
    transform 180ms var(--motion-ease-out),
    border-color 180ms ease,
    background-color 180ms ease;
}

.workflow-item.is-active { color: #fff; }
.workflow-item.is-active .workflow-dot { border-color: #9bcaee; background: #2a80bd; transform: scale(1.08); }
.workflow-item.is-complete { color: #b8c8d8; }
.workflow-item.is-complete .workflow-dot { border-color: #75b396; background: #3a8966; }
.workflow-item strong { display: block; font-size: 14px; font-weight: 600; }
.workflow-item small { display: block; margin-top: 2px; color: inherit; font-size: 12px; }

.rail-spec {
  display: grid;
  margin-top: auto;
  border-top: 1px solid var(--rail-line);
}

.rail-spec div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rail-line);
}

.rail-spec span { color: var(--rail-muted); font-size: 11px; }
.rail-spec strong { color: #dce8f3; font-size: 11px; font-weight: 500; text-align: right; }

.rail-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: #aec0d2;
  font-size: 11px;
}

.status-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53aa7f;
  box-shadow: 0 3px 10px rgba(83, 170, 127, 0.34);
}

.workbench {
  display: flex;
  min-width: 0;
  padding: 48px 56px 24px;
  flex-direction: column;
  background: #f3f6f8;
}

.workbench-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
}

h1, h2, p, dl, dd { margin: 0; }

h1 {
  color: var(--ink);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.workbench-header p {
  max-width: 620px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 15px;
}

.method-stamp {
  display: grid;
  width: 190px;
  flex: 0 0 auto;
  border-top: 2px solid var(--ink);
}

.method-stamp div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-dark);
}

.method-stamp dt {
  color: var(--ink-soft);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.method-stamp dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.privacy-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 42px;
  padding: 14px 16px;
  border: 1px solid #d3dce4;
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.62);
}

.privacy-seal {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--blue);
  border-radius: 8px;
}

.privacy-seal::before {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 9px;
  height: 8px;
  border: 1px solid var(--blue);
  border-bottom: 0;
  content: "";
}

.privacy-seal i {
  position: absolute;
  right: 7px;
  bottom: 5px;
  left: 7px;
  height: 9px;
  background: var(--blue);
}

.privacy-line div { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.privacy-line strong { color: var(--blue-deep); font-size: 13px; }
.privacy-line div > span { color: var(--ink-soft); font-size: 13px; }

.operation {
  margin-top: 42px;
  padding: 0 24px 24px;
  border: 1px solid #d2dbe3;
  border-radius: var(--radius-panel);
  background: var(--sheet);
  box-shadow: var(--surface-shadow);
}

.operation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 0 25px;
  border-bottom: 1px solid #dce3e9;
}

h2 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.operation-heading p, .process-board p, .results-heading p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 13px;
}

.operation-code {
  padding-top: 4px;
  color: #64758a;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.dropzone {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 142px;
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line-dark);
  border-radius: 17px;
  background: #fff;
  cursor: pointer;
  outline: 0;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragging {
  border-color: var(--blue);
  background: #f2f7fb;
  box-shadow: 0 12px 28px rgba(13, 75, 130, 0.09);
}

.drop-index {
  display: grid;
  width: 58px;
  height: 76px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 13px;
  color: var(--blue-deep);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.drop-copy { display: grid; gap: 4px; }
.drop-copy strong { font-size: 17px; font-weight: 600; }
.drop-copy span { color: var(--ink-soft); font-size: 13px; }

jelly-button {
  --press-x: 50%;
  --press-y: 50%;
  display: inline-flex;
  min-width: 0;
  vertical-align: middle;
}

jelly-button[variant="primary"] { min-width: 204px; }

.jelly-control {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  padding: 11px 20px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #87a6bf;
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 8px 20px rgba(15, 52, 86, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: var(--blue-deep);
  font: 600 15px "IBM Plex Sans", sans-serif;
  isolation: isolate;
  transform: translateY(0) scaleX(1) scaleY(1);
  transform-origin: var(--press-x) var(--press-y);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--motion-fast) var(--motion-ease-out),
    background-color var(--motion-fast) ease,
    color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.jelly-control::before {
  position: absolute;
  top: var(--press-y);
  left: var(--press-x);
  z-index: 0;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(21, 95, 159, 0.13);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.28);
  transition:
    transform var(--motion-fast) var(--motion-ease-out),
    opacity 100ms ease;
}

.jelly-control::after {
  position: absolute;
  top: 2px;
  right: 12px;
  left: 12px;
  z-index: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.9);
  content: "";
  opacity: 0.82;
  pointer-events: none;
}

.jelly-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

jelly-button[data-arrow] .jelly-label::after {
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

jelly-button[variant="primary"] .jelly-control {
  border: 1px solid var(--blue-deep);
  background: var(--blue-deep);
  box-shadow:
    0 10px 24px rgba(13, 75, 130, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
}

jelly-button[variant="primary"] .jelly-control::before { background: rgba(255, 255, 255, 0.18); }

@media (hover: hover) and (pointer: fine) {
  jelly-button:hover .jelly-control:not(:disabled) {
    border-color: var(--blue);
    background: #f0f6fb;
    box-shadow:
      0 12px 26px rgba(15, 52, 86, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(-2px) scaleX(1) scaleY(1);
  }

  jelly-button[variant="primary"]:hover .jelly-control:not(:disabled) {
    border-color: #083a68;
    background: #083a68;
    box-shadow:
      0 14px 28px rgba(8, 58, 104, 0.30),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

jelly-button.is-tactile-pressed .jelly-control:not(:disabled),
.jelly-control:active:not(:disabled) {
  box-shadow:
    0 4px 10px rgba(15, 52, 86, 0.14),
    inset 0 2px 4px rgba(6, 35, 61, 0.12);
  transform: translateY(2px) scaleX(1.018) scaleY(0.94);
}

jelly-button.is-tactile-pressed .jelly-control:not(:disabled)::before,
.jelly-control:active:not(:disabled)::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.jelly-control:disabled { cursor: not-allowed; opacity: 0.42; transform: none; box-shadow: none; }
.jelly-control:focus-visible, .text-button:focus-visible { outline: 3px solid rgba(21, 95, 159, 0.24); outline-offset: 3px; }

.file-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.8fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 10px;
  padding: 14px 18px;
  border: 1px solid #9db9cf;
  border-radius: var(--radius-control);
  background: var(--blue-light);
  animation: soft-in 220ms var(--motion-ease-out) both;
}

.file-strip-label, .file-strip-meta { display: grid; min-width: 0; gap: 2px; }
.file-strip-label span, .file-strip-meta span { color: #4e6579; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.file-strip-label strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.file-strip-meta strong { font-size: 12px; font-weight: 500; }

.text-button {
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.text-button:hover { background: rgba(21, 95, 159, 0.09); color: #072f55; }

.message {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 13px 16px;
  border: 1px solid #ca8992;
  border-radius: var(--radius-control);
  animation: soft-in 220ms var(--motion-ease-out) both;
}

.message.error { background: var(--danger-soft); color: #721f2a; }

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
}

.process-board, .results-board {
  margin-top: 30px;
  padding: 26px;
  border: 1px solid #c8d6e2;
  border-radius: var(--radius-panel);
  background: rgba(251, 252, 253, 0.92);
  box-shadow: var(--surface-shadow);
  animation: soft-in 260ms var(--motion-ease-out) both;
}

.process-copy, .results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

#progress-value {
  color: var(--blue-deep);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 4px;
  margin: 27px 0 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #cdd8e1;
}

#progress-bar {
  width: 100%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 120ms linear;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
}

.metric {
  min-width: 0;
  padding: 18px 18px 17px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
}

.metric:last-child { border-right: 0; }
.metric > span { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 500; }
.metric strong {
  display: block;
  margin-top: 10px;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric small { display: block; margin-top: 7px; color: #6b7989; font-size: 10px; }
.metric.is-danger { background: var(--danger-soft); }
.metric.is-danger strong { color: var(--danger); }
.metric.is-warning { background: var(--warning-soft); }
.metric.is-warning strong { color: var(--warning); }

.result-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.result-footnote strong { color: var(--ink); }
.new-audit { display: block; margin: 16px 0 0 auto; }

.workbench-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding-top: 42px;
  color: #738092;
  font-size: 10px;
}

body.has-drawer-open { overflow: hidden; }

jelly-alert {
  display: flex;
  width: max-content;
  max-width: 100%;
  padding: 12px 15px 12px 12px;
  align-items: center;
  justify-self: end;
  gap: 11px;
  border: 1px solid #8fb3cf;
  border-radius: 14px;
  background: #edf6fc;
  box-shadow: 0 16px 42px rgba(5, 38, 67, 0.18);
  color: #0a416f;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  visibility: hidden;
  transition:
    opacity 220ms var(--motion-ease-out),
    transform 220ms var(--motion-ease-out),
    visibility 0s linear 220ms;
}

jelly-alert.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition-delay: 0s;
}

.jelly-alert-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
}

.jelly-alert-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

jelly-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: block;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 300ms;
}

jelly-drawer[open] {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.jelly-drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(3, 12, 24, 0.48);
  cursor: default;
  opacity: 0;
  transition: opacity 220ms ease;
}

jelly-drawer[open] .jelly-drawer-backdrop { opacity: 1; }

.jelly-drawer-panel {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  width: min(430px, calc(100vw - 22px));
  max-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0 24px 24px 0;
  background: #f4f7f9;
  box-shadow: 24px 0 70px rgba(0, 8, 20, 0.34);
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

jelly-drawer[open] .jelly-drawer-panel { transform: translateX(0); }
.jelly-drawer-panel:focus { outline: 0; }

.jelly-drawer-header {
  display: flex;
  padding: 27px 24px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #d5dee6;
  background: #fff;
}

.jelly-drawer-header h2 { font-size: 28px; }

.jelly-drawer-close {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid #b4c4d1;
  border-radius: 12px;
  background: #f7fafc;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--motion-fast) ease, transform var(--motion-fast) var(--motion-ease-out);
}

.jelly-drawer-close span {
  position: absolute;
  inset: 0;
  display: block;
  transform: rotate(0deg) scale(1);
  transition: transform 180ms var(--motion-ease-out);
}

.jelly-drawer-close span::before,
.jelly-drawer-close span::after {
  position: absolute;
  top: 19px;
  left: 12px;
  width: 16px;
  height: 1px;
  background: currentColor;
  content: "";
}

.jelly-drawer-close span::before { transform: rotate(45deg); }
.jelly-drawer-close span::after { transform: rotate(-45deg); }
.jelly-drawer-close:hover { background: #e8f0f6; }
.jelly-drawer-close:active { transform: scale(0.96); }
.jelly-drawer-close:focus-visible { outline: 3px solid rgba(21, 95, 159, 0.24); outline-offset: 3px; }

jelly-drawer[open] .jelly-drawer-close span { animation: close-mark-in 260ms var(--motion-ease-out); }

@media (hover: hover) and (pointer: fine) {
  .jelly-drawer-close:hover span { transform: rotate(90deg) scale(1.04); }
}

.jelly-drawer-body {
  min-height: 0;
  padding: 22px 24px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.history-intro {
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 13px;
}

.history-overview {
  display: flex;
  margin-top: 22px;
  padding: 15px 17px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: var(--radius-control);
  background: var(--rail);
  color: #fff;
}

.history-overview span { color: #b9cad9; font-size: 12px; }
.history-overview strong { font-family: "IBM Plex Sans Condensed", sans-serif; font-size: 24px; font-weight: 600; }
.history-list { display: grid; gap: 10px; margin-top: 24px; }

.history-day { display: grid; gap: 9px; }
.history-day + .history-day { margin-top: 14px; }
.history-day-title { color: #617286; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.history-entry {
  padding: 14px 15px;
  border: 1px solid #d2dce4;
  border-radius: var(--radius-control);
  background: #fff;
}

.history-entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.history-entry-head strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.history-entry-head time { flex: 0 0 auto; color: #65778a; font-size: 11px; font-variant-numeric: tabular-nums; }
.history-entry-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 13px; }
.history-entry-stats span { display: grid; gap: 2px; color: #6b7b8c; font-size: 9px; }
.history-entry-stats b { color: var(--ink); font-family: "IBM Plex Sans Condensed", sans-serif; font-size: 18px; font-weight: 600; }
.history-entry-stats .is-danger b { color: var(--danger); }
.history-entry-stats .is-warning b { color: var(--warning); }

.history-empty {
  display: grid;
  gap: 5px;
  margin-top: 24px;
  padding: 22px 18px;
  border: 1px dashed #aebdca;
  border-radius: var(--radius-control);
  color: var(--ink-soft);
}

.history-empty strong { color: var(--ink); font-size: 14px; }
.history-empty span { font-size: 12px; }

[hidden] { display: none !important; }

@keyframes soft-in {
  from { opacity: 0.55; transform: translateY(8px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes close-mark-in {
  from { opacity: 0.25; transform: rotate(-55deg) scale(0.82); }
  to { opacity: 1; transform: rotate(0deg) scale(1); }
}

@media (max-width: 1040px) {
  .app-frame { grid-template-columns: 250px minmax(0, 1fr); }
  .control-rail { padding-right: 26px; padding-left: 26px; }
  .rail-thesis { font-size: 24px; }
  .workbench { padding-right: 38px; padding-left: 38px; }
}

@media (max-width: 820px) {
  .app-frame { display: block; width: min(100% - 24px, 760px); margin: 12px auto; }
  .control-rail { min-height: auto; padding: 24px; }
  .rail-history { width: min(100%, 320px); margin-top: 30px; }
  .workflow { grid-template-columns: repeat(3, 1fr); margin-top: 32px; }
  .workflow::before { top: 5px; right: 16%; bottom: auto; left: 16%; width: auto; height: 1px; }
  .workflow-item { grid-template-columns: 11px 1fr; padding-right: 12px; }
  .rail-spec { grid-template-columns: repeat(3, 1fr); margin-top: 28px; }
  .rail-spec div { display: block; padding-right: 12px; border-right: 1px solid var(--rail-line); border-bottom: 0; }
  .rail-spec div:last-child { border-right: 0; }
  .rail-spec strong { display: block; margin-top: 4px; text-align: left; }
  .rail-footer { margin-top: 24px; }
  .workbench { min-height: 780px; padding: 38px 30px 24px; }
}

@media (max-width: 620px) {
  .app-frame { width: 100%; margin: 0; border: 0; }
  .control-rail { padding: 22px 20px; }
  .rail-history { width: 100%; margin-top: 26px; }
  .workflow-item { display: flex; gap: 8px; }
  .workflow-item small { display: none; }
  .rail-spec { grid-template-columns: 1fr; }
  .rail-spec div { display: grid; padding: 8px 0; border-right: 0; border-bottom: 1px solid var(--rail-line); }
  .rail-spec strong { margin-top: 0; text-align: right; }
  .workbench { min-height: 720px; padding: 32px 20px 20px; }
  .workbench-header { display: block; }
  .method-stamp { width: 100%; margin-top: 28px; }
  h1 { font-size: 42px; }
  h2 { font-size: 24px; }
  .privacy-line { align-items: flex-start; margin-top: 30px; }
  .privacy-line div { display: grid; }
  .operation { margin-top: 32px; }
  .operation-heading { display: block; }
  .operation-code { display: block; margin-top: 14px; }
  .dropzone { grid-template-columns: 52px 1fr; min-height: 0; padding: 18px; }
  .drop-index { width: 48px; height: 62px; }
  .dropzone jelly-button { grid-column: 1 / -1; width: 100%; }
  .file-strip { grid-template-columns: 1fr auto; }
  .file-strip-meta { display: none; }
  .command-line { grid-template-columns: 1fr; align-items: stretch; }
  .command-line jelly-alert { justify-self: center; }
  .command-line jelly-button { width: 100%; }
  .process-copy, .results-heading { align-items: stretch; flex-direction: column; }
  .results-heading jelly-button { width: 100%; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 390px) {
  .workflow { grid-template-columns: 1fr; }
  .workflow::before { top: 17px; right: auto; bottom: 17px; left: 5px; width: 1px; height: auto; }
  .workflow-item small { display: block; }
  .metrics { grid-template-columns: 1fr; }
  .metric, .metric:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .workbench-footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .jelly-control, jelly-button:hover .jelly-control, .jelly-control:active, jelly-button.is-tactile-pressed .jelly-control { transform: none !important; }
  .jelly-control::before { display: none; }
  jelly-alert { transform: none !important; }
  .jelly-drawer-panel { transition-duration: 0.01ms !important; }
  .jelly-drawer-close span { animation: none !important; transform: none !important; }
}
