@font-face {
  font-family: "BWT Soliden Text";
  src: url("../assets/brand/BWTSoliden-RegularText.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BWT Soliden Text";
  src: url("../assets/brand/BWTSoliden-BoldText.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BWT Soliden Head";
  src: url("../assets/brand/BWTSoliden-LightHead.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BWT Soliden Head";
  src: url("../assets/brand/BWTSoliden-BoldHead.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #ffffff;
  --ink: #102854;
  --ink-2: #00174b;
  --ink-3: #183764;
  --pink: #f490bc;
  --pink-logo: #ff88bd;
  --pink-soft: #fff1f7;
  --surface: #ffffff;
  --page: #f5f5f5;
  --mist: #f8f9fb;
  --line: #dedede;
  --line-strong: #cfd6df;
  --text: #444444;
  --muted: #6f7782;
  --accent: #102854;
  --success: #176b54;
  --danger: #a32558;
  --shadow-sm: 0 6px 16px rgba(16, 40, 84, .08);
  --shadow: 0 16px 36px rgba(16, 40, 84, .12);
  --font-text: "BWT Soliden Text", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "BWT Soliden Head", "BWT Soliden Text", ui-sans-serif, system-ui, sans-serif;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(245, 245, 245, .96)),
    var(--page);
  color: var(--text);
  font-family: var(--font-text);
  line-height: 1.55;
}

a {
  color: var(--ink);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}

a:hover {
  color: var(--pink);
}

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

.ui-icon {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: -0.15em;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-heading h1,
.auth-panel h1,
.surface h1,
.surface h2,
.section-heading h2,
.catalog-panel-header h2,
.mapping-detail-head h2 {
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0;
}

.text-muted,
.form-text {
  color: var(--muted) !important;
}

.global-training-progress {
  position: fixed;
  z-index: 1080;
  top: 1rem;
  right: 1.25rem;
  left: calc(286px + 1.25rem);
  pointer-events: none;
}

.global-training-progress__content {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(220px, 1.8fr) auto;
  gap: .9rem;
  align-items: center;
  max-width: 980px;
  margin-inline: auto;
  padding: .85rem 1rem;
  border: 1px solid rgba(16, 40, 84, .1);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.global-training-progress__copy {
  display: grid;
  gap: .12rem;
  min-width: 0;
}

.global-training-progress__copy strong {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: .95rem;
  line-height: 1.2;
}

.global-training-progress__copy span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.global-training-progress__track {
  position: relative;
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e9edf3;
}

.global-training-progress__bar {
  display: flex;
  width: 0;
  min-width: 2.2rem;
  height: 100%;
  align-items: center;
  justify-content: flex-end;
  padding-right: .42rem;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--ink));
  color: var(--white);
  font-size: .64rem;
  font-weight: 700;
  line-height: 1;
  transition: width .35s ease;
}

.global-training-progress__actions {
  display: flex;
  gap: .45rem;
  align-items: center;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .18s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0)),
    var(--ink);
  color: var(--white);
  box-shadow: 8px 0 28px rgba(16, 40, 84, .18);
}

.app-shell.sidebar-collapsed .sidebar {
  padding: .9rem .65rem;
}

.sidebar-collapse-button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 .55rem;
  padding: .35rem .45rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .84);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.sidebar-collapse-button:hover,
.sidebar-collapse-button:focus {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .14);
  color: var(--white);
  outline: 0;
}

.sidebar-collapse-button-icon {
  width: 1rem;
  height: 1rem;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .16s ease;
}

.app-shell.sidebar-collapsed .sidebar-collapse-button {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-collapse-button-icon {
  transform: rotate(135deg);
}

.content-shell {
  min-width: 0;
  padding: 1.5rem;
}

.content-canvas {
  min-height: calc(100vh - 3rem);
  padding: 1.6rem;
  border: 1px solid rgba(16, 40, 84, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
}

.mobile-topbar {
  display: none;
}

.side-nav {
  display: flex;
  min-height: calc(100vh - 2.5rem);
  flex-direction: column;
}

.brand-lockup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65rem;
  padding: .35rem .45rem 1.15rem;
  color: var(--white);
  text-decoration: none;
}

.brand-lockup:hover {
  color: var(--white);
}

.brand-mark {
  display: flex;
  align-items: center;
  min-height: 54px;
}

.brand-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
}

.app-shell.sidebar-collapsed .brand-lockup {
  justify-items: center;
  padding: .2rem 0 .7rem;
}

.app-shell.sidebar-collapsed .brand-mark {
  justify-content: center;
  min-height: 42px;
}

.app-shell.sidebar-collapsed .brand-logo {
  display: none;
}

.app-shell.sidebar-collapsed .brand-mark::before {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  color: var(--white);
  content: "A";
  font-family: var(--font-head);
  font-weight: 800;
}

.brand-copy {
  display: block;
  padding-left: .12rem;
}

.brand-copy strong,
.brand-copy small {
  display: block;
  letter-spacing: 0;
}

.brand-copy strong {
  color: var(--white);
  font-family: var(--font-head);
  font-size: 1.02rem;
  line-height: 1.12;
}

.brand-copy small {
  margin-top: .2rem;
  color: rgba(255, 255, 255, .68);
  font-size: .76rem;
}

.nav-section {
  margin-top: .75rem;
}

.nav-section.compact {
  margin-top: .65rem;
}

.nav-section-title {
  display: block;
  margin: 1rem .7rem .42rem;
  color: rgba(255, 255, 255, .52);
  font-family: var(--font-head);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-shell.sidebar-collapsed .nav-section {
  margin-top: .45rem;
}

.app-shell.sidebar-collapsed .nav-section-title,
.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .user-copy {
  display: none;
}

.side-link,
.side-cta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin: .18rem 0;
  padding: .68rem .78rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font-family: var(--font-head);
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.app-shell.sidebar-collapsed .side-link,
.app-shell.sidebar-collapsed .side-cta {
  min-height: 46px;
  justify-content: center;
  padding: .68rem;
}

.side-link-main {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .62rem;
}

.side-link-main span {
  min-width: 0;
}

.app-shell.sidebar-collapsed .side-link-main {
  justify-content: center;
  gap: 0;
}

.app-shell.sidebar-collapsed .side-link-main > span {
  display: none;
}

.side-link .ui-icon,
.side-cta .ui-icon {
  width: 1.05rem;
  height: 1.05rem;
  opacity: .9;
}

.app-shell.sidebar-collapsed .side-link .ui-icon,
.app-shell.sidebar-collapsed .side-cta .ui-icon {
  width: 1.18rem;
  height: 1.18rem;
}

.side-link:hover,
.side-link:focus,
.side-link.active,
.side-cta:hover,
.side-cta:focus,
.side-cta.active {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .09);
  color: var(--white);
  transform: translateX(2px);
}

.side-link.active {
  border-color: rgba(244, 144, 188, .72);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.side-link.active::after {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  content: "";
}

.app-shell.sidebar-collapsed .side-link.active::after {
  position: absolute;
  right: .38rem;
  width: 6px;
  height: 6px;
}

.app-shell.sidebar-collapsed .side-link,
.app-shell.sidebar-collapsed .side-cta {
  position: relative;
}

.side-cta {
  justify-content: center;
  margin-top: .7rem;
  border-color: var(--pink);
  background: var(--pink);
  color: var(--ink);
}

.side-cta.active,
.side-cta:hover,
.side-cta:focus {
  background: var(--white);
  color: var(--ink);
}

.logout-link {
  cursor: pointer;
}

.nav-spacer {
  flex: 1;
}

.user-panel {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
}

.app-shell.sidebar-collapsed .user-panel {
  justify-content: center;
  padding: .45rem;
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
}

.user-copy {
  min-width: 0;
}

.user-copy strong,
.user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  color: var(--white);
  font-size: .9rem;
}

.user-copy span {
  color: rgba(255, 255, 255, .66);
  font-size: .75rem;
}

.page-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.5vw, 2.45rem);
  line-height: 1.06;
}

.page-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .68rem;
}

.page-title > span {
  min-width: 0;
}

.page-title .ui-icon {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--pink);
}

.page-heading p {
  max-width: 720px;
  margin: .35rem 0 0;
}

.surface,
.auth-panel,
.action-card {
  border: 1px solid rgba(16, 40, 84, .1);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.surface {
  padding: 1.1rem;
}

/* Content grids should remain compact when their parent has unused height. */
.dashboard-grid,
.document-upload-progress,
.compact-grid,
.item-list,
.item-card,
.item-card-primary-link,
.item-edit-card,
.catalog-knowledge-body,
.catalog-knowledge-form,
.catalog-knowledge-readonly,
.catalog-knowledge-reference,
.catalog-knowledge-entries,
.catalog-knowledge-entry,
.catalog-knowledge-images,
.catalog-knowledge-image-actions,
.catalog-image-strip,
.catalog-knowledge-image,
.catalog-image-picker-grid,
.catalog-image-picker-card,
.document-metadata-editor,
.document-metadata-form,
.document-card-list,
.document-card-main,
.document-knowledge-body,
.document-knowledge-tree,
.document-tree-category,
.document-tree-items,
.document-tree-item,
.document-tree-entry,
.catalog-image-relations,
.control-panel-grid,
.control-panel-card,
.mapping-workspace,
.mapping-list,
.mapping-table,
.chat-quote-generation-notice,
.chat-log,
.chat-spreadsheet-composer,
.checkbox-grid {
  align-content: start;
}

.auth-panel {
  max-width: 460px;
  margin: 3rem auto;
  padding: 1.45rem;
}

.auth-panel h1 {
  margin-bottom: .45rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: .95rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-heading p {
  margin: .25rem 0 0;
}

.action-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: .45rem;
  min-height: 142px;
  overflow: hidden;
  padding: 1.05rem;
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.action-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--pink);
  content: "";
}

.action-card:hover {
  border-color: rgba(244, 144, 188, .72);
  color: inherit;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.action-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: .12rem;
  border: 1px solid rgba(244, 144, 188, .34);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff7fb, #eef3fb);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 40, 84, .08);
}

.action-card-icon .ui-icon {
  width: 1.42rem;
  height: 1.42rem;
}

.action-card-label {
  display: block;
  color: var(--pink);
  font-family: var(--font-head);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.action-card strong {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 22rem;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.05rem;
  line-height: 1.35;
}

.btn {
  border-radius: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0;
}

.btn-with-icon {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
}

.btn-icon-only {
  display: inline-flex;
  width: 2.05rem;
  height: 2.05rem;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-icon-only .ui-icon {
  width: 1rem;
  height: 1rem;
}

.btn-primary {
  border-color: var(--pink);
  background: var(--pink);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(244, 144, 188, .24);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.btn-outline-primary {
  border-color: rgba(16, 40, 84, .42);
  color: var(--ink);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.btn-outline-secondary {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--ink-3);
  background: var(--ink-3);
  color: var(--white);
}

.btn-success {
  border-color: var(--success);
  background: var(--success);
}

.btn-outline-danger {
  border-color: rgba(163, 37, 88, .48);
  color: var(--danger);
}

.btn-outline-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--white);
}

.form-label {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 700;
}

.form-control,
.form-select {
  border-color: var(--line-strong);
  border-radius: 8px;
  padding: .64rem .78rem;
  color: var(--text);
  font-family: var(--font-text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 .2rem rgba(244, 144, 188, .22);
}

.form-control-sm,
.form-select-sm {
  min-height: 32px;
  padding: .34rem .5rem;
  border-radius: 7px;
  font-size: .86rem;
}

.status-check {
  display: flex;
  gap: .55rem;
  align-items: center;
  min-height: 46px;
  margin: 0;
  padding: .64rem .78rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
}

.form-check-input:checked {
  border-color: var(--pink);
  background-color: var(--pink);
}

.alert {
  border-radius: 10px;
  font-family: var(--font-text);
}

.alert-success {
  border-color: rgba(23, 107, 84, .22);
  background: #edf8f4;
  color: #155b48;
}

.alert-danger {
  border-color: rgba(163, 37, 88, .22);
  background: var(--pink-soft);
  color: #8b204d;
}

.alert-info {
  border-color: rgba(16, 40, 84, .16);
  background: #eef3fb;
  color: var(--ink);
}

.app-toast-stack {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 2100;
  display: grid;
  width: min(520px, calc(100vw - 2rem));
  gap: .65rem;
  pointer-events: none;
  transform: translateX(-50%);
}

.app-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .85rem;
  align-items: center;
  min-height: 54px;
  padding: .8rem .9rem .8rem 1rem;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 40, 84, .18);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: .95rem;
  line-height: 1.35;
  pointer-events: auto;
  transform: translateY(-18px) scale(.98);
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease, margin .22s ease;
  touch-action: pan-y;
}

.app-toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.app-toast.hiding {
  margin-top: -12px;
  transform: translateY(-24px) scale(.98);
  opacity: 0;
}

.app-toast-success {
  border-left-color: #176b54;
  background: #edf8f4;
  color: #155b48;
}

.app-toast-danger {
  border-left-color: var(--pink);
  background: var(--pink-soft);
  color: #8b204d;
}

.app-toast-info {
  border-left-color: var(--blue);
  background: #eef3fb;
}

.app-toast-warning {
  border-left-color: #b78415;
  background: #fff7e6;
  color: #6f4b0d;
}

.app-toast-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-toast-close {
  align-self: start;
  min-width: 0;
  padding: .15rem .35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-toast-close:hover,
.app-toast-close:focus {
  background: rgba(16, 40, 84, .08);
}

@media (max-width: 767.98px) {
  .app-toast-stack {
    top: max(.75rem, env(safe-area-inset-top));
    width: calc(100vw - 1rem);
  }

  .app-toast {
    grid-template-columns: 1fr;
    padding: .85rem 1rem;
  }

  .app-toast-close {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast {
    transition: none;
  }
}

.document-upload-progress {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.document-upload-progress strong,
.document-upload-progress span {
  display: block;
}

.document-upload-progress span {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .9rem;
}

.document-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

}

.control-panel-grid {
  display: grid;
  gap: 1rem;
}

.control-panel-card {
  display: grid;
  gap: 1rem;
}

.control-panel-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.control-panel-card-head p {
  margin: .2rem 0 0;
}

.thumbnail-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .7rem;
}

.thumbnail-status-grid div,
.thumbnail-backfill-result {
  display: grid;
  gap: .12rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.thumbnail-status-grid span,
.thumbnail-status-grid small,
.thumbnail-backfill-result span,
.thumbnail-backfill-form label span {
  color: var(--muted);
  font-size: .82rem;
}

.thumbnail-status-grid strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.thumbnail-backfill-form {
  display: grid;
  grid-template-columns: minmax(120px, 180px) auto;
  gap: .65rem;
  align-items: end;
}

.thumbnail-backfill-form label {
  display: grid;
  gap: .25rem;
  margin: 0;
}

.mono {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  font-weight: 700;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wide-field,
.compact-category-grid .row-actions {
  grid-column: 1 / -1;
}

.mapping-workspace {
  display: grid;
  gap: 1rem;
}

.mapping-tabs {
  display: flex;
  gap: .35rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.mapping-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .45rem .85rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.mapping-tab:hover {
  color: var(--ink);
}

.mapping-tab.active {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}

.mapping-grid {
  display: grid;
  grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
  gap: 1rem;
  min-height: 560px;
}

.mapping-selector,
.mapping-detail {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.mapping-selector {
  overflow: hidden;
}

.mapping-panel-head,
.mapping-detail-head {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line);
}

.mapping-panel-head strong,
.mapping-detail-head h2 {
  color: var(--ink);
}

.mapping-panel-head span {
  display: inline-flex;
  min-width: 2rem;
  height: 1.55rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
}

.mapping-detail-head h2 {
  margin: .1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.mapping-detail-head span {
  color: var(--muted);
  font-family: var(--font-head);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.mapping-list,
.mapping-table {
  display: grid;
  max-height: 620px;
  overflow: auto;
}

.mapping-list-row,
.mapping-assigned-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  min-height: 62px;
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--line);
}

.mapping-list-row {
  color: inherit;
  text-decoration: none;
}

.mapping-list-row:hover,
.mapping-list-row.active {
  background: var(--pink-soft);
  color: inherit;
}

.mapping-list-row.active {
  box-shadow: inset 3px 0 0 var(--pink);
}

.mapping-list-row strong,
.mapping-assigned-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-list-row small,
.mapping-assigned-row small {
  display: block;
  overflow: hidden;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-row-meta {
  display: flex;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.mapping-row-meta.wide {
  gap: .55rem;
}

.mapping-status,
.mapping-count,
.mapping-discount {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .15rem .48rem;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
}

.mapping-status.is-active {
  background: #edf8f4;
  color: #155b48;
}

.mapping-status.is-inactive {
  background: #eef2fb;
  color: var(--muted);
}

.mapping-count {
  min-width: 28px;
  background: var(--ink);
  color: var(--white);
}

.mapping-discount {
  background: var(--pink-soft);
  color: var(--danger);
}

.mapping-add {
  border-bottom: 1px solid var(--line);
  background: #fff8fb;
}

.mapping-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6rem;
  padding: .75rem .85rem;
}

.mapping-assigned-row form {
  margin: 0;
}

.mapping-empty {
  padding: 1.4rem .9rem;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
  text-align: center;
}

.mapping-empty.compact {
  padding: .8rem;
  text-align: left;
}

.table {
  margin-bottom: 0;
  color: var(--text);
}

.table td,
.table th {
  vertical-align: middle;
}

.table thead th {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.table tbody tr {
  transition: background .16s ease;
}

.table tbody tr:hover {
  background: var(--pink-soft);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .5rem;
}

.modal-content {
  border-radius: 10px;
}

.mobile-nav-panel {
  background: var(--ink);
}

.mobile-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.mobile-brand img {
  display: block;
  width: 150px;
  max-width: 56vw;
  height: auto;
}
