:root {
  --paper: #f5f3ee;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #1f2b2d;
  --ink-soft: #475355;
  --muted: #778180;
  --line: #e4e2da;
  --line-strong: #d5d3ca;
  --sidebar: #263c3d;
  --sidebar-soft: #315253;
  --teal: #147d75;
  --teal-dark: #0f665f;
  --teal-pale: #e4f1ee;
  --orange: #b4671f;
  --orange-pale: #fbecdb;
  --plum: #6f5a96;
  --red: #b9505c;
  --shadow-soft: 0 10px 30px rgba(32, 48, 45, 0.06);
  --shadow-dialog: 0 26px 80px rgba(20, 37, 35, 0.22);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
}

body {
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(20, 125, 117, 0.22);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 258px;
  flex-direction: column;
  padding: 28px 18px 20px;
  color: #f1f7f4;
  background: var(--sidebar);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fefcf5;
  font-size: 17px;
  font-weight: 700;
  background: var(--orange);
  border-radius: 8px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

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

.brand-lockup strong {
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-lockup span {
  margin-top: 2px;
  color: #a9c1bd;
  font-size: 11px;
}

.sidebar-heading,
.section-label-row {
  color: #91aca8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-heading {
  padding: 0 10px 9px;
}

.primary-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 11px;
  color: #c0d1ce;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.nav-item span {
  flex: 1;
  font-weight: 650;
}

.nav-item b {
  min-width: 24px;
  color: #8fa8a5;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.is-active {
  color: #ffffff;
  background: var(--sidebar-soft);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item.is-active b {
  color: #d8e9e4;
}

.sidebar-section {
  margin-top: 30px;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 9px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.muted-icon {
  color: #91aaa7;
}

.muted-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.group-list {
  display: grid;
  gap: 2px;
}

.group-item {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 34px;
  padding: 0 4px 0 0;
  border-radius: 5px;
}

.group-item:hover,
.group-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.group-item.is-active {
  border-color: rgba(255, 255, 255, 0.06);
}

.group-select {
  display: flex;
  min-width: 0;
  flex: 1;
  height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 7px 0 11px;
  color: #bfd0cd;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
}

.group-item:hover .group-select,
.group-item.is-active .group-select {
  color: #fff;
}

.group-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--group-color, var(--teal));
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--group-color, var(--teal)) 17%, transparent);
}

.group-name {
  overflow: hidden;
  flex: 1;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-count {
  color: #86a19d;
  font-size: 11px;
}

.group-edit-button {
  display: none;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #a6bfbb;
  background: transparent;
  border: 0;
}

.group-item:hover .group-edit-button,
.group-item:focus-within .group-edit-button {
  display: inline-grid;
  place-items: center;
}

.group-edit-button svg {
  width: 13px;
  height: 13px;
}

.sidebar-spacer {
  flex: 1;
  min-height: 20px;
}

.shared-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 16px 4px 14px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.shared-note-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #f1c894;
  background: rgba(180, 103, 31, 0.23);
  border-radius: 5px;
}

.shared-note-icon svg {
  width: 15px;
  height: 15px;
}

.shared-note strong,
.shared-note span {
  display: block;
}

.shared-note strong {
  color: #edf7f3;
  font-size: 11px;
}

.shared-note span {
  margin-top: 2px;
  color: #98b0ac;
  font-size: 10px;
}

.sidebar-footer {
  padding: 0 10px;
  color: #78908e;
  font-size: 10px;
}

.main-area {
  width: calc(100% - 258px);
  min-height: 100vh;
  margin-left: 258px;
}

.topbar {
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  background: rgba(255, 253, 249, 0.86);
  border-bottom: 1px solid var(--line);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs svg {
  width: 14px;
  height: 14px;
  color: #a0aaa6;
}

.breadcrumbs strong {
  color: var(--ink);
  font-weight: 700;
}

.topbar-actions,
.heading-actions,
.toolbar-controls {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 12px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.connection-dot {
  width: 7px;
  height: 7px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(180, 103, 31, 0.12);
}

.connection-status.is-connected {
  color: var(--teal-dark);
}

.connection-status.is-connected .connection-dot {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 125, 117, 0.13);
}

.connection-status.is-offline {
  color: var(--red);
}

.connection-status.is-offline .connection-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(185, 80, 92, 0.13);
}

.topbar-divider {
  width: 1px;
  height: 21px;
  background: var(--line);
}

.text-button,
.secondary-button,
.primary-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 650;
  border-radius: 5px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.text-button {
  padding: 0 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.text-button:hover {
  color: var(--teal-dark);
}

.text-button svg,
.secondary-button svg,
.primary-button svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.secondary-button {
  color: var(--ink-soft);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-color: #a9d1cb;
}

.primary-button {
  color: #fff;
  background: var(--teal);
  border: 1px solid var(--teal);
  box-shadow: 0 5px 12px rgba(20, 125, 117, 0.16);
}

.primary-button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  transform: translateY(-1px);
}

.content-area {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 42px 44px 60px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--ink);
  font-size: 31px;
  font-weight: 740;
  letter-spacing: 0;
  line-height: 1.16;
}

.page-heading p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.heading-actions {
  gap: 9px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-soft);
}

.metric-cell {
  min-height: 95px;
  padding: 17px 20px 15px;
  border-right: 1px solid var(--line);
}

.metric-cell:last-child {
  border-right: 0;
}

.metric-label,
.metric-hint {
  display: block;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.metric-cell strong {
  display: inline-block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
}

.metric-hint {
  margin-top: 5px;
  color: #9a9f99;
  font-size: 10px;
}

.metric-cell-note strong {
  color: var(--teal);
  font-size: 15px;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
}

.search-field {
  display: flex;
  width: min(570px, 100%);
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 11px 0 14px;
  color: #8a9391;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: #8bbdb7;
  box-shadow: 0 0 0 3px rgba(20, 125, 117, 0.1);
}

.search-field > svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field input::placeholder {
  color: #a2aaa6;
}

.clear-search {
  display: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #9aa29f;
  background: transparent;
  border: 0;
}

.clear-search.is-visible {
  display: grid;
  place-items: center;
}

.clear-search:hover {
  color: var(--red);
}

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

.toolbar-controls {
  gap: 14px;
}

.result-summary {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sort-select {
  min-height: 36px;
  padding: 0 30px 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.active-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--teal-dark);
  font-size: 11px;
}

.bulk-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 7px 10px 7px 13px;
  background: var(--teal-pale);
  border: 1px solid #bedbd5;
  border-radius: 6px;
}

.bulk-select-all,
.bulk-actions {
  display: flex;
  align-items: center;
}

.bulk-select-all {
  gap: 8px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.bulk-select-all input,
.item-select input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--teal);
}

.bulk-selected {
  margin-right: auto;
  color: #5f7772;
  font-size: 11px;
  white-space: nowrap;
}

.bulk-actions {
  gap: 7px;
}

.bulk-actions .secondary-button {
  min-height: 31px;
  padding: 0 9px;
  font-size: 11px;
}

.bulk-actions select {
  height: 31px;
  max-width: 150px;
  padding: 0 25px 0 8px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  border: 1px solid #b7d1cc;
  border-radius: 4px;
}

.bulk-clear {
  width: 29px;
  height: 29px;
  color: #5b7771;
}

.bulk-clear:hover {
  color: var(--red);
  background: rgba(185, 80, 92, 0.1);
}

.filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.filter-clear:hover {
  color: var(--red);
}

.filter-clear svg {
  width: 13px;
  height: 13px;
}

.library-view {
  margin-top: 29px;
}

.view-caption {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.view-caption h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 730;
}

.view-caption span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.view-tip {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  margin-top: 0 !important;
  color: #9a7a54 !important;
  white-space: nowrap;
}

.view-tip svg {
  width: 14px;
  height: 14px;
}

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

.phrase-card {
  display: flex;
  min-height: 205px;
  flex-direction: column;
  padding: 18px 19px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 5px 16px rgba(32, 48, 45, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.phrase-card:hover {
  border-color: #b9d3cd;
  box-shadow: 0 11px 24px rgba(32, 48, 45, 0.09);
  transform: translateY(-2px);
}

.item-topline,
.item-footer,
.item-actions,
.product-actions,
.product-meta-line,
.price-line,
.tag-list,
.item-leading,
.product-title-row {
  display: flex;
  align-items: center;
}

.item-topline,
.item-footer {
  justify-content: space-between;
}

.item-leading,
.product-title-row {
  min-width: 0;
  gap: 8px;
}

.item-select {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 22px;
  cursor: pointer;
}

.item-select input {
  cursor: pointer;
}

.group-pill {
  display: inline-flex;
  max-width: 180px;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 4px 8px;
  color: var(--teal-dark);
  font-size: 10px;
  background: var(--teal-pale);
  border-radius: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-pill i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  background: var(--group-color, var(--teal));
  border-radius: 50%;
}

.item-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  font-size: 10px;
}

.item-state.is-disabled {
  color: #9a9e9b;
}

.state-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.phrase-card h3 {
  margin-top: 16px;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phrase-card.is-disabled h3,
.phrase-card.is-disabled .phrase-content {
  color: #939996;
}

.phrase-content {
  display: -webkit-box;
  min-height: 53px;
  margin-top: 9px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-list {
  min-height: 25px;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.tag {
  padding: 3px 6px;
  color: #727d7a;
  font-size: 10px;
  background: #f1f0eb;
  border-radius: 3px;
}

.item-footer {
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  color: #9a9f9b;
  font-size: 10px;
  border-top: 1px solid #efede7;
}

.item-actions {
  gap: 4px;
}

.small-action,
.copy-action {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 4px;
}

.small-action {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.small-action:hover {
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.small-action.danger-action:hover {
  color: var(--red);
  background: #f9e8e8;
}

.copy-action {
  color: #fff;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.copy-action:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.small-action svg,
.copy-action svg {
  width: 13px;
  height: 13px;
}

.move-action {
  width: 26px;
  padding: 0;
}

.move-action:disabled {
  color: #c4c9c5;
  cursor: not-allowed;
  opacity: 0.6;
}

.move-action:disabled:hover {
  color: #c4c9c5;
  background: transparent;
}

.product-table {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-soft);
}

.product-table-head,
.product-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.32fr) minmax(270px, 1.18fr) minmax(190px, 0.9fr) 210px;
  gap: 18px;
  align-items: center;
}

.product-table-head {
  min-height: 40px;
  padding: 0 18px;
  color: #8d9692;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #faf9f5;
  border-bottom: 1px solid var(--line);
}

.product-row {
  min-height: 118px;
  padding: 16px 18px;
  border-bottom: 1px solid #efede7;
}

.product-row:last-child {
  border-bottom: 0;
}

.product-row:hover {
  background: #fffefc;
}

.product-identity {
  min-width: 0;
}

.product-identity h3 {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta-line {
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.product-meta-line .group-pill {
  padding-top: 3px;
  padding-bottom: 3px;
}

.product-prices {
  min-width: 0;
}

.price-line {
  flex-wrap: wrap;
  gap: 9px;
}

.price-item {
  display: grid;
  gap: 2px;
}

.price-item span {
  color: #9a9f9b;
  font-size: 10px;
}

.price-item strong {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 720;
}

.price-item.current strong {
  color: var(--orange);
}

.price-item.best strong {
  color: var(--teal);
}

.price-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 6px;
  color: var(--teal-dark);
  font-size: 10px;
  background: var(--teal-pale);
  border-radius: 3px;
}

.price-status.is-normal {
  color: #9a6b39;
  background: var(--orange-pale);
}

.price-status.is-empty {
  color: #9a9f9b;
  background: #f1f0eb;
}

.product-note {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-link {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  overflow: hidden;
  color: var(--teal);
  font-size: 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.product-link svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.product-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
  background: rgba(255, 253, 249, 0.54);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
}

.empty-icon {
  display: grid;
  width: 43px;
  height: 43px;
  margin: 0 auto 13px;
  place-items: center;
  color: var(--teal);
  background: var(--teal-pale);
  border-radius: 8px;
}

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

.empty-state h3 {
  color: var(--ink);
  font-size: 15px;
}

.empty-state p {
  margin: 6px 0 17px;
  color: var(--muted);
  font-size: 12px;
}

.editor-dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-dialog);
}

.editor-dialog::backdrop {
  background: rgba(24, 37, 36, 0.42);
}

.editor-dialog form {
  display: flex;
  max-height: calc(100vh - 30px);
  flex-direction: column;
}

.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-header {
  padding: 23px 25px 17px;
  border-bottom: 1px solid var(--line);
}

.dialog-kicker {
  color: var(--orange);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.dialog-header h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 740;
}

.dialog-close {
  margin: -4px -7px 0 0;
  color: #8a9491;
}

.dialog-close:hover {
  color: var(--red);
  background: #f9e8e8;
}

.dialog-body {
  overflow: auto;
  padding: 23px 25px 25px;
}

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

.single-column {
  grid-template-columns: 1fr;
}

.form-field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.form-field em {
  color: var(--red);
  font-style: normal;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input,
.form-field select {
  height: 39px;
  padding: 0 11px;
}

.form-field textarea {
  min-height: 115px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.65;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #8bbdb7;
  box-shadow: 0 0 0 3px rgba(20, 125, 117, 0.1);
  outline: 0;
}

.field-help {
  color: #9a9f9b;
  font-size: 10px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding-top: 19px;
}

.toggle-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.toggle-field span {
  color: var(--ink-soft);
  font-size: 12px;
}

.color-options {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 39px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  background: var(--swatch);
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(31, 43, 45, 0.12);
}

.color-swatch:hover,
.color-swatch.is-selected {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--swatch);
}

.dialog-footer {
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 25px;
  border-top: 1px solid var(--line);
}

.group-dialog {
  width: min(430px, calc(100vw - 30px));
}

.toast-region {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100vw - 30px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 5px;
  box-shadow: 0 12px 32px rgba(24, 37, 36, 0.15);
  animation: toast-in 180ms ease-out;
}

.toast.is-error {
  border-left-color: var(--red);
}

.toast.is-warning {
  border-left-color: var(--orange);
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--teal);
}

.toast.is-error svg {
  color: var(--red);
}

.toast.is-warning svg {
  color: var(--orange);
}

.toast span {
  font-size: 12px;
  line-height: 1.45;
}

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

@media (max-width: 1120px) {
  .topbar,
  .content-area {
    padding-right: 28px;
    padding-left: 28px;
  }

  .product-table-head,
  .product-row {
    grid-template-columns: minmax(210px, 1.25fr) minmax(235px, 1.15fr) minmax(150px, 0.8fr) 140px;
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 76px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand-lockup {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .brand-lockup > div:last-child,
  .sidebar-heading,
  .nav-item span,
  .nav-item b,
  .section-label-row > span,
  .group-name,
  .group-count,
  .group-edit-button,
  .shared-note > div,
  .sidebar-footer {
    display: none;
  }

  .primary-nav {
    gap: 7px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .section-label-row {
    justify-content: center;
    padding: 0 0 8px;
  }

  .group-list {
    gap: 4px;
  }

  .group-item {
    justify-content: center;
    padding: 0;
  }

  .group-dot {
    width: 10px;
    height: 10px;
  }

  .shared-note {
    justify-content: center;
    margin-right: 0;
    margin-left: 0;
    padding: 9px 0;
  }

  .main-area {
    width: calc(100% - 76px);
    margin-left: 76px;
  }

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

  .metric-cell:nth-child(2) {
    border-right: 0;
  }

  .metric-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .product-table {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .product-table-head {
    display: none;
  }

  .product-row {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr) 148px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 5px 16px rgba(32, 48, 45, 0.035);
  }

  .product-note-cell {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: 58px;
    padding: 0 16px;
  }

  .topbar-actions .text-button span,
  .topbar-divider {
    display: none;
  }

  .topbar-actions {
    gap: 9px;
  }

  .text-button {
    width: 30px;
    padding: 0;
  }

  .content-area {
    padding: 27px 16px 45px;
  }

  .page-heading {
    display: block;
  }

  .heading-actions {
    margin-top: 18px;
  }

  .heading-actions .secondary-button {
    flex: 0 0 auto;
  }

  .heading-actions .primary-button {
    flex: 1;
  }

  h1 {
    font-size: 26px;
  }

  .metric-strip {
    margin-top: 25px;
  }

  .metric-cell {
    min-height: 86px;
    padding: 14px 13px;
  }

  .metric-cell strong {
    font-size: 21px;
  }

  .toolbar {
    display: block;
    margin-top: 22px;
  }

  .toolbar-controls {
    justify-content: space-between;
    margin-top: 10px;
  }

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

  .view-caption {
    display: block;
  }

  .view-tip {
    margin-top: 8px !important;
  }

  .product-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 15px;
  }

  .product-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid #efede7;
  }

  .product-note-cell {
    display: block;
    grid-column: 1 / -1;
  }

  .editor-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .editor-dialog form {
    max-height: calc(100vh - 18px);
  }

  .dialog-header {
    padding: 20px 18px 15px;
  }

  .dialog-body {
    padding: 19px 18px 21px;
  }

  .dialog-footer {
    padding: 13px 18px;
  }

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

  .form-field.full-width {
    grid-column: auto;
  }

  .toggle-field {
    padding-top: 0;
  }

  .toast-region {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}
