.ams-exp-root,
.ams-exp-modal,
.ams-exp-viewer,
.ams-exp-toast {
  --navy: #161C34;
  --crimson: #AE2129;
  --muted: #4b5163;
  --border: #d9dde6;
  --soft: #f4f6fb;
}
.ams-exp-root {
  color: var(--navy);
  font-family: Inter, Manrope, "IBM Plex Sans", Tahoma, system-ui, sans-serif;
  padding: 16px 24px 24px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.ams-exp-root *,
.ams-exp-root *::before,
.ams-exp-root *::after { box-sizing: border-box; }
.ams-exp-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--crimson);
  border-radius: 16px;
  background: #fff;
}
.ams-exp-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crimson);
}
.ams-exp-hero h1 { margin: 0; font-size: 1.35rem; }
.ams-exp-sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 42rem; }
.ams-exp-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ams-exp-import-steps {
  margin: 0 0 14px;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.ams-exp-import-steps li { margin: 0 0 6px; }
.ams-exp-import-result {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--soft);
  font-size: 13px;
  color: var(--navy);
}
.ams-exp-import-result ul { margin: 8px 0 0; padding-left: 1.1rem; color: var(--crimson); }
.ams-exp-field input[type="file"] {
  font: 500 13px/1.4 Inter, system-ui, sans-serif;
  padding: 10px;
  border: 1px dashed var(--border);
  background: var(--soft);
}
.ams-exp-import-steps code {
  font-size: 12px;
  background: var(--soft);
  padding: 1px 5px;
  border: 1px solid var(--border);
}
.ams-exp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ams-exp-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.ams-exp-card p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.ams-exp-card strong { display: block; margin-top: 8px; font-size: 1.2rem; }
.ams-exp-shell {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(22, 28, 52, 0.05);
}
.ams-exp-shell-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
.ams-exp-shell-body { padding: 16px 20px 20px; }
.ams-exp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  text-decoration: none; font-weight: 600; cursor: pointer; font-size: 13px;
}
.ams-exp-btn.primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.ams-exp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.ams-exp-table th, .ams-exp-table td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.ams-exp-table th { background: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.ams-exp-table tbody tr { cursor: pointer; }
.ams-exp-table tbody tr:hover { background: var(--soft); }
.ams-exp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ams-exp-empty { margin: 0; color: var(--muted); padding: 12px 0; }
.ams-exp-modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(22, 28, 52, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow: auto;
}
.ams-exp-modal[hidden] { display: none !important; }
.ams-exp-modal-card {
  width: min(760px, 100%); background: #fff; border-radius: 16px; padding: 22px;
  box-shadow: 0 20px 50px rgba(22, 28, 52, .25); margin: 0 auto;
  color: var(--navy);
}
.ams-exp-modal-card.wide {
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.ams-exp-split {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 14px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.ams-exp-split-facts {
  min-width: 0;
  align-self: stretch;
}
.ams-exp-split-facts .ams-exp-grid {
  margin-top: 0;
  grid-template-columns: 1fr;
}
.ams-exp-split-doc {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
  overflow: hidden;
}
.ams-exp-preview-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.ams-exp-preview-bar strong { font-size: 13px; }
.ams-exp-preview {
  flex: 1 1 auto;
  min-height: 360px;
  background: #eceef4;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
.ams-exp-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: top left;
  margin: 0;
  background: #fff;
}
.ams-exp-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border: 0;
  background: #fff;
}
.ams-exp-docs-count {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.ams-exp-modal-card h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--navy); }
.ams-exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.ams-exp-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--navy); }
.ams-exp-field input, .ams-exp-field select, .ams-exp-field textarea {
  width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font: inherit; color: var(--navy); background: #fff; font-weight: 500;
}
.ams-exp-field textarea { min-height: 88px; }
.ams-exp-wide { grid-column: 1 / -1; }
.ams-exp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ams-exp-help { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.ams-exp-error { color: var(--crimson); font-weight: 600; }
.ams-exp-docs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; }
.ams-exp-doc {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--navy); cursor: pointer; text-align: left; font: inherit;
}
.ams-exp-doc span { color: var(--muted); font-size: 11px; font-weight: 600; }
.ams-exp-doc.active { border-color: var(--crimson); box-shadow: 0 0 0 1px var(--crimson); }
.ams-exp-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ams-exp-viewer {
  position: fixed; inset: 0; z-index: 120; background: #161C34;
  display: flex; flex-direction: column;
}
.ams-exp-viewer-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 10px; padding: 12px 16px; color: #fff; background: #161C34;
}
.ams-exp-viewer-bar span { display: block; margin-top: 4px; font-size: 12px; opacity: .8; }
.ams-exp-viewer-bar .ams-exp-btn { background: #fff; }
.ams-exp-viewer-bar .ams-exp-btn.primary { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.ams-exp-viewer-body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 16px; background: #1d243d; }
.ams-exp-viewer-body .ams-exp-help,
.ams-exp-viewer-body .ams-exp-empty { color: #dce1ee; }
.ams-exp-viewer-body img { max-width: 96vw; max-height: 84vh; border-radius: 8px; background: #fff; }
.ams-exp-viewer-body iframe { width: 96vw; height: 84vh; border: 0; border-radius: 8px; background: #fff; }
.ams-exp-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 90; background: #161C34; color: #fff;
  padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.ams-exp-toast.err { background: var(--crimson); }
.ams-exp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.ams-exp-filter {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ams-exp-filter span {
  display: inline-block;
  min-width: 1.5rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.ams-exp-filter.active {
  border-color: var(--crimson);
  background: #fff5f5;
  color: var(--crimson);
}
.ams-exp-filter.active span {
  background: #AE2129;
  color: #fff;
}
.ams-exp-badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; background: var(--soft); color: var(--navy); }
.ams-exp-status-unpaid { background: #f1f5f9; color: #334155; }
.ams-exp-status-outstanding { background: #fff7ed; color: #9a3412; }
.ams-exp-status-partially_paid { background: #eff6ff; color: #1d4ed8; }
.ams-exp-status-paid { background: #ecfdf5; color: #047857; }
.ams-exp-section-title { margin: 18px 0 8px; font-size: 14px; font-weight: 700; }
.ams-exp-status-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 12px 0; }
.ams-exp-status-tools .ams-exp-field { margin: 0; flex: 1 1 160px; }
.ams-exp-pay-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.ams-exp-pay-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font-size: 13px;
}
.ams-exp-pay-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ams-exp-pay-note { margin-top: 6px; padding: 8px 10px; background: var(--soft); border-radius: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.ams-exp-pay-note.muted { font-style: italic; }
#ams-exp-slot { display: none; width: 100%; }
body.ams-exp-page #app .flex.min-w-0.flex-1.flex-col {
  align-items: stretch !important;
}
body.ams-exp-page #ams-exp-slot {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 0% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  overflow: auto;
  position: relative;
  z-index: 1;
  align-self: stretch;
  box-sizing: border-box;
  background: #F5F5F3;
}
body.ams-exp-page #app .flex.min-w-0.flex-1.flex-col > .flex-1.p-4:not(#ams-exp-slot):not(#ams-acc-slot):not(#ams-frt-slot):not(#ams-wa-slot),
body.ams-exp-page #app .flex.min-w-0.flex-1.flex-col > .flex-1.p-6:not(#ams-exp-slot):not(#ams-acc-slot):not(#ams-frt-slot):not(#ams-wa-slot),
body.ams-exp-page #app .flex.min-w-0.flex-1.flex-col > .flex-1.p-8:not(#ams-exp-slot):not(#ams-acc-slot):not(#ams-frt-slot):not(#ams-wa-slot),
body.ams-exp-page [data-ams-exp-hidden-page="1"] {
  display: none !important;
}
body.ams-exp-page #ams-exp-slot .ams-exp-root,
body.ams-exp-page #ams-exp-slot .ams-workspace.ams-exp-root {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  flex: 1 1 auto;
  width: 100% !important;
  max-width: none !important;
  min-height: 0;
  height: auto;
  overflow: auto;
  z-index: 1 !important;
  padding: 16px 24px 24px;
  margin: 0 !important;
  background: #F5F5F3;
  box-sizing: border-box;
}
body.ams-exp-page.ams-exp-fixed-fallback #ams-exp-slot,
#ams-exp-slot.ams-exp-slot-fallback {
  position: fixed !important;
  top: 4rem !important;
  left: 18rem !important;
  right: 0 !important;
  bottom: 0 !important;
  inset: 4rem 0 0 18rem !important;
  z-index: 20 !important;
  width: auto !important;
  flex: none !important;
  display: flex !important;
}
@media (max-width: 1023px) {
  body.ams-exp-page.ams-exp-fixed-fallback #ams-exp-slot,
  #ams-exp-slot.ams-exp-slot-fallback {
    left: 0 !important;
    inset: 4rem 0 0 0 !important;
  }
}
@media (max-width: 900px) {
  .ams-exp-split { grid-template-columns: 1fr; }
  .ams-exp-modal-card.wide { min-height: 0; align-self: flex-start; }
  .ams-exp-preview { min-height: 52vh; }
  .ams-exp-preview iframe { min-height: 52vh; }
}
@media (max-width: 640px) {
  .ams-exp-root { padding: 12px; }
}
.ams-exp-doc-vis {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}
.ams-exp-doc-vis.show { color: #047857; }
.ams-exp-doc-vis.hide { color: #6b7280; }
.ams-exp-existing-proofs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft);
}
.ams-exp-proof-vis {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}
.ams-exp-proof-vis input { margin-top: 2px; }

