:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-elevated: rgba(255, 255, 255, 0.82);
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f1f2f6;
  --panel: var(--surface);
  --panel-soft: var(--surface-2);
  --line: rgba(16, 24, 40, 0.1);
  --line-strong: rgba(16, 24, 40, 0.16);
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #86868b;
  --muted: #86868b;
  --muted-strong: #515154;
  --blue: #0071e3;
  --blue-2: #0a84ff;
  --blue-soft: rgba(0, 113, 227, 0.1);
  --indigo: #5e5ce6;
  --green: #1e9f64;
  --green-soft: rgba(30, 159, 100, 0.12);
  --amber: #e67e22;
  --amber-soft: rgba(230, 126, 34, 0.12);
  --orange: var(--amber);
  --orange-soft: var(--amber-soft);
  --red: #d92d20;
  --red-soft: rgba(217, 45, 32, 0.1);
  --violet: #8b5cf6;
  --violet-soft: rgba(139, 92, 246, 0.12);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.1), 0 2px 8px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 28px 80px rgba(16, 24, 40, 0.18), 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-soft: var(--shadow-sm);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 0.8, 0.22, 1);
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background:
    radial-gradient(900px 560px at 82% -14%, rgba(94, 92, 230, 0.1), transparent 65%),
    radial-gradient(820px 500px at 8% 0%, rgba(0, 113, 227, 0.08), transparent 64%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 560px at 82% -14%, rgba(94, 92, 230, 0.1), transparent 65%),
    radial-gradient(820px 500px at 8% 0%, rgba(0, 113, 227, 0.08), transparent 64%),
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Admin-only semantic mapping draft workspace. The visual treatment keeps the
   inactive boundary visible on every section so it cannot be mistaken for a
   live Cake runtime switch. */
.nav-draft-badge {
  position: absolute;
  top: 3px;
  right: 5px;
  padding: 1px 5px;
  border: 1px solid rgba(230, 126, 34, 0.25);
  border-radius: 999px;
  color: #a6540d;
  background: rgba(230, 126, 34, 0.1);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
}

body[data-admin-surface="control"] .nav-list button:has(.nav-draft-badge) {
  position: relative;
  padding-right: 30px;
}

.mapping-v2-shell {
  display: grid;
  gap: 14px;
}

.mapping-v2-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 24px;
  border: 1px solid rgba(94, 92, 230, 0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 180px at 96% -30%, rgba(94, 92, 230, 0.14), transparent 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 255, 0.97));
  box-shadow: var(--shadow-sm);
}

.mapping-v2-hero > div:first-child {
  max-width: 760px;
}

.mapping-v2-hero h3,
.mapping-v2-section-head h3,
.mapping-v2-fallback-card h3 {
  margin: 4px 0 6px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.28;
}

.mapping-v2-hero p,
.mapping-v2-section-head p,
.mapping-v2-fallback-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}

.mapping-v2-hero-state {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 150px;
  padding: 12px 16px;
  border: 1px solid rgba(230, 126, 34, 0.22);
  border-radius: 14px;
  background: rgba(255, 250, 244, 0.94);
  text-align: center;
}

.mapping-v2-hero-state strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9b4d0a;
  font-size: 15px;
}

.mapping-v2-hero-state strong span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.12);
}

.mapping-v2-hero-state small {
  color: var(--text-3);
  font-size: 11px;
}

.mapping-v2-safety {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 13px 16px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: var(--radius);
  background: rgba(246, 250, 255, 0.94);
}

.mapping-v2-safety-main {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.mapping-v2-safety-main strong {
  color: #0068d1;
  font-size: 14px;
}

.mapping-v2-safety-main span,
.mapping-v2-safety > p {
  color: var(--text-2);
  font-size: 12px;
}

.mapping-v2-safety-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mapping-v2-safety-tags span {
  padding: 4px 8px;
  border: 1px solid rgba(30, 159, 100, 0.16);
  border-radius: 999px;
  color: #15744a;
  background: rgba(30, 159, 100, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.mapping-v2-safety > p {
  flex: 1 1 100%;
  margin: -2px 0 0;
  line-height: 1.5;
}

.mapping-v2-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
}

.mapping-v2-status-panel > div,
.mapping-v2-status-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mapping-v2-status-panel small,
.mapping-v2-status-actions > span {
  color: var(--text-3);
  font-size: 11px;
}

.mapping-v2-lock {
  padding: 4px 8px;
  border-radius: 999px;
  color: #9b4d0a;
  background: var(--amber-soft);
  font-size: 11px;
  font-weight: 750;
}

.mapping-v2-validation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.mapping-v2-validation.safe {
  border: 1px solid rgba(30, 159, 100, 0.18);
  color: #15744a;
  background: var(--green-soft);
}

.mapping-v2-validation.warning {
  border: 1px solid rgba(230, 126, 34, 0.22);
  color: #8a480e;
  background: var(--amber-soft);
}

.mapping-v2-validation strong {
  font-size: 12px;
}

.mapping-v2-validation span {
  font-size: 11px;
}

.mapping-v2-section {
  overflow: hidden;
  padding: 0;
}

.mapping-v2-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(250, 250, 252, 0.92), rgba(255, 255, 255, 0.96));
}

.mapping-v2-section-head > div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  max-width: 860px;
}

.mapping-v2-section-head > div > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  align-self: start;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.mapping-v2-section-head h3 {
  margin: 1px 0 3px;
  font-size: 17px;
}

.mapping-v2-section-head p {
  grid-column: 2;
  font-size: 12px;
}

.mapping-v2-section-action > button {
  flex: 0 0 auto;
}

.mapping-v2-field-matrix {
  overflow: hidden;
  margin: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.mapping-v2-field-matrix-head,
.mapping-v2-field-card {
  display: grid;
  grid-template-columns: minmax(250px, 1.8fr) repeat(4, minmax(92px, 0.58fr));
  align-items: stretch;
}

.mapping-v2-field-matrix-head {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 11px;
}

.mapping-v2-field-matrix-head > * {
  display: grid;
  place-items: center;
  padding: 9px 8px;
  text-align: center;
}

.mapping-v2-field-matrix-head > strong {
  place-items: center start;
  padding-left: 14px;
}

.mapping-v2-field-card {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.mapping-v2-field-card:last-child {
  border-bottom: 0;
}

.mapping-v2-field-card > header {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 11px 14px;
}

.mapping-v2-field-card > header strong {
  color: var(--text);
  font-size: 13px;
}

.mapping-v2-field-card > header small {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-v2-matrix-choice {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 54px;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.mapping-v2-matrix-choice input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mapping-v2-route-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mapping-v2-matrix-choice > span {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  transition: 140ms ease;
}

.mapping-v2-matrix-choice input:checked + span {
  border-color: var(--blue);
  color: white;
  background: var(--blue);
  box-shadow: 0 3px 9px rgba(0, 113, 227, 0.2);
}

.mapping-v2-matrix-choice input:checked + span::after {
  content: "✓";
  font-size: 14px;
  font-weight: 850;
}

.mapping-v2-matrix-choice input:focus-visible + span,
.mapping-v2-route-choice input:focus-visible + span {
  outline: 3px solid rgba(0, 113, 227, 0.18);
  outline-offset: 2px;
}

.mapping-v2-matrix-choice input:disabled + span,
.mapping-v2-route-choice input:disabled + span {
  cursor: not-allowed;
  opacity: 0.58;
}

.mapping-v2-matrix-choice em {
  display: none;
  color: var(--text-2);
  font-size: 11px;
  font-style: normal;
}

.mapping-v2-derived-note {
  display: flex;
  gap: 6px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  background: rgba(0, 113, 227, 0.045);
  font-size: 11px;
}

.mapping-v2-rule-list,
.mapping-v2-product-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.mapping-v2-rule-card,
.mapping-v2-product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.mapping-v2-rule-card > header,
.mapping-v2-product-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.mapping-v2-rule-card > header > div,
.mapping-v2-product-card > header > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.mapping-v2-rule-card > header strong,
.mapping-v2-product-card > header strong {
  overflow: hidden;
  max-width: 680px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-v2-rule-card > header span,
.mapping-v2-product-card > header span {
  padding: 3px 7px;
  border-radius: 999px;
  color: #5a55bd;
  background: rgba(94, 92, 230, 0.08);
  font-size: 10px;
  font-weight: 700;
}

.mapping-v2-rule-card > header button,
.mapping-v2-product-card > header button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  color: var(--red);
  background: transparent;
  font-size: 11px;
}

.mapping-v2-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.mapping-v2-form-grid label,
.mapping-v2-notes label {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
}

.mapping-v2-form-grid label.span-2 {
  grid-column: span 2;
}

.mapping-v2-form-grid input,
.mapping-v2-form-grid select,
.mapping-v2-notes textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  outline: 0;
}

.mapping-v2-form-grid input:focus,
.mapping-v2-form-grid select:focus,
.mapping-v2-notes textarea:focus {
  border-color: rgba(0, 113, 227, 0.56);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.mapping-v2-form-grid label.is-disabled {
  opacity: 0.58;
}

.mapping-v2-form-grid small {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 400;
}

.mapping-v2-rule-inheritance {
  margin: -3px 14px 12px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-3);
  background: var(--surface-3);
  font-size: 11px;
  line-height: 1.5;
}

.mapping-v2-advanced {
  border-top: 1px solid var(--line);
  background: rgba(250, 250, 252, 0.65);
}

.mapping-v2-advanced > summary,
.mapping-v2-notes > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.mapping-v2-advanced > summary::-webkit-details-marker,
.mapping-v2-notes > summary::-webkit-details-marker {
  display: none;
}

.mapping-v2-advanced > summary::before,
.mapping-v2-notes > summary::before {
  content: "›";
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: transform 140ms ease;
}

.mapping-v2-advanced[open] > summary::before,
.mapping-v2-notes[open] > summary::before {
  transform: rotate(90deg);
}

.mapping-v2-advanced > summary strong,
.mapping-v2-notes > summary strong {
  font-size: 11px;
}

.mapping-v2-advanced > summary span,
.mapping-v2-notes > summary span {
  color: var(--text-3);
  font-size: 10px;
}

.mapping-v2-form-grid-advanced {
  padding-top: 4px;
}

.mapping-v2-rule-routes {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(210px, 0.8fr);
  gap: 10px;
  padding: 0 14px 14px;
}

.mapping-v2-rule-routes fieldset {
  min-width: 0;
  margin: 0;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.mapping-v2-rule-routes legend {
  padding: 0 4px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
}

.mapping-v2-rule-routes fieldset > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mapping-v2-route-choice {
  position: relative;
  display: inline-flex;
}

.mapping-v2-route-choice span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text-2);
  background: var(--surface);
  font-size: 11px;
  transition: 140ms ease;
}

.mapping-v2-route-choice input:checked + span {
  border-color: rgba(0, 113, 227, 0.34);
  color: #0068d1;
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.08);
}

.mapping-v2-fallback-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-color: rgba(30, 159, 100, 0.2);
  background: linear-gradient(135deg, rgba(244, 253, 248, 0.96), rgba(255, 255, 255, 0.98));
}

.mapping-v2-fallback-card h3 {
  margin: 0 0 3px;
  font-size: 15px;
}

.mapping-v2-fallback-card p {
  font-size: 11px;
}

.mapping-v2-fallback-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 20px;
  font-weight: 800;
}

.mapping-v2-fixed-badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: #15744a;
  background: rgba(30, 159, 100, 0.1);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.mapping-v2-notes {
  padding: 0;
}

.mapping-v2-notes > summary {
  min-height: 46px;
}

.mapping-v2-notes > div {
  display: grid;
  gap: 8px;
  padding: 2px 16px 14px;
}

.mapping-v2-notes textarea {
  min-height: 70px;
  resize: vertical;
}

.mapping-v2-notes > div > small {
  color: #9b4d0a;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 1050px) {
  .mapping-v2-field-matrix-head,
  .mapping-v2-field-card {
    grid-template-columns: minmax(210px, 1.6fr) repeat(4, minmax(78px, 0.58fr));
  }

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

  .mapping-v2-product-primary > label:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .nav-draft-badge {
    display: none;
  }

  body[data-admin-surface="control"] .nav-list button:has(.nav-draft-badge) {
    padding-right: 7px;
  }

  .mapping-v2-hero,
  .mapping-v2-status-panel,
  .mapping-v2-section-head,
  .mapping-v2-derived-note {
    align-items: stretch;
    flex-direction: column;
  }

  .mapping-v2-hero {
    gap: 12px;
    padding: 17px 15px;
  }

  .mapping-v2-hero h3 {
    font-size: 19px;
  }

  .mapping-v2-hero-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    text-align: left;
  }

  .mapping-v2-safety {
    align-items: stretch;
    padding: 12px;
  }

  .mapping-v2-safety-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .mapping-v2-safety-tags {
    gap: 6px;
  }

  .mapping-v2-status-panel,
  .mapping-v2-status-panel > div,
  .mapping-v2-status-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-admin-surface="control"] .mapping-v2-status-actions button,
  body[data-admin-surface="control"] .mapping-v2-section-action > button {
    width: 100%;
    min-height: 44px;
  }

  .mapping-v2-section-head {
    padding: 15px 14px;
  }

  .mapping-v2-section-head > div {
    column-gap: 8px;
  }

  .mapping-v2-field-matrix {
    margin: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .mapping-v2-field-matrix-head {
    display: none;
  }

  .mapping-v2-field-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 9px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
  }

  .mapping-v2-field-card:last-child {
    border-bottom: 1px solid var(--line);
  }

  .mapping-v2-field-card > header {
    grid-column: 1 / -1;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
  }

  .mapping-v2-field-card > header small {
    white-space: normal;
  }

  .mapping-v2-matrix-choice {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    min-height: 46px;
    padding: 8px 10px;
    border-top: 0;
    border-left: 0;
  }

  .mapping-v2-matrix-choice:nth-of-type(even) {
    border-left: 1px solid var(--line);
  }

  .mapping-v2-matrix-choice:nth-of-type(n + 3) {
    border-top: 1px solid var(--line);
  }

  .mapping-v2-matrix-choice em {
    display: block;
  }

  .mapping-v2-rule-list,
  .mapping-v2-product-list {
    padding: 10px;
  }

  .mapping-v2-rule-card > header,
  .mapping-v2-product-card > header {
    padding: 9px 11px;
  }

  .mapping-v2-form-grid,
  .mapping-v2-rule-routes,
  .mapping-v2-fallback-card {
    grid-template-columns: 1fr;
  }

  .mapping-v2-form-grid {
    gap: 10px;
    padding: 12px;
  }

  .mapping-v2-form-grid label.span-2,
  .mapping-v2-product-primary > label:last-child {
    grid-column: auto;
  }

  .mapping-v2-form-grid input,
  .mapping-v2-form-grid select {
    min-height: 44px;
  }

  .mapping-v2-route-choice span {
    min-height: 44px;
  }

  .mapping-v2-fallback-card {
    position: relative;
    align-items: start;
    padding: 14px;
  }

  .mapping-v2-fixed-badge {
    justify-self: start;
  }

  .mapping-v2-notes > summary {
    min-height: 48px;
  }
}
a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: rgba(0, 113, 227, 0.22);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(134, 134, 139, 0.32);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.22);
  outline-offset: 2px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 420px at 80% 10%, rgba(0, 113, 227, 0.12), transparent 62%),
    radial-gradient(560px 360px at 15% 18%, rgba(139, 92, 246, 0.1), transparent 64%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  animation: surfaceIn 260ms var(--ease) both;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel h1 {
  font-size: 25px;
  line-height: 1.2;
}

.login-panel p {
  color: var(--muted);
}

.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background:
    linear-gradient(145deg, #ffe9c2, #fff 48%, #f6c66a),
    var(--surface);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 8px 22px rgba(182, 112, 22, 0.16);
  color: #1d1d1f;
  font-weight: 850;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.primary-button,
.ghost-button,
.icon-button,
.small-button,
.role-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 760;
  white-space: nowrap;
  transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease), color 180ms var(--ease);
}

.primary-button {
  background: linear-gradient(180deg, #1681ed, #0067d3);
  color: #fff;
  border-color: rgba(0, 83, 174, 0.45);
  box-shadow: 0 7px 18px rgba(0, 113, 227, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-button:hover {
  background: linear-gradient(180deg, #2390ff, #006bd8);
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(0, 113, 227, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ghost-button,
.icon-button,
.small-button,
.role-tab {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}

.ghost-button:hover,
.icon-button:hover,
.small-button:hover,
.role-tab:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.icon-button {
  width: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.small-button.danger {
  color: var(--red);
  border-color: #f0c4cb;
  background: #fff;
}

.small-button.danger:hover {
  background: var(--red-soft);
}

.small-button.memo-attachment-button {
  color: var(--blue);
  border-color: #cfe0fb;
  background: var(--blue-soft);
}

.small-button.memo-attachment-button:hover {
  background: #dff0ff;
  border-color: #b8d8fb;
}

.small-button.memo-attachment-button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--panel-soft);
}

.form-error {
  min-height: 20px;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

.record-conflict-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  scroll-margin-bottom: 92px;
  color: #7c2d12;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
}

.record-conflict-card > strong {
  color: #9a3412;
  font-size: 15px;
}

.record-conflict-card:focus-visible {
  outline: 3px solid rgba(234, 88, 12, 0.35);
  outline-offset: 3px;
}

.record-conflict-card > span {
  color: #7c2d12;
  font-weight: 560;
  line-height: 1.55;
}

.record-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.record-conflict-actions > button {
  flex: 1 1 136px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 6px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav-list button {
  min-height: 44px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
  font-weight: 760;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.nav-list button span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0f3f7;
  color: var(--muted-strong);
  font-size: 14px;
}

.nav-list button.active,
.nav-list button:hover {
  background: var(--blue-soft);
  border-color: #cfe0fb;
  color: var(--blue);
}

.nav-list button.active span,
.nav-list button:hover span {
  background: #dcecff;
  color: var(--blue);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
}

.sidebar-footer span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 760;
}

.sidebar-footer button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-weight: 760;
}

.workspace {
  min-width: 0;
  padding: 20px 24px 36px;
}

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

.topbar h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.18;
}

.eyebrow,
.section-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.search-box {
  width: min(360px, 36vw);
  min-height: 44px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
}

.search-box span {
  display: grid;
  place-items: center;
  min-height: 44px;
}

.search-box input {
  min-height: 42px;
  padding-left: 0;
  border: 0;
  box-shadow: none;
}

.status-bar {
  min-height: 28px;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status-bar.error {
  color: var(--red);
}

.view-root {
  display: grid;
  gap: 16px;
}

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

.metric-card,
.panel,
.app-card,
.platform-board-head,
.memo-section-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(18, 26, 38, 0.02);
  animation: surfaceIn 220ms ease-out both;
}

.metric-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.metric-card span,
.app-card span,
.panel-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
}

.metric-card p,
.app-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head,
.platform-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-head {
  margin-bottom: 14px;
}

.platform-board-head {
  padding: 16px;
}

.panel-head h3,
.platform-board-head h3 {
  margin: 0;
  font-size: 17px;
}

.product-board {
  display: grid;
  gap: 14px;
}

.product-board-head {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(420px, 1fr) auto;
  align-items: end;
  gap: 16px;
  min-width: 0;
}

.product-board-head h3 {
  margin: 0;
  font-size: 17px;
}

.product-board-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) repeat(3, minmax(128px, 0.68fr)) repeat(2, minmax(96px, 0.48fr)) auto;
  gap: 10px;
  align-items: end;
}

.product-filter-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.product-filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.product-filter-field input,
.product-filter-field select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  background: #fff;
}

.product-board-controls .small-button {
  align-self: end;
}

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

.app-card {
  min-height: 154px;
  display: grid;
  gap: 10px;
  padding: 16px;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.app-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.app-card h3 {
  margin: 5px 0 0;
  font-size: 17px;
}

.app-card a {
  align-self: end;
  color: var(--blue);
  font-weight: 780;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 780;
}

.tag.blue { color: var(--blue); background: var(--blue-soft); border-color: #cfe0fb; }
.tag.green { color: var(--green); background: var(--green-soft); border-color: #cbeedd; }
.tag.amber { color: var(--amber); background: var(--amber-soft); border-color: #f0d5aa; }
.tag.red { color: var(--red); background: var(--red-soft); border-color: #f4cbd1; }
.tag.violet { color: var(--violet); background: var(--violet-soft); border-color: #dad4ff; }

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

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

.data-table {
  min-width: 980px;
}

.product-data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.product-col-category { width: 7.5%; }
.product-col-name { width: 20%; }
.product-col-flavor { width: 14%; }
.product-col-size { width: 12%; }
.product-col-spec { width: 5.5%; }
.product-col-price { width: 9%; }
.product-col-sync { width: 7%; }
.product-col-cake { width: 7.5%; }
.product-col-status { width: 5.5%; }
.product-col-actions { width: 6%; }

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 820;
}

tr:last-child td {
  border-bottom: 0;
}

.account-name {
  display: grid;
  gap: 3px;
}

.account-name strong {
  font-size: 14px;
}

.account-name span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.platform-board {
  display: grid;
  gap: 16px;
}

.production-board {
  --production-glass: rgba(255, 255, 255, 0.82);
  --production-line: rgba(60, 60, 67, 0.11);
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.production-hero {
  position: relative;
  min-height: 132px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 248, 252, 0.92) 58%, rgba(241, 246, 255, 0.9) 100%),
    #fff;
  box-shadow:
    0 18px 48px rgba(31, 35, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: productionPanelIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.production-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, transparent 32%, rgba(255, 255, 255, 0.58) 50%, transparent 68%, transparent 100%);
  transform: translateX(-120%);
  animation: productionSheen 900ms ease-out 120ms both;
}

.production-hero > * {
  position: relative;
  z-index: 1;
}

.production-hero-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.production-hero h3,
.production-hero p {
  margin: 0;
}

.production-hero h3 {
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.production-hero p,
.production-update-line {
  color: var(--muted);
  font-weight: 760;
}

.production-hero-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  min-height: 44px;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 12px;
  background: rgba(239, 241, 246, 0.86);
  box-shadow: inset 0 1px 2px rgba(21, 28, 38, 0.08);
}

.segmented-control button {
  min-width: 96px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 820;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.segmented-control button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 9px rgba(31, 35, 42, 0.12);
  transform: translateY(-1px);
}

.production-refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(0, 113, 227, 0.22);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 20px rgba(31, 35, 42, 0.07);
}

.production-refresh-button::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 113, 227, 0.28);
  border-top-color: var(--blue);
  border-radius: 999px;
}

.production-board.is-refreshing .production-refresh-button::before {
  animation: refreshSpin 700ms linear infinite;
}

.production-update-line {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 0 6px;
  font-size: 13px;
}

.production-update-line span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.production-update-line span:last-child {
  padding: 0 10px;
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.production-live i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(36, 138, 61, 0.1);
}

.production-board.is-refreshing .production-live i {
  animation: livePulse 950ms ease-in-out infinite;
}

.production-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.production-metric,
.production-card {
  background: var(--production-glass);
  border: 1px solid var(--production-line);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 12px 30px rgba(31, 35, 42, 0.055);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: productionPanelIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.production-metric {
  --tone: var(--blue);
  --tone-soft: var(--blue-soft);
  position: relative;
  min-height: 128px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  overflow: hidden;
  padding: 17px;
}

.production-metric.is-selected {
  border-color: color-mix(in srgb, var(--tone) 30%, rgba(60, 60, 67, 0.12));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), color-mix(in srgb, var(--tone-soft) 38%, #fff)),
    #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 18px 40px rgba(31, 35, 42, 0.08);
}

.production-metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--tone);
}

.production-metric::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% 45%;
  height: 82px;
  background: linear-gradient(90deg, transparent, var(--tone-soft));
  opacity: 0.72;
  transform: rotate(-8deg);
  pointer-events: none;
}

.production-metric.tone-green { --tone: var(--green); --tone-soft: var(--green-soft); }
.production-metric.tone-amber { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.production-metric.tone-red { --tone: var(--red); --tone-soft: var(--red-soft); }

.production-metric-main {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.metric-toggle {
  min-width: 54px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted-strong);
  box-shadow: 0 6px 14px rgba(31, 35, 42, 0.055);
  font-size: 12px;
  font-weight: 820;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.metric-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--tone) 26%, rgba(60, 60, 67, 0.12));
  background: color-mix(in srgb, var(--tone-soft) 72%, #fff);
  color: var(--tone);
}

.metric-toggle-inline {
  --tone: var(--blue);
  --tone-soft: var(--blue-soft);
  flex: 0 0 auto;
}

.production-metric span,
.production-card-head span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.production-metric strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: countLift 360ms ease-out both;
}

.production-metric p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-weight: 720;
}

.metric-category-strip {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-category-pill {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid rgba(60, 60, 67, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  max-width: 100%;
}

.metric-category-pill em {
  overflow: hidden;
  color: var(--muted-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
}

.metric-category-pill b {
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-category-pill.tone-birthday {
  background: rgba(234, 244, 255, 0.78);
  border-color: #cfe0fb;
}

.metric-category-pill.tone-dessert {
  background: rgba(241, 239, 255, 0.78);
  border-color: #dad4ff;
}

.metric-category-pill.tone-other {
  background: rgba(237, 240, 244, 0.72);
}

.metric-detail-stack {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.metric-order-panel {
  --detail-tone: var(--blue);
  --detail-soft: var(--blue-soft);
  position: relative;
  display: grid;
  min-width: 0;
  gap: 14px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--detail-tone) 18%, rgba(60, 60, 67, 0.1));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), color-mix(in srgb, var(--detail-soft) 30%, #fff)),
    #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 18px 46px rgba(31, 35, 42, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: productionPanelIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.metric-order-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--detail-tone);
}

.metric-order-panel.tone-green,
.metric-order-panel.tone-green .metric-toggle-inline {
  --detail-tone: var(--green);
  --detail-soft: var(--green-soft);
  --tone: var(--green);
  --tone-soft: var(--green-soft);
}

.metric-order-panel.tone-amber,
.metric-order-panel.tone-amber .metric-toggle-inline {
  --detail-tone: var(--amber);
  --detail-soft: var(--amber-soft);
  --tone: var(--amber);
  --tone-soft: var(--amber-soft);
}

.metric-order-panel.tone-red,
.metric-order-panel.tone-red .metric-toggle-inline {
  --detail-tone: var(--red);
  --detail-soft: var(--red-soft);
  --tone: var(--red);
  --tone-soft: var(--red-soft);
}

.metric-order-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-order-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.metric-order-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.metric-order-head strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-order-list {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.metric-order-category-group {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.metric-order-category-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(237, 240, 244, 0.76);
  color: var(--muted-strong);
}

.metric-order-category-head.tone-birthday {
  background: rgba(234, 244, 255, 0.88);
  color: var(--blue);
}

.metric-order-category-head.tone-dessert {
  background: rgba(241, 239, 255, 0.9);
  color: var(--violet);
}

.metric-order-category-head.tone-other {
  background: rgba(237, 240, 244, 0.86);
}

.metric-order-category-head span,
.metric-order-category-head b {
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.metric-order-category-head b {
  white-space: nowrap;
}

.metric-order-row {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.5fr) minmax(112px, auto);
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(60, 60, 67, 0.09);
  border-radius: 12px;
  background: rgba(251, 251, 253, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  animation: productionRowIn 240ms ease-out both;
  animation-delay: calc(var(--row-index, 0) * 6ms);
}

.metric-order-row > div {
  min-width: 0;
}

.metric-order-row strong {
  display: block;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-order-row span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 720;
}

.metric-order-time strong {
  font-size: 13px;
}

.metric-order-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-items: end;
  gap: 8px;
}

.metric-order-meta b {
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.metric-order-meta .tag {
  min-height: 22px;
  padding: 0 8px;
}

.metric-empty {
  min-height: 132px;
}

.production-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.production-card {
  min-width: 0;
  max-width: 100%;
  padding: 17px;
}

.production-card.wide {
  display: grid;
  gap: 12px;
}

.production-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.production-card-head h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.urgent-card {
  --card-tone: var(--red);
  border-color: rgba(215, 0, 21, 0.16);
}

.ranking-card.tone-blue {
  --card-tone: var(--blue);
}

.ranking-card.tone-violet {
  --card-tone: var(--violet);
}

.urgent-card,
.ranking-card {
  position: relative;
  overflow: hidden;
}

.urgent-card::before,
.ranking-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--card-tone, var(--blue));
}

.urgent-list,
.ranking-list,
.store-bars {
  display: grid;
  gap: 8px;
}

.urgent-item,
.ranking-row,
.store-bar {
  min-height: 58px;
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(60, 60, 67, 0.09);
  border-radius: 12px;
  background: rgba(251, 251, 253, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  animation: productionRowIn 260ms ease-out both;
  animation-delay: calc(var(--row-index, 0) * 38ms);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.urgent-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.urgent-item > div,
.ranking-row > div,
.store-bar > div {
  min-width: 0;
}

.urgent-item strong,
.ranking-row strong,
.store-bar strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.urgent-item span,
.ranking-row em,
.store-bar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
}

.urgent-item b {
  min-width: 66px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 240, 241, 0.96);
  box-shadow: 0 0 0 1px rgba(215, 0, 21, 0.08) inset;
  color: var(--red);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  animation: urgentPulse 1800ms ease-in-out infinite;
}

.ranking-row {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.ranking-row > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #edf2f7;
  color: var(--muted-strong);
  font-weight: 850;
}

.ranking-row:nth-child(1) > span {
  background: var(--text);
  color: #fff;
}

.ranking-row:nth-child(2) > span {
  background: #e8edf5;
  color: #2f3744;
}

.ranking-row:nth-child(3) > span {
  background: #fff3e3;
  color: var(--amber);
}

.ranking-row b,
.store-bar b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.store-bar {
  grid-template-columns: minmax(92px, 0.8fr) minmax(120px, 1fr) auto;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(237, 240, 244, 0.92);
  box-shadow: inset 0 1px 2px rgba(31, 35, 42, 0.06);
}

.bar-track i {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #6bb3ff);
  transform-origin: left center;
  animation: barGrow 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.production-table-wrap {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.production-orders-table {
  min-width: 820px;
  background: transparent;
}

.production-orders-table th {
  background: rgba(251, 251, 253, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.production-orders-table tbody tr {
  transition: background 150ms ease;
}

.production-orders-table tbody tr:hover td {
  background: rgba(0, 113, 227, 0.035);
}

.empty-state.compact {
  min-height: 120px;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  background: rgba(251, 251, 253, 0.62);
}

.platform-board-head {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(360px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.memo-board-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px);
  gap: 10px;
  align-items: end;
}

.memo-filter-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.memo-filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.memo-filter-field input,
.memo-filter-field select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  background: #fff;
}

.memo-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.memo-section-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 20px;
}

.memo-section-card.is-collapsed .memo-section-head {
  border-bottom: 0;
}

.memo-section-card.tone-blue { border-top: 3px solid var(--blue); }
.memo-section-card.tone-green { border-top: 3px solid var(--green); }
.memo-section-card.tone-amber { border-top: 3px solid var(--amber); }
.memo-section-card.tone-red { border-top: 3px solid var(--red); }
.memo-section-card.tone-violet { border-top: 3px solid var(--violet); }

.memo-section-head {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.memo-section-head h3 {
  margin: 2px 0 3px;
  font-size: 17px;
  letter-spacing: 0;
}

.memo-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.memo-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.memo-section-toggle {
  min-width: 62px;
}

.memo-section-filterbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) minmax(140px, 180px);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.memo-list {
  display: grid;
  background: #fff;
}

.memo-fold-groups,
.platform-account-groups {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
}

.memo-fold-group,
.platform-account-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.memo-fold-group:hover,
.memo-fold-group.is-expanded,
.platform-account-group:hover,
.platform-account-group.is-expanded {
  border-color: #cfe0fb;
  box-shadow: var(--shadow-soft);
}

.memo-fold-group:hover,
.platform-account-group:hover {
  transform: translateY(-1px);
}

.memo-fold-group-head,
.platform-account-group-head {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.memo-fold-group-head:focus-visible,
.platform-account-group-head:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.28);
  outline-offset: -3px;
}

.memo-fold-icon,
.platform-account-fold-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 20px;
  font-weight: 860;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease;
}

.memo-fold-group.is-expanded .memo-fold-icon,
.platform-account-group.is-expanded .platform-account-fold-icon {
  transform: rotate(180deg);
  background: #fff;
}

.memo-fold-group-copy,
.platform-account-group-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.memo-fold-group-copy strong,
.platform-account-group-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 860;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-fold-group-copy small,
.platform-account-group-copy small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-fold-group-meta,
.platform-account-group-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.memo-fold-group-body,
.platform-account-group-body {
  display: grid;
  border-top: 1px solid var(--line);
  background: #fff;
  animation: memoExpandIn 180ms ease-out both;
}

.memo-fold-group-body .memo-item,
.platform-account-group-body .memo-item {
  border-radius: 0;
}

.memo-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.memo-item::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0;
  transform: scaleY(0.55);
  transition: opacity 180ms ease, transform 180ms ease;
}

.memo-item:last-child {
  border-bottom: 0;
}

.memo-item:hover {
  z-index: 1;
  background: #fbfbfd;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.045);
  transform: translateY(-1px);
}

.memo-item:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.memo-item.is-expanded {
  z-index: 1;
  background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
}

.memo-item.is-expanded::before {
  opacity: 1;
  transform: scaleY(1);
}

.memo-item.tone-green::before { background: var(--green); }
.memo-item.tone-amber::before { background: var(--amber); }
.memo-item.tone-red::before { background: var(--red); }
.memo-item.tone-violet::before { background: var(--violet); }

.memo-type-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #cfe0fb;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 15px;
  font-weight: 860;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.memo-item.tone-green .memo-type-mark {
  border-color: #cbeedd;
  background: var(--green-soft);
  color: var(--green);
}

.memo-item.tone-amber .memo-type-mark {
  border-color: #f0d5aa;
  background: var(--amber-soft);
  color: var(--amber);
}

.memo-item.tone-red .memo-type-mark {
  border-color: #f4cbd1;
  background: var(--red-soft);
  color: var(--red);
}

.memo-item.tone-violet .memo-type-mark {
  border-color: #dad4ff;
  background: var(--violet-soft);
  color: var(--violet);
}

.memo-item-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.memo-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.memo-title-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.memo-title-copy > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0;
}

.memo-title-copy h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

.memo-title-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.memo-keyline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.memo-fact {
  min-height: 30px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
}

.memo-fact small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.memo-fact strong {
  min-width: 0;
  max-width: 260px;
  color: inherit;
  font-size: 12px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-fact.tone-blue {
  border-color: #cfe5ff;
  background: var(--blue-soft);
  color: var(--blue);
}

.memo-fact.tone-green {
  border-color: #cfe8d5;
  background: var(--green-soft);
  color: var(--green);
}

.memo-fact.tone-amber {
  border-color: #efd4ad;
  background: var(--amber-soft);
  color: var(--amber);
}

.memo-fact.tone-red {
  border-color: #ffd4d8;
  background: var(--red-soft);
  color: var(--red);
}

.memo-fact.tone-violet {
  border-color: #e0dcff;
  background: var(--violet-soft);
  color: var(--violet);
}

.memo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.memo-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.memo-detail {
  min-width: 0;
  display: grid;
  gap: 6px;
  min-height: 68px;
  align-content: start;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.memo-detail:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.memo-detail small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
}

.memo-detail small::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.34;
}

.memo-detail strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.memo-detail strong a {
  font-weight: 820;
}

.memo-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f7f7f9;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.memo-note-compact {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memo-expanded-panel {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 8px 24px rgba(0, 0, 0, 0.035);
  animation: memoExpandIn 180ms ease-out both;
}

.memo-expanded-head {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 2px 2px 0;
}

.memo-expanded-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.04em;
}

.memo-expanded-head strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

.memo-expanded-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.memo-expanded-actions {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.memo-expanded-actions > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.memo-expanded-actions > div {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.memo-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.action-note {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.memo-empty {
  min-height: 134px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.memo-empty strong {
  color: var(--text);
  font-size: 15px;
}

.log-list {
  display: grid;
  gap: 9px;
}

.log-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.log-item:last-child {
  border-bottom: 0;
}

.log-item strong {
  font-size: 14px;
}

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

.order-contract-shell {
  display: grid;
  gap: 14px;
}

.order-contract-head,
.order-mapping-card {
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(31, 35, 48, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(145%);
}

.order-contract-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 85% 5%, rgba(119, 86, 255, 0.11), transparent 34%),
    radial-gradient(circle at 60% 100%, rgba(0, 113, 227, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.94);
}

.order-contract-head h3 {
  margin: 5px 0 7px;
  color: var(--text);
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: -0.035em;
}

.order-contract-head p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.order-contract-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: center;
  gap: 7px;
  min-width: 260px;
}

.order-contract-trust span {
  padding: 7px 10px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.06);
  color: #075fac;
  font-size: 12px;
  font-weight: 780;
}

.order-channel-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 17px;
  background: rgba(235, 236, 240, 0.82);
}

.order-channel-tab {
  min-height: 60px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 10px 14px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
}

.order-channel-tab span {
  font-size: 14px;
  font-weight: 840;
}

.order-channel-tab small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.order-channel-tab.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: 0 5px 18px rgba(30, 34, 45, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.order-mapping-card {
  overflow: hidden;
}

.order-mapping-card-head {
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.order-mapping-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-mapping-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #1684f8, #0065d5);
  color: #fff;
  font-size: 17px;
  font-weight: 880;
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.22);
}

.order-mapping-identity div {
  display: grid;
  gap: 4px;
}

.order-mapping-identity strong {
  color: var(--text);
  font-size: 17px;
}

.order-mapping-identity small {
  color: var(--muted);
  font-size: 12px;
}

.order-mapping-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 780;
}

.order-mapping-switch input {
  width: 34px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--blue);
}

.order-contract-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(247, 248, 251, 0.95), rgba(252, 252, 253, 0.8));
  border-bottom: 1px solid var(--line);
}

.order-contract-flow > div {
  min-height: 60px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-content: center;
  gap: 2px 9px;
  padding: 10px 12px;
  border: 1px solid rgba(60, 60, 67, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.order-contract-flow > div > span {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 880;
}

.order-contract-flow strong {
  color: var(--text);
  font-size: 13px;
}

.order-contract-flow small,
.order-contract-flow i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.order-mapping-group {
  border-bottom: 1px solid var(--line);
}

.order-mapping-group > header {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(247, 247, 249, 0.82);
}

.order-mapping-group > header strong {
  color: var(--text);
  font-size: 14px;
}

.order-mapping-group > header span {
  color: var(--muted);
  font-size: 12px;
}

.order-mapping-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(190px, 0.9fr) minmax(280px, 1.35fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid rgba(60, 60, 67, 0.075);
}

.order-mapping-grid-head {
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.order-mapping-business {
  display: grid;
  gap: 4px;
}

.order-mapping-business strong {
  color: var(--text);
  font-size: 13px;
}

.order-mapping-business em {
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 59, 48, 0.08);
  color: #c62d27;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.order-mapping-business small,
.order-mapping-grid label small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.order-mapping-grid code {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.045);
  color: #4a4d55;
  font: 680 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.order-mapping-grid label {
  display: grid;
  gap: 4px;
}

.order-mapping-grid input {
  min-height: 40px;
  border-radius: 10px;
  background: rgba(248, 248, 250, 0.94);
  font-size: 13px;
}

.order-mapping-example {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.order-mapping-footer {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.order-mapping-footer > label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 760;
}

.order-mapping-footer textarea {
  resize: vertical;
}

.order-mapping-footer > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.role-tab {
  color: var(--muted-strong);
  font-size: 14px;
}

.role-tab.active {
  color: var(--blue);
  border-color: #b9d3f6;
  background: var(--blue-soft);
}

.permission-tree-panel {
  padding: 20px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 0%, rgba(0, 113, 227, 0.07), transparent 28%),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(25, 30, 42, 0.075);
}

.permission-tree-head h3 {
  margin: 5px 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.permission-tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 13px;
  background: rgba(247, 247, 249, 0.8);
}

.permission-tree-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.permission-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c7c7cc;
}

.permission-dot.full {
  background: #34c759;
}

.permission-dot.partial {
  background: #ff9f0a;
}

.permission-level-one {
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(27, 31, 43, 0.045);
}

.permission-level-one + .permission-level-one {
  margin-top: 12px;
}

.permission-level-one.is-full {
  border-color: rgba(52, 199, 89, 0.22);
}

.permission-level-one.is-partial {
  border-color: rgba(255, 159, 10, 0.25);
}

.permission-level-one-head {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 251, 0.92));
}

.permission-level-one-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.permission-tree-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #1684f8, #0065d5);
  color: #fff;
  font-size: 16px;
  font-weight: 880;
  box-shadow: 0 7px 18px rgba(0, 113, 227, 0.2);
}

.permission-level-one-title div {
  display: grid;
  gap: 4px;
}

.permission-level-one-title strong {
  color: var(--text);
  font-size: 16px;
}

.permission-level-one-title small {
  color: var(--muted);
  font-size: 12px;
}

.permission-node-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.permission-scope-toggle {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid rgba(60, 60, 67, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.permission-scope-toggle.allowed {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.06);
  color: var(--blue);
}

.permission-scope-toggle input {
  width: 15px;
  min-height: 15px;
  padding: 0;
  accent-color: var(--blue);
}

.permission-level-two-list {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.8);
}

.permission-level-two {
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.09);
  border-radius: 15px;
  background: #fff;
}

.permission-level-two > header {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.075);
}

.permission-level-two > header > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
}

.permission-level-two > header > div:first-child > span {
  grid-row: 1 / span 2;
  padding: 4px 6px;
  border-radius: 7px;
  background: rgba(0, 113, 227, 0.07);
  color: var(--blue);
  font-size: 9px;
  font-weight: 860;
}

.permission-level-two > header strong {
  color: var(--text);
  font-size: 13px;
}

.permission-level-two > header small {
  color: var(--muted);
  font-size: 10px;
}

.permission-level-three-list {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.permission-level-three {
  grid-template-columns: minmax(260px, 1fr) 112px 112px;
}

.permission-level-three > div {
  position: relative;
  padding-left: 48px;
}

.permission-level-badge {
  position: absolute;
  left: 9px;
  top: 50%;
  margin: 0 !important;
  padding: 3px 5px;
  transform: translateY(-50%);
  border-radius: 6px;
  background: rgba(118, 118, 128, 0.08);
  color: var(--muted) !important;
  font-size: 9px !important;
  font-weight: 820 !important;
}

.permission-editor {
  display: grid;
  gap: 8px;
}

.permission-edit-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 120px;
  gap: 8px;
  align-items: stretch;
}

.permission-edit-row > div,
.perm-check {
  min-height: 44px;
  display: grid;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 760;
}

.permission-edit-head > div {
  min-height: 38px;
  background: var(--panel-soft);
  color: var(--muted);
}

.permission-edit-row strong,
.permission-edit-row span {
  display: block;
}

.permission-edit-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.perm-check {
  grid-template-columns: 18px 1fr;
  gap: 8px;
  color: var(--muted);
}

.perm-check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.perm-check.allowed {
  color: var(--green);
  border-color: #c7ead9;
  background: var(--green-soft);
}

.perm-check span {
  margin: 0;
  color: inherit;
  font-weight: 780;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.26);
  animation: fadeIn 160ms ease-out both;
}

.drawer {
  position: fixed;
  z-index: 21;
  inset: 0 0 0 auto;
  width: min(660px, 100vw);
  display: grid;
  grid-template-rows: 1fr;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 34px rgba(22, 32, 46, 0.1);
  animation: drawerIn 190ms ease-out both;
}

.drawer.compact-drawer {
  width: min(460px, 100vw);
}

.drawer form {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 22px;
}

.drawer-head,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.password-account-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
}

.password-account-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.password-account-card strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.product-category-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.product-category-field legend {
  padding: 0 6px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 820;
}

.product-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.category-radio {
  min-height: 44px;
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 780;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.category-radio:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.category-radio:has(input:checked) {
  border-color: #9ec5f8;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 209, 0.08);
}

.category-radio input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.product-category-custom {
  display: none;
}

.product-category-field.is-adding .product-category-custom {
  display: grid;
}

.choice-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.choice-field legend {
  padding: 0 6px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 820;
}

.choice-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.choice-field.compact-choice .choice-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.choice-card {
  min-height: 52px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted-strong);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.choice-card:has(input:checked) {
  border-color: #9ec5f8;
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 209, 0.08);
}

.choice-card input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.choice-card span,
.choice-card strong,
.choice-card small {
  min-width: 0;
  display: block;
}

.choice-card strong {
  font-size: 14px;
  line-height: 1.25;
}

.choice-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.is-disabled {
  opacity: 0.58;
}

.is-disabled input,
.is-disabled select,
.is-disabled textarea {
  background: #f3f6fa;
  color: var(--muted);
}

.certificate-schema {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.form-section-title {
  display: grid;
  gap: 3px;
}

.form-section-title strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.form-section-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 650;
}

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

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

.certificate-file-grid .file-field {
  grid-column: auto;
}

.file-field input[type="file"] {
  padding: 9px;
}

.file-current {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.file-current a {
  margin-left: 8px;
  font-weight: 780;
}

.form-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-section h4 {
  margin: 0;
  font-size: 15px;
}

.form-note {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.memo-document-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

.memo-document-action strong {
  padding: 0 5px 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

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

.check-card {
  min-height: 60px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #fff;
}

.check-card input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.check-card strong,
.check-card span {
  display: block;
}

.check-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  min-height: 154px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.empty-state strong {
  color: var(--text);
}

@keyframes surfaceIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes memoExpandIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawerIn {
  from {
    opacity: 0.8;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes productionPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes productionRowIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes productionSheen {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@keyframes refreshSpin {
  to { transform: rotate(360deg); }
}

@keyframes livePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(36, 138, 61, 0.1);
  }
  50% {
    transform: scale(0.82);
    box-shadow: 0 0 0 8px rgba(36, 138, 61, 0.15);
  }
}

@keyframes countLift {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes urgentPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(215, 0, 21, 0.08) inset, 0 0 0 0 rgba(215, 0, 21, 0.16);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(215, 0, 21, 0.08) inset, 0 0 0 5px rgba(215, 0, 21, 0.08);
  }
}

@keyframes barGrow {
  from { transform: scaleX(0.08); }
  to { transform: scaleX(1); }
}

/* ================= luludola admin · Apple Pro detail pass ================= */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
}

.brand {
  padding: 4px 8px 10px;
}

.brand strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-list {
  gap: 5px;
}

.nav-list button {
  position: relative;
  min-height: 46px;
  border-radius: 13px;
  color: var(--muted-strong);
  transition:
    background 200ms var(--ease),
    color 200ms var(--ease),
    border-color 200ms var(--ease),
    box-shadow 200ms var(--ease),
    transform 200ms var(--ease);
}

.nav-list button::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0;
  transform: scaleY(0.55);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

.nav-list button span {
  border: 1px solid rgba(16, 24, 40, 0.06);
  background: var(--surface-3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.nav-list button.active,
.nav-list button:hover {
  background: linear-gradient(145deg, var(--blue-soft), rgba(139, 92, 246, 0.07));
  border-color: rgba(0, 113, 227, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.04);
  color: var(--blue);
  transform: translateX(2px);
}

.nav-list button.active::before,
.nav-list button:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-list button.active span,
.nav-list button:hover span {
  background: rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.12);
  color: var(--blue);
}

.sidebar-footer {
  margin: 0 4px;
  padding: 14px 6px 0;
}

.sidebar-footer button {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.sidebar-footer button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.workspace {
  padding: 20px clamp(18px, 2vw, 30px) 44px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 76px;
  margin: -20px -24px 18px;
  padding: 0 clamp(18px, 2vw, 30px);
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}

.topbar h2 {
  color: var(--text);
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.eyebrow,
.section-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-panel h1,
.topbar h2,
.panel-head h3,
.platform-board-head h3,
.product-board-head h3,
.production-hero h3,
.production-card-head h4,
.memo-section-head h3,
.memo-title-copy h4,
.memo-expanded-head strong,
.form-section-title strong {
  letter-spacing: 0;
}

.toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-box {
  border-color: var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
  transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.search-box:hover,
.search-box:focus-within {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-box input {
  background: transparent;
}

.status-bar {
  min-height: 0;
  padding: 0;
}

.status-bar:not(:empty) {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.metric-card,
.panel,
.app-card,
.platform-board-head,
.memo-section-card {
  background: var(--bg-elevated);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  animation: surfaceIn 260ms var(--ease) both;
}

.metric-card,
.app-card {
  position: relative;
  overflow: hidden;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease), background 220ms var(--ease);
}

.metric-card::after,
.app-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -74px;
  top: -74px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.12), transparent 68%);
  pointer-events: none;
}

.metric-card:hover,
.app-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.metric-card strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.metric-card span,
.app-card span,
.panel-caption {
  color: var(--muted);
}

.metric-card p,
.app-card p {
  color: var(--muted-strong);
}

.panel {
  padding: 18px;
}

.panel-head,
.platform-board-head,
.product-board-head {
  align-items: center;
}

.panel-head h3,
.platform-board-head h3,
.product-board-head h3 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.app-grid {
  gap: 14px;
}

.app-card {
  min-height: 166px;
  border-radius: var(--radius);
}

.app-card a {
  position: relative;
  z-index: 1;
  width: max-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  transition: background 180ms var(--ease), transform 180ms var(--ease);
}

.app-card a:hover {
  background: rgba(0, 113, 227, 0.16);
  text-decoration: none;
  transform: translateY(-1px);
}

.tag {
  border-color: rgba(16, 24, 40, 0.09);
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tag.blue { border-color: rgba(0, 113, 227, 0.14); }
.tag.green { border-color: rgba(30, 159, 100, 0.16); }
.tag.amber { border-color: rgba(230, 126, 34, 0.16); }
.tag.red { border-color: rgba(217, 45, 32, 0.14); }
.tag.violet { border-color: rgba(139, 92, 246, 0.16); }

.table-wrap {
  overflow: auto;
  border-color: var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), var(--shadow-xs);
}

table {
  background: transparent;
}

th,
td {
  border-bottom-color: var(--line);
}

th {
  color: var(--muted);
  background: rgba(251, 251, 253, 0.92);
  font-size: 12px;
  letter-spacing: 0;
}

td {
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted-strong);
}

.product-data-table th,
.product-data-table td {
  padding: 12px 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-data-table th:nth-child(7),
.product-data-table td:nth-child(7),
.product-data-table th:nth-child(8),
.product-data-table td:nth-child(8),
.product-data-table th:nth-child(9),
.product-data-table td:nth-child(9),
.product-data-table th:nth-child(10),
.product-data-table td:nth-child(10) {
  white-space: nowrap;
}

.product-data-table td:nth-child(11) {
  padding-right: 10px;
}

.product-data-table .tag {
  max-width: 100%;
  padding: 0 8px;
}

.product-data-table .row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
  width: 100%;
  justify-content: stretch;
}

.product-data-table .row-actions .small-button {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
}

.product-group-row {
  cursor: pointer;
}

.product-group-row td {
  padding-top: 14px;
  padding-bottom: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
  border-bottom-color: #dbe8f7;
  color: #273142;
  transition: background 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.product-group-row:hover td {
  background: #f2f8ff;
  box-shadow: inset 0 1px 0 rgba(0, 113, 227, 0.08), inset 0 -1px 0 rgba(0, 113, 227, 0.08);
}

.product-group-row.is-expanded td {
  background: #f4f9ff;
}

.product-group-toggle {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.product-group-toggle:focus-visible,
.product-group-row:focus-within td {
  outline: 3px solid rgba(0, 113, 227, 0.28);
  outline-offset: -3px;
}

.product-group-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}

.product-group-row.is-expanded .product-group-icon {
  transform: rotate(90deg);
  background: var(--blue);
  color: #fff;
}

.product-group-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-group-title strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.product-group-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.product-summary-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #4d5969;
  font-weight: 760;
}

.product-summary-stack span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-summary-stack small,
.product-summary-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.product-price-range {
  color: #3f4652;
  font-weight: 860;
}

.product-group-cue {
  display: block;
  width: 8px;
  height: 8px;
  margin: 13px auto 0;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.22);
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}

.product-group-row.is-expanded .product-group-cue {
  transform: scaleX(2.2);
  background: rgba(0, 113, 227, 0.48);
}

.product-child-row td {
  background: #fff;
  animation: productChildRowIn 180ms var(--ease) both;
}

.product-child-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(0, 113, 227, 0.18);
}

@keyframes productChildRowIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

tbody tr {
  transition: background 170ms var(--ease), box-shadow 170ms var(--ease);
}

tbody tr:hover td {
  background: rgba(0, 113, 227, 0.035);
}

.account-name strong,
.log-item strong,
.memo-title-copy h4,
.memo-detail strong,
.permission-edit-row strong {
  color: var(--text);
}

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

.small-button.danger {
  color: var(--red);
  border-color: rgba(217, 45, 32, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.small-button.danger:hover {
  background: var(--red-soft);
  border-color: rgba(217, 45, 32, 0.22);
}

.product-board,
.platform-board {
  gap: 16px;
}

.product-board-head,
.platform-board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  align-items: start;
}

.product-board-head > div:first-child,
.platform-board-head > div:first-child {
  grid-column: 1;
  grid-row: 1;
}

.product-board-head > .primary-button,
.platform-board-head > .primary-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  min-width: 112px;
}

.product-board-head > .product-board-controls,
.platform-board-head > .memo-board-controls {
  grid-column: 1 / -1;
  grid-row: 2;
}

.product-board-controls {
  grid-template-columns:
    minmax(260px, 2fr)
    repeat(3, minmax(132px, 1fr))
    repeat(2, minmax(110px, 0.76fr))
    minmax(96px, auto);
  align-items: end;
}

.memo-board-controls {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
}

.product-filter-field input,
.product-filter-field select,
.memo-filter-field input,
.memo-filter-field select {
  border-color: var(--line);
  background: var(--surface-2);
}

.production-board {
  --production-glass: var(--bg-elevated);
  --production-line: var(--line);
}

.memo-section-card {
  border-radius: var(--radius);
}

.memo-section-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(251, 251, 253, 0.44));
}

.memo-section-filterbar,
.memo-list,
.memo-fold-groups,
.platform-account-groups,
.memo-fold-group-body,
.platform-account-group-body {
  background: rgba(251, 251, 253, 0.72);
}

.memo-fold-group,
.platform-account-group,
.memo-item,
.memo-detail,
.memo-expanded-panel,
.memo-expanded-actions,
.memo-fact,
.password-account-card,
.certificate-schema,
.check-card,
.category-radio,
.choice-card,
.permission-edit-row > div,
.perm-check {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.memo-fold-group:hover,
.memo-fold-group.is-expanded,
.platform-account-group:hover,
.platform-account-group.is-expanded,
.memo-detail:hover,
.choice-card:hover,
.category-radio:hover {
  border-color: rgba(0, 113, 227, 0.18);
  box-shadow: var(--shadow-sm);
}

.memo-fold-group-head,
.platform-account-group-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(251, 251, 253, 0.82));
}

.memo-item:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.memo-note {
  background: rgba(241, 242, 246, 0.72);
}

.role-tab.active,
.category-radio:has(input:checked),
.choice-card:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.22);
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

.permission-edit-head > div {
  background: rgba(241, 242, 246, 0.76);
}

.perm-check.allowed {
  border-color: rgba(30, 159, 100, 0.18);
  background: var(--green-soft);
}

.product-category-field,
.choice-field,
.form-section {
  border-color: var(--line);
}

.drawer-backdrop {
  background: rgba(4, 8, 18, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.drawer {
  background: rgba(255, 255, 255, 0.94);
  border-left-color: var(--line);
  box-shadow: -24px 0 70px rgba(16, 24, 40, 0.18);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
}

.drawer form {
  padding: 24px;
}

.drawer-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 {
  letter-spacing: 0;
}

.drawer-actions {
  position: sticky;
  bottom: 0;
  margin: 8px -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.empty-state {
  border-color: rgba(16, 24, 40, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

@media (max-width: 860px) {
  .topbar {
    min-height: auto;
    margin: -16px -16px 16px;
    padding: 16px;
  }

  .nav-list button:hover,
  .nav-list button.active {
    transform: none;
  }

  .drawer-actions {
    margin: 8px -18px -18px;
    padding: 14px 18px;
  }
}

@media (hover: hover) {
  .production-hero:hover,
  .production-metric:hover,
  .production-card:hover {
    border-color: rgba(60, 60, 67, 0.16);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.88) inset,
      0 18px 42px rgba(31, 35, 42, 0.09);
    transform: translateY(-2px);
  }

  .segmented-control button:not(.active):hover {
    background: rgba(255, 255, 255, 0.48);
    color: var(--text);
  }

  .metric-toggle:hover {
    background: #fff;
    border-color: color-mix(in srgb, var(--tone) 22%, rgba(60, 60, 67, 0.12));
    color: var(--tone);
    transform: translateY(-1px);
  }

  .urgent-item:hover,
  .ranking-row:hover,
  .store-bar:hover,
  .metric-order-row:hover {
    background: #fff;
    border-color: rgba(0, 113, 227, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 8px 18px rgba(31, 35, 42, 0.055);
    transform: translateX(2px);
  }
}

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

/* Channel product language ------------------------------------------------ */
.product-mapping-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 13px;
  background: var(--blue-soft);
}

.product-mapping-handoff > div {
  display: grid;
  gap: 3px;
}

.product-mapping-handoff strong { color: var(--blue); }
.product-mapping-handoff span { color: var(--muted-strong); font-size: 11px; line-height: 1.45; }
.product-mapping-handoff .small-button { flex: 0 0 auto; }

.channel-mapping-shell {
  display: grid;
  gap: 16px;
}

.channel-mapping-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 10%, rgba(0, 113, 227, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.92));
  box-shadow: var(--shadow-sm);
}

.channel-mapping-hero-copy {
  max-width: 780px;
}

.channel-mapping-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mapping-combo-incomplete {
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  color: #9a5a00;
  background: #fff8e8;
  font-size: 13px;
  font-weight: 700;
}

.channel-mapping-hero h3 {
  margin: 6px 0 8px;
  color: var(--text);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
}

.channel-mapping-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.65;
}

.channel-mapping-hero > .primary-button {
  flex: 0 0 auto;
  min-height: 46px;
  padding-inline: 18px;
}

.cake-mapping-rollout {
  --rollout-color: #6e7785;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(360px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--rollout-color) 22%, white);
  border-radius: 20px;
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--rollout-color) 6%, white));
  box-shadow: var(--shadow-xs);
}

.cake-mapping-rollout.is-off { --rollout-color: #6e7785; }
.cake-mapping-rollout.is-shadow { --rollout-color: #a36100; }
.cake-mapping-rollout.is-enabled { --rollout-color: #168348; }
.cake-mapping-rollout.is-error { --rollout-color: var(--red); grid-template-columns: 1fr auto; }
.cake-mapping-rollout.is-loading { grid-template-columns: 1fr; }

.cake-mapping-rollout-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cake-mapping-mode-mark {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: color-mix(in srgb, var(--rollout-color) 12%, white);
  color: var(--rollout-color);
  font-size: 16px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rollout-color) 13%, white);
}

.cake-mapping-rollout-main > div:last-child,
.cake-mapping-rollout.is-loading > div,
.cake-mapping-rollout.is-error > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cake-mapping-kicker {
  color: var(--rollout-color);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.cake-mapping-rollout h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.cake-mapping-rollout h3 b { color: var(--rollout-color); }

.cake-mapping-rollout p,
.cake-mapping-rollout small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cake-mapping-shadow-proof {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.cake-mapping-shadow-proof > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 830;
}

.cake-mapping-shadow-proof.is-passed > span { color: var(--green); }
.cake-mapping-shadow-proof.is-pending > span { color: var(--amber); }

.cake-mapping-shadow-proof dl {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  gap: 6px;
  margin: 0;
}

.cake-mapping-shadow-proof dl > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cake-mapping-shadow-proof dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cake-mapping-shadow-proof dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 880;
}

.cake-mapping-rollout-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.cake-mapping-rollout-actions button {
  min-height: 40px;
  white-space: nowrap;
}

.channel-mapping-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-xs);
}

.channel-mapping-guide > div {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-content: center;
  gap: 3px 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--surface-2);
}

.channel-mapping-guide > div > span {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.channel-mapping-guide strong {
  color: var(--text);
  font-size: 13px;
}

.channel-mapping-guide small,
.channel-mapping-guide i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.channel-mapping-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.channel-mapping-metric {
  --mapping-tone: var(--blue);
  position: relative;
  overflow: hidden;
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.83);
  box-shadow: var(--shadow-xs);
}

.channel-mapping-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--mapping-tone);
}

.channel-mapping-metric.tone-green { --mapping-tone: var(--green); }
.channel-mapping-metric.tone-violet { --mapping-tone: var(--violet); }
.channel-mapping-metric.tone-amber { --mapping-tone: var(--amber); }

.channel-mapping-metric span,
.channel-mapping-metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.channel-mapping-metric strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.channel-mapping-board {
  display: grid;
  gap: 14px;
}

.channel-mapping-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.channel-mapping-toolbar h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 18px;
}

.channel-mapping-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.channel-mapping-filters label {
  display: grid;
  gap: 4px;
}

.channel-mapping-filters label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.channel-mapping-filters select {
  min-width: 138px;
  min-height: 38px;
  padding: 0 30px 0 10px;
  border-radius: 10px;
  background-color: var(--surface-2);
  font-size: 12px;
}

.channel-mapping-list {
  display: grid;
  gap: 12px;
}

.channel-mapping-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-xs);
}

.channel-mapping-card.is-inactive {
  opacity: 0.72;
}

.channel-mapping-card > header,
.channel-mapping-card > footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
}

.channel-mapping-card > header {
  border-bottom: 1px solid var(--line);
  background: rgba(249, 250, 252, 0.82);
}

.channel-mapping-source-title,
.channel-mapping-card .row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.channel-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 840;
}

.channel-mapping-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.channel-mapping-health::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber);
}

.channel-mapping-health.ok::before { background: var(--green); }
.channel-mapping-health.paused::before { background: var(--muted); }

.channel-mapping-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 15px;
}

.channel-mapping-endpoint {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 92px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.channel-mapping-endpoint.target {
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(0, 113, 227, 0.055);
}

.channel-mapping-endpoint.target.ignored {
  border-color: rgba(230, 126, 34, 0.18);
  background: rgba(230, 126, 34, 0.055);
}

.channel-mapping-endpoint small,
.channel-mapping-endpoint span {
  color: var(--muted);
  font-size: 11px;
}

.channel-mapping-endpoint strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.channel-mapping-endpoint .channel-mapping-target-flavor {
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.channel-mapping-endpoint .channel-mapping-target-spec {
  line-height: 1.45;
}

.channel-mapping-arrow {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 22px;
  font-weight: 850;
}

.channel-option-list {
  display: grid;
  gap: 6px;
  margin: 0 15px 15px;
  padding: 10px;
  border: 1px solid rgba(139, 92, 246, 0.14);
  border-radius: 13px;
  background: rgba(139, 92, 246, 0.045);
}

.channel-option-list > div {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 26px minmax(150px, 1fr) minmax(100px, 0.6fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.channel-option-list i {
  color: var(--violet);
  font-style: normal;
  text-align: center;
}

.channel-option-list strong { color: var(--text); }
.channel-option-list small { color: var(--muted); }

.channel-mapping-card > footer {
  border-top: 1px solid var(--line);
}

.channel-mapping-card > footer > span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.mapping-form-intro {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(0, 113, 227, 0.15);
  border-radius: 13px;
  background: var(--blue-soft);
}

.mapping-form-intro strong { color: var(--blue); }
.mapping-form-intro span { color: var(--muted-strong); font-size: 12px; line-height: 1.55; }

.mapping-channel-field small,
.mapping-form-section label small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.channel-rule-choice .choice-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mapping-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(248, 249, 251, 0.72);
}

.mapping-form-section > header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mapping-form-section > header > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.mapping-form-section > header > div {
  display: grid;
  gap: 2px;
}

.mapping-form-section > header strong { color: var(--text); }
.mapping-form-section > header small { color: var(--muted); font-size: 11px; }

.mapping-form-section > label {
  display: grid;
  gap: 6px;
}

.mapping-ignore-panel {
  border-color: rgba(230, 126, 34, 0.18);
  background: rgba(230, 126, 34, 0.055);
}

.mapping-combo-list {
  display: grid;
  gap: 9px;
}

.mapping-combo-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 0.9fr) 24px minmax(0, 1.1fr) 34px;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.mapping-combo-row label {
  display: grid;
  gap: 5px;
}

.mapping-combo-row label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.mapping-combo-index {
  align-self: center;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  font-weight: 900;
}

.mapping-combo-arrow {
  align-self: center;
  color: var(--violet);
  text-align: center;
}

.mapping-combo-row .icon-button {
  width: 32px;
  height: 32px;
  align-self: center;
}

.mapping-add-option {
  justify-self: start;
}

.mapping-advanced {
  padding: 11px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
}

.mapping-advanced summary {
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.mapping-advanced p {
  margin: 9px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.mapping-advanced > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mapping-advanced label {
  display: grid;
  gap: 5px;
}

.mapping-preview-result {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(217, 45, 32, 0.17);
  border-radius: 13px;
  background: rgba(217, 45, 32, 0.055);
  color: var(--muted-strong);
}

.mapping-preview-result.success {
  border-color: rgba(30, 159, 100, 0.18);
  background: rgba(30, 159, 100, 0.06);
}

.mapping-preview-result.ignored {
  border-color: rgba(230, 126, 34, 0.18);
  background: rgba(230, 126, 34, 0.06);
}

.mapping-preview-result strong { color: var(--text); }
.mapping-preview-result > span,
.mapping-preview-result > small { font-size: 12px; line-height: 1.5; }

.mapping-preview-result dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 3px 0;
}

.mapping-preview-result dl > div {
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.mapping-preview-result dt { color: var(--muted); font-size: 10px; }
.mapping-preview-result dd { margin: 3px 0 0; color: var(--text); font-size: 12px; font-weight: 800; }

@media (max-width: 1000px) {
  .cake-mapping-rollout { grid-template-columns: 1fr; align-items: stretch; }
  .cake-mapping-rollout-actions { justify-content: flex-start; }
  .channel-mapping-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-mapping-toolbar { align-items: stretch; flex-direction: column; }
  .channel-mapping-filters { justify-content: flex-start; }
  .channel-option-list > div { grid-template-columns: minmax(140px, 1fr) 24px minmax(140px, 1fr); }
  .channel-option-list small { grid-column: 3; }
  .mapping-combo-row { grid-template-columns: 32px minmax(0, 1fr) 32px; }
  .mapping-combo-row > label:first-of-type { grid-column: 2 / span 2; }
  .mapping-combo-row .mapping-combo-arrow { display: none; }
  .mapping-combo-row > label:last-of-type { grid-column: 2 / span 2; }
  .mapping-combo-row .icon-button { grid-column: 1; grid-row: 2; }
}

@media (max-width: 760px) {
  .channel-mapping-hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .channel-mapping-hero-actions > button {
    flex: 1 1 140px;
  }
  .cake-mapping-rollout { padding: 16px; }
  .cake-mapping-shadow-proof dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cake-mapping-rollout-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cake-mapping-rollout-actions .primary-button { grid-column: 1 / -1; }
  .product-mapping-handoff { align-items: stretch; flex-direction: column; }
  .product-mapping-handoff .small-button { width: 100%; }
  .channel-mapping-hero { align-items: stretch; flex-direction: column; padding: 18px; }
  .channel-mapping-hero > .primary-button { width: 100%; }
  .channel-mapping-guide { grid-template-columns: 1fr; }
  .channel-mapping-guide > i { display: none; }
  .channel-mapping-metrics { grid-template-columns: 1fr 1fr; }
  .channel-mapping-filters { display: grid; grid-template-columns: 1fr; }
  .channel-mapping-filters select { width: 100%; }
  .channel-mapping-card > header,
  .channel-mapping-card > footer { align-items: flex-start; flex-direction: column; }
  .channel-mapping-route { grid-template-columns: 1fr; }
  .channel-mapping-arrow { min-height: 22px; transform: rotate(90deg); }
  .channel-option-list > div { grid-template-columns: 1fr; gap: 4px; }
  .channel-option-list i { text-align: left; transform: rotate(90deg); }
  .channel-option-list small { grid-column: auto; }
  .channel-rule-choice .choice-card-grid { grid-template-columns: 1fr; }
  .mapping-advanced > div { grid-template-columns: 1fr; }
  .mapping-preview-result dl { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .channel-mapping-metrics { grid-template-columns: 1fr; }
  .mapping-combo-row { grid-template-columns: 30px minmax(0, 1fr); }
  .mapping-combo-row > label:first-of-type,
  .mapping-combo-row > label:last-of-type { grid-column: 1 / -1; }
  .mapping-combo-row .icon-button { grid-column: 1; grid-row: auto; }
}

@media (max-width: 1180px) {
  .metric-grid,
  .app-grid,
  .production-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memo-section-grid,
  .platform-board-head,
  .product-board-head,
  .product-board-controls,
  .memo-board-controls,
  .memo-section-filterbar,
  .production-grid {
    grid-template-columns: 1fr;
  }

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

  .product-board-head > div:first-child,
  .platform-board-head > div:first-child,
  .product-board-head > .primary-button,
  .platform-board-head > .primary-button,
  .product-board-head > .product-board-controls,
  .platform-board-head > .memo-board-controls {
    grid-column: 1;
    grid-row: auto;
  }

  .product-board-head > .primary-button,
  .platform-board-head > .primary-button {
    justify-self: start;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .workspace {
    padding: 16px;
  }

  .topbar,
  .toolbar,
  .panel-head,
  .production-hero,
  .production-hero-actions,
  .product-board-head,
  .platform-board-head,
  .memo-section-head,
  .memo-item {
    align-items: stretch;
    flex-direction: column;
  }

  .memo-item {
    display: grid;
    grid-template-columns: 1fr;
  }

  .memo-fold-group-head,
  .platform-account-group-head {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .memo-fold-group-meta,
  .platform-account-group-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .metric-grid,
  .app-grid,
  .production-metrics,
  .form-grid,
  .check-grid,
  .memo-section-grid,
  .memo-detail-grid,
  .certificate-field-grid,
  .certificate-file-grid {
    grid-template-columns: 1fr;
  }

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

  .permission-level-one-head,
  .permission-level-two > header {
    align-items: stretch;
    flex-direction: column;
  }

  .permission-node-actions {
    width: 100%;
  }

  .permission-scope-toggle {
    flex: 1;
    justify-content: center;
  }

  .permission-level-three > div {
    padding-left: 48px;
  }

  .order-contract-head {
    display: grid;
  }

  .order-contract-trust {
    justify-content: flex-start;
    min-width: 0;
  }

  .order-contract-flow {
    grid-template-columns: 1fr;
  }

  .order-contract-flow i {
    display: none;
  }

  .order-mapping-grid,
  .order-mapping-grid-head {
    grid-template-columns: 1fr;
  }

  .order-mapping-grid-head {
    display: none;
  }

  .order-mapping-footer > div {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions,
  .memo-item-actions,
  .memo-section-actions {
    justify-content: flex-start;
  }

  .memo-expanded-actions {
    grid-template-columns: 1fr;
  }

  .production-update-line {
    display: grid;
  }

  .metric-order-row {
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr) auto;
  }
}

@media (max-width: 520px) {
  .nav-list {
    grid-template-columns: 1fr;
  }

  .drawer form {
    padding: 18px;
  }

  .primary-button,
  .ghost-button,
  .small-button {
    width: 100%;
    justify-content: center;
  }

  .drawer-actions,
  .row-actions,
  .memo-item-actions,
  .production-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .segmented-control {
    grid-auto-flow: row;
  }

  .store-bar,
  .ranking-row,
  .metric-order-row {
    grid-template-columns: 1fr;
  }

  .metric-order-meta {
    justify-content: flex-start;
  }

  .store-bar .bar-track,
  .ranking-row > span {
    grid-column: 1 / -1;
  }

  .memo-document-action {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ================= luludola admin · cake-style full UI refresh ================= */
:root {
  --bg: #f5f5f7;
  --bg-elevated: rgba(255, 255, 255, 0.86);
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f1f2f6;
  --line: rgba(60, 60, 67, 0.14);
  --line-strong: rgba(60, 60, 67, 0.2);
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #86868b;
  --blue: #0071e3;
  --blue-2: #2997ff;
  --blue-soft: rgba(0, 113, 227, 0.1);
  --green: #1e9f64;
  --green-soft: rgba(30, 159, 100, 0.12);
  --amber: #b85c00;
  --amber-soft: rgba(184, 92, 0, 0.12);
  --red: #d70015;
  --red-soft: rgba(215, 0, 21, 0.1);
  --violet: #5e5ce6;
  --violet-soft: rgba(94, 92, 230, 0.12);
  --shadow-xs: 0 1px 2px rgba(20, 31, 50, 0.04);
  --shadow-sm: 0 8px 24px rgba(20, 31, 50, 0.08);
  --shadow-md: 0 18px 48px rgba(20, 31, 50, 0.12);
  --shadow-lg: 0 32px 96px rgba(20, 31, 50, 0.18);
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 28px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html,
body {
  min-width: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(41, 151, 255, 0.13), transparent 32%),
    radial-gradient(circle at 0 15%, rgba(255, 201, 92, 0.12), transparent 27%),
    var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 15px;
  background: rgba(248, 248, 250, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 113, 227, 0.52);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.11), inset 0 1px 0 #fff;
}

.login-panel,
.metric-card,
.panel,
.app-card,
.product-board-head,
.platform-board-head,
.memo-section-card,
.production-hero,
.production-card,
.production-metric {
  border: 1px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.82));
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.login-panel {
  border-radius: 30px;
  padding: 34px;
}

.login-panel .mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

.login-panel h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.app-shell {
  min-height: 100vh;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  z-index: 30;
  padding: 20px 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.82) inset;
}

.brand {
  min-height: 54px;
  padding: 4px 8px 14px;
}

.brand .mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.nav-list {
  gap: 7px;
}

.nav-list button {
  min-height: 48px;
  border-radius: 15px;
  padding: 0 12px;
  font-size: 14px;
}

.nav-list button span {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.sidebar-footer {
  border-top-color: var(--line);
}

.workspace {
  min-width: 0;
  padding: 22px clamp(18px, 2.4vw, 34px) 46px;
}

.topbar {
  min-height: 82px;
  margin: -22px calc(clamp(18px, 2.4vw, 34px) * -1) 18px;
  padding: 0 clamp(18px, 2.4vw, 34px);
  background: rgba(245, 245, 247, 0.82);
}

.topbar h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.025em;
}

.toolbar {
  gap: 10px;
}

.search-box {
  min-height: 48px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-xs);
}

.search-box input {
  min-height: 46px;
  font-size: 14px;
}

.primary-button,
.ghost-button,
.icon-button,
.small-button,
.role-tab {
  min-height: 44px;
  border-radius: 15px;
}

.primary-button {
  background: linear-gradient(180deg, #1684ef, #006bd8);
  box-shadow: 0 12px 25px rgba(0, 113, 227, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-button:active,
.ghost-button:active,
.small-button:active,
.icon-button:active {
  transform: scale(0.985);
}

.view-root {
  gap: 18px;
}

.metric-grid {
  gap: 14px;
}

.metric-card,
.app-card {
  border-radius: 24px;
  padding: 20px;
}

.metric-card strong {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.panel {
  overflow: hidden;
  border-radius: 24px;
  padding: 18px;
}

.panel-head,
.product-board-head,
.platform-board-head {
  gap: 16px;
}

.panel-head h3,
.product-board-head h3,
.platform-board-head h3,
.production-hero h3 {
  letter-spacing: -0.015em;
}

.product-board-head,
.platform-board-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 18px;
  border-radius: 24px;
}

.product-board-head > .product-board-controls,
.platform-board-head > .memo-board-controls {
  grid-column: 1 / -1;
}

.product-board-controls {
  grid-template-columns:
    minmax(260px, 1.65fr)
    minmax(118px, 0.66fr)
    minmax(118px, 0.66fr)
    minmax(118px, 0.66fr)
    minmax(94px, 0.48fr)
    minmax(94px, 0.48fr)
    minmax(78px, auto);
}

.memo-board-controls {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
}

.product-filter-field input,
.product-filter-field select,
.memo-filter-field input,
.memo-filter-field select {
  min-height: 48px;
  border-radius: 15px;
  background: rgba(248, 248, 250, 0.86);
}

.table-wrap {
  overflow: auto;
  border-radius: 22px;
  border-color: rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

table {
  min-width: 780px;
  background: transparent;
}

th {
  height: 48px;
  background: rgba(251, 251, 253, 0.9);
  color: var(--text-3);
  font-size: 12px;
}

td {
  background: rgba(255, 255, 255, 0.54);
  color: var(--text-2);
}

.product-data-table {
  min-width: 0;
  table-layout: fixed;
}

.product-col-category { width: 7.5%; }
.product-col-name { width: 18%; }
.product-col-flavor { width: 13.5%; }
.product-col-size { width: 11%; }
.product-col-spec { width: 5.2%; }
.product-col-price { width: 8.6%; }
.product-col-sync { width: 7.2%; }
.product-col-cake { width: 9.4%; }
.product-col-status { width: 7%; }
.product-col-actions { width: 7.6%; }

.product-data-table th,
.product-data-table td {
  padding: 12px 8px;
  font-size: 13px;
}

.product-data-table th {
  line-height: 1.25;
  white-space: normal !important;
  word-break: keep-all;
}

.product-data-table th:nth-child(n + 7),
.product-data-table td:nth-child(n + 7) {
  text-align: center;
}

.product-data-table th:nth-child(9) {
  font-size: 11px;
  letter-spacing: 0;
}

.product-data-table .product-price-range,
.product-data-table td:nth-child(7) strong {
  display: inline-block;
  max-width: 100%;
  font-size: 12.5px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-data-table .tag {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.product-group-row td {
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(242, 248, 255, 0.86));
}

.product-group-toggle {
  grid-template-columns: 38px minmax(0, 1fr);
}

.product-group-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.product-group-title strong {
  font-size: 15px;
}

.product-summary-stack {
  color: var(--text-2);
}

.product-child-row td:first-child {
  box-shadow: inset 4px 0 0 rgba(0, 113, 227, 0.14);
}

.row-actions {
  gap: 7px;
}

.row-actions .small-button {
  min-height: 38px;
}

.memo-section-grid {
  gap: 16px;
}

.memo-section-card {
  border-radius: 24px;
}

.memo-section-head {
  min-height: 82px;
  padding: 16px 18px;
}

.memo-section-head h3 {
  font-size: 19px;
}

.memo-section-actions {
  gap: 8px;
}

.memo-section-filterbar {
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) minmax(140px, 180px);
  padding: 12px 16px;
  background: rgba(251, 251, 253, 0.74);
}

.memo-fold-groups,
.platform-account-groups {
  gap: 12px;
  padding: 14px;
  background: rgba(251, 251, 253, 0.66);
}

.memo-fold-group,
.platform-account-group {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.memo-fold-group-head,
.platform-account-group-head {
  min-height: 76px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 251, 253, 0.82));
}

.memo-fold-icon,
.platform-account-fold-icon {
  border-radius: 14px;
}

.memo-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
}

.memo-type-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.memo-title-copy h4 {
  font-size: 16px;
}

.memo-keyline {
  gap: 7px;
}

.memo-fact {
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.memo-expanded-panel {
  gap: 14px;
  padding: 14px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 252, 0.9)),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), var(--shadow-sm);
}

.memo-expanded-head {
  padding: 2px;
}

.memo-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.memo-detail {
  min-height: 76px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.memo-expanded-actions {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.drawer {
  width: min(720px, 100vw);
  background: rgba(255, 255, 255, 0.96);
}

.drawer form {
  gap: 18px;
}

.drawer-head h3 {
  font-size: 25px;
}

.form-grid {
  gap: 14px;
}

.product-category-field,
.choice-field,
.certificate-schema,
.password-account-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.choice-card,
.category-radio,
.check-card,
.perm-check,
.permission-edit-row > div {
  border-radius: 15px;
}

.production-board {
  gap: 18px;
}

.production-hero {
  border-radius: 28px;
}

.production-metric,
.production-card {
  border-radius: 24px;
}

@keyframes adminSheetIn {
  from {
    opacity: 0.75;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .product-board-controls,
  .memo-board-controls,
  .memo-section-filterbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-filter-search,
  .memo-filter-field-wide {
    grid-column: 1 / -1;
  }

  .product-board-controls .small-button {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .login-screen {
    padding: 16px;
    align-items: end;
  }

  .login-panel {
    width: 100%;
    padding: 26px 22px 22px;
    border-radius: 28px;
  }

  .login-panel h1 {
    font-size: 34px;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    height: auto;
    display: block;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(60, 60, 67, 0.13);
    border-right: 0;
    background: rgba(245, 245, 247, 0.9);
    box-shadow: 0 -18px 48px rgba(20, 31, 50, 0.12);
  }

  .brand {
    display: none;
  }

  .sidebar-footer {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: 10px;
    z-index: 75;
    display: flex;
    width: auto;
    max-width: calc(100vw - 120px);
    min-height: 38px;
    gap: 8px;
    padding: 5px 6px 5px 10px;
    border: 1px solid rgba(60, 60, 67, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 24px rgba(20, 31, 50, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .sidebar-footer span {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-footer button {
    min-height: 28px;
    padding: 4px 10px;
  }

  .nav-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 0 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-list button {
    flex: 0 0 74px;
    scroll-snap-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
  }

  .nav-list button::before {
    display: none;
  }

  .nav-list button span {
    width: 28px;
    height: 28px;
    margin: 0 auto;
    border-radius: 11px;
    font-size: 12px;
  }

  .workspace {
    padding: 12px 10px calc(92px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
    margin: -12px -10px 12px;
    padding: 54px 10px 12px;
  }

  .topbar h2 {
    font-size: 30px;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .search-box {
    width: 100%;
  }

  .toolbar > .primary-button[hidden] {
    display: none;
  }

  .toolbar > .primary-button:not([hidden]) {
    width: 100%;
  }

  .status-bar:not(:empty) {
    width: 100%;
    justify-content: center;
  }

  .metric-grid,
  .app-grid,
  .split-grid,
  .production-metrics,
  .production-grid,
  .form-grid,
  .check-grid,
  .certificate-field-grid,
  .certificate-file-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .app-card,
  .panel,
  .product-board-head,
  .platform-board-head,
  .production-hero,
  .production-card,
  .production-metric {
    border-radius: 24px;
  }

  .panel {
    padding: 14px;
  }

  .panel-head,
  .product-board-head,
  .platform-board-head,
  .production-hero,
  .production-hero-actions,
  .memo-section-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .product-board-head,
  .platform-board-head {
    padding: 16px;
  }

  .product-board-head > .primary-button,
  .platform-board-head > .primary-button {
    width: 100%;
    justify-self: stretch;
    order: 2;
  }

  .product-board-head > .product-board-controls,
  .platform-board-head > .memo-board-controls {
    order: 3;
  }

  .product-board-controls,
  .memo-board-controls,
  .memo-section-filterbar {
    grid-template-columns: 1fr;
  }

  .product-filter-search,
  .memo-filter-field-wide {
    grid-column: auto;
  }

  .product-board-controls .small-button {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  table:not(.product-data-table),
  table:not(.product-data-table) tbody,
  table:not(.product-data-table) tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  table:not(.product-data-table) {
    border-collapse: separate;
    background: transparent;
  }

  table:not(.product-data-table) thead {
    display: none;
  }

  table:not(.product-data-table) tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-xs);
  }

  table:not(.product-data-table) td {
    min-height: 34px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    text-align: right;
  }

  table:not(.product-data-table) td + td {
    border-top: 1px solid rgba(60, 60, 67, 0.08);
  }

  table:not(.product-data-table) td::before {
    content: attr(data-label);
    flex: 0 0 86px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 820;
    text-align: left;
  }

  table:not(.product-data-table) td[data-label="账号"],
  table:not(.product-data-table) td[data-label="商品"],
  table:not(.product-data-table) td[data-label="物料"] {
    display: block;
    text-align: left;
  }

  table:not(.product-data-table) td[data-label="账号"]::before,
  table:not(.product-data-table) td[data-label="商品"]::before,
  table:not(.product-data-table) td[data-label="物料"]::before {
    display: block;
    margin-bottom: 4px;
  }

  .product-data-table,
  .product-data-table tbody {
    display: grid;
    min-width: 0;
    width: 100%;
    gap: 12px;
    background: transparent;
  }

  .product-data-table colgroup,
  .product-data-table thead {
    display: none;
  }

  .product-data-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-xs);
  }

  .product-data-table td {
    display: grid;
    grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border: 0;
    background: transparent !important;
    text-align: right;
  }

  .product-data-table td + td {
    border-top: 1px solid rgba(60, 60, 67, 0.08);
  }

  .product-data-table td::before {
    content: attr(data-label);
    color: var(--text-3);
    font-size: 12px;
    font-weight: 820;
    text-align: left;
  }

  .product-data-table td[data-label="商品名称"] {
    grid-template-columns: 1fr;
    order: -1;
    padding-bottom: 10px;
    text-align: left;
    border-top: 0;
  }

  .product-data-table td[data-label="商品名称"]::before {
    display: none;
  }

  .product-data-table td[data-label="展开状态"] {
    display: none;
  }

  .product-data-table .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .product-data-table .row-actions .small-button {
    width: 100%;
  }

  .product-group-row {
    border-color: rgba(0, 113, 227, 0.18) !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 255, 0.88)) !important;
  }

  .product-group-toggle {
    min-height: 52px;
  }

  .memo-section-head {
    padding: 16px;
  }

  .memo-section-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .memo-section-actions .tag {
    justify-content: center;
  }

  .memo-section-actions .small-button {
    width: 100%;
  }

  .memo-fold-groups,
  .platform-account-groups {
    padding: 10px;
  }

  .memo-fold-group-head,
  .platform-account-group-head {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 78px;
    padding: 12px;
  }

  .memo-fold-group-meta,
  .platform-account-group-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .memo-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
  }

  .memo-type-mark {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .memo-title-row {
    display: grid;
    padding-right: 48px;
  }

  .memo-badges {
    justify-content: flex-start;
  }

  .memo-keyline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .memo-fact {
    justify-content: space-between;
    width: 100%;
    border-radius: 14px;
  }

  .memo-fact strong {
    max-width: 62%;
    text-align: right;
  }

  .memo-detail-grid {
    grid-template-columns: 1fr;
  }

  .memo-expanded-actions {
    grid-template-columns: 1fr;
  }

  .memo-expanded-actions > div,
  .memo-item-actions,
  .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .memo-item-actions .small-button,
  .row-actions .small-button {
    width: 100%;
  }

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

  .production-hero h3 {
    font-size: 28px;
  }

  .production-hero-actions,
  .segmented-control {
    width: 100%;
  }

  .segmented-control {
    grid-auto-flow: column;
  }

  .metric-order-row,
  .store-bar,
  .ranking-row,
  .urgent-item {
    grid-template-columns: 1fr;
  }

  .metric-order-meta {
    justify-content: flex-start;
  }

  .drawer {
    inset: auto 0 0 0;
    width: 100vw;
    height: min(92vh, 920px);
    border-top: 1px solid rgba(60, 60, 67, 0.14);
    border-left: 0;
    border-radius: 28px 28px 0 0;
    animation: adminSheetIn 220ms var(--ease) both;
  }

  .drawer form {
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .drawer-actions {
    margin: 8px -16px calc(-20px - env(safe-area-inset-bottom));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .drawer-actions .ghost-button,
  .drawer-actions .primary-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topbar h2,
  .login-panel h1 {
    font-size: 30px;
  }

  .nav-list button {
    flex-basis: 68px;
    font-size: 10.5px;
  }

  .memo-section-actions,
  .memo-item-actions,
  .row-actions,
  .memo-expanded-actions > div,
  .product-data-table .row-actions {
    grid-template-columns: 1fr;
  }

  .product-data-table td,
  table:not(.product-data-table) td {
    grid-template-columns: 1fr;
    display: grid;
    text-align: left;
  }

  .product-data-table td::before,
  table:not(.product-data-table) td::before {
    margin-bottom: 2px;
  }
}

.product-board-head > .product-board-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
}

.product-board-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.product-board-actions .primary-button,
.product-board-actions .small-button {
  min-width: 112px;
}

.small-button.is-active {
  color: var(--blue);
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(0, 113, 227, 0.08);
}

.product-batch-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(0, 113, 227, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: var(--shadow-xs);
}

.product-batch-toolbar strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.product-batch-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.product-batch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.product-name-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-name-cell .account-name,
.product-name-cell .product-group-toggle {
  min-width: 0;
  flex: 1;
}

.product-select-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
}

.product-select-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.product-select-box span {
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(99, 99, 102, 0.32);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.product-select-box:hover span,
.product-select-box input:focus-visible + span {
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.product-select-box input:checked + span {
  border-color: rgba(0, 113, 227, 0.88);
  background: var(--blue);
}

.product-select-box input:checked + span::after {
  content: "";
  display: block;
  width: 9px;
  height: 5px;
  margin: 6px auto 0;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.product-select-box.is-partial span {
  border-color: rgba(0, 113, 227, 0.66);
  background: rgba(0, 113, 227, 0.12);
}

.product-select-box.is-partial span::after {
  content: "";
  display: block;
  width: 10px;
  height: 2px;
  margin: 9px auto 0;
  border-radius: 999px;
  background: var(--blue);
}

.batch-edit-summary {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.06);
}

.batch-edit-summary strong {
  font-size: 15px;
}

.batch-edit-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.governance-panel {
  margin-top: 18px;
}

.governance-grid,
.sync-health-grid,
.permission-simulation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.governance-card {
  display: grid;
  gap: 7px;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: 160ms var(--ease);
}

.governance-card:hover {
  border-color: rgba(0, 113, 227, 0.28);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.governance-card strong { font-size: 16px; }
.governance-card span { color: var(--muted); }
.governance-card em { margin-top: auto; color: var(--blue); font-style: normal; font-weight: 750; }

.log-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.log-filter-grid label,
.simulator-account {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.log-table-list,
.integrity-list,
.version-list {
  display: grid;
  gap: 9px;
}

.audit-log-card,
.integrity-item,
.version-list article,
.permission-simulation-grid article,
.governance-callout {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.audit-log-summary {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(260px, 2fr) 130px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.audit-log-summary > span:first-child { display: grid; gap: 2px; }
.audit-log-summary em,
.audit-log-summary time { color: var(--muted); font-size: 12px; font-style: normal; }
.audit-log-detail { display: grid; gap: 14px; padding: 0 16px 16px; border-top: 1px solid var(--line); }
.audit-log-detail dl { display: flex; gap: 24px; margin: 14px 0 0; }
.audit-log-detail dl div { display: grid; gap: 2px; }
.audit-log-detail dt { color: var(--muted); font-size: 12px; }
.audit-log-detail dd { margin: 0; font-weight: 700; }
.audit-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.audit-diff section { min-width: 0; }
.audit-diff pre { max-height: 280px; overflow: auto; margin: 7px 0 0; padding: 12px; border-radius: 12px; background: #1d1d1f; color: #f5f5f7; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; color: var(--muted); }

.integrity-summary,
.governance-callout {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 14px 16px;
}

.integrity-summary span,
.governance-callout span { color: var(--muted); }

.audit-log-truncation {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(180, 116, 24, 0.32);
  border-radius: 12px;
  background: rgba(255, 246, 222, 0.84);
  color: #7a4b0a;
}

.audit-log-truncation span {
  color: #7a5b2d;
  font-size: 13px;
  line-height: 1.55;
}
.integrity-item { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.integrity-item i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); }
.integrity-item.tone-red i { background: var(--red); }
.integrity-item div { display: grid; gap: 2px; }
.integrity-item span { color: var(--muted); font-size: 12px; }
.version-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.version-list article div { display: grid; gap: 2px; }
.version-list span,
.version-list time { color: var(--muted); }
.simulator-account { max-width: 480px; margin-bottom: 16px; }
.permission-simulation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.permission-simulation-grid article { display: grid; gap: 10px; padding: 16px; }
.permission-simulation-grid p { margin: 0; color: var(--muted); }
.scope-store-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.scope-stores-field { display: grid; gap: 8px; color: var(--muted-strong); font-size: 14px; font-weight: 700; }
.scope-store-option { position: relative; }
.scope-store-option input { position: absolute; opacity: 0; pointer-events: none; }
.scope-store-option span { display: grid; min-height: 40px; place-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.scope-store-option input:checked + span { border-color: rgba(0, 113, 227, .4); background: var(--blue-soft); color: var(--blue); }
.scope-store-choices.is-disabled { opacity: .5; }
.error-state button { margin-top: 8px; }

@media (max-width: 760px) {
  .governance-grid,
  .sync-health-grid,
  .permission-simulation-grid,
  .log-filter-grid,
  .audit-diff {
    grid-template-columns: 1fr;
  }

  .audit-log-summary {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

  .product-board-head > .product-board-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    order: 2;
    justify-self: stretch;
    width: 100%;
  }

  .product-board-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .product-board-actions .primary-button,
  .product-board-actions .small-button {
    width: 100%;
  }

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

  .product-batch-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .product-batch-actions .small-button {
    width: 100%;
  }
}

/* 鹿鹿 AI：对话式平台备忘录 */
.assistant-workspace {
  width: min(1080px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(94, 92, 230, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(61, 55, 108, 0.09);
  overflow: hidden;
}

.assistant-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(94, 92, 230, 0.12);
  background:
    radial-gradient(360px 160px at 10% -20%, rgba(255, 196, 88, 0.24), transparent 72%),
    radial-gradient(420px 180px at 88% 20%, rgba(94, 92, 230, 0.16), transparent 72%),
    linear-gradient(135deg, #fffdf8 0%, #f7f7ff 54%, #f2f6ff 100%);
}

.assistant-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.assistant-avatar,
.assistant-message-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #44351e;
  font-weight: 850;
  background:
    linear-gradient(145deg, #fff8df, #ffffff 48%, #f3c66e),
    #fff;
  border: 1px solid rgba(164, 109, 30, 0.16);
  box-shadow: 0 8px 22px rgba(155, 104, 30, 0.13);
}

.assistant-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 18px;
}

.assistant-identity h3,
.assistant-identity p {
  margin: 0;
}

.assistant-identity h3 {
  margin-top: 2px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.assistant-identity p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.assistant-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.assistant-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(30, 159, 100, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #31705a;
  font-size: 11px;
  font-weight: 720;
}

.assistant-trust i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 159, 100, 0.1);
}

.assistant-reset {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.78);
}

.assistant-conversation {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto auto auto;
  min-height: min(680px, calc(100vh - 210px));
  max-height: calc(100vh - 130px);
}

.assistant-messages {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 26px clamp(18px, 5vw, 62px) 20px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.assistant-message {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  max-width: 82%;
}

.assistant-message.is-user {
  flex-direction: row-reverse;
  justify-self: end;
}

.assistant-message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 12px;
}

.assistant-message.is-user .assistant-message-avatar {
  border-color: rgba(0, 113, 227, 0.16);
  background: linear-gradient(145deg, #dcecff, #f8fbff);
  color: #0a5cae;
  box-shadow: 0 7px 18px rgba(0, 113, 227, 0.1);
}

.assistant-message-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.assistant-message.is-user .assistant-message-main {
  justify-items: end;
}

.assistant-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.assistant-message-meta strong {
  color: var(--muted-strong);
  font-size: 12px;
}

.assistant-message-meta time,
.assistant-message-meta span {
  font-variant-numeric: tabular-nums;
}

.assistant-bubble {
  min-width: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 6px 17px 17px 17px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.045);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.assistant-message.is-user .assistant-bubble {
  border-color: rgba(0, 113, 227, 0.16);
  border-radius: 17px 6px 17px 17px;
  background: linear-gradient(145deg, #0a7bed, #0068d2);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 113, 227, 0.16);
}

.assistant-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 4px clamp(18px, 5vw, 62px) 16px;
}

.assistant-suggestions button {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid rgba(94, 92, 230, 0.13);
  border-radius: 13px;
  background: #fafaff;
  color: var(--text);
  text-align: left;
  transition: 160ms var(--ease);
}

.assistant-suggestions button:hover {
  border-color: rgba(94, 92, 230, 0.28);
  background: #f6f5ff;
  transform: translateY(-1px);
}

.assistant-suggestions span {
  font-weight: 760;
}

.assistant-suggestions small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-composer {
  display: grid;
  gap: 8px;
  padding: 15px clamp(18px, 5vw, 62px) 17px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -12px 30px rgba(255, 255, 255, 0.78);
}

.assistant-composer > label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.assistant-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  padding: 7px;
  border: 1px solid rgba(94, 92, 230, 0.18);
  border-radius: 16px;
  background: var(--surface-2);
  transition: 160ms var(--ease);
}

.assistant-composer-row:focus-within {
  border-color: rgba(0, 113, 227, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.09);
}

.assistant-composer textarea {
  min-height: 52px;
  max-height: 150px;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
}

.assistant-composer textarea:hover,
.assistant-composer textarea:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-send {
  min-width: 78px;
  min-height: 44px;
  border-radius: 12px;
}

.assistant-composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
}

.assistant-error {
  margin: 0 clamp(18px, 5vw, 62px) 8px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 45, 32, 0.18);
  border-radius: 11px;
  background: var(--red-soft);
  color: #9d291f;
  font-size: 12px;
}

.assistant-thinking .assistant-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
}

.assistant-thinking .assistant-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a86c8;
  animation: assistantDot 1.1s ease-in-out infinite;
}

.assistant-thinking .assistant-bubble span:nth-child(2) { animation-delay: 120ms; }
.assistant-thinking .assistant-bubble span:nth-child(3) { animation-delay: 240ms; }

@keyframes assistantDot {
  0%, 70%, 100% { opacity: 0.38; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

.assistant-action-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #33715a;
  font-size: 11px;
  font-weight: 700;
}

.assistant-action-note i {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 9px;
  font-style: normal;
}

.assistant-action-note button {
  min-height: 30px;
  margin-left: 4px;
  padding: 4px 9px;
  border: 1px solid rgba(30, 159, 100, 0.2);
  border-radius: 9px;
  background: #fff;
  color: #236c50;
  font-size: 11px;
  font-weight: 760;
}

.assistant-action-note button:hover {
  border-color: rgba(30, 159, 100, 0.38);
  background: var(--green-soft);
}

.assistant-match-list {
  width: min(620px, 100%);
  display: grid;
  gap: 7px;
}

.assistant-match-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  transition: 150ms var(--ease);
}

.assistant-match-list button:hover {
  border-color: rgba(0, 113, 227, 0.28);
  background: #f9fbff;
}

.assistant-match-list button > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.assistant-match-list small,
.assistant-match-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.assistant-match-list em {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.assistant-structured-card {
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid rgba(94, 92, 230, 0.16);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(45, 43, 100, 0.06);
}

.assistant-structured-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(94, 92, 230, 0.1);
  background: linear-gradient(135deg, rgba(247, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.assistant-structured-card > header > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.assistant-structured-card > header strong {
  font-size: 12px;
}

.assistant-structured-card > header small {
  color: var(--muted);
  font-size: 10px;
}

.assistant-structured-card > header > span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(94, 92, 230, 0.09);
  color: #5551a8;
  font-size: 10px;
  font-weight: 760;
}

.assistant-structured-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 5px 13px 9px;
}

.assistant-structured-card dl > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 6px 8px 0;
  border-bottom: 1px solid rgba(16, 24, 40, 0.055);
}

.assistant-structured-card dt {
  color: var(--muted);
  font-size: 10px;
}

.assistant-structured-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.assistant-structured-card > p {
  margin: 0;
  padding: 9px 13px 11px;
  border-top: 1px solid rgba(94, 92, 230, 0.08);
  background: rgba(247, 246, 255, 0.72);
  color: #5551a8;
  font-size: 11px;
  font-weight: 700;
}

.assistant-saved-card {
  border-color: rgba(30, 159, 100, 0.2);
}

.assistant-saved-card > header {
  border-color: rgba(30, 159, 100, 0.12);
  background: linear-gradient(135deg, rgba(242, 253, 248, 0.96), rgba(255, 255, 255, 0.98));
}

.assistant-saved-card > header > span {
  background: var(--green-soft);
  color: #277057;
}

.assistant-credential-list {
  width: min(620px, 100%);
  display: grid;
  gap: 9px;
}

.assistant-credential-card {
  overflow: hidden;
  border: 1px solid rgba(30, 159, 100, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(245, 255, 250, 0.94), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: 0 8px 22px rgba(23, 91, 67, 0.07);
}

.assistant-credential-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid rgba(30, 159, 100, 0.12);
}

.assistant-credential-head > div {
  min-width: 0;
  display: grid;
}

.assistant-credential-head small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-lock {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: #226c50;
  font-size: 10px;
  font-weight: 800;
}

.assistant-secure-badge {
  margin-left: auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #277057;
  font-size: 10px;
  font-weight: 750;
}

.assistant-credential-card dl {
  margin: 0;
  padding: 4px 13px 8px;
}

.assistant-credential-card dl > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.055);
}

.assistant-credential-card dl > div:last-child {
  border-bottom: 0;
}

.assistant-credential-card dt {
  color: var(--muted);
  font-size: 11px;
}

.assistant-credential-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.assistant-password-row dd:not(.is-revealed) {
  color: #587065;
  letter-spacing: 0.12em;
}

.assistant-credential-card button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(30, 159, 100, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #286b52;
  font-size: 10px;
  font-weight: 750;
}

.assistant-secret-actions {
  display: flex;
  gap: 5px;
}

.assistant-credential-card > p {
  margin: 0;
  padding: 0 13px 12px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .assistant-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
  }

  .assistant-trust {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .assistant-reset {
    grid-column: 2;
    grid-row: 1;
  }

  .assistant-message {
    max-width: 90%;
  }
}

@media (max-width: 760px) {
  .assistant-workspace {
    width: calc(100% + 20px);
    margin: -6px -10px 0;
    border-radius: 18px 18px 0 0;
  }

  .assistant-hero {
    padding: 15px;
  }

  .assistant-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .assistant-identity p {
    display: none;
  }

  .assistant-trust {
    gap: 5px;
  }

  .assistant-trust span {
    min-height: 26px;
    padding: 4px 7px;
    font-size: 10px;
  }

  .assistant-conversation {
    min-height: calc(100dvh - 244px);
    max-height: none;
  }

  .assistant-messages {
    min-height: 330px;
    max-height: 52dvh;
    gap: 16px;
    padding: 19px 13px 16px;
  }

  .assistant-message {
    max-width: 96%;
    gap: 8px;
  }

  .assistant-message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .assistant-bubble {
    padding: 10px 12px;
    font-size: 13px;
  }

  .assistant-suggestions {
    grid-template-columns: 1fr;
    padding: 2px 13px 13px;
  }

  .assistant-suggestions small {
    white-space: normal;
  }

  .assistant-composer {
    padding: 12px 13px max(13px, env(safe-area-inset-bottom));
  }

  .assistant-composer-row {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .assistant-send {
    min-width: 68px;
    padding: 0 10px;
  }

  .assistant-composer-meta {
    display: block;
  }

  .assistant-composer-meta span:last-child {
    display: none;
  }

  .assistant-error {
    margin-inline: 13px;
  }

  .assistant-credential-card dl > div {
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 7px;
  }

  .assistant-structured-card dl {
    grid-template-columns: 1fr;
  }

  .assistant-structured-card dl > div {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .assistant-match-list button {
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-thinking .assistant-bubble span {
    animation: none;
    opacity: 0.72;
  }

  .assistant-messages {
    scroll-behavior: auto;
  }
}
