:root {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  background: #f1f5f9;
  --border: #e5eaf0;
  --muted: #64748b;
  --teal: #0f766e;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input {
  font: inherit;
}
button {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 14px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-weight: 600;
  transition:
    background-color 120ms,
    border-color 120ms;
}
button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #14b8a6;
  outline-offset: 3px;
}
button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
button.primary:hover:not(:disabled) {
  background: #115e59;
  border-color: #115e59;
}
button.danger {
  color: #b42332;
  border-color: #f0d7dc;
}
button.danger:hover:not(:disabled) {
  background: #fff1f2;
  border-color: #e8adb8;
}
button.text {
  background: transparent;
  border-color: transparent;
  padding: 7px 9px;
}
input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  background: #fff;
}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.65rem;
  line-height: 1.3;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 1rem;
  font-weight: 650;
}
h3 {
  font-size: 1.1rem;
  line-height: 1.35;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.shell {
  width: 100%;
  max-width: 1600px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
}
.mark svg {
  width: 20px;
  height: 20px;
}
.top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.session-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.session-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.session-status.active {
  color: var(--teal);
}
.session-status.active::before {
  background: #0d9488;
}
.session-status.inactive::before {
  background: #94a3b8;
}
.desk {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: calc(100vh - 165px);
}
.sidebar {
  padding: 24px 12px;
  border-right: 1px solid var(--border);
}
.nav-item {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  text-align: left;
  background: transparent;
  border-color: transparent;
}
.nav-item.active {
  background: #e7f7f5;
  color: var(--teal);
}
.nav-item.active:hover:not(:disabled) {
  background: #d5f0ec;
  border-color: transparent;
}
.desk-content {
  min-width: 0;
  padding: 28px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(380px, 1fr);
  gap: 28px;
  align-items: start;
}
.proposal-list,
.inspector {
  min-width: 0;
}
.inspector > h2 {
  margin-bottom: 18px;
}
.order-metadata {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.order-metadata summary {
  cursor: pointer;
}
.order-metadata p {
  margin-top: 8px;
}
.card-body > .fineprint {
  margin-top: 16px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 18px;
}
.section-heading > button:last-child {
  margin-left: auto;
}
.count {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.queue {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.queue th {
  padding: 11px 8px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: #f8fafc;
  border-block: 1px solid var(--border);
  white-space: nowrap;
}
.queue td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.queue tbody tr:hover {
  background: #f3faf9;
}
.queue tr.selected {
  background: #e7f7f5;
}
.queue tr.selected:hover {
  background: #d8f1ee;
}
.queue th:nth-child(3),
.queue th:nth-child(4),
.queue td:nth-child(3),
.queue td:nth-child(4) {
  text-align: right;
}
.queue td:nth-child(2) {
  padding: 0;
}
button.row-select {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 14px 8px;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
}
button.row-select:hover:not(:disabled) {
  background: #d8f1ee;
}
.row-select small {
  display: block;
  font-size: 0.73rem;
  font-weight: 400;
}
.row-select:focus-visible {
  outline-offset: -3px;
}
.pill,
.side-tag {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
}
.pill {
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #475569;
}
.pill.pending,
.pill.amber {
  background: #fff7e5;
  color: #91640d;
}
.pill.submitted,
.pill.approved,
.pill.green {
  background: #e7f7f5;
  color: #0f766e;
}
.pill.unknown {
  background: #edf0f5;
  color: #475569;
}
.pill.rejected,
.pill.failed,
.pill.red {
  background: #fff1f2;
  color: #b42332;
}
.side-tag {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.side-tag.buy {
  color: #0f766e;
}
.side-tag.sell {
  color: #b45309;
}
.mobile-inbox {
  display: none;
}
.back-button {
  display: none;
}
.proposal {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}
.instrument {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.instrument > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.instrument-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--teal);
  font-weight: 700;
}
.instrument small {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
}
.card-body {
  padding: 0 22px 22px;
}
.terms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.terms > div {
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.terms > div:nth-child(even):not(.wide) {
  padding-left: 18px;
}
.terms dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}
.terms dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 550;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.terms .wide {
  grid-column: 1 / -1;
}
.estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 12px;
  padding: 14px;
  border: 1px solid #d7eeea;
  border-radius: 6px;
  background: #f0faf8;
  color: #475569;
  font-size: 0.8rem;
}
.estimate strong {
  color: #0f172a;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.fineprint {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.card-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  background: #fafcfd;
}
.card-footer p {
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.empty {
  padding: 60px 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fafcfd;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.empty h3 {
  margin-bottom: 8px;
  color: #334155;
  font-size: 1rem;
}
.notice,
.status-message {
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.status-message {
  margin-top: 16px;
}
.status-message.error {
  color: #b42332;
  border-color: #f0d7dc;
  background: #fff7f8;
}
.status-message:empty,
.feedback:empty {
  display: none;
}
.history {
  max-width: 1000px;
}
.audit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.audit-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.audit-list p {
  font-size: 0.85rem;
}
.audit-list time,
.audit-list small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  font-size: 0.73rem;
  color: var(--muted);
}
.auth {
  width: calc(100% - 40px);
  max-width: 420px;
  margin: 64px auto;
}
.auth h1 {
  margin: 10px 0 14px;
}
.auth > p {
  color: var(--muted);
}
.auth-card {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.auth-card h2 {
  margin-bottom: 10px;
}
.auth-card p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}
.auth-card input {
  margin-bottom: 14px;
}
.auth-card button {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}
.auth-note {
  margin-top: 18px;
  font-size: 0.77rem;
  color: var(--muted);
}
.refresh-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.73rem;
}
.break {
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
  .desk {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }
  .sidebar {
    display: flex;
    gap: 6px;
    padding: 10px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-item {
    width: auto;
    margin: 0;
  }
  .desk-content {
    padding: 22px;
  }
  .workspace {
    grid-template-columns: minmax(360px, 1fr) minmax(340px, 1fr);
    gap: 16px;
  }
  .queue th,
  .queue td {
    padding-inline: 6px;
  }
  .card-heading,
  .card-footer {
    padding: 18px;
  }
  .card-body {
    padding: 0 18px 18px;
  }
}

@media (max-width: 899px) {
  button {
    min-height: 44px;
  }
  .shell {
    border-inline: 0;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .top-right {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
    gap: 4px 12px;
  }
  .top-right button {
    font-size: 0.8rem;
  }
  .desk {
    min-height: 0;
  }
  .session-status {
    margin-right: auto;
  }
  .sidebar {
    padding: 8px 16px;
  }
  .desk-content {
    padding: 20px 16px;
  }
  .workspace {
    display: block;
  }
  .workspace:not(.has-selection) .inspector {
    display: none;
  }
  .workspace.has-selection .proposal-list {
    display: none;
  }
  .queue {
    display: none;
  }
  .mobile-inbox {
    display: grid;
    gap: 10px;
  }
  button.proposal-row {
    display: block;
    width: 100%;
    padding: 16px;
    text-align: left;
    border-radius: 8px;
    font-weight: 400;
  }
  button.proposal-row:hover:not(:disabled) {
    background: #e7f7f5;
    border-color: #a9dcd5;
  }
  .proposal-row.selected {
    background: #e7f7f5;
    border-color: #a9dcd5;
  }
  .row-title,
  .row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
  }
  .row-title {
    margin-bottom: 10px;
  }
  .row-title strong {
    font-size: 1rem;
  }
  .row-title .pill {
    margin-left: auto;
  }
  .row-meta {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .back-button {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
  }
  .section-heading {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .section-heading > div {
    flex-basis: 100%;
  }
  .card-heading {
    flex-wrap: wrap;
    padding: 18px 16px;
  }
  .card-body {
    padding: 0 16px 18px;
  }
  .terms {
    grid-template-columns: minmax(0, 1fr);
  }
  .terms > div,
  .terms > div:nth-child(even):not(.wide) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: baseline;
    gap: 16px;
    padding: 14px 0;
  }
  .terms dt {
    margin: 0;
  }
  .terms dd {
    text-align: right;
  }
  .terms .wide {
    grid-column: auto;
  }
  .estimate {
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  .card-footer {
    padding: 16px;
  }
  .card-footer .actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .card-footer .actions button {
    width: 100%;
  }
  .footer {
    flex-direction: column;
    margin-top: 28px;
  }
  .auth {
    margin: 36px auto;
  }
  .auth-card {
    padding: 20px;
  }
}

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