/* Ns 客服 2.0 — Soft System (Operate)
   CMT Soft System: system gray, frosted topbar, charcoal actions, stamp red accents
   Dials: VARIANCE 4 · MOTION 3 · DENSITY 6
*/

:root {
  --ink: #1d1d1f;
  --ink-soft: #3a3a3c;
  --plate: #1d1d1f;
  --paper: #f2f0ec;
  --paper-mid: #f7f5f1;
  --paper-deep: #e4e0d8;
  --sheet: #fffcf8;
  --fill: rgba(60, 56, 50, 0.08);
  --fill-strong: rgba(60, 56, 50, 0.14);
  --stamp: #c41e3a;
  --stamp-deep: #9e1830;
  --accent: #1d1d1f;
  --muted: #6e6a63;
  --line: rgba(40, 36, 30, 0.08);
  --line-strong: rgba(40, 36, 30, 0.14);
  --ok: #248a3d;
  --warn: #b25e09;
  --danger: #d70015;
  --bubble-me: #1d1d1f;
  --bubble-them: #fffcf8;
  --glass: rgba(255, 252, 248, 0.86);
  --radius: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(29, 29, 31, 0.04), 0 10px 28px rgba(29, 29, 31, 0.07);
  --shadow-soft: 0 16px 40px rgba(29, 29, 31, 0.1);
  --font: "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --topbar-h: 56px;
  --z-top: 40;
  --z-modal: 1000;
  --z-toast: 1100;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(820px 380px at 8% -12%, rgba(255,255,255,.9), transparent 55%),
    radial-gradient(640px 360px at 100% 0%, rgba(196,30,58,.05), transparent 50%),
    linear-gradient(180deg, #ebe7e0 0%, var(--paper) 48%, #e7e3db 100%);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--stamp); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.glass {
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--plate);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform 0.18s var(--ease), opacity 0.15s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { opacity: 0.92; box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.btn:active { transform: scale(0.98); }
.btn.ghost {
  background: var(--fill);
  color: var(--ink);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--fill-strong); }
.btn.stamp { background: var(--stamp); }
.btn.stamp:hover { background: var(--stamp-deep); }
.btn.warn { background: var(--warn); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.field {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.92);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field::placeholder { color: #a1a1a6; }
.field:focus {
  border-color: rgba(29, 29, 31, 0.35);
  box-shadow: 0 0 0 4px rgba(29, 29, 31, 0.08);
  background: #fff;
}
textarea.field { min-height: 88px; resize: vertical; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
.chip:hover { background: #fff; }
.chip:active { transform: scale(0.98); }
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(29, 29, 31, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  width: min(400px, 100%);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
}
.modal h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 16px; line-height: 1.5; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: rgba(29, 29, 31, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise 0.28s var(--ease); }
}
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.app-shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-top);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 16px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.topbar .brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.topbar .spacer { flex: 1; }
.topbar .meta { font-size: 12px; color: var(--muted); font-weight: 500; }

.layout-desk {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  height: calc(100dvh - var(--topbar-h));
  min-height: 0;
}
@media (max-width: 1100px) {
  .layout-desk { grid-template-columns: 240px 1fr; }
  .layout-desk .side-right { display: none; }
}
@media (max-width: 760px) {
  .layout-desk {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 26vh) 1fr;
    height: calc(100dvh - var(--topbar-h));
  }
  .layout-desk .side-left { max-height: none; border-bottom: 1px solid var(--line); }
}

.panel {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  overflow: auto;
}
.panel:last-child { border-right: none; border-left: 1px solid var(--line); }
.panel h4 {
  padding: 16px 16px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.list-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 2px solid transparent;
}
.list-item:hover { background: rgba(255, 255, 255, 0.7); }
.list-item.active {
  background: rgba(255, 255, 255, 0.92);
  border-left-color: var(--ink);
}
.list-item .title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.list-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255,252,248,.55), rgba(242,240,236,.72)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 12px,
      rgba(29,29,31,.015) 12px,
      rgba(29,29,31,.015) 13px
    );
}
.chat-scroll {
  flex: 1;
  overflow: auto;
  padding: 18px 16px 14px;
  -webkit-overflow-scrolling: touch;
}
.chat-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.7);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(29,29,31,.08);
}
.chat-tools { display: none; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.plus-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(29,29,31,.12);
  background: var(--paper-mid);
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.plus-btn.open {
  background: var(--ink);
  color: #fff;
  transform: rotate(45deg);
}
.plus-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 2px 10px;
}
.plus-panel.hidden { display: none !important; }
.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 6px;
  border: 1px solid rgba(29,29,31,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
}
.plus-item.danger { color: #b42318; }
.plus-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(29,29,31,.06);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.plus-item.danger .plus-ico { background: rgba(215,0,21,.1); }
.order-bubble {
  min-width: 200px;
  padding: 2px 0;
}
.order-bubble-kicker {
  font-size: 11px;
  opacity: .72;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.order-bubble-title {
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.35;
  margin-bottom: 6px;
}
.order-bubble-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  opacity: .85;
}
.order-bubble-time,
.order-bubble-extra {
  margin-top: 6px;
  font-size: 12px;
  opacity: .72;
}
.bubble.me .order-bubble-kicker,
.bubble.me .order-bubble-meta,
.bubble.me .order-bubble-time,
.bubble.me .order-bubble-extra { opacity: .8; }
.orders-modal { max-width: min(440px, 92vw); width: 100%; }
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow: auto;
  margin: 12px 0 4px;
}
.orders-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.order-pick {
  text-align: left;
  border: 1px solid rgba(29,29,31,.1);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.order-pick:hover { border-color: rgba(29,29,31,.28); }
.order-pick-title { font-weight: 650; font-size: 14px; margin-bottom: 4px; }
.order-pick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.order-pick-time { margin-top: 4px; font-size: 11px; color: var(--muted); }
.composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  border-radius: var(--radius-sm);
  border-color: transparent;
  background: var(--paper-mid);
}
.composer textarea:focus {
  background: #fff;
  border-color: rgba(29,29,31,.2);
}

.bubble {
  max-width: min(82%, 480px);
  margin: 7px 0;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: ns-rise 0.22s var(--ease); }
}
@keyframes ns-rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.bubble.me {
  margin-left: auto;
  background: var(--bubble-me);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 3px 12px rgba(29, 29, 31, .16);
}
.bubble.them {
  background: var(--bubble-them);
  border: 1px solid rgba(29, 29, 31, .08);
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(29, 29, 31, .05);
}
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 8px 0;
  max-width: 100%;
}
.bubble-row.me { justify-content: flex-end; }
.bubble-row.them { justify-content: flex-start; }
.bubble-row .bubble { margin: 0; }
.bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper-deep);
}
.bubble-avatar.placeholder {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}
.msg-time {
  margin-top: 6px;
  font-size: 11px;
  opacity: .62;
  letter-spacing: 0.01em;
}
.bubble.me .msg-time { opacity: .72; text-align: right; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.auth-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.send-btn {
  background: var(--plate);
  min-width: 64px;
}
.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--paper-deep);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink-soft);
}
.avatar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bubble.failed {
  outline: 1px solid rgba(215, 0, 21, 0.45);
  opacity: 0.85;
}
.bubble.system {
  margin: 14px auto;
  background: rgba(29,29,31,.06);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  max-width: 88%;
  padding: 6px 14px;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.04);
  box-shadow: none;
}
.bubble.system .who { display: none; }
.bubble.bot {
  /* bot 走普通聊天气泡样式，不再居中圆条 */
}
.bubble .who {
  font-size: 11px;
  opacity: 0.55;
  margin-bottom: 3px;
  font-weight: 500;
}
.bubble .quote {
  border-left: 2px solid rgba(255, 255, 255, 0.35);
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 0 6px 6px 0;
}
.bubble.them .quote {
  border-left-color: rgba(29, 29, 31, 0.2);
  background: var(--paper-mid);
}
.bubble .file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.05);
}
.bubble.me .file-card { background: rgba(255, 255, 255, 0.12); }
.bubble img.media,
.bubble video.media {
  border-radius: var(--radius-xs);
  max-height: 260px;
  background: #111;
}
.bubble.recalled { opacity: 0.55; font-style: italic; }

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  gap: 2px;
}
.seg button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button.active {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th,
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--muted); font-weight: 600; }

.card {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.auth-card {
  border: 1px solid rgba(196,30,58,.14);
  background:
    linear-gradient(180deg, #fff, #fff8f9);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0;
  box-shadow: var(--shadow);
}
.auth-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.auth-card h4 img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.landing {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.landing-box {
  width: min(420px, 100%);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: grid;
  gap: 8px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: var(--shadow-soft);
}
.landing-box h1 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.landing-box p { color: var(--muted); margin-top: 4px; font-size: 14px; }

.shell {
  width: min(440px, 100%);
  padding: 7px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.55), rgba(255,255,255,.18)),
    rgba(120,120,128,.12);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: var(--shadow-soft);
}
.shell .landing-box {
  width: 100%;
  margin: 0;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}

.entry-url {
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.portal-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.portal {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
}
.portal strong { display: block; font-size: 15px; margin-bottom: 4px; }
.portal span { color: var(--muted); font-size: 13px; }

.user-body { overflow: hidden; }
.user-frame {
  width: min(460px, 100%);
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: rgba(245, 245, 247, 0.72);
  border-left: 1px solid rgba(255,255,255,.55);
  border-right: 1px solid rgba(255,255,255,.55);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.04),
    0 24px 80px rgba(29,29,31,.14);
  backdrop-filter: blur(8px);
}
@media (max-width: 480px) {
  .user-frame {
    border: none;
    width: 100%;
    box-shadow: none;
    backdrop-filter: none;
    background: transparent;
  }
}

.user-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.agent-pill {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  font-size: 12px !important;
  font-weight: 550;
}
.agent-pill.serving {
  background: rgba(36, 138, 61, 0.14);
  color: var(--ok);
}
.dept-bar {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}
.dept-label {
  font-size: 12px;
  color: var(--muted);
  width: 100%;
  font-weight: 500;
}
.auth-wrap,
.rate-wrap { padding: 0 14px 8px; }
.auth-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.auth-fields { display: grid; gap: 8px; }
.rate-card h4 { margin-bottom: 10px; font-weight: 650; }
.rate-card .field { margin-top: 10px; }
.rate-card .btn { margin-top: 10px; width: 100%; }
.safe-bottom { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.hidden { display: none !important; }
.badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--stamp);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
}
.credit-good { color: var(--ok); }
.credit-bad { color: var(--danger); }
.credit-normal { color: var(--muted); }

#deskView { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 760px) {
  .chat-tools .btn.sm { font-size: 12px; padding: 0 9px; }
}

.admin-main { max-width: 1080px; margin: 0 auto; padding: 20px 18px 48px; }
.admin-main:has(#tab-live:not(.hidden)) {
  max-width: none;
  padding: 0 0 12px;
  height: calc(100dvh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tab-live:not(.hidden) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.admin-live {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.admin-live .side-left { max-height: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}
.table { min-width: 560px; }
.admin-main .card h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.desk-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.desk-root .layout-desk { flex: 1; min-height: 0; }
.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  font-size: 14px;
}
.quote-preview {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: var(--paper-mid);
  border-left: 2px solid var(--ink);
}
.linkish {
  color: var(--stamp);
  text-decoration: underline;
  margin-left: 8px;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}
.empty-hint { padding: 20px 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.list-item .grow { flex: 1; min-width: 0; }
.profile-form { padding: 0 12px 12px; display: grid; gap: 8px; }
.soft-hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.only-mobile { display: none !important; }
.hide-mobile { display: block; }
@media (max-width: 1100px) {
  .only-mobile { display: inline-flex !important; }
  .hide-mobile { display: none !important; }
  .side-right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 92vw);
    z-index: 80;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    transform: translateX(105%);
    transition: transform 0.28s var(--ease);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
  }
  .side-right.open { transform: none; display: block !important; }
}
.notify-chip input { margin-right: 4px; }

#companyName { cursor: default; user-select: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
