@charset "UTF-8";

/* Synapse product UI · proposed v0.1. Tokens load before this stylesheet. */

/* Base and accessible interaction */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-base);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

a {
  color: var(--color-ink);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
}

:where(button, a, select, summary, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-ink);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}

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

input::placeholder,
textarea::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

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

select {
  cursor: pointer;
}

input[dir="ltr"],
textarea[dir="ltr"] {
  text-align: left;
}

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

h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.6;
}

h2 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

button svg {
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

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

.mono {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-danger {
  color: var(--color-danger);
}

.text-success {
  color: var(--color-success);
}

.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;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 1000;
  padding: 12px 20px;
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-popover);
}

.skip-link:focus {
  top: 15px;
}

/* Global rail + contextual navigation + content. Geometry is always LTR. */
.app-body,
.app-shell {
  direction: ltr;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

.navigation-shell {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--navigation-width);
  height: 100dvh;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  direction: ltr;
}

.app-rail {
  display: flex;
  flex: 0 0 var(--rail-width);
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: var(--rail-width);
  padding: 22px 8px 17px;
  border-right: 1px solid var(--color-border);
  background: var(--color-rail);
  overflow-y: auto;
  scrollbar-width: thin;
}

.rail-brand {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 25px;
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-latin);
  font-size: 24px;
  font-weight: 700;
}

.rail-brand:hover {
  background: var(--color-primary-hover);
  color: var(--color-on-primary);
}

.rail-link {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 56px;
  min-height: 61px;
  padding: 10px 3px 8px;
  border-radius: 11px;
  color: var(--color-muted);
  transition: background var(--motion-fast), color var(--motion-fast);
}

.rail-link svg {
  width: 21px;
  height: 21px;
}

.rail-link:hover {
  background: var(--color-surface-soft);
  color: var(--color-ink);
}

.rail-link.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 3px 7px rgb(30 35 45 / 7%);
}

.rail-caption {
  font-family: var(--font-latin);
  font-size: 9px;
  font-weight: var(--weight-medium);
  line-height: 1.3;
  text-align: center;
}

.rail-spacer {
  flex: 1;
  min-height: 28px;
}

.context-sidebar {
  display: flex;
  flex: 0 0 var(--context-width);
  flex-direction: column;
  width: var(--context-width);
  min-width: 0;
  padding: 27px 18px 21px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  color: var(--color-ink);
  direction: ltr;
}

.brand-mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: var(--color-ink);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand strong {
  display: block;
  font-family: var(--font-latin);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.7px;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 9px;
  line-height: 1.7;
}

.workspace-switcher {
  margin-top: var(--space-8);
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.workspace-switcher label {
  display: block;
  margin-bottom: 5px;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.workspace-switcher select {
  min-height: 31px;
  padding: 4px 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  box-shadow: none;
}

.workspace-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-success);
}

.context-section-label,
.nav-label {
  margin: 29px 9px 7px;
  color: var(--color-muted);
  font-family: var(--font-latin);
  font-size: 9px;
  font-weight: var(--weight-medium);
  letter-spacing: 1px;
}

.context-heading {
  margin: 0 9px 17px;
  color: var(--color-ink);
  font-size: 16px;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.main-nav a,
.context-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 42px;
  padding: 10px 11px;
  border-radius: var(--radius-control);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.7;
  transition: background var(--motion-fast), color var(--motion-fast);
}

.main-nav svg {
  width: 17px;
  height: 17px;
}

.main-nav a > span:first-child {
  flex-shrink: 0;
}

.main-nav a:hover,
.context-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-ink);
}

.main-nav a.active,
.main-nav a[aria-current="page"],
.context-item.active {
  background: var(--color-surface-soft);
  color: var(--color-ink);
  font-weight: var(--weight-semibold);
}

.nav-caption {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: var(--weight-regular);
}

.context-caption {
  margin: 19px 10px 30px;
  color: var(--color-muted);
  font-size: 10px;
  line-height: 2;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.holding-symbol {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  font-family: var(--font-latin);
  font-size: 17px;
  font-weight: 700;
}

.sidebar-bottom strong {
  display: block;
  font-size: 9px;
  font-weight: var(--weight-semibold);
}

.sidebar-bottom small {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 9px;
}

.workspace-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: calc(100% - var(--navigation-width));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--navigation-width);
  direction: ltr;
}

/* Header and page framing */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  padding: 0 var(--content-padding);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.topbar-context,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.topbar-context {
  font-size: var(--text-sm);
}

.breadcrumb-root {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.breadcrumb-divider {
  color: var(--color-border-strong);
}

#breadcrumb {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex-shrink: 0;
  gap: var(--space-6);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-muted);
  font-size: 10px;
  white-space: nowrap;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--text-sm);
  list-style: none;
  cursor: pointer;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu summary > span:last-child svg {
  width: 13px;
  height: 13px;
  color: var(--color-muted);
}

.account-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: #eef0f2;
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

.account-popover {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 45;
  width: min(250px, calc(100vw - 32px));
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-popover);
}

.account-popover > p {
  padding: 8px 10px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.account-popover a,
.account-popover button {
  display: block;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text);
  direction: rtl;
  font-size: var(--text-sm);
  text-align: right;
}

.account-popover a:hover,
.account-popover button:hover {
  background: var(--color-surface-hover);
}

.account-popover button {
  color: var(--color-danger);
}

.main-content {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: var(--content-padding);
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

.page-heading > div:first-child {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.page-subtitle {
  margin-top: 7px;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 2;
}

.page-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 17px var(--content-padding);
  color: var(--color-muted);
  font-size: 10px;
}

/* Buttons, notices and reusable containers */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
  white-space: nowrap;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 2px 3px rgb(30 35 45 / 5%);
}

.button-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-on-primary);
}

.button-secondary {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.button-secondary:hover {
  border-color: #bec2c9;
  background: var(--color-surface-hover);
}

.button-quiet {
  background: transparent;
  color: var(--color-text);
}

.button-quiet:hover {
  background: var(--color-surface-soft);
}

.button-danger {
  background: var(--color-danger);
  color: var(--color-on-primary);
}

.button-danger:hover {
  background: var(--color-danger-hover);
}

.button-block {
  width: 100%;
  min-height: 48px;
  padding: 13px;
  font-size: var(--text-base);
}

.button-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: var(--text-xs);
}

.icon-button {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-muted);
}

.icon-button:hover {
  background: var(--color-surface-soft);
  color: var(--color-ink);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.mobile-menu {
  display: none;
}

.notice {
  margin-bottom: var(--space-4);
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  line-height: var(--line-relaxed);
  overflow-wrap: anywhere;
}

.notice-error {
  border-color: var(--color-danger-border);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.notice-success {
  border-color: var(--color-success-border);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.notice-info {
  border-color: var(--color-info-border);
  background: var(--color-info-soft);
  color: var(--color-info);
}

.notice-warning {
  border-color: var(--color-warning-border);
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.notice button {
  margin-inline-start: 10px;
}

.notice a {
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border);
}

.panel-head h2 {
  font-size: var(--text-base);
}

.panel-head p {
  margin-top: 5px;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.panel-body {
  padding: var(--space-6);
}

/* Dashboard: real metrics and restrained, informative status accents */
.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  padding: 26px 30px;
  border: 1px solid #e4e7ea;
  border-radius: var(--radius-card);
  background: linear-gradient(110deg, #eef0f1, #f4f5f5 66%, #f1f3f2);
  overflow: hidden;
}

.welcome-panel > div:first-child {
  min-width: 0;
}

.welcome-panel h2 {
  color: var(--color-ink);
  font-size: 22px;
  font-weight: var(--weight-semibold);
}

.welcome-panel p {
  margin-top: 9px;
  color: #666d76;
  font-size: var(--text-sm);
  line-height: 2;
}

.welcome-art {
  position: relative;
  flex-shrink: 0;
  width: 104px;
  height: 84px;
}

.welcome-art span {
  position: absolute;
  top: 4px;
  left: 13px;
  width: 61px;
  height: 61px;
  border: 1px solid #d8dde2;
  border-radius: 16px;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 8px 18px rgb(30 35 45 / 3%);
  transform: rotate(-12deg);
}

.welcome-art span:nth-child(2) {
  display: grid;
  place-items: center;
  top: 15px;
  left: 29px;
  border-color: #bdc7d1;
  background: #d9e0e5;
  color: #566675;
  transform: rotate(9deg);
}

.welcome-art svg {
  width: 27px;
  height: 27px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.stat-label {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.stat-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #eef0f5;
  color: #747c92;
}

.stat-card:nth-child(2) .stat-icon {
  background: #edf4ed;
  color: #709073;
}

.stat-card:nth-child(3) .stat-icon {
  background: #faf1e4;
  color: #9b835f;
}

.stat-card:nth-child(4) .stat-icon {
  background: #ecf1f6;
  color: #718da7;
}

.stat-value {
  margin-top: 18px;
  font-size: 32px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.stat-caption {
  margin-top: 7px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 1.8;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-5);
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 17px 0;
  border-bottom: 1px solid var(--color-border);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-symbol {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--color-surface-soft);
  color: #7b858d;
}

.activity-symbol svg {
  width: 15px;
  height: 15px;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-summary {
  color: var(--color-text);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.activity-time {
  max-width: 135px;
  color: var(--color-muted);
  font-size: 10px;
  text-align: right;
}

.category-row {
  margin-bottom: 22px;
}

.category-row:last-child {
  margin-bottom: 0;
}

.category-row-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 9px;
  font-size: var(--text-sm);
}

.category-row-head span:last-child {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.category-progress {
  display: block;
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: var(--radius-pill);
  appearance: none;
  overflow: hidden;
}

.category-progress::-webkit-progress-bar {
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
}

.category-progress::-webkit-progress-value {
  border-radius: var(--radius-pill);
  background: #b3c1ca;
}

.category-progress::-moz-progress-bar {
  border-radius: var(--radius-pill);
  background: #b3c1ca;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  padding: var(--space-8);
  text-align: center;
}

.empty-state.compact {
  min-height: 180px;
  padding: var(--space-6);
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #f6f7f8;
  color: #8a939e;
}

.empty-state-icon svg {
  width: 25px;
  height: 25px;
}

.empty-state h3 {
  font-size: var(--text-base);
}

.empty-state p {
  max-width: 400px;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 2;
}

.empty-state .button {
  margin-top: var(--space-2);
}

.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 280px;
  padding: var(--space-5);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.button-primary .spinner {
  border-color: rgb(255 255 255 / 30%);
  border-top-color: white;
}

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

/* Trade Board and users: horizontal overflow stays inside the table. */
.trade-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: 17px 19px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.search-field {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}

.search-field input {
  padding-left: 39px;
  border-color: var(--color-border);
  background: #fafbfc;
  font-size: var(--text-sm);
}

.search-field > span {
  position: absolute;
  top: 13px;
  left: 13px;
  color: var(--color-muted);
  pointer-events: none;
}

.search-field svg {
  width: 17px;
  height: 17px;
}

.toolbar-select {
  width: 168px;
  font-size: var(--text-sm);
}

.toolbar-count {
  margin-left: auto;
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.tradeboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  min-width: 0;
}

.tradeboard-grid.has-detail {
  grid-template-columns: minmax(0, 1fr) 290px;
}

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

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  direction: ltr;
  font-size: var(--text-sm);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  padding: 15px 16px;
  border-bottom: 1px solid var(--color-border);
  background: #fbfcfc;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: start;
}

.data-table td {
  padding: 17px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.data-table tbody tr {
  transition: background var(--motion-fast);
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table tbody tr.is-selected {
  background: #f0f3f5;
}

.data-table .product-name-cell {
  min-width: 170px;
  max-width: 230px;
  white-space: normal;
}

.row-number {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.product-name-button {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.8;
  text-align: start;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
}

.product-name-button:hover {
  color: var(--color-accent);
}

.product-model {
  display: block;
  max-width: 230px;
  margin-top: 4px;
  direction: ltr;
  color: var(--color-muted);
  font-size: 10px;
  text-align: left;
  overflow-wrap: anywhere;
}

.sku-tag {
  display: block;
  direction: ltr;
  color: var(--color-muted);
  font-family: var(--font-latin);
  font-size: 10px;
  unicode-bidi: isolate;
}

.brand-chip {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 10px;
  font-weight: var(--weight-medium);
}

.money {
  display: block;
  direction: ltr;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.money.cost {
  color: var(--color-muted);
  font-weight: var(--weight-regular);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-surface-soft);
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.6;
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge-violet {
  background: var(--color-info-soft);
  color: var(--color-info);
}

.badge-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.row-actions,
.users-actions {
  display: flex;
  gap: 5px;
}

.row-actions .icon-button {
  width: 31px;
  height: 31px;
  border-color: transparent;
  background: transparent;
}

.row-actions .icon-button:hover {
  background: var(--color-surface-soft);
}

.row-actions svg {
  width: 15px;
  height: 15px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pagination .icon-button {
  width: 32px;
  height: 32px;
}

.detail-panel {
  position: sticky;
  top: var(--space-5);
  align-self: start;
  min-width: 0;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 17px 19px;
  border-bottom: 1px solid var(--color-border);
}

.detail-header h2 {
  font-size: var(--text-sm);
}

.detail-content {
  padding: var(--space-5);
}

.product-identity {
  display: grid;
  place-items: center;
  height: 96px;
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(130deg, #f2f4f5, #fafbfc);
  color: #a4afb7;
}

.product-identity svg {
  width: 38px;
  height: 38px;
}

.detail-content h3 {
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}

.detail-category {
  margin: 6px 0 18px;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.detail-section {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--color-border);
}

.detail-section h4 {
  margin: 0 0 13px;
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 9px;
  font-size: var(--text-xs);
}

.detail-row > span:first-child {
  flex-shrink: 0;
  color: var(--color-muted);
}

.detail-row > span:last-child {
  min-width: 0;
  text-align: end;
  white-space: pre-wrap;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
}

.detail-notes {
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  gap: 7px;
  margin-top: var(--space-5);
}

.detail-actions .button {
  flex: 1;
}

.detail-updated {
  margin-top: var(--space-4);
  color: var(--color-muted);
  font-size: 10px;
}

.user-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.user-toolbar .search-field {
  max-width: 350px;
  margin-left: auto;
}

.user-status-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #f0f1f3;
}

.user-status-tabs button {
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.user-status-tabs button.is-active {
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-identity .avatar {
  width: 34px;
  height: 34px;
  font-size: var(--text-sm);
}

.user-identity strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.user-identity small {
  display: block;
  margin-top: 3px;
  direction: ltr;
  color: var(--color-muted);
  font-size: 10px;
  text-align: left;
}

.membership-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 270px;
}

.users-actions {
  flex-wrap: wrap;
  max-width: 280px;
}

.users-actions .button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 10px;
}

/* Dialogs: product editing opens on the right; text direction stays local. */
.drawer-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--drawer-width);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-ink);
  direction: ltr;
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

.drawer-dialog[open] {
  display: flex;
  flex-direction: column;
}

.drawer-dialog::backdrop,
.action-dialog::backdrop {
  background: rgb(32 38 45 / 36%);
  backdrop-filter: blur(3px);
}

.dialog-body {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.drawer-dialog .dialog-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dialog-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 24px 28px;
  border-bottom: 1px solid var(--color-border);
  direction: ltr;
}

.dialog-head > div {
  min-width: 0;
}

.dialog-head h2 {
  font-size: var(--text-lg);
  overflow-wrap: anywhere;
}

.dialog-head p {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.product-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.form-scroll {
  flex: 1;
  min-height: 0;
  padding: 26px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.form-section {
  margin-bottom: var(--space-8);
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.form-section-title > span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface-soft);
  color: var(--color-text);
  font-size: 10px;
}

.form-section-caption {
  margin: -6px 0 16px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 2;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.full-width {
  grid-column: 1 / -1;
}

.field label {
  color: var(--color-text);
  font-size: var(--text-xs);
  line-height: 1.9;
  unicode-bidi: plaintext;
}

.field input,
.field select,
.field textarea {
  font-size: var(--text-sm);
}

.field input:not([dir]),
.field textarea:not([dir]) {
  unicode-bidi: plaintext;
}

.required-mark {
  margin-inline-start: 3px;
  color: var(--color-danger);
}

.field-help {
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.9;
}

.field-error {
  color: var(--color-danger);
  font-size: var(--text-xs);
  line-height: 1.9;
}

.field [aria-invalid="true"] {
  border-color: var(--color-danger);
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  direction: ltr;
}

.stock-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fafbfc;
}

.stock-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  unicode-bidi: plaintext;
}

.stock-field input {
  min-height: 38px;
  padding: 6px;
  background: var(--color-surface);
  font-size: var(--text-base);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.stock-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 15px 3px 0;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.stock-total strong {
  color: var(--color-ink);
  font-size: var(--text-md);
}

.attribute-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 32px;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 10px;
  direction: ltr;
}

.attribute-row input {
  font-size: var(--text-sm);
}

.attribute-row .icon-button {
  width: 32px;
  height: 34px;
  border-color: transparent;
}

.attributes-empty {
  margin-bottom: var(--space-3);
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 2;
}

.dialog-footer {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 9px;
  padding: 18px 28px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  direction: ltr;
}

.dialog-footer .button-primary {
  min-width: 125px;
}

.action-dialog {
  width: 470px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-ink);
  direction: ltr;
  box-shadow: var(--shadow-dialog);
  overflow-y: auto;
}

.action-dialog .dialog-head {
  padding: 21px 24px;
}

.action-dialog .dialog-head h2 {
  font-size: 16px;
}

.action-content {
  padding: 23px 24px;
}

.action-content > p {
  margin-bottom: 18px;
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 2;
}

.action-content .field {
  margin-bottom: 15px;
}

.action-dialog .dialog-footer {
  padding: 17px 24px;
}

.reset-link-input {
  direction: ltr;
  background: #fafbfc;
  font-size: var(--text-xs) !important;
  text-align: left;
}

.reset-link-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.reset-expiry {
  margin-top: 14px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 2;
}

.toast-region {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 360px;
  max-width: calc(100vw - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-popover);
  font-size: var(--text-sm);
}

.toast > span:first-child {
  flex-shrink: 0;
  color: var(--color-success);
}

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

.toast.error > span:first-child {
  color: var(--color-danger);
}

.toast-text {
  flex: 1;
  min-width: 0;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
}

.toast .icon-button {
  width: 23px;
  height: 23px;
  border: 0;
}

.toast svg {
  width: 17px;
  height: 17px;
}

/* Authentication: warm neutral surfaces and graphite emphasis. */
.auth-body {
  min-height: 100vh;
  background: var(--color-surface);
  direction: ltr;
}

.auth-layout {
  display: grid;
  grid-template-columns: 46% 54%;
  min-height: 100vh;
  direction: ltr;
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 46px 60px 33px;
  border-right: 1px solid #e5e7e8;
  background: linear-gradient(140deg, #f2f3f2, #e9edec);
  color: var(--color-ink);
  overflow: hidden;
}

.brand-inverse,
.brand-inverse:hover {
  color: var(--color-ink);
}

.brand-inverse .brand-mark {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.brand-inverse small {
  color: var(--color-muted);
}

.auth-story-content {
  margin: auto 0;
  padding: var(--space-16) 0;
  direction: rtl;
  text-align: right;
}

.auth-kicker {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.auth-story h2 {
  margin: 16px 0 20px;
  font-size: var(--text-display);
  font-weight: var(--weight-semibold);
  line-height: 1.7;
}

.auth-story-content > p {
  max-width: 390px;
  color: var(--color-muted);
  font-size: var(--text-base);
  line-height: 2.3;
}

.auth-story-footer {
  color: var(--color-muted);
  font-family: var(--font-latin);
  font-size: var(--text-xs);
  letter-spacing: 0.5px;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 50px 36px;
}

.auth-card {
  width: 100%;
  max-width: 390px;
  direction: rtl;
}

.auth-overline {
  margin-bottom: 20px;
  direction: ltr;
  color: var(--color-muted);
  font-family: var(--font-latin);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-align: right;
}

.auth-card h1 {
  font-size: 28px;
}

.auth-subtitle {
  margin: 10px 0 26px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 2.2;
}

.auth-form {
  margin-top: 27px;
}

.auth-form p {
  margin-bottom: 19px;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text);
  font-size: var(--text-sm);
}

.auth-form input {
  min-height: 47px;
  padding: 12px 14px;
  background: #fdfdfd;
  font-size: 13px;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  direction: ltr;
  text-align: left;
}

.auth-form input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-left: 7px;
  accent-color: var(--color-primary);
}

.auth-form input[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.auth-form ul.errorlist {
  margin: 10px 0;
  padding: 11px 13px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-control);
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-size: var(--text-sm);
  list-style: none;
}

.auth-form .helptext {
  display: block;
  margin-top: 7px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 1.9;
}

.auth-form .helptext ul {
  margin: 5px 0 9px;
  padding-right: 18px;
}

.auth-form .button {
  justify-content: space-between;
  margin-top: 9px;
}

.auth-links {
  margin-top: var(--space-6);
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 2.1;
  text-align: center;
}

.auth-links p {
  margin-top: 14px;
}

.auth-links a {
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.auth-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-footnote {
  margin-top: 33px;
  padding-top: 23px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--text-xs);
  line-height: 2;
  text-align: center;
}

.auth-illustration {
  position: relative;
  max-width: 315px;
  margin-top: 45px;
  padding: 21px;
  border: 1px solid #dce1e0;
  border-radius: 18px;
  background: linear-gradient(130deg, rgb(255 255 255 / 75%), rgb(255 255 255 / 40%));
  box-shadow: 0 14px 40px rgb(60 70 67 / 5%);
  transform: rotate(-3deg);
}

.illustration-line {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  border-bottom: 1px solid #e7eae9;
}

.illustration-line:last-of-type {
  border-bottom: 0;
}

.illustration-line span {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #dfe5e2;
}

.illustration-line i {
  display: block;
  width: 80px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: #d9dfdc;
}

.illustration-line i + i {
  width: 35px;
  background: #c9d5d0;
}

.illustration-node {
  position: absolute;
  right: -14px;
  bottom: -15px;
  display: grid;
  place-items: center;
  width: 57px;
  height: 57px;
  border: 1px solid var(--color-primary);
  border-radius: 16px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-latin);
  font-size: 29px;
  font-weight: 700;
  transform: rotate(9deg);
}

/* Reviewable design system examples, all driven by the same CSS tokens. */
.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  min-width: 0;
}

.design-card {
  min-width: 0;
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.design-palette {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.design-palette .design-swatch {
  margin-bottom: 0;
}

.design-card h2,
.design-card h3 {
  margin-bottom: var(--space-4);
}

.design-note {
  margin-bottom: var(--space-6);
  padding: 18px 21px;
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-md);
  background: var(--color-info-soft);
  color: var(--color-info);
  font-size: var(--text-sm);
  line-height: 2.1;
}

.design-swatch {
  min-width: 0;
  margin-bottom: var(--space-3);
  padding: 13px 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  font-size: var(--text-sm);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.design-swatch:last-child {
  margin-bottom: 0;
}

.design-swatch strong,
.design-swatch small {
  display: block;
}

.design-swatch small {
  margin-top: 4px;
  color: inherit;
  font-family: var(--font-latin);
  font-size: var(--text-xs);
}

.swatch-color {
  display: block;
  height: 16px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-sm);
  background: inherit;
}

.swatch-ink {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.swatch-canvas {
  background: var(--color-canvas);
}

.swatch-surface {
  background: var(--color-surface);
}

.swatch-border {
  background: var(--color-border);
}

.swatch-success {
  border-color: var(--color-success-border);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.swatch-warning {
  border-color: var(--color-warning-border);
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.swatch-info,
.swatch-accent {
  border-color: var(--color-info-border);
  background: var(--color-info-soft);
  color: var(--color-info);
}

.type-specimen {
  margin-bottom: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-base);
  line-height: 2;
  overflow-wrap: anywhere;
}

.type-specimen:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.type-display {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1.65;
}

.type-heading {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

.type-body {
  font-size: var(--text-base);
}

.type-caption {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

/* Responsive layout: keep three regions at desktop, use one left drawer on tablets. */
@media (min-width: 1500px) {
  :root {
    --content-padding: 44px;
  }

  .tradeboard-grid.has-detail {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .stat-card {
    padding: 24px;
  }
}

@media (max-width: 1250px) {
  :root {
    --content-padding: 28px;
  }

  .topbar-actions {
    gap: 14px;
  }

  .connection-status {
    display: none;
  }

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

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

  .tradeboard-grid.has-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
  }

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

  .detail-content > .product-identity {
    display: none;
  }

  .detail-content > h3,
  .detail-content > .detail-category,
  .detail-content > .detail-actions,
  .detail-content > .detail-updated {
    grid-column: 1 / -1;
  }

  .trade-toolbar .search-field {
    flex-basis: 100%;
  }

  .toolbar-select {
    flex: 1 1 150px;
    width: auto;
  }

  .user-toolbar .search-field {
    max-width: none;
  }

  .auth-story {
    padding: 36px 40px;
  }

  .auth-story h2 {
    font-size: 36px;
  }
}

@media (max-width: 1000px) {
  :root {
    --content-padding: 26px;
    --topbar-height: 72px;
  }

  .navigation-shell {
    width: min(var(--navigation-width), calc(100vw - 44px));
    transform: translateX(-100%);
    transition: transform var(--motion-base);
  }

  .navigation-shell.is-open {
    transform: translateX(0);
  }

  .navigation-shell .context-sidebar {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgb(32 38 45 / 40%);
  }

  .workspace-main {
    width: 100%;
    margin-left: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .page-heading {
    gap: var(--space-4);
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }

  .panel-head,
  .panel-body {
    padding: var(--space-5);
  }

  .panel-head {
    align-items: flex-start;
  }

  .activity-time {
    max-width: 90px;
  }

  .auth-layout {
    grid-template-columns: 43% 57%;
  }

  .auth-story {
    padding: 32px;
  }

  .auth-story h2 {
    font-size: 32px;
  }

  .auth-story-content > p {
    font-size: var(--text-sm);
  }

  .auth-illustration {
    max-width: 240px;
  }
}

@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-heading {
    align-items: flex-start;
  }

  .page-actions {
    padding-top: 9px;
  }

  .account-name {
    display: none;
  }

  .user-toolbar .search-field {
    flex-basis: 100%;
    width: 100%;
  }

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

@media (max-width: 600px) {
  :root {
    --content-padding: 17px;
    --topbar-height: 66px;
    --text-2xl: 26px;
  }

  html,
  body {
    min-width: 320px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar-context {
    gap: 9px;
    font-size: var(--text-xs);
  }

  .breadcrumb-root {
    display: none;
  }

  .breadcrumb-divider {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .main-content {
    padding-top: var(--space-6);
  }

  .page-heading {
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: var(--space-6);
  }

  .page-heading h1 {
    font-size: 26px;
  }

  .page-actions {
    padding-top: 0;
  }

  .page-subtitle {
    font-size: var(--text-xs);
  }

  .welcome-panel {
    gap: 8px;
    padding: 22px 20px;
  }

  .welcome-panel h2 {
    font-size: var(--text-lg);
  }

  .welcome-panel p {
    font-size: var(--text-xs);
  }

  .welcome-art {
    display: none;
  }

  .stats-grid {
    gap: var(--space-3);
    margin-bottom: var(--space-5);
  }

  .stat-card {
    padding: 16px 14px;
  }

  .stat-top {
    align-items: flex-start;
    gap: 6px;
  }

  .stat-label {
    font-size: var(--text-xs);
    line-height: 1.9;
  }

  .stat-value {
    margin-top: 15px;
    font-size: 27px;
  }

  .stat-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-caption {
    font-size: 10px;
  }

  .panel-head,
  .panel-body {
    padding: 18px;
  }

  .activity-item {
    gap: 10px;
  }

  .activity-time {
    max-width: 70px;
    font-size: 9px;
  }

  .activity-summary {
    font-size: var(--text-xs);
  }

  .trade-toolbar {
    gap: 9px;
    padding: 13px;
  }

  .toolbar-select {
    flex: 1 1 calc(50% - 5px);
    width: calc(50% - 5px);
    min-width: 0;
    font-size: var(--text-xs);
  }

  .toolbar-count {
    width: 100%;
    margin-left: 0;
    padding: 4px 2px 0;
  }

  .data-table th,
  .data-table td {
    padding: 14px 12px;
  }

  .data-table .product-name-cell {
    min-width: 155px;
  }

  .pagination {
    gap: 8px;
    padding: 14px 12px;
    font-size: 10px;
  }

  .pagination-actions {
    gap: 7px;
  }

  .detail-content {
    display: block;
  }

  .drawer-dialog {
    width: 100%;
    border: 0;
  }

  .dialog-head {
    padding: 21px 20px;
  }

  .form-scroll {
    padding: 23px 20px;
  }

  .form-grid {
    gap: 14px;
  }

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

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

  .attribute-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px;
    gap: 6px;
  }

  .attribute-row input {
    padding: 10px 8px;
    font-size: var(--text-xs);
  }

  .attribute-row .icon-button {
    width: 28px;
  }

  .dialog-footer {
    padding: 17px 20px;
  }

  .user-status-tabs {
    width: 100%;
  }

  .user-status-tabs button {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    font-size: 10px;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }

  .auth-layout {
    display: block;
  }

  .auth-story {
    min-height: 96px;
    padding: 25px;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
    background: #f2f4f3;
  }

  .auth-story .brand {
    margin: auto;
  }

  .auth-story .brand small,
  .auth-story-content,
  .auth-story-footer {
    display: none;
  }

  .auth-form-panel {
    padding: 38px 26px;
  }

  .auth-card h1 {
    font-size: 26px;
  }

  .auth-overline {
    margin-bottom: 15px;
  }

  .auth-form {
    margin-top: 23px;
  }

  .auth-footnote {
    margin-top: 26px;
  }

  .design-card {
    padding: var(--space-5);
  }

  .design-note {
    padding: 16px 18px;
  }
}

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