:root {
  --ink: #172330;
  --ink-soft: #3d4a57;
  --muted: #71808d;
  --line: #dce5eb;
  --line-strong: #c9d5de;
  --page: #edf3f6;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --brand: #0e9bd3;
  --brand-deep: #087bb4;
  --brand-pale: #e5f5fb;
  --amber: #f2a317;
  --amber-pale: #fff4dd;
  --green: #1b9b76;
  --green-pale: #e4f6ef;
  --red: #c7565b;
  --red-pale: #fff0f1;
  --shadow: 0 18px 42px rgba(28, 53, 72, 0.11);
  --shadow-soft: 0 8px 20px rgba(28, 53, 72, 0.07);
  --radius: 8px;
}

/* Production desktop override. Kept last so the complete approved preview wins. */
@media (min-width: 761px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    grid-template-rows: auto auto auto auto !important;
    align-content: start;
    gap: 14px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand {
    justify-self: center;
    flex-direction: column;
    gap: 9px;
    min-width: 220px;
    text-align: center;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-mark {
    width: 110px;
    height: 110px;
    position: relative;
    border-radius: 50%;
    border: 0;
    background: #fff;
    font-size: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.28);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-mark::before {
    content: "单号\A查询";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre;
    color: #111;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 2px;
    text-indent: 2px;
    text-align: center;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy {
    justify-items: center;
    gap: 1px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy strong {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.15;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy small {
    font-size: 13px;
    line-height: 1.25;
  }
}

/* Desktop result page: keep the area below the last logistics row white. */
@media (min-width: 761px) {
  body.public-shell .public-view.has-results {
    background: #fff;
  }
}

/* Preview desktop layout promoted to an external stylesheet for production CSP. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history {
  grid-row: auto !important;
  width: min(880px, 100%);
  align-self: start;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
  grid-row: auto !important;
}

@media (max-width: 760px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history,
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
    width: 100%;
  }
}

@media (min-width: 761px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    grid-template-rows: auto auto auto auto !important;
    align-content: start;
    gap: 14px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand {
    justify-self: center;
    flex-direction: column;
    gap: 9px;
    min-width: 220px;
    text-align: center;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-mark {
    width: 110px;
    height: 110px;
    position: relative;
    border-radius: 50%;
    border: 0;
    background: #fff;
    font-size: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.28);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-mark::before {
    content: "单号\A查询";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre;
    color: #111;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 2px;
    text-indent: 2px;
    text-align: center;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy {
    justify-items: center;
    gap: 1px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy strong {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.15;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy small {
    font-size: 13px;
    line-height: 1.25;
  }
}


* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}

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

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(14, 155, 211, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  width: min(1160px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.brand {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-align: left;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.09);
  font-size: 19px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 0;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.2;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.admin-topbar-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.admin-topbar-title h1,
.admin-topbar-title p {
  margin: 0;
  white-space: nowrap;
}

.admin-topbar-title h1 {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.admin-topbar-title p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.view-switch {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.nav-tab,
.mode-button {
  appearance: none;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.nav-tab {
  min-height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.nav-tab svg,
.primary-button svg,
.secondary-button svg,
.icon-button svg,
.meta-safe svg,
.empty-icon svg,
.admin-note svg,
.search-field svg,
.heading-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.nav-tab.active {
  color: var(--brand-deep);
  background: #fff;
  box-shadow: 0 2px 6px rgba(35, 70, 91, 0.08);
}

.query-hero {
  background: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.hero-inner {
  width: min(1160px, calc(100% - 40px));
  min-height: 296px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: 60px;
  padding: 52px 0 50px;
}

.hero-copy {
  color: #fff;
}

.hero-emblem {
  width: 112px;
  height: 112px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 18px rgba(0, 77, 112, 0.22);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.eyebrow,
.section-kicker {
  display: block;
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.hero-copy h1 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  font-weight: 800;
}

.hero-copy p {
  max-width: 360px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
}

.query-box {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px;
  border-radius: 7px;
  background: #eef3f6;
}

.mode-button {
  min-width: 70px;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
}

.mode-button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 7px rgba(35, 70, 91, 0.12);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.input-row input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.input-row input::placeholder {
  color: #9aa6af;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  color: #fff;
  background: var(--amber);
  box-shadow: 0 5px 0 #cf850a;
}

.primary-button:hover {
  background: #f7ad25;
  transform: translateY(-1px);
  box-shadow: 0 6px 0 #cf850a;
}

.primary-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #cf850a;
}

.secondary-button {
  color: var(--brand-deep);
  border-color: #b8dce9;
  background: var(--brand-pale);
}

.secondary-button:hover {
  background: #d8f0f8;
}

.query-button {
  min-width: 112px;
  min-height: 50px;
  font-size: 16px;
}

.query-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.meta-safe {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
}

.content-wrap,
.admin-wrap {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.content-wrap {
  padding: 30px 0 62px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.overview-item {
  min-height: 96px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
}

.overview-item + .overview-item {
  border-left: 1px solid var(--line);
}

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

.overview-item strong {
  grid-row: 2;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.overview-unit {
  grid-row: 2;
  align-self: end;
  padding-bottom: 1px;
  color: var(--muted);
  font-size: 12px;
}

.panel-line {
  margin-top: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-heading,
.tool-heading,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compact-heading {
  justify-content: flex-start;
}

.section-heading h2,
.tool-heading h2,
.modal-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
}

.heading-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.heading-icon.amber {
  color: #a56800;
  background: var(--amber-pale);
}

.heading-icon.teal {
  color: #087d75;
  background: #e2f6f4;
}

.heading-date,
.tool-heading-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.announcement-copy {
  margin: 15px 0 0 50px;
  color: var(--ink-soft);
  font-size: 14px;
}

.date-index {
  margin-top: 18px;
}

.date-index .compact-heading {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.date-index-toggle {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.date-index-toggle:hover {
  color: var(--brand-deep);
}

.date-index-toggle-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #9ca8af;
  transition: transform 160ms ease, color 160ms ease;
}

.date-index-toggle-mark svg {
  width: 17px;
  height: 17px;
}

.date-index-toggle:hover .date-index-toggle-mark {
  color: var(--brand-deep);
}

.date-index-toggle.is-collapsed .date-index-toggle-mark {
  transform: rotate(180deg);
}

.date-index-list {
  margin-top: 2px;
  display: grid;
}

.date-index-row {
  min-height: 54px;
  padding: 0 3px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

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

button.date-index-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
}

.date-index-row:hover {
  color: var(--brand-deep);
  background: #f6fbfd;
}

.date-index-row strong {
  font-size: 15px;
  font-weight: 600;
}

.date-index-row small {
  color: var(--muted);
  font-size: 12px;
}

.date-index-row svg {
  width: 18px;
  height: 18px;
  color: #a8b3ba;
}

.results-section {
  margin-top: 32px;
}

.results-heading {
  padding: 0 2px 12px;
  border-bottom: 1px solid var(--line);
}

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

.results-list {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.date-group {
  display: grid;
  gap: 9px;
}

.date-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

.date-label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.result-card {
  width: 100%;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: border 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button.result-card {
  cursor: pointer;
}

.result-card:hover {
  border-color: #9bd4e5;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.result-main {
  min-width: 0;
}

.result-topline,
.result-meta,
.result-arrow {
  display: flex;
  align-items: center;
}

.result-topline {
  gap: 9px;
}

.carrier-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--brand-deep);
  font-size: 11px;
  font-weight: 800;
}

.result-topline strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-pale);
  font-size: 11px;
  font-weight: 800;
}

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

.status-pill.status-delivered {
  color: #427a6b;
  background: #e9f4ef;
}

.status-pill.status-warning {
  color: var(--red);
  background: var(--red-pale);
}

.status-pill.status-pending {
  color: #9b690d;
  background: var(--amber-pale);
}

.result-number {
  margin: 9px 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.result-meta {
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.result-arrow {
  align-self: center;
  color: #a1adb6;
}

.result-arrow svg {
  width: 20px;
  height: 20px;
}

.empty-state {
  min-height: 230px;
  margin-top: 18px;
  padding: 40px 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.58);
}

.empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-deep);
  background: var(--brand-pale);
}

.empty-state h2 {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.admin-view {
  position: relative;
  flex: 1;
  background: var(--page);
}

.admin-wrap {
  padding: 38px 0 60px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 16px;
}

.dark-eyebrow {
  color: var(--brand-deep);
}

.admin-actions {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  overflow: visible;
}

.admin-actions .secondary-button,
.admin-actions .primary-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (min-width: 851px) and (max-width: 1200px) {
  .admin-actions {
    gap: 8px;
  }

  .admin-actions .secondary-button,
  .admin-actions .primary-button {
    padding-right: 12px;
    padding-left: 12px;
  }
}

.admin-note {
  margin-top: 22px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #c8e3ec;
  border-radius: var(--radius);
  color: #397080;
  background: #edf9fc;
  font-size: 12px;
}

.admin-note svg {
  flex: 0 0 auto;
  color: var(--brand-deep);
}

.admin-stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.admin-stat {
  min-height: 86px;
  padding: 16px 20px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.admin-stat-action {
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.admin-stat-action:hover {
  background: #f6fbfd;
}

.admin-stat-action:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.admin-stat + .admin-stat {
  border-left: 1px solid var(--line);
}

.admin-stat span {
  color: var(--muted);
  font-size: 12px;
}

.admin-stat strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.accent-stat strong {
  color: var(--brand-deep);
  font-size: 18px;
}

.admin-layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(350px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
  gap: 20px;
}

.tool-panel {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.tool-heading {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #fff;
}

.order-form {
  display: grid;
  gap: 16px;
  padding-top: 18px;
}

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

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

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

.field > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search-field,
.filter-select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
}

.field textarea {
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder {
  color: #a1acb4;
}

.form-actions {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-message {
  color: var(--green);
  font-size: 12px;
}

.form-message.error {
  color: var(--red);
}

.form-message.warning {
  color: #946515;
}

.file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.list-toolbar {
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.search-field {
  min-width: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.search-field input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.filter-select {
  width: 100%;
  padding: 0 8px;
}

.admin-list {
  display: grid;
  gap: 0;
  max-height: 625px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.admin-row {
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-row-main {
  min-width: 0;
}

.admin-row-top,
.admin-row-bottom,
.admin-row-actions {
  display: flex;
  align-items: center;
}

.admin-row-top {
  gap: 8px;
}

.admin-row-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.admin-row-bottom {
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.admin-row-actions {
  align-items: flex-start;
  gap: 6px;
}

.small-action {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.small-action:hover {
  color: var(--brand-deep);
  border-color: #a9d5e4;
}

.small-action.danger:hover {
  color: var(--red);
  border-color: #ebc1c3;
  background: var(--red-pale);
}

.empty-list {
  padding: 28px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.announcement-tool {
  margin-top: 20px;
}

.announcement-form {
  padding-top: 18px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.announcement-form .secondary-button {
  min-height: 40px;
}

.site-footer {
  min-height: 54px;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #84919c;
  background: #e5edf1;
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(18, 35, 48, 0.45);
}

.detail-modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.admin-login-modal {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

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

.standalone-login-shell .topbar,
.standalone-login-shell main,
.standalone-login-shell .site-footer {
  display: none !important;
}

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

.admin-login-page {
  min-height: 100vh;
  padding: clamp(24px, 7vw, 88px) 20px;
  display: grid;
  place-items: center;
  background: var(--page);
}

.admin-login-page-card {
  width: min(440px, 100%);
  padding: clamp(26px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-login-page-brand {
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.1);
  font-size: 26px;
  font-weight: 800;
}

.admin-login-page-card h1 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.2;
}

.admin-login-page-intro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-login-page-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.admin-login-page-form input {
  min-height: 46px;
  font-size: 16px;
}

.admin-login-page-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.admin-login-page-actions button {
  width: 100%;
  min-width: 0;
}

@media (max-width: 620px) {
  .admin-login-page {
    align-items: start;
    padding: 24px 16px;
  }

  .admin-login-page-card {
    padding: 24px 20px;
  }

  .admin-login-page-actions {
    grid-template-columns: 1fr;
  }
}

/* Public home visual preview v2. The selectors are deliberately scoped to
   the home state so result pages, the admin view, and their interactions keep
   the existing layout. */
.public-shell {
  --hero-ink: #ffffff;
  --hero-lavender: #858bb8;
  --hero-blue: #78c7e2;
  --hero-cta: #7889df;
  background: #edf1fb;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: var(--hero-lavender) url("./assets/public-hero-arch.png") center center / cover no-repeat;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, rgba(75, 72, 130, 0.15), rgba(115, 194, 221, 0.06) 58%, rgba(75, 72, 130, 0.2));
  pointer-events: none;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
  position: relative;
  width: min(1240px, calc(100% - 64px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 18px;
  padding: 26px 0 0;
}

.public-hero-nav {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 20px;
  z-index: 4;
}

.public-hero-brand {
  appearance: none;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--hero-ink);
  background: transparent;
  text-align: left;
}

.public-hero-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  color: #545b8e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 9px 24px rgba(56, 52, 99, 0.14);
  font-size: 21px;
  font-weight: 900;
}

.public-hero-brand-copy {
  display: grid;
  gap: 1px;
}

.public-hero-brand-copy strong {
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
  text-shadow: 0 2px 14px rgba(45, 46, 88, 0.25);
}

.public-hero-brand-copy small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.25;
}

.public-hero-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(50, 48, 91, 0.12);
  backdrop-filter: blur(14px);
}

.public-hero-links button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #686985;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.public-hero-links button:hover,
.public-hero-links button:focus-visible {
  color: #3d447a;
  background: rgba(255, 255, 255, 0.96);
}

.public-hero-cta {
  justify-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 17px 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: var(--hero-cta);
  box-shadow: 0 9px 22px rgba(61, 65, 145, 0.26);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.public-hero-cta:hover {
  background: #697bd6;
  transform: translateY(-1px);
}

.public-hero-cta svg {
  width: 15px;
  height: 15px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy {
  position: relative;
  z-index: 3;
  max-width: 920px;
  margin-top: 28px;
  color: var(--hero-ink);
  text-align: center;
}

.public-hero-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 6.4vw, 86px);
  font-weight: 850;
  line-height: 0.99;
  letter-spacing: 0;
  text-shadow: 0 5px 28px rgba(57, 54, 105, 0.22);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy h1 span {
  color: rgba(255, 255, 255, 0.94);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy p {
  max-width: 520px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.7;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box {
  position: relative;
  z-index: 5;
  width: min(880px, 100%);
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 46px rgba(44, 47, 100, 0.19);
  backdrop-filter: blur(15px);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .input-row {
  gap: 9px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .input-row input {
  min-height: 58px;
  border: 1px solid #e2e5f1;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 16px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-button {
  min-width: 126px;
  min-height: 58px;
  border-radius: 13px;
  color: #fff;
  background: var(--hero-cta);
  box-shadow: 0 5px 0 #5f6fc6;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-button:hover {
  background: #697bd6;
  box-shadow: 0 6px 0 #5f6fc6;
}

.public-hero-query-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  color: #717694;
  font-size: 11px;
}

.public-hero-query-note svg {
  width: 14px;
  height: 14px;
  color: #5c72c5;
}

.public-hero-device {
  position: absolute;
  left: 50%;
  bottom: -274px;
  z-index: 2;
  width: 248px;
  height: 522px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 38px 38px 0 0;
  background: linear-gradient(145deg, rgba(242, 242, 255, 0.95), rgba(188, 193, 239, 0.94));
  box-shadow: 0 20px 56px rgba(49, 47, 104, 0.28), inset 0 0 0 1px rgba(103, 105, 164, 0.24);
  transform: translateX(-50%) rotate(2.5deg);
  pointer-events: none;
}

.public-hero-device-speaker {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 76px;
  height: 18px;
  border-radius: 999px;
  background: rgba(25, 28, 56, 0.96);
  transform: translateX(-50%);
}

.public-hero-device-screen {
  height: 100%;
  padding: 34px 18px 24px;
  overflow: hidden;
  border-radius: 29px 29px 0 0;
  color: #535b8d;
  background: linear-gradient(160deg, #e7e8ff 0%, #c9d3f4 58%, #a9d8e6 100%);
}

.public-device-status,
.public-device-status-pill,
.public-device-route,
.public-device-status {
  display: flex;
  align-items: center;
}

.public-device-status {
  justify-content: space-between;
  color: rgba(79, 84, 137, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.public-device-status svg {
  width: 14px;
  height: 14px;
}

.public-device-greeting {
  margin-top: 42px;
  color: #4a5389;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.08;
}

.public-device-number {
  margin-top: 10px;
  color: rgba(78, 84, 136, 0.7);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.public-device-status-pill {
  width: fit-content;
  gap: 5px;
  margin-top: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #4a61b6;
  background: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 800;
}

.public-device-status-pill svg {
  width: 13px;
  height: 13px;
}

.public-device-route {
  align-items: flex-start;
  gap: 9px;
  margin-top: 20px;
  color: #59628e;
}

.public-device-route > span {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  flex: 0 0 auto;
  border: 2px solid rgba(77, 95, 173, 0.55);
  border-radius: 50%;
}

.public-device-route > span.is-active {
  border-color: #6678d2;
  background: #6678d2;
  box-shadow: 0 0 0 4px rgba(102, 120, 210, 0.15);
}

.public-device-route strong,
.public-device-route small {
  display: block;
}

.public-device-route strong {
  font-size: 10px;
  line-height: 1.4;
}

.public-device-route small {
  margin-top: 3px;
  color: rgba(77, 84, 135, 0.68);
  font-size: 9px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .content-wrap {
  position: relative;
  z-index: 6;
  width: min(1100px, calc(100% - 40px));
  margin: -34px auto 0;
  padding: 0 0 62px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .date-index,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .introduction-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(55, 61, 113, 0.1);
  backdrop-filter: blur(14px);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel {
  grid-column: 1 / -1;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .introduction-panel {
  padding: 22px 24px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .date-index {
  padding: 12px 18px;
}

@media (max-width: 760px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero,
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    min-height: 700px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    width: min(100% - 28px, 560px);
    gap: 14px;
    padding-top: 18px;
  }

  .public-hero-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .public-hero-links {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .public-hero-links::-webkit-scrollbar {
    display: none;
  }

  .public-hero-links button {
    flex: 0 0 auto;
    padding: 0 14px;
  }

  .public-hero-cta {
    min-height: 38px;
    padding: 0 13px 0 15px;
  }

  .public-hero-brand-mark {
    width: 38px;
    height: 38px;
  }

  .public-hero-brand-copy strong {
    font-size: 15px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy {
    margin-top: 18px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy h1 {
    font-size: clamp(32px, 9.2vw, 48px);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy p {
    max-width: 330px;
    margin-top: 14px;
    font-size: 13px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box {
    width: 100%;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-button {
    width: 100%;
  }

  .public-hero-device {
    display: none;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .content-wrap {
    width: min(100% - 28px, 560px);
    margin-top: -18px;
    grid-template-columns: minmax(0, 1fr);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel {
    grid-column: auto;
  }
}

/* The richer no-result template is desktop-only; mobile keeps the legacy text. */
.result-empty-template {
  display: none;
}

@media (min-width: 761px) {
  body.public-shell .public-view.has-results.has-empty-results {
    min-height: 100svh;
    background: #fff;
  }

  .public-view.has-empty-results .results-section {
    min-height: 100svh;
    background: #fff;
  }

  .public-view.has-empty-results .result-page-bar {
    min-height: 220px;
    position: relative;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #fff;
  }

  .public-view.has-empty-results .result-page-bar > * {
    display: none;
  }

  .public-view.has-empty-results .result-page-bar::before {
    content: "单号\A查询";
    width: 110px;
    height: 110px;
    position: absolute;
    top: 24px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #111;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.28);
    white-space: pre;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 2px;
    text-indent: 2px;
    text-align: center;
    transform: translateX(-50%);
  }

  .public-view.has-empty-results .result-page-bar::after {
    content: "美博单号查询";
    position: absolute;
    top: 151px;
    left: 50%;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    text-shadow: none;
    transform: translateX(-50%);
  }

  .public-view.has-empty-results .result-page-content,
  .public-view.has-empty-results .result-empty-mobile {
    display: none !important;
  }

  .public-view.has-empty-results .results-list {
    width: 100%;
    max-width: none;
    min-height: calc(100svh - 220px);
    display: block;
    margin: 0;
    padding: 16px 15px 48px;
    background: #fff;
  }

  .public-view.has-empty-results .result-empty-template {
    width: min(880px, 100%);
    min-height: 360px;
    margin: 0 auto;
    padding: 28px 34px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(103, 111, 173, 0.16);
    border-radius: 18px;
    color: #252944;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 44px rgba(66, 72, 129, 0.1);
    text-align: center;
  }

  .result-empty-template .result-empty-kicker {
    margin-bottom: 18px;
    color: #323650;
    font-size: 18px;
    font-weight: 800;
  }

  .result-empty-illustration {
    width: 154px;
    height: 104px;
    position: relative;
    margin-bottom: 16px;
  }

  .result-empty-window {
    width: 132px;
    height: 92px;
    position: absolute;
    left: 0;
    bottom: 0;
    display: block;
    border: 9px solid #e2e8f7;
    border-top-width: 25px;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(91, 100, 168, 0.1);
  }

  .result-empty-window::before {
    content: "";
    width: 56px;
    height: 13px;
    position: absolute;
    top: 13px;
    left: 12px;
    border-radius: 3px;
    background: #b8c9f7;
  }

  .result-empty-window i {
    width: 7px;
    height: 7px;
    position: relative;
    top: -19px;
    left: -1px;
    display: inline-block;
    margin-right: 3px;
    border-radius: 50%;
    background: #f5bc45;
  }

  .result-empty-window i:nth-child(2) {
    background: #e99a88;
  }

  .result-empty-window i:nth-child(3) {
    background: #a9bf6d;
  }

  .result-empty-window b {
    width: 44px;
    height: 14px;
    position: absolute;
    bottom: 11px;
    left: 12px;
    border-radius: 3px;
    background: #ffe6ab;
  }

  .result-empty-window b:last-child {
    width: 28px;
    left: auto;
    right: 10px;
    background: #ffc5b6;
  }

  .result-empty-alert {
    width: 54px;
    height: 54px;
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    border: 5px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: #ffbd3d;
    box-shadow: 0 8px 18px rgba(255, 172, 24, 0.25);
    font-size: 31px;
    font-weight: 800;
    line-height: 1;
  }

  .result-empty-template h2 {
    margin: 0;
    color: #252944;
    font-size: 20px;
    line-height: 1.4;
  }

  .result-empty-template p {
    margin: 8px 0 22px;
    color: #7a8097;
    font-size: 14px;
  }

  .result-empty-template .result-empty-back {
    width: min(460px, 100%);
    min-height: 46px;
    border: 1px solid #d6d9e8;
    border-radius: 9px;
    color: #59649e;
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
  }

  .result-empty-template .result-empty-back:hover,
  .result-empty-template .result-empty-back:focus-visible {
    border-color: #7b88da;
    color: #4f5bb0;
    box-shadow: 0 8px 22px rgba(91, 103, 183, 0.16);
    outline: none;
  }
}

/* Final production desktop override for the approved v61 layout. */
@media (min-width: 761px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    grid-template-rows: auto auto auto auto !important;
    align-content: start;
    gap: 14px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand {
    justify-self: center;
    flex-direction: column;
    gap: 9px;
    min-width: 220px;
    text-align: center;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-mark {
    width: 110px;
    height: 110px;
    position: relative;
    border-radius: 50%;
    border: 0;
    background: #fff;
    font-size: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.28);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-mark::before {
    content: "单号\A查询";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre;
    color: #111;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 2px;
    text-indent: 2px;
    text-align: center;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy {
    justify-items: center;
    gap: 1px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy strong {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.15;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-brand-copy small {
    font-size: 13px;
    line-height: 1.25;
  }
}

/* Final desktop-only override: the hero artwork reaches the viewport bottom,
   while the mobile 700px hero rule above remains unchanged. */
@media (min-width: 761px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero,
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    min-height: 100svh;
  }
}

/* Desktop preview: if the page is taller than the hero section, keep the
   same artwork visible behind the lower edge instead of the default pale
   page color. This block is intentionally limited to desktop widths. */
@media (min-width: 761px) {
  html,
  body.public-shell {
    background: var(--hero-lavender) url("./assets/public-hero-arch.png") center bottom / cover no-repeat !important;
  }
}

/* Desktop preview: let the artwork fill the entire initial viewport so the
   lower edge never falls back to the plain page color. Mobile keeps its
   existing 700px hero and background unchanged. */
@media (min-width: 761px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero,
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    min-height: 100svh;
  }
}

/* Desktop background refinement: use one continuous artwork layer behind the
   hero and cards to remove the visible seam at the bottom of the hero. */
@media (min-width: 761px) {
  html,
  body.public-shell {
    background: var(--hero-lavender) url("./assets/public-hero-arch.png") center top / cover fixed no-repeat !important;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero {
    background: transparent !important;
  }
}

/* Final preview placement: the query history follows the search form before
   the announcement/query-center/introduction panels.  !important keeps this
   order after the legacy visual rules above. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history {
  grid-row: auto !important;
  width: min(880px, 100%);
  align-self: start;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
  grid-row: auto !important;
}

@media (max-width: 760px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history,
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
    width: 100%;
  }
}

/* Final preview placement: history sits directly after the query form, and
   the content panels follow it in normal document order. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
  grid-row: auto;
}

/* Keep query history immediately below the query form. The panels flow after
   it automatically, so the layout stays compact when history is hidden. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history {
  grid-row: 3;
  align-self: start;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
  grid-row: auto;
}

/* The history block now follows the query form in document order. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history {
  grid-row: auto;
  align-self: start;
}

/* Preview-only removal requested from the marked hero area. Keep the brand
   and query form available while removing the center navigation and headline. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-cta,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-device {
  display: none !important;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-hero-nav {
  grid-template-columns: minmax(0, 1fr);
}

/* Put the existing public content panels below the query form and align all
   controls to one shared width. */
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
  grid-template-rows: auto auto auto auto 1fr;
}
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
  width: min(880px, 100%);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box {
  grid-row: 2;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
  display: grid;
  grid-row: 3;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 6;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .search-history {
  grid-row: 4;
  width: min(880px, 100%);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels > .announcement-panel,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels > .date-index,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels > .introduction-panel {
  width: 100%;
  min-width: 0;
  margin: 0;
  grid-column: 1 / -1;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box .input-row {
  grid-template-columns: minmax(0, 1fr);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box .query-button {
  width: 100%;
}

@media (max-width: 760px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .public-home-panels {
    width: 100%;
    gap: 6px;
  }
}

.admin-login-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.admin-login-form input {
  font-size: 16px;
}

.admin-login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.admin-login-actions button {
  min-width: 96px;
}

.detail-summary {
  margin-top: 18px;
  padding: 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.detail-carrier {
  display: flex;
  align-items: center;
  gap: 9px;
}

.detail-carrier strong {
  font-size: 15px;
}

.detail-number {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.copy-number {
  align-self: center;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #b8dce9;
  border-radius: 5px;
  color: var(--brand-deep);
  background: #effaff;
  font-size: 12px;
  font-weight: 700;
}

.timeline {
  position: relative;
  margin: 24px 0 0 7px;
  padding-left: 24px;
  border-left: 1px solid #c4d7df;
}

.timeline-item {
  position: relative;
  padding: 0 0 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  top: 2px;
  left: -30px;
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 1px #9dcdda;
}

.timeline-item:first-child .timeline-dot {
  background: var(--green);
  box-shadow: 0 0 0 1px #8bd2bb;
}

.timeline-time {
  color: var(--muted);
  font-size: 11px;
}

.timeline-text {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13px;
}

.timeline-location {
  margin-top: 2px;
  color: #9aa7b0;
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100% - 36px));
  padding: 11px 15px;
  border-radius: 6px;
  color: #fff;
  background: #20323d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 850px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 38px 0 42px;
  }

  .hero-copy p {
    max-width: none;
  }

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

  .announcement-form {
    grid-template-columns: 1fr 1.5fr auto;
  }
}

@media (max-width: 620px) {
  .topbar-inner,
  .content-wrap,
  .admin-wrap,
  .hero-inner {
    width: min(100% - 28px, 1160px);
  }

  .topbar-inner {
    min-height: 62px;
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 17px;
  }

  .brand-copy small {
    display: none;
  }

  .admin-topbar-title {
    gap: 0;
  }

  .admin-topbar-title h1 {
    font-size: 14px;
  }

  .admin-topbar-title p {
    display: none;
  }

  .nav-tab {
    min-height: 31px;
    padding: 0 9px;
  }

  .query-hero {
    border-bottom: 0;
  }

  .hero-inner {
    min-height: auto;
    gap: 20px;
    padding: 31px 0 34px;
  }

  .hero-copy {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .hero-emblem {
    width: 136px;
    height: 136px;
    margin-bottom: 19px;
    border-width: 6px;
    font-size: 27px;
  }

  .hero-copy h1 {
    margin-top: 6px;
    font-size: 32px;
  }

  .hero-copy p {
    font-size: 13px;
  }

  .query-box {
    padding: 16px;
  }

  .mode-button {
    min-width: 64px;
    padding: 7px 9px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .query-button {
    width: 100%;
  }

  .query-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .content-wrap {
    padding-top: 18px;
  }

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

  .overview-item {
    min-height: 80px;
    padding: 14px 16px;
  }

  .overview-item:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .panel-line {
    padding: 17px;
  }

  .announcement-copy {
    margin-left: 0;
  }

  .result-card {
    padding: 14px;
  }

  .result-topline {
    flex-wrap: wrap;
  }

  .admin-wrap {
    padding-top: 26px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .admin-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-actions .secondary-button,
  .admin-actions .primary-button {
    min-width: 0;
    flex: 1 1 calc(50% - 5px);
  }

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

  .admin-stat {
    min-height: 72px;
    padding: 13px 15px;
  }

  .admin-stat:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .admin-stat:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .admin-stat strong {
    font-size: 21px;
  }

  .tool-panel {
    padding: 17px;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  .list-toolbar {
    grid-template-columns: 1fr;
  }

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

  .admin-row-actions {
    align-items: center;
  }

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

  .announcement-form .secondary-button {
    width: 100%;
  }

  .site-footer {
    padding: 14px 12px;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .detail-modal {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }
}

/* Public lookup template */
.public-shell {
  background: #f4f6f8;
}

.public-page-bar {
  display: none;
}

.public-page-shell .public-page-bar {
  display: block;
  border-bottom: 1px solid #e3e7ea;
  background: #fff;
}

.public-page-bar-inner {
  width: min(660px, calc(100% - 30px));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.public-page-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.public-page-title > div {
  min-width: 0;
  display: grid;
  gap: 0;
}

.public-page-title strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.public-page-title small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.public-page-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--brand);
  font-size: 17px;
  font-weight: 800;
}

.public-page-bar .secondary-button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.public-shell .topbar,
.public-shell .site-footer {
  display: none;
}

.public-shell main {
  width: 100%;
}

.public-shell .query-hero {
  border: 0;
  background: #12a5dc;
}

.public-shell .hero-inner {
  width: min(660px, calc(100% - 30px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 30px 0 34px;
}

.public-shell .hero-copy {
  display: grid;
  justify-items: center;
  color: #fff;
  text-align: center;
}

.public-shell .hero-emblem {
  width: 110px;
  height: 110px;
  margin: 0 0 14px;
  border: 0;
  color: #111;
  background: #fff;
  box-shadow: 0 5px 12px rgba(0, 79, 116, 0.22);
  font-size: 23px;
}

.public-shell .hero-copy h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 71, 103, 0.16);
}

.public-shell .query-box {
  width: 100%;
  margin-top: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.public-shell .input-row {
  grid-template-columns: 1fr;
  gap: 14px;
}

.public-shell .input-row input {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 5px;
  font-size: 14px;
}

.public-shell .query-button {
  width: 100%;
  min-height: 46px;
  border-radius: 5px;
  color: #fff;
  background: #ffa400;
  box-shadow: none;
  font-size: 16px;
}

.public-shell .query-button:hover,
.public-shell .query-button:active {
  background: #f39a00;
  box-shadow: none;
  transform: none;
}

.public-shell .search-history {
  width: 100%;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.public-shell .search-history[hidden] {
  display: none;
}

.public-shell .search-history-header {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.public-shell .search-history-header h2 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
}

.public-shell .search-history-clear {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
}

.public-shell .search-history-clear:hover,
.public-shell .search-history-clear:active {
  color: #fff;
  background: rgba(0, 91, 134, 0.18);
}

.public-shell .search-history-clear svg {
  width: 18px;
  height: 18px;
}

.public-shell .search-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-shell .search-history-chip {
  max-width: 100%;
  min-height: 30px;
  padding: 5px 18px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #087fb7;
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-shell .search-history-chip:hover,
.public-shell .search-history-chip:active {
  background: #066f9f;
}

.public-shell .content-wrap {
  width: min(660px, calc(100% - 30px));
  padding: 12px 0 34px;
}

.public-shell .announcement-panel,
.public-shell .date-index,
.public-shell .introduction-panel {
  margin-top: 0;
  padding: 0;
  border: 1px solid #e3e7ea;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.public-shell .date-index,
.public-shell .introduction-panel {
  margin-top: 12px;
}

.public-shell .public-panel-heading {
  min-height: 42px;
  padding: 0 14px;
  justify-content: flex-start;
  border-bottom: 1px solid #edf0f2;
  gap: 9px;
}

.public-shell .date-index-toggle {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
}

.public-shell .date-index-toggle .compact-heading {
  gap: 9px;
}

.public-shell .date-index-toggle-mark {
  margin-left: auto;
  width: 20px;
  height: 20px;
  color: #a8b3ba;
}

.public-shell .date-index-toggle-mark svg {
  width: 15px;
  height: 15px;
}

.public-shell .public-panel-heading h2 {
  margin: 0;
  color: #737d85;
  font-size: 14px;
  font-weight: 400;
}

.public-shell .public-panel-heading .heading-icon {
  width: 24px;
  height: 24px;
  color: #f2a000;
  background: #fff1d7;
}

.public-shell .public-panel-heading .heading-icon svg {
  width: 14px;
  height: 14px;
}

.public-shell .announcement-copy {
  margin: 0;
  padding: 11px 14px 13px;
  color: #56616a;
  font-size: 13px;
  line-height: 1.7;
}

.public-shell .introduction-copy {
  margin: 0;
  padding: 11px 14px 13px;
  color: #56616a;
  font-size: 13px;
  line-height: 1.7;
}

.public-shell .date-index-list {
  margin: 0;
}

.public-shell .date-index-row {
  min-height: 42px;
  padding: 0 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid #edf0f2;
  color: #344b5d;
  font-size: 14px;
}

.public-shell .date-index-row:last-child {
  border-bottom: 0;
}

.public-shell .date-index-row strong {
  font-weight: 400;
}

.public-shell .date-index-row:hover {
  color: #087bb4;
  background: #fbfcfd;
}

.public-shell .date-index-row svg {
  width: 16px;
  height: 16px;
  color: #c6cbd0;
}

.public-shell .public-view.has-results .query-hero {
  display: none;
}

.public-shell .public-view.has-results .content-wrap {
  width: 100%;
  padding: 0 0 34px;
}

.public-shell .public-view.has-results .results-section {
  margin-top: 0;
  background: #f4f6f8;
}

.public-shell .public-view.has-results .announcement-panel,
.public-shell .public-view.has-results .date-index,
.public-shell .public-view.has-results .introduction-panel,
.public-shell .public-view.has-results .empty-state {
  display: none;
}

.public-shell .result-page-bar,
.public-shell .date-page-bar {
  min-height: 50px;
  padding: 0 max(15px, calc((100% - 660px) / 2));
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: #12a5dc;
}

.public-shell .public-view.has-date-lookup .query-hero {
  display: none;
}

.public-shell .public-view.has-date-lookup .content-wrap {
  width: 100%;
  padding: 0;
}

.public-shell .public-view.has-date-lookup .announcement-panel,
.public-shell .public-view.has-date-lookup .date-index,
.public-shell .public-view.has-date-lookup .introduction-panel,
.public-shell .public-view.has-date-lookup .results-section,
.public-shell .public-view.has-date-lookup .empty-state {
  display: none;
}

.public-shell .date-lookup-section {
  min-height: 100vh;
  margin: 0;
  background: #f4f6f8;
}

.public-shell .date-page-content {
  width: min(660px, calc(100% - 30px));
  margin: 0 auto;
  padding: 38px 0 50px;
}

.public-shell .date-page-content h2 {
  margin: 0 0 32px;
  color: #1f2a32;
  font-size: 20px;
  line-height: 1.2;
  text-align: center;
}

.public-shell .date-search-form {
  display: grid;
  gap: 20px;
}

.public-shell .date-search-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #d2d5d8;
  border-radius: 5px;
  color: #515b63;
  background: #fff;
  font-size: 14px;
}

.public-shell .date-search-form .primary-button {
  width: 100%;
  min-height: 45px;
  border-radius: 5px;
  background: #ffa400;
  box-shadow: none;
  font-size: 16px;
}

.public-shell .date-search-form .primary-button:hover,
.public-shell .date-search-form .primary-button:active {
  background: #f39a00;
  box-shadow: none;
  transform: none;
}

.public-shell .result-back-button {
  width: 28px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
}

.public-shell .result-back-button svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.8;
}

.public-shell .result-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.public-shell .result-breadcrumb strong {
  font-weight: 700;
}

.public-shell .result-page-content {
  width: min(660px, calc(100% - 30px));
  margin: 0 auto;
  padding: 16px 0 0;
}

.public-shell .result-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 0;
}

.public-shell .result-search-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #d5d7d9;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  color: #515b63;
  background: #fff;
  font-size: 14px;
}

.public-shell .result-search-form .primary-button {
  min-height: 46px;
  border-radius: 0 4px 4px 0;
  background: #ffa400;
  box-shadow: none;
  font-size: 16px;
}

.public-shell .result-search-form .primary-button:hover,
.public-shell .result-search-form .primary-button:active {
  background: #f39a00;
  box-shadow: none;
  transform: none;
}

.public-shell .result-summary {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid #edf0f2;
  color: #68727a;
  background: #fff;
  font-size: 14px;
}

.public-shell .result-summary strong {
  color: #4f5a62;
  font-weight: 400;
}

.public-shell .results-list {
  width: min(660px, calc(100% - 30px));
  margin: 12px auto 0;
  display: grid;
  gap: 12px;
  padding: 0;
}

.public-shell .shipment-result {
  min-width: 0;
}

.public-shell .result-record-row {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #edf0f2;
  border-bottom: 0;
  border-radius: 0;
  color: #59636b;
  background: #fff;
  text-align: left;
  font-size: 13px;
}

.public-shell .result-record-row svg {
  width: 17px;
  height: 17px;
  color: #00b149;
  stroke-width: 2.4;
}

.public-shell .result-identity,
.public-shell .result-detail-panel {
  border: 1px solid #edf0f2;
  background: #fff;
}

.public-shell .result-identity {
  margin-top: 12px;
  padding: 13px 14px;
  display: grid;
  gap: 6px;
  color: #7a838a;
  font-size: 13px;
}

.public-shell .result-identity strong {
  font-weight: 400;
}

.public-shell .result-detail-panel {
  margin-top: 12px;
  padding: 16px 14px 18px;
}

.public-shell .tracking-line,
.public-shell .carrier-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.public-shell .tracking-line {
  color: #111;
  font-size: 14px;
}

.public-shell .copy-button {
  min-width: 60px;
  min-height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: #f0a179;
  font-size: 12px;
}

.public-shell .carrier-line {
  margin-top: 13px;
  color: #59636b;
  font-size: 13px;
}

.public-shell .reset-search-link {
  padding: 0;
  border: 0;
  color: #267cc4;
  background: transparent;
  font-size: 13px;
}

.public-shell .tracking-status {
  margin: 24px 0 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #e44842;
  font-size: 16px;
  text-align: center;
}

.public-shell .tracking-status.is-success {
  color: #00a94f;
}

.public-shell .tracking-status svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.public-shell .tracking-note {
  margin: 8px 0 0;
  color: #8a9298;
  font-size: 12px;
  line-height: 1.65;
}

/* Public result preview: full-width record details with the tracking timeline
   expanded in place, matching the supplied reference structure. */
.public-shell .public-view.has-results .result-page-bar {
  padding-inline: 15px;
}

.public-shell .public-view.has-results .result-page-content,
.public-shell .public-view.has-results .results-list {
  width: calc(100% - 30px);
  max-width: none;
}

.public-shell .public-view.has-results .result-page-content {
  padding-top: 16px;
}

.public-shell .public-view.has-results .result-summary {
  min-height: 49px;
  margin-top: 16px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  border-color: #eceff1;
  color: #68727a;
}

.public-shell .public-view.has-results .result-index-list {
  margin-top: 0;
  border: 1px solid #eceff1;
  border-top: 0;
  background: #fff;
}

.public-shell .public-view.has-results .result-index-row {
  width: 100%;
  min-height: 40px;
  padding: 9px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-top: 1px solid #eceff1;
  border-radius: 0;
  color: #4f5a62;
  background: #fff;
  text-align: left;
  line-height: 1.55;
}

.public-shell .public-view.has-results .result-index-row:first-child {
  border-top: 0;
}

.public-shell .public-view.has-results .result-index-row:hover,
.public-shell .public-view.has-results .result-index-row:active {
  color: #287bc0;
  background: #fbfcfd;
}

.public-shell .public-view.has-results .result-index-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-shell .public-view.has-results .result-index-row svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #00b149;
  stroke-width: 2.4;
}

.public-shell .public-view.has-results .results-list {
  margin-top: 0;
  gap: 16px;
}

.public-shell .public-view.has-results .shipment-result {
  min-width: 0;
  display: grid;
  gap: 16px;
  scroll-margin-top: 58px;
}

.public-shell .public-view.has-results .results-list {
  margin-top: 16px;
}

.public-shell .public-view.has-results .result-record-row > span,
.public-shell .public-view.has-results .result-tracking-number,
.public-shell .public-view.has-results .result-timeline-text,
.public-shell .public-view.has-results .result-timeline-location {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-shell .public-view.has-results .result-identity,
.public-shell .public-view.has-results .result-carrier-panel,
.public-shell .public-view.has-results .result-timeline-panel {
  margin: 0;
  border: 1px solid #f0f1f2;
  border-radius: 0;
  background: #fff;
}

.public-shell .public-view.has-results .result-identity {
  padding: 13px 15px;
  gap: 6px;
  color: #7a838a;
  line-height: 1.55;
}

.public-shell .public-view.has-results .result-carrier-panel {
  min-height: 46px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: #7a838a;
  font-size: 13px;
}

.public-shell .public-view.has-results .result-carrier-panel strong {
  color: #287bc0;
  font-weight: 400;
}

.public-shell .public-view.has-results .result-carrier-help {
  color: #9aa2a8;
  font-size: 11px;
}

.public-shell .public-view.has-results .result-carrier-panel .reset-search-link {
  color: #287bc0;
  font-size: 11px;
}

.public-shell .public-view.has-results .result-timeline-panel {
  overflow: hidden;
}

.public-shell .public-view.has-results .result-timeline {
  position: relative;
}

.public-shell .public-view.has-results .result-timeline-item {
  position: relative;
  min-height: 68px;
  padding: 12px 16px 12px 40px;
  border-bottom: 1px solid #eceff1;
}

.public-shell .public-view.has-results .result-timeline-item:last-child {
  border-bottom: 0;
}

.public-shell .public-view.has-results .result-timeline-item::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 1px;
  background: #d8dcdf;
  content: "";
}

.public-shell .public-view.has-results .result-timeline-item:first-child::before {
  top: 18px;
}

.public-shell .public-view.has-results .result-timeline-item:last-child::before {
  bottom: calc(100% - 20px);
}

.public-shell .public-view.has-results .result-timeline-item:only-child::before {
  display: none;
}

.public-shell .public-view.has-results .result-timeline-dot {
  position: absolute;
  top: 16px;
  left: 10px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #d6dade;
  box-shadow: 0 0 0 1px #d6dade;
}

.public-shell .public-view.has-results .result-timeline-item.is-latest .result-timeline-dot {
  border: 3px solid #fff;
  background: #fff;
  box-shadow: 0 0 0 2px #ff9e00;
}

.public-shell .public-view.has-results .result-timeline-content {
  min-width: 0;
}

.public-shell .public-view.has-results .result-timeline-text {
  color: #8a939a;
  font-size: 13px;
  line-height: 1.65;
}

.public-shell .public-view.has-results .result-timeline-item.is-latest .result-timeline-text {
  color: #f08b00;
}

.public-shell .public-view.has-results .result-timeline-location {
  margin-top: 3px;
  color: #a0a8ae;
  font-size: 11px;
  line-height: 1.55;
}

.public-shell .public-view.has-results .result-timeline-meta {
  margin-top: 7px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: #bcc2c6;
  font-size: 10px;
}

.public-shell .public-view.has-results .result-latest-label {
  display: inline-flex;
  min-height: 16px;
  padding: 0 5px;
  align-items: center;
  border-radius: 2px;
  color: #fff;
  background: #39a9ca;
  font-size: 9px;
  line-height: 16px;
}

.public-shell .result-empty {
  padding: 22px 14px;
  border: 1px solid #edf0f2;
  color: #7d858b;
  background: #fff;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 620px) {
  .public-shell .hero-inner,
  .public-shell .content-wrap,
  .public-shell .date-page-content,
  .public-shell .result-page-content,
  .public-shell .results-list {
    width: calc(100% - 30px);
  }

  .public-shell .result-page-bar,
  .public-shell .date-page-bar {
    padding-inline: 15px;
  }

  .public-shell .result-search-form {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .public-shell .public-view.has-results .result-timeline-item {
    padding-right: 12px;
  }
}

/* Formal management tools. These selectors are intentionally namespaced so the
   public lookup template and the existing order form can remain unchanged. */
.formal-preview-notice,
.formal-automation-strip {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.formal-preview-notice {
  margin-top: 22px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid #c18416;
  color: #775113;
  background: #fff8e8;
  font-size: 12px;
  line-height: 1.5;
}

.formal-preview-notice svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.formal-automation-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(300px, 1.65fr) minmax(150px, 0.72fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.formal-automation-item {
  min-width: 0;
  min-height: 70px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.formal-automation-link {
  width: 100%;
  border: 0;
  border-radius: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.formal-automation-link:hover {
  background: #f4fafc;
}

.formal-automation-link:focus-visible {
  z-index: 1;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.formal-automation-link[aria-current="page"] {
  background: #eef9fc;
}

.formal-automation-item + .formal-automation-item {
  border-left: 1px solid var(--line);
}

.formal-automation-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--brand-deep);
}

.formal-automation-item span {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: 11px;
}

.formal-automation-item strong {
  color: var(--ink);
  font-size: 13px;
}

.formal-automation-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-automation-item time {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.formal-automation-item .formal-automation-open-icon {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  color: #78a7b8;
}

.formal-automation-strip[data-automation-state="success"] .formal-automation-last svg,
.formal-automation-strip[data-automation-state="success"] .formal-automation-last strong {
  color: #177858;
}

.formal-automation-strip[data-automation-state="warning"] .formal-automation-last svg,
.formal-automation-strip[data-automation-state="warning"] .formal-automation-last strong {
  color: #946515;
}

#adminView > .admin-wrap,
#adminView > .formal-batch-import-view,
#adminView > .formal-manual-entry-view,
#adminView > .formal-bottom-query-view,
#adminView > .formal-subscription-history-view,
#adminView > .formal-content-settings-view,
#adminView > .formal-account-settings-view,
#adminView > .formal-visitor-records-view {
  padding-top: 24px;
}

.formal-smart-entry-panel,
.formal-batch-panel {
  margin-top: 20px;
}

.formal-panel-heading,
.formal-query-panel-heading,
.formal-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.formal-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #c8e3ec;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-pale);
  font-size: 11px;
  white-space: nowrap;
}

.formal-panel-badge svg {
  width: 14px;
  height: 14px;
}

.formal-recognition-grid {
  padding-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: end;
}

.formal-paste-field textarea {
  min-height: 104px;
}

.formal-recognition-actions {
  display: grid;
  gap: 9px;
  align-content: end;
}

.formal-recognition-actions .primary-button {
  width: 100%;
}

.formal-recognition-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.formal-smart-order-form {
  padding-top: 18px;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.formal-field-grid {
  gap: 12px;
}

.formal-address-field textarea,
.formal-content-field textarea {
  min-height: 64px;
}

.formal-form-actions {
  flex-wrap: wrap;
}

.formal-form-actions .form-message {
  min-width: 0;
  flex: 1 1 100%;
  line-height: 1.55;
}

.formal-batch-body {
  padding-top: 18px;
  display: grid;
  gap: 14px;
}

.formal-batch-toolbar,
.formal-batch-footer,
.formal-inline-actions,
.formal-query-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.formal-batch-toolbar {
  flex-wrap: wrap;
}

.formal-batch-dropzone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 10px 4px 4px;
  border: 1px dashed #9bc8d8;
  border-radius: 8px;
  background: #f5fbfd;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.formal-batch-dropzone.is-dragover {
  border-color: var(--brand);
  background: #e5f7fc;
  box-shadow: 0 0 0 3px rgba(18, 157, 204, .12);
}

.formal-batch-drop-hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.formal-batch-drop-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 6px 5px 12px;
  border: 1px solid #9bc8d8;
  border-radius: 8px;
  background: #ffffff;
}

.formal-batch-drop-confirm[hidden] {
  display: none;
}

.formal-batch-drop-file-name {
  max-width: 260px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-batch-drop-confirm .compact-button {
  min-height: 30px;
  padding: 0 12px;
}

.formal-batch-note,
.formal-muted-text {
  color: var(--muted);
  font-size: 12px;
}

.formal-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.formal-utility-status,
.utility-status {
  min-height: 20px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.formal-utility-status.success,
.utility-status.success {
  border-color: #b7e2d2;
  color: #177858;
  background: var(--green-pale);
}

.formal-utility-status.warning,
.utility-status.warning {
  border-color: #f1d28d;
  color: #946515;
  background: var(--amber-pale);
}

.formal-batch-table-wrap,
.formal-query-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.formal-batch-table,
.formal-query-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.formal-batch-table th,
.formal-batch-table td,
.formal-query-table th,
.formal-query-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

.formal-batch-table th,
.formal-query-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 700;
}

.formal-batch-table tr:last-child td,
.formal-query-table tr:last-child td {
  border-bottom: 0;
}

.formal-empty-row td,
.empty-row td {
  padding: 25px 12px;
  color: var(--muted);
  text-align: center;
}

.formal-batch-table .formal-empty-row td {
  text-align: left;
}

.formal-batch-table .row-warning,
.formal-batch-table .row-ready {
  font-weight: 700;
}

.formal-batch-table .row-warning {
  color: #946515;
}

.formal-batch-table .row-ready {
  color: #177858;
}

.formal-batch-table .formal-batch-status-cell {
  min-width: 218px;
  vertical-align: middle;
}

.formal-batch-status-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.formal-batch-status-text {
  min-width: 0;
}

.formal-batch-remove-button {
  min-width: 54px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #e9b9b9;
  border-radius: 4px;
  color: #a33b3b;
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.formal-batch-remove-button:hover,
.formal-batch-remove-button:focus-visible {
  border-color: #d98f8f;
  color: #8c2727;
  background: #fff5f5;
}

.formal-batch-remove-button svg {
  width: 13px;
  height: 13px;
}


.formal-batch-text-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.formal-batch-text-heading label {
  font: inherit;
  font-weight: 700;
}

.formal-batch-text-heading .compact-button {
  min-height: 34px;
  padding: 0 16px;
}

.formal-batch-footer {
  justify-content: space-between;
  flex-wrap: wrap;
}

.formal-batch-import-view {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.formal-bottom-query-view,
.formal-subscription-history-view {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.formal-subscription-summary {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.formal-subscription-summary-item {
  min-width: 0;
  min-height: 76px;
  padding: 12px 18px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.formal-subscription-summary-item + .formal-subscription-summary-item {
  border-left: 1px solid var(--line);
}

.formal-subscription-summary-item:hover {
  background: #f7fafb;
}

.formal-subscription-summary-item:focus-visible {
  z-index: 1;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.formal-subscription-summary-item.is-active {
  box-shadow: inset 0 -3px 0 var(--brand);
  background: #f0fafd;
}

.formal-subscription-summary-item span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-subscription-summary-item strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.formal-subscription-summary-item.success strong {
  color: #177858;
}

.formal-subscription-summary-item.pending strong {
  color: #946515;
}

.formal-subscription-summary-item.failed strong {
  color: #b33c3c;
}

.formal-subscription-history-panel {
  margin-top: 20px;
}

.formal-subscription-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.formal-subscription-date-field {
  min-width: 286px;
  display: grid;
  gap: 6px;
}

.formal-subscription-date-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.formal-subscription-date-field .formal-date-range {
  min-height: 36px;
}

.formal-subscription-date-field .formal-date-range-button {
  min-height: 36px;
  padding-block: 6px;
}

.formal-subscription-range {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  overflow: hidden;
  border: 1px solid #c8e3ec;
  border-radius: 6px;
}

.formal-subscription-range button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 0;
  color: #317085;
  background: #f5fbfd;
  font-size: 12px;
  white-space: nowrap;
}

.formal-subscription-range button + button {
  border-left: 1px solid #c8e3ec;
}

.formal-subscription-range button:hover,
.formal-subscription-range button.is-active {
  color: #086b91;
  background: #dff3f9;
}

.formal-subscription-range button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.formal-subscription-search {
  min-width: 0;
  min-height: 36px;
  align-self: end;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
}

.formal-subscription-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 149, 198, 0.1);
}

.formal-subscription-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}

.formal-subscription-search input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.formal-subscription-clear {
  width: 34px;
  height: 36px;
  align-self: end;
}

.formal-subscription-list-heading {
  padding-top: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.formal-subscription-list-heading h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.formal-subscription-table-wrap {
  max-width: 100%;
  margin-top: 15px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.formal-subscription-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.formal-subscription-table th,
.formal-subscription-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.formal-subscription-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 700;
  white-space: nowrap;
}

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

.formal-subscription-person,
.formal-subscription-waybill {
  display: grid;
  gap: 3px;
}

.formal-subscription-person strong,
.formal-subscription-waybill strong {
  color: var(--ink);
  font-size: 12px;
}

.formal-subscription-person small,
.formal-subscription-waybill small,
.formal-subscription-message small {
  color: var(--muted);
  font-size: 11px;
}

.formal-subscription-waybill strong {
  max-width: 210px;
  overflow-wrap: anywhere;
}

.formal-subscription-result {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.formal-subscription-result-badge {
  min-height: 22px;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.formal-subscription-result-badge.success {
  border-color: #b7e2d2;
  color: #177858;
  background: var(--green-pale);
}

.formal-subscription-result-badge.pending {
  border-color: #f1d28d;
  color: #946515;
  background: var(--amber-pale);
}

.formal-subscription-result-badge.failed {
  border-color: #edbbbb;
  color: #a83030;
  background: #fff1f1;
}

.formal-subscription-message {
  max-width: 270px;
  color: #44515a;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.formal-subscription-view-order {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #b8dce9;
  border-radius: 5px;
  color: var(--brand-deep);
  background: #effaff;
  font-size: 12px;
  white-space: nowrap;
}

.formal-subscription-view-order:hover {
  border-color: var(--brand);
  background: var(--brand-pale);
}

.formal-subscription-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.formal-subscription-resubscribe {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #f0cf8b;
  border-radius: 5px;
  color: #8b5c0b;
  background: #fff9eb;
  font-size: 12px;
  white-space: nowrap;
}

.formal-subscription-resubscribe:hover {
  border-color: #dcae4c;
  background: #fff2cf;
}

.formal-subscription-resubscribe:disabled {
  cursor: wait;
  opacity: .68;
}

.formal-subscription-resubscribe svg {
  width: 14px;
  height: 14px;
}

.formal-subscription-view-order svg {
  width: 14px;
  height: 14px;
}

.formal-manual-entry-view {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.formal-manual-entry-panel {
  margin-top: 20px;
}

.formal-manual-entry-heading {
  align-items: flex-start;
}

.formal-manual-entry-form {
  padding-top: 18px;
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.formal-manual-entry-form .formal-form-actions {
  padding-top: 2px;
}

.formal-content-settings-view {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.formal-content-settings-panel {
  margin-top: 20px;
}

.formal-content-settings-form {
  padding-top: 18px;
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.formal-content-settings-form textarea {
  min-height: 92px;
  resize: vertical;
}

.formal-content-settings-actions {
  flex-wrap: wrap;
}

.formal-account-settings-view {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.formal-account-settings-panel {
  margin-top: 20px;
}

.formal-account-settings-note {
  margin: 18px 0 0;
  padding: 11px 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #c8e3ec;
  border-radius: 6px;
  color: #397080;
  background: #edf9fc;
  font-size: 12px;
}

.formal-account-settings-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--brand-deep);
}

.formal-account-settings-form {
  padding-top: 18px;
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.formal-account-settings-form .field > span small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.formal-account-settings-actions {
  flex-wrap: wrap;
}

.formal-visitor-records-view {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.formal-visitor-summary {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.formal-visitor-summary-item {
  min-width: 0;
  min-height: 88px;
  padding: 13px 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  background: #fff;
}

.formal-visitor-summary-item + .formal-visitor-summary-item {
  border-left: 1px solid var(--line);
}

.formal-visitor-summary-item.accent {
  background: #f7fcfe;
}

.formal-visitor-summary-item > span,
.formal-visitor-summary-item > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-visitor-summary-item > span {
  font-size: 12px;
}

.formal-visitor-summary-item > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-visitor-summary-item.accent > strong {
  color: var(--brand-deep);
  font-size: 18px;
}

.formal-visitor-summary-item > small {
  color: var(--muted);
  font-size: 11px;
}

.formal-visitor-records-panel,
.formal-visitor-table-panel {
  margin-top: 20px;
}

.formal-visitor-filter-grid {
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.formal-visitor-date-field {
  grid-column: span 2;
}

.formal-visitor-search-field {
  grid-column: span 2;
}

.formal-visitor-filter-actions {
  flex-wrap: wrap;
}

.formal-visitor-filter-actions .formal-muted-text {
  margin-left: auto;
}

.formal-visitor-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #c8e3ec;
  border-radius: 6px;
  color: #397080;
  background: #edf9fc;
  font-size: 12px;
  line-height: 1.55;
}

.formal-visitor-note svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--brand-deep);
}

.formal-visitor-table-wrap {
  max-width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.formal-visitor-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.formal-visitor-table th,
.formal-visitor-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

.formal-visitor-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 700;
}

.formal-visitor-table td:nth-child(3),
.formal-visitor-table td:nth-child(4),
.formal-visitor-table td:nth-child(5) {
  color: var(--ink-soft);
}

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

.formal-visitor-table .formal-empty-row td {
  padding: 25px 12px;
  color: var(--muted);
  text-align: center;
}

.formal-visitor-summary-row {
  transition: background-color 160ms ease;
}

.formal-visitor-summary-row:hover td {
  background: #f8fbfc;
}

.formal-visitor-summary-row td {
  white-space: normal;
}

.formal-visitor-summary-row .formal-visitor-id-cell {
  min-width: 148px;
  white-space: normal;
}

.formal-visitor-summary-row .formal-visitor-id-cell strong,
.formal-visitor-summary-row .formal-visitor-id-cell small,
.formal-visitor-summary-row .formal-visitor-location-cell strong,
.formal-visitor-summary-row .formal-visitor-location-cell small {
  display: block;
}

.formal-visitor-summary-row .formal-visitor-id-cell strong {
  color: var(--brand-deep);
  font-weight: 700;
}

.formal-visitor-summary-row .formal-visitor-id-cell small,
.formal-visitor-summary-row .formal-visitor-location-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.formal-visitor-summary-row .formal-visitor-location-cell {
  min-width: 126px;
  white-space: normal;
}

.formal-visitor-summary-row .formal-visitor-location-cell strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.formal-visitor-summary-row .formal-visitor-behavior-cell {
  min-width: 230px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.formal-visitor-row-actions {
  min-width: 96px;
  white-space: nowrap !important;
}

.formal-visitor-detail-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
}

.formal-visitor-detail-button svg {
  width: 14px;
  height: 14px;
}

.formal-visitor-detail-row td {
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.formal-visitor-detail-panel {
  padding: 14px 16px 16px;
  border-top: 1px solid #c8e3ec;
}

.formal-visitor-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.formal-visitor-detail-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.formal-visitor-detail-heading span {
  color: var(--muted);
  font-size: 11px;
}

.formal-visitor-timeline {
  display: grid;
  gap: 7px;
}

.formal-visitor-timeline-item {
  min-width: 0;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 112px 92px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  line-height: 1.45;
}

.formal-visitor-timeline-item time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.formal-visitor-timeline-event {
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.formal-visitor-timeline-item > span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-manual-tracking-field {
  grid-column: 1 / -1;
}

.formal-manual-tracking-field textarea {
  min-height: 88px;
  resize: vertical;
}

.formal-query-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.formal-query-heading h1 {
  margin: 6px 0 5px;
  font-size: 29px;
  line-height: 1.15;
}

.formal-query-heading h1 small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.formal-query-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.formal-query-filter-panel,
.formal-query-results-panel {
  margin-top: 20px;
}

.formal-query-filter-grid {
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.formal-query-date-field {
  grid-column: span 2;
}

.formal-query-tracking-field {
  grid-column: span 2;
}

.formal-date-range {
  position: relative;
  min-height: 40px;
}

.formal-date-range-button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  text-align: left;
}

.formal-date-range-button:hover,
.formal-date-range-button[aria-expanded="true"] {
  border-color: var(--brand);
}

.formal-date-range-button:focus-visible,
.formal-calendar-nav-button:focus-visible,
.formal-calendar-day:focus-visible,
.formal-calendar-presets button:focus-visible {
  outline: 3px solid rgba(14, 155, 211, 0.2);
  outline-offset: 1px;
}

.formal-date-range-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formal-date-range-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
}

.formal-date-range-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(690px, calc(100vw - 56px));
  max-height: min(590px, calc(100vh - 128px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 14px 34px rgba(29, 47, 61, 0.17);
}

.formal-date-range-popover[hidden] {
  display: none;
}

.formal-calendar-toolbar {
  min-height: 48px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.formal-calendar-nav-group {
  display: flex;
  gap: 2px;
}

.formal-calendar-nav-button {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}

.formal-calendar-nav-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-soft);
}

.formal-calendar-nav-button:disabled {
  color: #c6cfd5;
  cursor: not-allowed;
}

.formal-calendar-nav-button svg {
  width: 16px;
  height: 16px;
}

.formal-calendar-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.formal-calendar-months {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.formal-calendar-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.formal-calendar-weekday {
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.formal-calendar-day {
  width: 100%;
  min-width: 0;
  height: 35px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
}

.formal-calendar-day:hover:not(:disabled) {
  border-color: #b8dfea;
  color: var(--brand-deep);
  background: #f1f9fb;
}

.formal-calendar-day.in-range {
  color: #16799f;
  background: #edf8fb;
}

.formal-calendar-day.range-start,
.formal-calendar-day.range-end {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  font-weight: 700;
}

.formal-calendar-day.is-today:not(.range-start):not(.range-end) {
  border-color: #86cadf;
  color: var(--brand-deep);
  font-weight: 700;
}

.formal-calendar-day.outside-month,
.formal-calendar-day:disabled {
  color: #c4cdd3;
  background: #f7f9fa;
  cursor: not-allowed;
}

.formal-calendar-presets {
  padding: 10px 12px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--line);
}

.formal-calendar-presets button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d9e8ee;
  border-radius: 5px;
  color: #177ba1;
  background: #f5fafc;
  font-size: 12px;
}

.formal-calendar-presets button:hover {
  border-color: #9fd4e4;
  background: #ebf7fa;
}

.formal-query-actions {
  padding-top: 16px;
  flex-wrap: wrap;
}

.formal-query-panel-heading h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.formal-query-results-panel .formal-query-table-wrap {
  margin-top: 17px;
}

.formal-query-table {
  min-width: 940px;
}

.formal-query-table th:last-child,
.formal-query-table td:last-child {
  width: 210px;
  min-width: 210px;
  text-align: center;
}

.formal-query-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.formal-logistics-status {
  display: block;
  color: var(--ink);
}

.formal-sync-badge {
  width: max-content;
  max-width: 100%;
  min-height: 20px;
  margin-top: 5px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.formal-sync-badge.success {
  border-color: #b7e2d2;
  color: #177858;
  background: var(--green-pale);
}

.formal-sync-badge.warning {
  border-color: #f1d28d;
  color: #946515;
  background: var(--amber-pale);
}

.formal-sync-badge.pending {
  border-color: #c8e3ec;
  color: var(--brand-deep);
  background: var(--brand-pale);
}

.formal-table-edit-button,
.table-edit-button {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #b8dce9;
  border-radius: 5px;
  color: var(--brand-deep);
  background: #effaff;
  font-size: 12px;
  white-space: nowrap;
}

.formal-table-edit-button:hover,
.table-edit-button:hover {
  border-color: var(--brand);
  background: var(--brand-pale);
}

.formal-table-edit-button svg,
.table-edit-button svg,
.formal-table-logistics-button svg {
  width: 14px;
  height: 14px;
}

.formal-table-logistics-button {
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #b9d9c9;
  border-radius: 5px;
  color: #26785d;
  background: #f0fbf6;
  font-size: 12px;
  white-space: nowrap;
}

.formal-table-logistics-button:hover {
  border-color: #61b995;
  background: #e5f7ee;
}

.formal-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(18, 35, 48, 0.45);
}

.formal-edit-dialog,
.formal-custom-carrier-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.formal-custom-carrier-dialog {
  width: min(620px, 100%);
}

.formal-logistics-dialog {
  width: min(650px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.formal-logistics-dialog h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.formal-logistics-summary {
  margin-top: 20px;
  padding: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.formal-logistics-summary-item {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.formal-logistics-summary-item span {
  color: var(--muted);
  font-size: 11px;
}

.formal-logistics-summary-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.formal-logistics-summary-item strong.formal-logistics-current-status {
  color: var(--brand-deep);
}

.formal-logistics-summary-item strong.formal-logistics-sync-status.success {
  color: var(--green);
}

.formal-logistics-summary-item strong.formal-logistics-sync-status.warning {
  color: #946515;
}

.formal-logistics-summary-item strong.formal-logistics-sync-status.pending {
  color: var(--brand-deep);
}

.formal-logistics-events {
  margin-top: 20px;
}

.formal-logistics-events-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.formal-logistics-events-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.formal-logistics-timeline {
  position: relative;
  margin: 15px 0 0 7px;
  padding: 2px 0 2px 25px;
  border-left: 1px solid #c4d7df;
}

.formal-logistics-timeline-item {
  position: relative;
  padding: 0 0 20px;
}

.formal-logistics-timeline-item:last-child {
  padding-bottom: 0;
}

.formal-logistics-timeline-rail {
  position: absolute;
  top: 3px;
  left: -31px;
  width: 11px;
  height: 11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 1px #9dcdda;
}

.formal-logistics-timeline-item.is-latest .formal-logistics-timeline-rail {
  background: var(--green);
  box-shadow: 0 0 0 1px #8bd2bb;
}

.formal-logistics-timeline-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.formal-logistics-timeline-content time {
  color: var(--muted);
  font-size: 11px;
}

.formal-logistics-timeline-content p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.formal-logistics-timeline-location {
  color: #9aa7b0;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.formal-logistics-latest-label {
  width: max-content;
  padding: 2px 6px;
  border: 1px solid #b7e2d2;
  border-radius: 4px;
  color: #177858;
  background: var(--green-pale);
  font-size: 10px;
}

.formal-logistics-empty {
  min-height: 140px;
  padding: 24px 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

.formal-logistics-empty svg {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.formal-logistics-empty strong {
  color: var(--ink-soft);
  font-size: 14px;
}

.formal-logistics-empty p {
  max-width: 420px;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.formal-edit-dialog h2,
.formal-custom-carrier-dialog h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.formal-edit-form {
  padding-top: 20px;
}

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

.formal-edit-tracking-field {
  grid-column: 1 / -1;
}

.formal-custom-carrier-form {
  padding-top: 20px;
}

.formal-custom-carrier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.formal-custom-carrier-saved {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.formal-custom-carrier-saved-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.formal-custom-carrier-saved-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.formal-custom-carrier-list {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.formal-custom-carrier-item {
  min-height: 48px;
  padding: 8px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.formal-custom-carrier-identity {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.formal-custom-carrier-identity strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.formal-custom-carrier-identity code {
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

.formal-custom-carrier-remove {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #e9b9b9;
  border-radius: 5px;
  color: #a33b3b;
  background: #fff;
}

.formal-custom-carrier-remove:hover,
.formal-custom-carrier-remove:focus-visible {
  border-color: #d98f8f;
  color: #8c2727;
  background: #fff5f5;
}

.formal-custom-carrier-remove:focus-visible {
  outline: 3px solid rgba(163, 59, 59, 0.14);
  outline-offset: 1px;
}

.formal-custom-carrier-remove svg {
  width: 15px;
  height: 15px;
}

.formal-custom-carrier-empty {
  margin: 0;
  padding: 15px 2px 2px;
  color: var(--muted);
  font-size: 12px;
}

.formal-dialog-message,
.dialog-message {
  min-height: 22px;
  margin: 13px 0 0;
  color: var(--green);
  font-size: 12px;
}

.formal-dialog-message.error,
.dialog-message.error {
  color: var(--red);
}

.formal-dialog-actions {
  padding-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 850px) {
  .formal-automation-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formal-automation-last {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid var(--line);
    border-left: 0 !important;
  }

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

  .formal-query-date-field,
  .formal-query-tracking-field {
    grid-column: span 2;
  }

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

  .formal-subscription-summary-item:nth-child(3) {
    border-left: 0;
  }

  .formal-subscription-summary-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

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

  .formal-visitor-summary-item:nth-child(3) {
    border-left: 0;
  }

  .formal-visitor-summary-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

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

  .formal-visitor-search-field {
    grid-column: span 2;
  }

  .formal-subscription-toolbar {
    grid-template-columns: auto minmax(0, 1fr) 34px;
  }
}

@media (max-width: 620px) {
  .formal-preview-notice,
  .formal-automation-strip {
    width: min(100% - 28px, 1160px);
  }

  .formal-preview-notice {
    align-items: flex-start;
  }

  .formal-automation-strip {
    grid-template-columns: 1fr;
  }

  .formal-automation-item {
    min-height: 60px;
    padding: 10px 12px;
  }

  .formal-automation-item + .formal-automation-item,
  .formal-automation-last {
    grid-column: auto;
    grid-row: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .formal-automation-item small {
    white-space: normal;
  }

  .formal-automation-item time {
    align-self: flex-start;
  }

  .formal-batch-import-view,
  .formal-bottom-query-view,
  .formal-subscription-history-view,
  .formal-visitor-records-view {
    width: min(100% - 28px, 1160px);
    padding-top: 26px;
  }

  .formal-manual-entry-view {
    width: min(100% - 28px, 860px);
    padding-top: 26px;
  }

  .formal-content-settings-view {
    width: min(100% - 28px, 860px);
    padding-top: 26px;
  }

  .formal-account-settings-view {
    width: min(100% - 28px, 860px);
    padding-top: 26px;
  }

  .formal-visitor-detail-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .formal-visitor-timeline-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .formal-visitor-timeline-item > span:last-child {
    white-space: normal;
  }

  .formal-manual-entry-heading .secondary-button {
    width: 100%;
  }

  .formal-query-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .formal-query-heading h1 {
    font-size: 25px;
  }

  .formal-query-heading h1 small {
    display: block;
    margin-top: 4px;
  }

  .formal-query-heading .secondary-button {
    width: 100%;
  }

  .formal-subscription-toolbar {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .formal-subscription-date-field {
    min-width: 0;
    grid-column: 1 / -1;
  }

  .formal-subscription-range {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .formal-subscription-range button {
    padding-inline: 7px;
  }

  .formal-subscription-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .formal-subscription-table {
    min-width: 0;
  }

  .formal-subscription-table thead {
    display: none;
  }

  .formal-subscription-table tbody {
    display: grid;
    gap: 10px;
  }

  .formal-subscription-table tr {
    padding: 9px 12px;
    display: grid;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }

  .formal-subscription-table td {
    padding: 8px 0;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 1px solid #edf1f3;
  }

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

  .formal-subscription-table td:last-child {
    border-bottom: 0;
  }

  .formal-subscription-table .formal-empty-row {
    display: block;
  }

  .formal-subscription-table .formal-empty-row td {
    display: block;
    padding: 22px 10px;
    border: 0;
    text-align: center;
  }

  .formal-subscription-table .formal-empty-row td::before {
    content: none;
  }

  .formal-subscription-message,
  .formal-subscription-waybill strong {
    max-width: none;
  }

  .formal-recognition-grid {
    grid-template-columns: 1fr;
  }

  .formal-recognition-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .formal-recognition-status {
    text-align: left;
  }

  .formal-query-filter-grid {
    grid-template-columns: 1fr;
  }

  .formal-visitor-filter-grid {
    grid-template-columns: 1fr;
  }

  .formal-visitor-search-field {
    grid-column: auto;
  }

  .formal-visitor-date-field {
    grid-column: auto;
  }

  .formal-visitor-filter-actions {
    align-items: stretch;
  }

  .formal-visitor-filter-actions button {
    flex: 1;
  }

  .formal-visitor-filter-actions .formal-muted-text {
    width: 100%;
    margin-left: 0;
  }

  .formal-visitor-table-wrap {
    margin-inline: -1px;
    border-radius: 0;
  }

  .formal-query-date-field,
  .formal-query-tracking-field {
    grid-column: auto;
  }

  .formal-date-range-popover {
    width: 100%;
    max-height: min(560px, calc(100vh - 104px));
  }

  .formal-calendar-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .formal-calendar-right-title,
  .formal-calendar-right-grid {
    display: none;
  }

  .formal-calendar-months {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .formal-calendar-day {
    height: 38px;
  }

  .formal-calendar-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .formal-calendar-presets button {
    width: 100%;
  }

  .formal-batch-toolbar,
  .formal-batch-toolbar .formal-batch-dropzone,
  .formal-batch-toolbar .formal-batch-dropzone .file-button,
  .formal-batch-toolbar .primary-button {
    width: 100%;
  }

  .formal-batch-dropzone {
    justify-content: center;
  }

  .formal-batch-drop-confirm {
    width: 100%;
    flex-wrap: wrap;
  }

  .formal-batch-drop-file-name {
    width: 100%;
    max-width: none;
  }

  .formal-batch-note {
    width: 100%;
  }

  .formal-batch-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .formal-inline-actions {
    width: 100%;
  }

  .formal-inline-actions button {
    flex: 1;
  }

  .formal-edit-dialog,
  .formal-custom-carrier-dialog {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .formal-logistics-dialog {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

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

  .formal-edit-grid {
    grid-template-columns: 1fr;
  }

  .formal-custom-carrier-grid {
    grid-template-columns: 1fr;
  }

  .formal-edit-tracking-field {
    grid-column: auto;
  }

  .formal-dialog-actions {
    justify-content: stretch;
  }

  .formal-dialog-actions button {
    flex: 1;
  }
}
/* Public home visual preview v2. The selectors are deliberately scoped to
   the home state so result pages, the admin view, and their interactions keep
   the existing layout. */
.public-shell {
  --hero-ink: #ffffff;
  --hero-lavender: #858bb8;
  --hero-blue: #78c7e2;
  --hero-cta: #7889df;
  background: #edf1fb;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: var(--hero-lavender) url("./assets/public-hero-arch.png") center center / cover no-repeat;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, rgba(75, 72, 130, 0.15), rgba(115, 194, 221, 0.06) 58%, rgba(75, 72, 130, 0.2));
  pointer-events: none;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
  position: relative;
  width: min(1240px, calc(100% - 64px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 18px;
  padding: 26px 0 0;
}

.public-hero-nav {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 20px;
  z-index: 4;
}

.public-hero-brand {
  appearance: none;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--hero-ink);
  background: transparent;
  text-align: left;
}

.public-hero-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 14px;
  color: #545b8e;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 9px 24px rgba(56, 52, 99, 0.14);
  font-size: 21px;
  font-weight: 900;
}

.public-hero-brand-copy {
  display: grid;
  gap: 1px;
}

.public-hero-brand-copy strong {
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
  text-shadow: 0 2px 14px rgba(45, 46, 88, 0.25);
}

.public-hero-brand-copy small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.25;
}

.public-hero-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(50, 48, 91, 0.12);
  backdrop-filter: blur(14px);
}

.public-hero-links button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #686985;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.public-hero-links button:hover,
.public-hero-links button:focus-visible {
  color: #3d447a;
  background: rgba(255, 255, 255, 0.96);
}

.public-hero-cta {
  justify-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 17px 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: var(--hero-cta);
  box-shadow: 0 9px 22px rgba(61, 65, 145, 0.26);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.public-hero-cta:hover {
  background: #697bd6;
  transform: translateY(-1px);
}

.public-hero-cta svg {
  width: 15px;
  height: 15px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy {
  position: relative;
  z-index: 3;
  max-width: 920px;
  margin-top: 28px;
  color: var(--hero-ink);
  text-align: center;
}

.public-hero-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 6.4vw, 86px);
  font-weight: 850;
  line-height: 0.99;
  letter-spacing: 0;
  text-shadow: 0 5px 28px rgba(57, 54, 105, 0.22);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy h1 span {
  color: rgba(255, 255, 255, 0.94);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy p {
  max-width: 520px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.7;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box {
  position: relative;
  z-index: 5;
  width: min(880px, 100%);
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 46px rgba(44, 47, 100, 0.19);
  backdrop-filter: blur(15px);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .input-row {
  gap: 9px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .input-row input {
  min-height: 58px;
  border: 1px solid #e2e5f1;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 16px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-button {
  min-width: 126px;
  min-height: 58px;
  border-radius: 13px;
  color: #fff;
  background: var(--hero-cta);
  box-shadow: 0 5px 0 #5f6fc6;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-button:hover {
  background: #697bd6;
  box-shadow: 0 6px 0 #5f6fc6;
}

.public-hero-query-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  color: #717694;
  font-size: 11px;
}

.public-hero-query-note svg {
  width: 14px;
  height: 14px;
  color: #5c72c5;
}

.public-hero-device {
  position: absolute;
  left: 50%;
  bottom: -274px;
  z-index: 2;
  width: 248px;
  height: 522px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 38px 38px 0 0;
  background: linear-gradient(145deg, rgba(242, 242, 255, 0.95), rgba(188, 193, 239, 0.94));
  box-shadow: 0 20px 56px rgba(49, 47, 104, 0.28), inset 0 0 0 1px rgba(103, 105, 164, 0.24);
  transform: translateX(-50%) rotate(2.5deg);
  pointer-events: none;
}

.public-hero-device-speaker {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 76px;
  height: 18px;
  border-radius: 999px;
  background: rgba(25, 28, 56, 0.96);
  transform: translateX(-50%);
}

.public-hero-device-screen {
  height: 100%;
  padding: 34px 18px 24px;
  overflow: hidden;
  border-radius: 29px 29px 0 0;
  color: #535b8d;
  background: linear-gradient(160deg, #e7e8ff 0%, #c9d3f4 58%, #a9d8e6 100%);
}

.public-device-status,
.public-device-status-pill,
.public-device-route,
.public-device-status {
  display: flex;
  align-items: center;
}

.public-device-status {
  justify-content: space-between;
  color: rgba(79, 84, 137, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.public-device-status svg {
  width: 14px;
  height: 14px;
}

.public-device-greeting {
  margin-top: 42px;
  color: #4a5389;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.08;
}

.public-device-number {
  margin-top: 10px;
  color: rgba(78, 84, 136, 0.7);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.public-device-status-pill {
  width: fit-content;
  gap: 5px;
  margin-top: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #4a61b6;
  background: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 800;
}

.public-device-status-pill svg {
  width: 13px;
  height: 13px;
}

.public-device-route {
  align-items: flex-start;
  gap: 9px;
  margin-top: 20px;
  color: #59628e;
}

.public-device-route > span {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  flex: 0 0 auto;
  border: 2px solid rgba(77, 95, 173, 0.55);
  border-radius: 50%;
}

.public-device-route > span.is-active {
  border-color: #6678d2;
  background: #6678d2;
  box-shadow: 0 0 0 4px rgba(102, 120, 210, 0.15);
}

.public-device-route strong,
.public-device-route small {
  display: block;
}

.public-device-route strong {
  font-size: 10px;
  line-height: 1.4;
}

.public-device-route small {
  margin-top: 3px;
  color: rgba(77, 84, 135, 0.68);
  font-size: 9px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .content-wrap {
  position: relative;
  z-index: 6;
  width: min(1100px, calc(100% - 40px));
  margin: -34px auto 0;
  padding: 0 0 62px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .date-index,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .introduction-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(55, 61, 113, 0.1);
  backdrop-filter: blur(14px);
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel {
  grid-column: 1 / -1;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel,
.public-shell .public-view:not(.has-results):not(.has-date-lookup) .introduction-panel {
  padding: 22px 24px;
}

.public-shell .public-view:not(.has-results):not(.has-date-lookup) .date-index {
  padding: 12px 18px;
}

@media (max-width: 760px) {
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-hero,
  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    min-height: 700px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-inner {
    width: min(100% - 28px, 560px);
    gap: 14px;
    padding-top: 18px;
  }

  .public-hero-nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .public-hero-links {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .public-hero-links::-webkit-scrollbar {
    display: none;
  }

  .public-hero-links button {
    flex: 0 0 auto;
    padding: 0 14px;
  }

  .public-hero-cta {
    min-height: 38px;
    padding: 0 13px 0 15px;
  }

  .public-hero-brand-mark {
    width: 38px;
    height: 38px;
  }

  .public-hero-brand-copy strong {
    font-size: 15px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy {
    margin-top: 18px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy h1 {
    font-size: clamp(32px, 9.2vw, 48px);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .hero-copy p {
    max-width: 330px;
    margin-top: 14px;
    font-size: 13px;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-box {
    width: 100%;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .query-button {
    width: 100%;
  }

  .public-hero-device {
    display: none;
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .content-wrap {
    width: min(100% - 28px, 560px);
    margin-top: -18px;
    grid-template-columns: minmax(0, 1fr);
  }

  .public-shell .public-view:not(.has-results):not(.has-date-lookup) .announcement-panel {
    grid-column: auto;
  }
}
