:root {
  --paper: #f4f4f0;
  --paper-deep: #ecece7;
  --surface: rgba(255, 255, 253, 0.92);
  --surface-solid: #fffffd;
  --ink: #171714;
  --muted: #6f706a;
  --quiet: #979891;
  --line: rgba(23, 23, 20, 0.10);
  --line-strong: rgba(23, 23, 20, 0.18);
  --blue: #3158d4;
  --blue-soft: #e8edff;
  --green: #247a4b;
  --green-soft: #e6f3eb;
  --orange: #ad5b1e;
  --orange-soft: #f9eadc;
  --red: #a53f3f;
  --red-soft: #f7e7e6;
  --violet: #6950a1;
  --violet-soft: #eee9f7;
  --shadow: 0 22px 60px rgba(34, 34, 29, 0.07);
  --shadow-small: 0 8px 24px rgba(34, 34, 29, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 248px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% -5%, rgba(49, 88, 212, 0.08), transparent 28rem),
    var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid rgba(49, 88, 212, 0.34);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.boot {
  width: min(440px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: min(34vh, 280px);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-solid);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-small);
}

.boot-line {
  width: 100%;
  height: 13px;
  margin-top: 30px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.boot-line::after,
.skeleton::after {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.76), transparent);
  animation: shimmer 1.35s ease-in-out infinite;
  content: "";
}

.boot-line-short {
  width: 62%;
  margin-top: 12px;
}

@keyframes shimmer {
  from { transform: translateX(-110%); }
  to { transform: translateX(230%); }
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.auth-story {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 76px);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18), transparent 20rem),
    #1a1b19;
  color: #f8f8f3;
}

.auth-story .brand-mark {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.auth-headline {
  max-width: 780px;
  margin: 12vh 0 9vh;
  font-size: clamp(46px, 6vw, 92px);
  font-weight: 580;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.auth-footnote {
  max-width: 520px;
  margin: 0;
  color: rgba(248, 248, 243, 0.58);
  font-size: 15px;
  line-height: 1.7;
}

.auth-panel {
  display: flex;
  min-height: 100vh;
  align-items: center;
  padding: clamp(30px, 5vw, 72px);
}

.auth-panel-inner {
  width: min(100%, 400px);
  margin: auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-panel h1,
.page-title,
.customer-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 620;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-panel p {
  margin: 18px 0 30px;
  color: var(--muted);
  line-height: 1.7;
}

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.6;
}

.privacy-note::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease,
    opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: #292925;
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  transform: none;
  opacity: 0.42;
  cursor: not-allowed;
}

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

.button-primary:hover {
  background: #264bc0;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface-solid);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: #fafaf7;
}

.button-danger {
  border-color: rgba(165, 63, 63, 0.15);
  background: var(--red-soft);
  color: var(--red);
}

.button-danger-subtle {
  border-color: rgba(165, 63, 63, 0.16);
  background: transparent;
  color: var(--red);
}

.button-danger-subtle:hover {
  border-color: rgba(165, 63, 63, 0.28);
  background: var(--red-soft);
}

.button-quiet {
  min-height: 40px;
  padding-inline: 13px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-quiet:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.button-block {
  width: 100%;
}

.service-action {
  margin-top: 18px;
}

.service-note {
  margin: 9px 0 0;
  text-align: center;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(244, 244, 240, 0.88);
  backdrop-filter: blur(24px) saturate(130%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 7px 28px;
}

.sidebar-brand-text strong,
.sidebar-brand-text span {
  display: block;
}

.sidebar-brand-text strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.sidebar-brand-text span {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 11px;
}

.nav-label {
  margin: 16px 12px 8px;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.12em;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 253, 0.7);
  color: var(--ink);
}

.nav-item[aria-current="page"] {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow-small);
  font-weight: 640;
}

.nav-glyph {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 750;
  opacity: 0.66;
}

.sidebar-account {
  margin-top: auto;
  padding: 14px 8px 4px;
  border-top: 1px solid var(--line);
}

.account-name {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-role {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
}

.main-column {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 12;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 58px);
  border-bottom: 1px solid rgba(23, 23, 20, 0.06);
  background: rgba(244, 244, 240, 0.78);
  backdrop-filter: blur(22px) saturate(135%);
}

.topbar-title {
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -0.015em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--quiet);
  font-size: 12px;
}

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.freshness::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
  content: "";
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px) clamp(24px, 4vw, 58px) 90px;
}

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

.page-description {
  max-width: 600px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 15%, rgba(49, 88, 212, 0.14), transparent 18rem),
    var(--surface-solid);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  bottom: -120px;
  border: 1px solid rgba(49, 88, 212, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(49, 88, 212, 0.03),
    0 0 0 68px rgba(49, 88, 212, 0.02);
  content: "";
}

.hero-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 570;
  letter-spacing: -0.064em;
  line-height: 1;
}

.hero-number {
  color: var(--blue);
}

.hero-summary {
  position: relative;
  z-index: 1;
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.section {
  margin-top: 42px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.028em;
}

.section-note {
  color: var(--quiet);
  font-size: 12px;
}

.section-copy {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

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

.action-card {
  display: flex;
  min-height: 176px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-small);
}

.action-card-label {
  color: var(--muted);
  font-size: 13px;
}

.action-card-value {
  margin-top: 16px;
  font-size: 42px;
  font-weight: 590;
  letter-spacing: -0.055em;
  line-height: 1;
}

.action-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  color: var(--quiet);
  font-size: 12px;
}

.action-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink);
  font-size: 16px;
}

.metric-strip {
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 253, 0.56);
}

.compact-metrics {
  margin-top: 22px;
}

.metric {
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  color: var(--quiet);
  font-size: 11px;
}

.metric-value {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.search-wrap {
  position: relative;
  width: min(100%, 360px);
}

.search-input,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: rgba(255, 255, 253, 0.86);
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.search-input {
  padding: 0 16px 0 42px;
}

.search-wrap::before {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translateY(-58%);
  border: 1.5px solid var(--quiet);
  border-radius: 50%;
  content: "";
}

.search-wrap::after {
  position: absolute;
  left: 27px;
  top: 27px;
  width: 6px;
  height: 1.5px;
  transform: rotate(45deg);
  background: var(--quiet);
  content: "";
}

.search-input:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: rgba(49, 88, 212, 0.48);
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px rgba(49, 88, 212, 0.09);
}

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

.record {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(110px, 0.7fr)) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 253, 0.8);
  transition: border-color 150ms ease, background 150ms ease;
}

.record:hover {
  border-color: var(--line-strong);
  background: var(--surface-solid);
}

.record-main,
.record-cell {
  min-width: 0;
}

.record-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-subtitle,
.record-label {
  color: var(--quiet);
  font-size: 11px;
}

.record-subtitle {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-value {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.record-detail {
  grid-column: 1 / -1;
  padding-top: 2px;
  border-top: 1px solid transparent;
}

.record-detail[open] {
  margin-top: 4px;
  padding-top: 16px;
  border-top-color: var(--line);
}

.record-detail summary {
  width: fit-content;
  min-height: 44px;
  padding: 13px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 24px;
  padding: 2px 0 8px;
}

.record-detail-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.message-preview {
  white-space: pre-wrap;
}

.record-detail-grid .error-copy {
  color: var(--red);
}

.status {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-success { background: var(--green-soft); color: var(--green); }
.status-warning { background: var(--orange-soft); color: var(--orange); }
.status-danger { background: var(--red-soft); color: var(--red); }
.status-info { background: var(--blue-soft); color: var(--blue); }
.status-violet { background: var(--violet-soft); color: var(--violet); }

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 42px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state-inner {
  max-width: 420px;
}

.empty-orbit {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.empty-orbit::after {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--blue-soft);
  content: "";
}

.empty-state h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.loading-grid {
  display: grid;
  gap: 12px;
}

.skeleton {
  overflow: hidden;
  height: 86px;
  border-radius: 17px;
  background: var(--paper-deep);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-deep);
}

.workspace-tabs {
  margin-bottom: 26px;
}

.logistics-toolbar {
  margin-bottom: 26px;
}

.logistics-customer {
  width: min(440px, 100%);
}

.segment {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.segment[aria-selected="true"] {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(34, 34, 29, 0.07);
  font-weight: 650;
}

.form-card {
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: var(--shadow-small);
}

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

.binding-fields {
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

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

.check-field {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-deep);
  color: var(--ink);
  cursor: pointer;
}

.check-field input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.check-field span,
.check-field small {
  display: block;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.role-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
}

.role-card summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.role-card summary span {
  color: var(--quiet);
  font-size: 11px;
}

.role-card p {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.role-card code {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 11px;
}

.role-card p span {
  color: var(--muted);
  font-size: 11px;
}

.choice-field,
.mapping-field {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.choice-field legend,
.mapping-field legend {
  padding: 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.choice-grid label,
.option-list label {
  display: flex;
  min-height: 46px;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--paper-deep);
  cursor: pointer;
}

.choice-grid input,
.option-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--blue);
}

.choice-grid span,
.choice-grid small {
  display: block;
}

.choice-grid strong {
  font-size: 12px;
}

.choice-grid small {
  margin-top: 2px;
  color: var(--quiet);
  font-size: 10px;
}

.option-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
}

.option-picker summary {
  min-height: 48px;
  padding: 15px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.option-list {
  padding: 0 14px 14px;
}

.option-list > div {
  display: grid;
  max-height: 230px;
  gap: 5px;
  margin-top: 10px;
  overflow: auto;
}

.option-list label span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.tool-summary {
  overflow-wrap: anywhere;
}

.check-field strong {
  font-size: 13px;
}

.check-field small {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.5;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.field-input,
.field-select {
  padding: 0 14px;
}

.field-textarea {
  min-height: 110px;
  padding: 13px 14px;
  resize: vertical;
}

.field-help {
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.customer-shell {
  min-height: 100vh;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.customer-topbar {
  display: flex;
  width: min(760px, 100%);
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 20px;
}

.customer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 680;
}

.customer-main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.customer-hero {
  padding: 30px;
  border-radius: var(--radius-xl);
  background: #1b1c1a;
  color: #f8f8f3;
  box-shadow: var(--shadow);
}

.customer-hero .eyebrow {
  color: rgba(248, 248, 243, 0.5);
}

.customer-hero p {
  margin: 14px 0 0;
  color: rgba(248, 248, 243, 0.62);
  font-size: 13px;
  line-height: 1.7;
}

.context-switcher {
  width: 100%;
  min-height: 48px;
  margin-top: 20px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  outline: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.context-switcher option {
  color: var(--ink);
}

.customer-tabs {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin: 22px 0 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(244, 244, 240, 0.9);
  backdrop-filter: blur(20px);
}

.customer-tab {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.customer-tab[aria-selected="true"] {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-small);
  font-weight: 650;
}

.mobile-card-list {
  display: grid;
  gap: 12px;
}

.mobile-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-solid);
}

.mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mobile-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 670;
  letter-spacing: -0.025em;
}

.mobile-card-meta {
  margin-top: 5px;
  color: var(--quiet);
  font-size: 11px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.fact-label {
  display: block;
  color: var(--quiet);
  font-size: 10px;
}

.fact-value {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 0;
  margin-top: 18px;
}

.timeline-item {
  position: relative;
  padding: 0 0 18px 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.timeline-item::before {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  content: "";
}

.timeline-item::after {
  position: absolute;
  left: 5px;
  top: 15px;
  bottom: 0;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-time {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 10px;
}

.binding-intro {
  margin-bottom: 24px;
}

.binding-intro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.request-status-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.request-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 253, 0.64);
}

.dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(23, 23, 20, 0.12);
  border-radius: 24px;
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(20, 20, 18, 0.22);
}

.dialog-wide {
  width: min(760px, calc(100% - 32px));
}

.dialog::backdrop {
  background: rgba(20, 20, 18, 0.34);
  backdrop-filter: blur(8px);
}

.dialog-body {
  padding: 28px;
}

.dialog h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.dialog-copy {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100% - 32px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(26, 27, 25, 0.94);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.5;
  animation: toast-in 180ms ease-out both;
}

.toast-error {
  background: rgba(126, 42, 42, 0.96);
}

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

.bottom-nav {
  display: none;
}

.error-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.error-panel-inner {
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.error-panel h1 {
  margin: 22px 0 10px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.error-panel p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1040px) {
  :root { --sidebar: 218px; }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record { grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(110px, 0.8fr)) auto; }
  .record-cell-optional { display: none; }
}

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at 90% 0%, rgba(49, 88, 212, 0.07), transparent 18rem),
      var(--paper);
  }

  .auth-screen {
    display: block;
  }

  .auth-story {
    min-height: 46vh;
    padding: 28px 24px 34px;
  }

  .auth-headline {
    max-width: 560px;
    margin: 11vh 0 3vh;
    font-size: clamp(42px, 12vw, 68px);
  }

  .auth-footnote {
    display: none;
  }

  .auth-panel {
    min-height: 54vh;
    padding: 38px 24px calc(38px + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-column {
    display: block;
  }

  .topbar {
    min-height: 62px;
    padding: 0 18px;
  }

  .topbar-meta .account-name,
  .topbar-meta .freshness {
    display: none;
  }

  .page {
    padding: 28px 18px calc(108px + env(safe-area-inset-bottom));
  }

  .page-head {
    display: block;
    margin-bottom: 24px;
  }

  .page-head .button {
    width: 100%;
    margin-top: 18px;
  }

  .hero {
    min-height: 232px;
    padding: 28px 24px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .hero-summary {
    font-size: 13px;
  }

  .section {
    margin-top: 32px;
  }

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

  .action-card {
    min-height: 146px;
  }

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

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .record {
    display: block;
    padding: 18px;
  }

  .record-cell {
    display: inline-block;
    width: calc(50% - 6px);
    margin-top: 16px;
    padding-right: 10px;
    vertical-align: top;
  }

  .record-cell-optional {
    display: inline-block;
  }

  .record-actions {
    justify-content: flex-start;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

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

  .record-title,
  .record-subtitle,
  .record-value {
    white-space: normal;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-wrap {
    width: 100%;
  }

  .bottom-nav {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 4px;
    min-height: 66px;
    padding: 6px;
    border: 1px solid rgba(23, 23, 20, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 253, 0.9);
    box-shadow: 0 16px 50px rgba(34, 34, 29, 0.14);
    backdrop-filter: blur(24px) saturate(150%);
  }

  .bottom-nav-item {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--quiet);
    font-size: 10px;
  }

  .bottom-nav-item[aria-current="page"] {
    background: var(--paper-deep);
    color: var(--ink);
    font-weight: 680;
  }

  .bottom-nav-item .nav-glyph {
    width: 20px;
    height: 20px;
    border-radius: 6px;
  }

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

  .dialog-body {
    padding: 24px 20px;
  }

  .toast-region {
    right: 16px;
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .metric {
    padding: 18px 16px;
  }

  .metric-value {
    font-size: 19px;
  }

  .customer-main {
    padding-inline: 16px;
  }

  .customer-topbar {
    padding-inline: 16px;
  }

  .customer-hero {
    padding: 25px 22px;
  }

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

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

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

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