@font-face {
  font-family: "XinHammer Sans";
  src: url("/assets/fonts/xinhammer-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 350 750;
  font-display: swap;
}
@font-face {
  font-family: "XinHammer Logo CN";
  src: url("/assets/fonts/xinhammer-logo-cn.woff2") format("woff2");
  font-style: normal;
  font-weight: 860;
  font-display: swap;
}
@font-face {
  font-family: "XinHammer Logo EN";
  src: url("/assets/fonts/xinhammer-logo-en.woff2") format("woff2");
  font-style: normal;
  font-weight: 720;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  font-family: "XinHammer Sans", "PingFang SC", -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  background: #f5f7fc;
  --surface: #ffffff;
  --surface-soft: #f7f9fe;
  --blue: #2350dc;
  --ink: #0f172a;
  --muted: #5c667a;
  --line: rgba(15, 23, 42, .08);
  --shadow: 0 2px 6px rgba(15, 23, 42, .03), 0 14px 32px -16px rgba(15, 23, 42, .08);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.2, 0, 0, 1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 68% 36% at 82% 0%, rgba(59, 130, 246, .08), transparent 66%),
    radial-gradient(ellipse 46% 30% at 12% 4%, rgba(245, 158, 11, .06), transparent 62%),
    var(--bg-base, #f5f7fc);
  color: inherit;
}
a { color: var(--blue); touch-action: manipulation; }
button, select, input[type="text"], input[type="search"], textarea {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}
button, select { min-height: 40px; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .34rem;
  border: 1px solid rgba(15, 23, 42, .13);
  border-radius: .65rem;
  padding: .38rem .85rem;
  background: var(--surface);
  font-size: .88rem;
  font-weight: 540;
  cursor: pointer;
  transition:
    transform 150ms var(--ease-spring),
    background-color 180ms var(--ease-spring),
    border-color 180ms var(--ease-spring),
    color 180ms var(--ease-spring),
    box-shadow 200ms var(--ease-spring);
}
button:not(:disabled):active { transform: scale(0.97); transition-duration: 100ms; transition-timing-function: var(--ease-press); }
button:disabled, select:disabled { opacity: .5; cursor: default; }
button:not(:disabled):hover, select:not(:disabled):hover { border-color: rgba(35, 80, 220, .42); }
:focus-visible { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: min(68rem, calc(100% - 2rem)); margin-inline: auto; }

/* Sticky Frosted Topbar with Official Gradient Brand Logo */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: .9rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .58rem; text-decoration: none; min-height: 44px; flex: none; }
.brand-icon { width: 32px; height: 32px; flex: none; }
.brand-lockup { display: flex; flex-direction: column; line-height: 1.08; }
.brand-name {
  font: 860 1.15rem/1.08 "XinHammer Logo CN", var(--sans, sans-serif);
  letter-spacing: .018em;
  background: linear-gradient(102deg, #0f172a 16%, #1c3a94 62%, #2554e6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-en {
  font: 720 .7rem/1.15 "XinHammer Logo EN", var(--sans, sans-serif);
  letter-spacing: .035em;
  background: linear-gradient(100deg, #1e293b 16%, #224dd6 60%, #3b6ef5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-admin-tag {
  display: inline-flex;
  align-items: center;
  padding: .14rem .5rem;
  border-radius: 999px;
  border: 1px solid rgba(35, 80, 220, .18);
  background: rgba(35, 80, 220, .07);
  color: var(--blue);
  font-size: .72rem;
  font-weight: 620;
  letter-spacing: .02em;
}
.topbar-actions { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.topbar-health-pill {
  display: inline-flex; align-items: center; gap: .42rem; min-height: 34px; padding: .2rem .72rem;
  border-radius: 999px; border: 1px solid rgba(16, 185, 129, .24); background: rgba(16, 185, 129, .09);
  color: #047857; font-size: .78rem; font-weight: 580; text-decoration: none; white-space: nowrap;
}
.topbar-health-pill[data-warn="true"] {
  border-color: rgba(245, 158, 11, .36); background: rgba(245, 158, 11, .12); color: #b45309;
}
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); flex: none; }
.topbar-health-pill[data-warn="true"] .health-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.topbar-user-pill {
  display: inline-flex; align-items: center; min-height: 34px; padding: .2rem .7rem;
  border-radius: 999px; background: #eef2fa; color: #334155; font-size: .8rem; font-weight: 580; white-space: nowrap;
}
.topbar-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 .7rem;
  border-radius: .6rem; font-size: .86rem; font-weight: 560; text-decoration: none; white-space: nowrap;
  transition: background-color 180ms var(--ease-spring);
}
.topbar-link:hover { background: rgba(35, 80, 220, .08); }
.quiet { background: transparent; color: #536279; border-color: transparent; min-height: 36px; padding-inline: .65rem; font-size: .86rem; white-space: nowrap; }
.quiet:hover { color: #be123c; border-color: rgba(225, 29, 72, .24); background: rgba(225, 29, 72, .08); }

/* Workspace Header & Tabs */
main { padding-block: clamp(1.35rem, 3.8vw, 2.3rem) 4rem; }
h1, h2, h3, p { margin: 0; }
.workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.35rem;
}
.eyebrow {
  display: inline-flex;
  font-family: "XinHammer Logo EN", sans-serif;
  font-size: .72rem;
  font-weight: 720;
  letter-spacing: .08em;
  color: var(--blue);
  margin-bottom: .25rem;
}
h1 { font-size: clamp(1.65rem, 3.2vw, 2.25rem); font-weight: 680; letter-spacing: -.03em; line-height: 1.15; }
h2 { font-size: 1.16rem; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: .88rem; font-weight: 620; color: var(--muted); }

.sections {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .26rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 10px -4px rgba(15, 23, 42, .06);
}
.sections a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 38px;
  padding: .34rem .98rem;
  border-radius: 999px;
  text-decoration: none;
  color: #475569;
  font-size: .88rem;
  font-weight: 560;
  transition: background-color 180ms var(--ease-spring), color 180ms var(--ease-spring), transform 130ms var(--ease-spring);
}
.sections a:hover { color: var(--ink); }
.sections a:active { transform: scale(0.97); }
.sections .xh-seg-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: #111827;
  pointer-events: none;
  opacity: 0;
  transition: transform 240ms var(--ease-spring), width 240ms var(--ease-spring), height 240ms var(--ease-spring), opacity 160ms ease;
}
.sections a[aria-current="page"] { color: #ffffff; font-weight: 600; background: #111827; }
.sections[data-seg-ready="true"] a[aria-current="page"] { background: transparent; color: #ffffff; }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding-inline: .32rem;
  border-radius: 999px; background: #d97706; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.sections a[aria-current="page"] .tab-badge { background: #fde68a; color: #111827; }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, .24); }

/* Panels & KPI Overview */
.panel-group { display: grid; gap: 1.15rem; }
.panel {
  padding: clamp(1.1rem, 2.8vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel p, .status { margin-top: .34rem; color: var(--muted); font-size: .88rem; line-height: 1.62; }
.panel-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1.2rem; }
.header-btn-group, .quick-sort-group { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.subtle-btn { min-height: 36px; padding: .26rem .72rem; font-size: .82rem; background: var(--surface-soft); }
.inline-action-link { display: inline-flex; align-items: center; min-height: 36px; font-size: .86rem; font-weight: 580; text-decoration: none; }
.inline-action-link:hover { text-decoration: underline; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .95rem; }
.kpi-card {
  display: flex; flex-direction: column; gap: .32rem;
  padding: 1.1rem 1.2rem;
  border-radius: 1.2rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 180ms var(--ease-spring), border-color 180ms var(--ease-spring), box-shadow 180ms var(--ease-spring);
}
.kpi-card:hover { transform: translateY(-2px); border-color: rgba(35, 80, 220, .28); box-shadow: 0 18px 34px -16px rgba(35, 80, 220, .18); }
.kpi-card--amber { background: linear-gradient(155deg, #ffffff 0%, #fffbf2 100%); }
.kpi-card--blue { background: linear-gradient(155deg, #ffffff 0%, #f5f8ff 100%); }
.kpi-card--violet { background: linear-gradient(155deg, #ffffff 0%, #f8f5ff 100%); }
.kpi-card--emerald { background: linear-gradient(155deg, #ffffff 0%, #f2fbf7 100%); }
.kpi-label { font-size: .78rem; font-weight: 560; color: var(--muted); }
.kpi-value { font-size: clamp(1.45rem, 2.4vw, 1.85rem); font-weight: 700; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-sub { font-size: .78rem; color: var(--muted); line-height: 1.45; }

.overview-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr); gap: 1.15rem; align-items: start; }

/* Live 8-Service Health Grid */
.service-grid {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem;
}
.service-item {
  display: flex; flex-direction: column; gap: .38rem;
  padding: .82rem .92rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: var(--surface-soft);
}
.service-item[data-ok="false"] { border-color: rgba(225, 29, 72, .28); background: rgba(225, 29, 72, .04); }
.service-item-top { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
.service-name-wrap { display: inline-flex; align-items: center; gap: .44rem; min-width: 0; }
.service-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #10b981; }
.service-item[data-ok="false"] .service-dot { background: #e11d48; }
.service-name { font-size: .88rem; font-weight: 620; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-meta { font-size: .73rem; font-weight: 560; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.service-detail { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.service-links { display: flex; gap: .65rem; margin-top: auto; padding-top: .15rem; }
.service-links a { font-size: .76rem; font-weight: 560; text-decoration: none; }
.service-links a:hover { text-decoration: underline; }
.panel-foot-note { margin-top: 0 !important; font-size: .76rem !important; color: var(--muted); font-variant-numeric: tabular-nums; }
.health-foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .9rem; margin-top: .85rem; }
.host-memory-chip {
  display: inline-flex; align-items: center; padding: .16rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted);
  font-size: .74rem; font-weight: 560; font-variant-numeric: tabular-nums;
}
.host-memory-chip[data-warn="true"] { border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .12); color: #b45309; }
.auto-refresh-toggle {
  display: inline-flex; align-items: center; gap: .38rem; min-height: 36px; padding: .2rem .66rem;
  border-radius: .65rem; border: 1px solid var(--line); background: var(--surface-soft);
  font-size: .8rem; font-weight: 540; color: var(--muted); cursor: pointer; user-select: none;
}
.auto-refresh-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.auto-refresh-toggle:has(input:checked) { border-color: rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .09); color: #047857; }
.kbd-hint {
  display: inline-grid; place-items: center; min-width: 1.2rem; height: 1.2rem; padding-inline: .26rem;
  border: 1px solid var(--line); border-radius: .32rem; background: var(--surface-soft);
  color: var(--muted); font: 600 .68rem/1 "XinHammer Logo EN", monospace;
}

/* Command Hub */
.hub-group { margin-top: 1rem; }
.hub-group h3 { margin-bottom: .58rem; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.hub-links { display: grid; gap: .55rem; }
.hub-link {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: .68rem;
  padding: .72rem .88rem; border: 1px solid var(--line); border-radius: .95rem;
  background: var(--surface-soft); text-decoration: none; color: inherit;
  transition: border-color 160ms var(--ease-spring), background-color 160ms var(--ease-spring), transform 160ms var(--ease-spring);
}
.hub-link:hover { border-color: rgba(35, 80, 220, .3); background: #f0f5ff; transform: translateY(-1px); }
.hub-link[data-ok="false"] { border-color: rgba(225, 29, 72, .28); }
.hub-link img { border-radius: 7px; object-fit: contain; }
.hub-link-body { min-width: 0; display: block; }
.hub-link-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: .42rem; }
.hub-link strong { display: inline; font-size: .9rem; font-weight: 620; color: var(--ink); }
.hub-live-pill {
  display: inline-flex; align-items: center; gap: .26rem; padding: .08rem .46rem; border-radius: 999px;
  font-size: .68rem; font-weight: 620; font-variant-numeric: tabular-nums;
  background: #edf2fa; color: var(--muted); white-space: nowrap;
}
.hub-live-pill[data-ok="true"] { background: rgba(16, 185, 129, .12); color: #047857; }
.hub-live-pill[data-ok="true"]::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #10b981; }
.hub-live-pill[data-ok="false"] { background: rgba(225, 29, 72, .12); color: #be123c; }
.hub-live-pill[data-ok="false"]::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #e11d48; }
.hub-link em { display: block; font-style: normal; font-size: .76rem; color: var(--muted); margin-top: .16rem; line-height: 1.45; }
.hub-arrow { font-size: .9rem; color: var(--blue); font-weight: 600; }
.hub-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.hub-chips a {
  display: inline-flex; align-items: center; min-height: 34px; padding: .24rem .74rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft);
  color: var(--ink); font-size: .8rem; font-weight: 540; text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.hub-chips a:hover { border-color: rgba(35, 80, 220, .34); background: #eef4ff; color: var(--blue); }

/* Recent Unread List */
.recent-list { list-style: none; margin: .85rem 0 0; padding: 0; display: grid; gap: .55rem; }
.recent-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .4rem 1rem;
  padding: .75rem .95rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface-soft);
}
.recent-item-actions { display: inline-flex; align-items: center; gap: .38rem; flex-shrink: 0; }
.recent-item-actions .fb-done-btn { border-color: #bfe7ce; color: #0f6b3e; background: #f3fbf6; }
.recent-item-actions .fb-done-btn:hover { border-color: #0f6b3e; background: #e6f6ec; }
.recent-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem .5rem; font-size: .82rem; }
.recent-item-msg { margin-top: .25rem; font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-empty { padding: 1.1rem; text-align: center; border-radius: .9rem; background: var(--surface-soft); color: var(--muted); font-size: .88rem; }

/* Catalog Order Editor + Live Preview Strip */
.order-preview-wrap {
  margin-top: .95rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: .95rem;
  background: var(--surface-soft); display: flex; align-items: center; gap: .75rem; overflow-x: auto;
}
.order-preview-label { font-size: .76rem; font-weight: 600; color: var(--muted); white-space: nowrap; flex: none; }
.order-preview-strip { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .48rem; }
.order-preview-chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: .6rem; background: var(--surface); border: 1px solid var(--line); flex: none;
}
.order-preview-chip img { width: 24px; height: 24px; object-fit: contain; }
.order-preview-chip span {
  position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding-inline: 3px;
  border-radius: 999px; background: #111827; color: #fff; font-size: .62rem; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.order-preview-chip[data-moved="true"] { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(35, 80, 220, .18); }
.order-preview-chip[data-moved="true"] span { background: var(--blue); }

.controls {
  position: sticky; top: 60px; z-index: 8; display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  margin-top: .65rem; padding-block: .72rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.primary:not(:disabled) { background: #111827; color: #ffffff; border-color: #111827; font-weight: 600; }
.primary:not(:disabled):hover { background: #1f2937; border-color: #1f2937; }
#order-state { margin-left: auto; font-size: .84rem; font-weight: 560; color: var(--muted); }
#order-state[data-state="dirty"] { color: #b45309; }
#order-state[data-state="stale"] { color: #be123c; }

.status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .88rem; }
.status:empty { display: none; }
.status[data-tone="success"] {
  margin-top: .65rem; padding: .42rem .8rem; border-radius: .65rem;
  color: #047857; background: rgba(16, 185, 129, .12); font-weight: 540;
}
.status[data-tone="error"] {
  margin-top: .65rem; padding: .42rem .8rem; border-radius: .65rem;
  color: #be123c; background: rgba(225, 29, 72, .1); font-weight: 540;
}
.inline-undo-btn {
  min-height: 28px; padding: .1rem .58rem; margin-left: .25rem;
  border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font-size: .78rem; font-weight: 620;
}
.inline-undo-btn:hover { background: rgba(16, 185, 129, .14); }

.products, .feedback-list { padding: 0; margin: .45rem 0 0; list-style: none; }
.product-row {
  position: relative; display: grid; grid-template-columns: 2.65rem minmax(0, 1fr) auto;
  align-items: center; gap: .55rem; min-height: 3.85rem; padding: .35rem .3rem;
  border-bottom: 1px solid var(--line); border-radius: .7rem; scroll-margin-block: 8rem 1rem;
  transition: background-color 200ms var(--ease-spring), box-shadow 200ms var(--ease-spring);
}
.product-row:last-child { border-bottom: 0; }
.product-row.row-settled { animation: row-settle 650ms var(--ease-spring); }
@keyframes row-settle { 0% { background-color: rgba(35, 80, 220, .14); } 100% { background-color: transparent; } }
.product-info { display: flex; align-items: center; gap: .55rem; min-width: 0; flex-wrap: wrap; }
.product-rank {
  min-width: 1.65rem; text-align: center; font-family: "XinHammer Logo EN", sans-serif;
  font-size: .78rem; font-weight: 720; color: var(--muted); font-variant-numeric: tabular-nums;
}
.product-icon { width: 32px; height: 32px; border-radius: 8px; flex: none; object-fit: contain; }
.product-name { font-weight: 620; overflow-wrap: anywhere; }
.product-state-pill { font-size: .73rem; font-weight: 560; padding: .14rem .5rem; border-radius: 999px; background: #edf2fb; color: #355084; white-space: nowrap; }
.product-state-pill[data-tier="live"] { background: #e8f7ee; color: #0f6b3e; }
.product-delta { font-size: .72rem; font-weight: 660; padding: .1rem .44rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.product-delta[data-dir="up"] { background: rgba(16, 185, 129, .14); color: #047857; }
.product-delta[data-dir="down"] { background: rgba(245, 158, 11, .16); color: #b45309; }
.row-actions { display: flex; align-items: center; gap: .38rem; }
.row-visit {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: .55rem;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .85rem;
}
.row-visit:hover { border-color: rgba(35, 80, 220, .36); color: var(--blue); background: var(--surface-soft); }
.pin-top { min-height: 36px; padding: .22rem .62rem; font-size: .82rem; color: var(--blue); }
.handle { padding: 0; width: 42px; height: 42px; border-color: transparent; background: transparent; color: #586e92; cursor: grab; touch-action: none; user-select: none; }
.handle span { font: 1.35rem/1 system-ui, sans-serif; }
.dragging { position: relative; z-index: 10; border-radius: .75rem; background: #edf3ff; box-shadow: 0 12px 28px -8px rgba(15, 23, 42, .22), 0 0 0 1px rgba(35, 80, 220, .26); transition: none; }
.dragging .handle { cursor: grabbing; }
.product-row[data-drop]::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--blue); border-radius: 2px; pointer-events: none; }
.product-row[data-drop="before"]::after { top: -2px; }
.product-row[data-drop="after"]::after { bottom: -2px; }
.position {
  min-height: 36px; padding: .24rem 1.7rem .24rem .62rem; border: 1px solid rgba(15, 23, 42, .14); border-radius: .55rem; appearance: none; font-size: .84rem;
  background: linear-gradient(45deg, transparent 50%, #536279 50%) right .7rem center / 5px 5px no-repeat,
              linear-gradient(135deg, #536279 50%, transparent 50%) right .45rem center / 5px 5px no-repeat, var(--surface); cursor: pointer;
}

/* Inbox Toolbar, Search, Batch Bar & Notes */
.inbox-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; margin-top: .95rem; }
.inbox-filters { position: relative; isolation: isolate; display: inline-flex; flex-wrap: wrap; gap: .22rem; padding: .22rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); }
.inbox-filters .xh-seg-indicator { position: absolute; top: 0; left: 0; z-index: 0; border-radius: 999px; background: #111827; pointer-events: none; opacity: 0; transition: transform 240ms var(--ease-spring), width 240ms var(--ease-spring), height 240ms var(--ease-spring), opacity 160ms ease; }
.inbox-filters button { position: relative; z-index: 1; min-height: 34px; padding: .22rem .74rem; border: 0; border-radius: 999px; background: transparent; font-size: .82rem; font-weight: 560; color: #475569; }
.inbox-filters button:hover { color: var(--ink); }
.inbox-filters button[aria-pressed="true"] { background: #111827; color: #fff; }
.inbox-filters[data-seg-ready="true"] button[aria-pressed="true"] { background: transparent; color: #fff; }
.inbox-filters button span { opacity: .78; font-variant-numeric: tabular-nums; margin-left: .18rem; }

.inbox-search-wrap { flex: 1 1 13rem; max-width: 20rem; }
.inbox-search-wrap input {
  width: 100%; min-height: 38px; padding: .35rem .8rem;
  border: 1px solid rgba(15, 23, 42, .14); border-radius: 999px; background: var(--surface-soft); font-size: .86rem;
}
.inbox-search-wrap input:focus { background: var(--surface); border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(35, 80, 220, .14); }

.inbox-subtoolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem;
  margin-top: .65rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line);
}
.inbox-selects { display: flex; flex-wrap: wrap; gap: .45rem; }
.inbox-product-filter select {
  max-width: 100%; min-height: 36px; padding: .24rem 1.7rem .24rem .68rem;
  border: 1px solid rgba(15, 23, 42, .14); border-radius: .55rem; font-size: .84rem; background: var(--surface);
}
.batch-check-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); cursor: pointer; user-select: none; }
.batch-check-label input, .fb-select-check { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

.batch-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem;
  margin-top: .7rem; padding: .62rem .9rem; border-radius: .85rem;
  background: linear-gradient(135deg, #eef4ff, #f6f8ff); border: 1px solid rgba(35, 80, 220, .2);
}
.batch-bar strong { font-size: .86rem; color: #1d4ed8; }
.batch-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.batch-actions button { min-height: 34px; padding: .2rem .66rem; font-size: .8rem; }

.feedback-list li { display: grid; gap: .5rem; padding: 1rem .4rem; border-top: 1px solid var(--line); border-radius: .75rem; overflow-wrap: anywhere; }
.feedback-list li.row-settled { animation: row-settle 900ms var(--ease-spring); }
.feedback-list li:first-child { border-top: 0; }
.feedback-list li[data-status="archived"] { opacity: .72; }
.feedback-head { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .55rem; }
.feedback-head time { margin-left: auto; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.fb-tag { display: inline-flex; align-items: center; padding: .12rem .5rem; border-radius: 999px; font-size: .73rem; font-weight: 580; }
.fb-tag--cocreate { background: #fef3c7; color: #92400e; }
.fb-tag--feedback { background: #edf2fb; color: #24478f; }
.fb-tag--product { background: #eef6ff; color: #1d4ed8; }
.fb-tag--new { background: #fff1f2; color: #be123c; }
.fb-tag--done { background: #e8f7ee; color: #0f6b3e; }
.fb-tag--archived { background: #f1f5f9; color: #475569; }
.feedback-body { margin: 0; color: var(--ink); font-size: .92rem; white-space: pre-wrap; line-height: 1.68; }

.fb-note-display {
  padding: .55rem .78rem; border-radius: .7rem; border-left: 3px solid var(--blue);
  background: var(--surface-soft); font-size: .84rem; color: #334155; white-space: pre-wrap; line-height: 1.58;
}
.fb-note-display strong { color: var(--blue); font-weight: 620; margin-right: .35rem; }
.fb-note-editor { display: grid; gap: .45rem; padding: .68rem; border-radius: .75rem; background: var(--surface-soft); border: 1px solid var(--line); }
.fb-note-editor textarea {
  width: 100%; min-height: 4.5rem; padding: .5rem .68rem; border: 1px solid rgba(15, 23, 42, .14);
  border-radius: .55rem; background: var(--surface); resize: vertical; font-size: .86rem; line-height: 1.55;
}
.fb-note-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.fb-note-editor-actions button { min-height: 32px; padding: .18rem .65rem; font-size: .8rem; }

.feedback-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; margin-top: .1rem; }
.feedback-actions button { min-height: 34px; padding: .18rem .65rem; font-size: .8rem; border-radius: .5rem; }
.feedback-actions .fb-done-btn { border-color: #bfe7ce; color: #0f6b3e; background: #f3fbf6; }
.feedback-actions .fb-done-btn:hover { border-color: #0f6b3e; background: #e6f6ec; }
.feedback-actions .fb-delete-btn { color: var(--muted); }
.feedback-actions .fb-delete-btn[data-armed="true"] { border-color: #e11d48; background: #fff1f2; color: #be123c; font-weight: 640; }
button[data-copied="true"] { border-color: rgba(16, 185, 129, .45); background: rgba(16, 185, 129, .12); color: #047857; }

/* Notice Editor & Live Preview */
.notice-live-state {
  display: inline-flex; align-items: center; gap: .4rem; padding: .24rem .72rem;
  border-radius: 999px; font-size: .78rem; font-weight: 600; background: #f1f5f9; color: #475569;
}
.notice-live-state[data-live="true"] { background: rgba(16, 185, 129, .14); color: #047857; }
.notice-preview-shell {
  margin-top: 1.1rem; padding: 1rem 1.15rem; border-radius: 1rem; border: 1px dashed rgba(35, 80, 220, .24);
  background: var(--surface-soft); display: grid; gap: .6rem;
}
.notice-preview-caption { font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.notice-preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .7rem;
  padding: .62rem 1rem; border-radius: 999px; font-size: .86rem; font-weight: 520;
  border: 1px solid rgba(35, 80, 220, .18); background: linear-gradient(90deg, #eef4ff, #f5f3ff); color: #1e293b;
}
.notice-preview-bar[data-tone="amber"] {
  border-color: rgba(217, 119, 6, .24); background: linear-gradient(90deg, #fffbeb, #fff7ed); color: #78350f;
}
.notice-preview-bar[data-tone="emerald"] {
  border-color: rgba(16, 185, 129, .24); background: linear-gradient(90deg, #ecfdf5, #f0fdf4); color: #065f46;
}
.notice-preview-badge {
  padding: .12rem .52rem; border-radius: 999px; font-size: .72rem; font-weight: 680;
  background: #2350dc; color: #fff;
}
.notice-preview-bar[data-tone="amber"] .notice-preview-badge { background: #d97706; }
.notice-preview-bar[data-tone="emerald"] .notice-preview-badge { background: #059669; }
.notice-preview-link { font-weight: 640; color: var(--blue); text-decoration: underline; }
.notice-preview-bar[data-tone="amber"] .notice-preview-link { color: #b45309; }
.notice-preview-bar[data-tone="emerald"] .notice-preview-link { color: #047857; }

.notice-presets { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: 1rem; }
.notice-presets-label { font-size: .8rem; color: var(--muted); font-weight: 560; }
.notice-form { display: grid; gap: 1rem; margin-top: 1.1rem; }
.notice-toggle-row {
  display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; border-radius: .95rem;
  border: 1px solid var(--line); background: var(--surface-soft); cursor: pointer;
}
.notice-toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.notice-toggle-track {
  position: relative; width: 44px; height: 24px; border-radius: 999px; background: #cbd5e1; flex: none;
  transition: background-color 180ms var(--ease-spring);
}
.notice-toggle-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
  transition: transform 180ms var(--ease-spring);
}
.notice-toggle-row input:checked + .notice-toggle-track { background: #10b981; }
.notice-toggle-row input:checked + .notice-toggle-track::after { transform: translateX(20px); }
.notice-toggle-copy { display: flex; flex-direction: column; gap: .12rem; }
.notice-toggle-copy strong { font-size: .92rem; font-weight: 620; color: var(--ink); }
.notice-toggle-copy span { font-size: .78rem; color: var(--muted); }

.notice-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.notice-field { display: grid; gap: .36rem; }
.notice-field label { font-size: .82rem; font-weight: 580; color: var(--ink); }
.notice-label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.notice-char-count { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.notice-field input, .notice-field select {
  width: 100%; min-height: 40px; padding: .4rem .75rem;
  border: 1px solid rgba(15, 23, 42, .14); border-radius: .65rem; background: var(--surface); font-size: .88rem;
}
.notice-field input:focus, .notice-field select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(35, 80, 220, .14); }
.notice-quick-urls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); }
.notice-quick-urls button { min-height: 28px; padding: .15rem .58rem; border-radius: 999px; font-size: .75rem; background: var(--surface-soft); }
.notice-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; }
.notice-updated-meta { font-size: .8rem; color: var(--muted); }

/* Access Card (Unauthenticated /admin/) */
.access-shell { min-height: 100dvh; display: grid; place-items: center; padding-block: 2rem; }
.access-card {
  width: min(26rem, 100%); padding: 2rem; border-radius: 1.4rem;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 1rem; justify-items: start;
}
.access-status { color: var(--muted); font-size: .92rem; line-height: 1.65; }
.access-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.xh-check-svg { flex: none; display: inline-block; }
.xh-check-svg path { stroke-dasharray: 22; stroke-dashoffset: 0; animation: xh-check-draw 260ms var(--ease-spring) both; }
@keyframes xh-check-draw { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }
.xh-spinner { display: inline-block; width: .88em; height: .88em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: xh-spin 680ms linear infinite; }
@keyframes xh-spin { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
  :root {
    color: #f1f5f9;
    --bg-base: #0b0f19;
    --surface: #131b2c;
    --surface-soft: #0f1625;
    --blue: #7aa2ff;
    --ink: #f8fafc;
    --muted: #9aa7bd;
    --line: rgba(255, 255, 255, .09);
    --shadow: 0 18px 42px -18px rgba(0, 0, 0, .6);
  }
  .topbar { background: rgba(11, 15, 25, .86); }
  .brand-name { background: linear-gradient(102deg, #ffffff 18%, #bfdbfe 65%, #7aa2ff 100%); -webkit-background-clip: text; background-clip: text; }
  .brand-en { background: linear-gradient(100deg, #e2e8f0 16%, #93c5fd 62%, #60a5fa 100%); -webkit-background-clip: text; background-clip: text; }
  .brand-admin-tag { border-color: rgba(122, 162, 255, .28); background: rgba(122, 162, 255, .14); color: #93c5fd; }
  .topbar-user-pill { background: rgba(255, 255, 255, .08); color: #e2e8f0; }
  .topbar-health-pill { background: rgba(16, 185, 129, .14); border-color: rgba(52, 211, 153, .3); color: #6ee7b7; }
  .topbar-health-pill[data-warn="true"] { background: rgba(245, 158, 11, .16); border-color: rgba(251, 191, 36, .35); color: #fcd34d; }
  .topbar-link:hover { background: rgba(122, 162, 255, .14); }
  button, .position, .inbox-product-filter select, .inbox-search-wrap input, .notice-field input, .notice-field select, .fb-note-editor textarea { border-color: rgba(255, 255, 255, .14); }
  .position {
    background: linear-gradient(45deg, transparent 50%, #9aa7bd 50%) right .7rem center / 5px 5px no-repeat,
                linear-gradient(135deg, #9aa7bd 50%, transparent 50%) right .45rem center / 5px 5px no-repeat, var(--surface);
  }
  .quiet { color: #9aa7bd; border-color: transparent; }
  .quiet:hover { color: #fda4af; border-color: rgba(244, 63, 94, .35); background: rgba(244, 63, 94, .14); }
  .sections { background: rgba(19, 27, 44, .92); }
  .sections .xh-seg-indicator { background: #f8fafc; }
  .sections a { color: #9aa7bd; }
  .sections a[aria-current="page"] { background: #f8fafc; color: #0b0f19; }
  .sections[data-seg-ready="true"] a[aria-current="page"] { background: transparent; color: #0b0f19; }
  .sections a[aria-current="page"] .tab-badge { background: #d97706; color: #fff; }
  .host-memory-chip[data-warn="true"] { border-color: rgba(251, 191, 36, .35); background: rgba(245, 158, 11, .16); color: #fcd34d; }
  .auto-refresh-toggle:has(input:checked) { border-color: rgba(52, 211, 153, .35); background: rgba(16, 185, 129, .15); color: #6ee7b7; }
  .hub-live-pill { background: rgba(255, 255, 255, .08); color: #9aa7bd; }
  .hub-live-pill[data-ok="true"] { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
  .hub-live-pill[data-ok="false"] { background: rgba(244, 63, 94, .2); color: #fda4af; }
  .recent-item-actions .fb-done-btn { border-color: rgba(52, 211, 153, .35); color: #6ee7b7; background: rgba(16, 185, 129, .12); }
  .recent-item-actions .fb-done-btn:hover { background: rgba(16, 185, 129, .22); }
  .kpi-card--amber { background: linear-gradient(155deg, #171f33 0%, #211b19 100%); }
  .kpi-card--blue { background: linear-gradient(155deg, #141d33 0%, #15223d 100%); }
  .kpi-card--violet { background: linear-gradient(155deg, #171d33 0%, #201933 100%); }
  .kpi-card--emerald { background: linear-gradient(155deg, #131e30 0%, #112426 100%); }
  .hub-link:hover { background: rgba(122, 162, 255, .12); border-color: rgba(122, 162, 255, .36); }
  .hub-chips a:hover { background: rgba(122, 162, 255, .14); color: #93c5fd; }
  .order-preview-chip span { background: #f8fafc; color: #0b0f19; }
  .primary:not(:disabled) { background: #f8fafc; color: #0b0f19; border-color: #f8fafc; }
  .primary:not(:disabled):hover { background: #ffffff; border-color: #ffffff; }
  .dragging { background: #1a2744; box-shadow: 0 14px 32px rgba(0, 0, 0, .55), 0 0 0 1px rgba(122, 162, 255, .4); }
  .product-state-pill { background: rgba(122, 162, 255, .15); color: #93b8ff; }
  .product-state-pill[data-tier="live"] { background: rgba(16, 185, 129, .16); color: #6ee7b7; }
  .product-delta[data-dir="up"] { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
  .product-delta[data-dir="down"] { background: rgba(245, 158, 11, .2); color: #fcd34d; }
  .inbox-filters .xh-seg-indicator { background: #f8fafc; }
  .inbox-filters button { color: #9aa7bd; }
  .inbox-filters button[aria-pressed="true"] { background: #f8fafc; color: #0b0f19; }
  .inbox-filters[data-seg-ready="true"] button[aria-pressed="true"] { background: transparent; color: #0b0f19; }
  .batch-bar { background: rgba(59, 130, 246, .14); border-color: rgba(96, 165, 250, .3); }
  .batch-bar strong { color: #93c5fd; }
  .fb-note-display { color: #cbd5e1; }
  .fb-tag--cocreate { background: rgba(245, 158, 11, .18); color: #fcd34d; }
  .fb-tag--feedback { background: rgba(122, 162, 255, .16); color: #93b8ff; }
  .fb-tag--product { background: rgba(59, 130, 246, .18); color: #93c5fd; }
  .fb-tag--new { background: rgba(244, 63, 94, .18); color: #fda4af; }
  .fb-tag--done { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
  .fb-tag--archived { background: rgba(255, 255, 255, .09); color: #94a3b8; }
  .feedback-actions .fb-done-btn { border-color: rgba(52, 211, 153, .35); color: #6ee7b7; background: rgba(16, 185, 129, .12); }
  .feedback-actions .fb-done-btn:hover { background: rgba(16, 185, 129, .22); }
  .feedback-actions .fb-delete-btn[data-armed="true"] { background: rgba(225, 29, 72, .22); color: #fda4af; }
  .notice-live-state { background: rgba(255, 255, 255, .08); color: #cbd5e1; }
  .notice-live-state[data-live="true"] { background: rgba(16, 185, 129, .2); color: #6ee7b7; }
  .notice-preview-bar { background: linear-gradient(90deg, rgba(37, 84, 230, .24), rgba(109, 74, 255, .2)); border-color: rgba(122, 162, 255, .32); color: #f8fafc; }
  .notice-preview-bar[data-tone="amber"] { background: linear-gradient(90deg, rgba(217, 119, 6, .24), rgba(245, 158, 11, .16)); border-color: rgba(251, 191, 36, .35); color: #fef3c7; }
  .notice-preview-bar[data-tone="emerald"] { background: linear-gradient(90deg, rgba(5, 150, 105, .24), rgba(16, 185, 129, .16)); border-color: rgba(52, 211, 153, .34); color: #d1fae5; }
  .notice-preview-link { color: #93c5fd; }
  .notice-preview-bar[data-tone="amber"] .notice-preview-link { color: #fde68a; }
  .notice-preview-bar[data-tone="emerald"] .notice-preview-link { color: #6ee7b7; }
  .notice-toggle-track { background: #334155; }
  .status[data-tone="success"] { color: #6ee7b7; background: rgba(16, 185, 129, .16); }
  .status[data-tone="error"] { color: #fda4af; background: rgba(244, 63, 94, .18); }
  button[data-copied="true"] { color: #6ee7b7; background: rgba(16, 185, 129, .18); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .xh-spinner { display: none !important; }
}

@media (max-width: 58rem) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-split { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .topbar-inner { gap: .38rem; min-height: 56px; }
  .brand { gap: .42rem; }
  .brand-icon { width: 26px; height: 26px; }
  .brand-name { font-size: .96rem; }
  .brand-en { font-size: .62rem; }
  .topbar-actions { gap: .18rem; flex-shrink: 0; }
  .topbar-user-pill, .brand-admin-tag, .kbd-hint, .topbar-health-pill .health-label-full { display: none; }
  .topbar-health-pill { min-height: 28px; padding: .12rem .48rem; font-size: .72rem; gap: .3rem; }
  .topbar-link, .quiet { padding-inline: .38rem; font-size: .78rem; }
  .service-grid, .notice-field-row { grid-template-columns: 1fr; }
  .recent-item { grid-template-columns: 1fr; }
  .recent-item-actions { justify-content: flex-end; }
  .sections { width: 100%; border-radius: 1rem; justify-content: space-between; }
  .sections a { flex: 1 1 auto; justify-content: center; padding-inline: .55rem; font-size: .82rem; }
  .product-row { grid-template-columns: 2.3rem minmax(0, 1fr); gap: .35rem .45rem; padding-block: .5rem; }
  .row-actions { grid-column: 2; justify-self: end; }
  .product-state-pill { display: none; }
  .pin-top { padding: .2rem .55rem; font-size: .8rem; }
  .inbox-filters { border-radius: 1rem; }
  .inbox-search-wrap { max-width: none; width: 100%; }
  #order-state { margin-left: 0; }
  .controls button { padding-inline: .6rem; }
  .feedback-head time { margin-left: 0; flex-basis: 100%; }
}
