:root {
  --ink: #171717;
  --muted: #737373;
  --line: #e8e6e1;
  --paper: #f8f7f3;
  --white: #fff;
  --accent: #ff6b35;
  --accent-dark: #e9501a;
  --green: #207a51;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 107, 53, 0.08), transparent 28%),
    var(--paper);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  width: min(1440px, calc(100% - 32px));
  min-height: 82px;
  padding: 14px 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid rgba(23, 23, 23, 0.12);
}

.header-top-row,
.header-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.header-top-row {
  display: grid;
  grid-template-columns: minmax(132px, 180px) minmax(0, 1fr) minmax(132px, 180px);
  justify-content: center;
  flex-wrap: nowrap;
}

.header-top-row .brand {
  justify-self: start;
}

.header-bottom-row {
  justify-content: flex-end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: var(--ink);
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 30px;
  fill: currentColor;
}

.brand-mark .spark {
  fill: var(--accent);
}

.header-note {
  color: #8a8883;
  font-size: 13px;
  font-weight: 600;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.home-notice {
  min-height: 370px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px 0 70px;
}

.home-notice[hidden] {
  display: none;
}

.home-notice-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.home-notice-label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.home-notice-card {
  width: min(700px, 100%);
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 20px 60px rgba(42, 39, 32, 0.08);
}

.home-notice-card > svg {
  width: 36px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-notice-card h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

#home-notice-text {
  color: #615e58;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.notice-pager {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 16px;
}

.notice-page-button {
  min-width: 64px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f7f3;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
}

.notice-page-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.notice-page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#notice-page-indicator {
  min-width: 56px;
  text-align: center;
  color: #8b8780;
  font-size: 12px;
  font-weight: 700;
}

.notice-version {
  margin-bottom: 13px;
  color: var(--accent-dark);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.notice-history-item + .notice-history-item {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.notice-history-item + .notice-history-item .notice-version {
  color: #77736d;
  font-size: 15px;
}

.notice-feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice-feature-list li {
  position: relative;
  padding-left: 15px;
  color: #716d66;
  font-size: 13px;
  line-height: 1.55;
}

.notice-feature-list li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.notice-feature-list strong {
  color: #292724;
  font-weight: 800;
}

.home-notice > p {
  margin: 16px 0 0;
  color: #95918a;
  font-size: 11px;
}

.hero {
  padding: 30px 0 22px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 107, 53, 0.13);
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 5.5vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.065em;
  font-weight: 900;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero p {
  margin: 16px 0 0;
  color: #66635e;
  font-size: 15px;
  line-height: 1.7;
}

.tool-card {
  position: relative;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 80px rgba(42, 39, 32, 0.09);
}

.tool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.header-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-tabs::-webkit-scrollbar {
  display: none;
}

.theme-switcher {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  justify-self: end;
  margin-left: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
}

.header-metrics {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  margin-left: 0;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 6px 18px rgba(18, 18, 18, 0.04);
  min-height: 28px;
}

.metric-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #fff6ee, #ffe2c9);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.metric-text {
  display: flex;
  flex-direction: row;
  gap: 3px;
  align-items: baseline;
  line-height: 1;
}

.metric-text strong {
  font-size: 9px;
  font-weight: 800;
  color: var(--ink);
}

.metric-text small {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.theme-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 0.16s ease;
}

.theme-button:hover {
  color: var(--ink);
  background: rgba(23, 23, 23, 0.06);
}

.theme-button.is-active {
  color: white;
  background: var(--ink);
  box-shadow: 0 2px 7px rgba(23, 23, 23, 0.18);
}

.theme-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-tabs .tool-tab {
  min-height: 54px;
  gap: 8px;
  padding: 9px 9px;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
}

.header-tabs .tool-tab:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.header-tabs .tool-tab.is-active {
  color: white;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: none;
}

.header-tabs .tool-tab strong {
  font-size: 12px;
}

.header-tabs .tool-tab small {
  font-size: 9px;
}

.header-tabs .tab-number {
  font-size: 11px;
}

.tool-tab {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #77736d;
  background: rgba(255, 255, 255, 0.55);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.tool-tab:hover {
  border-color: #c9c5bd;
  background: white;
}

.tool-tab.is-active {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 9px 24px rgba(23, 23, 23, 0.12);
}

.tab-number {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.tool-tab > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tool-tab strong {
  font-size: 14px;
}

.tool-tab small {
  color: #99958e;
  font-size: 11px;
}

.tool-tab.is-active small {
  color: #aaa;
}

.tool-panel[hidden] {
  display: none;
}

.label-workspaces {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.label-mode-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaf7;
}

.label-mode-card--custom {
  background: #fffaf7;
}

.label-mode-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.label-mode-heading > div > span {
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.label-mode-heading h3 {
  margin: 3px 0 0;
  font-size: 17px;
  letter-spacing: -0.035em;
}

.custom-label-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.custom-label-title svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preset-label-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.preset-label-title svg {
  width: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label-size-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #77736d;
  background: white;
  font-size: 10px;
  font-weight: 800;
}

.custom-label-toolbar {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.custom-label-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.custom-label-toolbar label > span {
  font-size: 11px;
  font-weight: 800;
}

.font-size-control {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.font-size-control input {
  width: 100%;
  accent-color: var(--accent);
}

.font-size-control output {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.label-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.label-fields label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label-fields label > span {
  font-size: 12px;
  font-weight: 700;
}

.label-fields > label > input,
.label-field-row input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fbfaf7;
  font-size: 13px;
}

.label-fields input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.05);
}

.label-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.label-unit-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.unit-button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.unit-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.unit-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

html[data-theme="dark"] .unit-button {
  background: #211f1d;
  color: var(--ink);
}

html[data-theme="dark"] .unit-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

html[data-theme="dark"] .unit-button.is-active {
  background: #f3f1ec;
  color: #171717;
  border-color: #f3f1ec;
}

.label-preview-wrap {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f0eee8;
}

.custom-label-preview-wrap {
  padding: 14px;
  background: #f3eee9;
}

.custom-label-preview {
  min-height: 0;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.16;
  cursor: text;
  caret-color: var(--accent);
}

.custom-label-preview:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.custom-label-fields {
  margin-top: auto;
}

.label-card-footer {
  margin-top: auto;
}

.label-card-footer .merge-button {
  width: 100%;
}

.label-card-footer .message {
  margin-top: 10px;
}

.preview-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
}

.preview-title span {
  color: #8b8780;
}

.label-preview {
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  padding: 4%;
  border: 1px solid #d3d0c8;
  background: white;
  box-shadow: 0 8px 24px rgba(40, 35, 28, 0.1);
  color: #000;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  text-align: center;
}

#label-preview-company,
#label-preview-invoice {
  max-width: 100%;
  font-size: clamp(20px, 3.1vw, 36px);
  font-weight: 700;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

#label-preview-invoice {
  margin-top: 2.5%;
}

#label-preview-box {
  margin-top: 3%;
  font-size: clamp(28px, 4.3vw, 48px);
  font-weight: 700;
  line-height: 1;
}

.tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.tool-heading h2 {
  margin: 0 0 7px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.tool-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-subtitle {
  max-width: 520px;
  margin-top: 6px !important;
  color: color-mix(in srgb, var(--text-muted) 86%, var(--accent));
  font-size: 13px !important;
  font-weight: 750;
  letter-spacing: -.02em;
}

.dashboard-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.dashboard-export-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-export-button {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.dashboard-export-button.is-excel {
  border-color: color-mix(in srgb, #16a34a 30%, var(--border));
  background: color-mix(in srgb, #16a34a 10%, var(--surface));
  color: #15803d;
}

.dashboard-export-button.is-pdf {
  border-color: color-mix(in srgb, #ef4444 30%, var(--border));
  background: color-mix(in srgb, #ef4444 10%, var(--surface));
  color: #dc2626;
}

.dashboard-export-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.dashboard-export-button.is-excel svg {
  filter: drop-shadow(0 3px 6px rgba(22, 163, 74, .18));
}

.dashboard-export-button.is-pdf svg {
  filter: drop-shadow(0 3px 6px rgba(239, 68, 68, .18));
}

.dashboard-export-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
}

.dashboard-export-button:disabled {
  opacity: .55;
  cursor: wait;
}

.local-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 10px;
  color: var(--green);
  border: 1px solid #cce4d7;
  border-radius: 999px;
  background: #f2faf6;
  font-size: 12px;
  font-weight: 700;
}

.local-badge svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 22px;
  border: 1.5px dashed #cac7bf;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)),
    repeating-linear-gradient(-45deg, #f8f7f3, #f8f7f3 8px, #f4f2ed 8px, #f4f2ed 16px);
  transition: 0.2s ease;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #fff8f5;
  transform: scale(1.005);
}

.upload-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: var(--accent);
  border-radius: 14px;
  background: #fff0e9;
}

.upload-icon svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone strong {
  font-size: 16px;
  letter-spacing: -0.03em;
}

.drop-zone > span {
  margin: 6px 0;
  color: #aaa69e;
  font-size: 12px;
}

.select-button {
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  color: white;
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

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

.drop-zone small {
  margin-top: 10px;
  color: #aaa69e;
  font-size: 11px;
}

.workspace {
  animation: reveal 0.3s ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfaf7;
}

.selected-file[hidden] {
  display: none;
}

.file-type {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent-dark);
  border-radius: 10px;
  background: #fff0e9;
  font-size: 11px;
  font-weight: 900;
}

.pdf-file-type {
  color: #a53e29;
  background: #fff0eb;
}

.excel-file-type {
  color: #217346;
  background: #e9f7ef;
}

.sheet-upload-icon {
  color: #217346;
  background: #e9f7ef;
}

.sheet-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 7px 10px;
  border: 1px solid #ddd9d1;
  border-radius: 999px;
  color: #77736d;
  background: #fbfaf7;
  font-size: 11px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa69e;
}

.sheet-badge.is-loading .status-dot {
  background: #e9a23b;
  animation: pulse 1s infinite alternate;
}

.sheet-badge.is-ready {
  color: #217346;
  border-color: #bfe1ce;
  background: #f0faf4;
}

.sheet-badge.is-ready .status-dot {
  background: #2d9b61;
}

.sheet-badge.is-error {
  color: #a53e29;
  border-color: #f0c6bc;
  background: #fff4f1;
}

.sheet-badge.is-error .status-dot {
  background: #d05a43;
}

.license-download-card {
  min-height: 150px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfaf7;
}

.license-file-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #217346;
  border-radius: 15px;
  background: #e9f7ef;
  font-size: 13px;
  font-weight: 900;
}

.license-download-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.license-download-copy strong {
  font-size: 17px;
}

.license-download-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.license-download-card .merge-button {
  width: auto;
  min-width: 190px;
}

.license-note {
  margin-top: 12px;
  padding: 13px 15px;
  color: #77736d;
  border-radius: 12px;
  background: #fff8d9;
  font-size: 12px;
  line-height: 1.6;
}

.license-mail-preview,
.license-delivery-copy {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfaf7;
}

.license-mail-preview-head,
.license-delivery-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.license-mail-preview-head strong,
.license-delivery-copy-head strong {
  font-size: 13px;
}

.license-copy-button {
  padding: 6px 12px;
  color: #fff;
  border: 0;
  border-radius: 8px;
  background: #222;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.license-mail-fields {
  margin: 0;
}

.license-mail-fields > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.license-mail-fields > div:last-child {
  border-bottom: 0;
}

.license-mail-fields dt,
.license-mail-fields dd {
  margin: 0;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
}

.license-mail-fields dt {
  color: var(--muted);
  border-right: 1px solid var(--line);
  background: #f5f2ec;
  font-weight: 800;
}

.license-mail-fields dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  word-break: break-word;
}

.license-mail-fields dd > span {
  min-width: 0;
}

.license-field-copy {
  flex: 0 0 auto;
}

.license-delivery-copy pre {
  min-height: 260px;
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: var(--text);
  font: 500 13px/1.9 "Malgun Gothic", "맑은 고딕", sans-serif;
  white-space: pre-wrap;
  word-break: keep-all;
}

.license-generated-by {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 15px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
}

.license-generated-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
}

.license-generated-logo {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 8px;
  background: var(--ink);
  transform: rotate(-3deg);
}

.license-generated-logo svg {
  width: 22px;
  fill: currentColor;
}

.license-generated-logo .spark {
  fill: var(--accent);
}

.password-gate {
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 38px 20px;
  text-align: center;
}

.password-gate[hidden],
#picking-content[hidden],
#sync-content[hidden],
#dashboard-content[hidden],
#admin-content[hidden] {
  display: none !important;
}

.lock-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  color: var(--accent);
  border-radius: 18px;
  background: #fff0e9;
}

.lock-icon svg {
  width: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-gate h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.04em;
}

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

.password-form {
  width: min(330px, 100%);
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 7px;
}

.password-form input {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fbfaf7;
  font-size: 14px;
}

.password-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.06);
}

.password-form button {
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.password-error {
  margin-top: 10px;
  color: #b13e29;
  font-size: 12px;
  font-weight: 700;
}

#picking-content {
  animation: reveal 0.25s ease;
}

#sync-content {
  animation: reveal 0.25s ease;
}

#admin-content {
  animation: reveal 0.25s ease;
}

.admin-editor label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 800;
}

.admin-editor textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fbfaf7;
  font-size: 14px;
  line-height: 1.7;
}

.admin-editor textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.05);
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.admin-actions .merge-button {
  margin-top: 12px;
}

.secondary-button {
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

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

.admin-storage-note {
  margin: 10px 0 0;
  color: #99958e;
  font-size: 10px;
  text-align: right;
}

.admin-badge svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.admin-status-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(242, 107, 58, 0.12), transparent 34%),
    #fffdf9;
  box-shadow: var(--shadow-soft);
}

.admin-control-card {
  border-color: rgba(242, 107, 58, 0.22);
}

.admin-empty-card {
  min-height: 136px;
  background:
    linear-gradient(135deg, rgba(23, 23, 23, 0.02), transparent 44%),
    #fffdf9;
  box-shadow: none;
}

.admin-placeholder-card {
  opacity: 0.72;
  background:
    linear-gradient(135deg, rgba(23, 23, 23, 0.03), transparent 40%),
    #fffdf9;
}

.admin-status-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-kicker {
  display: inline-flex;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.admin-status-main h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.05em;
}

.admin-status-card h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.04em;
}

.admin-status-main p,
.admin-status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 800;
}

.admin-switch {
  flex: 0 0 auto;
  cursor: pointer;
}

.admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-switch-track {
  width: 54px;
  height: 30px;
  display: block;
  position: relative;
  border-radius: 999px;
  background: #d7d2c9;
  box-shadow: inset 0 0 0 1px rgba(23, 23, 23, 0.08);
  transition: 0.2s ease;
}

.admin-switch-thumb {
  width: 24px;
  height: 24px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 16px rgba(23, 23, 23, 0.18);
  transition: 0.2s ease;
}

.admin-switch input:checked + .admin-switch-track {
  background: #25845a;
}

.admin-switch input:checked + .admin-switch-track .admin-switch-thumb {
  transform: translateX(24px);
}

.admin-switch input:disabled + .admin-switch-track {
  opacity: 0.55;
  cursor: wait;
}

.admin-status-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #e4dfd5;
  border-radius: 13px;
  background: #f7f4ee;
}

.admin-status-preview strong {
  font-size: 13px;
  font-weight: 900;
}

.admin-status-preview small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa39a;
}

.admin-status-preview.is-enabled {
  border-color: rgba(37, 132, 90, 0.24);
  background: #edf8f2;
}

.admin-status-preview.is-enabled .admin-status-dot {
  background: #25845a;
}

.admin-status-preview.is-enabled strong {
  color: #176642;
}

.admin-status-preview.is-disabled {
  border-color: rgba(198, 40, 40, 0.22);
  background: #fff1ef;
}

.admin-status-preview.is-disabled .admin-status-dot {
  background: #c62828;
}

.admin-status-preview.is-disabled strong {
  color: #b3261e;
}

.admin-status-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-status-actions .secondary-button {
  min-height: 34px;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-decoration: none;
}

.local-chat {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7f5f1;
}

.chat-topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px 9px 17px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.chat-topbar > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-topbar .secondary-button {
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
}

.chat-topbar .status-dot {
  background: #aaa69e;
}

.chat-topbar .status-dot.is-ready {
  background: #2ca46f;
}

.chat-messages {
  height: min(480px, 52vh);
  min-height: 330px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 22px;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #fff;
  background: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.chat-message.user .chat-avatar {
  background: var(--accent);
}

.chat-bubble {
  max-width: min(76%, 720px);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 4px 15px 15px;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.65;
}

.chat-message.user .chat-bubble {
  color: #fff;
  border-color: var(--ink);
  border-radius: 15px 4px 15px 15px;
  background: var(--ink);
}

.chat-bubble.is-loading {
  color: var(--muted);
  animation: pulse 0.8s ease-in-out infinite alternate;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 9px;
  padding: 13px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-composer textarea {
  width: 100%;
  min-height: 46px;
  max-height: 130px;
  resize: none;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fbfaf7;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.chat-composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.chat-send-button {
  width: 44px;
  height: 44px;
  align-self: end;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.chat-send-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.chat-send-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes pulse {
  to { opacity: 0.35; }
}

.file-meta {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

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

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

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: #eeeae3;
}

.icon-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 9px;
}

.list-header div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.list-header strong {
  font-size: 15px;
}

.list-header span {
  color: #95918a;
  font-size: 11px;
}

#file-count {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #fff0e9;
  font-weight: 800;
}

.pdf-list {
  max-height: 210px;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  counter-reset: pdf;
}

.pdf-list li {
  min-height: 43px;
  display: grid;
  grid-template-columns: 48px 32px 1fr;
  align-items: center;
  padding: 0 16px 0 0;
  border-bottom: 1px solid #efede8;
  counter-increment: pdf;
  font-size: 13px;
}

.pdf-list li:last-child {
  border-bottom: 0;
}

.pdf-list li::before {
  content: counter(pdf, decimal-leading-zero);
  color: #aaa69e;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.pdf-icon {
  width: 23px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #c4472a;
  border-radius: 4px;
  background: #fff0eb;
  font-size: 7px;
  font-weight: 900;
}

.pdf-name {
  min-width: 0;
  overflow: hidden;
  padding-left: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-label {
  display: block;
  margin: 17px 0 7px;
  font-size: 13px;
  font-weight: 700;
}

.output-field {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf7;
}

.output-field:focus-within {
  border-color: #aaa69e;
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.05);
}

.output-field input {
  min-width: 0;
  flex: 1;
  padding: 10px 13px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.output-field span {
  padding-right: 14px;
  color: #8c8983;
  font-size: 13px;
}

.merge-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--accent);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
}

.merge-button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(233, 80, 26, 0.22);
}

.merge-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.merge-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #6e6a64;
  font-size: 11px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eeeae3;
}

.progress-track div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.message {
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 10px;
  color: #2b694d;
  background: #eff8f3;
  font-size: 13px;
  font-weight: 600;
}

.message.error {
  color: #9b3525;
  background: #fff0ed;
}

.ups-summary {
  display: grid;
  grid-template-columns: 1fr 30px 1fr 1.15fr;
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
}

.ups-summary > div {
  min-height: 83px;
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
  text-align: center;
}

.ups-summary > div > span {
  grid-column: 1 / -1;
  color: #8b8780;
  font-size: 10px;
}

.ups-summary strong {
  font-size: 20px;
  letter-spacing: -0.04em;
}

.ups-summary small {
  align-self: end;
  padding-bottom: 3px;
  color: #99958e;
  font-size: 10px;
}

.ups-summary > svg {
  width: 20px;
  align-self: center;
  justify-self: center;
  fill: none;
  stroke: #aaa69e;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ups-summary .accent-summary {
  border-color: #ffd2c1;
  background: #fff6f2;
}

.ups-summary .accent-summary strong {
  color: var(--accent-dark);
}

.size-summary strong {
  white-space: nowrap;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.check-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #b9b5ad;
  border-radius: 6px;
}

.check-option input:checked + .check-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.check-option input:checked + .check-mark::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}

.check-option > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-option strong {
  font-size: 12px;
}

.check-option small {
  color: #99958e;
  font-size: 10px;
}

.picking-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.sync-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.sync-summary > div {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
}

.sync-summary span {
  grid-column: 1 / -1;
  color: #8b8780;
  font-size: 10px;
  text-align: center;
}

.sync-summary strong {
  font-size: 21px;
  letter-spacing: -0.04em;
}

.sync-summary small {
  align-self: end;
  padding-bottom: 3px;
  color: #99958e;
  font-size: 10px;
}

.sync-summary .matched-summary {
  border-color: #bfe1ce;
  background: #f0faf4;
}

.sync-summary .missing-summary {
  border-color: #f0d3ca;
  background: #fff6f3;
}

.sync-summary .zero-summary {
  border-color: #d9d5e9;
  background: #f6f4fb;
}

.zero-summary strong {
  color: #6853a4;
}

.sync-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #68645e;
  background: #f3f1ec;
  font-size: 11px;
  line-height: 1.6;
}

.picking-summary > div {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
}

.picking-summary span {
  grid-column: 1 / -1;
  color: #8b8780;
  font-size: 10px;
  text-align: center;
}

.picking-summary strong {
  font-size: 21px;
  letter-spacing: -0.04em;
}

.picking-summary small {
  align-self: end;
  padding-bottom: 3px;
  color: #99958e;
  font-size: 10px;
}

.picking-summary .matched-summary {
  border-color: #bfe1ce;
  background: #f0faf4;
}

.matched-summary strong {
  color: #217346;
}

.picking-summary .missing-summary {
  border-color: #f0d3ca;
  background: #fff6f3;
}

.missing-summary strong {
  color: #bd4d36;
}

.missing-list {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #8d402f;
  background: #fff2ee;
  font-size: 11px;
}

.missing-list strong {
  font-size: 11px;
}

.missing-list p {
  margin: 5px 0 0;
  line-height: 1.6;
  word-break: break-all;
}

.change-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfaf7;
  color: #68645e;
  font-size: 11px;
}

.change-list span {
  margin-right: 5px;
  color: #217346;
  font-weight: 900;
}

.picking-download-button {
  background: #217346;
}

.picking-download-button:hover:not(:disabled) {
  background: #185c37;
  box-shadow: 0 8px 22px rgba(33, 115, 70, 0.22);
}

.download-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.picking-download-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.picking-download-actions .merge-button {
  min-width: 0;
  padding-inline: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.orientation-section {
  margin-top: 16px;
}

.orientation-section > .output-label {
  margin: 0 0 9px;
}

.orientation-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.orientation-option {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfaf7;
  text-align: left;
  cursor: pointer;
}

.orientation-option:hover {
  border-color: #bcb8b0;
}

.orientation-option.is-active {
  border-color: #217346;
  background: #f0faf4;
  box-shadow: 0 0 0 2px rgba(33, 115, 70, 0.08);
}

.orientation-option > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.orientation-option strong {
  font-size: 13px;
}

.orientation-option small {
  color: #8b8780;
  font-size: 10px;
}

.paper-icon {
  display: block;
  flex: 0 0 auto;
  fill: white;
  stroke: #77736d;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landscape-paper {
  width: 36px;
  height: 26px;
}

.portrait-paper {
  width: 26px;
  height: 36px;
  margin: 0 5px;
}

.orientation-option.is-active .paper-icon {
  fill: #ffffff;
  stroke: #217346;
}

.download-actions .merge-button {
  margin-top: 14px;
}

.pdf-download-button {
  background: #d4533a;
}

.pdf-download-button:hover:not(:disabled) {
  background: #b93e29;
  box-shadow: 0 8px 22px rgba(185, 62, 41, 0.2);
}

footer {
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  border-top: 1px solid rgba(23, 23, 23, 0.12);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.footer-metrics {
  justify-content: flex-end;
}

.footer-brand {
  font-size: 17px;
}

.footer-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

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

footer p {
  margin: 0;
  color: #8a8883;
  font-size: 12px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3f1ec;
  --muted: #aaa69e;
  --line: #3b3935;
  --paper: #171717;
  --white: #242321;
  --accent: #ff7a49;
  --accent-dark: #ff8a5f;
  --green: #73c99c;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 107, 53, 0.1), transparent 28%),
    var(--paper);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] footer {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .brand-mark {
  color: #171717;
  background: #f3f1ec;
}

html[data-theme="dark"] .theme-switcher,
html[data-theme="dark"] .header-tabs .tool-tab:hover,
html[data-theme="dark"] .tool-tab,
html[data-theme="dark"] .home-notice-card,
html[data-theme="dark"] .tool-card {
  background: rgba(36, 35, 33, 0.94);
}

html[data-theme="dark"] .label-mode-card,
html[data-theme="dark"] .custom-label-toolbar {
  border-color: #3a3834;
  background: #22211f;
}

html[data-theme="dark"] .label-mode-card--custom {
  background: #27211e;
}

html[data-theme="dark"] .label-size-badge {
  border-color: #44413c;
  color: #d2cec7;
  background: #292825;
}

html[data-theme="dark"] .theme-button:hover {
  background: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .theme-button.is-active,
html[data-theme="dark"] .header-tabs .tool-tab.is-active,
html[data-theme="dark"] .select-button,
html[data-theme="dark"] .password-form button {
  color: #171717;
  background: #f3f1ec;
}

html[data-theme="dark"] .metric-pill {
  background: rgba(34, 33, 31, 0.95);
  border-color: #3f3b37;
}

html[data-theme="dark"] .metric-icon {
  background: linear-gradient(145deg, #3a2314, #5a331a);
  color: #ffb27f;
}

html[data-theme="dark"] .metric-text strong {
  color: #f3f1ec;
}

html[data-theme="dark"] .metric-text small {
  color: #c7c0b8;
}

html[data-theme="dark"] .footer-right {
  color: #c7c0b8;
}

html[data-theme="dark"] .home-notice-card {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .notice-page-button {
  border-color: #3f3b37;
  background: #22211f;
  color: var(--ink);
}

html[data-theme="dark"] .notice-page-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

html[data-theme="dark"] #notice-page-indicator {
  color: #aaa69e;
}

html[data-theme="dark"] #home-notice-text,
html[data-theme="dark"] .notice-feature-list li,
html[data-theme="dark"] .hero p,
html[data-theme="dark"] .sync-note {
  color: #aaa69e;
}

html[data-theme="dark"] .notice-feature-list strong {
  color: #f0ede7;
}

html[data-theme="dark"] .label-fields input,
html[data-theme="dark"] .password-form input,
html[data-theme="dark"] .admin-editor textarea,
html[data-theme="dark"] .admin-status-card,
html[data-theme="dark"] .admin-placeholder-card,
html[data-theme="dark"] .admin-status-preview,
html[data-theme="dark"] .local-chat,
html[data-theme="dark"] .chat-topbar,
html[data-theme="dark"] .chat-composer,
html[data-theme="dark"] .chat-composer textarea,
html[data-theme="dark"] .chat-bubble,
html[data-theme="dark"] .selected-file,
html[data-theme="dark"] .sheet-badge,
html[data-theme="dark"] .output-field,
html[data-theme="dark"] .ups-summary > div,
html[data-theme="dark"] .sync-summary > div,
html[data-theme="dark"] .picking-summary > div,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .orientation-option {
  color: var(--ink);
  background: #211f1d;
}

html[data-theme="dark"] .chat-message.user .chat-bubble {
  color: #171717;
  border-color: var(--accent);
  background: var(--accent);
}

html[data-theme="dark"] .admin-status-card {
  background:
    radial-gradient(circle at top right, rgba(242, 107, 58, 0.16), transparent 34%),
    #211f1d;
}

html[data-theme="dark"] .admin-empty-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 44%),
    #211f1d;
}

html[data-theme="dark"] .admin-placeholder-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 42%),
    #211f1d;
}

html[data-theme="dark"] .admin-status-preview.is-enabled {
  background: rgba(37, 132, 90, 0.16);
}

html[data-theme="dark"] .admin-status-preview.is-enabled strong {
  color: #77d6a8;
}

html[data-theme="dark"] .admin-status-preview.is-disabled {
  background: rgba(198, 40, 40, 0.14);
}

html[data-theme="dark"] .admin-status-preview.is-disabled strong {
  color: #ff9a8f;
}

html[data-theme="dark"] .drop-zone {
  border-color: #55514b;
  background:
    linear-gradient(rgba(31, 30, 28, 0.86), rgba(31, 30, 28, 0.86)),
    repeating-linear-gradient(-45deg, #242321, #242321 8px, #1d1c1a 8px, #1d1c1a 16px);
}

html[data-theme="dark"] .drop-zone.is-dragging {
  border-color: var(--accent);
  background: #2c211d;
}

html[data-theme="dark"] .label-preview-wrap {
  background: #211f1d;
}

html[data-theme="dark"] .label-preview {
  border-color: #5a5650;
  background: white;
}

html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .progress-track {
  background: #35322e;
}

html[data-theme="dark"] .pdf-list li {
  border-color: #35322e;
}

html[data-theme="dark"] .local-badge,
html[data-theme="dark"] .sheet-badge.is-ready,
html[data-theme="dark"] .sync-summary .matched-summary,
html[data-theme="dark"] .message {
  color: #8bd6af;
  border-color: #315a45;
  background: #1c3026;
}

html[data-theme="dark"] .sheet-badge.is-error,
html[data-theme="dark"] .sync-summary .missing-summary,
html[data-theme="dark"] .message.error {
  color: #ff9b7c;
  border-color: #653c31;
  background: #39231e;
}

html[data-theme="dark"] .ups-summary .accent-summary,
html[data-theme="dark"] .sync-summary .zero-summary,
html[data-theme="dark"] .missing-list,
html[data-theme="dark"] .sync-note {
  background: #2b2522;
}

html[data-theme="dark"] .license-download-card {
  background: #222;
}

html[data-theme="dark"] .license-mail-preview,
html[data-theme="dark"] .license-delivery-copy {
  background: #222;
}

html[data-theme="dark"] .license-mail-fields dt {
  background: #292929;
}

html[data-theme="dark"] .license-copy-button {
  color: #181818;
  background: #f1ede6;
}

html[data-theme="dark"] .license-note {
  color: #d7cfa7;
  background: #332f20;
}

@media (max-width: 700px) {
  .site-header {
    width: min(100% - 20px, 1180px);
    min-height: 64px;
  }

  .header-note,
  .desktop-only {
    display: none;
  }

  main {
    width: min(100% - 24px, 980px);
  }

  .hero {
    padding: 38px 8px 24px;
  }

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

  .hero p {
    font-size: 15px;
  }

  .tool-card {
    padding: 16px;
    border-radius: 18px;
  }

  .tool-tabs {
    gap: 7px;
  }

  .header-tabs {
    gap: 2px;
  }

  .theme-switcher {
    margin-left: 0;
  }

  .header-metrics {
    gap: 4px;
    margin-left: 6px;
  }

  .metric-pill {
    padding: 4px 7px;
    min-height: 26px;
  }

  .metric-icon {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .metric-text strong,
  .metric-text small {
    font-size: 8px;
  }

  .theme-button {
    width: 27px;
    height: 28px;
  }

  .tool-tab {
    min-height: 68px;
    gap: 8px;
    padding: 11px;
  }

  .header-tabs .tool-tab {
    min-height: 44px;
    gap: 5px;
    padding: 8px 7px;
  }

  .header-tabs .tab-number {
    display: none;
  }

  .footer-right {
    gap: 4px;
  }

  .header-tabs .tool-tab strong {
    font-size: 10px;
    white-space: nowrap;
  }

  .tool-tab small {
    display: none;
  }

  .tool-heading {
    flex-direction: column;
  }

  .dashboard-header-right {
    align-items: flex-start;
  }

  .license-download-card {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .license-download-card .merge-button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .license-mail-fields > div {
    grid-template-columns: 1fr;
  }

  .license-mail-fields dt {
    padding-bottom: 5px;
    border-right: 0;
  }

  .license-mail-fields dd {
    padding-top: 7px;
  }

  .label-workspaces {
    grid-template-columns: 1fr;
  }

  .home-notice {
    min-height: 310px;
    padding-bottom: 45px;
  }

  .home-notice-card {
    padding: 22px;
  }

  .admin-actions {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

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

  .drop-zone {
    min-height: 230px;
    padding: 20px 14px;
  }

  .list-header > span {
    display: none;
  }

  .ups-summary {
    grid-template-columns: 1fr 18px 1fr;
  }

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

  .sync-summary {
    grid-template-columns: 1fr 1fr;
  }

  .download-actions {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .picking-download-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .picking-download-actions .merge-button {
    margin-top: 0;
  }

  .orientation-options {
    grid-template-columns: 1fr;
  }

  .ups-summary .size-summary {
    grid-column: 1 / -1;
    min-height: 62px;
  }

  footer {
    width: calc(100% - 32px);
  }
}

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 20px;
  padding: 7px;
  border: 1.5px solid color-mix(in srgb, var(--border) 86%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.74), rgba(255,255,255,.92)),
    repeating-linear-gradient(135deg, rgba(23,23,23,.022) 0, rgba(23,23,23,.022) 7px, transparent 7px, transparent 14px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.58), 0 12px 26px rgba(15, 23, 42, .045);
}

.dash-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 12px;
  cursor: pointer;
  font: 850 12px/1 var(--font);
  color: var(--text-muted);
  padding: 7px 8px;
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

.dash-tab::before {
  content: "";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-muted) 10%, var(--surface));
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
}

.dash-tab[data-dash="incoming"]::before { content: "📥"; }
.dash-tab[data-dash="queue"]::before { content: "⏳"; }
.dash-tab[data-dash="outgoing"]::before { content: "🚚"; }
.dash-tab[data-dash="personnel"]::before { content: "👥"; }
.dash-tab[data-dash="materials"]::before { content: "📦"; }
.dash-tab[data-dash="library"]::before { content: "📚"; }
.dash-tab[data-dash^="future"]::before { content: "＋"; }

.dash-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  transform: translateY(-1px);
}

.dash-tab.is-active {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 54%, var(--border));
  background: linear-gradient(135deg, var(--accent), #f97316);
  box-shadow: 0 12px 24px rgba(255, 107, 53, .22);
}

.dash-tab.is-active::before {
  background: rgba(255,255,255,.2);
  color: #fff;
}

.dash-tab:disabled,
.dash-tab-soon {
  cursor: default;
  opacity: .58;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  border-style: dashed;
}

.dash-tab:disabled:hover,
.dash-tab-soon:hover {
  transform: none;
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
}

.dash-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.dash-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 130px;
  border-left: 4px solid var(--stat-color, var(--border));
}

.dash-stat.stat-blue   { --stat-color: #3b82f6; }
.dash-stat.stat-blue   .stat-icon { color: #3b82f6; opacity: 1; }
.dash-stat.stat-blue   strong { color: #3b82f6; }

.dash-stat.stat-amber  { --stat-color: #f59e0b; }
.dash-stat.stat-amber  .stat-icon { color: #f59e0b; opacity: 1; }
.dash-stat.stat-amber  strong { color: #d97706; }

.dash-stat.stat-orange { --stat-color: #f97316; }
.dash-stat.stat-orange .stat-icon { color: #f97316; opacity: 1; }
.dash-stat.stat-orange strong { color: #ea580c; }

.dash-stat.stat-green  { --stat-color: #22c55e; }
.dash-stat.stat-green  .stat-icon { color: #22c55e; opacity: 1; }
.dash-stat.stat-green  strong { color: #16a34a; }

.stat-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: .7;
  display: inline-block;
  vertical-align: middle;
}

.money-icon {
  width: auto;
  height: auto;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.dash-stat.is-accent .stat-icon { color: var(--accent); opacity: 1; }

.dash-stat > :last-child,
.dash-stat > :nth-last-child(2) { display: flex; flex-direction: column; gap: 2px; }

.dash-stat span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.dash-stat strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}

.dash-stat.is-accent strong { color: var(--accent); }

#dashboard-content .dash-item-value {
  color: #cc0000 !important;
}

#dashboard-content .dash-qty-value {
  color: #1155cc !important;
}

#dashboard-content .dash-item-header,
#dashboard-content .dash-qty-header {
  color: var(--text) !important;
}

#dashboard-content .dashboard-amount-value {
  color: var(--accent);
}

.dash-unit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 9%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.dash-unit-badge.is-box {
  background: #ffff00;
  color: #ff0000;
}

.dash-unit-badge.is-plt {
  background: #000000;
  color: #ffffff;
}

.dash-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1.5px solid var(--border);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.dash-table thead tr {
  background: var(--surface);
}

.dash-table th {
  color: var(--text-muted);
  font-weight: 850;
  font-size: 10px;
  text-align: left;
  padding: 7px 8px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dash-table th:last-child { border-right: none; }

.dash-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.dash-table td:last-child { border-right: none; }

.dash-table tbody tr:last-child td { border-bottom: none; }

.dash-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 60%, transparent); }

.dash-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent) !important; }

.dash-personnel-table td:first-child,
.dash-personnel-table td:nth-child(7) {
  font-weight: 700;
}

.dash-personnel-table .personnel-section-row td {
  background: var(--accent-soft);
}

.dash-personnel-graphic {
  display: grid;
  gap: 18px;
}

.dashboard-board,
.dash-queue-wrap {
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
  border-radius: 24px;
  background-color: #fff8f3;
  background-image:
    radial-gradient(circle at 8% 0%, rgba(255, 107, 53, .13), transparent 28%),
    radial-gradient(circle at 94% 18%, rgba(34, 197, 94, .10), transparent 26%),
    linear-gradient(135deg, rgba(255, 107, 53, .05), rgba(34, 197, 94, .04) 52%, rgba(255, 255, 255, .88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.62);
}

.dashboard-board .dashboard-content-card {
  margin: 0;
}

.dashboard-board .dash-summary,
.dashboard-board .dash-chart-wrap {
  margin-bottom: 0;
}

.queue-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background-color: #ffffff;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.76)),
    radial-gradient(circle at top left, rgba(255, 107, 53, .20), transparent 36%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .06);
}

.queue-hero h3 {
  margin: 0;
  color: var(--accent);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.dashboard-hero h3 {
  color: var(--accent);
}

.queue-complete-total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.queue-complete-total span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: rgba(255,255,255,.76);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.queue-complete-total b {
  color: var(--accent);
  font-size: 16px;
  font-weight: 950;
}

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

.queue-summary-card,
.queue-section,
.queue-card {
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.queue-summary-card {
  padding: 15px 16px;
  min-height: 94px;
}

.queue-summary-card span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.queue-summary-card strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -.03em;
}

.queue-summary-card.is-working strong { color: var(--accent); }
.queue-summary-card.is-done strong { color: #16a34a; }

.dashboard-board .dash-table-wrap,
.dashboard-board .dash-chart-wrap,
.dashboard-board .dash-materials-card {
  border: 1.5px dashed color-mix(in srgb, var(--text-muted) 32%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .94)),
    repeating-linear-gradient(135deg, rgba(23,23,23,.025) 0, rgba(23,23,23,.025) 7px, transparent 7px, transparent 14px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.68),
    0 14px 28px rgba(15, 23, 42, .045);
}

.dashboard-board .dash-table-wrap {
  overflow: auto;
}

.queue-mini-board {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

.queue-stage-pills,
.queue-carrier-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .045);
}

.queue-stage-filter,
.queue-carrier-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.queue-stage-filter.is-active {
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 107, 53, .18);
}

.queue-stage-filter.is-active b {
  color: #fff;
}

.queue-stage-pills b,
.queue-carrier-filter b {
  color: var(--accent);
}

.queue-stage-filter b {
  color: var(--accent);
}

.queue-carrier-filter {
  min-height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.queue-packed-column .queue-carrier-pills {
  width: 100%;
  justify-content: flex-start;
  align-content: flex-start;
}

.queue-packed-column .queue-carrier-filter {
  flex: 1 1 74px;
  justify-content: center;
}

.queue-carrier-filter.is-active {
  color: var(--accent);
  background: transparent;
}

.queue-carrier-filter > span:not(.queue-carrier-icon) {
  font-size: 12px;
  font-weight: 850;
}

.queue-carrier-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  max-width: 74px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  background: #334155;
  color: #fff;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.queue-carrier-icon span { color: #ff6600; }
.queue-carrier-icon.dhl { background: #ffcc00; color: #d40511; }
.queue-carrier-icon.fedex { background: #4d148c; color: #fff; }
.queue-carrier-icon.ups { background: #351c15; color: #ffb500; }
.queue-carrier-icon.cj { background: #e30613; color: #fff; }
.queue-carrier-icon.forward { min-width: 48px; background: #1d4ed8; color: #fff; }

.queue-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-split-grid {
  display: grid;
  grid-template-columns: minmax(310px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.outgoing-carrier-panel,
.outgoing-list-panel {
  min-height: 540px;
}

.outgoing-list-panel {
  padding-bottom: 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
}

.outgoing-list-panel .dash-table-wrap {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 0 0 12px 12px;
  border: 1.5px solid var(--border);
  border-top: 0;
  background: rgba(255,255,255,.78);
}

.outgoing-list-panel .dash-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.outgoing-list-panel .dash-table thead {
  display: none;
}

.outgoing-table-head {
  display: grid;
  grid-template-columns: 6% 16% 23% 14% 10% 11% 20%;
  align-items: center;
  padding: 9px 8px;
  border: 1.5px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: color-mix(in srgb, var(--text-muted) 8%, var(--surface));
  color: var(--text);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.outgoing-table-head span {
  min-width: 0;
  padding: 0 8px;
}

.outgoing-list-panel .dash-table th,
.outgoing-list-panel .dash-table td {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.outgoing-list-panel .dash-table td {
  border-bottom: 1.5px solid color-mix(in srgb, var(--border) 82%, var(--accent) 18%);
}

.outgoing-list-panel .dash-table tbody tr:nth-child(odd) td {
  background: color-mix(in srgb, var(--surface) 34%, transparent);
}

.outgoing-list-panel .dash-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface) 68%, transparent);
}

.outgoing-list-panel .dash-table td:first-child {
  text-align: center;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 900;
}

.outgoing-list-panel .dash-table td:nth-child(2) {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 950;
}

.outgoing-carrier-panel .dash-chart-wrap {
  margin: 0;
  min-height: 0;
  overflow-y: auto;
}

.outgoing-carrier-panel .carrier-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.dash-empty-card {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.queue-active-column,
.queue-packed-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.queue-panel-spacer {
  min-height: 50px;
  pointer-events: none;
}

.queue-packed-column .queue-carrier-pills {
  align-content: center;
  min-height: 50px;
  padding: 8px 10px;
}

.queue-panel {
  min-width: 0;
  min-height: 360px;
  max-height: 540px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 16px;
  border: 1.5px dashed color-mix(in srgb, var(--text-muted) 36%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .94)),
    repeating-linear-gradient(135deg, rgba(23,23,23,.025) 0, rgba(23,23,23,.025) 7px, transparent 7px, transparent 14px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.68),
    0 14px 28px rgba(15, 23, 42, .055);
}

.queue-panel.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background-color: #fff7f0;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.94)),
    repeating-linear-gradient(135deg, rgba(255,107,53,.045) 0, rgba(255,107,53,.045) 7px, transparent 7px, transparent 14px);
}

.queue-panel.packed {
  border-color: color-mix(in srgb, #22c55e 42%, var(--border));
  background-color: #f4fff8;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,255,255,.95)),
    repeating-linear-gradient(135deg, rgba(34,197,94,.045) 0, rgba(34,197,94,.045) 7px, transparent 7px, transparent 14px);
}

.queue-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.queue-panel-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.03em;
}

.queue-panel-title span {
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.queue-panel.packed .queue-panel-title span {
  background: color-mix(in srgb, #22c55e 10%, var(--surface));
  color: #16a34a;
}

.queue-panel-head,
.queue-panel .queue-row {
  display: grid;
  grid-template-columns: 24px minmax(70px, .78fr) minmax(72px, 1fr) minmax(54px, 64px) 32px 38px 52px 54px;
  align-items: center;
  gap: 5px;
}

.queue-panel-head.no-progress,
.queue-panel .queue-row.no-progress {
  grid-template-columns: 24px minmax(70px, .78fr) minmax(86px, 1.13fr) minmax(54px, 66px) 32px 38px 52px;
}

.queue-panel-head {
  padding: 0 8px 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.queue-panel-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
}

.queue-row-list {
  display: grid;
  gap: 8px;
}

.queue-row {
  min-height: 42px;
  padding: 7px 7px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.86);
}

.queue-row[hidden] {
  display: none !important;
}

.queue-row-head {
  min-height: auto;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--text-muted) 6%, var(--surface));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.queue-row-index,
.queue-invoice {
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.queue-row-index {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 7px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 9%, var(--surface));
  font-size: 10px;
  font-weight: 900;
}

.queue-row-customer {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-row-carrier,
.queue-row-number,
.queue-row-worker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.queue-row-carrier {
  display: inline-flex;
  justify-content: flex-start;
}

.queue-row-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.queue-row-item { color: #cc0000; }
.queue-row-qty { color: #1155cc; }

.queue-row-worker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 9%, var(--surface));
  color: var(--text);
}

.queue-row-worker.is-box {
  background: #ffff00;
  color: #ff0000;
  font-weight: 900;
}

.queue-row-worker.is-plt {
  background: #000000;
  color: #ffffff;
  font-weight: 900;
}

.queue-row-progress {
  display: grid;
  align-items: center;
  gap: 8px;
}

.queue-stage-badge {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 24px;
  padding: 0 6px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.queue-stage-badge.is-picking {
  color: #71a30c;
}

.queue-stage-badge.is-packing {
  color: #5479df;
}

.queue-stage-badge.is-packing-done {
  color: #171717;
  border-color: color-mix(in srgb, #171717 24%, var(--border));
  background: color-mix(in srgb, #171717 6%, var(--surface));
}

.queue-panel .queue-row-progress i {
  display: none;
}

.queue-empty {
  margin: 0;
  padding: 24px 10px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.queue-panel.packed .queue-stage-badge {
  border-color: color-mix(in srgb, #22c55e 35%, var(--border));
  background: color-mix(in srgb, #22c55e 10%, var(--surface));
  color: #16a34a;
}

html[data-theme="dark"] .queue-panel {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, #fff 4%), var(--surface)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0, rgba(255,255,255,.035) 7px, transparent 7px, transparent 14px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

html[data-theme="dark"] .dashboard-board,
html[data-theme="dark"] .dash-queue-wrap {
  background-color: #151719;
  background-image:
    radial-gradient(circle at 8% 0%, rgba(255, 107, 53, .18), transparent 30%),
    radial-gradient(circle at 94% 18%, rgba(34, 197, 94, .14), transparent 28%),
    linear-gradient(135deg, rgba(255, 107, 53, .05), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

html[data-theme="dark"] .queue-hero,
html[data-theme="dark"] .queue-stage-pills,
html[data-theme="dark"] .queue-carrier-pills {
  background: color-mix(in srgb, var(--surface) 92%, #fff 5%);
}

html[data-theme="dark"] .dash-tabs {
  border-color: #3a3834;
  background:
    linear-gradient(135deg, rgba(36,35,33,.86), rgba(28,27,25,.94)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) 7px, transparent 7px, transparent 14px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

html[data-theme="dark"] .dash-tab {
  background: rgba(255,255,255,.045);
  border-color: #3a3834;
}

html[data-theme="dark"] .dash-tab::before {
  background: rgba(255,255,255,.08);
}

html[data-theme="dark"] .dash-tab.is-active {
  border-color: rgba(255, 122, 73, .58);
  background: linear-gradient(135deg, #ff6b35, #f97316);
}

html[data-theme="dark"] .dash-tab:disabled,
html[data-theme="dark"] .dash-tab-soon {
  background: rgba(255,255,255,.025);
  border-color: #3a3834;
  color: #7b756d;
}

html[data-theme="dark"] .person-meta .person-dday {
  background: rgba(255, 122, 73, .14);
  border-color: rgba(255, 122, 73, .28);
  color: #fb923c;
}

html[data-theme="dark"] .dashboard-board .dash-table-wrap,
html[data-theme="dark"] .dashboard-board .dash-chart-wrap,
html[data-theme="dark"] .dashboard-board .dash-materials-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, #fff 4%), var(--surface)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0, rgba(255,255,255,.035) 7px, transparent 7px, transparent 14px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

html[data-theme="dark"] .queue-row {
  background: color-mix(in srgb, var(--surface) 88%, #fff 4%);
}

.queue-row.is-done .queue-stage-badge {
  border-color: color-mix(in srgb, #22c55e 35%, var(--border));
  background: color-mix(in srgb, #22c55e 10%, var(--surface));
  color: #16a34a;
}

.queue-row-progress i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 12%, var(--surface));
}

.queue-row-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
}

.queue-row.is-done .queue-row-progress b {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.queue-layout-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr 1fr;
  gap: 12px;
}

.queue-section {
  padding: 16px;
}

.queue-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: -.03em;
}

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

.queue-stage-row {
  display: grid;
  grid-template-columns: 48px 1fr 42px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 750;
}

.queue-stage-row strong {
  color: var(--text);
  text-align: right;
}

.queue-stage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 10%, var(--surface));
}

.queue-stage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
}

.queue-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.queue-chip b {
  color: var(--accent);
}

.queue-carrier-grid {
  display: grid;
  gap: 8px;
}

.queue-carrier-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text-muted) 7%, var(--surface));
}

.queue-carrier-card strong {
  font-size: 12px;
  color: var(--text);
}

.queue-carrier-card span:last-child {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.queue-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.queue-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-left: 4px solid color-mix(in srgb, var(--text-muted) 30%, transparent);
}

.queue-card.is-working { border-left-color: var(--accent); }
.queue-card.is-done { border-left-color: #22c55e; }

.queue-card-top,
.queue-workline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-card-top strong {
  color: var(--text);
  font-size: 15px;
}

.queue-status,
.queue-progress {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.queue-card.is-done .queue-status {
  background: color-mix(in srgb, #22c55e 12%, var(--surface));
  color: #16a34a;
}

.queue-customer {
  min-height: 38px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.queue-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.queue-card-meta span,
.queue-worker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 10%, var(--surface));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.queue-worker {
  color: var(--text);
  font-weight: 850;
}

.queue-worker.is-empty {
  color: var(--text-muted);
  font-weight: 700;
}

.personnel-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background-color: #ffffff;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.76)),
    radial-gradient(circle at top left, rgba(255, 107, 53, .20), transparent 36%);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .06);
}

.personnel-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--accent);
}

.personnel-hero h3 {
  margin: 0;
  color: var(--accent);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.personnel-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.personnel-summary-card {
  min-height: 104px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.personnel-summary-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -24px;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-color, var(--accent)) 16%, transparent);
}

.personnel-summary-card strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.015em;
}

.personnel-summary-card em {
  display: block;
  margin-top: 12px;
  color: var(--card-color, var(--accent));
  font-size: 30px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: -.03em;
}

.personnel-summary-card.male { --card-color: #4f7fcf; }
.personnel-summary-card.female { --card-color: #d16b9c; }
.personnel-summary-card.present { --card-color: #5c9f67; }
.personnel-summary-card.total { --card-color: #e17845; }
.personnel-summary-card.rest { --card-color: #8a78c7; }

.personnel-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.person-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.03);
}

.person-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
}

.person-card.is-male .person-avatar { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.person-card.is-female .person-avatar { background: linear-gradient(135deg, #f472b6, #db2777); }

.person-info strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.person-meta span,
.person-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 10%, var(--surface));
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

.person-meta .person-dday {
  background: linear-gradient(135deg, rgba(255, 107, 53, .16), rgba(245, 158, 11, .18));
  border: 1px solid rgba(255, 107, 53, .24);
  color: #c2410c;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: .01em;
  box-shadow: 0 6px 14px rgba(255, 107, 53, .09);
}

.person-side-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  justify-self: end;
}

.person-tenure {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(34, 197, 94, .22);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(20, 184, 166, .11));
  color: #15803d;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.person-tenure.tenure-senior {
  border-color: rgba(17, 85, 204, .2);
  background: linear-gradient(135deg, rgba(17, 85, 204, .13), rgba(59, 130, 246, .1));
  color: #1155cc;
}

.person-tenure.tenure-decade {
  border-color: rgba(124, 58, 237, .26);
  background: linear-gradient(135deg, rgba(124, 58, 237, .14), rgba(168, 85, 247, .11));
  color: #6d28d9;
}

.person-status {
  background: color-mix(in srgb, #ef4444 12%, var(--surface));
  color: #b91c1c;
  white-space: nowrap;
  font-weight: 900;
}

html[data-theme="dark"] .person-tenure {
  border-color: rgba(74, 222, 128, .3);
  background: rgba(34, 197, 94, .14);
  color: #86efac;
}

html[data-theme="dark"] .person-tenure.tenure-senior {
  border-color: rgba(96, 165, 250, .32);
  background: rgba(59, 130, 246, .14);
  color: #93c5fd;
}

html[data-theme="dark"] .person-tenure.tenure-decade {
  border-color: rgba(196, 181, 253, .34);
  background: rgba(124, 58, 237, .18);
  color: #c4b5fd;
}

@media (max-width: 700px) {
  .dash-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dash-tab {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }

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

  .queue-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .queue-summary-grid,
  .queue-layout-grid,
  .queue-mini-board,
  .queue-split-grid,
  .dashboard-split-grid,
  .queue-active-column,
  .queue-packed-column {
    grid-template-columns: 1fr;
  }

  .queue-row,
  .queue-row-head,
  .queue-panel .queue-row {
    grid-template-columns: 1fr;
  }

  .queue-row-head,
  .queue-panel-head {
    display: none;
  }

  .queue-row-number {
    text-align: left;
  }

  .personnel-hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .person-card {
    grid-template-columns: 38px 1fr;
  }

  .person-side-badges {
    grid-column: 2;
    justify-self: start;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .person-status {
    grid-column: 2;
    justify-self: start;
  }
}

.dash-table .num-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.dash-table .tag-cell {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
}

.dash-table .amount-cell {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.dash-materials-grid {
  display: grid;
  gap: 16px;
}

.dash-materials-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.dash-materials-card h3 {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.dash-materials-card.is-box-stock h3 {
  color: #b45309;
  background: linear-gradient(90deg, rgba(245, 158, 11, .15), transparent);
}

.dash-materials-card.is-pack-stock h3 {
  color: #0369a1;
  background: linear-gradient(90deg, rgba(14, 165, 233, .14), transparent);
}

.dash-library-card h3 {
  color: #4338ca;
  background: linear-gradient(90deg, rgba(99, 102, 241, .14), transparent);
}

.dash-library-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.dash-library-item {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.dash-library-item.is-active {
  border-color: rgba(99, 102, 241, .28);
  background:
    linear-gradient(135deg, rgba(99, 102, 241, .11), rgba(14, 165, 233, .08)),
    var(--surface);
  box-shadow: 0 10px 26px rgba(79, 70, 229, .08);
}

.dash-library-item.is-active:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, .44);
  box-shadow: 0 14px 32px rgba(79, 70, 229, .12);
}

.dash-library-item.is-disabled {
  color: var(--text-muted);
  filter: grayscale(1);
  opacity: .52;
  pointer-events: none;
}

.dash-library-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--text-muted) 10%, var(--surface));
  font-size: 22px;
}

.dash-library-item.is-active .dash-library-icon {
  color: #4f46e5;
  background: linear-gradient(135deg, rgba(79, 70, 229, .18), rgba(14, 165, 233, .16));
}

.dash-library-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-library-item strong {
  display: block;
  color: currentColor;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.32;
  word-break: keep-all;
}

.dash-library-item small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

#dashboard-content .dash-materials-card.is-box-stock .mat-item-name {
  color: #7c4a03;
}

#dashboard-content .dash-materials-card.is-box-stock .mat-item-qty {
  color: #c2410c !important;
}

#dashboard-content .dash-materials-card.is-pack-stock .mat-item-name {
  color: #075985;
}

#dashboard-content .dash-materials-card.is-pack-stock .mat-item-qty {
  color: #047857 !important;
}

html[data-theme="dark"] .dash-stat { background: var(--surface); }
html[data-theme="dark"] .dash-table th { background: var(--surface); }
html[data-theme="dark"] .dash-table tbody tr:hover td { background: var(--surface); }
html[data-theme="dark"] .dashboard-export-button {
  background: color-mix(in srgb, var(--surface) 90%, #111 10%);
  border-color: var(--border);
}
html[data-theme="dark"] .dashboard-export-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

html[data-theme="dark"] .dashboard-export-button.is-excel {
  border-color: rgba(34, 197, 94, .42);
  background: rgba(22, 163, 74, .13);
  color: #4ade80;
}

html[data-theme="dark"] .dashboard-export-button.is-pdf {
  border-color: rgba(248, 113, 113, .42);
  background: rgba(239, 68, 68, .13);
  color: #f87171;
}

html[data-theme="dark"] .dash-materials-card.is-box-stock h3 {
  color: #fbbf24;
  background: linear-gradient(90deg, rgba(245, 158, 11, .18), transparent);
}

html[data-theme="dark"] .dash-materials-card.is-pack-stock h3 {
  color: #38bdf8;
  background: linear-gradient(90deg, rgba(14, 165, 233, .18), transparent);
}

html[data-theme="dark"] .dash-library-card h3 {
  color: #a5b4fc;
  background: linear-gradient(90deg, rgba(99, 102, 241, .2), transparent);
}

html[data-theme="dark"] .dash-library-item.is-active {
  border-color: rgba(129, 140, 248, .34);
  background:
    linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(14, 165, 233, .12)),
    var(--surface);
  box-shadow: none;
}

html[data-theme="dark"] .dash-library-item.is-active .dash-library-icon {
  color: #c4b5fd;
  background: rgba(99, 102, 241, .18);
}

html[data-theme="dark"] .dash-library-item.is-disabled {
  opacity: .42;
}

html[data-theme="dark"] #dashboard-content .dash-materials-card.is-box-stock .mat-item-name {
  color: #facc15;
}

html[data-theme="dark"] #dashboard-content .dash-materials-card.is-box-stock .mat-item-qty {
  color: #fb923c !important;
}

html[data-theme="dark"] #dashboard-content .dash-materials-card.is-pack-stock .mat-item-name {
  color: #7dd3fc;
}

html[data-theme="dark"] #dashboard-content .dash-materials-card.is-pack-stock .mat-item-qty {
  color: #34d399 !important;
}

/* ── Carrier badge ─────────────────────────────────────────── */
.carrier-badge {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 5px;
  letter-spacing: -.2px;
  vertical-align: middle;
  line-height: 1.4;
  flex-shrink: 0;
}

.carrier-name-text {
  font-size: 12px;
  margin-left: 5px;
  vertical-align: middle;
}

/* ── Dashboard Charts ───────────────────────────────────────── */
.dash-chart-wrap { margin-bottom: 20px; }

.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Vendor cards (입고 거래처별) ─────────────────────────────── */
.vendor-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vendor-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  overflow: hidden;
}

.vendor-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  opacity: .12;
  pointer-events: none;
  border-radius: 6px 0 0 6px;
}

.vendor-name {
  position: relative;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.vendor-val {
  position: relative;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Carrier cards (출고 배송사별) ───────────────────────────── */
.carrier-summary-row {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.carrier-summary-row strong {
  color: var(--text);
  font-weight: 700;
}

.carrier-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.carrier-card {
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1.5px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: var(--surface);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .055);
}

.carrier-card-header {
  padding: 11px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrier-card-body {
  display: grid;
  grid-template-columns: .72fr 1fr 1fr;
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,.12);
}

.carrier-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 10px 5px 9px;
  gap: 5px;
}

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

.cstat-num {
  font-size: 22px;
  font-weight: 950;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cstat-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}

.carrier-stat-unit .dash-unit-badge {
  width: 100%;
  max-width: 72px;
  min-height: 24px;
  padding: 4px 5px;
  font-size: 11px;
}

.cstat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ── Materials item grid ─────────────────────────────────────── */
.mat-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
  padding: 14px;
}

.mat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--surface) 82%, #fff 18%);
  border: 1.5px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
}

.mat-visual-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.mat-visual-icon.box { box-shadow: 0 10px 24px rgba(217, 119, 6, .14); }
.mat-visual-icon.air { box-shadow: 0 10px 24px rgba(2, 132, 199, .14); }
.mat-visual-icon.tape { box-shadow: 0 10px 24px rgba(234, 88, 12, .14); }
.mat-visual-icon.wrap { box-shadow: 0 10px 24px rgba(5, 150, 105, .14); }

.mat-item-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mat-item-name {
  font-size: 12px;
  color: color-mix(in srgb, var(--text) 72%, var(--text-muted));
  font-weight: 850;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
}

.mat-item-qty {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

.dash-mat-chart { padding: 16px 16px 0; }

/* ── Location Sync split layout ─────────────────────────────── */
.sync-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 700px) {
  .sync-split { grid-template-columns: 1fr; }
}

.sync-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loc-pane .loc-check-textarea {
  min-height: 210px;
  resize: vertical;
}

.sync-pane-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  width: fit-content;
}

.sync-pane-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

#sync-workspace {
  display: grid;
  gap: 14px;
}

#sync-content .output-label,
#sync-content .output-field {
  margin-top: 0;
}

#sync-content .selected-file {
  margin-top: 2px;
}

#sync-content .sync-summary {
  margin-top: 10px;
}

#sync-content .merge-button,
#sync-content .message {
  margin-top: 0;
}

#sync-content #sync-download-button {
  margin-top: 8px;
}

#loc-check-results {
  min-height: 286px;
  max-height: 470px;
  overflow: hidden;
  border: 1.5px dashed #cac7bf;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)),
    repeating-linear-gradient(-45deg, #f8f7f3, #f8f7f3 8px, #f4f2ed 8px, #f4f2ed 16px);
  padding: 14px;
}

#loc-check-results:empty::before {
  content: "";
  display: block;
  min-height: 256px;
}

.loc-input-frame {
  padding: 2px;
  border: 1.5px dashed #cac7bf;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)),
    repeating-linear-gradient(-45deg, #f8f7f3, #f8f7f3 8px, #f4f2ed 8px, #f4f2ed 16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.loc-input-frame:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

/* ── Location checker ────────────────────────────────────────── */
.loc-check-textarea {
  width: 100%;
  min-height: 210px;
  font-family: var(--mono, monospace);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  resize: vertical;
  box-sizing: border-box;
}

.loc-check-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.loc-check-summary {
  display: flex;
  gap: 14px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0 6px;
}

/* ── Location Pick ───────────────────────────────────────────── */
.location-pick-input-frame {
  position: relative;
  height: 560px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    repeating-linear-gradient(-45deg, #f8f7f3, #f8f7f3 8px, #f4f2ed 8px, #f4f2ed 16px);
}

.location-pick-split {
  grid-template-columns: minmax(320px, .78fr) minmax(560px, 1.22fr);
  align-items: stretch;
}

.location-pick-highlight,
.location-pick-textarea {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10.8px;
  line-height: 1.45;
  letter-spacing: -.01em;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  tab-size: 2;
  scrollbar-width: none;
}

.location-pick-textarea::-webkit-scrollbar {
  display: none;
}

.location-pick-highlight {
  position: absolute;
  inset: 2px;
  z-index: 1;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  color: color-mix(in srgb, var(--text) 62%, var(--text-muted));
  pointer-events: none;
  user-select: none;
  scrollbar-width: none;
}

.location-pick-highlight.has-content {
  color: #334155;
}

.location-pick-highlight::-webkit-scrollbar {
  display: none;
}

.location-pick-textarea {
  position: relative;
  z-index: 2;
  color: transparent;
  caret-color: var(--accent);
  background: transparent;
  -webkit-text-size-adjust: 100%;
  text-decoration: none;
  text-decoration-color: transparent;
}

.location-pick-textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 58%, transparent);
}

.location-pick-result-pane {
  display: flex;
  gap: 12px;
}

.location-pick-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.location-pick-title-row .sync-pane-title {
  margin: 0;
}

.location-pick-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}

.location-pick-mini-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.location-pick-mini-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.location-pick-mini-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.location-pick-mini-button.excel {
  color: #217346;
}

.location-pick-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr .9fr .9fr;
  gap: 8px;
  margin-bottom: 12px;
}

.location-pick-stat-card {
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(17, 24, 39, .035);
}

.location-pick-stat-card span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 850;
}

.location-pick-stat-card strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-pick-progress {
  display: flex !important;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.location-pick-remaining {
  color: #cc0000;
  font-size: 13px;
  font-weight: 950;
}

.location-pick-slash {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.location-pick-total {
  color: #6b7280;
  font-size: 12px;
  font-weight: 900;
}

.location-pick-progress small {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 950;
}

.location-pick-done {
  color: #15803d;
  font-size: 13px;
  font-weight: 950;
}

.location-pick-stat-card .location-pick-remaining {
  color: #cc0000;
}

.location-pick-stat-card .location-pick-total {
  color: #1f2937;
}

.location-pick-stat-card .location-pick-slash {
  color: #6b7280;
}

.location-pick-stat-card .location-pick-done {
  color: #15803d;
}

.location-pick-stat-card.invoice {
  border-color: rgba(17, 85, 204, .18);
  background: color-mix(in srgb, #1155cc 7%, var(--surface));
}

.location-pick-stat-card.customer {
  border-color: rgba(124, 58, 237, .18);
  background: color-mix(in srgb, #7c3aed 7%, var(--surface));
}

.location-pick-stat-card.product {
  border-color: rgba(34, 197, 94, .2);
  background: color-mix(in srgb, #16a34a 8%, var(--surface));
}

.location-pick-stat-card.total {
  border-color: rgba(255, 107, 53, .2);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.location-pick-result {
  flex: 1 1 auto;
  height: 560px;
  min-height: 560px;
  max-height: 560px;
  overflow: hidden;
  border: 1.5px dashed #cac7bf;
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
    repeating-linear-gradient(-45deg, #f8f7f3, #f8f7f3 8px, #f4f2ed 8px, #f4f2ed 16px);
  padding: 14px;
}

.location-pick-empty {
  min-height: calc(100% - 58px);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.location-pick-fixed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.location-pick-fixed > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 107, 53, .18);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.location-pick-fixed span,
.location-pick-summary span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.location-pick-fixed strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-pick-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.location-pick-summary span {
  margin: 0;
}

.location-pick-summary strong {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.location-pick-barcode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(17, 85, 204, .18);
  border-radius: 9px;
  background: color-mix(in srgb, #1155cc 8%, var(--surface));
  color: #1155cc;
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.location-pick-barcode-button:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 85, 204, .32);
  background: color-mix(in srgb, #1155cc 13%, var(--surface));
}

.location-pick-barcode-button.is-copied {
  border-color: rgba(107, 114, 128, .24);
  background: color-mix(in srgb, #6b7280 12%, var(--surface));
  color: #6b7280;
  opacity: .72;
}

.location-pick-barcode-button.is-copied::before {
  content: "✓";
  margin-right: 5px;
  font-family: inherit;
  font-weight: 950;
}

.location-pick-barcode-button.is-copied:hover {
  transform: none;
  border-color: rgba(107, 114, 128, .24);
  background: color-mix(in srgb, #6b7280 12%, var(--surface));
}

.location-pick-table-wrap {
  height: calc(100% - 58px);
  max-height: none;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.location-pick-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.location-pick-table th,
.location-pick-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  vertical-align: middle;
}

.location-pick-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 96%, white);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 1px 0 var(--border), 0 10px 18px color-mix(in srgb, var(--surface) 88%, transparent);
}

.location-pick-table th::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--border);
}

.location-pick-table th:first-child,
.location-pick-table td:first-child,
.location-pick-table th:last-child,
.location-pick-table td:last-child {
  text-align: center;
  white-space: nowrap;
}

.location-pick-table td:first-child {
  color: var(--text-muted);
  font-weight: 900;
}

.location-pick-table td:nth-child(2) {
  color: #262626;
  font-weight: 850;
  word-break: break-all;
}

.location-pick-table td:nth-child(3) {
  color: #262626;
  font-weight: 750;
  word-break: break-word;
}

.location-pick-table td:nth-child(4) {
  font-family: var(--mono, monospace);
  font-weight: 800;
  white-space: nowrap;
}

.location-pick-table td:last-child {
  color: #262626;
  font-weight: 950;
}

.location-pick-table tbody tr.is-copied td {
  background: color-mix(in srgb, #6b7280 8%, var(--surface));
  color: #6b7280;
}

.location-pick-table tbody tr.is-copied td:nth-child(2),
.location-pick-table tbody tr.is-copied td:last-child {
  color: #6b7280;
}

.location-pick-table tbody tr.is-copied .location-pick-barcode-button {
  border-color: rgba(107, 114, 128, .24);
  background: color-mix(in srgb, #6b7280 12%, var(--surface));
  color: #6b7280;
  opacity: .72;
}

html[data-theme="dark"] .location-pick-result,
html[data-theme="dark"] .location-pick-input-frame {
  border-color: rgba(255, 255, 255, .16);
  background:
    linear-gradient(rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.94)),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .028) 8px, rgba(255, 255, 255, .014) 8px, rgba(255, 255, 255, .014) 16px);
}

html[data-theme="dark"] .location-pick-highlight {
  color: #e2e8f0;
  text-shadow: none;
}

html[data-theme="dark"] .location-pick-table th {
  background: #111827;
  color: #cbd5e1;
  box-shadow: 0 1px 0 rgba(148, 163, 184, .26), 0 12px 18px rgba(15, 23, 42, .9);
}

html[data-theme="dark"] .location-pick-barcode-button {
  border-color: rgba(147, 197, 253, .22);
  background: rgba(59, 130, 246, .14);
  color: #93c5fd;
}

html[data-theme="dark"] .location-pick-barcode-button.is-copied {
  border-color: rgba(148, 163, 184, .26);
  background: rgba(148, 163, 184, .14);
  color: #cbd5e1;
}

html[data-theme="dark"] .location-pick-table tbody tr.is-copied td {
  background: rgba(148, 163, 184, .1);
  color: #cbd5e1;
}

html[data-theme="dark"] .location-pick-table tbody tr.is-copied td:nth-child(2),
html[data-theme="dark"] .location-pick-table tbody tr.is-copied td:last-child {
  color: #cbd5e1;
}

html[data-theme="dark"] .location-pick-table td:nth-child(2) {
  color: #e5e7eb;
}

html[data-theme="dark"] .location-pick-table td:nth-child(3) {
  color: #e5e7eb;
}

html[data-theme="dark"] .location-pick-table td:last-child {
  color: #e5e7eb;
}

html[data-theme="dark"] .location-pick-stat-card {
  box-shadow: none;
}

html[data-theme="dark"] .location-pick-remaining {
  color: #fca5a5;
}

html[data-theme="dark"] .location-pick-total {
  color: #cbd5e1;
}

html[data-theme="dark"] .location-pick-progress small {
  color: #fdba74;
}

html[data-theme="dark"] .location-pick-done {
  color: #86efac;
}

.location-pick-highlight .json-key {
  color: #7c3aed;
}

.location-pick-highlight .json-string {
  color: #0f766e;
}

.location-pick-highlight .json-number {
  color: #1155cc;
}

.location-pick-highlight .json-boolean {
  color: #c2410c;
}

.location-pick-highlight .json-null {
  color: #64748b;
}

html[data-theme="dark"] .location-pick-highlight .json-key {
  color: #c084fc;
}

html[data-theme="dark"] .location-pick-highlight .json-string {
  color: #5eead4;
}

html[data-theme="dark"] .location-pick-highlight .json-number {
  color: #60a5fa;
  font-weight: 900;
}

html[data-theme="dark"] .location-pick-highlight .json-boolean {
  color: #fb923c;
}

html[data-theme="dark"] .location-pick-highlight .json-null {
  color: #94a3b8;
}

@media (max-width: 700px) {
  .location-pick-split {
    grid-template-columns: 1fr;
  }

  .location-pick-stat-grid {
    grid-template-columns: 1fr;
  }

  .location-pick-fixed {
    grid-template-columns: 1fr;
  }

  .location-pick-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ── Location filter buttons ─────────────────────────────────── */
.loc-filter-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 0 10px;
}

.loc-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.loc-filter-btn span {
  font-size: 11px;
  background: rgba(23, 23, 23, 0.08);
  color: var(--muted);
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 700;
}

.loc-filter-btn.active,
.loc-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.loc-filter-btn.active span {
  background: var(--accent);
  color: #fff;
}

.loc-filter-btn.loc-filter-match.active  { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }
.loc-filter-btn.loc-filter-match.active span { background: #16a34a; }

.loc-filter-btn.loc-filter-mismatch.active { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.loc-filter-btn.loc-filter-mismatch.active span { background: #dc2626; }

.loc-filter-btn.loc-filter-unknown.active  { border-color: #6b7280; color: #6b7280; background: rgba(107, 114, 128, 0.08); }
.loc-filter-btn.loc-filter-unknown.active span { background: #6b7280; }

.loc-check-error {
  color: var(--danger, #ef4444);
  font-size: 13px;
  padding: 8px 0;
}

.loc-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 364px;
  overflow-y: auto;
  padding-right: 2px;
}

.loc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--mono, monospace);
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.loc-row.loc-match    { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.38); }
.loc-row.loc-mismatch { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.38); }
.loc-row.loc-unknown  { background: rgba(148, 163, 184, 0.08); }

.loc-bc     { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-arrow  { color: var(--muted); flex-shrink: 0; }
.loc-target { font-weight: 700; flex-shrink: 0; }
.loc-actual { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.loc-status-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  line-height: 1.4;
}

.loc-icon {
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.loc-match    { color: #16a34a; }
.loc-mismatch { color: #dc2626; }
.loc-unknown  { color: var(--muted); }

html[data-theme="dark"] .loc-input-frame {
  border-color: #55514b;
  background:
    linear-gradient(rgba(31, 30, 28, 0.86), rgba(31, 30, 28, 0.86)),
    repeating-linear-gradient(-45deg, #242321, #242321 8px, #1d1c1a 8px, #1d1c1a 16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .loc-check-textarea {
  color: var(--ink);
}

html[data-theme="dark"] #loc-check-results {
  border-color: #55514b;
  background:
    linear-gradient(rgba(31, 30, 28, 0.86), rgba(31, 30, 28, 0.86)),
    repeating-linear-gradient(-45deg, #242321, #242321 8px, #1d1c1a 8px, #1d1c1a 16px);
}

html[data-theme="dark"] .loc-filter-btn {
  background: #211f1d;
  color: var(--ink);
}

html[data-theme="dark"] .loc-filter-btn span {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

html[data-theme="dark"] .loc-filter-btn.active,
html[data-theme="dark"] .loc-filter-btn:hover {
  color: var(--accent);
  background: rgba(255, 122, 73, 0.12);
  border-color: rgba(255, 122, 73, 0.45);
}

html[data-theme="dark"] .loc-filter-btn.active span {
  background: var(--accent);
  color: #171717;
}

html[data-theme="dark"] .loc-filter-btn.loc-filter-match.active {
  color: #7dd3a6;
  border-color: rgba(125, 211, 166, 0.5);
  background: rgba(16, 185, 129, 0.16);
}

html[data-theme="dark"] .loc-filter-btn.loc-filter-match.active span {
  background: #16a34a;
  color: #f8f7f3;
}

html[data-theme="dark"] .loc-filter-btn.loc-filter-mismatch.active {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(239, 68, 68, 0.16);
}

html[data-theme="dark"] .loc-filter-btn.loc-filter-mismatch.active span {
  background: #dc2626;
  color: #f8f7f3;
}

html[data-theme="dark"] .loc-filter-btn.loc-filter-unknown.active {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .loc-filter-btn.loc-filter-unknown.active span {
  background: #6b7280;
  color: #f8f7f3;
}

html[data-theme="dark"] .loc-row {
  background: #211f1d;
  border-color: #4a463f;
}

html[data-theme="dark"] .loc-row.loc-match {
  background: rgba(22, 101, 52, 0.22);
  border-color: #166534;
}

html[data-theme="dark"] .loc-row.loc-mismatch {
  background: rgba(153, 27, 27, 0.22);
  border-color: #991b1b;
}

html[data-theme="dark"] .loc-row.loc-unknown {
  background: #211f1d;
}

.carrier-card-empty { opacity: .45; }

.carrier-badge-card {
  font-size: 14px !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  letter-spacing: -.2px;
  white-space: nowrap;
}

html[data-theme="dark"] .mat-visual-icon {
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
}

html[data-theme="dark"] .mat-visual-icon.box { color: #fbbf24; }
html[data-theme="dark"] .mat-visual-icon.air { color: #38bdf8; }
html[data-theme="dark"] .mat-visual-icon.tape { color: #fb923c; }
html[data-theme="dark"] .mat-visual-icon.wrap { color: #34d399; }

.fedex-accent {
  color: #ff7a00;
  font-weight: 900;
}
