:root {
  --canvas: #000000;
  --surface: #0b111a;
  --surface-raised: #111b28;
  --surface-focus: #172638;
  --line: #26384b;
  --line-soft: #182536;
  --text: #f5f9fc;
  --text-secondary: #a8b7c6;
  --text-muted: #718296;
  --cyan: #28d7f5;
  --cyan-soft: rgba(40, 215, 245, 0.14);
  --green: #43e39d;
  --green-soft: rgba(67, 227, 157, 0.13);
  --amber: #ffbd55;
  --amber-soft: rgba(255, 189, 85, 0.14);
  --red: #ff6a78;
  --red-soft: rgba(255, 106, 120, 0.13);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --focus-shadow: 0 0 0 2px var(--cyan), 0 0 24px rgba(40, 215, 245, 0.32);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--canvas);
}

body {
  color: var(--text);
  font-family: "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: -0.01em;
}

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

button {
  border: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#app {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 8px;
  background:
    radial-gradient(circle at 50% -25%, rgba(34, 106, 147, 0.18), transparent 45%),
    var(--canvas);
}

.screen {
  position: absolute;
  inset: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(6, 11, 18, 0.94);
}

.hidden {
  display: none !important;
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 17, 26, 0.97);
  flex: 0 0 auto;
}

.home-header {
  min-height: 88px;
}

.header-copy {
  min-width: 0;
  flex: 1;
}

.header-copy h1 {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 680;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-header .header-copy h1 {
  font-size: 22px;
}

.header-copy p {
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  justify-content: center;
  gap: 4px;
  padding: 9px;
  border: 1px solid #1d8ba2;
  border-radius: 12px;
  background: var(--cyan-soft);
}

.brand-mark span {
  border-radius: 3px;
  background: var(--cyan);
}

.brand-mark span:nth-child(1) { height: 13px; }
.brand-mark span:nth-child(2) { height: 24px; }
.brand-mark span:nth-child(3) { height: 18px; }

.status-dot {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 12px;
}

.status-dot span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(67, 227, 157, 0.65);
}

.icon-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 25px;
  cursor: pointer;
}

.content {
  min-height: 0;
  flex: 1;
  padding: 14px 16px;
}

.scroll-shell,
.checklist-shell,
.step-content {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.scroll-shell::after,
.checklist-shell::after,
.step-content::after {
  content: "";
  position: sticky;
  bottom: -14px;
  display: block;
  width: 100%;
  height: 42px;
  margin-top: -42px;
  background: linear-gradient(to top, rgba(6, 11, 18, 0.98), transparent);
  pointer-events: none;
}

.home-content {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.section-label,
.field-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-actions,
.stack-list,
.checklist {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.action-tile,
.template-card,
.history-card,
.export-option {
  width: 100%;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
}

.primary-tile {
  border-color: rgba(40, 215, 245, 0.26);
  background: linear-gradient(90deg, rgba(40, 215, 245, 0.14), var(--surface-raised) 58%);
}

.action-tile > span:nth-child(2),
.export-option > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.action-tile strong,
.export-option strong {
  display: block;
  font-size: 16px;
  font-weight: 650;
}

.action-tile small,
.export-option small {
  display: block;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 13px;
}

.tile-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--cyan);
  color: #051116;
}

.tile-icon .ui-icon {
  width: 25px;
  height: 25px;
}

.history-icon {
  background: #25374a;
  color: var(--text);
}

.chevron {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.info-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 11px 13px;
  border: 1px solid rgba(255, 189, 85, 0.28);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
}

.info-notice p {
  color: #d7c6a7;
  font-size: 12px;
  line-height: 1.38;
}

.info-notice strong {
  color: var(--amber);
}

.info-notice.compact {
  margin-top: 2px;
}

.notice-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.notice-icon .ui-icon {
  width: 13px;
  height: 13px;
}

.active-run-card {
  padding: 15px;
  border: 1px solid rgba(40, 215, 245, 0.3);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(40, 215, 245, 0.12), rgba(17, 27, 40, 0.96) 55%);
}

.active-run-top,
.card-top,
.progress-copy,
.meta-row,
.step-title-row,
.run-meta-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.active-run-eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.active-run-card h2 {
  margin-top: 7px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-run-card p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
}

.resume-button {
  min-width: 102px;
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: var(--cyan);
  color: #031217;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.mini-progress {
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 4px;
  background: #1c2a3a;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.template-card,
.history-card {
  min-height: 104px;
  align-items: flex-start;
}

.template-code,
.file-type {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(40, 215, 245, 0.33);
  border-radius: 12px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.template-card-content,
.history-card-content {
  min-width: 0;
  flex: 1;
}

.template-card h2,
.history-card h2 {
  font-size: 16px;
  font-weight: 680;
  line-height: 1.25;
}

.template-card p,
.history-card p {
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.meta-chip,
.status-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101a27;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 680;
}

.status-label.active {
  border-color: rgba(40, 215, 245, 0.38);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.status-label.completed {
  border-color: rgba(67, 227, 157, 0.38);
  background: var(--green-soft);
  color: var(--green);
}

.status-label.preview {
  border-color: rgba(40, 215, 245, 0.38);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.status-label.archived {
  color: var(--text-muted);
}

.status-label.na {
  border-color: var(--line);
  background: #131c28;
  color: var(--text-secondary);
}

.detail-hero {
  padding: 16px;
  border: 1px solid rgba(40, 215, 245, 0.24);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.detail-hero h2 {
  font-size: 20px;
  line-height: 1.22;
}

.detail-hero p {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.fact {
  padding: 10px;
  border-radius: 9px;
  background: #0a131e;
}

.fact strong,
.fact span {
  display: block;
}

.fact strong {
  color: var(--cyan);
  font-size: 17px;
}

.fact span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.preview-list {
  margin-top: 12px;
}

.preview-list h3,
.info-block h3,
.notes-block h3,
.evidence-block h3 {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.preview-step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.preview-step code {
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.preview-step span {
  color: var(--text-secondary);
  font-size: 13px;
}

.action-rail {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  background: rgba(11, 17, 26, 0.98);
  flex: 0 0 auto;
}

.action-rail.two-up .rail-button {
  flex: 1;
}

.rail-button {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #1b2a3b;
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
  cursor: pointer;
}

.rail-button.primary {
  flex: 1;
  background: var(--cyan);
  color: #031217;
}

.rail-button.danger-soft {
  background: var(--red-soft);
  color: var(--red);
}

.rail-button:disabled,
.focusable:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.form-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.text-input,
.note-input {
  width: 100%;
  min-height: 58px;
  padding: 13px 15px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text);
  outline: none;
}

.note-input {
  min-height: 88px;
  resize: none;
}

.run-config,
.info-block {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.config-row,
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.config-row + .config-row,
.info-row + .info-row {
  border-top: 1px solid var(--line-soft);
}

.config-row strong,
.info-row strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.procedure-header {
  min-height: 72px;
}

.progress-panel {
  padding: 11px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 13, 21, 0.98);
}

.progress-copy {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.progress-copy span:first-child {
  color: var(--text);
  font-weight: 650;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: #1b2a3a;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #20bcd7, var(--cyan));
  transition: width 260ms ease;
}

.checklist-shell {
  padding: 10px 12px;
}

.checklist-row {
  width: 100%;
  min-height: 73px;
  display: grid;
  grid-template-columns: 42px 72px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.checklist-row.upcoming {
  opacity: 0.5;
}

.checklist-row.upcoming:focus {
  opacity: 1;
}

.step-state-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid #46586c;
  border-radius: 50%;
  color: transparent;
  font-size: 15px;
  font-weight: 800;
}

.step-state-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.checklist-row.completed .step-state-icon {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.checklist-row.reopened .step-state-icon {
  border-color: var(--amber);
  color: var(--amber);
}

.checklist-row.not-applicable .step-state-icon {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}

.checklist-row.not-applicable .step-row-copy strong {
  color: var(--text-secondary);
}

.step-code {
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 650;
}

.step-row-copy {
  min-width: 0;
}

.step-row-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-row-copy small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tag-badge {
  padding: 5px 7px;
  border: 1px solid rgba(40, 215, 245, 0.45);
  border-radius: 6px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-tag-badge.nominal {
  border-color: rgba(67, 227, 157, 0.45);
  background: var(--green-soft);
  color: var(--green);
}

.note-tag-badge.anomaly {
  border-color: rgba(255, 106, 120, 0.45);
  background: var(--red-soft);
  color: var(--red);
}

.note-tag-badge.hold {
  border-color: rgba(255, 189, 85, 0.45);
  background: var(--amber-soft);
  color: var(--amber);
}

.note-tag-badge.retest {
  border-color: rgba(182, 156, 255, 0.45);
  background: rgba(182, 156, 255, 0.13);
  color: #c7b2ff;
}

.step-row-flags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.step-hero {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.step-title-row {
  align-items: flex-start;
}

.step-hero h2 {
  font-size: 21px;
  line-height: 1.22;
}

.step-description {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.48;
}

.step-reference-card {
  width: 100%;
  min-height: 94px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--surface-raised);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.step-reference-thumb {
  position: relative;
  width: 104px;
  height: 76px;
}

.step-reference-thumb img {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.step-reference-thumb.stacked::before {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 104px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-focus);
}

.step-reference-copy {
  min-width: 0;
}

.step-reference-title,
.step-reference-desc {
  display: block;
}

.step-reference-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.step-reference-desc {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.step-reference-expand {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
}

.step-image-viewer {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
  overflow: hidden;
}

.step-image-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
}

.step-image-stage img {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  object-fit: contain;
  background: #080e16;
}

.image-counter {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101a27;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

/* Hidden for single-image steps where the counter has no content. */
.image-counter:empty {
  display: none;
}

/* Scoped above `.step-image-viewer figcaption span { display: block }` so the
   dots lay out in a horizontal row instead of stacking vertically. */
.step-image-viewer .image-dots {
  display: flex;
  flex-flow: row wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.step-image-viewer .image-dots:empty {
  display: none;
}

.step-image-viewer .image-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2c4055;
}

.step-image-viewer .image-dot.active {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(40, 215, 245, 0.6);
}

.step-image-viewer figcaption {
  flex: 0 0 auto;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
}

.step-image-viewer figcaption strong,
.step-image-viewer figcaption span {
  display: block;
}

.step-image-viewer figcaption strong {
  font-size: 12px;
  line-height: 1.4;
}

.step-image-viewer figcaption span {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.48;
}

.step-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 9px;
  margin-top: 13px;
}

.completion-control {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
}

.completion-control .completion-check {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #526579;
  border-radius: 9px;
}

.completion-control.completed {
  border-color: rgba(67, 227, 157, 0.38);
  background: var(--green-soft);
}

.completion-control.completed .completion-check {
  border-color: var(--green);
  color: var(--green);
}

.completion-check .ui-icon {
  width: 22px;
  height: 22px;
}

.completion-control strong,
.completion-control small {
  display: block;
}

.completion-control strong {
  font-size: 15px;
}

.completion-control small {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
}

.na-control {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
}

.na-control .na-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.na-control .na-icon .ui-icon {
  width: 22px;
  height: 22px;
}

.na-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.na-control.active {
  border-color: rgba(255, 189, 85, 0.5);
  background: var(--amber-soft);
  color: var(--amber);
}

.na-control.active .na-icon {
  color: var(--amber);
}

.notes-block,
.evidence-block {
  margin-top: 14px;
}

.note-tag-select {
  position: relative;
  margin-bottom: 9px;
}

.note-tag-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note-select-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.select-chevron {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.note-select-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(-90deg);
}

.note-select-menu {
  max-height: 218px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0d1723;
}

.note-select-option {
  min-height: 44px;
  padding: 8px 11px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.note-select-option.selected {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.inline-button {
  min-height: 48px;
  flex: 1;
  padding: 8px 12px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #1b2a3b;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.inline-button.primary {
  background: var(--cyan);
  color: #031217;
}

.camera-button {
  width: 56px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #1b2a3b;
  color: var(--text);
  cursor: pointer;
}

.camera-button .ui-icon {
  width: 26px;
  height: 26px;
}

.evidence-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #38516a;
  border-radius: 10px;
  background: #0b141f;
}

.mock-thumb {
  width: 58px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background:
    linear-gradient(135deg, transparent 48%, rgba(40, 215, 245, 0.22) 49%, rgba(40, 215, 245, 0.22) 52%, transparent 53%),
    #152334;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.mock-thumb .ui-icon {
  width: 25px;
  height: 25px;
}

.evidence-copy {
  min-width: 0;
  flex: 1;
}

.evidence-copy strong,
.evidence-copy small {
  display: block;
}

.evidence-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-copy small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.remove-evidence {
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  cursor: pointer;
}

.remove-evidence .ui-icon {
  width: 22px;
  height: 22px;
  margin: auto;
}

.history-card {
  align-items: center;
}

.history-status {
  width: 12px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--cyan);
}

.history-status.completed { background: var(--green); }
.history-status.archived { background: #526579; }

.empty-state {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-raised);
  color: var(--cyan);
  font-size: 27px;
}

.empty-state h2 {
  font-size: 18px;
}

.empty-state p {
  max-width: 350px;
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.info-block + .info-block {
  margin-top: 10px;
}

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

.summary-cell {
  padding: 12px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.summary-cell strong,
.summary-cell span {
  display: block;
}

.summary-cell strong {
  color: var(--cyan);
  font-size: 20px;
}

.summary-cell span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.timeline {
  padding-left: 15px;
}

.timeline-event {
  position: relative;
  padding: 0 0 17px 25px;
  border-left: 1px solid #2d4157;
}

.timeline-event::before {
  content: "";
  position: absolute;
  top: 3px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--cyan);
}

.timeline-event.complete::before { background: var(--green); }
.timeline-event.reopen::before { background: var(--amber); }
.timeline-event.archive::before { background: var(--text-muted); }

.timeline-event h3 {
  font-size: 13px;
  font-weight: 650;
}

.timeline-event p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.timeline-event time {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.export-content {
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  scrollbar-width: none;
}

.export-content::-webkit-scrollbar {
  display: none;
}

.export-option {
  min-height: 112px;
}

.download-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.file-type.csv {
  border-color: rgba(67, 227, 157, 0.35);
  background: var(--green-soft);
  color: var(--green);
}

.export-list-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.export-list-heading > span {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--line);
}

.export-list-heading h2 {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.export-list-heading small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.generated-export-list {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
}

.generated-export-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 70px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.generated-export-empty .ui-icon {
  width: 22px;
  height: 22px;
}

.generated-export-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
}

.generated-export-main,
.generated-export-delete {
  min-height: 72px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.generated-export-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.generated-export-icon {
  color: var(--cyan);
}

.generated-export-icon .ui-icon {
  width: 26px;
  height: 26px;
}

.generated-export-copy {
  min-width: 0;
}

.generated-export-copy strong,
.generated-export-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-export-copy strong {
  font-size: 13px;
}

.generated-export-copy small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.generated-export-format {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
}

.generated-export-delete {
  display: grid;
  place-items: center;
  color: var(--red);
}

.generated-export-delete .ui-icon {
  width: 24px;
  height: 24px;
}

.export-preview-content {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.export-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: var(--text-secondary);
  font-size: 11px;
}

.export-preview-text {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #07111d;
  color: var(--text);
  font: 11px/1.5 "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(0, 0, 0, 0.78);
}

.modal-panel {
  width: 100%;
  max-width: 500px;
  padding: 22px;
  border: 1px solid #34506a;
  border-radius: 18px;
  background: #101b28;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.modal-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  color: var(--cyan);
  font-weight: 750;
}

.modal-icon .ui-icon {
  width: 22px;
  height: 22px;
}

.modal-backdrop[data-tone="danger"] .modal-panel {
  border-color: rgba(255, 106, 120, 0.55);
}

.modal-backdrop[data-tone="danger"] .modal-icon {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.modal-panel h2 {
  font-size: 20px;
}

.modal-panel p {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.modal-actions button {
  min-height: 56px;
  flex: 1;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #213247;
  font-weight: 650;
  cursor: pointer;
}

.modal-actions button.primary {
  background: var(--cyan);
  color: #031217;
}

.modal-actions button.danger {
  background: var(--red);
  color: #1b0508;
}

.toast {
  position: fixed;
  top: 28px;
  left: 50%;
  z-index: 150;
  max-width: 536px;
  padding: 12px 18px;
  border: 1px solid var(--cyan);
  border-radius: 13px;
  background: #132231;
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -24px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

.focusable {
  outline: none;
  transition:
    transform 180ms cubic-bezier(0.6, 0, 0.4, 1),
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.focusable:focus {
  z-index: 2;
  border-color: var(--cyan);
  box-shadow: var(--focus-shadow);
  transform: scale(0.985);
}

.focusable:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
