:root {
  color-scheme: light;
  --ink-950: #101827;
  --ink-900: #172033;
  --ink-800: #253046;
  --ink-700: #3b465a;
  --ink-600: #596579;
  --ink-500: #748096;
  --ink-400: #9aa5b5;
  --ink-300: #c5ccd6;
  --ink-200: #dce1e8;
  --ink-100: #edf0f4;
  --ink-50: #f7f8fa;
  --paper: #ffffff;
  --blue-700: #174f8f;
  --blue-600: #1e64ad;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --green-700: #147a50;
  --green-600: #179563;
  --green-100: #d8f4e7;
  --green-50: #edfbf5;
  --red-700: #b52b37;
  --red-600: #ce3b47;
  --red-100: #fee0e3;
  --red-50: #fff2f3;
  --amber-700: #9a5d0b;
  --amber-100: #fdecc8;
  --amber-50: #fff8e8;
  --shadow-sm: 0 1px 2px rgb(16 24 39 / 5%);
  --shadow-md: 0 12px 32px rgb(16 24 39 / 10%);
  --shadow-lg: 0 24px 70px rgb(16 24 39 / 18%);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --sidebar-width: 264px;
  --content-max: 1540px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Quote creation and Market Watch */
.pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  align-items: start;
}

.pricing-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.form-section {
  padding-bottom: 23px;
}

.form-section .form-grid {
  padding-inline: 24px;
}

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

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

.pricing-summary {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.pricing-summary h2 {
  margin: -8px 0 0;
  font-size: 1.8rem;
}

.pricing-summary .definition-grid {
  margin-inline: -24px;
  border-block: 1px solid var(--ink-100);
  border-radius: 0;
}

.pricing-safety {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
}

.pricing-safety p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
  align-items: start;
}

.watch-controls {
  padding-bottom: 24px;
}

.watch-controls > .form-grid,
.watch-controls > .watch-actions,
.watch-controls > .repeat-indicator,
.watch-controls > .form-error {
  margin-inline: 24px;
}

.watch-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.repeat-indicator {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 16px;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 700;
}

.repeat-indicator > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-600);
  box-shadow: 0 0 0 5px rgb(31 157 104 / 12%);
}

.watch-board {
  overflow: hidden;
  min-height: 470px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.watch-board--off {
  border-color: var(--red-600);
}

.watch-board > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--ink-100);
}

.watch-board h2 {
  margin: 3px 0 0;
  font-size: 1.8rem;
}

.market-state {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 0.72rem;
  font-weight: 800;
}

.market-state--off {
  background: var(--red-50);
  color: var(--red-700);
}

.watch-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink-100);
}

.watch-price {
  display: grid;
  gap: 5px;
  padding: 27px 24px;
  background: var(--paper);
}

.watch-price span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.watch-price strong {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.1;
}

.watch-price small {
  color: var(--ink-500);
}

.watch-price--ask span,
.watch-price--ask strong {
  color: var(--green-700);
}

.watch-price--bid span,
.watch-price--bid strong {
  color: var(--red-700);
}

.watch-board .definition-grid {
  border: 0;
  border-top: 1px solid var(--ink-100);
  border-radius: 0;
}

.watch-board > .alert {
  margin: 20px 24px 24px;
}

.watch-empty {
  display: grid;
  min-height: 470px;
  place-content: center;
  justify-items: center;
  padding: 36px;
  color: var(--ink-500);
  text-align: center;
}

.watch-empty h2 {
  margin: 16px 0 5px;
  color: var(--ink-900);
}

.watch-empty p {
  max-width: 430px;
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .pricing-layout,
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .pricing-summary {
    position: static;
  }
}

@media (max-width: 767px) {
  .form-grid--two,
  .form-grid--three,
  .watch-prices {
    grid-template-columns: 1fr;
  }

  .form-section .form-grid,
  .watch-controls > .form-grid,
  .watch-controls > .watch-actions,
  .watch-controls > .repeat-indicator,
  .watch-controls > .form-error {
    margin-inline: 0;
    padding-inline: 17px;
  }

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

  .watch-actions .button {
    width: 100%;
  }

  .watch-board > header {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 17px;
  }

  .watch-price {
    padding: 22px 17px;
  }

  .pricing-summary {
    padding: 19px 17px;
  }

  .pricing-summary .definition-grid {
    margin-inline: -17px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink-50);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--ink-50);
  color: var(--ink-900);
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong,
.numeric,
.record-id {
  font-variant-numeric: tabular-nums;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(30 100 173 / 28%);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 72px;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgb(255 255 255 / 9%);
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink-950);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.brand__mark--small {
  width: 42px;
  height: 34px;
  border-color: var(--ink-200);
  border-radius: 9px;
  font-size: 0.68rem;
}

.brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.1;
}

.brand__text strong {
  color: var(--paper);
  font-size: 1.03rem;
  letter-spacing: 0.01em;
}

.brand__text small {
  margin-top: 5px;
  color: var(--ink-400);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 720;
  line-height: 1.2;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button--primary {
  background: var(--blue-600);
  color: var(--paper);
}

.button--primary:hover:not(:disabled) {
  background: var(--blue-700);
}

.button--secondary {
  border-color: var(--ink-200);
  background: var(--paper);
  color: var(--ink-800);
  box-shadow: var(--shadow-sm);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--ink-300);
  background: var(--ink-50);
}

.button--danger {
  background: var(--red-600);
  color: var(--paper);
}

.button--danger:hover:not(:disabled) {
  background: var(--red-700);
}

.button--ghost {
  background: transparent;
  color: var(--ink-700);
}

.button--full {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--ink-100);
}

.spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner--large {
  width: 28px;
  height: 28px;
  color: var(--blue-600);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.field__label {
  color: var(--ink-700);
  font-size: 0.82rem;
  font-weight: 750;
}

.field__hint {
  color: var(--ink-500);
  font-size: 0.75rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--ink-300);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-900);
  padding: 10px 12px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-400);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-400);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-600);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(30 100 173 / 13%);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.88fr) minmax(520px, 1.12fr);
  background: var(--paper);
}

.login-story {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 42px clamp(38px, 5vw, 76px);
  background: var(--ink-950);
  color: var(--paper);
}

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

.login-brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.login-brand strong {
  font-size: 1.08rem;
}

.login-brand small {
  color: var(--ink-400);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-story__content {
  max-width: 600px;
  margin: auto 0;
}

.login-story__content h1 {
  margin-bottom: 24px;
  font-size: clamp(2.7rem, 5vw, 5.5rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.login-story__content > p:last-child {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--ink-300);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.7;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 26px;
  border-top: 1px solid rgb(255 255 255 / 12%);
  color: var(--ink-300);
  font-size: 0.83rem;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  padding: 54px clamp(28px, 7vw, 110px);
  background:
    linear-gradient(var(--ink-100) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-100) 1px, transparent 1px),
    var(--ink-50);
  background-size: 36px 36px;
}

.login-card {
  width: min(100%, 500px);
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--shadow-lg);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue-700);
  font-size: 0.7rem;
  font-weight: 820;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #8ac2ff;
}

.login-card h2 {
  margin-bottom: 14px;
  font-size: clamp(1.75rem, 3vw, 2.3rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.login-card__intro {
  margin-bottom: 28px;
  color: var(--ink-600);
  line-height: 1.65;
}

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

.login-help {
  margin-top: 28px;
  padding: 17px 18px;
  border-left: 3px solid var(--blue-600);
  background: var(--blue-50);
  color: var(--ink-700);
}

.login-help strong {
  color: var(--ink-900);
  font-size: 0.86rem;
}

.login-help p {
  margin: 5px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.challenge-message {
  padding: 13px 15px;
  border: 1px solid var(--blue-100);
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 0.84rem;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  gap: 8px;
}

.otp-inputs input {
  min-width: 0;
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-600);
  font-size: 0.84rem;
}

.countdown strong {
  color: var(--green-700);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.countdown--urgent strong {
  color: var(--red-700);
}

.login-secondary-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.login-secondary-actions button {
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 720;
}

.login-secondary-actions button:disabled {
  color: var(--ink-400);
  cursor: not-allowed;
}

.form-error,
.global-error {
  padding: 12px 14px;
  border: 1px solid var(--red-100);
  border-radius: 9px;
  background: var(--red-50);
  color: var(--red-700);
  font-size: 0.82rem;
}

.login-card > .form-error {
  margin-top: 18px;
}

.login-footer {
  margin: 24px 0 0;
  color: var(--ink-500);
  font-size: 0.75rem;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  background: var(--ink-950);
  color: var(--paper);
}

.sidebar__nav {
  display: grid;
  gap: 5px;
  padding: 25px 14px;
}

.nav-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-300);
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 680;
  text-align: left;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.nav-link:hover {
  background: rgb(255 255 255 / 7%);
  color: var(--paper);
}

.nav-link--active {
  background: var(--paper);
  color: var(--ink-950);
}

.nav-link--active:hover {
  background: var(--paper);
  color: var(--ink-950);
}

.sidebar__footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 14px 20px;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.user-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 8px;
}

.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-600);
  color: var(--paper);
  font-size: 0.86rem;
  font-weight: 800;
}

.user-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.user-card__copy strong,
.user-card__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card__copy strong {
  font-size: 0.82rem;
}

.user-card__copy small {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 0.7rem;
}

.nav-link--logout {
  width: 100%;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 8px clamp(22px, 3vw, 46px);
  border-bottom: 1px solid var(--ink-200);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}

.topbar__brand {
  display: none;
}

.topbar__user {
  max-width: 260px;
  overflow: hidden;
  color: var(--ink-700);
  font-size: 0.82rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-600);
  font-size: 0.75rem;
}

.connection > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-600);
  box-shadow: 0 0 0 3px var(--green-100);
}

.connection--offline {
  color: var(--red-700);
}

.connection--offline > span {
  background: var(--red-600);
  box-shadow: 0 0 0 3px var(--red-100);
}

.main-content {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: clamp(24px, 3.2vw, 50px);
}

.bottom-nav {
  display: none;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.page-header h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.page-description {
  max-width: 680px;
  margin: 0;
  color: var(--ink-600);
}

.page-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.back-row {
  margin-bottom: 13px;
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--blue-700);
  font-size: 0.83rem;
  font-weight: 720;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  display: flex;
  min-height: 126px;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.stat-card__icon {
  display: inline-grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 12px;
}

.stat-card__icon--blue {
  background: var(--blue-100);
  color: var(--blue-700);
}

.stat-card__icon--green {
  background: var(--green-100);
  color: var(--green-700);
}

.stat-card__icon--navy {
  background: var(--ink-100);
  color: var(--ink-800);
}

.stat-card > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-card span {
  color: var(--ink-600);
  font-size: 0.78rem;
}

.stat-card strong {
  margin-top: 3px;
  font-size: 1.85rem;
  line-height: 1.15;
}

.stat-card--wide strong {
  font-size: 1rem;
}

.stat-card small {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.dashboard-grid,
.detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.panel--flush {
  overflow: hidden;
}

.panel__header {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 21px;
  border-bottom: 1px solid var(--ink-100);
}

.panel__header h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.panel__header .eyebrow {
  margin-bottom: 3px;
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 3px;
  color: var(--blue-700);
  font-size: 0.78rem;
  font-weight: 730;
}

.compact-list {
  display: grid;
}

.compact-row {
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 15px;
  padding: 13px 21px;
  border-bottom: 1px solid var(--ink-100);
  transition: background-color 140ms ease;
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-row:hover {
  background: var(--ink-50);
}

.compact-row > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.compact-row strong,
.compact-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row strong {
  font-size: 0.86rem;
}

.compact-row small {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 0.7rem;
}

.compact-row__amount {
  align-items: flex-end;
  text-align: right;
}

.toolbar {
  display: flex;
  min-height: 72px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 17px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.toolbar label {
  display: grid;
  min-width: min(100%, 260px);
  gap: 5px;
}

.toolbar label > span {
  color: var(--ink-600);
  font-size: 0.72rem;
  font-weight: 740;
}

.toolbar select {
  min-height: 42px;
}

.result-count {
  padding-bottom: 10px;
  color: var(--ink-500);
  font-size: 0.78rem;
}

.desktop-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.79rem;
}

th {
  height: 48px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--ink-200);
  background: var(--ink-50);
  color: var(--ink-600);
  font-size: 0.67rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  height: 67px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--ink-50);
}

.record-id {
  color: var(--ink-900);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.73rem;
  font-weight: 730;
}

.table-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.numeric {
  color: var(--ink-900);
  font-weight: 680;
}

.table-open {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue-700);
}

.table-open:hover {
  background: var(--blue-50);
}

.mobile-cards {
  display: none;
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.record-card__top,
.record-card__pair,
.record-card__open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.record-card__pair {
  justify-content: flex-start;
}

.record-card__amount {
  font-size: 1.32rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.record-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
}

.record-card dl > div {
  min-width: 0;
}

.record-card dt {
  color: var(--ink-500);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.record-card dd {
  overflow: hidden;
  margin: 3px 0 0;
  font-size: 0.79rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card__open {
  justify-content: flex-end;
  color: var(--blue-700);
  font-size: 0.76rem;
  font-weight: 740;
}

.direction {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.63rem;
  font-weight: 820;
  letter-spacing: 0.05em;
}

.direction--buy {
  background: var(--green-100);
  color: var(--green-700);
}

.direction--sell {
  background: var(--red-100);
  color: var(--red-700);
}

.badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 0.65rem;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.badge--active,
.badge--executed,
.badge--settlement-finished {
  background: var(--green-100);
  color: var(--green-700);
}

.badge--executing,
.badge--settlement-pending {
  background: var(--blue-100);
  color: var(--blue-700);
}

.badge--execution_unknown {
  background: var(--amber-100);
  color: var(--amber-700);
}

.badge--cancelled,
.badge--settlement-cancelled {
  background: var(--red-100);
  color: var(--red-700);
}

.pagination {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12px;
  border-top: 1px solid var(--ink-100);
  color: var(--ink-600);
  font-size: 0.76rem;
}

.state-panel,
.empty-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  padding: 36px;
  color: var(--ink-600);
  text-align: center;
}

.state-panel {
  gap: 13px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.state-panel p,
.empty-state p {
  max-width: 480px;
  margin: 0;
  font-size: 0.84rem;
}

.empty-state {
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 50%);
}

.empty-state h2 {
  margin: 12px 0 6px;
  font-size: 1.08rem;
}

.empty-state__icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
  padding: 15px 17px;
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.alert > div {
  min-width: 0;
  flex: 1;
}

.alert strong {
  display: block;
  font-size: 0.85rem;
}

.alert p {
  margin: 3px 0 0;
  font-size: 0.78rem;
}

.alert--error {
  border-color: var(--red-100);
  background: var(--red-50);
  color: var(--red-700);
}

.alert--success {
  border-color: var(--green-100);
  background: var(--green-50);
  color: var(--green-700);
}

.alert--warning {
  border-color: var(--amber-100);
  background: var(--amber-50);
  color: var(--amber-700);
}

.quote-hero,
.trade-hero {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--radius-md);
  background: var(--ink-900);
  color: var(--paper);
  box-shadow: var(--shadow-md);
}

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

.quote-hero h2,
.trade-hero h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
}

.quote-hero > div > p,
.trade-hero > div > span {
  margin: 10px 0 0;
  color: var(--ink-300);
  font-size: 0.83rem;
}

.quote-hero__amount,
.trade-hero__settlement {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.quote-hero__amount > span,
.trade-hero__settlement > span:first-child {
  color: var(--ink-400);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.quote-hero__amount strong {
  margin: 4px 0;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
}

.quote-hero__amount small,
.trade-hero__settlement small {
  margin-top: 6px;
  color: var(--ink-400);
  font-size: 0.7rem;
}

.trade-hero .eyebrow {
  color: #8ac2ff;
}

.trade-hero__settlement {
  gap: 8px;
}

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

.definition-grid > div {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
}

.definition-grid > div:nth-child(2n) {
  border-right: 0;
}

.definition-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.definition-grid__wide {
  grid-column: 1 / -1;
  border-right: 0 !important;
}

.definition-grid dt {
  color: var(--ink-500);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.definition-grid dd {
  overflow-wrap: anywhere;
  margin: 5px 0 0;
  color: var(--ink-900);
  font-size: 0.84rem;
  font-weight: 690;
}

.sticky-action-bar {
  position: sticky;
  z-index: 15;
  bottom: 18px;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, 760px);
  margin: 24px auto 0;
  padding: 13px 15px 13px 20px;
  border: 1px solid var(--ink-300);
  border-radius: 16px;
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.sticky-action-bar > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sticky-action-bar span {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-action-bar strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-action-bar__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(16 24 39 / 68%);
  backdrop-filter: blur(5px);
}

.modal {
  display: flex;
  width: min(100%, 670px);
  max-height: min(90vh, 850px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.modal--danger {
  border-top: 4px solid var(--red-600);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--ink-100);
}

.modal__header h2 {
  margin-bottom: 5px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.modal__header p:last-child {
  max-width: 540px;
  margin: 0;
  color: var(--ink-600);
  font-size: 0.8rem;
}

.modal__body {
  overflow-y: auto;
  padding: 22px 24px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--ink-100);
  background: var(--ink-50);
}

.confirmation-summary {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--ink-50);
}

.confirmation-summary strong {
  font-size: 1.2rem;
}

.confirmation-summary span {
  color: var(--ink-600);
  font-size: 0.83rem;
}

.execution-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--ink-50);
}

.execution-review > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px 15px;
  border-right: 1px solid var(--ink-200);
  border-bottom: 1px solid var(--ink-200);
}

.execution-review > div:nth-child(2n) {
  border-right: 0;
}

.execution-review > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.execution-review span {
  color: var(--ink-500);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.execution-review strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.form-grid .field:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.danger-note {
  display: flex;
  gap: 11px;
  margin-top: 18px;
  padding: 13px 14px;
  border-left: 3px solid var(--amber-700);
  background: var(--amber-50);
  color: var(--amber-700);
}

.danger-note p {
  margin: 0;
  font-size: 0.76rem;
}

.modal .form-error {
  margin-top: 16px;
}

.not-found,
.fatal-state,
.boot-screen {
  display: grid;
  min-height: 70vh;
  place-items: center;
  align-content: center;
  padding: 40px;
  text-align: center;
}

.not-found__code {
  color: var(--ink-300);
  font-size: clamp(5rem, 14vw, 10rem);
  font-weight: 850;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.not-found h1,
.fatal-state h1 {
  margin: 30px 0 8px;
}

.not-found p,
.fatal-state p {
  max-width: 520px;
  color: var(--ink-600);
}

.fatal-state .brand__mark,
.boot-screen .brand__mark {
  border-color: var(--ink-300);
}

.boot-screen {
  min-height: 100vh;
  gap: 20px;
}

.boot-screen .state-panel {
  min-height: 130px;
  border: 0;
  background: transparent;
}

.alert--info {
  border-color: var(--blue-100);
  background: var(--blue-50);
  color: var(--blue-700);
}

.muted {
  color: var(--ink-500);
  font-size: 0.76rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 14px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-size: 1.25rem;
}

.section-heading > span,
.section-heading__actions > span {
  display: inline-grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 0.75rem;
  font-weight: 800;
}

.section-heading__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-grid,
.config-grid,
.download-grid,
.user-grid,
.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.catalog-grid article {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--ink-50);
}

.catalog-grid h3 {
  margin: 0 0 8px;
  color: var(--ink-600);
  font-size: 0.69rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-grid p {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
}

.inline-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 13px;
}

.inline-editor input {
  min-width: 0;
}

.config-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-100);
}

.stacked-form {
  display: grid;
  gap: 18px;
}

.stacked-form textarea {
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-700);
  font-size: 0.84rem;
  font-weight: 700;
}

.check-field input {
  width: 19px;
  height: 19px;
  min-height: 0;
  flex: 0 0 19px;
  padding: 0;
}

.config-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
}

.config-card,
.download-card,
.user-panel,
.audit-card {
  min-width: 0;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.config-card {
  padding: 19px;
}

.config-card > header,
.user-panel > header,
.audit-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.config-card h3,
.user-panel h2,
.audit-card h2 {
  overflow-wrap: anywhere;
  margin: 0;
}

.config-card h3 {
  font-size: 1rem;
}

.config-unit {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 0.64rem;
  font-weight: 800;
}

.config-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm);
  background: var(--ink-100);
}

.config-summary > div {
  min-width: 0;
  padding: 11px;
  background: var(--ink-50);
}

.config-summary dt,
.key-values dt,
.user-panel dt,
.audit-card dt {
  color: var(--ink-500);
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.config-summary dd,
.key-values dd,
.user-panel dd,
.audit-card dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.config-card details {
  border-top: 1px solid var(--ink-100);
}

.config-card summary {
  padding: 12px 0;
  color: var(--blue-700);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 750;
}

.key-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.key-values > div,
.pair-list > div {
  min-width: 0;
  padding: 9px;
  border-radius: 7px;
  background: var(--ink-50);
}

.pair-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.pair-list > div {
  display: grid;
  gap: 3px;
}

.pair-list strong {
  font-size: 0.76rem;
}

.pair-list span,
.pair-list small,
.watched-pairs {
  overflow-wrap: anywhere;
  color: var(--ink-600);
  font-size: 0.7rem;
}

.watched-pairs {
  margin: 9px 0 12px;
}

.download-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.download-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px;
}

.download-card__icon {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--blue-700);
}

.download-card h2 {
  margin: 20px 0 7px;
}

.download-card p {
  flex: 1;
  margin: 0 0 22px;
  color: var(--ink-600);
  font-size: 0.82rem;
}

.download-control {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.download-error {
  max-width: 280px;
  color: var(--red-700);
  font-size: 0.68rem;
}

.user-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
}

.user-panel {
  padding: 19px;
}

.user-panel > header {
  justify-content: flex-start;
}

.user-panel > header > div {
  min-width: 0;
  flex: 1;
}

.user-panel h2 {
  font-size: 0.95rem;
}

.user-panel header p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.user-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
}

.user-status--active {
  background: var(--green-100);
  color: var(--green-700);
}

.user-status--inactive {
  background: var(--ink-100);
  color: var(--ink-600);
}

.user-panel > dl,
.audit-card dl {
  display: grid;
  gap: 10px;
  margin: 17px 0;
}

.user-panel > dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-panel footer {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-100);
}

.self-note {
  margin: 15px 0 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 0.72rem;
}

.audit-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.audit-card {
  padding: 18px;
}

.audit-card h2 {
  margin-top: 4px;
  font-size: 0.92rem;
  text-transform: capitalize;
}

.audit-card time {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.audit-card dl > div {
  min-width: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--ink-100);
}

.audit-card dl > div:last-child {
  border-bottom: 0;
}

@media (max-width: 1279px) and (min-width: 768px) {
  :root {
    --sidebar-width: 84px;
  }

  .brand {
    justify-content: center;
    padding-inline: 8px;
  }

  .brand__text,
  .nav-link span,
  .user-card__copy {
    display: none;
  }

  .sidebar__nav,
  .sidebar__footer {
    padding-inline: 12px;
  }

  .nav-link {
    justify-content: center;
    padding-inline: 8px;
  }

  .user-card {
    justify-content: center;
    padding-inline: 0;
  }

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

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

  .stat-card--wide {
    grid-column: 1 / -1;
  }

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

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

  .login-story {
    min-height: 330px;
    padding: 28px clamp(24px, 7vw, 64px);
  }

  .login-story__content {
    margin: 50px 0 38px;
  }

  .login-story__content h1 {
    font-size: clamp(2.25rem, 8vw, 4rem);
  }

  .security-note {
    margin-top: auto;
  }

  .login-panel {
    min-height: auto;
    padding-block: 48px;
  }

  .desktop-table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .panel--flush {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .panel--flush .pagination {
    margin-top: 8px;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    background: var(--paper);
  }
}

@media (max-width: 767px) {
  :root {
    --bottom-nav-height: 72px;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 58px;
    justify-content: space-between;
    padding: 7px 16px;
  }

  .topbar__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.83rem;
  }

  .topbar__user {
    display: none;
  }

  .connection {
    font-size: 0;
  }

  .connection::after {
    content: "Online";
    font-size: 0.7rem;
  }

  .connection--offline::after {
    content: "Offline";
  }

  .main-content {
    padding: 24px 15px;
  }

  .bottom-nav {
    position: fixed;
    z-index: 40;
    inset: auto 0 0;
    display: grid;
    min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ink-200);
    background: rgb(255 255 255 / 97%);
    box-shadow: 0 -10px 30px rgb(16 24 39 / 8%);
    backdrop-filter: blur(14px);
  }

  .bottom-nav .nav-link {
    min-height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 3px;
    color: var(--ink-500);
    font-size: 0.62rem;
  }

  .bottom-nav .nav-link--active {
    background: var(--blue-50);
    color: var(--blue-700);
  }

  .page-header {
    align-items: flex-start;
    margin-bottom: 21px;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .page-description {
    font-size: 0.83rem;
  }

  .page-actions .button span {
    display: none;
  }

  .page-actions .button {
    width: 46px;
    padding: 0;
  }

  .stats-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stat-card--wide {
    grid-column: auto;
  }

  .stat-card {
    min-height: 104px;
    padding: 17px;
  }

  .stat-card strong {
    font-size: 1.55rem;
  }

  .stat-card--wide strong {
    font-size: 0.93rem;
  }

  .panel__header {
    padding-inline: 17px;
  }

  .compact-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: 17px;
  }

  .compact-row > .badge {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }

  .toolbar {
    align-items: center;
  }

  .result-count {
    padding-bottom: 0;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 10px;
  }

  .pagination > span {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .quote-hero,
  .trade-hero {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-hero__amount,
  .trade-hero__settlement {
    align-items: flex-start;
    text-align: left;
  }

  .quote-hero__title {
    flex-wrap: wrap;
  }

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

  .definition-grid > div,
  .definition-grid > div:nth-child(2n),
  .definition-grid > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--ink-100);
  }

  .definition-grid > div:last-child {
    border-bottom: 0;
  }

  .sticky-action-bar {
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 10px);
    align-items: stretch;
    flex-direction: column;
    gap: 11px;
    padding: 13px;
  }

  .sticky-action-bar__actions,
  .sticky-action-bar__actions .button,
  .sticky-action-bar__actions .download-control,
  .sticky-action-bar > .button {
    width: 100%;
  }

  .sticky-action-bar__actions .button {
    flex: 1;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 96vh;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding-inline: 17px;
  }

  .modal__footer {
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
  }

  .modal__footer .button {
    min-width: 0;
    flex: 1;
  }

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

  .execution-review > div,
  .execution-review > div:nth-child(2n),
  .execution-review > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--ink-200);
  }

  .execution-review > div:last-child {
    border-bottom: 0;
  }

  .form-grid .field:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading__actions {
    align-items: flex-end;
    flex-direction: column;
  }

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

  .config-summary,
  .user-panel > dl {
    grid-template-columns: 1fr;
  }

  .user-panel footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .login-story {
    min-height: 290px;
  }

  .security-note {
    align-items: flex-start;
    font-size: 0.74rem;
  }

  .login-panel {
    padding: 28px 13px;
    background: var(--ink-50);
  }

  .login-card {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }

  .otp-inputs {
    gap: 6px;
  }

  .otp-inputs input {
    height: 52px;
    font-size: 1.3rem;
  }

  .login-secondary-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
  }

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

  .toolbar label {
    min-width: 0;
  }

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

  .modal__footer {
    flex-direction: column-reverse;
  }

  .sticky-action-bar__actions {
    flex-direction: column-reverse;
  }
}

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