/* Soft glass surfaces, pastel light and rounded controls. */
:root {
  --ink: #24252a;
  --muted: #71717e;
  --line: #dedee680;
  --surface: #ffffff8c;
  --bg: #eeedf1;
  --accent: #176bd7;
  --danger: #b42330;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 10% 6%, #e5def5 0, transparent 48%),
    radial-gradient(ellipse at 95% 70%, #e1ebd6 0, transparent 46%),
    radial-gradient(ellipse at 40% 100%, #f7e7ee 0, transparent 50%), #eeedf1;
  background-attachment: fixed;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
}
button,
a {
  transition:
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #89bdf3;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 14px;
  font-weight: 500;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.full {
  width: 100%;
}
/* Header and workspace. */
.topbar {
  min-height: 72px;
  padding: 0 max(28px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff80;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #ffffffad;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ebe5f7, #dfe9d1);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #ffffffb3;
  font-size: 20px;
  font-weight: 500;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}
.top-actions .button {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 12px;
}
.divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}
#userName {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.workspace {
  max-width: 1216px;
  margin: 0 auto;
  padding: 44px 28px 90px;
}
.intro {
  margin-bottom: 30px;
}
.intro h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -1.4px;
  margin: 0;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.card {
  border: 1px solid #ffffffc4;
  background: linear-gradient(145deg, #ffffffbf, #ffffff65);
  border-radius: 30px;
  backdrop-filter: blur(24px);
  box-shadow:
    0 16px 40px #49425708,
    inset 0 1px 0 #fff;
}
.form-card {
  overflow: hidden;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.form-card > .section-heading {
  padding: 26px 30px 22px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
#registrationForm {
  padding: 26px 30px 28px;
}
/* Form controls. */
.button {
  border: 1px solid transparent;
  border-radius: 16px;
  min-height: 44px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.primary {
  color: white;
  background: #2389ec;
  border-radius: 28px;
  box-shadow: 0 6px 18px #2389ec1f;
}
.primary:hover:not(:disabled) {
  background: #1476d7;
}
.secondary {
  background: #ffffff9e;
  border-color: #ffffffcf;
  border-radius: 28px;
  color: var(--ink);
}
.secondary:hover:not(:disabled) {
  background: #eaeaec;
}
.subtle {
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 5px 8px;
  font-weight: 400;
}
.subtle:hover {
  color: var(--ink);
  background: #f5f5f7;
}
.field {
  margin-bottom: 23px;
  min-width: 0;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #424245;
  margin-bottom: 9px;
}
label em {
  font-style: normal;
  color: #86868b;
  font-weight: 400;
  margin-left: 3px;
}
label span {
  font-size: 11px;
  color: #86868b;
  margin-left: 5px;
  font-weight: 400;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  display: block;
  border: 1px solid #ffffffc7;
  background: #ffffff99;
  box-shadow: inset 0 1px 3px #59526406;
  border-radius: 16px;
  padding: 11px 13px;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
input,
select {
  height: 46px;
}
input::placeholder,
textarea::placeholder {
  color: #909095;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #0071e31a;
}
input[readonly] {
  background: #e9e8ee66;
  border-color: #ffffff8c;
  color: #717176;
  cursor: default;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.8;
}
.input-action {
  display: flex;
  gap: 10px;
}
.input-action .button {
  padding: 10px 19px;
}
.field-foot {
  margin-top: 12px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}
.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
  box-shadow: none;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-rule {
  border-top: 1px solid var(--line);
  margin: 3px 0 23px;
  padding-top: 23px;
  font-size: 15px;
  font-weight: 600;
}
.field-help {
  color: var(--muted);
  font-size: 11px;
  margin: 9px 0 0;
  overflow-wrap: anywhere;
}
.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}
.order-details {
  background: #e7e5eb70;
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 24px;
}
.product-heading,
.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 34px;
  gap: 12px;
}
.product-heading {
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid #e2e2e5;
  padding-bottom: 10px;
}
.product-row {
  padding-top: 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.product-heading span:last-child,
.product-row span:last-child {
  text-align: right;
}
#addressText {
  margin: 0;
  font-size: 12px;
}
#addressText:not(:empty) {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
/* Preview. */
.preview-card {
  padding: 28px;
  position: sticky;
  top: 96px;
}
.badge {
  border-radius: 24px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--muted);
  background: #f5f5f7;
  white-space: nowrap;
}
.badge[data-state="ready"] {
  color: #505055;
  background: #eeeeef;
}
.badge[data-state="saved"] {
  color: #287450;
  background: #edf6f0;
}
.preview-paper {
  background: linear-gradient(155deg, #ece8f2a3, #fcfbf8b3 56%, #dbeac6a1);
  border: 1px solid #ffffffc4;
  border-radius: 24px;
  padding: 22px;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.empty-preview {
  text-align: center;
  padding: 36px 0;
  color: #aaaab0;
}
.empty-icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.1;
}
.empty-preview h3 {
  margin: 16px 0 0;
  color: #86868b;
  font-size: 13px;
  font-weight: 400;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 13px;
  line-height: 2;
  color: #515156;
  margin: 0;
}
.integration-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 20px 0;
}
.status-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: #8d8d92;
  border-radius: 50%;
  margin-top: 7px;
}
.integration-note strong {
  font-size: 12px;
  color: #515156;
  font-weight: 500;
}
.integration-note p {
  color: var(--muted);
  font-size: 11px;
  margin: 4px 0 0;
}
#destinationLink {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}
.inline-status {
  font-size: 12px;
  color: #515156;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.inline-status:empty {
  display: none;
}
.inline-status.error {
  color: var(--danger);
  background: #fff3f3;
  border-radius: 8px;
  padding: 10px 12px;
}
/* Conversation and modal controls. */
.chat-launch {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 17px;
  background: #fff;
  color: #424245;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 4px 18px #00000008;
  font-size: 12px;
}
.chat-launch:hover {
  background: #f5f5f7;
}
.chat-panel {
  position: fixed;
  right: 28px;
  bottom: 80px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 535px;
  max-height: calc(100dvh - 100px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #faf8fcf2;
  border: 1px solid #ffffffcf;
  border-radius: 18px;
  box-shadow: 0 18px 60px #0000001a;
  overflow: hidden;
}
.chat-panel > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.chat-panel h2 {
  font-size: 16px;
}
.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
  background: #fafafa;
}
.chat-message {
  background: #faf8fcf2;
  border: 1px solid #ffffffcf;
  border-radius: 12px 12px 12px 3px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #515156;
  line-height: 1.8;
}
.chat-message.user {
  margin-left: 26px;
  background: #ececee;
  border-color: #ececee;
  border-radius: 12px 12px 3px 12px;
}
.chat-shortcuts {
  display: flex;
  gap: 7px;
  padding: 12px 14px 0;
}
.chat-shortcuts button {
  background: #f5f5f7;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  color: #515156;
  font-size: 11px;
}
.chat-panel form {
  padding: 12px 14px;
}
.chat-panel label {
  font-size: 11px;
}
.chat-panel textarea {
  min-height: 68px;
  font-size: 13px;
}
.chat-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.chat-panel footer small {
  color: var(--muted);
  font-size: 10px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: #86868b;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 23px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.icon-button:hover {
  background: #f0f0f2;
  color: var(--ink);
}
dialog {
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid #ffffffdb;
  border-radius: 30px;
  background: linear-gradient(135deg, #f6f2fcf5, #fafcf5f5);
  padding: 28px;
  color: var(--ink);
  box-shadow: 0 24px 80px #00000026;
}
dialog::backdrop {
  background: #28233233;
  backdrop-filter: blur(9px);
}
dialog .section-heading {
  margin-bottom: 20px;
}
dialog .muted {
  margin-bottom: 22px;
}
dialog .field {
  margin-top: 18px;
}
dialog > h2 {
  margin-bottom: 12px;
}
dialog pre {
  max-height: 52dvh;
  overflow: auto;
  padding: 16px;
  background: #e7e5eb70;
  border-radius: 16px;
}
/* Login and registration. */
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-card {
  width: 430px;
  max-width: 100%;
  padding: 40px;
}
.auth-card > .brand {
  margin-bottom: 34px;
}
.auth-card h1 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.8px;
  margin-bottom: 28px;
}
.auth-card > .muted {
  margin: -12px 0 26px;
}
.auth-card .primary {
  height: 46px;
  margin-top: 6px;
}
.auth-footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 24px 0 0;
}
.auth-footer a {
  color: var(--accent);
}
.captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.captcha-row img {
  width: 150px;
  height: 45px;
  border-radius: 8px;
}
.captcha-row button {
  background: none;
  border: 0;
  padding: 0;
}
/* Responsive and compact layouts. */
@media (max-width: 900px) {
  .workspace {
    padding: 32px 24px 90px;
  }
  .topbar {
    padding: 0 24px;
  }
  .work-grid {
    gap: 18px;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .form-card > .section-heading,
  #registrationForm,
  .preview-card {
    padding: 22px;
  }
  .preview-paper {
    padding: 18px;
  }
  .field-row {
    gap: 12px;
  }
}
@media (max-width: 740px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
  .preview-card {
    position: static;
  }
  .intro {
    margin-bottom: 24px;
  }
  .topbar {
    min-height: 64px;
  }
  .top-actions {
    gap: 10px;
  }
  .divider {
    display: none;
  }
  .preview-paper {
    min-height: 230px;
  }
}
@media (max-width: 460px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .topbar {
    padding: 0 18px;
    gap: 12px;
  }
  .brand {
    font-size: 16px;
    gap: 7px;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions .button {
    padding: 6px 9px;
    font-size: 11px;
  }
  #userName {
    max-width: 48px;
    font-size: 11px;
  }
  .workspace {
    padding: 28px 16px 84px;
  }
  .card {
    border-radius: 24px;
  }
  .form-card > .section-heading,
  #registrationForm,
  .preview-card {
    padding: 20px;
  }
  h2 {
    font-size: 16px;
  }
  .input-action {
    gap: 8px;
  }
  .input-action .button {
    padding: 10px 13px;
  }
  .input-action input {
    font-size: 12px;
  }
  .chat-launch {
    right: 16px;
    bottom: 18px;
  }
  .chat-panel {
    right: 16px;
    bottom: 72px;
  }
  .auth-card {
    padding: 28px 24px;
  }
  dialog {
    padding: 24px;
  }
}
.compact .intro {
  display: none;
}
.compact .workspace {
  max-width: 600px;
  padding: 24px 18px 84px;
}
.compact .work-grid {
  grid-template-columns: 1fr;
  gap: 18px;
}
.compact .preview-card {
  position: static;
}
.compact .preview-paper {
  min-height: 180px;
}
.compact .empty-preview {
  padding: 20px 0;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

/* Shared dropdown manager. */
#optionsDialog {
  width: 660px;
}
.option-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #e4e2e966;
  border-radius: 20px;
  margin-bottom: 22px;
}
.option-tabs button {
  flex: 1;
  border: 0;
  border-radius: 16px;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.option-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: #ffffffce;
  box-shadow: 0 3px 10px #49425708;
}
.option-add {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0 0 20px;
}
.option-add .field {
  flex: 1;
  margin: 0;
}
.option-list {
  display: grid;
  gap: 9px;
  max-height: 42dvh;
  overflow-y: auto;
  padding: 2px;
}
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #ffffffc4;
  border-radius: 18px;
  background: #ffffff88;
}
.option-copy {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.option-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.option-copy a {
  color: var(--accent);
  font-size: 11px;
}
.option-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.option-actions .button {
  padding: 6px 9px;
  min-height: 32px;
  font-size: 12px;
}
.option-row input {
  min-width: 0;
  flex: 1;
}
.option-empty {
  text-align: center;
  padding: 32px 12px;
  font-size: 13px;
  color: var(--muted);
}
.option-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.danger {
  color: var(--danger);
}
@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 18px;
    gap: 10px;
  }
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .option-row {
    flex-wrap: wrap;
  }
  .option-row input {
    flex-basis: 100%;
  }
  .option-actions {
    margin-left: auto;
  }
}
@media (max-width: 420px) {
  .topbar .brand {
    font-size: 14px;
  }
  .topbar .brand-mark {
    display: none;
  }
  #userName {
    display: none;
  }
  .top-actions .button {
    font-size: 11px;
    padding: 6px 8px;
  }
}
/* Themed dropdowns share the same glass surface as the surrounding form. */
label[for="logisticsNo"],
label[for="merchantId"],
label[for="issueType"],
label[for="specificInfo"] {
  font-weight: 600;
  color: var(--ink);
}
.styled-select {
  position: relative;
  min-width: 0;
}
select.native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
}
.select-trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border: 1px solid #ffffffc7;
  border-radius: 16px;
  background: #ffffff99;
  box-shadow: inset 0 1px 3px #59526406;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.select-value {
  min-width: 0;
  overflow-wrap: anywhere;
}
.select-arrow {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #858492;
  border-bottom: 1.5px solid #858492;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin: -4px 2px 0;
}
.select-trigger[aria-expanded="true"] .select-arrow {
  transform: rotate(225deg);
  margin-top: 3px;
}
.select-trigger:hover:not(:disabled) {
  background: #ffffffd9;
}
.select-trigger:focus-visible,
.select-trigger[aria-expanded="true"] {
  outline: none;
  border-color: #91bcf1;
  box-shadow: 0 0 0 3px #2389ec12;
}
.select-trigger[aria-invalid="true"] {
  border-color: var(--danger);
}
.select-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 100;
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #ffffffeb;
  border-radius: 20px;
  background: linear-gradient(140deg, #f8f5fcf5, #f5f9f0f5);
  backdrop-filter: blur(24px);
  box-shadow:
    0 12px 32px #41345126,
    inset 0 1px 0 #fff;
  scrollbar-width: thin;
  scrollbar-color: #c9c4d3 transparent;
}
.select-option {
  position: relative;
  min-height: 40px;
  padding: 10px 34px 10px 12px;
  border-radius: 12px;
  color: #41414b;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.select-option + .select-option {
  margin-top: 3px;
}
.select-option.is-active {
  background: #ffffffd9;
}
.select-option[aria-selected="true"] {
  color: #176bd7;
  font-weight: 600;
  background: #deebfcaa;
}
.select-option[aria-selected="true"]::after {
  content: "✓";
  position: absolute;
  right: 13px;
  top: 10px;
}
.select-option[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 460px) {
  .select-trigger {
    font-size: 13px;
  }
}
