:root {
  --bg: #f2f5f3;
  --panel: #ffffff;
  --surface: #fbfcfb;
  --ink: #10221f;
  --muted: #687772;
  --soft: #edf3ef;
  --line: #dbe5df;
  --line-strong: #b8c9c0;
  --brand: #0f594b;
  --brand-dark: #0b3832;
  --brand-soft: #e8f4ef;
  --copper: #a66a2f;
  --green: #247454;
  --amber: #a66a2f;
  --danger: #b73d42;
  --focus: rgba(15, 89, 75, 0.18);
  --shadow: 0 18px 42px rgba(16, 34, 31, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  background:
    linear-gradient(180deg, #e6f0eb 0, #f2f5f3 280px),
    var(--bg);
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  margin: 0;
  min-height: 100%;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  margin: 0 auto;
  max-width: 1280px;
  min-height: 100vh;
  padding: 20px;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 82px;
  padding: 16px 18px;
}

.brand-mark {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-symbol {
  align-items: center;
  background:
    linear-gradient(145deg, var(--brand-dark), var(--brand));
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 27px;
  font-weight: 800;
  height: 48px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  padding-bottom: 5px;
  position: relative;
  width: 48px;
}

.brand-symbol::after {
  background: var(--copper);
  border-radius: 999px;
  bottom: 9px;
  content: "";
  height: 5px;
  left: 14px;
  position: absolute;
  width: 5px;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  color: var(--brand-dark);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.2;
}

.brand-copy small,
.panel-header p,
.inline-status,
.system-status span,
.summary-list dt,
.side-footer span {
  color: var(--muted);
  font-size: 13px;
}

.brand-copy small {
  direction: ltr;
  font-weight: 800;
  letter-spacing: 0;
  text-align: right;
}

.brand-mark.large {
  gap: 14px;
}

.brand-mark.large .brand-symbol {
  height: 62px;
  width: 62px;
}

.brand-mark.large .brand-copy strong {
  font-size: 34px;
}

.system-status {
  align-items: center;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.secondary-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #25362f;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover {
  filter: brightness(0.98);
}

.status-pill {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  min-width: 88px;
  padding: 8px 14px;
  text-align: center;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-areas:
    "request side"
    "log log";
  grid-template-columns: minmax(0, 1fr) 340px;
  margin-top: 18px;
}

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

.admin-workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  margin-top: 18px;
}

.admin-form-panel,
.admin-list-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.admin-form-panel .field-grid {
  grid-template-columns: 1fr;
}

.profile-details-panel {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-top: 16px;
  padding: 16px 0 0;
}

.profile-details-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-details-header h3 {
  font-size: 16px;
  margin: 0;
}

.profile-details-header span,
.profile-details-list dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-details-list {
  display: grid;
  gap: 10px;
}

.profile-details-list div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding-top: 10px;
}

.profile-details-list div:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-details-list dd {
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.search-field {
  margin-bottom: 14px;
}

.company-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.company-table {
  border-collapse: collapse;
  min-width: 740px;
  table-layout: fixed;
  width: 100%;
}

.company-table th:nth-child(1),
.company-table td:nth-child(1) {
  width: 23%;
}

.company-table th:nth-child(2),
.company-table td:nth-child(2) {
  width: 16%;
}

.company-table th:nth-child(3),
.company-table td:nth-child(3) {
  width: 13%;
}

.company-table th:nth-child(4),
.company-table td:nth-child(4) {
  width: 19%;
}

.company-table th:nth-child(5),
.company-table td:nth-child(5) {
  width: 19%;
}

.company-table th:nth-child(6),
.company-table td:nth-child(6) {
  width: 10%;
}

.company-table th,
.company-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: right;
  vertical-align: middle;
}

.company-table th {
  background: #f7f9fb;
  color: #2e3e38;
  font-size: 13px;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 1;
}

.company-table td {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.company-table tr:last-child td {
  border-bottom: 0;
}

.company-table strong,
.company-table small {
  display: block;
}

.company-table small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions .secondary-button,
.table-actions .danger-button {
  flex: 1 1 76px;
  padding: 0 10px;
}

.row-sync-status {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 8px;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.danger-button {
  align-items: center;
  background: #fff1f1;
  border: 1px solid #efc2bf;
  border-radius: 7px;
  color: var(--danger);
  display: inline-flex;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  padding: 0 12px;
}

.danger-button:hover {
  background: #ffe7e7;
}

.request-panel,
.log-panel,
.side-panel {
  padding: 20px;
}

.request-panel {
  grid-area: request;
}

.side-panel {
  grid-area: side;
}

.log-panel {
  grid-area: log;
}

.panel-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-bottom: 14px;
}

.panel-header h2 {
  font-size: 18px;
  line-height: 1.2;
}

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

.simple-flow {
  gap: 16px;
}

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

.form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-title {
  color: #2e3e38;
  font-size: 13px;
  font-weight: 700;
}

.company-picker {
  position: relative;
}

.company-picker-trigger {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 24px;
  min-height: 58px;
  padding: 8px 12px;
  text-align: right;
  width: 100%;
}

.company-picker-trigger:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.company-picker-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.company-picker-text strong,
.company-picker-text small {
  overflow-wrap: anywhere;
  white-space: normal;
}

.company-picker-text strong {
  font-size: 14px;
}

.company-picker-text small {
  color: var(--muted);
  direction: ltr;
  font-size: 12px;
  text-align: right;
}

.company-picker-icon {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.company-picker-icon::before {
  border-color: var(--brand);
  border-style: solid;
  border-width: 0 2px 2px 0;
  content: "";
  height: 7px;
  margin-top: -3px;
  transform: rotate(45deg);
  transition: transform 160ms ease;
  width: 7px;
}

.company-picker.is-open .company-picker-icon::before {
  margin-top: 3px;
  transform: rotate(225deg);
}

.company-popover {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  gap: 8px;
  left: 0;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
}

.company-picker.is-open .company-popover {
  display: grid;
}

.company-options {
  display: grid;
  gap: 6px;
  max-height: min(430px, 60vh);
  overflow: auto;
  padding: 0 0 2px;
}

.company-option {
  background: #fbfcfb;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 9px 11px;
  text-align: right;
  width: 100%;
}

.company-option:hover,
.company-option.is-active,
.company-option.is-selected {
  background: var(--soft);
}

.company-option.is-active {
  border-color: var(--teal);
}

.company-option.is-selected {
  background: #edf8f0;
  border-color: #b8dbc4;
}

.company-option.is-selected strong::after {
  color: var(--green);
  content: " \2713";
}

.company-option strong,
.company-option small {
  overflow-wrap: anywhere;
  white-space: normal;
}

.company-option small {
  color: var(--muted);
  direction: ltr;
  font-size: 12px;
  text-align: right;
}

.company-option.is-empty {
  color: var(--muted);
  cursor: default;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: #2e3e38;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  min-width: 0;
  padding: 0 12px;
  width: 100%;
}

input,
select {
  height: 46px;
}

textarea {
  line-height: 1.55;
  min-height: 112px;
  padding-bottom: 10px;
  padding-top: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.inline-field-action {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.inline-field-action .secondary-button {
  min-width: 86px;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.field-help.is-good {
  color: var(--green);
  font-weight: 800;
}

.field-help.is-error {
  color: var(--danger);
  font-weight: 800;
}

.field-help.is-muted {
  color: var(--muted);
}

.field-title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.intelligence-field {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-column: 1 / -1;
  padding: 16px;
}

.intelligence-field input[type="file"] {
  height: 1px;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.file-picker {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 46px;
  padding: 8px 12px;
}

.file-picker span {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
}

.file-picker strong {
  color: var(--muted);
  direction: ltr;
  font-size: 13px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intelligence-result {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.intelligence-result[hidden] {
  display: none;
}

.intelligence-result dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.intelligence-result div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.intelligence-result dt {
  color: var(--muted);
  font-size: 12px;
}

.intelligence-result dd {
  direction: ltr;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}

.exporter-review-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

#exporterDocumentInput {
  height: 1px;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.exporter-review-card h3 {
  font-size: 17px;
  margin: 0 0 4px;
}

.exporter-review-card p {
  color: var(--muted);
  font-size: 13px;
}

.review-grid {
  grid-template-columns: 1.1fr 0.8fr 1fr;
}

.advanced-options {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

.advanced-options summary {
  align-items: center;
  color: var(--brand-dark);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 15px 16px;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.advanced-options summary::before {
  border-color: var(--brand);
  border-style: solid;
  border-width: 0 2px 2px 0;
  content: "";
  height: 8px;
  transform: rotate(45deg);
  transition: transform 160ms ease;
  width: 8px;
}

.advanced-options[open] summary::before {
  transform: rotate(225deg);
}

.advanced-grid {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.toggle-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
}

.toggle-row input {
  accent-color: var(--teal);
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.action-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
}

.primary-button,
.secondary-button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  padding: 0 16px;
}

.primary-button {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #ffffff;
  min-width: 148px;
}

.primary-button:disabled {
  background: #a9b9ae;
  border-color: #a9b9ae;
  cursor: default;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: #25362f;
}

.secondary-button:hover,
.primary-button:not(:disabled):hover {
  filter: brightness(0.98);
}

.inline-status {
  overflow-wrap: anywhere;
}

.summary-list {
  display: grid;
}

.summary-list div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
  padding: 12px 0;
}

.summary-list div:first-child {
  padding-top: 0;
}

.summary-list dd {
  direction: ltr;
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}

.side-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
}

.side-footer strong {
  align-items: center;
  background: #fff6eb;
  border: 1px solid #efd6b8;
  border-radius: 999px;
  color: var(--amber);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  min-width: 44px;
  padding: 0 12px;
}

.sync-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
}

.sync-panel span,
.sync-panel small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.sync-panel strong {
  display: block;
  font-size: 15px;
  margin-top: 4px;
}

.sync-panel small {
  direction: ltr;
  margin-top: 6px;
  overflow-wrap: anywhere;
  text-align: right;
}

.sync-panel .secondary-button {
  width: 100%;
}

#logOutput {
  background: #111827;
  border-radius: 8px;
  color: #d6f3e7;
  direction: ltr;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  height: 230px;
  line-height: 1.55;
  margin: 0;
  overflow: auto;
  padding: 14px;
  text-align: left;
  white-space: pre-wrap;
}

.failure-artifact {
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.failure-artifact-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.failure-artifact-header strong {
  color: var(--ink);
  font-size: 15px;
}

.failure-artifact-header span {
  color: var(--muted);
  font-size: 12px;
}

.failure-artifact img {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: block;
  max-width: 100%;
}

#failureArtifactContext {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #173e37;
  direction: ltr;
  font-size: 12px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  text-align: left;
  white-space: pre-wrap;
}

.is-error {
  color: var(--danger);
}

.is-good {
  color: var(--green);
}

.is-muted {
  color: var(--muted);
}

.status-pill.is-error {
  background: #fff0f0;
  border-color: #e8b9b7;
}

.status-pill.is-good {
  background: #eef8f3;
  border-color: #b8dbc4;
}

.login-page {
  background:
    linear-gradient(135deg, rgba(15, 89, 75, 0.12), transparent 38%),
    linear-gradient(225deg, rgba(166, 106, 47, 0.12), transparent 42%),
    #f2f5f3;
}

.login-shell {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 460px);
  margin: 0 auto;
  max-width: 1120px;
  min-height: 100vh;
  padding: 32px 20px;
}

.login-brand-panel,
.login-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 520px;
  overflow: hidden;
  padding: 30px;
  position: relative;
}

.login-brand-panel::after {
  background:
    linear-gradient(90deg, transparent, rgba(15, 89, 75, 0.12), transparent),
    repeating-linear-gradient(
      0deg,
      rgba(16, 34, 31, 0.05) 0,
      rgba(16, 34, 31, 0.05) 1px,
      transparent 1px,
      transparent 42px
    );
  content: "";
  inset: auto 0 0;
  height: 44%;
  pointer-events: none;
  position: absolute;
}

.login-intro {
  align-self: end;
  max-width: 560px;
  position: relative;
  z-index: 1;
}

.login-intro h1 {
  color: var(--brand-dark);
  font-size: 42px;
  line-height: 1.18;
  margin: 0 0 12px;
}

.login-intro p,
.login-card-header p,
.login-status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-card {
  align-self: center;
  display: grid;
  gap: 22px;
  padding: 28px;
}

.login-card-header h2 {
  color: var(--ink);
  font-size: 24px;
  margin: 0 0 6px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .primary-button {
  width: 100%;
}

.login-status {
  min-height: 24px;
  overflow-wrap: anywhere;
}

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

  .login-brand-panel {
    min-height: 300px;
  }

  .workspace {
    grid-template-areas:
      "request"
      "side"
      "log";
    grid-template-columns: 1fr;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--bg);
  }

  .login-page {
    background: var(--bg);
  }

  .login-shell {
    gap: 12px;
    min-height: 100vh;
    padding: 10px;
  }

  .login-brand-panel,
  .login-card {
    padding: 18px;
  }

  .login-brand-panel {
    min-height: 240px;
  }

  .login-intro h1 {
    font-size: 30px;
  }

  .brand-mark.large .brand-symbol {
    height: 52px;
    width: 52px;
  }

  .brand-mark.large .brand-copy strong {
    font-size: 28px;
  }

  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
    display: grid;
    gap: 14px;
    padding: 14px;
  }

  .brand-symbol {
    height: 44px;
    width: 44px;
  }

  .brand-copy strong {
    font-size: 23px;
  }

  .system-status {
    justify-content: space-between;
  }

  .top-actions {
    align-items: stretch;
    display: grid;
  }

  .secondary-link {
    min-height: 44px;
    width: 100%;
  }

  .request-panel,
  .log-panel,
  .side-panel,
  .admin-form-panel,
  .admin-list-panel {
    padding: 14px;
  }

  .panel-header {
    display: grid;
  }

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

  input,
  select,
  textarea,
  .company-picker-trigger,
  .primary-button,
  .secondary-button,
  .toggle-row {
    min-height: 48px;
  }

  .company-popover {
    margin-top: 8px;
    position: static;
  }

  .company-options {
    max-height: min(430px, 58vh);
  }

  .action-row {
    align-items: stretch;
    display: grid;
  }

  .inline-field-action {
    grid-template-columns: 1fr;
  }

  .field-title-row {
    align-items: stretch;
    display: grid;
  }

  .intelligence-result dl {
    grid-template-columns: 1fr;
  }

  .inline-field-action .secondary-button {
    width: 100%;
  }

  .primary-button {
    width: 100%;
  }

  #logOutput {
    height: 190px;
  }

  .company-table-wrap {
    border: 0;
    overflow: visible;
  }

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

  .company-table thead {
    display: none;
  }

  .company-table,
  .company-table tbody,
  .company-table tr,
  .company-table td {
    display: block;
    width: 100%;
  }

  .company-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .company-table td {
    border-bottom: 0;
    display: grid;
    gap: 6px;
    padding: 7px 0;
  }

  .company-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
  }

  .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* bnafsk product interface refresh */
.app-shell {
  max-width: 1180px;
  padding: 22px;
}

.topbar {
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(184, 201, 192, 0.72);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(16, 34, 31, 0.08);
  min-height: 76px;
}

.brand-symbol {
  background: linear-gradient(150deg, #08352e, #0f6b59 64%, #178066);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 24px rgba(15, 89, 75, 0.18);
  font-size: 20px;
  height: 50px;
  padding: 0 0 4px;
  width: 50px;
}

.brand-symbol::after {
  background: #d79243;
  bottom: 10px;
  height: 6px;
  left: 11px;
  width: 6px;
}

.brand-copy strong {
  color: #082f2a;
  font-size: 27px;
}

.brand-copy small {
  color: #7a5b34;
}

.secondary-link,
.secondary-button,
.ghost-button,
.extract-button,
.verify-button,
.primary-button {
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.secondary-link:hover,
.secondary-button:hover,
.ghost-button:hover,
.extract-button:hover,
.verify-button:hover,
.primary-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.workspace {
  align-items: start;
  gap: 20px;
  grid-template-areas:
    "request side"
    "request log";
  grid-template-columns: minmax(0, 1fr) 320px;
  margin-top: 20px;
}

.request-panel,
.side-panel,
.log-panel {
  border-radius: 14px;
  box-shadow: 0 22px 54px rgba(16, 34, 31, 0.08);
}

.request-panel {
  overflow: hidden;
  padding: 0;
}

.request-hero {
  background:
    linear-gradient(135deg, rgba(15, 89, 75, 0.09), rgba(166, 106, 47, 0.07)),
    #ffffff;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 22px 24px;
}

.request-hero h2 {
  color: #0b3832;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.25;
}

.request-hero p {
  font-size: 14px;
  margin-top: 6px;
}

.eyebrow,
.action-label {
  color: #946025;
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.readiness-pill {
  align-items: center;
  background: #fff8ef;
  border: 1px solid #efd7b8;
  border-radius: 999px;
  color: #9b5c18;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  min-width: 96px;
  padding: 0 15px;
}

.readiness-pill.is-ready {
  background: #eaf8f0;
  border-color: #a9d9bf;
  color: #17633f;
}

.flow-stack {
  display: grid;
  gap: 14px;
  padding: 20px 24px 0;
}

.flow-card {
  animation: card-enter 360ms ease both;
  background: #ffffff;
  border: 1px solid rgba(184, 201, 192, 0.72);
  border-radius: 12px;
  display: grid;
  gap: 16px;
  padding: 18px;
  position: relative;
}

.flow-card.is-active,
.flow-card:focus-within {
  border-color: rgba(15, 89, 75, 0.42);
  box-shadow: 0 12px 28px rgba(15, 89, 75, 0.08);
}

.flow-card-header {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.flow-card-header h3 {
  color: #10221f;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
}

.flow-card-header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.step-badge {
  align-items: center;
  background: #f0f6f3;
  border: 1px solid #c7d9d0;
  border-radius: 10px;
  color: #0f594b;
  display: inline-flex;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.ghost-button,
.extract-button,
.verify-button {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
}

.ghost-button {
  background: #ffffff;
  border: 1px solid var(--line-strong);
  color: #173e37;
}

.extract-button {
  background: #0b3832;
  border: 1px solid #0b3832;
  color: #ffffff;
}

.extract-button:disabled {
  background: #dce6e1;
  border-color: #dce6e1;
  color: #7b8b86;
  cursor: default;
  transform: none;
}

.verify-button {
  background: #fff8ef;
  border: 1px solid #e5c69a;
  color: #8c551e;
}

.company-picker-trigger,
input,
select,
textarea {
  border-radius: 10px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input:focus,
select:focus,
textarea:focus,
.company-picker-trigger:focus {
  border-color: #0f6b59;
  box-shadow: 0 0 0 4px rgba(15, 89, 75, 0.12);
  outline: none;
}

.company-picker-trigger {
  background: #fbfdfb;
  min-height: 66px;
}

.file-picker {
  background:
    linear-gradient(135deg, rgba(15, 89, 75, 0.06), rgba(255, 255, 255, 0)),
    #fbfdfb;
  border: 1px dashed #9fbbb0;
  border-radius: 12px;
  min-height: 92px;
  padding: 16px;
}

.file-picker:hover {
  border-color: #0f6b59;
  box-shadow: 0 10px 26px rgba(15, 89, 75, 0.08);
}

.file-picker-icon {
  align-items: center;
  background: #0f594b;
  border-radius: 12px;
  color: #ffffff;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.file-picker-icon::before {
  content: "+";
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.file-picker-copy {
  background: transparent;
  border: 0;
  color: inherit;
  display: grid;
  gap: 3px;
  height: auto;
  padding: 0;
}

.file-picker-copy strong {
  color: #10221f;
  font-size: 15px;
  font-weight: 900;
  overflow: visible;
  white-space: normal;
}

.file-picker-copy small {
  color: var(--muted);
  direction: ltr;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}

.manual-source-field textarea {
  min-height: 104px;
  padding-top: 12px;
  resize: vertical;
}

.extract-action-row,
.verify-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verify-row .field-help {
  flex: 1 1 240px;
}

.intelligence-result {
  animation: card-enter 260ms ease both;
  background: #f8fbf9;
  border-radius: 12px;
}

.exporter-review-card {
  border-color: rgba(15, 89, 75, 0.34);
}

.review-grid {
  grid-template-columns: 1fr 220px 260px;
}

.advanced-options {
  border-radius: 12px;
  overflow: hidden;
}

.advanced-options summary {
  background: #fbfdfb;
}

.action-row {
  background: #fbfcfb;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  margin: 20px 0 0;
  padding: 18px 24px 22px;
}

.request-submit-button {
  background: #dfe8e3;
  border-color: #dfe8e3;
  color: #7c8a85;
  min-width: 190px;
}

.request-submit-button.is-ready {
  background: linear-gradient(135deg, #0f6b59, #0b563f);
  border-color: #0f6b59;
  box-shadow: 0 14px 28px rgba(15, 89, 75, 0.22);
  color: #ffffff;
}

.request-submit-button:disabled,
.request-submit-button.is-ready:disabled {
  background: #dfe8e3;
  border-color: #dfe8e3;
  box-shadow: none;
  color: #7c8a85;
  opacity: 1;
}

.side-panel {
  position: sticky;
  top: 18px;
}

.log-panel {
  padding: 0;
}

.log-panel summary {
  color: #10221f;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  list-style: none;
  padding: 16px 18px;
}

.log-panel summary::-webkit-details-marker {
  display: none;
}

.log-panel .panel-header,
.log-panel pre {
  margin-left: 18px;
  margin-right: 18px;
}

.log-panel pre {
  margin-bottom: 18px;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 980px) {
  .workspace {
    grid-template-areas:
      "request"
      "side"
      "log";
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 8px;
  }

  .topbar,
  .request-panel,
  .side-panel,
  .log-panel {
    border-radius: 12px;
  }

  .topbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    min-height: 0;
    padding: 12px;
  }

  .brand-mark {
    gap: 9px;
  }

  .brand-symbol {
    border-radius: 12px;
    font-size: 17px;
    height: 44px;
    width: 44px;
  }

  .brand-copy strong {
    font-size: 23px;
  }

  .brand-copy small {
    font-size: 12px;
  }

  .top-actions {
    align-items: center;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-start;
  }

  .top-actions .secondary-link {
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    width: auto;
  }

  .system-status {
    gap: 6px;
  }

  .system-status span {
    display: none;
  }

  .status-pill {
    min-width: 64px;
    padding: 7px 12px;
  }

  .request-hero,
  .flow-stack,
  .action-row {
    padding-left: 14px;
    padding-right: 14px;
  }

  .request-hero h2 {
    font-size: 22px;
    max-width: 13ch;
  }

  .flow-card {
    padding: 14px;
  }

  .flow-card-header {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .flow-card-header .ghost-button {
    font-size: 13px;
    min-height: 38px;
    padding: 0 12px;
  }

  .extract-action-row,
  .verify-row,
  .action-row {
    display: grid;
  }

  .extract-button,
  .ghost-button,
  .verify-button,
  .request-submit-button {
    width: 100%;
  }

  .side-panel {
    display: none;
  }

  .log-panel {
    margin-bottom: 12px;
  }
}

/* bnafsk commercial launch polish */
:root {
  --teal: #0f6b59;
  --mint: #eaf4ef;
  --paper: #f8f7f1;
  --paper-strong: #eee9dd;
  --blue: #275d7b;
}

body {
  background:
    linear-gradient(180deg, #eef5f1 0, #f7f6f1 360px),
    var(--paper);
}

.app-shell {
  max-width: 1140px;
}

.brand-symbol.brand-logo {
  background: #082f2a;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
}

.brand-symbol.brand-logo::after {
  display: none;
}

.brand-logo-svg {
  display: block;
  height: 100%;
  width: 100%;
}

.logo-paper {
  fill: #f7f4ea;
}

.logo-fold,
.logo-route,
.logo-check {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-fold {
  stroke: rgba(15, 89, 75, 0.28);
  stroke-width: 2.6;
}

.logo-route {
  stroke: #d5903d;
  stroke-width: 3.5;
}

.logo-check {
  stroke: #0f6b59;
  stroke-width: 4.5;
}

.logo-letter {
  direction: rtl;
  fill: #082f2a;
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 24px;
  font-weight: 900;
}

.logo-dot {
  fill: #d5903d;
}

.brand-copy strong {
  letter-spacing: 0;
}

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

.request-panel {
  border-color: rgba(120, 151, 139, 0.36);
}

.request-hero {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 136px;
  overflow: hidden;
  position: relative;
}

.request-hero::before {
  background:
    linear-gradient(90deg, rgba(15, 107, 89, 0.09), transparent),
    repeating-linear-gradient(
      135deg,
      rgba(39, 93, 123, 0.08) 0,
      rgba(39, 93, 123, 0.08) 1px,
      transparent 1px,
      transparent 18px
    );
  content: "";
  inset: 0;
  opacity: 0.7;
  pointer-events: none;
  position: absolute;
}

.request-hero > * {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 560px;
}

.hero-copy h2 {
  max-width: 13ch;
}

.hero-mini-steps {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(184, 201, 192, 0.78);
  border-radius: 999px;
  display: flex;
  gap: 6px;
  padding: 6px;
}

.hero-mini-steps span {
  align-items: center;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #173e37;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  min-width: 56px;
  padding: 0 12px;
  white-space: nowrap;
}

.hero-mini-steps span:last-child {
  background: #0f6b59;
  color: #ffffff;
}

.flow-stack {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.exporter-review-card,
.advanced-options {
  grid-column: 1 / -1;
}

.flow-card {
  border-radius: 16px;
  min-width: 0;
}

.company-flow-card,
.upload-flow-card {
  min-height: 252px;
}

.flow-card-header {
  align-items: start;
}

.flow-card-header p {
  line-height: 1.55;
}

.company-picker-trigger {
  border-color: rgba(120, 151, 139, 0.72);
  min-height: 72px;
}

.company-picker-text strong {
  color: #10221f;
  font-size: 16px;
  font-weight: 900;
}

.company-picker-text small {
  color: #66746f;
  font-size: 12px;
  line-height: 1.45;
}

.file-picker {
  align-items: center;
  border-radius: 18px;
  gap: 14px;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 108px;
}

.file-picker-icon {
  border-radius: 16px;
  height: 58px;
  width: 58px;
}

.file-picker-copy strong {
  color: #0b3832;
  font-size: 21px;
  line-height: 1.25;
}

.file-picker-copy small {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  max-width: 100%;
}

.manual-source-options {
  background: #fbfdfb;
  border: 1px solid rgba(184, 201, 192, 0.72);
  border-radius: 14px;
  overflow: hidden;
}

.manual-source-options summary {
  color: #275d7b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  padding: 12px 14px;
}

.manual-source-options summary::-webkit-details-marker {
  display: none;
}

.manual-source-options summary::before {
  border-color: currentColor;
  border-style: solid;
  border-width: 0 2px 2px 0;
  content: "";
  display: inline-block;
  height: 7px;
  margin-left: 10px;
  transform: rotate(45deg);
  width: 7px;
}

.manual-source-options[open] {
  padding-bottom: 12px;
}

.manual-source-options[open] summary::before {
  transform: rotate(225deg);
}

.manual-source-options .manual-source-field,
.manual-source-options .ghost-button {
  margin-left: 14px;
  margin-right: 14px;
}

.manual-source-options .ghost-button {
  margin-top: 10px;
  width: calc(100% - 28px);
}

.extract-action-row {
  display: grid;
  grid-template-columns: 1fr;
}

.extract-button {
  box-shadow: 0 14px 28px rgba(15, 107, 89, 0.18);
  font-size: 16px;
  min-height: 52px;
}

.extract-button:not(:disabled)::after {
  content: "←";
  font-size: 19px;
  margin-right: 9px;
}

.field-help {
  line-height: 1.7;
}

.advanced-options {
  background: rgba(255, 255, 255, 0.76);
}

.advanced-options summary {
  color: #275d7b;
  font-size: 14px;
}

.action-row {
  position: relative;
}

.request-submit-button {
  font-size: 16px;
  min-height: 52px;
}

.side-panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.login-page {
  background:
    linear-gradient(180deg, #eef5f1 0, #f7f6f1 100%),
    var(--paper);
}

.login-brand-panel {
  background:
    linear-gradient(135deg, rgba(15, 107, 89, 0.1), rgba(213, 144, 61, 0.09)),
    rgba(255, 255, 255, 0.86);
  border-radius: 18px;
}

.login-brand-panel::after {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(39, 93, 123, 0.08) 0,
      rgba(39, 93, 123, 0.08) 1px,
      transparent 1px,
      transparent 22px
    );
}

.login-card {
  border-radius: 18px;
}

.login-intro h1 {
  max-width: 12ch;
}

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

  .flow-stack {
    grid-template-columns: 1fr;
  }

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

  .hero-mini-steps {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  body {
    background: #f7f6f1;
  }

  .app-shell {
    padding: 8px;
  }

  .topbar {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(16, 34, 31, 0.07);
    padding: 10px;
  }

  .brand-symbol {
    height: 42px;
    width: 42px;
  }

  .brand-copy strong {
    font-size: 21px;
  }

  .brand-copy small,
  .system-status,
  .top-actions .secondary-link {
    font-size: 11px;
  }

  .request-panel {
    border-radius: 20px;
  }

  .request-hero {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 14px 14px 12px;
  }

  .eyebrow {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .request-hero h2 {
    font-size: 22px;
    line-height: 1.2;
    max-width: none;
  }

  .request-hero p {
    font-size: 12px;
    line-height: 1.45;
    margin-top: 4px;
    max-width: 31ch;
  }

  .readiness-pill {
    font-size: 12px;
    height: 34px;
    min-width: 78px;
    padding: 0 11px;
  }

  .hero-mini-steps {
    border-radius: 14px;
    display: grid;
    gap: 5px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 2px;
    padding: 5px;
    width: 100%;
  }

  .hero-mini-steps span {
    height: 28px;
    min-width: 0;
    padding: 0 8px;
  }

  .flow-stack {
    gap: 10px;
    padding: 10px 10px 0;
  }

  .flow-card {
    border-radius: 16px;
    gap: 12px;
    padding: 13px;
  }

  .company-flow-card,
  .upload-flow-card {
    min-height: 0;
  }

  .flow-card-header {
    gap: 9px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .step-badge {
    border-radius: 10px;
    height: 34px;
    width: 34px;
  }

  .flow-card-header h3 {
    font-size: 17px;
  }

  .flow-card-header p {
    font-size: 12px;
    line-height: 1.5;
  }

  .company-picker-trigger {
    min-height: 58px;
    padding: 10px;
  }

  .company-picker-text strong {
    font-size: 15px;
  }

  .file-picker {
    border-radius: 16px;
    gap: 11px;
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 78px;
    padding: 12px;
  }

  .file-picker-icon {
    border-radius: 14px;
    height: 48px;
    width: 48px;
  }

  .file-picker-copy strong {
    font-size: 18px;
    white-space: nowrap;
  }

  .file-picker-copy small {
    font-size: 12px;
    line-height: 1.35;
  }

  .manual-source-options summary {
    padding: 10px 12px;
  }

  .extract-button,
  .request-submit-button {
    min-height: 50px;
  }

  .field-help {
    font-size: 11px;
  }

  .action-row {
    gap: 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    padding-top: 14px;
  }

  .action-label {
    font-size: 11px;
  }

  .inline-status {
    font-size: 12px;
  }

  .login-shell {
    padding: 8px;
  }

  .login-brand-panel {
    min-height: 210px;
  }

  .login-intro h1 {
    font-size: 32px;
    line-height: 1.18;
  }
}

@media (max-width: 390px) {
  .request-hero h2 {
    font-size: 21px;
  }

  .flow-card-header {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .flow-card-header .ghost-button {
    grid-column: 1 / -1;
  }

  .file-picker-copy strong {
    font-size: 17px;
  }
}
