/* ============================================================
   云潭工作台 · Application layouts
   ============================================================ */

/* ============================================================
   1. Login
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(440px, 0.93fr);
  background: #fbfdfc;
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px 52px 34px;
  color: #eaf7f4;
  background:
    radial-gradient(1100px 700px at 8% 0%, rgba(18, 181, 165, 0.26), transparent 58%),
    radial-gradient(900px 700px at 100% 100%, rgba(216, 189, 146, 0.16), transparent 60%),
    linear-gradient(155deg, #0a1d25 0%, #0d2830 48%, #0b3438 100%);
  isolation: isolate;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 78%);
  pointer-events: none;
  z-index: -1;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 760px;
  height: 760px;
  left: -230px;
  bottom: -420px;
  border-radius: 50%;
  border: 1px solid rgba(127, 224, 206, 0.16);
  box-shadow:
    0 0 0 90px rgba(127, 224, 206, 0.035),
    0 0 0 180px rgba(127, 224, 206, 0.025),
    0 0 0 280px rgba(127, 224, 206, 0.018);
  pointer-events: none;
  z-index: -1;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  position: relative;
  z-index: 2;
}
.login-brand img {
  width: 43px;
  height: 43px;
  border-radius: 12px;
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.8);
}
.login-brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
}
.login-brand-sub {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(234, 247, 244, 0.46);
  margin-top: 3px;
  text-transform: uppercase;
}
.login-hero {
  margin-top: clamp(36px, 7vh, 72px);
  max-width: 540px;
  position: relative;
  z-index: 2;
}
.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--jade-300);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.login-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--jade-300);
  opacity: 0.6;
}
.login-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.1vw, 52px);
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f7fcfb;
}
.login-hero h1 em {
  font-style: normal;
  color: var(--jade-300);
  position: relative;
}
.login-hero h1 em::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  height: 7px;
  background: rgba(127, 224, 206, 0.16);
  border-radius: 4px;
  z-index: -1;
}
.login-hero p {
  margin-top: 17px;
  max-width: 400px;
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(226, 242, 238, 0.62);
}
.login-showcase {
  position: relative;
  flex: 1;
  min-height: 300px;
  margin-top: 18px;
  z-index: 1;
}
.show-card {
  position: absolute;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: floatCard 7s var(--ease) infinite;
}
.show-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.show-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(7, 24, 32, 0.42));
  pointer-events: none;
}
.show-card-label {
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: auto;
  z-index: 2;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(7, 24, 32, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.show-card-label::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--jade-300);
}
.show-card.c1 {
  width: 47%;
  aspect-ratio: 1;
  left: 3%;
  top: 2%;
  transform: rotate(-7deg);
  animation-delay: -1.2s;
  z-index: 2;
}
.show-card.c2 {
  width: 39%;
  aspect-ratio: 1;
  right: 4%;
  top: 13%;
  transform: rotate(6deg);
  animation-delay: -3.4s;
}
.show-card.c3 {
  width: 34%;
  aspect-ratio: 1;
  left: 30%;
  top: 34%;
  transform: rotate(-2deg);
  animation-delay: -5.1s;
  z-index: 3;
}
.login-visual-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  position: relative;
  z-index: 2;
}
.login-visual-foot span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: rgba(226, 242, 238, 0.52);
  letter-spacing: 0.02em;
}
.login-visual-foot .ico {
  width: 14px;
  height: 14px;
  color: var(--jade-300);
  opacity: 0.8;
}
@keyframes floatCard {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -11px; }
}

.login-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  position: relative;
  background:
    radial-gradient(720px 460px at 100% 0%, rgba(18, 181, 165, 0.07), transparent 65%),
    #fbfdfc;
}
.login-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(11, 32, 41, 0.1), transparent);
}
.login-card {
  width: 100%;
  max-width: 372px;
  animation: loginIn 0.5s var(--ease);
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.login-card .eyebrow { margin-bottom: 10px; }
.login-card h2 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-card > p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.login-form {
  margin-top: 27px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.login-form .field > label { color: var(--muted); font-weight: 500; font-size: 12px; }
.login-form .input {
  height: 45px;
  border-radius: 11px;
  background: #fff;
}
.login-form .input-icon .ico { width: 18px; height: 18px; }
.login-submit {
  height: 46px;
  margin-top: 5px;
  border-radius: 11px;
  font-size: 14px;
  letter-spacing: 0.06em;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  border: 1px solid #f3d6d2;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.login-error .ico { width: 15px; height: 15px; }
.login-demo {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.login-demo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.login-demo-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.demo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.demo-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.demo-btn:hover {
  border-color: var(--jade-300);
  background: var(--jade-50);
  box-shadow: 0 4px 12px -6px rgba(14, 158, 135, 0.3);
}
.demo-btn .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.demo-btn b {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.demo-btn span {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.02em;
}
.login-copyright {
  margin-top: 34px;
  font-size: 10.5px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.8;
}
.login-copyright b { color: var(--muted); font-weight: 600; }
.login-mobile-brand { display: none; }

/* ============================================================
   2. Shell
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--fog);
}
.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: #dcece8;
  background:
    radial-gradient(560px 400px at 0% 0%, rgba(18, 181, 165, 0.16), transparent 60%),
    linear-gradient(180deg, #0b2029 0%, #091a21 100%);
  overflow: hidden;
  z-index: 40;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 62%);
  pointer-events: none;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 21px 18px 20px;
  position: relative;
  z-index: 1;
}
.sidebar-brand img {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.7);
}
.sidebar-brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
  color: #f2fbf9;
}
.sidebar-brand-sub {
  font-size: 8px;
  letter-spacing: 0.26em;
  color: rgba(220, 236, 232, 0.42);
  margin-top: 2px;
}
.sidebar-env {
  margin: 0 14px 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: rgba(220, 236, 232, 0.55);
  position: relative;
  z-index: 1;
}
.sidebar-env .badge { height: 18px; font-size: 9px; background: rgba(127, 224, 206, 0.12); color: var(--jade-300); border: 0; margin-left: auto; }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); }
.nav-section {
  padding: 16px 10px 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(220, 236, 232, 0.32);
  text-transform: uppercase;
}
.nav-section:first-child { padding-top: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  color: rgba(220, 236, 232, 0.68);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  transition: background 0.16s, color 0.16s;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-item .ico {
  width: 17px;
  height: 17px;
  opacity: 0.72;
  transition: opacity 0.16s, color 0.16s;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}
.nav-item:hover .ico { opacity: 1; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(18, 181, 165, 0.2), rgba(18, 181, 165, 0.07));
  color: #f0fffb;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(127, 224, 206, 0.09);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--jade-400);
  box-shadow: 0 0 12px rgba(62, 202, 185, 0.7);
}
.nav-item.is-active .ico { color: var(--jade-300); opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(220, 236, 232, 0.65);
  font-size: 9px;
  font-weight: 600;
  height: 17px;
  padding: 0 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}
.nav-item.is-active .nav-badge { background: rgba(127, 224, 206, 0.14); color: var(--jade-300); }
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
  z-index: 1;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 11px;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.side-user:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.06); }
.side-user .avatar { box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.5); }
.side-user-copy { flex: 1; min-width: 0; }
.side-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #edf8f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-user-role {
  font-size: 9.5px;
  color: rgba(220, 236, 232, 0.42);
  display: flex;
  align-items: center;
  gap: 4px;
}
.side-user-role .ico { width: 10px; height: 10px; }
.side-user .icon-btn {
  color: rgba(220, 236, 232, 0.45);
  width: 28px;
  height: 28px;
}
.side-user .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.topbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-title h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title p {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.topbar-right { display: flex; align-items: center; gap: 7px; }
.topbar-divider { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }
.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  padding: 0 8px;
  white-space: nowrap;
}
.topbar-date .ico { width: 13px; height: 13px; color: var(--muted-2); }
.mobile-menu { display: none; }
.sidebar-scrim { display: none; }

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--fog);
}
.view-full { overflow: hidden; display: flex; flex-direction: column; }

.page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 30px 44px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}
.page-head-copy { min-width: 0; }
.page-head h2 {
  font-size: 23px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page-head p {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.6;
}
.page-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ============================================================
   3. Workbench
   ============================================================ */
.wb {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr) 352px;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--fog);
}
.wb-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.wb-products { border-right: 1px solid var(--line); }
.wb-inspector { border-left: 1px solid var(--line); }
.pane-head {
  height: 54px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.pane-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pane-title .ico { width: 15px; height: 15px; color: var(--jade-600); }
.pane-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-2);
  background: var(--fog);
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}
.product-tools { padding: 11px 13px 8px; display: flex; flex-direction: column; gap: 9px; }
.product-search {
  position: relative;
}
.product-search .ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}
.product-search input {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--fog);
  padding: 0 10px 0 31px;
  font-size: 11.5px;
  transition: background 0.15s, border-color 0.15s;
}
.product-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--jade-300);
  box-shadow: 0 0 0 3px rgba(18, 181, 165, 0.1);
}
.product-search input::placeholder { color: #9aacaa; }
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: visible;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.category-chips::-webkit-scrollbar { display: none; }
.chip {
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #f2fbf9;
}
.chip .chip-count { opacity: 0.5; font-size: 9px; }
.product-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  align-content: start;
}
.product-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  text-align: left;
  position: relative;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
  min-width: 0;
}
.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 7px 18px -10px rgba(11, 32, 41, 0.25);
  transform: translateY(-1px);
}
.product-card.is-active {
  border-color: var(--jade-500);
  box-shadow: 0 0 0 1px var(--jade-500), 0 8px 20px -10px rgba(14, 158, 135, 0.35);
}
.product-thumb {
  aspect-ratio: 1;
  border-radius: 7px;
  background:
    radial-gradient(120% 100% at 50% 0%, #ffffff, #f4f7f6 60%, #eef3f1);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s var(--ease);
}
.product-card:hover .product-thumb img { transform: scale(1.035); }
.product-card.is-active .product-thumb {
  background: radial-gradient(120% 100% at 50% 0%, #ffffff, #effbf7 65%, #e3f6f0);
}
.product-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--jade-500);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(14, 158, 135, 0.4);
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.18s var(--ease);
}
.product-check .ico { width: 10px; height: 10px; stroke-width: 3; }
.product-card.is-active .product-check { opacity: 1; transform: none; }
.product-meta { padding: 6px 3px 2px; }
.product-name {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-cat {
  font-size: 9px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.product-cat::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sand-400);
}
.product-empty { padding: 26px 10px; text-align: center; font-size: 11.5px; color: var(--muted-2); grid-column: 1 / -1; }

/* stage */
.wb-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(700px 500px at 50% 0%, rgba(255, 255, 255, 0.9), transparent 70%),
    var(--fog);
}
.stage-head {
  height: 54px;
  flex: 0 0 auto;
  padding: 0 16px 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}
.stage-product {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.stage-product-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.stage-product-icon img { width: 100%; height: 100%; object-fit: contain; }
.stage-product-name {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-product-meta {
  font-size: 9.5px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.stage-product-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.stage-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.zoom-control {
  display: inline-flex;
  align-items: center;
  height: 31px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.zoom-control button {
  width: 27px;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.zoom-control button:hover { background: var(--fog); color: var(--text); }
.zoom-control .ico { width: 13px; height: 13px; }
.zoom-value {
  min-width: 44px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
  border-left: 1px solid var(--fog-2);
  border-right: 1px solid var(--fog-2);
  line-height: 29px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.stage-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background-image: radial-gradient(rgba(18, 181, 165, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center;
}
.stage-body::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(11, 32, 41, 0.07);
  border-radius: 18px;
  pointer-events: none;
}
.stage-scroll {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 100%;
  min-height: 100%;
  padding: 10px;
}
.product-frame {
  position: relative;
  flex: 0 0 auto;
  transform-origin: center center;
  transition: transform 0.2s var(--ease);
  user-select: none;
  touch-action: none;
}
.product-frame img.product-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 26px 32px rgba(15, 40, 51, 0.10));
}
.logo-layer {
  position: absolute;
  transform-origin: center center;
  cursor: grab;
  touch-action: none;
  will-change: left, top, width;
}
.logo-layer:active { cursor: grabbing; }
.logo-layer img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.logo-layer.is-selected {
  outline: 1px dashed rgba(14, 158, 135, 0.85);
  outline-offset: 5px;
}
.logo-layer.is-selected::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1px;
  pointer-events: none;
}
.logo-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: #fff;
  border: 2px solid var(--jade-500);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(7, 24, 32, 0.2);
  z-index: 3;
  display: none;
}
.logo-layer.is-selected .logo-handle { display: block; }
.logo-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.logo-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.logo-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.logo-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.logo-rotate {
  position: absolute;
  left: 50%;
  top: -32px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--jade-700);
  display: none;
  place-items: center;
  box-shadow: 0 3px 8px rgba(7, 24, 32, 0.16);
  cursor: grab;
  z-index: 4;
}
.logo-rotate::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 12px;
  background: rgba(14, 158, 135, 0.5);
}
.logo-rotate .ico { width: 12px; height: 12px; }
.logo-layer.is-selected .logo-rotate { display: grid; }
.stage-hint {
  flex: 0 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  color: var(--muted-2);
}
.stage-hint span { display: inline-flex; align-items: center; gap: 5px; }
.stage-hint .ico { width: 12px; height: 12px; }
.stage-hint kbd {
  font-family: inherit;
  font-size: 9px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 0 4px;
  color: var(--muted);
}
.stage-empty-cta {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 15px;
  border-radius: 12px;
  background: rgba(11, 32, 41, 0.92);
  color: #f2fbf9;
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(8px);
  z-index: 5;
  font-size: 11.5px;
  max-width: calc(100% - 40px);
  white-space: nowrap;
}
.stage-empty-cta .pulse-dot { background: var(--jade-300); }
.stage-empty-cta .btn { height: 29px; padding: 0 11px; font-size: 11px; }
.stage-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(243, 247, 246, 0.7);
  backdrop-filter: blur(2px);
  z-index: 8;
  font-size: 11px;
  color: var(--muted);
  gap: 8px;
}

/* inspector */
.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  padding: 0 8px;
  gap: 2px;
}
.inspector-tab {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.inspector-tab .ico { width: 14px; height: 14px; }
.inspector-tab:hover { color: var(--text); }
.inspector-tab.is-active { color: var(--jade-700); border-bottom-color: var(--jade-500); }
.inspector-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.inspector-panel { display: none; flex-direction: column; gap: 14px; }
.inspector-panel.is-active { display: flex; }
.insp-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.insp-section-head {
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--fog-2);
  background: #fcfdfd;
}
.insp-section-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.insp-section-head-actions .btn { padding: 0 8px; }
.insp-section-title { white-space: nowrap; }
.insp-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  text-transform: uppercase;
}
.insp-section-title .ico { width: 13px; height: 13px; color: var(--jade-600); }
.insp-section-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.insp-section-body.flush { padding: 0; }
.insp-hint {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted-2);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.insp-hint .ico { width: 12px; height: 12px; margin-top: 2px; flex: 0 0 auto; }
.logo-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  background:
    radial-gradient(160px 90px at 50% 0%, rgba(18, 181, 165, 0.06), transparent 70%),
    #fcfdfd;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
  position: relative;
}
.logo-drop:hover,
.logo-drop.is-drag {
  border-color: var(--jade-400);
  background: var(--jade-50);
}
.logo-drop-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--jade-600);
  box-shadow: var(--shadow-xs);
}
.logo-drop-icon .ico { width: 19px; height: 19px; }
.logo-drop b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.logo-drop span {
  display: block;
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 4px;
  line-height: 1.6;
}
.sample-logos {
  display: flex;
  gap: 6px;
  padding-top: 2px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.sample-logo {
  flex: 0 0 72px;
  height: 46px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 4px 5px;
  display: grid;
  place-items: center;
  transition: all 0.15s;
  overflow: hidden;
}
.sample-logo:hover { border-color: var(--jade-300); box-shadow: 0 3px 10px -4px rgba(14, 158, 135, 0.3); }
.sample-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sample-label {
  font-size: 9px;
  color: var(--muted-2);
  text-align: center;
  margin-top: 2px;
}

.matte-preview {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background-color: #f1f4f3;
  background-image:
    linear-gradient(45deg, #e6ebe9 25%, transparent 25%, transparent 75%, #e6ebe9 75%),
    linear-gradient(45deg, #e6ebe9 25%, transparent 25%, transparent 75%, #e6ebe9 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  border: 1px solid var(--line);
  aspect-ratio: 1.5 / 1;
  display: grid;
  place-items: center;
  cursor: crosshair;
  touch-action: none;
}
.matte-preview canvas { display: block; max-width: 100%; max-height: 100%; }
.matte-preview .brush-cursor {
  position: absolute;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(11, 32, 41, 0.45);
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 2;
}
.matte-preview.is-brushing { cursor: none; }
.matte-preview.is-brushing .brush-cursor { display: block; }
.matte-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  height: 21px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  color: var(--jade-700);
  box-shadow: 0 2px 6px rgba(7, 24, 32, 0.08);
  backdrop-filter: blur(4px);
}
.matte-badge .ico { width: 10px; height: 10px; }
.matte-badge.manual { color: var(--warn); }
.matte-toolbar {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  display: flex;
  gap: 3px;
}
.matte-toolbar .icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--text-soft);
  backdrop-filter: blur(4px);
}
.matte-toolbar .icon-btn .ico { width: 13px; height: 13px; }
.matte-toolbar .icon-btn.is-active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.matte-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(252, 253, 253, 0.82);
  backdrop-filter: blur(3px);
  font-size: 10.5px;
  color: var(--muted);
}
.matte-loading .spinner { width: 20px; height: 20px; }
.matte-controls { display: flex; flex-direction: column; gap: 11px; }
.control-row { display: flex; flex-direction: column; gap: 5px; }
.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-soft);
  font-weight: 500;
}
.control-label b {
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}
.control-label .label-left { display: inline-flex; align-items: center; gap: 5px; }
.brush-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.brush-tool {
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.brush-tool .ico { width: 13px; height: 13px; }
.brush-tool:hover { border-color: var(--line-strong); color: var(--text); }
.brush-tool.is-active { background: var(--jade-50); border-color: var(--jade-300); color: var(--jade-700); }
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(11, 32, 41, 0.15);
  box-shadow: inset 0 0 0 2px #fff;
  flex: 0 0 auto;
}
.matte-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--jade-700);
  background: var(--jade-50);
  border: 1px solid #d9f2ec;
  border-radius: 7px;
  padding: 6px 8px;
}
.matte-status .ico { width: 12px; height: 12px; }
.matte-status.warn { color: var(--warn); background: var(--warn-soft); border-color: #f1e2c4; }

.guide-list { display: flex; flex-direction: column; gap: 11px; }
.guide-item { display: flex; gap: 9px; align-items: flex-start; }
.guide-num {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--fog);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
}
.guide-item b { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-soft); }
.guide-item p { font-size: 9.5px; color: var(--muted-2); line-height: 1.55; margin-top: 1px; }

.logo-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fcfdfd;
}
.logo-file-thumb {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #f1f4f3;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.logo-file-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-file-copy { flex: 1; min-width: 0; }
.logo-file-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-file-meta { font-size: 9.5px; color: var(--muted-2); }

.field-mini { display: flex; flex-direction: column; gap: 5px; }
.field-mini label { font-size: 10.5px; color: var(--text-soft); font-weight: 500; display: flex; justify-content: space-between; }
.field-mini label span { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.field-mini .input,
.field-mini .select { height: 34px; font-size: 11.5px; border-radius: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.align-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.align-btn {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
}
.align-btn:hover { border-color: var(--jade-300); color: var(--jade-700); background: var(--jade-50); }
.align-btn .ico { width: 13px; height: 13px; }
.blend-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.blend-chip {
  height: 27px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  background: #fff;
}
.blend-chip.is-active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.export-preview {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--fog);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}
.export-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.export-options { display: flex; flex-direction: column; gap: 9px; }
.export-actions { display: flex; flex-direction: column; gap: 7px; }
.export-tip { font-size: 9.5px; color: var(--muted-2); text-align: center; line-height: 1.6; }

/* ============================================================
   4. Designs
   ============================================================ */
.designs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.designs-toolbar .grow { flex: 1; }
.designs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.design-card {
  flex: 1 1 260px;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
  position: relative;
}
.design-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 36px -20px rgba(11, 32, 41, 0.35);
  transform: translateY(-2px);
}
.design-preview {
  aspect-ratio: 1;
  background:
    radial-gradient(140% 110% at 50% 0%, #fff, #f2f6f5);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.design-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.35s var(--ease);
}
.design-card:hover .design-preview img { transform: scale(1.03); }
.design-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 24, 32, 0.52));
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  gap: 5px;
}
.design-card:hover .design-overlay { opacity: 1; }
.design-overlay .btn {
  height: 28px;
  padding: 0 10px;
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border: 0;
  backdrop-filter: blur(4px);
}
.design-meta { padding: 11px 12px 12px; }
.design-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 4px;
}
.design-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.design-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.16s;
}
.design-card:hover .design-actions { opacity: 1; }
.design-actions .icon-btn {
  width: 27px;
  height: 27px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
  border-radius: 7px;
}
.design-owner {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  border-radius: 5px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================================
   5. Admin: products
   ============================================================ */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 17px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  right: -34px;
  top: -34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 181, 165, 0.1), transparent 65%);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.stat-label { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--jade-50);
  border: 1px solid #d9f1eb;
  color: var(--jade-700);
  display: grid;
  place-items: center;
}
.stat-icon .ico { width: 15px; height: 15px; }
.stat-card:nth-child(2) .stat-icon { background: var(--sand-100); border-color: #efe2c9; color: #8a6a35; }
.stat-card:nth-child(3) .stat-icon { background: var(--blue-soft); border-color: #dbe9f5; color: var(--blue); }
.stat-card:nth-child(4) .stat-icon { background: #f2effa; border-color: #e6e0f5; color: #6c6aae; }
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 9.5px; color: var(--muted-2); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.stat-sub .up { color: var(--success); font-weight: 600; }

.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.admin-product {
  flex: 1 1 240px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.16s, border-color 0.16s;
  position: relative;
}
.admin-product:hover { box-shadow: 0 14px 30px -18px rgba(11, 32, 41, 0.3); border-color: var(--line-strong); }
.admin-product.is-inactive { opacity: 0.66; }
.admin-product-thumb {
  aspect-ratio: 4 / 3;
  background: radial-gradient(130% 110% at 50% 0%, #fff, #f3f7f6);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.admin-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.admin-product-status { position: absolute; left: 8px; top: 8px; }
.admin-product-actions {
  position: absolute;
  right: 7px;
  top: 7px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.admin-product:hover .admin-product-actions { opacity: 1; }
.admin-product-actions .icon-btn {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.admin-product-meta { padding: 10px 12px 12px; }
.admin-product-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-product-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--muted-2);
}
.zone-preview {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.zone-dot {
  width: 14px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid var(--jade-400);
  background: rgba(18, 181, 165, 0.12);
  display: inline-block;
}

/* upload modal */
.upload-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 13px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  background: #fcfdfd;
  transition: all 0.16s;
}
.upload-drop:hover,
.upload-drop.is-drag { border-color: var(--jade-400); background: var(--jade-50); }
.upload-drop .logo-drop-icon { width: 44px; height: 44px; }
.upload-queue { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 190px; overflow-y: auto; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
}
.queue-item img {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: contain;
  background: var(--fog);
  flex: 0 0 auto;
}
.queue-item .grow { min-width: 0; }
.queue-item .queue-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.queue-item .queue-size { color: var(--muted-2); font-size: 9.5px; }
.queue-item .icon-btn { width: 24px; height: 24px; }

/* zone editor */
.zone-wrap { display: flex; flex-direction: column; gap: 10px; }
.zone-canvas {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 11px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #eef2f1 25%, transparent 25%, transparent 75%, #eef2f1 75%),
    linear-gradient(45deg, #eef2f1 25%, transparent 25%, transparent 75%, #eef2f1 75%),
    #f8faf9;
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  border: 1px solid var(--line);
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}
.zone-canvas img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.zone-rect {
  position: absolute;
  border: 1.5px solid var(--jade-500);
  background: rgba(18, 181, 165, 0.13);
  box-shadow: 0 0 0 9999px rgba(7, 24, 32, 0.1);
  cursor: move;
  border-radius: 1px;
}
.zone-rect::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  color: var(--jade-700);
  background: rgba(255, 255, 255, 0.86);
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 600;
}
.zone-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--jade-500);
  cursor: nwse-resize;
  box-shadow: 0 2px 5px rgba(7, 24, 32, 0.2);
}
.zone-readout {
  display: flex;
  gap: 12px;
  font-size: 9.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.zone-readout b { color: var(--text-soft); font-weight: 600; }
.zone-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ============================================================
   6. Team
   ============================================================ */
.team-card { overflow: hidden; }
.team-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.team-user-copy { min-width: 0; }
.team-user-name { font-size: 12.5px; font-weight: 700; }
.team-user-id { font-size: 10px; color: var(--muted-2); font-family: ui-monospace, Consolas, monospace; }
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  background: var(--fog);
  color: var(--muted);
}
.role-chip.admin { background: var(--ink-900); color: #e9f7f4; }
.role-chip .ico { width: 11px; height: 11px; }
.table-actions { display: flex; justify-content: flex-end; gap: 2px; }
.status-cell { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--success); }
.status-cell .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.status-cell.off { color: var(--muted-2); }
.status-cell.off .dot { background: var(--muted-2); }

/* ============================================================
   7. Dashboard
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chart-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 158px;
  padding: 8px 4px 0;
}
.chart-bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
}
.chart-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--jade-300), var(--jade-500));
  min-height: 4px;
  position: relative;
  transition: height 0.5s var(--ease);
}
.chart-bar.is-today { background: linear-gradient(180deg, var(--jade-400), var(--jade-700)); }
.chart-bar span {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chart-day { font-size: 9px; color: var(--muted-2); white-space: nowrap; }
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--fog-2);
  transition: background 0.12s;
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: #fbfdfc; }
.recent-thumb {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--fog);
  flex: 0 0 auto;
}
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-copy { min-width: 0; flex: 1; }
.recent-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-sub { font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }
.top-product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--fog-2);
}
.top-product:last-child { border-bottom: 0; }
.top-rank {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--fog);
  color: var(--muted-2);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  flex: 0 0 auto;
}
.top-rank.r1 { background: var(--ink-900); color: #fff; }
.top-rank.r2 { background: var(--sand-200); color: #7a5c2e; }
.top-rank.r3 { background: #f0e8dc; color: #8a6a35; }
.top-copy { flex: 1; min-width: 0; }
.top-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bar { height: 3px; border-radius: 3px; background: var(--fog-2); margin-top: 5px; overflow: hidden; }
.top-bar span { display: block; height: 100%; border-radius: 3px; background: var(--jade-400); }
.top-count { font-size: 10px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ============================================================
   8. Help / misc
   ============================================================ */
.help-steps { display: flex; flex-direction: column; gap: 14px; }
.help-step { display: flex; gap: 12px; }
.help-num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--jade-50);
  border: 1px solid #d8f0ea;
  color: var(--jade-700);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.help-step b { font-size: 12.5px; display: block; margin-bottom: 3px; }
.help-step p { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.help-note {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--sand-100);
  border: 1px solid #efe2c9;
  font-size: 11px;
  color: #7a6339;
  line-height: 1.7;
  display: flex;
  gap: 8px;
}
.help-note .ico { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
kbd.keys {
  display: inline-block;
  min-width: 19px;
  text-align: center;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: #fff;
  font-family: inherit;
  font-size: 9.5px;
  color: var(--muted);
}

/* ============================================================
   9. Responsive
   ============================================================ */
@media (max-width: 1440px) {
  .wb { grid-template-columns: 264px minmax(0, 1fr) 334px; }
  .product-list { gap: 8px; padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 1240px) {
  .wb { grid-template-columns: 240px minmax(0, 1fr) 318px; }
  .product-list { grid-template-columns: 1fr; }
  .product-card { display: flex; align-items: center; gap: 8px; padding: 5px; }
  .product-thumb { width: 54px; flex: 0 0 auto; border-radius: 6px; }
  .product-meta { padding: 0; flex: 1; min-width: 0; }
  .product-cat { font-size: 8.5px; }
  .page { padding: 24px 24px 40px; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 252px;
    transform: translateX(-102%);
    transition: transform 0.26s var(--ease);
    box-shadow: 20px 0 60px -30px rgba(0, 0, 0, 0.5);
  }
  body.nav-open .sidebar { transform: none; }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(7, 24, 32, 0.42);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .mobile-menu { display: inline-flex; }
  .wb { grid-template-columns: 220px minmax(0, 1fr) 310px; }
  .topbar { padding: 0 18px; }
  .page { padding: 20px 20px 36px; }
}

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel {
    min-height: 100vh;
    padding: 30px 22px 40px;
    justify-content: flex-start;
  }
  .login-panel::before { display: none; }
  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 372px;
    margin: 0 auto 32px;
  }
  .login-mobile-brand img { width: 40px; height: 40px; border-radius: 11px; }
  .login-mobile-brand b { display: block; font-size: 15px; letter-spacing: 0.1em; }
  .login-mobile-brand span { display: block; font-size: 8.5px; letter-spacing: 0.22em; color: var(--muted-2); }
  .login-card { margin-top: auto; margin-bottom: auto; }
  .login-copyright { margin-top: 26px; }
  .topbar-date { display: none; }
  .view-full { display: block; overflow-y: auto; }
  .wb { display: flex; flex-direction: column; overflow: visible; height: auto; flex: none; min-height: 0; }
  .wb-products {
    display: flex;
    order: 0;
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .wb-products .pane-head { height: 46px; }
  .wb-products .product-tools { padding: 8px 12px 4px; }
  .wb-products .category-chips { display: none; }
  .wb-products .product-search input { height: 32px; }
  .wb-products .product-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 9px;
    padding: 8px 12px 12px;
    flex: 0 0 auto;
  }
  .wb-products .product-card {
    flex: 0 0 104px;
    display: block;
    padding: 4px;
  }
  .wb-products .product-thumb { width: 100%; }
  .wb-products .product-meta { padding: 5px 2px 1px; }
  .wb-stage { order: 1; flex: 0 0 auto; height: 520px; min-height: 0; }
  .wb-inspector { order: 2; flex: 0 0 auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .inspector-body { overflow: visible; }
  .stage-body { min-height: 0; }
  .stage-hint { display: none; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .designs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .modal-overlay { padding: 14px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 28px); }
  .toast-root { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 560px) {
  .topbar { height: 60px; padding: 0 13px; gap: 8px; }
  .topbar-title h1 { font-size: 15px; }
  .topbar-title p { display: none; }
  .topbar-right .topbar-divider { display: none; }
  .topbar-right .btn span { display: none; }
  .topbar-right .btn { padding: 0 10px; }
  .page { padding: 16px 13px 30px; }
  .page-head h2 { font-size: 20px; }
  .designs-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 24px; }
  .login-card h2 { font-size: 23px; }
  .demo-row { grid-template-columns: 1fr; }
  .wb-stage { min-height: 390px; }
  .stage-body { min-height: 300px; padding: 10px; }
  .stage-head { padding: 0 10px; }
  .stage-actions .btn span { display: none; }
  .stage-actions .btn { padding: 0 9px; }
  .zoom-control { display: none; }
  .inspector-tabs { position: sticky; top: 0; background: #fff; z-index: 4; }
  .modal-head { padding: 18px 18px 0; }
  .modal-body { padding: 16px 18px; }
  .modal-foot { padding: 14px 18px 18px; }
  .confirm-message { font-size: 13px; }
}

/* --- patches --- */
.product-meta { display: block; }
.product-name,
.product-cat { display: block; }
.icon-btn.spin .ico { animation: spin 0.8s linear infinite; }
.matte-preview canvas { width: 100%; height: 100%; }
.wb-pane { overflow: hidden; }

/* ============================================================
   Multi-layer / multi-zone additions
   ============================================================ */
.logo-layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.logo-layer {
  pointer-events: auto;
}
.layer-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.layer-card {
  flex: 0 0 92px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.layer-card:hover { border-color: var(--line-strong); }
.layer-card.is-active {
  border-color: var(--jade-500);
  box-shadow: 0 0 0 1px var(--jade-500);
  background: #fbfffd;
}
.layer-thumb {
  height: 46px;
  border-radius: 5px;
  border: 1px solid var(--fog-2);
  background-color: #f4f7f6;
  background-image:
    linear-gradient(45deg, #e8eeec 25%, transparent 25%, transparent 75%, #e8eeec 75%),
    linear-gradient(45deg, #e8eeec 25%, transparent 25%, transparent 75%, #e8eeec 75%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.layer-thumb img { max-width: 94%; max-height: 94%; object-fit: contain; }
.layer-name {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.layer-zone {
  display: block;
  font-size: 8.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  place-items: center;
  z-index: 2;
}
.layer-remove:hover { color: var(--danger); border-color: #f0d4d0; background: var(--danger-soft); }
.layer-remove .ico { width: 10px; height: 10px; }
.layer-add {
  height: 29px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #fcfdfd;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  white-space: nowrap;
}
.layer-add:hover { border-color: var(--jade-300); color: var(--jade-700); background: var(--jade-50); }
.layer-add:disabled { opacity: 0.4; pointer-events: none; }
.layer-add .ico { width: 12px; height: 12px; }
.layer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 7px;
}
.layer-hint { font-size: 9.5px; color: var(--muted-2); }
.zone-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.zone-tab {
  height: 27px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.zone-tab:hover { border-color: var(--line-strong); color: var(--text); }
.zone-tab.is-active { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.zone-tab .zone-tab-count {
  font-size: 8.5px;
  opacity: 0.55;
}
.zone-overlays { position: absolute; inset: 0; pointer-events: none; }
.zone-rect.ghost {
  background: transparent;
  border: 1px dashed rgba(18, 181, 165, 0.55);
  box-shadow: none;
  pointer-events: none;
  cursor: default;
  opacity: 0.7;
}
.zone-rect.ghost::after {
  font-size: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}
.zone-editor-bar {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 9px;
}
.zone-editor-bar .input { height: 32px; font-size: 11.5px; flex: 1; min-width: 0; }
.zone-editor-bar .btn { height: 32px; font-size: 10.5px; }
.zone-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.zone-rect { pointer-events: auto; }
#layerPanel { margin-bottom: 12px; }

.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 13px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.guest-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid #d6ece6;
  background: linear-gradient(135deg, var(--jade-50), #fbfdfc);
  text-align: left;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.guest-entry:hover {
  border-color: var(--jade-300);
  box-shadow: 0 7px 18px -12px rgba(14, 158, 135, 0.4);
  background: linear-gradient(135deg, #e9faf5, #fbfdfc);
}
.guest-entry:disabled { opacity: 0.7; pointer-events: none; }
.guest-entry-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #d8f0ea;
  color: var(--jade-700);
  flex: 0 0 auto;
}
.guest-entry-icon .ico { width: 17px; height: 17px; }
.guest-entry-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.guest-entry-copy b { font-size: 12px; font-weight: 700; color: var(--text); }
.guest-entry-copy small { font-size: 9.5px; color: var(--muted); }
.guest-entry > .ico { width: 15px; height: 15px; color: var(--jade-500); flex: 0 0 auto; }
.guest-entry .spinner { width: 18px; height: 18px; border-color: rgba(18, 181, 165, 0.2); border-top-color: var(--jade-600); }

.guest-banner {
  flex: 0 0 auto;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 26px;
  background: #fdf8ec;
  border-bottom: 1px solid #f0e2c4;
  color: #7a6339;
  font-size: 11px;
  line-height: 1.5;
}
.guest-banner .ico { width: 14px; height: 14px; flex: 0 0 auto; color: #b47c25; }
.guest-banner b { color: #8a5f16; }
.guest-banner-expiry { margin-left: auto; white-space: nowrap; font-size: 10px; color: #9b7c47; }
@media (max-width: 900px) {
  .guest-banner { padding: 6px 14px; font-size: 10px; }
  .guest-banner-expiry { display: none; }
}

/* text layer editor */
.layer-name .ico {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 3px;
  vertical-align: -1px;
  color: var(--jade-700);
}
.layer-card.is-text .layer-thumb {
  background-color: #f7faf9;
}
.text-form { display: flex; flex-direction: column; gap: 13px; }
.text-content-input { min-height: 82px; font-size: 13.5px; }
.text-scan {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--jade-700);
  border: 0;
  background: transparent;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.text-scan:hover { color: var(--jade-600); }
.text-color-input {
  height: 41px;
  padding: 4px;
  cursor: pointer;
}
.text-font-custom {
  margin-top: 6px;
  font-size: 12px;
}
.text-preview {
  height: 174px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background-color: #f1f4f3;
  background-image:
    linear-gradient(45deg, #e5ebe9 25%, transparent 25%, transparent 75%, #e5ebe9 75%),
    linear-gradient(45deg, #e5ebe9 25%, transparent 25%, transparent 75%, #e5ebe9 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.text-preview canvas { display: block; max-width: 100%; max-height: 100%; }
.font-status { font-size: 10px; color: var(--muted-2); line-height: 1.65; }

.text-form .field > label.switch {
  justify-content: flex-start;
  width: auto;
  align-self: flex-start;
  gap: 8px;
}

/* font library */
.font-upload-card { margin-bottom: 16px; }
.font-upload-body {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}
.font-drop {
  min-height: 76px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  background: #fbfdfc;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.font-drop:hover { border-color: var(--jade-400); background: var(--jade-50); }
.font-drop-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--jade-700);
  flex: 0 0 auto;
}
.font-drop-icon .ico { width: 18px; height: 18px; }
.font-drop-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.font-drop-copy b { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-drop-copy small { font-size: 9.5px; color: var(--muted); line-height: 1.5; }
.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.font-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 5px 18px -18px rgba(20, 45, 38, 0.4);
}
.font-preview {
  min-height: 118px;
  padding: 18px 16px;
  background-color: #f5f8f7;
  background-image:
    linear-gradient(45deg, #e9efed 25%, transparent 25%, transparent 75%, #e9efed 75%),
    linear-gradient(45deg, #e9efed 25%, transparent 25%, transparent 75%, #e9efed 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.font-preview > span { font-size: 30px; line-height: 1.25; color: var(--text); }
.font-preview > small { font-size: 10px; color: var(--muted-2); letter-spacing: 0.04em; }
.font-card-body { padding: 11px 13px 12px; }
.font-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.font-card-title b { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-card-meta { font-size: 9.5px; color: var(--muted-2); margin-top: 4px; }
.font-card-actions { display: flex; justify-content: space-between; gap: 6px; margin-top: 10px; }
@media (max-width: 900px) {
  .font-upload-body { grid-template-columns: 1fr; }
}
