:root {
  --bg: #07141f;
  --surface: rgba(13, 31, 44, 0.82);
  --surface-strong: #0f2331;
  --surface-soft: #132b3b;
  --line: rgba(130, 176, 190, 0.18);
  --line-strong: rgba(109, 216, 208, 0.35);
  --text: #eef7f7;
  --muted: #8fa8b3;
  --teal: #58dfcf;
  --teal-deep: #1e9d9b;
  --blue: #54a9ff;
  --warning: #ffba67;
  --danger: #ff747c;
  --good: #67e6a1;
  --guide-lime: #b9f34a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(25, 104, 119, 0.15), transparent 35%),
    linear-gradient(160deg, #07141f 0%, #091824 48%, #06121b 100%);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  letter-spacing: -0.02em;
}

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

button {
  cursor: pointer;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
}

.ambient-one {
  top: -160px;
  right: 5%;
  background: var(--teal);
}

.ambient-two {
  bottom: -220px;
  left: 18%;
  background: var(--blue);
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(45, 151, 158, 0.2), transparent 38%),
    rgba(4, 13, 21, 0.96);
  backdrop-filter: blur(22px);
}

.access-gate.hidden {
  display: none;
}

.access-card {
  width: min(430px, 100%);
  padding: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(18, 42, 56, 0.95), rgba(8, 23, 34, 0.96));
  box-shadow: var(--shadow);
}

.access-card h1 {
  margin: 14px 0 10px;
  font-size: 31px;
}

.access-card label {
  margin-top: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(93, 235, 217, 0.55);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(78, 228, 210, 0.18), rgba(76, 161, 255, 0.08));
  color: var(--teal);
  font-weight: 800;
  letter-spacing: -0.05em;
  box-shadow: inset 0 0 20px rgba(70, 214, 202, 0.08);
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 20, 31, 0.82);
  backdrop-filter: blur(18px);
}

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

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

.brand strong {
  font-size: 16px;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clock {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.status-pill.good {
  border-color: rgba(103, 230, 161, 0.28);
  color: var(--good);
}

.status-pill.good::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.status-pill.warn {
  border-color: rgba(255, 186, 103, 0.3);
  color: var(--warning);
}

.status-pill.warn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag.core {
  color: var(--teal);
}

.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  padding: 28px 18px;
  border-right: 1px solid var(--line);
  background: rgba(7, 19, 29, 0.55);
  overflow-y: auto;
}

.sidebar-label,
.eyebrow {
  margin: 0 0 9px;
  color: #6f95a3;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#main-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-item span {
  width: 32px;
  color: #4f6d79;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: rgba(80, 215, 202, 0.07);
  color: var(--text);
}

.nav-item.active span {
  color: var(--teal);
}

.flow-card {
  margin-top: 32px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
}

.flow-card ol {
  display: grid;
  gap: 13px;
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.flow-card li {
  position: relative;
  padding-left: 23px;
  color: #7e97a2;
  font-size: 12px;
}

.flow-card li::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -14px;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.flow-card li:last-child::after {
  display: none;
}

.flow-card li span {
  position: absolute;
  top: 3px;
  left: 1px;
  width: 9px;
  height: 9px;
  border: 1px solid #49636e;
  border-radius: 50%;
  background: var(--bg);
}

.flow-card li.done {
  color: #b5d5d8;
}

.flow-card li.done span {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 9px rgba(88, 223, 207, 0.42);
}

.principle-note {
  margin-top: 18px;
  padding: 16px;
  border-left: 2px solid var(--warning);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 186, 103, 0.05);
}

.principle-note span {
  display: block;
  margin-bottom: 7px;
  color: var(--warning);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.principle-note strong {
  font-size: 11px;
  font-weight: 550;
  line-height: 1.65;
}

.content {
  width: min(1480px, 100%);
  padding: 38px 42px 70px;
}

.page {
  display: none;
  animation: pageIn 0.25s ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-heading,
.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.045em;
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.primary,
.secondary,
.text-button {
  border-radius: 11px;
  transition: 0.18s ease;
}

.primary {
  padding: 12px 17px;
  border: 1px solid rgba(106, 231, 218, 0.45);
  background: linear-gradient(135deg, #29a99e, #247b92);
  color: white;
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 10px 28px rgba(26, 140, 140, 0.19);
}

.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.secondary {
  padding: 11px 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.text-button {
  padding: 5px;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 12px;
}

.wide {
  width: 100%;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.heading-actions {
  display: flex;
  gap: 9px;
}

.production-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
}

.inheritance-flow {
  display: grid;
  gap: 5px;
  margin: 20px 0;
}

.inheritance-flow > div:not(.arch-arrow) {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 16, 24, 0.34);
}

.inheritance-flow strong {
  color: var(--teal);
  font-size: 11px;
}

.inheritance-flow span {
  color: var(--muted);
  font-size: 11px;
}

.production-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 18px;
}

.production-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 16, 24, 0.34);
}

.production-card strong,
.production-card p,
.production-card span {
  display: block;
}

.production-card strong {
  margin-top: 7px;
  font-size: 14px;
}

.production-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.production-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: #9bb5bc;
  font-size: 10px;
  white-space: nowrap;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(16, 38, 52, 0.8), rgba(9, 25, 36, 0.8));
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.11);
  backdrop-filter: blur(10px);
}

.metric-card {
  padding: 22px;
  border-radius: 17px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card span {
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin: 13px 0 7px;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  font-size: 10px;
}

.warn-text {
  color: var(--warning);
}

.good-text {
  color: var(--good);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 23px;
  border-radius: 18px;
}

.panel h2 {
  margin: 0;
  font-size: 19px;
}

.process-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 20px;
}

.process-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3, 15, 23, 0.28);
}

.process-card .process-code {
  display: block;
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.process-card strong {
  display: block;
  font-size: 15px;
}

.process-card p {
  min-height: 37px;
  margin: 7px 0 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.process-card small {
  color: #607e89;
  font-size: 9px;
}

.architecture {
  display: grid;
  margin-top: 19px;
}

.arch-node {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(4, 16, 24, 0.42);
}

.arch-node span,
.arch-node strong {
  display: block;
}

.arch-node span {
  color: var(--muted);
  font-size: 10px;
}

.arch-node strong {
  margin-top: 5px;
  font-size: 13px;
}

.core-node {
  border-color: rgba(84, 169, 255, 0.28);
}

.domain-node {
  border-color: rgba(88, 223, 207, 0.35);
}

.human-node {
  border-color: rgba(255, 186, 103, 0.32);
}

.arch-arrow {
  padding: 7px 12px;
  color: #587783;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.recent-panel {
  min-height: 190px;
}

.record-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.record-row {
  display: grid;
  grid-template-columns: 92px minmax(140px, 1.3fr) minmax(150px, 1fr) 100px 130px;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 15, 23, 0.25);
  font-size: 12px;
}

.record-row strong {
  font-size: 12px;
}

.record-row small {
  color: var(--muted);
}

.empty-state,
.result-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: #64808b;
  font-size: 12px;
  text-align: center;
}

.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.form-panel label,
.access-card label,
.dialog-card label {
  display: grid;
  gap: 8px;
  color: #b9cdd2;
  font-size: 11px;
  font-weight: 650;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.access-card input,
.dialog-card input,
.dialog-card select,
.dialog-card textarea,
.table-filter select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: rgba(4, 16, 24, 0.58);
  color: var(--text);
}

.form-panel textarea,
.dialog-card textarea {
  min-height: 100px;
  resize: vertical;
}

.form-panel input:focus,
.form-panel select:focus,
.form-panel textarea:focus,
.access-card input:focus,
.dialog-card input:focus,
.dialog-card textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(88, 223, 207, 0.08);
}

.form-panel label small {
  color: #5f7b86;
  font-weight: 400;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

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

.process-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 20px;
}

.record-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.guide-button,
.guide-stop {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(88, 223, 207, 0.38);
  border-radius: 10px;
  background: rgba(88, 223, 207, 0.09);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.guide-button:hover,
.guide-stop:hover {
  background: rgba(88, 223, 207, 0.16);
}

.field-guide-panel {
  position: relative;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(88, 223, 207, 0.36);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(88, 223, 207, 0.1), transparent 58%),
    rgba(4, 18, 27, 0.82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.field-guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-guide-heading div,
.field-guide-heading span,
.field-guide-heading strong {
  display: block;
}

.field-guide-heading div > span {
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.field-guide-heading strong {
  margin-top: 5px;
  font-size: 14px;
}

.guide-progress {
  min-width: 52px;
  padding: 6px 9px;
  border: 1px solid rgba(88, 223, 207, 0.28);
  border-radius: 999px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.field-guide-panel > p {
  margin: 13px 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.65;
}

.field-guide-safety {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-guide-safety span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 9px;
}

.guide-stop {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
}

.guide-focus {
  position: relative;
  z-index: 2;
  border-color: #ff5b5b !important;
  box-shadow:
    0 0 0 3px rgba(255, 91, 91, 0.16),
    0 0 30px rgba(255, 91, 91, 0.22) !important;
  animation: guidePulse 1.25s ease-in-out infinite;
}

.guide-focus::after,
.guide-complete::after {
  content: attr(data-guide-marker);
  position: absolute;
  z-index: 5;
  top: -12px;
  right: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #07131c;
  background: var(--guide-lime);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.guide-focus::after {
  color: #ffffff;
  background: #d93f48;
}

.guide-complete {
  position: relative;
  border-color: rgba(103, 230, 161, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(103, 230, 161, 0.1) !important;
}

.guide-complete::after {
  color: #dfffee;
  background: #14704e;
}

@keyframes guidePulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(255, 91, 91, 0.12),
      0 0 20px rgba(255, 91, 91, 0.14);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 91, 91, 0.24),
      0 0 34px rgba(255, 91, 91, 0.3);
  }
}

.dashboard-navigation-proposal {
  margin: 0 16px 16px;
}

.process-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 16, 24, 0.38);
  color: var(--muted);
}

.process-choice span {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.process-choice strong {
  font-size: 12px;
}

.process-choice.active {
  border-color: var(--line-strong);
  background: rgba(72, 210, 199, 0.08);
  color: var(--text);
}

.process-choice.active span {
  background: rgba(88, 223, 207, 0.13);
  color: var(--teal);
}

.dynamic-fields {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.field-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 11px;
}

.field-step h3,
.field-step p {
  margin: 0;
}

.field-step h3 {
  font-size: 13px;
}

.field-step p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(88, 223, 207, 0.08);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.touch-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-height: 0;
}

.touch-choice-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.touch-choice {
  display: grid;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 16, 24, 0.38);
  color: var(--muted);
  text-align: left;
}

.touch-choice span,
.touch-choice small {
  font-size: 9px;
}

.touch-choice strong {
  margin: 5px 0;
  color: var(--text);
  font-size: 12px;
}

.touch-choice.active {
  border-color: var(--teal);
  background: rgba(88, 223, 207, 0.1);
  box-shadow: 0 0 0 2px rgba(88, 223, 207, 0.07);
}

.touch-segments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.touch-segment {
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 16, 24, 0.38);
  color: var(--muted);
  font-weight: 700;
}

.touch-segment.active {
  border-color: var(--teal);
  background: rgba(88, 223, 207, 0.11);
  color: var(--text);
}

.numeric-entry {
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(220px, 0.45fr);
  gap: 14px;
  align-items: stretch;
}

.form-panel .numeric-display {
  min-height: 100%;
  border-color: var(--line-strong);
  background: rgba(3, 14, 22, 0.68);
  color: var(--teal);
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.numeric-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(52px, 1fr));
  gap: 7px;
}

.numeric-pad button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 37, 50, 0.75);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.numeric-pad button:active {
  border-color: var(--teal);
  background: rgba(88, 223, 207, 0.15);
}

.numeric-control {
  display: grid;
  gap: 8px;
}

.numeric-pad .numeric-confirm-key {
  grid-column: 1 / -1;
  min-height: 52px;
  border-color: rgba(88, 223, 207, 0.72);
  background: linear-gradient(135deg, rgba(32, 184, 168, 0.92), rgba(27, 133, 166, 0.92));
  color: #ffffff;
  font-size: 15px;
}

.numeric-confirm-status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.numeric-entry.numeric-confirmed .numeric-display {
  border-color: rgba(103, 230, 161, 0.78);
  color: var(--guide-lime);
  box-shadow: 0 0 0 2px rgba(103, 230, 161, 0.1);
}

.numeric-entry.numeric-confirmed .numeric-confirm-status {
  color: var(--guide-lime);
  font-weight: 800;
}

.record-reset-placeholder {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(4, 16, 24, 0.3);
  color: var(--muted);
  text-align: center;
}

.record-reset-placeholder strong {
  color: var(--text);
  font-size: 14px;
}

.record-reset-placeholder span {
  font-size: 11px;
}

.metal-check-board {
  display: grid;
  gap: 12px;
}

.metal-check-section {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 20, 30, 0.34);
}

.metal-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.metal-section-heading div,
.metal-section-heading span,
.metal-section-heading strong,
.metal-section-heading small {
  display: block;
}

.metal-section-heading span,
.metal-section-heading small {
  color: var(--muted);
  font-size: 9px;
}

.metal-section-heading strong {
  margin-top: 3px;
  font-size: 13px;
}

.metal-matrix {
  display: grid;
  gap: 9px;
}

[hidden] {
  display: none !important;
}

[data-metal-scope="product"]:not(.product-pass-card) {
  display: grid;
  gap: 9px;
}

.matrix-group {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) repeat(3, minmax(72px, 0.7fr));
  gap: 7px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 16, 24, 0.28);
}

.matrix-axis {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) repeat(3, minmax(72px, 0.7fr));
  gap: 7px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.matrix-axis span:first-child {
  padding-left: 8px;
  text-align: left;
}

.matrix-group > strong {
  padding-left: 8px;
  font-size: 11px;
}

.matrix-group .toggle {
  justify-content: space-between;
  margin: 0;
}

.product-pass-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.product-pass-card strong,
.product-pass-card span,
.product-pass-card small {
  display: block;
}

.product-pass-card span,
.product-pass-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.quantity-touch-grid,
.read-only-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.quantity-entry-card {
  padding: 14px;
  border: 1px solid rgba(88, 223, 207, 0.25);
  border-radius: 14px;
  background: rgba(6, 24, 34, 0.48);
}

.quantity-entry-card.detected {
  border-color: rgba(255, 186, 103, 0.28);
}

.quantity-entry-card > div:first-child span,
.quantity-entry-card > div:first-child strong,
.quantity-entry-card > div:first-child small {
  display: block;
}

.quantity-entry-card > div:first-child span,
.quantity-entry-card > div:first-child small {
  color: var(--muted);
  font-size: 9px;
}

.quantity-entry-card > div:first-child strong {
  margin: 4px 0;
  font-size: 14px;
}

.quantity-entry-card .numeric-entry {
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.quantity-entry-card .numeric-display {
  min-height: 76px;
}

.demo-reset-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  border-color: rgba(255, 116, 124, 0.22);
}

.demo-reset-panel .muted {
  max-width: 780px;
  margin-top: 8px;
}

.danger-button {
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 116, 124, 0.46);
  border-radius: 11px;
  background: rgba(255, 116, 124, 0.11);
  color: #ff9ca2;
  font-weight: 750;
}

.danger-button:hover {
  background: rgba(255, 116, 124, 0.18);
}

.danger-notice {
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(255, 116, 124, 0.24);
  border-radius: 11px;
  background: rgba(255, 116, 124, 0.07);
}

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

.danger-notice span {
  color: var(--muted);
  font-size: 10px;
}

.field-guidance {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--teal);
  color: var(--muted);
  background: rgba(88, 223, 207, 0.05);
  font-size: 10px;
  line-height: 1.6;
}

.read-only-facts > div {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 10px;
}

.read-only-facts strong {
  color: var(--text);
  font-size: 13px;
}

.human-checks {
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.dynamic-fields h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0 18px;
}

.toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 16, 24, 0.32);
}

.toggle input {
  appearance: none;
  width: 36px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: #263b46;
  transition: 0.18s ease;
}

.toggle input::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px;
  border-radius: 50%;
  background: #78909a;
  transition: 0.18s ease;
}

.toggle input:checked {
  background: rgba(48, 187, 175, 0.5);
}

.toggle input:checked::after {
  transform: translateX(16px);
  background: var(--teal);
}

.limit-box,
.notice-box {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid rgba(84, 169, 255, 0.2);
  border-radius: 12px;
  background: rgba(84, 169, 255, 0.045);
}

.limit-box div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.limit-box span {
  color: var(--muted);
  font-size: 10px;
}

.limit-box strong {
  color: #9bd0ff;
  font-size: 12px;
}

.limit-box p,
.notice-box {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.limit-box p {
  margin: 8px 0 0;
}

.result-panel {
  min-height: 420px;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--teal);
  font-size: 28px;
}

.result-empty strong {
  color: var(--text);
}

.result-empty p {
  max-width: 240px;
  margin: 8px auto 0;
  line-height: 1.6;
}

.result-content {
  margin-top: 20px;
}

.result-banner {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 16, 24, 0.38);
}

.result-banner.pass {
  border-color: rgba(103, 230, 161, 0.32);
}

.result-banner.deviation {
  border-color: rgba(255, 116, 124, 0.38);
  background: rgba(255, 116, 124, 0.05);
}

.result-banner span,
.result-banner strong {
  display: block;
}

.result-banner span {
  color: var(--muted);
  font-size: 10px;
}

.result-banner strong {
  margin-top: 6px;
  font-size: 18px;
}

.trace-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.trace-item {
  padding: 11px 12px;
  border-left: 2px solid var(--teal);
  border-radius: 0 9px 9px 0;
  background: rgba(88, 223, 207, 0.035);
}

.trace-item span,
.trace-item strong {
  display: block;
}

.trace-item span {
  color: var(--muted);
  font-size: 9px;
}

.trace-item strong {
  margin-top: 4px;
  font-size: 11px;
}

.records-table-panel {
  padding-bottom: 12px;
}

.table-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.table-filter select,
.table-filter input {
  min-height: 34px;
  font-size: 11px;
}

.table-filter input {
  width: 128px;
}

.table-filter span {
  color: var(--muted);
  font-size: 10px;
}

.record-select-column {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.record-select-column input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
  cursor: pointer;
}

.record-select-column input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #718f9b;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  color: #c4d5d8;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.badge.pass,
.badge.approved {
  border-color: rgba(103, 230, 161, 0.25);
  color: var(--good);
}

.badge.deviation,
.badge.rejected {
  border-color: rgba(255, 116, 124, 0.3);
  color: var(--danger);
}

.badge.pending,
.badge.temporary {
  border-color: rgba(255, 186, 103, 0.28);
  color: var(--warning);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.row-action {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #a9bec4;
  font-size: 9px;
}

.row-action:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.row-action.danger {
  border-color: rgba(255, 116, 124, 0.24);
  color: #ff9fa5;
}

.time-label {
  display: block;
  margin-bottom: 4px;
  color: #718f9b;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.verification-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 24px;
  color: #b6cbd0;
  font-size: 12px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
}

.verification-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.verification-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(320px, 1.6fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 16, 24, 0.32);
}

.verification-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.verification-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

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

.process-summary div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: center;
}

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

.process-summary span {
  color: var(--muted);
  font-size: 8px;
}

.process-summary strong {
  margin-top: 4px;
  font-size: 12px;
}

.verification-actions {
  display: flex;
  gap: 6px;
}

.audit-explain {
  display: grid;
  grid-template-columns: 150px minmax(240px, 1fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
}

.audit-number {
  display: block;
  color: var(--teal);
  font-size: 38px;
  font-weight: 750;
}

.audit-explain p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.hash-label {
  display: block;
  margin-bottom: 7px;
  color: #64818c;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.audit-explain code {
  display: block;
  max-width: 460px;
  overflow: hidden;
  color: #9bc4cd;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-event {
  display: grid;
  grid-template-columns: 46px minmax(160px, 0.8fr) minmax(160px, 1fr) minmax(240px, 1.4fr);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(10, 27, 39, 0.64);
}

.timeline-event .sequence {
  color: var(--teal);
  font-size: 11px;
  font-weight: 750;
}

.timeline-event strong {
  display: block;
  font-size: 11px;
}

.timeline-event small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-event code {
  overflow: hidden;
  color: #668995;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(2, 10, 16, 0.72);
  backdrop-filter: blur(9px);
}

.dialog-card {
  position: relative;
  padding: 28px;
}

.dialog-card h2 {
  margin: 0 0 8px;
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

#dialog-fields {
  display: grid;
  gap: 13px;
  margin: 22px 0;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-error {
  min-height: 17px;
  margin: 9px 0 0;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: 380px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #12313b;
  color: var(--text);
  font-size: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.luna-command-bar {
  position: relative;
  z-index: 5;
  margin: -10px 0 24px;
  padding: 14px 16px;
  border: 1px solid rgba(88, 223, 207, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 0%, rgba(84, 169, 255, 0.1), transparent 42%),
    rgba(8, 28, 39, 0.96);
  box-shadow: var(--shadow);
}

.luna-command-heading,
.luna-command-actions,
.luna-navigation-proposal,
.luna-navigation-proposal > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.luna-command-heading span,
.luna-navigation-proposal span {
  display: block;
  color: var(--teal);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.luna-command-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.luna-context-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.luna-context-chips span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b9ccd2;
  background: rgba(17, 47, 60, 0.58);
  font-size: 8px;
  letter-spacing: 0;
}

.luna-command-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.luna-command-form input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(4, 17, 26, 0.84);
}

.luna-command-form .primary {
  min-width: 76px;
}

.luna-command-response {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--teal);
  border-radius: 0 10px 10px 0;
  color: #c8d8dc;
  background: rgba(88, 223, 207, 0.05);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.luna-navigation-proposal {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 186, 103, 0.28);
  border-radius: 12px;
  background: rgba(255, 186, 103, 0.055);
}

.luna-navigation-proposal strong {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}

.luna-navigation-proposal button {
  padding: 8px 11px;
  font-size: 9px;
}

.conversation-panel {
  margin-bottom: 18px;
  border-color: rgba(88, 223, 207, 0.3);
  background:
    radial-gradient(circle at 85% 0%, rgba(84, 169, 255, 0.09), transparent 38%),
    linear-gradient(145deg, rgba(14, 42, 54, 0.94), rgba(8, 25, 36, 0.9));
}

.conversation-heading .muted {
  margin: 8px 0 0;
}

.conversation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  margin-top: 20px;
}

.conversation-side {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.chat-workspace,
.conversation-preview {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 18, 28, 0.62);
}

.aikeeper-trace {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(88, 223, 207, 0.22);
  border-radius: 16px;
  background: rgba(4, 16, 24, 0.72);
}

.trace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trace-heading span,
.trace-principles span {
  display: block;
  color: var(--teal);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.trace-heading strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.trace-live {
  padding: 4px 7px;
  border: 1px solid rgba(88, 223, 207, 0.22);
  border-radius: 999px;
  color: var(--good) !important;
  background: rgba(88, 223, 207, 0.06);
}

.trace-empty,
.trace-privacy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.trace-steps {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.trace-steps li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 37, 50, 0.42);
}

.trace-steps li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #04141d;
  background: var(--teal);
  font-size: 9px;
  font-weight: 900;
}

.trace-steps strong {
  font-size: 10px;
}

.trace-steps p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.trace-principles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.trace-principles strong {
  color: #b8cbd0;
  font-size: 9px;
  text-align: right;
}

.conversation-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 190px;
  max-height: 330px;
  padding: 18px;
  overflow-y: auto;
}

.chat-message {
  width: min(88%, 620px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  background: rgba(20, 46, 60, 0.72);
}

.chat-message.user {
  justify-self: end;
  border-color: rgba(84, 169, 255, 0.25);
  border-radius: 14px 14px 4px 14px;
  background: rgba(35, 83, 112, 0.42);
}

.chat-message span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chat-message p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.conversation-form {
  padding: 15px;
  border-top: 1px solid var(--line);
}

.conversation-form > label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.conversation-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 9px;
}

.conversation-input-row textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
}

.conversation-input-row .primary {
  min-width: 84px;
}

.settings-intro {
  margin-bottom: 18px;
  border-left: 3px solid var(--guide-lime);
}

.settings-intro p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.signer-settings {
  display: grid;
  gap: 18px;
}

.signer-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.signer-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(4, 17, 26, 0.52);
}

.signer-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.signer-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.signature-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 120px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: #f8fbfa;
}

.signature-preview img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: contain;
}

.signer-card small {
  color: var(--muted);
  line-height: 1.5;
}

.signature-dialog-card {
  width: min(860px, calc(100vw - 30px));
}

.signature-canvas-wrap {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
}

#signature-canvas {
  display: block;
  width: 100%;
  height: min(260px, 36vh);
  touch-action: none;
  cursor: crosshair;
}

#signature-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #8d9ba0;
  font-size: 18px;
}

.approval-signature-preview {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(88, 223, 207, 0.04);
  font-size: 11px;
  line-height: 1.6;
}

.conversation-preview {
  min-height: 330px;
  padding: 18px;
}

.preview-empty {
  display: grid;
  place-content: center;
  min-height: 250px;
  text-align: center;
}

.preview-empty strong {
  font-size: 16px;
}

.preview-empty p {
  max-width: 410px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.preview-title,
.preview-job,
.preview-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-title span,
.preview-job span,
.preview-record span,
.preview-record small {
  color: var(--muted);
  font-size: 10px;
}

.preview-title strong,
.preview-job strong,
.preview-record strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.preview-job {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(88, 223, 207, 0.06);
}

.preview-record-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.preview-record {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr auto;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(16, 40, 53, 0.55);
}

.preview-record.complete {
  border-color: rgba(103, 230, 161, 0.24);
}

.preview-record.incomplete {
  border-color: rgba(255, 186, 103, 0.24);
}

.missing-strip {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 11px 12px;
  border-left: 3px solid var(--warning);
  background: rgba(255, 186, 103, 0.06);
}

.missing-strip strong {
  color: var(--warning);
  font-size: 10px;
}

.missing-strip span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.missing-strip.warning {
  border-left-color: var(--danger);
}

.conversation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.conversation-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.conversation-actions p strong {
  color: var(--text);
}

.conversation-actions > div {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-column,
  .record-layout,
  .conversation-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: 280px;
  }

  .verification-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
  }

  .status-pill {
    display: none;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 72px;
    z-index: 15;
    width: 100%;
    height: auto;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    background: rgba(7, 20, 31, 0.94);
    backdrop-filter: blur(14px);
  }

  .sidebar > .sidebar-label,
  .flow-card,
  .principle-note {
    display: none;
  }

  #main-nav {
    display: flex;
    min-width: 520px;
  }

  .nav-item {
    justify-content: center;
    padding: 9px 12px;
    white-space: nowrap;
  }

  .content {
    padding: 28px 15px 70px;
  }

  .luna-command-bar {
    margin-top: -8px;
    padding: 13px;
  }

  .luna-command-heading,
  .luna-command-actions,
  .luna-navigation-proposal {
    align-items: stretch;
    flex-direction: column;
  }

  .luna-command-actions {
    gap: 8px;
  }

  .luna-context-chips {
    justify-content: flex-start;
  }

  .luna-command-form {
    grid-template-columns: 1fr;
  }

  .luna-command-form .primary {
    width: 100%;
  }

  .luna-navigation-proposal > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .page-heading {
    align-items: flex-end;
  }

  .page-heading .primary {
    padding: 10px 12px;
    white-space: nowrap;
  }

  .metric-grid,
  .process-cards,
  .process-selector,
  .form-grid,
  .toggle-grid,
  .production-list,
  .touch-choice-grid,
  .touch-choice-grid.compact,
  .numeric-entry,
  .quantity-touch-grid,
  .read-only-facts {
    grid-template-columns: 1fr;
  }

  .matrix-group {
    grid-template-columns: 1fr repeat(3, minmax(0, 1fr));
  }

  .matrix-axis {
    grid-template-columns: 1fr repeat(3, minmax(0, 1fr));
  }

  .matrix-group > strong {
    grid-column: 1 / -1;
    padding: 4px;
  }

  .matrix-axis span:first-child {
    grid-column: 1 / -1;
    padding: 4px;
    text-align: left;
  }

  .metal-section-heading,
  .demo-reset-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .record-title-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .field-guide-panel {
    padding-bottom: 58px;
  }

  .field-guide-safety {
    display: grid;
    grid-template-columns: 1fr;
  }

  .guide-stop {
    left: 14px;
    width: calc(100% - 28px);
  }

  .demo-reset-panel .danger-button {
    width: 100%;
  }

  .heading-actions {
    flex-direction: column;
  }

  .conversation-input-row,
  .preview-record {
    grid-template-columns: 1fr;
  }

  .conversation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .conversation-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    padding: 17px;
  }

  .metric-card strong {
    font-size: 27px;
  }

  .process-choice {
    min-height: 51px;
  }

  .record-row {
    grid-template-columns: 70px 1fr 90px;
  }

  .record-row > :nth-child(3),
  .record-row > :nth-child(4) {
    display: none;
  }

  .audit-explain,
  .timeline-event {
    grid-template-columns: 1fr;
  }

  .access-card {
    padding: 30px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-focus {
    animation: none;
  }
}

@media (max-width: 980px) {
  .signer-card-grid {
    grid-template-columns: 1fr;
  }
}
