:root {
  --bg: #050c17;
  --bg-elevated: #081423;
  --panel: rgba(10, 25, 43, 0.88);
  --panel-solid: #0a192b;
  --panel-soft: #0d2036;
  --panel-hover: #102741;
  --line: rgba(136, 178, 219, 0.14);
  --line-strong: rgba(97, 180, 239, 0.3);
  --text: #eef7ff;
  --text-soft: #c1d2e4;
  --muted: #7f94aa;
  --muted-2: #607489;
  --accent: #25b9ff;
  --accent-strong: #078eea;
  --accent-soft: rgba(37, 185, 255, 0.12);
  --blue: #5a77ff;
  --green: #24d7a1;
  --green-soft: rgba(36, 215, 161, 0.12);
  --amber: #ffbb62;
  --amber-soft: rgba(255, 187, 98, 0.12);
  --danger: #ff617c;
  --danger-soft: rgba(255, 97, 124, 0.12);
  --violet: #a886ff;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.42);
  --font: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(83, 145, 198, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 145, 198, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #0e2847 0%, var(--bg) 43%);
  background-size: 42px 42px, 42px 42px, auto;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, transparent 0%, rgba(5, 12, 23, 0.38) 60%, #050c17 100%);
}

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

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.13;
}

.ambient-one {
  top: 8%;
  left: -180px;
  width: 430px;
  height: 430px;
  background: #068ff0;
}

.ambient-two {
  top: 35%;
  right: -220px;
  width: 520px;
  height: 520px;
  background: #153c9b;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 13, 24, 0.8);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(22px) saturate(130%);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(68, 188, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(37, 185, 255, 0.18), rgba(14, 60, 101, 0.18));
  box-shadow: inset 0 0 18px rgba(37, 185, 255, 0.08), 0 0 24px rgba(37, 185, 255, 0.06);
}

.brand-mark::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  content: "";
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.brand-mark img {
  width: 27px;
  height: 27px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-copy small {
  margin-top: 7px;
  color: #62809d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle svg {
  color: var(--amber);
}

.save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(36, 215, 161, 0.8);
}

.save-state-short {
  display: none;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  transition: transform 140ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

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

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

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

.button-primary {
  color: #03101c;
  background: linear-gradient(135deg, #46caff 0%, #1ca3ef 56%, #3283f6 100%);
  box-shadow: 0 8px 26px rgba(28, 163, 239, 0.22), inset 0 1px rgba(255, 255, 255, 0.4);
}

.button-primary:hover {
  box-shadow: 0 10px 32px rgba(28, 163, 239, 0.32), inset 0 1px rgba(255, 255, 255, 0.45);
}

.button-secondary {
  color: var(--text-soft);
  border-color: var(--line);
  background: rgba(15, 34, 56, 0.72);
}

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

.chevron {
  width: 14px !important;
  height: 14px !important;
  color: var(--muted);
}

.menu-wrap {
  position: relative;
}

.action-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 9px);
  right: 0;
  width: 238px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(9, 24, 42, 0.98);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: menu-in 150ms ease both;
}

.action-menu::before {
  position: absolute;
  top: -5px;
  right: 22px;
  width: 9px;
  height: 9px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  content: "";
  background: #09182a;
  transform: rotate(45deg);
}

.action-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  color: var(--text-soft);
  background: transparent;
  text-align: left;
}

.action-menu button:hover {
  background: rgba(37, 185, 255, 0.08);
}

.action-menu button > svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.action-menu button span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-menu button strong {
  font-size: 13px;
}

.action-menu button small {
  color: var(--muted);
  font-size: 11px;
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 90px;
}

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

.page-heading-compact {
  justify-content: flex-end;
  margin-bottom: 16px;
}

.today-chip {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 3px 12px;
  min-width: 175px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(11, 27, 46, 0.56);
}

.today-chip span {
  grid-row: span 2;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.today-chip strong {
  font-size: 13px;
  font-weight: 650;
}

.today-chip small {
  color: var(--muted-2);
  font-size: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  position: relative;
  display: flex;
  min-height: 114px;
  align-items: center;
  gap: 15px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(13, 32, 54, 0.94), rgba(8, 21, 37, 0.88));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.015);
}

.stat-card::after {
  position: absolute;
  top: 0;
  left: 18px;
  width: 54px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(37, 185, 255, 0.85), transparent);
}

.stat-focus {
  border-color: rgba(37, 185, 255, 0.2);
  background: linear-gradient(145deg, rgba(12, 43, 70, 0.94), rgba(8, 24, 41, 0.9));
}

.stat-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid rgba(37, 185, 255, 0.18);
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.stat-icon.cyan {
  color: #58d0ff;
}

.stat-icon.violet {
  border-color: rgba(168, 134, 255, 0.18);
  color: var(--violet);
  background: rgba(168, 134, 255, 0.1);
}

.stat-icon.green {
  border-color: rgba(36, 215, 161, 0.18);
  color: var(--green);
  background: var(--green-soft);
}

.queue-glyph {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.queue-glyph i {
  display: block;
  width: 5px;
  border-radius: 2px 2px 1px 1px;
  background: currentColor;
  box-shadow: 0 0 9px rgba(37, 185, 255, 0.4);
}

.queue-glyph i:nth-child(1) { height: 12px; opacity: 0.5; }
.queue-glyph i:nth-child(2) { height: 22px; }
.queue-glyph i:nth-child(3) { height: 17px; opacity: 0.75; }

.stat-card > div:last-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  min-width: 0;
}

.stat-card span {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.stat-card strong {
  font-size: 27px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1;
}

.stat-card small {
  min-width: 0;
  margin-left: 7px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-panel {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(7, 19, 33, 0.82);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.status-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(3, 12, 22, 0.5);
}

.status-tab {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.status-tab span {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  border-radius: 99px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 9px;
}

.status-tab.is-active {
  color: var(--text);
  background: rgba(40, 88, 126, 0.32);
  box-shadow: inset 0 0 0 1px rgba(87, 167, 229, 0.08);
}

.status-tab.is-active span {
  color: var(--accent);
  background: var(--accent-soft);
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  position: relative;
  display: flex;
  width: 236px;
  height: 42px;
  align-items: center;
}

.search-box > svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-box input,
.select-wrap select,
.field > input,
.field textarea,
.level-input,
.advanced-settings input {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(8, 23, 40, 0.76);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-box input {
  height: 42px;
  padding: 0 37px 0 38px;
  border-radius: 11px;
  font-size: 12px;
}

.search-box input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: #53697f;
}

.search-box input:focus,
.select-wrap select:focus,
.field > input:focus,
.field textarea:focus,
.level-input:focus-within,
.advanced-settings input:focus {
  border-color: rgba(37, 185, 255, 0.52);
  background: rgba(10, 29, 49, 0.92);
  box-shadow: 0 0 0 3px rgba(37, 185, 255, 0.09);
}

.search-box button {
  position: absolute;
  right: 7px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.search-box button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.search-box button svg {
  width: 14px;
  height: 14px;
}

.select-wrap {
  position: relative;
  display: flex;
  width: 128px;
  height: 42px;
  align-items: center;
}

.select-wrap select {
  height: 42px;
  padding: 0 32px 0 12px;
  appearance: none;
  border-radius: 11px;
  font-size: 12px;
}

.select-wrap > svg {
  position: absolute;
  right: 11px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}

.select-wrap option {
  color: var(--text);
  background: var(--panel-solid);
}

.queue-meta {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(136, 178, 219, 0.08);
}

.queue-meta p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
}

.live-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(36, 215, 161, 0.75);
}

.text-button {
  padding: 4px 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
}

.text-button:hover {
  color: #77d7ff;
}

.queue-root {
  min-height: 320px;
  padding: 18px;
}

.date-group {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(10, 25, 43, 0.58);
}

.date-group.is-menu-open {
  position: relative;
  z-index: 40;
}

.date-group + .date-group {
  margin-top: 14px;
}

.date-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  border-radius: 15px 15px 0 0;
  background: linear-gradient(90deg, rgba(16, 43, 70, 0.72), rgba(9, 25, 43, 0.34));
}

.date-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-block {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(37, 185, 255, 0.22);
  border-radius: 10px;
  color: var(--accent);
  background: rgba(37, 185, 255, 0.09);
  font-size: 16px;
  font-weight: 750;
}

.date-title > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-title strong {
  font-size: 14px;
  font-weight: 680;
}

.date-title small,
.date-summary {
  color: var(--muted);
  font-size: 10px;
}

.date-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-summary b {
  color: var(--text-soft);
  font-weight: 600;
}

.date-summary i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

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

.order-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(120px, 0.9fr) minmax(260px, 1.8fr) 160px 88px 38px;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 12px 0;
}

.order-card + .order-card {
  border-top: 1px solid rgba(136, 178, 219, 0.09);
}

.order-card.is-completed {
  opacity: 0.68;
}

.order-card.is-completed:hover {
  opacity: 0.92;
}

.order-card.is-menu-open {
  z-index: 41;
}

.order-asset {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(100, 167, 223, 0.18);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(33, 65, 98, 0.72), rgba(10, 25, 43, 0.84)),
    radial-gradient(circle at 70% 20%, rgba(37, 185, 255, 0.16), transparent 55%);
}

.order-asset.rare {
  border-color: rgba(255, 117, 82, 0.24);
  background: radial-gradient(circle at 50% 30%, rgba(255, 98, 66, 0.15), transparent 65%), #111d2a;
}

.order-asset.coins-asset {
  border-color: rgba(255, 187, 98, 0.28);
  background: radial-gradient(circle at 50% 28%, rgba(255, 187, 98, 0.18), transparent 68%), #111d2a;
}

.order-asset img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.order-asset .asset-fallback {
  font-size: 20px;
  font-weight: 750;
}

.order-customer,
.order-target {
  min-width: 0;
}

.order-customer strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.order-subline svg {
  width: 12px;
  height: 12px;
}

.wait-badge {
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.wait-badge.is-long {
  color: var(--amber);
  background: var(--amber-soft);
}

.mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(37, 185, 255, 0.18);
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 700;
}

.mode-tag.level {
  border-color: rgba(168, 134, 255, 0.18);
  color: var(--violet);
  background: rgba(168, 134, 255, 0.1);
}

.mode-tag.insurance {
  border-color: rgba(36, 215, 161, 0.18);
  color: var(--green);
  background: var(--green-soft);
}

.order-target-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-target-line strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-note {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.order-note::before {
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 50%;
  content: "";
  background: var(--muted-2);
}

.order-note span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runs-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.runs-label {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.runs-label b {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.stepper {
  display: grid;
  grid-template-columns: 32px 40px 32px;
  height: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 15, 27, 0.6);
}

.stepper button {
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  font-weight: 400;
}

.stepper button:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-soft);
}

.stepper button:disabled {
  color: #3d5063;
}

.stepper input {
  width: 40px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(18, 43, 69, 0.52);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.stepper.is-locked {
  grid-template-columns: 1fr;
  width: 70px;
  opacity: 0.7;
}

.stepper.is-locked span {
  display: grid;
  place-items: center;
  color: var(--text-soft);
  font-size: 12px;
}

.complete-button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(36, 215, 161, 0.22);
  border-radius: 9px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
}

.complete-button:hover {
  border-color: rgba(36, 215, 161, 0.4);
  color: #adffe5;
  background: rgba(36, 215, 161, 0.18);
}

.complete-button svg {
  width: 14px;
  height: 14px;
}

.complete-button.reopen {
  border-color: var(--line);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
}

.more-wrap {
  position: relative;
}

.icon-button,
.more-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover,
.more-button:hover,
.more-button[aria-expanded="true"] {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.order-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  right: 0;
  width: 142px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #0a192b;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  animation: menu-in 140ms ease both;
}

.order-menu.opens-up {
  top: auto;
  bottom: calc(100% + 5px);
}

.order-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text-soft);
  background: transparent;
  font-size: 11px;
  text-align: left;
}

.order-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.order-menu button.danger {
  color: var(--danger);
}

.order-menu svg {
  width: 14px;
  height: 14px;
}

.empty-state {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-content {
  max-width: 390px;
}

.empty-visual {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid rgba(37, 185, 255, 0.17);
  border-radius: 22px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(37, 185, 255, 0.1), rgba(37, 185, 255, 0.025));
}

.empty-visual::before,
.empty-visual::after {
  position: absolute;
  width: 14px;
  height: 1px;
  content: "";
  background: rgba(37, 185, 255, 0.35);
}

.empty-visual::before { left: -7px; }
.empty-visual::after { right: -7px; }

.empty-visual svg {
  width: 32px;
  height: 32px;
}

.empty-content h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
}

.empty-content p {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.mobile-fab {
  position: fixed;
  z-index: 35;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  display: none;
  height: 48px;
  align-items: center;
  gap: 7px;
  padding: 0 17px;
  border: 0;
  border-radius: 14px;
  color: #04121d;
  background: linear-gradient(135deg, #4dd0ff, #209eea);
  box-shadow: 0 14px 35px rgba(20, 143, 218, 0.38);
  font-size: 13px;
  font-weight: 750;
}

.site-footer {
  display: flex;
  width: min(1240px, calc(100% - 40px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -58px auto 0;
  padding: 0 2px 28px;
  color: var(--muted-2);
  font-size: 9px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.mobile-fab svg {
  width: 18px;
  height: 18px;
}

.modal {
  width: min(680px, calc(100% - 28px));
  max-height: min(870px, calc(100dvh - 34px));
  padding: 0;
  overflow: visible;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.modal::backdrop {
  background: rgba(1, 7, 14, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdrop-in 180ms ease both;
}

.modal[open] .modal-card {
  animation: modal-in 190ms cubic-bezier(0.22, 0.9, 0.38, 1) both;
}

.modal-card {
  display: flex;
  max-height: min(870px, calc(100dvh - 34px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(111, 183, 235, 0.24);
  border-radius: 21px;
  background: #091829;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.64), inset 0 1px rgba(255, 255, 255, 0.025);
}

.modal-header {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(20, 57, 91, 0.4), transparent 60%);
}

.modal-header::before {
  position: absolute;
  top: 0;
  left: 24px;
  width: 74px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--accent), transparent);
}

.modal-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.24em;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.modal-header > div > p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-close,
.import-close {
  flex: 0 0 auto;
}

.modal-body {
  flex: 1 1 auto;
  padding: 20px 24px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #24445f transparent;
  scrollbar-width: thin;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #24445f;
}

.field {
  position: relative;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend,
.compact-field > label {
  display: block;
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.field em {
  margin-left: 2px;
  color: var(--danger);
  font-style: normal;
}

.field label span {
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 500;
}

.field > input,
.field textarea {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12px;
}

.field textarea {
  min-height: 64px;
  padding-top: 11px;
  padding-right: 48px;
  line-height: 1.55;
  resize: vertical;
}

.field-error {
  display: block;
  min-height: 0;
  margin-top: 6px;
  color: var(--danger);
  font-size: 10px;
}

.field-error:empty {
  display: none;
}

.field.has-error > input,
.field.has-error textarea,
.level-input.has-error {
  border-color: rgba(255, 97, 124, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 97, 124, 0.08);
}

.char-count {
  position: absolute;
  right: 11px;
  bottom: 11px;
  color: var(--muted-2);
  font-size: 9px;
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mode-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 23, 40, 0.66);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 130ms ease;
}

.mode-option:hover {
  border-color: rgba(96, 174, 230, 0.3);
  background: rgba(11, 32, 54, 0.8);
}

.mode-option:active {
  transform: scale(0.985);
}

.mode-option.is-selected {
  border-color: rgba(37, 185, 255, 0.48);
  background: rgba(37, 185, 255, 0.09);
  box-shadow: inset 0 0 24px rgba(37, 185, 255, 0.025);
}

.mode-option input,
.asset-option input,
.import-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-option > span:nth-of-type(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.mode-option strong {
  font-size: 12px;
  font-weight: 680;
}

.mode-option small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-option > b {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #03131e;
  background: var(--accent);
}

.mode-option.is-selected > b {
  display: grid;
}

.mode-option > b svg {
  width: 10px;
  height: 10px;
  stroke-width: 2.5;
}

.mode-option-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(37, 185, 255, 0.2);
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.material-icon {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.material-icon i {
  display: block;
  width: 5px;
  border: 1px solid currentColor;
  background: rgba(37, 185, 255, 0.16);
}

.material-icon i:nth-child(1) { height: 11px; }
.material-icon i:nth-child(2) { height: 18px; }
.material-icon i:nth-child(3) { height: 14px; }

.level-icon {
  border-color: rgba(168, 134, 255, 0.2);
  color: var(--violet);
  background: rgba(168, 134, 255, 0.1);
}

.safe-icon {
  border-color: rgba(36, 215, 161, 0.2);
  color: var(--green);
  background: var(--green-soft);
}

.coins-icon {
  border-color: rgba(255, 187, 98, 0.22);
  color: var(--amber);
  background: var(--amber-soft);
}

.coins-icon svg {
  width: 21px;
  height: 21px;
}

.dynamic-section[hidden] {
  display: none;
}

.dynamic-section {
  padding-top: 1px;
  animation: section-in 170ms ease both;
}

.asset-picker {
  display: grid;
  gap: 8px;
}

.material-picker,
.department-picker {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.asset-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 108px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 23, 40, 0.62);
  cursor: pointer;
  transition: transform 130ms ease, border-color 160ms ease, background 160ms ease;
}

.asset-option:hover {
  transform: translateY(-1px);
  border-color: rgba(95, 174, 232, 0.32);
}

.asset-option.is-selected {
  border-color: rgba(37, 185, 255, 0.55);
  background: rgba(37, 185, 255, 0.09);
  box-shadow: inset 0 0 22px rgba(37, 185, 255, 0.04);
}

.asset-option.is-selected::after {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 7px rgba(37, 185, 255, 0.9);
}

.asset-option img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.asset-option.department img {
  width: 48px;
  height: 48px;
}

.asset-option span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.level-row {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: end;
  margin-top: 4px;
}

.compact-field {
  margin-bottom: 0;
}

.level-input {
  display: flex;
  height: 44px;
  align-items: center;
  overflow: hidden;
  border-radius: 10px;
}

.level-input span {
  display: grid;
  height: 100%;
  padding: 0 10px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 700;
}

.level-input input {
  width: 100%;
  height: 100%;
  padding: 0 11px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.level-arrow {
  display: grid;
  height: 44px;
  place-items: center;
  color: var(--accent);
  font-size: 17px;
}

.level-error {
  margin-top: 7px;
}

.insurance-preview {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 15px;
  min-height: 98px;
  margin-bottom: 18px;
  padding: 11px 15px 11px 11px;
  border: 1px solid rgba(36, 215, 161, 0.26);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(36, 215, 161, 0.09), rgba(8, 23, 40, 0.72));
}

.insurance-art {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(36, 215, 161, 0.14);
  border-radius: 12px;
  background: rgba(7, 20, 34, 0.56);
}

.insurance-art::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  min-width: 27px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(36, 215, 161, 0.35);
  border-radius: 5px;
  content: "3×3";
  color: var(--green);
  background: rgba(5, 20, 29, 0.9);
  font-size: 7px;
  font-weight: 800;
}

.insurance-art img {
  width: 62px;
  height: 62px;
}

.insurance-preview > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.insurance-preview span {
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
}

.insurance-preview strong {
  font-size: 14px;
}

.insurance-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.insurance-check {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  color: #031810;
  background: var(--green);
  stroke-width: 2.5;
}

.coin-field {
  margin-bottom: 18px;
}

.coin-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.coin-preset {
  position: relative;
  display: flex;
  min-width: 0;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 23, 40, 0.62);
  transition: border-color 160ms ease, background 160ms ease, transform 130ms ease;
}

.coin-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 187, 98, 0.38);
}

.coin-preset.is-selected {
  border-color: rgba(255, 187, 98, 0.62);
  background: rgba(255, 187, 98, 0.12);
  box-shadow: inset 0 0 18px rgba(255, 187, 98, 0.04);
}

.coin-preset-select {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: 0;
  color: var(--text-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.coin-preset-select small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.coin-preset.is-selected .coin-preset-select,
.coin-preset.is-selected .coin-preset-select small {
  color: var(--amber);
}

.coin-preset-remove {
  display: grid;
  width: 24px;
  flex: 0 0 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.coin-preset-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.coin-tools {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.coin-tool-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px dashed rgba(123, 169, 207, 0.26);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(8, 23, 40, 0.42);
  font-size: 10px;
  font-weight: 650;
}

.coin-tool-button:hover,
.coin-tool-button.is-active {
  border-color: rgba(255, 187, 98, 0.42);
  color: var(--amber);
  background: var(--amber-soft);
}

.coin-tool-button svg {
  width: 14px;
  height: 14px;
}

.coin-entry-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 187, 98, 0.22);
  border-radius: 11px;
  background: linear-gradient(120deg, rgba(255, 187, 98, 0.07), rgba(8, 23, 40, 0.58));
  animation: section-in 160ms ease both;
}

.coin-entry-row[hidden] {
  display: none;
}

.coin-entry-row > label {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 650;
}

.coin-input-wrap {
  display: flex;
  height: 40px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 17, 30, 0.64);
}

.coin-input-wrap:focus-within {
  border-color: rgba(255, 187, 98, 0.52);
  box-shadow: 0 0 0 3px rgba(255, 187, 98, 0.08);
}

.coin-input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0 11px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  font-weight: 680;
}

.coin-input-wrap span {
  display: grid;
  height: 100%;
  padding: 0 11px;
  place-items: center;
  border-left: 1px solid var(--line);
  color: var(--amber);
  background: rgba(255, 187, 98, 0.06);
  font-size: 10px;
  font-weight: 700;
}

.coin-entry-row > button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 187, 98, 0.28);
  border-radius: 9px;
  color: #1d1304;
  background: linear-gradient(135deg, #ffd78d, #e7a945);
  font-size: 10px;
  font-weight: 750;
}

.manual-coin-row {
  grid-template-columns: 108px minmax(0, 1fr);
}

.coin-selection {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 0 13px;
  border: 1px solid rgba(255, 187, 98, 0.2);
  border-radius: 10px;
  background: rgba(255, 187, 98, 0.08);
}

.coin-selection[hidden] {
  display: none;
}

.coin-selection span {
  color: var(--muted);
  font-size: 10px;
}

.coin-selection strong {
  color: var(--amber);
  font-size: 13px;
  font-weight: 720;
}

.mode-tag.coins {
  border-color: rgba(255, 187, 98, 0.2);
  color: var(--amber);
  background: var(--amber-soft);
}

.advanced-settings {
  margin-top: -2px;
  border-top: 1px solid var(--line);
}

.advanced-settings summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  list-style: none;
  cursor: pointer;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.advanced-settings[open] summary svg {
  transform: rotate(180deg);
}

.advanced-settings .field {
  margin: 4px 0 0;
}

.advanced-settings input {
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color-scheme: dark;
  font-size: 12px;
}

.advanced-settings small {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: rgba(5, 16, 29, 0.72);
}

.modal-footer .button {
  min-width: 96px;
}

.submit-order {
  min-width: 146px !important;
}

.submit-order svg {
  transform: rotate(90deg);
}

.import-card {
  width: min(520px, 100%);
  margin: auto;
}

.import-file {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 23, 40, 0.68);
}

.import-file > svg {
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid rgba(37, 185, 255, 0.2);
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

.import-file > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.import-file strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-file small {
  color: var(--muted);
  font-size: 9px;
}

.import-file > span {
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 700;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 20px;
}

.import-stats div {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 23, 40, 0.48);
}

.import-stats span {
  color: var(--muted);
  font-size: 9px;
}

.import-stats strong {
  font-size: 20px;
}

.import-choice {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 22px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 23, 40, 0.52);
  cursor: pointer;
}

.import-choice + .import-choice {
  margin-top: 8px;
}

.import-choice.is-selected {
  border-color: rgba(37, 185, 255, 0.42);
  background: rgba(37, 185, 255, 0.08);
}

.import-choice > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.import-choice strong {
  font-size: 11px;
}

.import-choice strong b {
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 8px;
}

.import-choice small {
  color: var(--muted);
  font-size: 9px;
}

.import-choice > i {
  display: none;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #04131f;
  background: var(--accent);
}

.import-choice.is-selected > i {
  display: grid;
}

.import-choice > i svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 14px));
  display: flex;
  width: min(380px, calc(100% - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(9, 25, 43, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
  animation: toast-in 220ms cubic-bezier(0.2, 0.85, 0.35, 1) both;
  backdrop-filter: blur(16px);
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

.toast-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
}

.toast.warning .toast-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.toast.error .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.toast-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-copy small {
  color: var(--muted);
  font-size: 9px;
}

.toast button {
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 700;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf7ff;
  --bg-elevated: #f7fbff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #f9fcff;
  --panel-soft: #e8f4fc;
  --panel-hover: #e2f1fb;
  --line: rgba(36, 103, 155, 0.16);
  --line-strong: rgba(16, 129, 194, 0.32);
  --text: #102b46;
  --text-soft: #294d6b;
  --muted: #5f7e99;
  --muted-2: #7893aa;
  --accent: #078ccb;
  --accent-strong: #0578b5;
  --accent-soft: rgba(7, 140, 203, 0.1);
  --blue: #416de0;
  --green: #079c78;
  --green-soft: rgba(7, 156, 120, 0.1);
  --amber: #b97813;
  --amber-soft: rgba(210, 141, 31, 0.11);
  --danger: #d84664;
  --danger-soft: rgba(216, 70, 100, 0.1);
  --violet: #7455ce;
  --shadow-lg: 0 26px 70px rgba(42, 91, 128, 0.18);
}

html[data-theme="light"] body {
  background:
    linear-gradient(rgba(44, 123, 179, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 123, 179, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% -18%, #cdeaff 0%, #edf7ff 45%, #f4faff 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

html[data-theme="light"] body::before {
  background: linear-gradient(180deg, transparent 0%, rgba(237, 247, 255, 0.24) 64%, #f4faff 100%);
}

html[data-theme="light"] .ambient {
  opacity: 0.09;
}

html[data-theme="light"] .topbar {
  border-bottom-color: rgba(32, 102, 154, 0.14);
  background: rgba(244, 250, 255, 0.86);
  box-shadow: 0 8px 34px rgba(55, 101, 136, 0.1);
}

html[data-theme="light"] .brand-mark {
  border-color: rgba(7, 140, 203, 0.25);
  background: linear-gradient(145deg, rgba(7, 140, 203, 0.13), rgba(255, 255, 255, 0.7));
  box-shadow: inset 0 0 18px rgba(7, 140, 203, 0.05), 0 6px 18px rgba(40, 103, 147, 0.08);
}

html[data-theme="light"] .theme-toggle svg {
  color: #4162be;
}

html[data-theme="light"] .button-secondary {
  color: var(--text-soft);
  border-color: rgba(36, 103, 155, 0.17);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 14px rgba(45, 93, 128, 0.05);
}

html[data-theme="light"] .button-secondary:hover {
  border-color: var(--line-strong);
  background: #f7fcff;
}

html[data-theme="light"] .action-menu,
html[data-theme="light"] .order-menu {
  background: rgba(249, 253, 255, 0.98);
  box-shadow: 0 22px 55px rgba(38, 86, 122, 0.18);
}

html[data-theme="light"] .action-menu::before {
  background: #f9fdff;
}

html[data-theme="light"] .action-menu button:hover,
html[data-theme="light"] .order-menu button:hover {
  background: rgba(7, 140, 203, 0.08);
}

html[data-theme="light"] .today-chip {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(45, 94, 130, 0.06);
}

html[data-theme="light"] .stat-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(230, 244, 253, 0.9));
  box-shadow: 0 12px 32px rgba(44, 96, 134, 0.08), inset 0 1px rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .stat-focus {
  border-color: rgba(7, 140, 203, 0.23);
  background: linear-gradient(145deg, #f8fdff, #dff2fd);
}

html[data-theme="light"] .queue-panel {
  background: rgba(250, 253, 255, 0.84);
  box-shadow: 0 24px 70px rgba(44, 91, 127, 0.1);
}

html[data-theme="light"] .status-tabs {
  background: rgba(216, 237, 250, 0.62);
}

html[data-theme="light"] .status-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(45, 95, 132, 0.09), inset 0 0 0 1px rgba(7, 140, 203, 0.06);
}

html[data-theme="light"] .search-box input,
html[data-theme="light"] .select-wrap select,
html[data-theme="light"] .field > input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .level-input,
html[data-theme="light"] .advanced-settings input,
html[data-theme="light"] .coin-input-wrap {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .search-box input:focus,
html[data-theme="light"] .select-wrap select:focus,
html[data-theme="light"] .field > input:focus,
html[data-theme="light"] .field textarea:focus,
html[data-theme="light"] .level-input:focus-within,
html[data-theme="light"] .advanced-settings input:focus {
  background: #fff;
}

html[data-theme="light"] .select-wrap option {
  color: var(--text);
  background: #f9fdff;
}

html[data-theme="light"] .queue-meta {
  border-bottom-color: rgba(36, 103, 155, 0.09);
}

html[data-theme="light"] .date-group {
  background: rgba(245, 251, 255, 0.82);
  box-shadow: 0 8px 26px rgba(47, 96, 132, 0.05);
}

html[data-theme="light"] .date-header {
  background: linear-gradient(90deg, rgba(211, 237, 252, 0.92), rgba(245, 251, 255, 0.7));
}

html[data-theme="light"] .order-card + .order-card {
  border-top-color: rgba(36, 103, 155, 0.1);
}

html[data-theme="light"] .order-asset {
  border-color: rgba(36, 103, 155, 0.17);
  background:
    linear-gradient(145deg, rgba(223, 240, 251, 0.9), rgba(248, 252, 255, 0.95)),
    radial-gradient(circle at 70% 20%, rgba(7, 140, 203, 0.12), transparent 55%);
}

html[data-theme="light"] .order-asset.rare {
  border-color: rgba(212, 116, 78, 0.22);
  background: radial-gradient(circle at 50% 30%, rgba(255, 137, 93, 0.11), transparent 65%), #f7fbfe;
}

html[data-theme="light"] .order-asset.coins-asset {
  border-color: rgba(212, 143, 34, 0.28);
  background: radial-gradient(circle at 50% 28%, rgba(255, 187, 98, 0.2), transparent 68%), #f7fbfe;
}

html[data-theme="light"] .wait-badge {
  background: rgba(33, 93, 138, 0.05);
}

html[data-theme="light"] .stepper {
  background: rgba(232, 244, 252, 0.75);
}

html[data-theme="light"] .stepper input {
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
}

html[data-theme="light"] .complete-button.reopen {
  background: rgba(255, 255, 255, 0.66);
}

html[data-theme="light"] .empty-visual {
  background: linear-gradient(145deg, rgba(7, 140, 203, 0.1), rgba(255, 255, 255, 0.72));
}

html[data-theme="light"] .modal-card {
  border-color: rgba(16, 129, 194, 0.25);
  background: #f7fcff;
  box-shadow: 0 40px 110px rgba(34, 75, 105, 0.28), inset 0 1px rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .modal-header {
  background: linear-gradient(120deg, rgba(202, 234, 252, 0.74), rgba(255, 255, 255, 0.48) 65%);
}

html[data-theme="light"] .modal-footer {
  background: rgba(230, 244, 253, 0.66);
}

html[data-theme="light"] .modal-body {
  scrollbar-color: #a5c8df transparent;
}

html[data-theme="light"] .mode-option,
html[data-theme="light"] .asset-option,
html[data-theme="light"] .import-choice,
html[data-theme="light"] .import-file,
html[data-theme="light"] .import-stats div,
html[data-theme="light"] .coin-preset,
html[data-theme="light"] .coin-tool-button {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .mode-option:hover,
html[data-theme="light"] .asset-option:hover {
  background: #fff;
}

html[data-theme="light"] .mode-option.is-selected,
html[data-theme="light"] .asset-option.is-selected,
html[data-theme="light"] .import-choice.is-selected {
  background: rgba(7, 140, 203, 0.09);
}

html[data-theme="light"] .coin-preset.is-selected {
  background: rgba(210, 141, 31, 0.11);
}

html[data-theme="light"] .coin-entry-row {
  background: linear-gradient(120deg, rgba(255, 238, 205, 0.58), rgba(255, 255, 255, 0.78));
}

html[data-theme="light"] .coin-preset-remove {
  background: rgba(217, 234, 246, 0.42);
}

html[data-theme="light"] .insurance-preview {
  background: linear-gradient(120deg, rgba(7, 156, 120, 0.09), rgba(255, 255, 255, 0.76));
}

html[data-theme="light"] .insurance-art {
  background: rgba(228, 243, 251, 0.72);
}

html[data-theme="light"] .advanced-settings input {
  color-scheme: light;
}

html[data-theme="light"] .toast {
  border-color: rgba(16, 129, 194, 0.25);
  background: rgba(249, 253, 255, 0.97);
  box-shadow: 0 18px 45px rgba(40, 86, 120, 0.17);
}

html[data-theme="light"] .mobile-fab {
  box-shadow: 0 14px 32px rgba(20, 127, 188, 0.28);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px) scale(0.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(12px) scale(0.98); }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1060px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-card {
    grid-template-columns: 56px minmax(110px, 0.8fr) minmax(210px, 1.5fr) 138px 80px 36px;
    gap: 10px;
  }

  .runs-control {
    flex-direction: column;
    gap: 5px;
  }

  .runs-label {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 860px) {
  .shell,
  .topbar-inner {
    width: min(100% - 28px, 1240px);
  }

  .save-state-full {
    display: none;
  }

  .save-state-short {
    display: inline;
  }

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

  .status-tabs {
    align-self: flex-start;
  }

  .filters {
    width: 100%;
  }

  .search-box {
    width: auto;
    flex: 1;
  }

  .order-card {
    grid-template-columns: 56px minmax(120px, 0.8fr) minmax(180px, 1.5fr) 118px 36px;
  }

  .order-card > .complete-button {
    position: absolute;
    right: 50px;
    bottom: 10px;
    height: 30px;
  }

  .order-target {
    align-self: start;
    padding-top: 8px;
  }

  .runs-control {
    align-items: flex-end;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    height: 64px;
  }

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

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

  .brand-copy small {
    font-size: 7px;
  }

  .save-state,
  .top-add {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    padding: 0;
  }

  .theme-toggle span {
    display: none;
  }

  #backup-menu-button {
    width: 40px;
    padding: 0;
  }

  #backup-menu-button > span,
  #backup-menu-button .chevron {
    display: none;
  }

  .action-menu {
    position: fixed;
    top: 58px;
    right: 14px;
  }

  .action-menu::before {
    right: 12px;
  }

  .shell {
    padding: 34px 0 100px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .page-heading-compact {
    align-items: flex-end;
    margin-bottom: 14px;
  }

  .today-chip {
    min-width: 0;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    min-height: 98px;
    gap: 10px;
    padding: 13px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
  }

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

  .stat-card strong {
    font-size: 23px;
  }

  .stat-card small {
    display: none;
  }

  .queue-panel {
    border-radius: 17px;
  }

  .queue-toolbar {
    gap: 12px;
    padding: 13px;
  }

  .status-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .status-tab {
    justify-content: center;
    padding: 0 8px;
  }

  .filters {
    align-items: stretch;
  }

  .select-wrap {
    width: 112px;
  }

  .queue-meta {
    padding: 0 14px;
  }

  .queue-root {
    min-height: 360px;
    padding: 10px;
  }

  .date-group + .date-group {
    margin-top: 10px;
  }

  .date-header {
    min-height: 54px;
    padding: 8px 10px;
  }

  .date-block {
    width: 36px;
    height: 36px;
  }

  .date-summary {
    display: none;
  }

  .order-list {
    padding: 0 10px;
  }

  .order-card {
    grid-template-columns: 52px 1fr auto;
    grid-template-areas:
      "asset customer more"
      "asset target target"
      "actions actions actions";
    gap: 8px 11px;
    min-height: 0;
    padding: 13px 0;
  }

  .order-asset {
    grid-area: asset;
    width: 52px;
    height: 52px;
    align-self: start;
  }

  .order-customer {
    grid-area: customer;
  }

  .order-target {
    grid-area: target;
    padding-top: 1px;
  }

  .order-target-line {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px 7px;
  }

  .order-target-line strong {
    white-space: normal;
  }

  .order-note {
    margin-top: 5px;
  }

  .runs-control {
    grid-area: actions;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-top: 3px;
    padding-top: 10px;
    border-top: 1px solid rgba(136, 178, 219, 0.08);
  }

  .runs-label {
    justify-self: start;
  }

  .stepper {
    grid-template-columns: 38px 44px 38px;
    height: 38px;
  }

  .stepper input {
    width: 44px;
  }

  .order-card > .complete-button {
    position: static;
    grid-area: actions;
    height: 38px;
    align-self: end;
    justify-self: start;
    margin-top: 3px;
    margin-left: 0;
  }

  .order-card .runs-control + .complete-button {
    justify-self: start;
  }

  .order-card:has(.complete-button) .runs-control {
    padding-left: 98px;
  }

  .more-wrap {
    grid-area: more;
    align-self: start;
  }

  .more-button {
    width: 34px;
    height: 34px;
  }

  .order-menu {
    width: 170px;
  }

  .mobile-fab {
    display: flex;
  }

  .site-footer {
    width: calc(100% - 28px);
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-top: -70px;
    padding-bottom: 94px;
    line-height: 1.55;
  }

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

  .modal {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
  }

  .modal-card {
    max-height: calc(100dvh - 24px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .modal[open] .modal-card {
    animation-name: sheet-in;
  }

  .modal-header {
    padding: 19px 18px 15px;
  }

  .modal-header::after {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 38px;
    height: 3px;
    border-radius: 99px;
    content: "";
    background: rgba(141, 177, 207, 0.26);
    transform: translateX(-50%);
  }

  .modal-body {
    padding: 17px 18px 22px;
  }

  .modal-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .modal-footer .button {
    min-height: 44px;
  }

  .submit-order,
  .import-form .button-primary {
    flex: 1;
  }

  .mode-option {
    grid-template-columns: 32px 1fr;
    gap: 7px;
    min-height: 62px;
    padding: 8px;
  }

  .mode-option-icon {
    width: 32px;
    height: 32px;
  }

  .mode-option small {
    display: none;
  }

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

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

  .coin-entry-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .coin-entry-row > label {
    grid-column: 1 / -1;
  }

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

  .material-picker,
  .department-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .asset-option {
    min-height: 104px;
  }
}

@media (max-width: 420px) {
  .shell,
  .topbar-inner {
    width: calc(100% - 20px);
  }

  .brand {
    gap: 9px;
  }

  .brand-copy small {
    letter-spacing: 0.15em;
  }

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

  .stat-card {
    min-width: 0;
    padding: 11px;
  }

  .stat-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .select-wrap {
    width: 104px;
  }

  .search-box input {
    padding-right: 31px;
  }

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

  .asset-option {
    min-height: 106px;
  }

  .insurance-preview {
    grid-template-columns: 66px 1fr;
    gap: 11px;
  }

  .insurance-art {
    width: 66px;
    height: 66px;
  }

  .insurance-check {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .import-file {
    grid-template-columns: 38px 1fr;
  }

  .import-file > span {
    display: none;
  }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

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