:root {
  color-scheme: dark;
  --bg: #06101c;
  --panel: rgba(8, 20, 34, .92);
  --panel-2: rgba(13, 31, 51, .94);
  --panel-3: rgba(18, 49, 76, .92);
  --line: #245274;
  --line-soft: rgba(54, 151, 190, .22);
  --text: #e7f8ff;
  --muted: #93b8cc;
  --accent: #20d5df;
  --accent-2: #1478dc;
  --gold: #f4c247;
  --danger: #742638;
  --green-card: #0c493f;
  --vault-blue: #0b83d8;
  --vault-cyan: #23e7e6;
  --vault-gold: #f0b938;
  --glass: rgba(8, 20, 34, .78);
  --scroll-track: rgba(9, 25, 42, .58);
  --scroll-thumb: #1f80a6;
  --scroll-thumb-hover: #20d5df;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

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

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  min-height: 42px;
  border: 2px solid var(--scroll-track);
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--scroll-thumb-hover) 36%, white), var(--scroll-thumb));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--scroll-thumb-hover) 48%, white), var(--scroll-thumb-hover));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  min-width: 1180px;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 4%, rgba(35, 231, 230, .18), transparent 28%),
    radial-gradient(circle at 19% 10%, rgba(20, 120, 220, .22), transparent 30%),
    linear-gradient(180deg, rgba(6, 16, 28, .86), rgba(6, 11, 20, .96)),
    url("/ktv-banner.png") center top / 1340px auto no-repeat,
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 25, 42, .92);
  color: var(--text);
}

button {
  min-height: 29px;
  padding: 0 12px;
  color: #dffbf6;
  background: linear-gradient(180deg, rgba(21, 91, 129, .92), rgba(9, 29, 48, .96));
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

button:hover {
  border-color: var(--vault-cyan);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 0 1px rgba(35, 231, 230, .12),
    0 0 16px rgba(35, 231, 230, .10);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

input,
select {
  height: 31px;
  padding: 0 10px;
}

textarea {
  min-height: 62px;
  padding: 12px;
  resize: vertical;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
}

h2 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

small,
time,
label,
em {
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(700px, 1fr) 390px;
  gap: 8px;
  height: 100vh;
  padding: 8px;
  overflow-x: auto;
  overflow-y: hidden;
}

.app-shell[hidden] {
  display: none;
}

.sidebar,
.workspace {
  min-width: 0;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: calc(100vh - 16px);
  overflow: hidden;
}

.left-panel,
.right-panel,
.chat-card,
.links-panel,
.metric {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(9, 23, 39, .94), rgba(7, 17, 30, .91));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 28px rgba(0, 0, 0, .16);
  backdrop-filter: blur(3px);
}

.left-panel,
.right-panel {
  padding: 9px;
}

.left-panel {
  grid-template-rows: auto 352px minmax(0, 1fr);
}

.right-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: stretch;
}

.panel-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 5px 8px;
  border: 1px solid rgba(35, 231, 230, .20);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(35, 231, 230, .12), transparent 38%),
    rgba(5, 15, 27, .78);
}

.panel-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 18px rgba(35, 231, 230, .18);
}

.logo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-tool {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(35, 231, 230, .45);
  border-radius: 999px;
  background: rgba(9, 28, 47, .72);
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 5px 16px rgba(0,0,0,.18);
}

.icon-tool:hover {
  border-color: rgba(39, 245, 213, .78);
  background: rgba(14, 56, 78, .85);
}

.danger-icon-tool {
  border-color: rgba(255, 86, 126, .46);
  color: #ff5f87;
}

.danger-icon-tool:hover {
  border-color: rgba(255, 86, 126, .82);
  background: rgba(86, 18, 43, .72);
}

.panel-logo strong,
.panel-logo span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-logo strong {
  color: #f2f8ff;
  font-size: 12px;
  line-height: 1.1;
}

.panel-logo span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.pill-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-height: 25px;
  padding: 3px 5px;
  border: 1px solid rgba(35, 231, 230, .30);
  border-radius: 999px;
  background: rgba(5, 15, 27, .70);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}

.pill-row span,
.live-dot,
.badge {
  border: 1px solid rgba(33, 201, 167, .35);
  border-radius: 999px;
  background: rgba(35, 231, 230, .10);
  color: var(--accent);
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-row .health-summary {
  flex: 1 1 auto;
  text-align: left;
  text-transform: none;
}

.header-health {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(720px, 72%);
  justify-content: flex-start;
  border-radius: 10px;
  border-color: rgba(35, 231, 230, .42);
  background: rgba(5, 15, 27, .58);
  backdrop-filter: blur(4px);
}

.header-health span {
  flex: 0 0 auto;
}

.header-health .health-summary {
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  text-transform: none;
}

.pill-row span.inactive {
  border-color: rgba(255, 108, 139, .4);
  background: rgba(255, 108, 139, .08);
  color: #ff8ea3;
}

.side-section {
  display: grid;
  gap: 6px;
  min-height: 0;
}

.price-section {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 18px;
}

.section-title strong {
  font-size: 13px;
}

.customer-list,
.price-list {
  display: grid;
  gap: 5px;
  overflow: auto;
  padding-right: 3px;
}

.customer-list {
  max-height: 266px;
}

.customer-list.expanded {
  max-height: 266px;
}

.price-list {
  min-height: 0;
}

.customer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  text-align: left;
  align-items: center;
  border-color: rgba(35, 231, 230, .17);
  background: linear-gradient(180deg, rgba(13, 43, 68, .88), rgba(9, 28, 47, .92));
}

.customer.active {
  border-color: rgba(35, 231, 230, .62);
  background:
    linear-gradient(90deg, rgba(35, 231, 230, .16), transparent 52%),
    var(--panel-3);
}

.customer span {
  min-width: 0;
}

.customer strong,
.price-list strong,
.rank-list strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f0f6ff;
}

.customer em {
  font-style: normal;
  font-size: 10px;
}

.customer strong {
  font-size: 11px;
}

.customer-tag {
  display: inline;
  max-width: 86px;
  margin-left: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  line-height: inherit;
}

.wide-button {
  width: 100%;
  background: var(--panel-3);
}

.customer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.subtle-button {
  min-height: 28px;
  color: #d3e2f6;
  font-size: 11px;
}

.market-watch {
  margin-top: 4px;
  gap: 5px;
  min-height: 0;
  overflow: hidden;
}

.market-watch .section-title {
  min-height: 14px;
}

.market-watch h2 {
  color: #c9d9ef;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
}

.g2g-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 6px;
}

.g2g-actions {
  gap: 3px;
}

.g2g-actions button {
  height: 20px;
  min-height: 20px;
  padding: 0 5px;
  font-size: 8.5px;
}

.market-watch select {
  height: 32px;
  border-radius: 7px;
  border-color: #23324a;
  background: #0b121e;
  color: #f5fbff;
  font-size: 13px;
  font-weight: 800;
}

.mini-actions,
.tracker-actions,
.tracker-picker,
.tool-grid {
  display: grid;
  gap: 6px;
}

.mini-actions {
  grid-template-columns: 72px 1fr;
  align-items: center;
}

.tracker-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
}

.tracker-actions button {
  padding: 0 4px;
  font-size: 9.5px;
  letter-spacing: 0;
  white-space: nowrap;
}

.tracker-picker {
  grid-template-columns: 1fr;
  align-items: center;
}

.tracker-picker button {
  width: 100%;
}

.tracker-actions small {
  grid-column: 1 / -1;
}

.tool-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.tool-grid button {
  min-height: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tool-grid .danger-tool {
  border-color: rgba(255, 108, 139, .38);
  background: linear-gradient(180deg, #402033, #1d1420);
  color: #ffc7d2;
}

.listing-management-list {
  display: grid;
  gap: 8px;
}

.listing-management-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 110px 100px 190px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.listing-management-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.listing-management-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-management-main small {
  color: var(--muted);
}

.listing-management-main a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  width: fit-content;
}

.listing-management-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.listing-management-row input {
  width: 100%;
  min-width: 0;
}

.listing-management-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.listing-management-actions button {
  min-width: 0;
  white-space: nowrap;
}

body.compact-mode .card,
body.compact-mode .side-section,
body.compact-mode .chat-tools,
body.compact-mode .links-panel {
  padding-top: 6px;
  padding-bottom: 6px;
}

body.compact-mode .message {
  padding: 7px 9px;
}

body[data-theme="emerald"] {
  --accent: #4ff0b4;
  --accent-strong: #10b981;
  --line: #184d42;
}

body[data-theme="steel"] {
  --accent: #93c5fd;
  --accent-strong: #3b82f6;
  --line: #29425f;
}

.mini-actions button,
.tracker-actions button,
.tracker-picker button,
.g2g-filter-row button {
  height: 28px;
  min-height: 28px;
  border-radius: 8px;
  color: #d8e8fb;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(180deg, #1b2a40, #111a28);
}

.g2g-filter-row button {
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  color: #23e0bb;
  border-color: rgba(33, 201, 167, .4);
}

.rank-list {
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
  max-height: none;
  min-height: 0;
  align-content: start;
  overflow: auto;
  padding-right: 3px;
}

.rank-list li,
.store-grid article,
.price-list article {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(35, 231, 230, .06), transparent 38%),
    var(--panel-2);
  padding: 9px;
}

.rank-list li {
  min-height: 56px;
  border-color: rgba(54, 151, 190, .24);
  background:
    linear-gradient(135deg, rgba(35, 231, 230, .08), rgba(20, 120, 220, .05) 42%, rgba(240, 185, 56, .04)),
    linear-gradient(180deg, rgba(16, 35, 55, .96), rgba(8, 22, 38, .96));
  padding: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 1px 3px rgba(0,0,0,.22);
}

.rank-list li a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.rank-store .g2g-store-link {
  display: inline-block;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.rank-list li:hover {
  border-color: rgba(35, 231, 230, .52);
}

.rank-main {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 4px;
  align-items: start;
}

.rank-main em {
  color: #7f91aa;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
}

.rank-store {
  min-width: 0;
}

.rank-store strong {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 900;
}

.rank-store small {
  display: block;
  width: max-content;
  max-width: 120px;
  margin-top: 3px;
  padding: 1px 6px;
  border: 1px solid #263f5d;
  border-radius: 999px;
  background: #15243a;
  color: #c4d7ec;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.rank-price {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 54px;
  text-align: right;
}

.rank-list span,
.price-list b,
.store-grid b {
  color: var(--accent);
  font-weight: 800;
}

.rank-list span {
  font-size: 11px;
  font-weight: 900;
}

.rank-price small {
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.market-note {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8193ad;
  font-size: 10px;
  font-weight: 800;
  min-height: 0;
}

.market-note:empty {
  display: none;
}

.mini-actions .market-note {
  text-align: right;
  color: var(--accent);
  font-size: 10px;
}

.tracker-actions small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-picker select {
  height: 28px;
  font-size: 11px;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) minmax(146px, 178px);
  gap: 5px;
  min-height: 0;
  max-height: calc(100vh - 16px);
  overflow: hidden;
}

.dashboard-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 72px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 13, 21, .38), rgba(8, 13, 21, .08) 48%, rgba(8, 13, 21, .34)),
    url("/ktv-banner.png") center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.dashboard-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8,13,21,.02), rgba(8,13,21,.14));
}

.dashboard-header > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand strong {
  color: #ecf2ff;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,.75);
}

.brand strong::first-letter {
  color: var(--accent);
}

.brand-logo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 20px;
  border: 1px solid rgba(33, 201, 167, .45);
  border-radius: 6px;
  background: linear-gradient(180deg, #123d34, #0d1726);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.metrics {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  gap: 5px;
}

.metric {
  background:
    linear-gradient(135deg, rgba(35, 231, 230, .08), transparent 44%),
    rgba(9, 20, 34, .90);
  min-height: 48px;
  border-radius: 8px;
  padding: 6px 10px;
}

.metric.danger {
  cursor: pointer;
}

.metric.danger:hover {
  border-color: rgba(255, 108, 139, .68);
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  color: #f8fbff;
  line-height: 1.05;
}

.metric span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.metric small {
  font-size: 10px;
  line-height: 1;
}

.metric.danger {
  background:
    linear-gradient(135deg, rgba(240, 185, 56, .10), transparent 46%),
    rgba(47, 15, 26, .92);
  border-color: rgba(240, 185, 56, .35);
}

.metric.danger strong {
  color: #ff6d8d;
}

.chat-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
}

.chat-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 145px 145px auto;
  gap: 7px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #0a101b;
}

.chat-toolbar h1 {
  font-size: 15px;
  line-height: 1.05;
}

.chat-toolbar label {
  display: grid;
  gap: 3px;
  font-size: 9px;
  text-transform: uppercase;
}

.chat-toolbar input,
.chat-toolbar select {
  height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.tag-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 5px;
  margin-top: 4px;
  max-width: 260px;
}

.tag-editor input {
  height: 26px;
}

.tag-editor button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.chat-toolbar .live-dot {
  padding: 3px 6px;
  font-size: 8px;
}

.status {
  min-height: 34px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}

.status:empty {
  display: none;
}

.status.danger {
  color: #ff8ea3;
}

.conversation-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.conversation {
  display: grid;
  align-content: start;
  gap: 5px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 8px 10px;
  background:
    radial-gradient(circle at 80% 8%, rgba(35, 231, 230, .08), transparent 24%),
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 42px;
}

.jump-latest {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 4;
  min-height: 26px;
  padding: 0 10px;
  border-color: rgba(33, 201, 167, .45);
  border-radius: 999px;
  background: #123d34;
  color: #dffbf6;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}

.bubble {
  max-width: 58%;
  border: 1px solid rgba(54, 151, 190, .26);
  border-radius: 7px;
  padding: 6px 8px;
}

.bubble strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 10px;
}

.bubble p {
  line-height: 1.32;
  font-size: 12px;
}

.bubble.incoming {
  justify-self: start;
  background: linear-gradient(180deg, rgba(13, 36, 57, .96), rgba(9, 25, 42, .96));
}

.bubble.outgoing {
  justify-self: end;
  background: var(--green-card);
  border-color: rgba(35, 231, 230, .28);
}

.bubble.system {
  justify-self: center;
  max-width: 78%;
  background: #1a2030;
  border-color: #33415d;
  color: #d8e8fb;
}

.bubble.system strong {
  color: #ffd27a;
}

.quick-replies-bar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  max-height: 46px;
  padding: 3px 8px;
  border-top: 1px solid var(--line-soft);
  background: #0a101b;
}

.quick-replies {
  display: grid;
  grid-template-rows: 18px 20px;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.quick-reply-categories,
.quick-reply-options {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.quick-replies button,
.quick-reply-categories button,
.quick-reply-options button {
  flex: 0 0 auto;
  height: 20px;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(15, 82, 73, .98), rgba(8, 55, 50, .98));
  border-color: rgba(35, 231, 230, .28);
}

.quick-reply-categories button {
  height: 18px;
  min-height: 18px;
  padding: 0 6px;
  font-size: 8.5px;
  background: linear-gradient(180deg, rgba(21, 91, 129, .92), rgba(9, 29, 48, .96));
}

.quick-replies button.active,
.quick-reply-categories button.active,
.quick-reply-options button.active {
  border-color: rgba(33, 201, 167, .75);
  color: #ffffff;
}

.quick-reply-actions {
  display: flex;
  gap: 4px;
}

.quick-reply-actions button {
  height: 20px;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 8.5px;
  font-weight: 800;
}

.reply {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--line-soft);
  background: #0a101b;
}

.reply textarea {
  min-height: 38px;
  max-height: 56px;
  padding: 8px 10px;
  resize: none;
  font-size: 12px;
}

.reply button {
  min-height: 38px;
  height: 38px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.reply input[type="hidden"] {
  display: none;
}

.links-panel {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  padding: 7px 10px 9px;
  min-height: 0;
  overflow: hidden;
}

.links-title {
  min-height: 24px;
}

.link-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.link-actions button {
  height: 24px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
}

.quick-links button {
  height: 24px;
  min-height: 24px;
  padding: 0 7px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-links button.active {
  border-color: rgba(240, 185, 56, .60);
  background: linear-gradient(180deg, rgba(29, 93, 89, .98), rgba(12, 54, 57, .98));
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.store-grid article {
  display: grid;
  gap: 3px;
  padding: 6px;
  border-radius: 7px;
}

.store-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.store-card-head strong {
  font-size: 10px;
  line-height: 1.1;
}

.store-card-head button {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border-color: rgba(255, 108, 139, .38);
  border-radius: 4px;
  color: #ffc7d2;
  font-size: 9px;
  line-height: 1;
  background: #2a1420;
}

.store-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.store-stats span {
  display: grid;
  gap: 1px;
  padding: 3px 5px;
  border: 1px solid #22334b;
  border-radius: 5px;
  background: #0f1a29;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.store-stats b {
  color: var(--accent);
  font-size: 10px;
  line-height: 1.1;
}

.price-title {
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #19314c;
}

.price-list {
  max-height: none;
}

.price-list article,
.price-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}

.price-list a {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 6px 7px;
}

.price-list strong {
  font-size: 10px;
  line-height: 1.15;
}

.price-list small,
.price-list a small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.2;
  color: #91a4bd;
}

.price-list b {
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.empty,
.empty-mini {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: var(--panel-2);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at top, rgba(33, 201, 167, .08), transparent 36%),
    var(--bg);
  background-size: 100% 42px, auto, auto;
}

.login-overlay[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 9px;
  width: min(320px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a101b;
  box-shadow: 0 18px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
}

.login-card strong {
  color: #f1f7ff;
  font-size: 17px;
}

.login-card span {
  margin-top: -4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-card input {
  height: 34px;
}

.login-card button {
  height: 32px;
  min-height: 32px;
  font-weight: 800;
}

.login-card small {
  min-height: 14px;
  color: #ff8ea3;
}

.panel-alert {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.panel-alert[hidden] {
  display: none;
}

.panel-alert-card {
  display: grid;
  gap: 12px;
  width: min(620px, 94vw);
  padding: 18px 22px;
  border: 2px solid rgba(255, 125, 132, .86);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(26, 40, 66, .97), rgba(13, 23, 39, .98)),
    #0a101b;
  box-shadow:
    0 18px 70px rgba(0,0,0,.58),
    0 0 0 1px rgba(255, 197, 197, .24),
    0 0 28px rgba(255, 82, 110, .22),
    inset 0 1px 0 rgba(255,255,255,.08);
  pointer-events: auto;
}

.panel-alert-card strong {
  display: block;
  margin-bottom: 2px;
  color: #fff6f2;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
}

.panel-alert-card small {
  display: block;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  font-weight: 800;
}

.panel-alert-card p {
  color: #f2f8ff;
  line-height: 1.35;
  font-size: 13px;
  font-weight: 900;
  white-space: pre-line;
}

.panel-alert-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel-alert-actions button {
  width: 100%;
  min-width: 0;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 950;
}

#goPanelAlert {
  border-color: rgba(80, 255, 176, .7);
  background: linear-gradient(180deg, #50f5a2, #20b875);
  color: #07301d;
  box-shadow: 0 0 18px rgba(57, 255, 164, .22);
}

#closePanelAlert {
  border-color: rgba(111, 158, 220, .38);
  background: linear-gradient(180deg, #18375b, #122741);
  color: #f2f8ff;
}

.panel-alert.tracking-alert .panel-alert-card {
  width: min(660px, 94vw);
}

.tool-row-action {
  justify-self: start;
  display: inline-grid;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(35, 224, 187, .5);
  border-radius: 6px;
  color: #dffff8;
  background: rgba(13, 75, 61, .75);
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 9, 15, .78);
}

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

.modal-card {
  width: min(760px, 96vw);
  max-height: 82vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a101b;
  box-shadow: 0 18px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
}

.tool-modal-card {
  width: min(980px, 94vw);
}

.tool-modal-card:has(.embedded-verification:not([hidden])) {
  width: min(1180px, 96vw);
}

.tool-modal-body {
  display: grid;
  gap: 10px;
  max-height: 72vh;
  overflow: auto;
  padding: 12px;
}

.embedded-verification {
  display: grid;
  gap: 8px;
  min-height: min(62vh, 560px);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #050b13;
  overflow: hidden;
}

.embedded-verification[hidden] {
  display: none;
}

.embedded-verification-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #0f1d30;
}

.embedded-verification-title strong {
  color: #fff;
  font-size: 12px;
}

.embedded-verification-title a {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.embedded-verification iframe {
  width: 100%;
  height: min(58vh, 520px);
  min-height: 360px;
  border: 0;
  background: #000;
}

.tool-table {
  display: grid;
  gap: 6px;
}

.tool-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101b2b;
}

.tool-row strong,
.tool-row span,
.tool-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-row span,
.tool-row small {
  color: var(--muted);
}

.tool-row b {
  color: var(--accent);
}

.report-product-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.report-product-row:hover {
  border-color: rgba(0, 245, 212, .45);
  background: #13243a;
}

.report-product-row strong,
.report-product-row span,
.report-product-row b,
.report-product-row small {
  grid-column: 1;
}

.report-product-detail-btn {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: stretch;
  min-width: 74px;
  font-size: 10px;
  font-weight: 950;
}

.report-sale-detail small {
  line-height: 1.45;
}

.report-cards,
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-grid {
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  max-height: min(68vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.theme-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  text-align: left;
}

.theme-choice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 11px;
}

.theme-choice.active {
  border-color: rgba(0, 174, 190, .65);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 13%, white), var(--theme-card-3));
}

.theme-swatch {
  display: block;
  width: 30px;
  height: 24px;
  border: 1px solid rgba(16, 34, 53, .14);
  border-radius: 7px;
  background: linear-gradient(135deg, #fff 0 45%, #eaf5ff 45% 70%, #00aebe 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.theme-ktv-green-price { background: linear-gradient(135deg, #fff 0 45%, #eaf5ff 45% 70%, #12a84f 70%); }
.theme-ice-vault { background: linear-gradient(135deg, #fbfdff 0 45%, #dff5ff 45% 70%, #00bcd4 70%); }
.theme-skyline { background: linear-gradient(135deg, #fff 0 45%, #dbefff 45% 70%, #1497d4 70%); }
.theme-aqua { background: linear-gradient(135deg, #fff 0 45%, #d5fbf5 45% 70%, #00a999 70%); }
.theme-pearl { background: linear-gradient(135deg, #fff 0 45%, #edf5fb 45% 70%, #2aaec2 70%); }
.theme-cloud { background: linear-gradient(135deg, #fff 0 45%, #e9f3fb 45% 70%, #5aa8d8 70%); }
.theme-mint { background: linear-gradient(135deg, #fff 0 45%, #dff8ea 45% 70%, #18ad72 70%); }
.theme-seafoam { background: linear-gradient(135deg, #fff 0 45%, #d9f7ef 45% 70%, #00a77d 70%); }
.theme-turquoise { background: linear-gradient(135deg, #fff 0 45%, #d4f6f8 45% 70%, #00aebe 70%); }
.theme-sapphire { background: linear-gradient(135deg, #fff 0 45%, #dfeaff 45% 70%, #2176d2 70%); }
.theme-royal { background: linear-gradient(135deg, #fff 0 45%, #e1e8ff 45% 70%, #356fe8 70%); }
.theme-cyber-sky { background: linear-gradient(135deg, #fff 0 45%, #d8f2ff 45% 70%, #00c7d9 70%); }
.theme-frost { background: linear-gradient(135deg, #fff 0 45%, #e7f2f7 45% 70%, #73aeca 70%); }
.theme-silver { background: linear-gradient(135deg, #fff 0 45%, #e7edf2 45% 70%, #6aa8bd 70%); }
.theme-platinum { background: linear-gradient(135deg, #fff 0 45%, #eceff3 45% 70%, #7aa9b7 70%); }
.theme-porcelain { background: linear-gradient(135deg, #fff 0 45%, #f0f5fb 45% 70%, #3ea8c7 70%); }
.theme-sand-light { background: linear-gradient(135deg, #fffdf8 0 45%, #f7eddb 45% 70%, #2fa6b6 70%); }
.theme-champagne { background: linear-gradient(135deg, #fffdf8 0 45%, #f7ead4 45% 70%, #0ba7aa 70%); }
.theme-gold-soft { background: linear-gradient(135deg, #fffdf5 0 45%, #f9eabf 45% 70%, #c88608 70%); }
.theme-amber { background: linear-gradient(135deg, #fffdf8 0 45%, #fbe3c5 45% 70%, #c9780c 70%); }
.theme-coral { background: linear-gradient(135deg, #fff 0 45%, #fae0dd 45% 70%, #e06b67 70%); }
.theme-rose { background: linear-gradient(135deg, #fff 0 45%, #f7dfeb 45% 70%, #cc6aa0 70%); }
.theme-lavender { background: linear-gradient(135deg, #fff 0 45%, #eae1fb 45% 70%, #8a72d8 70%); }
.theme-lilac { background: linear-gradient(135deg, #fff 0 45%, #eddffa 45% 70%, #a56ed1 70%); }
.theme-orchid-light { background: linear-gradient(135deg, #fff 0 45%, #f6def8 45% 70%, #be6ed4 70%); }
.theme-lime { background: linear-gradient(135deg, #fff 0 45%, #edf7d0 45% 70%, #53a90e 70%); }
.theme-matrix-light { background: linear-gradient(135deg, #fff 0 45%, #dcf8df 45% 70%, #149c45 70%); }
.theme-steel-light { background: linear-gradient(135deg, #fff 0 45%, #e0eaf1 45% 70%, #587f9b 70%); }
.theme-graphite-light { background: linear-gradient(135deg, #fff 0 45%, #e4e8ec 45% 70%, #4b7f9b 70%); }
.theme-night { background: linear-gradient(135deg, #07111d 0 45%, #12314c 45% 70%, #20d5df 70%); }
.text-tone-navy { background: linear-gradient(135deg, #f8fbff 0 58%, #102235 58%); }
.text-tone-ink { background: linear-gradient(135deg, #f8fbff 0 58%, #071827 58%); }
.text-tone-graphite { background: linear-gradient(135deg, #f8fbff 0 58%, #242d38 58%); }
.text-tone-slate { background: linear-gradient(135deg, #f8fbff 0 58%, #334155 58%); }
.text-tone-petrol { background: linear-gradient(135deg, #f8fbff 0 58%, #12343b 58%); }
.text-tone-teal { background: linear-gradient(135deg, #f8fbff 0 58%, #064e58 58%); }
.text-tone-royal { background: linear-gradient(135deg, #f8fbff 0 58%, #173b74 58%); }
.text-tone-violet { background: linear-gradient(135deg, #f8fbff 0 58%, #3f326b 58%); }
.text-tone-espresso { background: linear-gradient(135deg, #f8fbff 0 58%, #35291f 58%); }
.text-tone-soft { background: linear-gradient(135deg, #f8fbff 0 58%, #475569 58%); }

.report-cards article,
.security-tools > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101b2b;
}

.report-cards strong {
  color: #fff;
  font-size: 18px;
}

.report-date-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 76px 64px;
  gap: 8px;
  align-items: end;
  margin: 8px 0;
}

.report-date-bar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-date-bar input {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  color: var(--text);
  background: #101b2b;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color-scheme: dark;
}

.mini-tool-btn {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 900;
}

.report-selected-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.report-selected-summary article {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 245, 212, 0.3);
  border-radius: 7px;
  background: rgba(0, 245, 212, 0.07);
}

.report-selected-summary strong {
  color: #fff;
  font-size: 18px;
}

.security-tools {
  display: grid;
  gap: 8px;
}

.tool-search-input {
  width: 100%;
}

.tool-code {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  font-size: 11px;
  line-height: 1.35;
  font-family: Consolas, "Courier New", monospace;
}

.g2g-auth-form {
  display: grid;
  gap: 8px;
}

.g2g-auth-form button {
  justify-self: end;
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 800;
}

.modal-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 24px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-title select {
  height: 26px;
  font-size: 11px;
}

.modal-title button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}

.quick-reply-modal {
  width: min(460px, 94vw);
}

.sale-cost-modal {
  width: min(520px, 94vw);
}

.sale-cost-title {
  grid-template-columns: minmax(0, 1fr) 24px;
}

.sale-cost-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.sale-cost-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101b2b;
}

.sale-cost-summary strong,
.sale-cost-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-cost-summary span {
  color: var(--muted);
}

.sale-cost-summary b {
  grid-row: span 2;
  align-self: center;
  color: var(--accent);
  font-size: 15px;
}

.sale-cost-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sale-cost-body label {
  display: grid;
  gap: 5px;
  color: #91a4bd;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.sale-cost-body input {
  width: 100%;
  min-width: 0;
  color: #f4fbff;
  background: #101b2b;
}

.sale-cost-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sale-cost-result span {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f1a29;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.sale-cost-result b {
  color: var(--accent);
  font-size: 15px;
}

.order-tool-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.order-tool-row strong,
.order-tool-row span,
.order-tool-row b,
.order-tool-row small {
  grid-column: 1;
}

.order-tool-row button {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: center;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
}

.order-tool-row.canceled-sale {
  border-color: rgba(255, 86, 113, .35);
  background: rgba(69, 18, 31, .45);
}

.order-tool-row.canceled-sale b {
  color: #ff8da0;
}

.g2g-order-form {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr .55fr .7fr .7fr .9fr 1fr auto;
  gap: 6px;
  align-items: center;
}

.g2g-order-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f1a29;
}

.g2g-order-toolbar button {
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 800;
}

.g2g-order-toolbar span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g2g-order-form input {
  width: 100%;
  min-width: 0;
  height: 30px;
  font-size: 11px;
}

.g2g-order-form button,
.g2g-match-head button {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
}

.tool-note {
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0f1a29;
  color: var(--muted);
  font-size: 11px;
}

.g2g-order-section-title,
.g2g-matched-orders summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.g2g-matched-orders {
  display: grid;
  gap: 8px;
}

.g2g-matched-orders summary {
  cursor: pointer;
  color: var(--muted);
}

.g2g-order-row.matched-order {
  opacity: .7;
  border-color: rgba(35, 224, 187, .18);
}

.g2g-order-row.excluded-order {
  opacity: .82;
  border-color: rgba(255, 127, 80, .28);
}

.g2g-order-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.g2g-order-row strong,
.g2g-order-row span,
.g2g-order-row b,
.g2g-order-row small {
  grid-column: 1;
}

.g2g-order-actions {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: center;
  display: grid;
  gap: 6px;
}

.g2g-matched-sale-list {
  grid-column: 1;
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(35, 224, 187, .08);
}

.g2g-matched-sale-list span {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 700;
}

.g2g-order-row button {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
}

.g2g-match-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101b2b;
}

.g2g-match-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.g2g-match-head span,
.g2g-match-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g2g-match-head b,
.g2g-sale-choice b {
  color: var(--accent);
}

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

.g2g-sale-choice {
  position: relative;
  min-height: 72px;
  padding-left: 34px;
  cursor: pointer;
}

.g2g-sale-choice input {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 14px;
  height: 14px;
}

.g2g-sale-choice.pending-cost {
  border-color: rgba(35, 224, 187, .35);
}

.g2g-sale-choice.has-cost {
  opacity: .74;
}

@media (max-width: 980px) {
  .g2g-order-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g2g-order-form button,
  .g2g-order-toolbar,
  .g2g-match-head,
  .g2g-match-list {
    grid-column: 1 / -1;
  }

  .g2g-order-toolbar {
    grid-template-columns: 1fr;
  }

  .g2g-match-head {
    grid-template-columns: 1fr;
  }

  .g2g-match-list {
    grid-template-columns: 1fr;
  }
}

.quick-reply-title {
  grid-template-columns: minmax(0, 1fr) 24px;
}

.quick-reply-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.quick-reply-form label {
  display: grid;
  gap: 5px;
  color: #91a4bd;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-reply-form input,
.quick-reply-form textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  color: #f4fbff;
  background: #101b2b;
}

.quick-reply-form textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.35;
}

.quick-reply-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.quick-reply-form-actions button {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.store-modal {
  width: min(560px, 94vw);
}

.store-modal-title {
  grid-template-columns: minmax(0, 1fr) 24px;
}

.store-modal-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.store-choice-list {
  display: grid;
  gap: 6px;
  max-height: min(520px, 62vh);
  overflow: auto;
  padding-right: 4px;
}

.store-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101b2b;
}

.store-choice input {
  width: 14px;
  height: 14px;
}

.store-choice span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.store-choice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-choice small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.listing-category-list {
  display: grid;
  gap: 6px;
  max-height: min(560px, 64vh);
  overflow: auto;
  padding-right: 4px;
}

.listing-category-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #101b2b;
}

.listing-category-choice span {
  min-width: 0;
}

.listing-category-choice strong,
.listing-category-choice small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-category-choice small {
  margin-top: 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

#deleteQuickReplyModal,
#deleteQuickLinkModal,
#deleteG2gProductModal {
  border-color: rgba(255, 108, 139, .38);
  background: linear-gradient(180deg, #402033, #1d1420);
  color: #ffc7d2;
}

.history-table {
  display: grid;
  max-height: calc(82vh - 48px);
  overflow: auto;
  padding: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 84px 96px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.history-row strong {
  overflow: hidden;
  color: #f0f6ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row b {
  color: var(--accent);
}

.history-head {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #121c2b;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 1300px) {
  body {
    min-width: 980px;
  }

  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar,
  .workspace {
    max-height: none;
    overflow: visible;
  }

  .right-panel {
    display: grid;
  }

  .left-panel {
    grid-template-rows: auto auto auto;
  }

  .workspace {
    grid-template-rows: auto auto minmax(60vh, auto) auto;
  }

  .pill-row {
    flex-wrap: wrap;
    border-radius: 12px;
  }

  .pill-row .health-summary {
    flex-basis: 100%;
  }

  .dashboard-header {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .header-health {
    flex-basis: 100%;
    max-width: none;
  }

  .header-health .health-summary {
    min-width: 0;
  }

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

  .chat-card {
    min-height: 72vh;
    grid-template-rows: auto minmax(48vh, 1fr) auto auto;
  }

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

  .chat-toolbar > div:first-child,
  .chat-toolbar .live-dot {
    grid-column: 1 / -1;
  }

  .tag-editor {
    max-width: none;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .quick-replies-bar {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .quick-reply-actions {
    justify-content: flex-end;
  }

  .reply {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .bubble {
    max-width: 100%;
  }

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

  .price-list,
  .customer-list,
  .customer-list.expanded {
    max-height: none;
  }

  .modal-card {
    width: min(96vw, 760px);
    max-height: 92vh;
  }

  .listing-management-row {
    grid-template-columns: minmax(0, 1fr) 110px 100px;
  }

  .listing-management-main,
  .listing-management-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 12px;
  }

  .app-shell {
    gap: 6px;
    padding: 6px;
  }

  .left-panel,
  .right-panel {
    padding: 7px;
  }

  .chat-toolbar,
  .tracker-actions,
  .g2g-filter-row,
  .mini-actions {
    grid-template-columns: 1fr;
  }

  .chat-toolbar label {
    min-width: 0;
  }

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

  .reply button {
    width: 100%;
  }

  .listing-management-row {
    grid-template-columns: 1fr;
  }

  .listing-management-actions {
    grid-template-columns: 1fr;
  }

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

  .quick-links {
    grid-template-columns: 1fr;
  }

  .panel-alert-card {
    width: calc(100vw - 20px);
  }
}

/* KTV light theme */
:root {
  --bg: #f4f8fc;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --panel-3: #eaf5ff;
  --line: #bdd5e7;
  --line-soft: #d8e8f3;
  --text: #102235;
  --muted: #5d7287;
  --accent: #00aebe;
  --accent-2: #1678d3;
  --gold: #d79a14;
  --danger: #d94168;
  --green-card: #e7fbf5;
  --theme-bg1: rgba(255,255,255,.88);
  --theme-bg2: rgba(244,248,252,.96);
  --theme-body: #f4f8fc;
  --theme-card: rgba(255,255,255,.94);
  --theme-card-2: #f8fbff;
  --theme-card-3: #eaf5ff;
  --theme-panel-border: #d6e7f2;
  --theme-button-top: #ffffff;
  --theme-button-bottom: #eaf5ff;
  --theme-danger-bg: #fff3f6;
  --theme-danger-border: #f0b7c5;
  --theme-chat-bg: #f7fbff;
  --theme-outgoing: #e9fbf4;
  --theme-incoming: #ffffff;
  --price-color: var(--accent);
  --scroll-track: #e3f5fb;
  --scroll-thumb: #8fd6e7;
  --scroll-thumb-hover: #00aebe;
}

body[data-theme="ktv-light"],
body:not([data-theme]),
body[data-theme="default"],
body[data-theme="emerald"],
body[data-theme="steel"] {
  --bg: #f4f8fc;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --panel-3: #eaf5ff;
  --line: #bdd5e7;
  --line-soft: #d8e8f3;
  --text: #102235;
  --muted: #5d7287;
  --accent: #00aebe;
  --accent-2: #1678d3;
  --gold: #d79a14;
  --danger: #d94168;
  --green-card: #e7fbf5;
  --theme-bg1: rgba(255,255,255,.88);
  --theme-bg2: rgba(244,248,252,.96);
  --theme-body: #f4f8fc;
  --theme-card: rgba(255,255,255,.94);
  --theme-card-2: #f8fbff;
  --theme-card-3: #eaf5ff;
  --theme-panel-border: #d6e7f2;
  --theme-button-top: #ffffff;
  --theme-button-bottom: #eaf5ff;
  --theme-danger-bg: #fff3f6;
  --theme-danger-border: #f0b7c5;
  --theme-chat-bg: #f7fbff;
  --theme-outgoing: #e9fbf4;
  --theme-incoming: #ffffff;
  --price-color: var(--accent);
  --scroll-track: #e3f5fb;
  --scroll-thumb: #8fd6e7;
  --scroll-thumb-hover: #00aebe;
}

body[data-theme="ktv-green-price"] {
  --bg: #f4f8fc;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --panel-3: #eaf5ff;
  --line: #bdd5e7;
  --line-soft: #d8e8f3;
  --text: #102235;
  --muted: #5d7287;
  --accent: #00aebe;
  --accent-2: #1678d3;
  --gold: #d79a14;
  --danger: #d94168;
  --green-card: #e7fbf5;
  --theme-bg1: rgba(255,255,255,.88);
  --theme-bg2: rgba(244,248,252,.96);
  --theme-body: #f4f8fc;
  --theme-card: rgba(255,255,255,.94);
  --theme-card-2: #f8fbff;
  --theme-card-3: #eaf5ff;
  --theme-panel-border: #d6e7f2;
  --theme-button-top: #ffffff;
  --theme-button-bottom: #eaf5ff;
  --theme-danger-bg: #fff3f6;
  --theme-danger-border: #f0b7c5;
  --theme-chat-bg: #f7fbff;
  --theme-outgoing: #e9fbf4;
  --theme-incoming: #ffffff;
  --price-color: #12a84f;
  --scroll-track: #e3f5fb;
  --scroll-thumb: #8fd6e7;
  --scroll-thumb-hover: #00aebe;
}

body[data-theme="ice-vault"] { --theme-body:#eef9ff; --theme-bg2:rgba(238,249,255,.96); --theme-card:#fbfdff; --theme-card-2:#effaff; --theme-card-3:#dff5ff; --theme-panel-border:#bee8f6; --theme-button-bottom:#dff5ff; --theme-chat-bg:#f3fbff; --accent:#00bcd4; --accent-2:#1586d8; --gold:#e0a92e; --scroll-track:#dff5ff; --scroll-thumb:#7dd7ee; --scroll-thumb-hover:#00bcd4; }
body[data-theme="skyline"] { --theme-body:#f1f8ff; --theme-bg2:rgba(241,248,255,.96); --theme-card:#ffffff; --theme-card-2:#eef7ff; --theme-card-3:#dbefff; --theme-panel-border:#c2dff5; --theme-button-bottom:#e3f2ff; --theme-chat-bg:#f5faff; --accent:#1497d4; --accent-2:#356fe8; --gold:#d9a31d; }
body[data-theme="aqua"] { --theme-body:#effffd; --theme-bg2:rgba(239,255,253,.96); --theme-card:#ffffff; --theme-card-2:#ecfffc; --theme-card-3:#d5fbf5; --theme-panel-border:#afe9e1; --theme-button-bottom:#dffbf7; --theme-chat-bg:#f4fffd; --accent:#00a999; --accent-2:#08a7d9; --gold:#d69c21; }
body[data-theme="pearl"] { --theme-body:#fbfdff; --theme-bg2:rgba(251,253,255,.96); --theme-card:#ffffff; --theme-card-2:#f6fbff; --theme-card-3:#edf5fb; --theme-panel-border:#d8e6ef; --theme-button-bottom:#edf5fb; --theme-chat-bg:#fbfdff; --accent:#2aaec2; --accent-2:#4f87d5; --gold:#c99524; }
body[data-theme="cloud"] { --theme-body:#f7fbff; --theme-bg2:rgba(247,251,255,.96); --theme-card:#ffffff; --theme-card-2:#f3f8fc; --theme-card-3:#e9f3fb; --theme-panel-border:#d5e3ee; --theme-button-bottom:#eef6fc; --theme-chat-bg:#ffffff; --accent:#5aa8d8; --accent-2:#7897df; --gold:#cda02a; }
body[data-theme="mint"] { --theme-body:#f2fff8; --theme-bg2:rgba(242,255,248,.96); --theme-card:#ffffff; --theme-card-2:#effff6; --theme-card-3:#dff8ea; --theme-panel-border:#bfe8d0; --theme-button-bottom:#e5f8ed; --theme-chat-bg:#f8fffb; --accent:#18ad72; --accent-2:#159fc2; --gold:#c99b20; }
body[data-theme="seafoam"] { --theme-body:#f0fffb; --theme-bg2:rgba(240,255,251,.96); --theme-card:#ffffff; --theme-card-2:#edfffa; --theme-card-3:#d9f7ef; --theme-panel-border:#b6e6d9; --theme-button-bottom:#def8f1; --theme-chat-bg:#f6fffc; --accent:#00a77d; --accent-2:#00a9c8; --gold:#c99b2f; }
body[data-theme="turquoise"] { --theme-body:#effdfd; --theme-bg2:rgba(239,253,253,.96); --theme-card:#ffffff; --theme-card-2:#eaffff; --theme-card-3:#d4f6f8; --theme-panel-border:#ade5e7; --theme-button-bottom:#dff8fa; --theme-chat-bg:#f5ffff; --accent:#00aebe; --accent-2:#087bd3; --gold:#d5a120; }
body[data-theme="sapphire"] { --theme-body:#f2f7ff; --theme-bg2:rgba(242,247,255,.96); --theme-card:#ffffff; --theme-card-2:#edf4ff; --theme-card-3:#dfeaff; --theme-panel-border:#bed3f1; --theme-button-bottom:#e5efff; --theme-chat-bg:#f8fbff; --accent:#2176d2; --accent-2:#0bbbd0; --gold:#d4a22d; }
body[data-theme="royal"] { --theme-body:#f3f5ff; --theme-bg2:rgba(243,245,255,.96); --theme-card:#ffffff; --theme-card-2:#eff2ff; --theme-card-3:#e1e8ff; --theme-panel-border:#c8d2f3; --theme-button-bottom:#e7edff; --theme-chat-bg:#f8f9ff; --accent:#356fe8; --accent-2:#00aebe; --gold:#d9a51f; }
body[data-theme="cyber-sky"] { --theme-body:#effaff; --theme-bg2:rgba(239,250,255,.96); --theme-card:#ffffff; --theme-card-2:#eaf9ff; --theme-card-3:#d8f2ff; --theme-panel-border:#b8e1f2; --theme-button-bottom:#e1f4ff; --theme-chat-bg:#f5fcff; --accent:#00c7d9; --accent-2:#4e7cff; --gold:#e0b02a; }
body[data-theme="frost"] { --theme-body:#f5fbfd; --theme-bg2:rgba(245,251,253,.96); --theme-card:#ffffff; --theme-card-2:#f1f8fb; --theme-card-3:#e7f2f7; --theme-panel-border:#cfe1ea; --theme-button-bottom:#e9f3f8; --theme-chat-bg:#fbfdff; --accent:#73aeca; --accent-2:#5290cf; --gold:#c89a22; }
body[data-theme="silver"] { --theme-body:#f6f8fa; --theme-bg2:rgba(246,248,250,.96); --theme-card:#ffffff; --theme-card-2:#f3f6f8; --theme-card-3:#e7edf2; --theme-panel-border:#d3dde5; --theme-button-bottom:#edf2f6; --theme-chat-bg:#fbfcfd; --accent:#6aa8bd; --accent-2:#657ed0; --gold:#bc8c1e; }
body[data-theme="platinum"] { --theme-body:#fafafa; --theme-bg2:rgba(250,250,250,.96); --theme-card:#ffffff; --theme-card-2:#f7f8fa; --theme-card-3:#eceff3; --theme-panel-border:#d8dde4; --theme-button-bottom:#f0f3f6; --theme-chat-bg:#ffffff; --accent:#7aa9b7; --accent-2:#608ed0; --gold:#c59b31; }
body[data-theme="porcelain"] { --theme-body:#fffefd; --theme-bg2:rgba(255,254,253,.96); --theme-card:#ffffff; --theme-card-2:#fbfbff; --theme-card-3:#f0f5fb; --theme-panel-border:#dce7ef; --theme-button-bottom:#f2f7fb; --theme-chat-bg:#fffefd; --accent:#3ea8c7; --accent-2:#688bdb; --gold:#c79b28; }
body[data-theme="sand-light"] { --theme-body:#fffaf0; --theme-bg2:rgba(255,250,240,.96); --theme-card:#fffdf8; --theme-card-2:#fff7e8; --theme-card-3:#f7eddb; --theme-panel-border:#e6d7bd; --theme-button-bottom:#fff1d7; --theme-chat-bg:#fffdf8; --accent:#2fa6b6; --accent-2:#4e87cc; --gold:#c78617; }
body[data-theme="champagne"] { --theme-body:#fff9ed; --theme-bg2:rgba(255,249,237,.96); --theme-card:#fffdf8; --theme-card-2:#fff6e7; --theme-card-3:#f7ead4; --theme-panel-border:#e7d3ad; --theme-button-bottom:#fff0d3; --theme-chat-bg:#fffdfa; --accent:#0ba7aa; --accent-2:#3b87d1; --gold:#d29517; }
body[data-theme="gold-soft"] { --theme-body:#fff9e7; --theme-bg2:rgba(255,249,231,.96); --theme-card:#fffdf5; --theme-card-2:#fff5d9; --theme-card-3:#f9eabf; --theme-panel-border:#ead290; --theme-button-bottom:#fff0c6; --theme-chat-bg:#fffdf6; --accent:#05a9b5; --accent-2:#2079cc; --gold:#c88608; }
body[data-theme="amber"] { --theme-body:#fff7ed; --theme-bg2:rgba(255,247,237,.96); --theme-card:#fffdf8; --theme-card-2:#fff2df; --theme-card-3:#fbe3c5; --theme-panel-border:#eac49b; --theme-button-bottom:#ffe8c8; --theme-chat-bg:#fffaf4; --accent:#149eb0; --accent-2:#337dd0; --gold:#c9780c; }
body[data-theme="coral"] { --theme-body:#fff6f4; --theme-bg2:rgba(255,246,244,.96); --theme-card:#ffffff; --theme-card-2:#fff0ee; --theme-card-3:#fae0dd; --theme-panel-border:#edc6c0; --theme-button-bottom:#ffe5e2; --theme-chat-bg:#fffafb; --accent:#0fa4b7; --accent-2:#e06b67; --gold:#c9981f; }
body[data-theme="rose"] { --theme-body:#fff6fb; --theme-bg2:rgba(255,246,251,.96); --theme-card:#ffffff; --theme-card-2:#fff0f7; --theme-card-3:#f7dfeb; --theme-panel-border:#e8c4d6; --theme-button-bottom:#ffe5f1; --theme-chat-bg:#fffbfd; --accent:#159eb2; --accent-2:#cc6aa0; --gold:#c39424; }
body[data-theme="lavender"] { --theme-body:#f9f6ff; --theme-bg2:rgba(249,246,255,.96); --theme-card:#ffffff; --theme-card-2:#f5f0ff; --theme-card-3:#eae1fb; --theme-panel-border:#d6c8ec; --theme-button-bottom:#eee6fb; --theme-chat-bg:#fcfaff; --accent:#4faac1; --accent-2:#8a72d8; --gold:#c49b2b; }
body[data-theme="lilac"] { --theme-body:#fbf7ff; --theme-bg2:rgba(251,247,255,.96); --theme-card:#ffffff; --theme-card-2:#f8efff; --theme-card-3:#eddffa; --theme-panel-border:#dcc4ea; --theme-button-bottom:#f1e5fb; --theme-chat-bg:#fefbff; --accent:#31a8bd; --accent-2:#a56ed1; --gold:#c79b24; }
body[data-theme="orchid-light"] { --theme-body:#fff6ff; --theme-bg2:rgba(255,246,255,.96); --theme-card:#ffffff; --theme-card-2:#fff0ff; --theme-card-3:#f6def8; --theme-panel-border:#e8c4e9; --theme-button-bottom:#fae5fb; --theme-chat-bg:#fffaff; --accent:#1aa4b5; --accent-2:#be6ed4; --gold:#c79326; }
body[data-theme="lime"] { --theme-body:#fbfff0; --theme-bg2:rgba(251,255,240,.96); --theme-card:#ffffff; --theme-card-2:#f6ffe8; --theme-card-3:#edf7d0; --theme-panel-border:#d7e9ac; --theme-button-bottom:#effbd8; --theme-chat-bg:#fdfff8; --accent:#53a90e; --accent-2:#0aa8be; --gold:#b28a16; }
body[data-theme="matrix-light"] { --theme-body:#f4fff5; --theme-bg2:rgba(244,255,245,.96); --theme-card:#ffffff; --theme-card-2:#ecffed; --theme-card-3:#dcf8df; --theme-panel-border:#bfe8c5; --theme-button-bottom:#e2f9e5; --theme-chat-bg:#f8fff9; --accent:#149c45; --accent-2:#00a9c8; --gold:#c39b21; }
body[data-theme="steel-light"] { --theme-body:#f4f8fb; --theme-bg2:rgba(244,248,251,.96); --theme-card:#ffffff; --theme-card-2:#eef4f8; --theme-card-3:#e0eaf1; --theme-panel-border:#c9d8e3; --theme-button-bottom:#e6eef4; --theme-chat-bg:#f8fbfd; --accent:#587f9b; --accent-2:#338fd0; --gold:#c39122; }
body[data-theme="graphite-light"] { --theme-body:#f6f7f8; --theme-bg2:rgba(246,247,248,.96); --theme-card:#ffffff; --theme-card-2:#f0f2f4; --theme-card-3:#e4e8ec; --theme-panel-border:#cdd5dd; --theme-button-bottom:#e9edf1; --theme-chat-bg:#fbfcfd; --accent:#4b7f9b; --accent-2:#247fca; --gold:#bb8f21; }
body[data-theme="night"] { --theme-body:#07111d; --theme-bg1:rgba(7,17,29,.78); --theme-bg2:rgba(7,17,29,.94); --theme-card:rgba(8,20,34,.94); --theme-card-2:#0d1f33; --theme-card-3:#12314c; --theme-panel-border:#245274; --theme-button-top:#155b81; --theme-button-bottom:#091d30; --theme-chat-bg:#06101c; --theme-outgoing:#0c493f; --theme-incoming:#0d1f33; --text:#e7f8ff; --muted:#93b8cc; --accent:#20d5df; --accent-2:#1478dc; --gold:#f4c247; --scroll-track:#081928; --scroll-thumb:#1f80a6; --scroll-thumb-hover:#20d5df; }

body:not([data-theme="night"])[data-text-tone="navy"] { --text:#102235; --muted:#5d7287; }
body:not([data-theme="night"])[data-text-tone="ink"] { --text:#071827; --muted:#4f6577; }
body:not([data-theme="night"])[data-text-tone="graphite"] { --text:#242d38; --muted:#667483; }
body:not([data-theme="night"])[data-text-tone="slate"] { --text:#334155; --muted:#64748b; }
body:not([data-theme="night"])[data-text-tone="petrol"] { --text:#12343b; --muted:#55727a; }
body:not([data-theme="night"])[data-text-tone="teal"] { --text:#064e58; --muted:#527b83; }
body:not([data-theme="night"])[data-text-tone="royal"] { --text:#173b74; --muted:#5d739d; }
body:not([data-theme="night"])[data-text-tone="violet"] { --text:#3f326b; --muted:#756d91; }
body:not([data-theme="night"])[data-text-tone="espresso"] { --text:#35291f; --muted:#74675b; }
body:not([data-theme="night"])[data-text-tone="soft"] { --text:#475569; --muted:#7c8a99; }

body {
  background:
    linear-gradient(180deg, var(--theme-bg1), var(--theme-bg2)),
    url("/ktv-banner.png") center top / 1340px auto no-repeat,
    var(--theme-body);
  color: var(--text);
}

button,
select,
input,
textarea {
  border-color: #c7dcec;
  background: var(--theme-card);
  color: var(--text);
}

button {
  color: var(--text);
  background: linear-gradient(180deg, var(--theme-button-top), var(--theme-button-bottom));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(16, 34, 53, .06);
}

button:hover {
  border-color: #00b9c8;
  box-shadow: 0 0 0 2px rgba(0, 185, 200, .12), 0 4px 12px rgba(22, 120, 211, .10);
}

small,
time,
label,
em {
  color: var(--muted);
}

.left-panel,
.right-panel,
.chat-card,
.links-panel,
.metric {
  border-color: var(--theme-panel-border);
  background: var(--theme-card);
  box-shadow: 0 8px 24px rgba(24, 76, 112, .08), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(2px);
}

.panel-logo,
.pill-row,
.header-health {
  border-color: rgba(0, 174, 190, .24);
  background: color-mix(in srgb, var(--theme-card) 82%, transparent);
  box-shadow: 0 2px 10px rgba(22, 120, 211, .10);
}

.panel-logo strong,
.brand strong,
h1,
h2,
.section-title strong,
.customer strong,
.price-list strong,
.rank-list strong {
  color: #102235;
  color: var(--text);
}

.panel-logo span,
.market-note,
.tracker-actions small {
  color: #61788d;
  color: var(--muted);
}

.pill-row span,
.live-dot,
.badge {
  border-color: rgba(0, 174, 190, .30);
  background: #e9fbfc;
  color: #007c88;
}

.pill-row span.inactive,
.health-summary.inactive {
  border-color: rgba(217, 65, 104, .35);
  background: #fff0f4;
  color: #b52c50;
}

.dashboard-header {
  border-color: var(--theme-panel-border);
  background:
    linear-gradient(90deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 48%, rgba(255,255,255,.18)),
    url("/ktv-banner.png") center / cover no-repeat;
  box-shadow: 0 8px 20px rgba(24, 76, 112, .10);
}

.dashboard-header::after {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
}

.metric {
  background: var(--theme-card);
}

.metric strong {
  color: #12283f;
}

.metric.danger {
  background: var(--theme-danger-bg);
  border-color: var(--theme-danger-border);
}

.metric.danger strong {
  color: #d94168;
}

.customer,
.rank-list li,
.store-grid article,
.price-list article,
.price-list a {
  border-color: #d6e7f2;
  border-color: var(--theme-panel-border);
  background: linear-gradient(180deg, var(--theme-card), var(--theme-card-2));
  box-shadow: 0 2px 8px rgba(24, 76, 112, .05);
}

.customer.active,
.quick-links button.active,
.quick-replies button.active {
  border-color: rgba(0, 174, 190, .55);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, white), var(--theme-card-3));
}

.rank-list li:hover,
.price-list article:hover,
.price-list a:hover {
  border-color: rgba(0, 174, 190, .55);
}

.rank-list span,
.price-list b,
.store-grid b,
.customer-tag {
  color: #008b96;
  color: var(--accent);
}

.chat-toolbar,
.quick-replies-bar,
.reply {
  border-color: #d6e7f2;
  border-color: var(--theme-panel-border);
  background: var(--theme-card);
}

.conversation {
  background:
    linear-gradient(rgba(15, 84, 130, .035) 1px, transparent 1px),
    var(--theme-chat-bg);
  background-size: 100% 42px;
}

.bubble {
  border-color: #cddfed;
  color: #102235;
  color: var(--text);
}

.bubble.incoming {
  background: var(--theme-incoming);
}

.bubble.outgoing {
  background: var(--theme-outgoing);
  border-color: #a9dfce;
}

.bubble.system {
  background: #fff8e8;
  border-color: #ead09c;
  color: #4a3820;
}

.bubble strong,
.bubble.system strong {
  color: #008b96;
  color: var(--accent);
}

.quick-replies button {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, white), var(--theme-card-3));
  border-color: rgba(0, 174, 190, .30);
  color: var(--text);
}

.tool-grid button,
.link-actions button,
.quick-links button,
.g2g-actions button,
.mini-actions button,
.tracker-actions button,
.tracker-picker button,
.g2g-filter-row button {
  background: linear-gradient(180deg, #ffffff, #eaf5ff);
  background: linear-gradient(180deg, var(--theme-button-top), var(--theme-button-bottom));
  color: var(--text);
}

.tool-grid .danger-tool {
  border-color: #efb7c4;
  background: linear-gradient(180deg, #fff5f7, #ffe8ee);
  color: #a42545;
}

.modal-card,
.login-card,
.panel-alert-card {
  border-color: #d6e7f2;
  border-color: var(--theme-panel-border);
  background: var(--theme-card);
  color: var(--text);
  box-shadow: 0 18px 44px rgba(24, 76, 112, .18);
}

/* Light-theme readability fixes for legacy dark widgets */
body:not([data-theme="night"]) .panel-alert-card {
  border-color: color-mix(in srgb, var(--accent) 42%, white);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-card) 92%, var(--accent)), var(--theme-card));
  box-shadow:
    0 20px 58px rgba(24, 76, 112, .20),
    0 0 0 1px rgba(255,255,255,.90),
    0 0 28px color-mix(in srgb, var(--accent) 18%, transparent);
}

body:not([data-theme="night"]) .panel-alert-card strong,
body:not([data-theme="night"]) .panel-alert-card p {
  color: var(--text);
}

body:not([data-theme="night"]) .panel-alert-card small {
  color: var(--muted);
}

body:not([data-theme="night"]) #closePanelAlert {
  border-color: var(--theme-panel-border);
  background: linear-gradient(180deg, var(--theme-button-top), var(--theme-button-bottom));
  color: var(--text);
}

body:not([data-theme="night"]) #goPanelAlert {
  border-color: color-mix(in srgb, var(--accent) 58%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, white), color-mix(in srgb, var(--accent) 12%, white));
  color: var(--text);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 16%, transparent);
}

body:not([data-theme="night"]) .price-title,
body:not([data-theme="night"]) .modal-title,
body:not([data-theme="night"]) .history-head,
body:not([data-theme="night"]) .g2g-order-section-title {
  border: 1px solid var(--theme-panel-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, white), var(--theme-card-2));
  color: var(--text);
}

body:not([data-theme="night"]) .store-stats span,
body:not([data-theme="night"]) .report-cards article,
body:not([data-theme="night"]) .security-tools > div,
body:not([data-theme="night"]) .tool-row,
body:not([data-theme="night"]) .g2g-sale-choice,
body:not([data-theme="night"]) .history-row,
body:not([data-theme="night"]) .store-choice,
body:not([data-theme="night"]) .listing-category-choice {
  border-color: var(--theme-panel-border);
  background: linear-gradient(180deg, var(--theme-card), var(--theme-card-2));
  color: var(--text);
}

body:not([data-theme="night"]) .report-cards strong,
body:not([data-theme="night"]) .tool-row strong,
body:not([data-theme="night"]) .history-row strong,
body:not([data-theme="night"]) .store-choice strong,
body:not([data-theme="night"]) .listing-category-choice strong {
  color: var(--text);
}

body:not([data-theme="night"]) .tool-note,
body:not([data-theme="night"]) .empty-mini,
body:not([data-theme="night"]) .g2g-order-toolbar,
body:not([data-theme="night"]) .embedded-verification-title,
body:not([data-theme="night"]) .sale-cost-summary,
body:not([data-theme="night"]) .sale-cost-preview {
  border-color: var(--theme-panel-border);
  background: color-mix(in srgb, var(--theme-card-2) 82%, white);
  color: var(--text);
}

body:not([data-theme="night"]) .tool-row-action,
body:not([data-theme="night"]) .order-tool-row button,
body:not([data-theme="night"]) .g2g-order-row button,
body:not([data-theme="night"]) .report-product-detail-btn {
  border-color: color-mix(in srgb, var(--accent) 45%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, white), var(--theme-card-2));
  color: var(--text);
}

body:not([data-theme="night"]) .login-card strong,
body:not([data-theme="night"]) .modal-title strong,
body:not([data-theme="night"]) .price-title h2,
body:not([data-theme="night"]) .price-title span,
body:not([data-theme="night"]) .section-title h2 {
  color: var(--text);
}

body:not([data-theme="night"]) .tool-modal-body input,
body:not([data-theme="night"]) .tool-modal-body select,
body:not([data-theme="night"]) .tool-modal-body textarea,
body:not([data-theme="night"]) .quick-reply-form input,
body:not([data-theme="night"]) .quick-reply-form textarea {
  background: #ffffff;
  color: var(--text);
}

body:not([data-theme="night"]) .report-selected-summary strong,
body:not([data-theme="night"]) .report-selected-summary b,
body:not([data-theme="night"]) .report-cards strong,
body:not([data-theme="night"]) .sale-cost-result b,
body:not([data-theme="night"]) .sale-cost-summary b,
body:not([data-theme="night"]) .g2g-match-head b,
body:not([data-theme="night"]) .g2g-sale-choice b,
body:not([data-theme="night"]) .order-tool-row b,
body:not([data-theme="night"]) .g2g-order-row b,
body:not([data-theme="night"]) .tool-row b,
body:not([data-theme="night"]) .history-row b {
  color: var(--text);
}

body:not([data-theme="night"]) .report-selected-summary span,
body:not([data-theme="night"]) .report-selected-summary small,
body:not([data-theme="night"]) .report-cards span,
body:not([data-theme="night"]) .report-cards small,
body:not([data-theme="night"]) .sale-cost-result span,
body:not([data-theme="night"]) .sale-cost-summary span,
body:not([data-theme="night"]) .order-tool-row small,
body:not([data-theme="night"]) .g2g-order-row small,
body:not([data-theme="night"]) .g2g-order-toolbar span,
body:not([data-theme="night"]) .g2g-matched-orders summary,
body:not([data-theme="night"]) .tool-row span,
body:not([data-theme="night"]) .tool-row small {
  color: var(--muted);
}

body:not([data-theme="night"]) .report-selected-summary article,
body:not([data-theme="night"]) .sale-cost-result span {
  border-color: var(--theme-panel-border);
  background: linear-gradient(180deg, var(--theme-card), var(--theme-card-2));
}

body:not([data-theme="night"]) .report-product-row:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, white), var(--theme-card-2));
}

body:not([data-theme="night"]) .tool-modal-body,
body:not([data-theme="night"]) .tool-modal-body :where(strong, b, p, span, label, em, summary, div),
body:not([data-theme="night"]) .history-table,
body:not([data-theme="night"]) .store-modal-body,
body:not([data-theme="night"]) .quick-reply-form,
body:not([data-theme="night"]) .sale-cost-body {
  color: var(--text);
}

body:not([data-theme="night"]) .tool-modal-body :where(small, time),
body:not([data-theme="night"]) .history-table :where(small, time),
body:not([data-theme="night"]) .store-modal-body :where(small, time),
body:not([data-theme="night"]) .quick-reply-form :where(small, time),
body:not([data-theme="night"]) .sale-cost-body :where(small, time) {
  color: var(--muted);
}

body:not([data-theme="night"]) .tool-modal-body :where(
  .tool-row,
  .report-cards article,
  .security-tools > div,
  .report-selected-summary article,
  .sale-cost-summary,
  .sale-cost-result span,
  .order-tool-row,
  .g2g-order-toolbar,
  .g2g-match-head,
  .g2g-sale-choice,
  .store-choice,
  .listing-category-choice,
  .history-row,
  .tool-note,
  .empty-mini
) {
  border-color: var(--theme-panel-border);
  background: linear-gradient(180deg, var(--theme-card), var(--theme-card-2));
}

body:not([data-theme="night"]) .embedded-verification,
body:not([data-theme="night"]) .embedded-verification-title {
  border-color: var(--theme-panel-border);
  background: var(--theme-card-2);
  color: var(--text);
}

body:not([data-theme="night"]) .embedded-verification-title strong,
body:not([data-theme="night"]) .embedded-verification-title a {
  color: var(--text);
}

body:not([data-theme="night"]) .tool-code,
body:not([data-theme="night"]) .g2g-order-form input,
body:not([data-theme="night"]) .sale-cost-body input,
body:not([data-theme="night"]) .quick-reply-form input,
body:not([data-theme="night"]) .quick-reply-form textarea,
body:not([data-theme="night"]) .report-date-bar input {
  border-color: var(--theme-panel-border);
  background: #ffffff;
  color: var(--text);
  color-scheme: light;
}

body:not([data-theme="night"]) .order-tool-row.canceled-sale {
  border-color: #efb7c4;
  background: linear-gradient(180deg, #fff5f7, #ffe8ee);
}

body:not([data-theme="night"]) .order-tool-row.canceled-sale b {
  color: #a42545;
}

body:not([data-theme="night"]) .tool-grid .danger-tool,
body:not([data-theme="night"]) #deleteQuickReplyModal,
body:not([data-theme="night"]) #deleteQuickLinkModal,
body:not([data-theme="night"]) #deleteG2gProductModal {
  border-color: #efb7c4;
  background: linear-gradient(180deg, #fff5f7, #ffe8ee);
  color: #a42545;
}

/* Final light-theme contrast guard across the panel and every popup. */
body:not([data-theme="night"]) :where(.left-panel, .right-panel, .workspace, .modal-card, .panel-alert-card) {
  color: var(--text);
}

body:not([data-theme="night"]) :where(.left-panel, .right-panel, .workspace, .modal-card, .panel-alert-card)
  :where(h1, h2, h3, p, strong, b, label, summary, div) {
  color: var(--text);
}

body:not([data-theme="night"]) :where(.left-panel, .right-panel, .workspace, .modal-card, .panel-alert-card)
  :where(small, time, em) {
  color: var(--muted);
}

body:not([data-theme="night"]) :where(.left-panel, .right-panel, .workspace, .modal-card, .panel-alert-card)
  :where(input, select, textarea) {
  background: #ffffff;
  color: var(--text);
  border-color: var(--theme-panel-border);
  color-scheme: light;
}

body:not([data-theme="night"]) :where(.left-panel, .right-panel, .workspace, .modal-card, .panel-alert-card)
  :where(button, a.tool-row-action, .report-product-detail-btn) {
  color: var(--text);
}

body:not([data-theme="night"]) :where(
  .rank-list span,
  .price-list b,
  .rank-price small,
  .store-grid b,
  .store-stats b,
  .customer-tag,
  .tool-row b,
  .history-row b,
  .sale-cost-summary b,
  .sale-cost-result b,
  .g2g-match-head b,
  .g2g-sale-choice b,
  .g2g-order-row b,
  .order-tool-row b,
  .report-sale-detail b
) {
  color: var(--price-color, var(--accent));
}

body:not([data-theme="night"]) .rank-main em {
  color: #536b80;
}

body:not([data-theme="night"]) .rank-store small {
  border-color: color-mix(in srgb, var(--accent) 28%, white);
  background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--accent) 10%, white));
  color: #244358;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 3px rgba(24, 76, 112, .08);
}

body:not([data-theme="night"]) .rank-price small {
  color: var(--price-color, #315c72);
}

body:not([data-theme="night"]) :where(.pill-row span, .live-dot, .badge) {
  color: #007c88;
}

body:not([data-theme="night"]) :where(
  .tool-row,
  .report-product-row,
  .report-cards article,
  .report-selected-summary article,
  .security-tools > div,
  .sale-cost-summary,
  .sale-cost-result span,
  .g2g-order-toolbar,
  .g2g-match-head,
  .g2g-sale-choice,
  .store-choice,
  .listing-category-choice,
  .history-row,
  .tool-note,
  .empty-mini,
  .price-title,
  .modal-title,
  .history-head
) {
  border-color: var(--theme-panel-border);
  background: linear-gradient(180deg, var(--theme-card), var(--theme-card-2));
}

body[data-theme="ice-vault"] :where(
  .left-panel,
  .right-panel,
  .chat-card,
  .links-panel,
  .metric,
  .panel-logo,
  .pill-row,
  .header-health,
  .customer,
  .rank-list li,
  .store-grid article,
  .price-list article,
  .price-list a,
  .quick-replies-bar,
  .reply,
  .chat-toolbar,
  .modal-card,
  .panel-alert-card
) {
  background: linear-gradient(180deg, rgba(244, 252, 255, .96), rgba(225, 246, 255, .94));
  border-color: #a9dff2;
}

body[data-theme="ice-vault"] :where(input, select, textarea) {
  background: #f4fcff;
  border-color: #a9dff2;
}

body[data-theme="ice-vault"] :where(button, .quick-links button, .quick-replies button) {
  background: linear-gradient(180deg, #f8fdff, #dff5ff);
  border-color: #9bd8ee;
}

body[data-theme="ice-vault"] .conversation {
  background:
    linear-gradient(rgba(0, 188, 212, .045) 1px, transparent 1px),
    #edfaff;
  background-size: 100% 42px;
}

body[data-theme="ice-vault"] .bubble.incoming {
  background: #f7fdff;
}

body[data-theme="ice-vault"] .bubble.outgoing {
  background: #e0fff8;
}

body[data-theme="ice-vault"] .links-panel,
body[data-theme="ice-vault"] .tool-modal-body :where(
  .tool-row,
  .report-cards article,
  .security-tools > div,
  .report-selected-summary article,
  .sale-cost-summary,
  .sale-cost-result span,
  .order-tool-row,
  .g2g-order-toolbar,
  .g2g-match-head,
  .g2g-sale-choice,
  .store-choice,
  .listing-category-choice,
  .history-row,
  .tool-note,
  .empty-mini
) {
  background: linear-gradient(180deg, #f4fcff, #e4f7ff);
  border-color: #a9dff2;
}

body[data-theme="ice-vault"] .metric.danger {
  background: linear-gradient(180deg, #fff4f8, #ffeaf1);
  border-color: #f0b7c5;
}

body:not([data-theme="night"]) .quick-replies button {
  color: var(--text);
  opacity: 1;
}

body:not([data-theme="night"]) .quick-replies button.active,
body:not([data-theme="night"]) .quick-replies button:disabled,
body:not([data-theme="night"]) .quick-replies button[disabled] {
  border-color: color-mix(in srgb, var(--accent) 55%, white);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, white), color-mix(in srgb, var(--accent) 12%, white));
  color: var(--text);
  opacity: 1;
}
