:root {
  color-scheme: light;
  --green: #16a34a;
  --green-dark: #12823d;
  --red: #dc2626;
  --yellow: #f2b705;
  --ink: #18202b;
  --muted: #687385;
  --line: #e4e8ef;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --shadow: 0 16px 40px rgba(20, 28, 38, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background: #d9dee7;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

[hidden] {
  display: none !important;
}

.customer-page {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.customer-page.detail-is-open {
  overflow: hidden;
}

.access-gate {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #edf3ef;
}

.access-card {
  display: grid;
  width: 100%;
  max-width: 430px;
  width: min(100%, 430px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.access-cover {
  min-height: 156px;
  background-color: #d7e6dd;
  background-position: center;
  background-size: cover;
}

.access-copy {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.access-copy h1,
.access-copy p {
  margin: 0;
}

.access-copy h1 {
  font-size: 22px;
}

.access-copy p:not(.eyebrow) {
  color: #526070;
  font-size: 14px;
  line-height: 1.6;
}

.access-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.access-form input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
}

.access-form button {
  min-height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.phone-shell {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 430px;
  width: min(100%, 430px);
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 20px 60px rgba(0, 0, 0, 0.18);
}

.shop-banner {
  position: relative;
  flex: 0 0 20%;
  min-height: 112px;
  background-color: #d7e6dd;
  background-position: center;
  background-size: cover;
}

.banner-title {
  position: absolute;
  right: 16px;
  bottom: 12px;
  left: 16px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.banner-title strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
}

.banner-title span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.notice-strip {
  display: grid;
  height: 38px;
  flex: 0 0 auto;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f3fbf5;
  color: #31533d;
}

.notice-mark {
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  color: var(--green);
}

.notice-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.notice-window {
  overflow: hidden;
  white-space: nowrap;
}

.notice-window p {
  display: inline-block;
  min-width: 100%;
  margin: 0;
  padding-left: 100%;
  font-size: 13px;
  animation: marquee 16s linear infinite;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.browse-area {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: 76px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}

.category-nav {
  display: block;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  contain: layout paint;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  border-right: 1px solid var(--line);
  background: #f5f7f8;
  scrollbar-color: #94a3b8 #e8edf2;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.category-nav::-webkit-scrollbar {
  width: 7px;
}

.category-nav::-webkit-scrollbar-track {
  background: #e8edf2;
}

.category-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid #e8edf2;
  background: #94a3b8;
}

.category-group {
  border-bottom: 1px solid #e8edf2;
}

.category-main,
.subcategory-button {
  display: grid;
  width: 100%;
  min-height: 46px;
  place-items: center;
  padding: 7px 5px;
  color: #27313e;
  background: transparent;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.category-main {
  grid-template-columns: minmax(0, 1fr) 12px;
  font-weight: 700;
}

.category-main.active,
.subcategory-button.active {
  color: #fff;
  background: var(--green);
}

.category-main b {
  font-size: 14px;
  font-weight: 700;
}

.subcategory-list {
  padding: 4px 0 6px;
}

.subcategory-button {
  min-height: 36px;
  color: #586474;
  font-size: 13px;
}

.product-area {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #fff;
}

.search-box {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 10px 10px 8px;
  padding: 0 12px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.current-category {
  height: 36px;
  flex: 0 0 auto;
  padding: 0 11px;
  overflow: hidden;
  color: #223047;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 36px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 10px 86px;
}

.service-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f5;
}

.service-thumb,
.row-thumb,
.draft-thumb {
  border-radius: 8px;
  background: linear-gradient(135deg, #dce4eb, #f7fafc);
  background-position: center;
  background-size: cover;
}

.service-thumb {
  width: 86px;
  height: 86px;
}

.service-card-body {
  min-width: 0;
}

.service-card h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-card p {
  display: -webkit-box;
  min-height: 34px;
  margin: 5px 0 6px;
  overflow: hidden;
  color: #5c6878;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.spec-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 7px;
  color: #b42318;
  background: #fff0ed;
  font-size: 12px;
  font-weight: 700;
}

.location-line {
  margin-top: 6px;
  overflow: hidden;
  color: #6b7482;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-service {
  position: absolute;
  right: 14px;
  bottom: 16px;
  z-index: 6;
  min-width: 96px;
  height: 44px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.35);
  font-size: 14px;
  font-weight: 800;
}

.drawer-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(14, 24, 36, 0.38);
}

.chat-drawer {
  display: flex;
  width: 100%;
  max-width: 430px;
  width: min(100%, 430px);
  max-height: 88vh;
  max-height: 88dvh;
  flex-direction: column;
  border-radius: 8px 8px 0 0;
  background: #fff;
}

.drawer-backdrop.detail-open {
  align-items: stretch;
  background: #fff;
}

.detail-drawer {
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  flex-direction: column;
  border-radius: 0;
  background: #fff;
}

.drawer-header {
  display: grid;
  height: 54px;
  flex: 0 0 auto;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.drawer-header h1 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-text-button {
  color: var(--green);
  background: transparent;
  font-size: 14px;
}

.detail-content {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 84px;
  -webkit-overflow-scrolling: touch;
}

.detail-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.detail-block:first-child {
  padding-top: 0;
}

.detail-block h2,
.detail-block h3 {
  margin: 0 0 8px;
}

.detail-block h2 {
  font-size: 20px;
}

.detail-block h3 {
  font-size: 15px;
}

.detail-block p {
  margin: 0;
  color: #4c5868;
  font-size: 14px;
  line-height: 1.7;
}

.detail-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-grid {
  display: grid;
  gap: 10px;
}

.media-grid img,
.video-tile video {
  width: 100%;
  border-radius: 8px;
  background: #edf1f5;
}

.video-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.22), rgba(15, 23, 42, 0.2)),
    linear-gradient(135deg, #263241, #111827);
}

.video-cover {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  min-height: 190px;
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.18), rgba(15, 23, 42, 0.2)),
    linear-gradient(135deg, #263241, #111827);
  background-position: center;
  background-size: cover;
  cursor: pointer;
}

.video-cover.fallback-cover::after {
  content: "视频";
  position: absolute;
  left: 14px;
  top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.video-cover.loading-cover::after {
  content: "正在生成视频预览";
  position: absolute;
  left: 14px;
  top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.video-tile::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.24));
}

.video-tile video {
  position: relative;
  min-height: 190px;
  object-fit: cover;
  background: transparent;
}

.video-tile .video-play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  font-weight: 800;
}

.video-tile .video-play-badge::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
}

.video-tile.playing::before,
.video-tile.playing .video-cover,
.video-tile.playing .video-play-badge {
  display: none;
}

.detail-service-button,
.chat-form button,
.reply-form button,
.stack-form button,
.primary-button {
  min-height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.detail-service-button {
  width: 100%;
  margin-top: 14px;
}

.detail-floating-service {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 22;
  min-height: 46px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.35);
  font-weight: 900;
}

.chat-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: #386348;
  background: #f3fbf5;
  font-size: 13px;
}

.chat-product strong,
.chat-product span {
  display: block;
}

.chat-product strong {
  color: #17412a;
}

.chat-product span {
  margin-top: 2px;
  color: #567064;
  line-height: 1.4;
}

.send-product-button {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-messages {
  display: flex;
  flex: 1 1 auto;
  min-height: 260px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
  background: #f6f8fb;
}

.chat-messages.service {
  min-height: 0;
}

.chat-bubble {
  max-width: 78%;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble span {
  display: block;
  margin-bottom: 3px;
  color: #7a8595;
  font-size: 11px;
}

.chat-bubble.mine {
  align-self: flex-end;
  color: #fff;
  background: var(--green);
}

.chat-bubble.theirs {
  align-self: flex-start;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.chat-form,
.reply-form {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-form input,
.chat-form textarea,
.reply-form textarea,
.stack-form input,
.editor-grid input,
.editor-grid textarea,
.editor-grid select,
.draft-editor-form input,
.draft-editor-form textarea,
.draft-editor-form select,
.inline-form input,
.batch-toolbar input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.chat-form input,
.stack-form input,
.editor-grid input,
.editor-grid select,
.draft-editor-form input,
.draft-editor-form select,
.inline-form input,
.batch-toolbar input {
  height: 40px;
  padding: 0 11px;
}

.chat-form textarea,
.reply-form textarea,
.editor-grid textarea,
.draft-editor-form textarea {
  padding: 10px 11px;
  resize: vertical;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.empty-state.small {
  min-height: 70px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: 20px;
  left: 18px;
  display: none;
  width: calc(100% - 36px);
  max-width: 420px;
  width: min(420px, calc(100% - 36px));
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: rgba(24, 32, 43, 0.95);
  font-size: 14px;
  text-align: center;
}

.toast.show {
  display: block;
}

.dashboard-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #eef2f7;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 4px 0 8px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.text-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--green);
  font-weight: 700;
}

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

.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  color: #dbe5ee;
  background: #17202c;
}

.dashboard-side strong {
  margin-bottom: 12px;
  color: #fff;
  font-size: 18px;
}

.dashboard-side button,
.dashboard-side a {
  display: flex;
  min-height: 38px;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: #dbe5ee;
  background: transparent;
  font-size: 14px;
  text-align: left;
}

.dashboard-side button.active {
  color: #fff;
  background: var(--green);
}

.dashboard-main {
  min-width: 0;
  padding: 22px;
  overflow: auto;
}

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-top h1 {
  margin: 4px 0 0;
  font-size: 24px;
}

.admin-panel {
  display: none;
}

.admin-panel.active {
  display: grid;
  gap: 16px;
}

.panel-grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(18, 30, 44, 0.05);
}

.panel-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

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

.title-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.title-actions h2 {
  margin-right: 6px;
}

.folder-drop {
  display: grid;
  min-height: 128px;
  place-items: center;
  margin-top: 14px;
  border: 1px dashed #9fb0c3;
  border-radius: 8px;
  background: #f7fafc;
  color: #4c596a;
  font-weight: 800;
  text-align: center;
}

.folder-drop.drag-over {
  border-color: var(--green);
  background: #ecfdf3;
  color: #166534;
}

.folder-drop input {
  display: none;
}

.folder-preview,
.draft-list,
.table-list,
.category-manage,
.message-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.folder-item,
.table-row,
.draft-card,
.category-admin-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.folder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.folder-item span,
.table-row span,
.draft-copy span {
  color: var(--muted);
  font-size: 12px;
}

.batch-toolbar {
  display: grid;
  gap: 12px;
}

.upload-submit-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.upload-progress {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 2px solid #22c55e;
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #f0fdf4, #dcfce7);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.14);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #14532d;
  font-size: 13px;
}

.upload-progress-head strong {
  font-size: 15px;
}

.upload-progress-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #bbf7d0;
}

.upload-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.18s ease;
}

.upload-progress p {
  margin: 0;
  color: #166534;
  font-size: 13px;
  line-height: 1.45;
}

.batch-toolbar label,
.editor-grid label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
}

.editor-grid .switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-grid .switch-line input {
  width: 18px;
  height: 18px;
}

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

.form-subhead:first-child {
  border-top: 0;
  padding-top: 0;
}

.form-subhead strong {
  color: #14532d;
  font-size: 15px;
}

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

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-choice-group {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  padding: 10px;
  background: #f9fbfd;
}

.sub-choice-group strong {
  color: #1f2a3a;
  font-size: 13px;
}

.chip-check {
  display: inline-flex;
  align-items: center;
}

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

.chip-check span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  padding: 0 11px;
  color: #475569;
  background: #fff;
  font-size: 13px;
}

.chip-check input:checked + span {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.draft-card {
  display: grid;
  grid-template-columns: 68px 76px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.draft-editor-card {
  overflow: hidden;
  border: 1px solid #b7e4c7;
  border-radius: 8px;
  background: #fff;
}

.draft-editor-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #b7e4c7;
  border-left: 5px solid var(--green);
  background: #e8f8ee;
}

.draft-editor-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-editor-head span {
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.draft-editor-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  padding: 10px;
}

.draft-editor-form label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 13px;
}

.draft-editor-form .wide {
  grid-column: 1 / -1;
}

.draft-editor-form .compact-spec-block {
  gap: 7px;
}

.compact-spec-block .spec-row {
  grid-template-columns: minmax(96px, 150px) minmax(110px, 1fr) auto;
}

.compact-spec-block .small-button {
  width: max-content;
  min-height: 32px;
}

.draft-subcategory-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-editor-form .compact-choice {
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: start;
}

.draft-editor-form .compact-choice > span {
  padding-top: 7px;
  font-weight: 800;
}

.draft-editor-form .sub-choice-group {
  width: auto;
  min-width: 180px;
  flex: 1 1 220px;
  padding: 7px;
}

.draft-editor-form input,
.draft-editor-form select {
  height: 34px;
}

.draft-editor-form textarea {
  min-height: 52px;
  padding: 8px 10px;
}

.draft-check {
  color: #475569;
  font-size: 13px;
}

.draft-thumb,
.row-thumb {
  width: 76px;
  height: 76px;
}

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

.draft-copy strong,
.table-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-copy p,
.table-row p {
  margin: 4px 0 0;
  color: #5f6b7a;
  font-size: 13px;
}

.draft-actions,
.row-actions,
.form-actions,
.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-actions {
  margin-top: 10px;
}

.secondary-button,
.small-button,
.danger-button,
.success-button,
.warning-button,
.inline-form button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.secondary-button {
  color: #334155;
  background: #e8eef5;
}

.small-button,
.inline-form button {
  color: #17412a;
  background: #dff5e7;
}

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

.success-button {
  color: #fff;
  background: var(--green);
}

.warning-button {
  color: #372b00;
  background: var(--yellow);
}

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

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

.editor-grid .compact-choice {
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: start;
}

.editor-grid .compact-choice > span {
  padding-top: 8px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.edit-modal {
  width: 100%;
  max-width: 980px;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border-radius: 10px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

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

.modal-head h2 {
  margin: 4px 0 0;
}

.spec-rows {
  display: grid;
  gap: 8px;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 160px) auto;
  gap: 8px;
}

.spec-row button {
  border-radius: 8px;
  color: #fff;
  background: var(--red);
}

.media-keep {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: #475569;
  background: #fff;
  font-size: 13px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.product-row {
  grid-template-columns: auto 76px minmax(170px, 0.7fr) auto;
}

.product-row.with-quick-editor {
  grid-template-columns: auto 76px minmax(150px, 0.45fr) minmax(420px, 1.6fr) auto;
  align-items: start;
}

.product-row.compact {
  grid-template-columns: auto 58px minmax(0, 1fr) auto;
}

.product-row.compact .row-thumb {
  width: 58px;
  height: 58px;
}

.row-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-check input {
  width: 18px;
  height: 18px;
}

.product-admin-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.collapse-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.collapse-toggle.small {
  min-height: 28px;
}

.collapse-toggle b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
}

.product-admin-head span {
  color: var(--muted);
  font-size: 12px;
}

.product-admin-list {
  display: grid;
}

.product-subgroup-list {
  display: grid;
}

.product-subgroup {
  border-bottom: 1px solid var(--line);
}

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

.product-subgroup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  color: #334155;
  background: #f1f5f9;
}

.subgroup-actions,
.sort-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.product-subgroup-head strong {
  font-size: 14px;
}

.product-subgroup-head span {
  color: var(--muted);
  font-size: 12px;
}

.product-admin-list .table-row {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

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

.row-main {
  min-width: 0;
}

.product-quick-editor {
  display: grid;
  min-width: 0;
  gap: 8px;
  cursor: default;
}

.quick-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 6px;
}

.quick-fields input,
.quick-fields select,
.product-quick-editor input,
.product-quick-editor select {
  height: 32px;
  min-width: 0;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  padding: 0 8px;
  color: #1f2a3a;
  background: #fff;
  font-size: 12px;
}

.quick-spec-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.product-quick-specs {
  gap: 6px;
}

.product-quick-specs .spec-row {
  grid-template-columns: minmax(86px, 1fr) minmax(80px, 0.8fr) auto;
  gap: 6px;
}

.product-quick-specs .spec-row button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

.quick-subcategory-block,
.quick-media-block {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
}

.quick-subcategory-block > span,
.quick-media-block > span {
  padding-top: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.quick-subcategory-groups {
  max-height: 92px;
  overflow: auto;
  border: 1px solid #e5ebf2;
  border-radius: 8px;
  padding: 6px;
  background: #f8fafc;
}

.quick-subcategory-groups .sub-choice-group {
  min-width: 160px;
  flex: 1 1 180px;
  padding: 6px;
}

.quick-subcategory-groups .choice-grid {
  gap: 5px;
}

.quick-subcategory-groups .chip-check span {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.quick-media-block {
  grid-template-columns: 52px minmax(0, 1fr) minmax(120px, 0.4fr);
}

.quick-media-keep {
  max-height: 64px;
  overflow: auto;
  gap: 5px;
}

.quick-media-keep .media-check {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.product-row {
  cursor: pointer;
}

.draggable-row {
  cursor: grab;
}

.draggable-row.dragging {
  opacity: 0.55;
  background: #ecfdf3;
}

.category-admin-group {
  padding: 12px;
}

.category-admin-main {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto minmax(220px, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: center;
}

.subcategory-admin-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 20px;
}

.subcategory-admin-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 8px;
  background: #f6f8fb;
  font-size: 13px;
}

.category-check,
.subcategory-admin-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-name-input,
.subcategory-admin-row input[type="text"],
.subcategory-admin-row input:not([type]) {
  min-height: 34px;
}

.message-row {
  cursor: pointer;
}

.message-row:hover {
  background: #f8fafc;
}

.conversation-admin-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: #166534;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 800;
}

.status.hidden {
  color: #991b1b;
  background: #fee2e2;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-form.three {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.staff-edit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.staff-edit-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  margin: 0;
}

.service-shell {
  display: grid;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: 340px minmax(0, 1fr);
  background: #fff;
}

.conversation-list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.conversation-list header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.service-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sound-on {
  color: #fff;
  background: var(--green);
}

.conversation-list h1,
.conversation-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

#conversationList {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.conversation-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.conversation-item.unread {
  border-color: #fecaca;
  background: #fff7f7;
}

.conversation-item.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.conversation-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.conversation-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-dot {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  color: #fff;
  background: #dc2626;
  font-size: 11px;
  line-height: 1;
}

.reply-needed,
.reply-done {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.reply-needed {
  color: #991b1b;
  background: #fee2e2;
}

.reply-done {
  color: #166534;
  background: #dcfce7;
}

.conversation-item span,
.conversation-item p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.conversation-head {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.conversation-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.conversation-alert,
.conversation-ok {
  display: inline-flex;
  width: max-content;
  margin-left: 8px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.conversation-alert {
  color: #991b1b;
  background: #fee2e2;
}

.conversation-ok {
  color: #166534;
  background: #dcfce7;
}

@media (max-width: 820px) {
  .dashboard-page {
    overflow: hidden;
  }

  .dashboard-shell {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .dashboard-side {
    position: sticky;
    top: 0;
    z-index: 5;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  .dashboard-side strong {
    display: none;
  }

  .dashboard-side button,
  .dashboard-side a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 11px;
  }

  .dashboard-main {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-top {
    position: sticky;
    top: 0;
    z-index: 4;
    align-items: flex-start;
    margin: 0 0 12px;
    padding: 10px 0;
    background: #eef2f7;
  }

  .dashboard-top h1 {
    font-size: 20px;
  }

  .panel-card {
    padding: 14px;
  }

  .section-head {
    flex-direction: column;
  }

  .panel-grid.two,
  .editor-grid,
  .draft-editor-form,
  .draft-editor-head,
  .inline-form,
  .inline-form.three,
  .category-admin-main,
  .subcategory-admin-row,
  .draft-card,
  .product-row,
  .table-row,
  .spec-row {
    grid-template-columns: 1fr;
  }

  .product-row.with-quick-editor,
  .quick-fields,
  .quick-spec-block,
  .quick-subcategory-block,
  .quick-media-block,
  .product-quick-specs .spec-row {
    grid-template-columns: 1fr;
  }

  .quick-subcategory-groups,
  .quick-media-keep {
    max-height: none;
  }

  .folder-drop {
    min-height: 96px;
  }

  .draft-thumb,
  .row-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .draft-actions,
  .row-actions,
  .form-actions,
  .batch-actions {
    width: 100%;
  }

  .draft-actions button,
  .row-actions button,
  .form-actions button,
  .batch-actions button {
    flex: 1 1 120px;
  }

  .service-shell {
    display: grid;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    grid-template-columns: minmax(92px, 25%) minmax(0, 75%);
    overflow: hidden;
  }

  .conversation-list {
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .conversation-list header,
  .conversation-head {
    padding: 12px;
  }

  .conversation-list header {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .service-head-actions button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .conversation-item {
    padding: 9px 7px;
  }

  .conversation-item span,
  .conversation-item p {
    font-size: 12px;
  }

  .conversation-panel {
    min-height: 0;
  }

  .conversation-head h2 {
    font-size: 18px;
  }

  .reply-form {
    padding: 10px;
  }

  .chat-product {
    grid-template-columns: 1fr;
  }
}
