:root {
  --ink: #0b0b0a;
  --soft-ink: #49423a;
  --paper: #fff8f1;
  --line: #ead8c8;
  --panel: #ffffff;
  --gold: #ff731c;
  --gold-dark: #c84d08;
  --green: #16784c;
  --rose: #a74531;
  --blue: #2f5f8f;
  --shadow: 0 16px 46px rgba(17, 12, 8, 0.12);
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7eee7;
  color: var(--ink);
}

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 115, 28, 0.22);
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #050505;
}

.splash-screen.hidden {
  display: none;
}

.splash-logo-button {
  width: min(42vw, 340px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255, 115, 28, 0.22), 0 28px 90px rgba(255, 115, 28, 0.24);
}

.splash-logo-button img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.splash-motto {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 74%;
  margin: 0 auto;
  max-width: 620px;
  color: #fff;
  font-family: var(--apple-font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.main-menu-screen {
  position: fixed;
  inset: 0;
  z-index: 29;
  display: grid;
  place-items: center;
  background: #050505;
  color: var(--gold);
}

.splash-screen .dark-footer,
.main-menu-screen .dark-footer {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 24px;
  margin: 0;
  color: rgba(255, 247, 239, 0.72);
}

.main-menu-screen[hidden] {
  display: none;
}

.main-menu-inner {
  width: min(720px, calc(100vw - 42px));
  display: grid;
  justify-items: center;
  gap: 34px;
}

.main-menu-logo {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 16px 52px rgba(255, 115, 28, 0.22);
}

.main-menu-actions {
  display: grid;
  gap: 18px;
  width: 100%;
  justify-items: center;
}

.main-menu-actions button {
  font-family: var(--apple-font);
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.main-menu-actions button:hover {
  transform: scale(1.045);
  color: #ff9656;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  background: #050505;
  color: #fff7ef;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand-wrap {
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.brand:hover .brand-logo,
.brand[aria-expanded="true"] .brand-logo {
  box-shadow: 0 0 0 3px rgba(255, 115, 28, 0.26), 0 10px 22px rgba(255, 115, 28, 0.18);
}

.brand-logo {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 115, 28, 0.14);
}

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

.brand-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 12px);
  z-index: 8;
  padding: 8px;
  border: 1px solid rgba(255, 115, 28, 0.32);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.brand-dropdown button {
  font-family: var(--apple-font);
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff7ef;
  text-align: left;
  padding: 0 10px;
  font-weight: 800;
}

.brand-dropdown button:hover {
  background: #22150f;
  color: #fff;
}

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

.brand span,
.operator span {
  color: #ffc9a8;
  font-size: 13px;
}

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

.nav-item {
  font-family: var(--apple-font);
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: transparent;
  color: #fff8eb;
  text-align: left;
}

.nav-item.active {
  background: #22150f;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.operator {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 22px;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid #f2d0bd;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff 0%, #fff7f0 100%);
  box-shadow: var(--shadow);
}

.topbar[hidden] {
  display: none !important;
}

.title-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.top-logo {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  border: 2px solid var(--gold);
  flex: 0 0 auto;
}

.topbar h1,
.panel-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 30px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold-dark);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.top-actions,
.bottom-actions {
  display: flex;
  gap: 12px;
}

.return-menu-button {
  min-height: 40px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff2e8;
  color: var(--gold-dark);
  padding: 0 14px;
  font-weight: 900;
  margin-bottom: 14px;
}

.return-menu-button:hover {
  background: #ffe4d3;
}

.primary-button,
.ghost-button,
.small-button {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 800;
}

.primary-button {
  background: #0b0b0a;
  color: #fff8eb;
}

.ghost-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.small-button {
  min-height: 38px;
  background: #fff2e8;
  color: var(--gold-dark);
  border-color: #ffc39e;
}

.screen {
  display: none;
}

.active-screen {
  display: block;
}

.software-footer {
  margin: 34px auto 0;
  text-align: center;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 700;
}

.stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 0;
  margin: 0 0 18px;
}

.step {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  min-height: 58px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--soft-ink);
  font-weight: 800;
}

.step span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f4dfcf;
}

.step.active {
  background: #fff;
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(255, 115, 28, 0.14);
}

.step.active span {
  background: var(--gold);
  color: #080808;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 18px;
  align-items: start;
}

.form-panel,
.side-panel > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 22px;
}

.form-step {
  display: none;
}

.active-step {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.status-pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: #eef5f0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.warning {
  background: #fff0e6;
  color: var(--gold-dark);
}

.status-pill.success {
  background: #e8f5ed;
  color: var(--green);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.field-grid.two,
.field-grid.three {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea,
.search {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  border: 1px solid #ded2be;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px 13px;
  min-height: 50px;
}

input[type="date"],
input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  line-height: 1.2;
  padding-right: 10px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.birth-place-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
}

.practice-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff5ed;
  overflow: hidden;
}

.practice-meta-row {
  display: flex;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.practice-meta-row > label {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
}

.practice-meta label,
.field-grid label,
.birth-place-row label {
  min-width: 0;
}

.birth-date-field {
  width: 100%;
  max-width: 100%;
}

.date-input-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 50px;
  border: 1px solid #ded2be;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.date-input-frame input[type="date"] {
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  width: 100%;
  max-width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.document-expiry-field input {
  max-width: 220px;
}

.practice-meta input[readonly] {
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.practice-meta input,
.practice-meta select {
  display: block;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

.practice-meta input[type="date"],
.practice-meta input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  text-align: center;
}

.ceded-items-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff5ed;
}

.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.subsection-heading h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.ceded-items-table {
  display: grid;
  gap: 10px;
}

.ceded-items-head,
.ceded-item-row {
  display: grid;
  grid-template-columns: 38px minmax(260px, 1.9fr) minmax(120px, 0.8fr) minmax(100px, 0.7fr) 40px;
  gap: 10px;
  align-items: end;
}

.ceded-items-head {
  color: var(--soft-ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 0 10px;
}

.ceded-item-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.bullion-quote-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff9f4;
}

.bullion-quote-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.bullion-quote-heading strong {
  color: var(--ink);
}

.bullion-quote-field {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff;
}

.bullion-quote-field span {
  color: var(--ink);
  font-size: 14px;
}

.bullion-quote-field em {
  color: var(--soft-ink);
  font-style: normal;
  line-height: 1.35;
}

.row-number {
  min-height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffe4d3;
  color: var(--gold-dark);
}

.remove-row {
  width: 40px;
  height: 40px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff2e8;
  color: var(--gold-dark);
  font-size: 20px;
  font-weight: 900;
}

.remove-row:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.internal-weight {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: end;
}

.internal-weight strong,
.internal-weight p {
  display: block;
  margin: 0;
}

.internal-weight p {
  margin-top: 5px;
  color: var(--soft-ink);
  line-height: 1.4;
}

.internal-badge {
  display: inline-flex;
  margin-bottom: 7px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffe4d3;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.weight-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.metal-weight-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.inline-check input {
  width: 20px;
  min-height: 20px;
}

.legal-text {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff5ed;
}

.legal-text p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
}

#printPacket {
  display: none;
}

.items-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.item-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.7fr 0.7fr 0.8fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffcf6;
}

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

.signature-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf8;
}

.signature-box strong,
.signature-box span {
  display: block;
}

.signature-box span {
  color: var(--soft-ink);
  font-size: 12px;
  margin-top: 3px;
}

canvas {
  display: block;
  width: 100%;
  height: 142px;
  margin: 12px 0;
  border: 1px dashed #ffad7a;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.clear-signature {
  min-height: 34px;
  border: 0;
  background: #ffe4d3;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--soft-ink);
  font-weight: 800;
}

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

.precious-captures,
.payment-captures {
  margin-top: 18px;
}

.capture-card {
  min-height: 178px;
  border: 1px dashed #ffad7a;
  border-radius: 8px;
  background: #fffdf8;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.capture-card input {
  display: none;
}

.capture-card span,
.summary-grid span {
  color: var(--gold-dark);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
}

.capture-card strong {
  font-size: 18px;
}

.capture-card em {
  color: var(--soft-ink);
  font-style: normal;
}

.capture-card.loaded {
  border-style: solid;
  border-color: #2e9f68;
  background: #edf8f1;
}

.capture-card.gold {
  background: #fff2e8;
}

.capture-card.silver {
  background: #f4f6f7;
}

.capture-card.platinum {
  background: #eef4f8;
}

.capture-card.loaded,
.capture-card.gold.loaded,
.capture-card.silver.loaded,
.capture-card.platinum.loaded {
  border-style: solid;
  border-color: #2e9f68;
  background: #edf8f1;
}

.capture-card.loaded span,
.capture-card.loaded strong,
.capture-card.loaded em {
  color: #16784c;
}

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

.summary-grid > div,
.document-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fffdf8;
}

.summary-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
}

.document-preview {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.preview-action-stack {
  display: grid;
  gap: 8px;
}

.document-preview h3,
.document-preview p,
.checklist h3,
.print-box h3 {
  margin: 0;
}

.document-preview p,
.print-box p,
.muted {
  color: var(--soft-ink);
  line-height: 1.5;
}

.bottom-actions {
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.side-panel {
  display: grid;
  gap: 14px;
}

.side-panel > div {
  padding: 18px;
}

.practice-card span,
.practice-card strong,
.practice-card p {
  display: block;
  margin: 0;
}

.practice-card span {
  color: var(--soft-ink);
  font-size: 13px;
}

.practice-card strong {
  margin-top: 6px;
  font-size: 21px;
}

.practice-card p {
  margin-top: 10px;
  color: var(--green);
  font-weight: 800;
}

.checklist {
  display: grid;
  gap: 13px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.checklist input {
  width: 20px;
  min-height: 20px;
}

.print-box {
  display: grid;
  gap: 12px;
}

.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.search {
  max-width: 430px;
}

.filter-field {
  min-width: 260px;
  max-width: 360px;
}

.archive-groups {
  display: grid;
  gap: 18px;
}

.fusion-groups {
  display: grid;
  gap: 18px;
}

.fusion-store {
  display: grid;
  gap: 12px;
}

.fusion-store-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #ffc39e;
  border-radius: 8px;
  background: #fff5ed;
}

.fusion-store-heading h3,
.fusion-store-heading p {
  margin: 0;
}

.fusion-store-heading h3 {
  color: var(--gold-dark);
  letter-spacing: 0;
}

.fusion-store-heading p {
  margin-top: 4px;
  color: var(--soft-ink);
  font-weight: 800;
}

.fusion-totals {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--soft-ink);
  font-weight: 900;
}

.fusion-totals strong {
  color: var(--ink);
}

.fusion-materials {
  display: grid;
  gap: 14px;
}

.fusion-material {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.fusion-material.gold {
  background: #fff2e8;
  border-color: #ffc39e;
}

.fusion-material.silver {
  background: #f4f6f7;
}

.fusion-material.platinum {
  background: #eef4f8;
}

.fusion-material-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.fusion-material-heading h4,
.fusion-material-heading span {
  margin: 0;
}

.fusion-material-heading h4 {
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0;
}

.fusion-material-heading span {
  color: var(--soft-ink);
  font-weight: 900;
}

.archive-month,
.archive-day {
  display: grid;
  gap: 10px;
}

.archive-month h3,
.archive-day h4 {
  margin: 0;
  letter-spacing: 0;
}

.archive-month h3 {
  color: var(--gold-dark);
  text-transform: capitalize;
}

.archive-day h4 {
  color: var(--soft-ink);
  font-size: 15px;
}

.archive-table,
.settings-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.archive-table {
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr 0.8fr 0.7fr;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.search-table .table-row {
  grid-template-columns: 1.2fr 1fr 0.9fr 0.75fr 0.75fr 1fr 0.9fr;
}

.fusion-table .table-row {
  grid-template-columns: 1.15fr 1fr 0.85fr 0.7fr 0.65fr 0.6fr;
}

.archive-export-table {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.archive-export-row {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr 0.9fr 0.75fr 1fr 0.75fr 0.7fr;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #ddd;
  font-size: 12px;
}

.archive-export-row.head {
  border-top: 0;
  background: #fff2e8;
  font-weight: 800;
}

.table-row.head {
  border-top: 0;
  background: #fff2e8;
  color: var(--soft-ink);
  font-weight: 900;
}

.table-row em {
  justify-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff0e6;
  color: var(--gold-dark);
  font-style: normal;
  font-weight: 800;
}

.table-row em.done {
  background: #e8f5ed;
  color: var(--green);
}

.table-row button,
.settings-list button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  background: #fff;
  font-weight: 800;
}

.row-actions,
.readonly-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button {
  flex: 1 1 90px;
}

.danger-button {
  border-color: #f2b4a8 !important;
  background: #fff1ef !important;
  color: var(--rose) !important;
}

.danger-button:hover {
  background: #ffe1dc !important;
}

.readonly-actions {
  max-width: 780px;
  margin: 0 auto 12px;
  justify-content: flex-end;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 18px;
}

.settings-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.settings-list button {
  text-align: left;
  min-height: 56px;
  padding: 0 16px;
}

.search-results {
  margin-top: 18px;
}

.search-results .archive-table {
  margin-top: 12px;
}

.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--soft-ink);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  min-width: 260px;
  max-width: 420px;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff8eb;
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(23, 19, 13, 0.64);
  padding: 26px;
}

.preview-dialog {
  height: 100%;
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-topbar h2 {
  margin: 0;
  font-size: 20px;
}

.preview-body {
  overflow: auto;
  padding: 18px;
  background: #f3efe7;
}

.preview-body .print-copy {
  max-width: 780px;
  min-height: auto;
  margin: 0 auto;
  background: #fff;
  box-shadow: var(--shadow);
  page-break-after: auto;
  padding: 26px;
}

.preview-body .print-copy h1 {
  margin: 0 0 14px;
  font-size: 24px;
}

.preview-body .print-copy h2 {
  margin: 18px 0 8px;
  font-size: 16px;
}

.preview-body .print-meta,
.preview-body .print-grid,
.preview-body .print-signatures,
.preview-body .print-attachments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-body .print-field,
.preview-body .print-item,
.preview-body .print-internal,
.preview-body .print-signature,
.preview-body .print-attachment {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  min-height: 38px;
}

.preview-body .print-field span,
.preview-body .print-item span,
.preview-body .print-internal span,
.preview-body .print-signature span,
.preview-body .print-attachment span {
  display: block;
  color: var(--soft-ink);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 4px;
}

.preview-body .print-items {
  display: grid;
  gap: 8px;
}

.preview-body .print-item {
  display: grid;
  grid-template-columns: 38px 1fr 110px 90px;
  gap: 8px;
}

.preview-body .print-signature img {
  width: 100%;
  height: 58px;
  object-fit: contain;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.preview-body .print-legal {
  line-height: 1.45;
  text-align: justify;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 92px 1fr;
  }

  .brand div:last-child,
  .nav-item:not(.active),
  .operator {
    display: none;
  }

  .brand {
    justify-content: center;
  }

  .brand-dropdown {
    left: 0;
    width: 248px;
    right: auto;
  }

  .nav-item {
    justify-content: center;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }

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

  .signature-grid,
  .capture-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 12px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-heading,
  .subsection-heading,
  .bullion-quote-heading,
  .archive-header,
  .document-preview,
  .fusion-store-heading,
  .fusion-material-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .stepper,
  .item-row,
  .ceded-item-row,
  .bullion-quote-field,
  .internal-weight,
  .weight-fields,
  .metal-weight-fields,
  .signature-grid,
  .capture-grid,
  .summary-grid,
  .side-panel,
  .settings-grid,
  .table-row,
  .search-table .table-row,
  .fusion-table .table-row {
    grid-template-columns: 1fr;
  }

  .ceded-items-head {
    display: none;
  }

  .brand-wrap {
    width: auto;
    margin: 0 auto;
  }

  .brand-dropdown {
    left: 50%;
    right: auto;
    width: min(320px, calc(100vw - 24px));
    transform: translateX(-50%);
  }

  .brand-logo {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .top-actions,
  .bottom-actions,
  .preview-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .top-actions > *,
  .bottom-actions > *,
  .preview-actions > * {
    flex: 1 1 180px;
  }

  .form-panel {
    padding: 16px;
  }

  .side-panel {
    margin-top: 16px;
  }

  .capture-card {
    min-height: 150px;
  }

  .fusion-totals {
    justify-items: start;
  }

  .archive-table,
  .search-results .archive-table {
    overflow-x: auto;
  }

  .table-row {
    min-width: 0;
  }

  .preview-modal {
    padding: 12px;
  }

  .preview-body .print-copy {
    padding: 18px;
  }

  .preview-body .print-meta,
  .preview-body .print-grid,
  .preview-body .print-signatures,
  .preview-body .print-attachments,
  .preview-body .print-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .splash-logo-button {
    width: min(72vw, 280px);
  }

  .main-menu-inner {
    gap: 26px;
  }

  .main-menu-logo {
    width: 108px;
    height: 108px;
  }

  .main-menu-actions {
    gap: 12px;
  }

  .main-menu-actions button {
    font-size: 20px;
    min-height: 56px;
  }

  .splash-screen .dark-footer,
  .main-menu-screen .dark-footer {
    bottom: 14px;
    font-size: 11px;
    line-height: 1.35;
  }

  .workspace {
    padding: 12px;
  }

  .sidebar {
    padding: 10px 12px;
  }

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

  .brand span {
    font-size: 12px;
  }

  .top-logo {
    width: 48px;
    height: 48px;
  }

  .topbar,
  .form-panel,
  .ceded-items-panel,
  .internal-weight,
  .summary-grid > div,
  .document-preview,
  .side-panel > div,
  .settings-list {
    padding: 12px;
  }

  .step {
    min-height: auto;
    align-items: flex-start;
  }

  .panel-heading h2 {
    font-size: 22px;
  }

  .subsection-heading h3 {
    font-size: 18px;
  }

  .status-pill {
    width: fit-content;
    white-space: normal;
  }

  .software-footer {
    font-size: 11px;
    line-height: 1.35;
    padding: 0 10px;
  }

  .table-row,
  .archive-export-row {
    gap: 8px;
    padding: 12px;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 680px) {
  .practice-meta-row {
    flex-direction: column;
  }

  .practice-meta-row > label {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell,
  .toast {
    display: none !important;
  }

  #printPacket {
    display: block;
    color: #111;
    font-family: Arial, sans-serif;
  }

  .print-copy {
    min-height: 100vh;
    padding: 18mm;
    page-break-after: always;
  }

  .print-copy:last-child {
    page-break-after: auto;
  }

  .print-copy h1 {
    margin: 0 0 12px;
    font-size: 22px;
  }

  .print-copy h2 {
    margin: 18px 0 8px;
    font-size: 15px;
  }

  .print-meta,
  .print-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .print-field,
  .print-item,
  .print-internal,
  .print-signature,
  .print-attachment {
    border: 1px solid #999;
    padding: 7px;
    min-height: 34px;
  }

  .print-field span,
  .print-item span,
  .print-internal span,
  .print-signature span,
  .print-attachment span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 3px;
  }

  .print-items {
    display: grid;
    gap: 6px;
  }

  .print-item {
    display: grid;
    grid-template-columns: 38px 1fr 110px 90px;
    gap: 6px;
  }

  .print-internal {
    margin-top: 12px;
    background: #f2f2f2;
    font-weight: 700;
  }

  .print-internal ul {
    margin: 6px 0 0;
    padding-left: 18px;
  }

  .print-signatures,
  .print-attachments {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .print-signature img {
    width: 100%;
    height: 54px;
    object-fit: contain;
    border-top: 1px solid #bbb;
    margin-top: 6px;
  }

  .print-legal {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
    text-align: justify;
  }
}
