:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --ink: #17191d;
  --muted: #717680;
  --line: #e3e5e8;
  --brand: #17191d;
  --brand2: #353a43;
  --danger: #d44343;
  --shadow: 0 14px 40px rgba(30, 45, 75, 0.09);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI Variable Text", "SF Pro Text", "PingFang SC",
    "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 8%, #e5efff, transparent 30%),
    radial-gradient(circle at 90% 85%, #eee7ff, transparent 36%), #f8f9fc;
}
.login-card {
  width: min(480px, 92vw);
  background: #fff;
  border: 1px solid #fff;
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}
.login h1 {
  font-size: 29px;
  margin: 30px 0 8px;
}
.sub {
  color: var(--muted);
  line-height: 1.7;
}
.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}
.field label {
  font-size: 13px;
  font-weight: 700;
  color: #566176;
}
.field select,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
}
.field select:focus,
.field input:focus,
.field textarea:focus {
  border-color: #82a8f2;
  box-shadow: 0 0 0 3px #eaf1ff;
}
.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 700;
}
.wide {
  width: 100%;
}
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  background: #10182a;
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar .logo {
  padding: 0 8px 22px;
}
.identity {
  background: #1a2439;
  padding: 13px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.identity small {
  color: #9eabc1;
}
.nav button {
  width: 100%;
  border: 0;
  color: #bec9da;
  background: transparent;
  padding: 12px;
  border-radius: 10px;
  text-align: left;
  margin: 2px 0;
}
.nav button.active,
.nav button:hover {
  color: #fff;
  background: #26334c;
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-bottom a {
  color: #9eabc1;
  text-decoration: none;
  font-size: 13px;
}
.main {
  display: flex;
  min-width: 0;
}
.history {
  width: 280px;
  background: #fbfcfe;
  border-right: 1px solid var(--line);
  padding: 18px;
  overflow: auto;
}
.new-btn {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 11px;
  border-radius: 10px;
  color: var(--brand);
  font-weight: 700;
}
.history-item {
  padding: 12px;
  border-radius: 10px;
  margin-top: 8px;
  cursor: pointer;
}
.history-item:hover,
.history-item.active {
  background: #eaf1ff;
}
.history-item strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item small {
  color: var(--muted);
}
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar h2 {
  font-size: 18px;
}
.mode-options {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mode-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.mode-options select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-weight: 400;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 28px max(24px, calc((100% - 850px) / 2));
}
.empty {
  text-align: center;
  margin-top: 12vh;
}
.empty .orb {
  width: 70px;
  height: 70px;
  margin: auto;
  border-radius: 22px;
  background: linear-gradient(135deg, #e7f0ff, #eee8ff);
  display: grid;
  place-items: center;
  font-size: 30px;
}
.empty h2 {
  margin: 20px 0 8px;
}
.chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 13px;
  border-radius: 99px;
  color: #566176;
}
.message {
  max-width: 820px;
  margin: 0 auto 22px;
  display: flex;
  gap: 12px;
}
.message .avatar {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 10px;
  background: #dfe8f7;
  display: grid;
  place-items: center;
}
.message.user .avatar {
  background: #dce9ff;
}
.bubble {
  line-height: 1.75;
  white-space: pre-wrap;
}
.composer {
  padding: 18px max(24px, calc((100% - 850px) / 2)) 24px;
  background: linear-gradient(transparent, var(--bg) 25%);
}
.chat-tools {
  max-width: 850px;
  margin: 0 auto 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tool-toggle,
.tool-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #566176;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
}
.tool-toggle:has(input:checked) {
  color: var(--brand);
  border-color: #8aacee;
  background: #edf4ff;
}
.tool-toggle input {
  margin-right: 6px;
}
.image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #566176;
  font-size: 13px;
}
.image-preview img,
.message-image {
  width: 76px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.result-image {
  display: block;
  width: min(480px, 100%);
  max-height: 520px;
  object-fit: contain;
  margin: 12px 0 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.remove-image {
  border: 0;
  background: #eef1f6;
  border-radius: 7px;
  padding: 5px 8px;
}
.compose-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(35, 50, 80, 0.07);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.compose-box textarea {
  border: 0;
  outline: 0;
  resize: none;
  flex: 1;
  min-height: 46px;
  max-height: 150px;
  padding: 12px;
  background: transparent;
}
.send {
  border: 0;
  background: var(--brand);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.video-panel {
  padding: 30px;
  overflow: auto;
  width: 100%;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 5px 20px rgba(30, 45, 75, 0.04);
}
.video-grid {
  display: grid;
  grid-template-columns: minmax(300px, 460px) 1fr;
  gap: 24px;
}
.drop {
  border: 2px dashed #cfd7e5;
  border-radius: 14px;
  padding: 30px;
  text-align: center;
}
.video-task {
  display: flex;
  gap: 15px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.video-task img {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

/* Employee workspace — quiet, conversation-first layout */
.app {
  grid-template-columns: 280px minmax(0, 1fr);
  background: #fff;
  overflow: hidden;
}
.sidebar {
  position: relative;
  z-index: 30;
  width: 280px;
  padding: 12px;
  background: #171717;
  color: #ececec;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar .logo {
  padding: 6px 8px 14px;
  font-size: 16px;
  font-weight: 650;
}
.sidebar .logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff;
  color: #171717;
  font-size: 11px;
  letter-spacing: -0.03em;
}
.identity {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #343434;
  border-radius: 10px;
  background: #212121;
  line-height: 1.4;
}
.identity b {
  font-size: 14px;
  font-weight: 600;
}
.identity small {
  color: #9b9b9b;
  font-size: 12px;
}
.nav {
  display: grid;
  gap: 3px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 9px 11px;
  color: #d7d7d7;
  border-radius: 9px;
  font-size: 14px;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}
.nav button:hover {
  background: #2b2b2b;
  transform: translateX(1px);
}
.nav button.active {
  background: #303030;
  color: #fff;
}
.history {
  width: auto;
  min-height: 0;
  flex: 1;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}
.new-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f1f1f1;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s ease;
}
.new-btn:hover {
  background: #2b2b2b;
}
.history-heading {
  padding: 20px 11px 6px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
}
.history-item {
  padding: 9px 11px;
  margin: 2px 0;
  border-radius: 9px;
  color: #d2d2d2;
  transition: background 0.15s ease;
}
.history-item:hover,
.history-item.active {
  background: #2b2b2b;
}
.history-item strong {
  font-size: 13px;
  font-weight: 450;
}
.history-item small {
  display: none;
}
.sidebar-bottom {
  padding: 9px 8px 4px;
  border-top: 1px solid #2b2b2b;
}
.sidebar-bottom a {
  display: block;
  padding: 8px;
  color: #b4b4b4;
  border-radius: 8px;
  font-size: 13px;
}
.sidebar-bottom a:hover {
  color: #fff;
  background: #292929;
}
.main {
  min-width: 0;
  height: 100vh;
  background: #fff;
}
.workspace {
  position: relative;
  width: 100%;
  min-height: 0;
  background: #fff;
  overflow: hidden;
}
.topbar {
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid #ececec;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}
.topbar h2 {
  margin: 0;
  color: #202020;
  font-size: 17px;
  font-weight: 650;
}
.mode-options {
  gap: 12px;
}
.mode-options label {
  color: #656565;
  font-size: 13px;
  font-weight: 500;
}
.mode-options select {
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border-color: #dedede;
  border-radius: 10px;
  color: #303030;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.mode-options select:focus {
  border-color: #999;
  box-shadow: 0 0 0 3px #0000000d;
}
.messages {
  min-height: 0;
  padding: 38px max(24px, calc((100% - 760px) / 2)) 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  background: #fff;
}
.empty {
  margin-top: min(18vh, 150px);
  animation: rise-in 0.42s ease both;
}
.empty .orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 19px;
  box-shadow: 0 8px 25px #00000018;
}
.empty h2 {
  margin: 18px 0 6px;
  font-size: 24px;
  letter-spacing: -0.025em;
}
.empty .sub {
  margin: 0;
  color: #777;
}
.chips {
  margin-top: 24px;
  gap: 9px;
}
.chip {
  padding: 10px 14px;
  border-color: #dedede;
  border-radius: 13px;
  color: #555;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}
.chip:hover {
  background: #f7f7f7;
  border-color: #c8c8c8;
  transform: translateY(-1px);
}
.message {
  max-width: 760px;
  margin: 0 auto 30px;
  gap: 13px;
  animation: message-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.message .avatar {
  flex-basis: 30px;
  height: 30px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.message.user {
  flex-direction: row-reverse;
}
.message.user .avatar {
  display: none;
}
.message.user .bubble {
  max-width: min(78%, 620px);
  margin-left: auto;
  padding: 10px 15px;
  border-radius: 18px;
  background: #f1f1f1;
}
.bubble {
  min-width: 0;
  color: #252525;
  font-size: 16px;
  line-height: 1.72;
}
.bubble a {
  color: #2563a9;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.composer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 34px max(24px, calc((100% - 760px) / 2))
    max(20px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, #fff 32%);
}
.chat-tools {
  max-width: 760px;
  margin-bottom: 8px;
  gap: 7px;
}
.composer-options {
  max-width: 760px;
  margin: 0 auto 10px;
  justify-content: flex-start;
  gap: 10px;
}
.composer-options label {
  gap: 8px;
  color: #5f646d;
  font-size: 14px;
}
.composer-options .custom-select-menu {
  top: auto;
  bottom: calc(100% + 7px);
  transform: translateY(5px) scale(.985);
  transform-origin: bottom;
}
.translation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.translation-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 3px 9px;
  border: 1px solid #e1e3e6;
  border-radius: 999px;
  color: #666b74;
  background: #f7f7f8;
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
}
.admin-conversation-meta {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 22px;
  padding: 10px 0;
  background: #fff;
}
.tool-toggle,
.tool-button {
  min-height: 34px;
  padding: 6px 10px;
  border-color: #dedede;
  border-radius: 999px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.16s ease;
}
.tool-toggle:hover,
.tool-button:hover {
  background: #f4f4f4;
}
.tool-toggle:has(input:checked) {
  color: #147a5b;
  border-color: #b9dfd2;
  background: #edf8f4;
}
.compose-box {
  max-width: 760px;
  margin: 0 auto;
  min-height: 58px;
  padding: 7px 8px 7px 14px;
  border-color: #d8d8d8;
  border-radius: 26px;
  box-shadow:
    0 2px 12px #00000010,
    0 8px 32px #0000000a;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.compose-box:focus-within {
  border-color: #aaa;
  box-shadow:
    0 2px 14px #00000016,
    0 8px 32px #0000000a;
}
.compose-box textarea {
  min-height: 42px;
  padding: 10px 6px;
  color: #222;
  font-size: 16px;
  line-height: 1.45;
}
.compose-box textarea::placeholder {
  color: #999;
}
.send {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #111;
  font-size: 22px;
  line-height: 1;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease;
}
.send:hover {
  transform: scale(1.04);
  background: #292929;
}
.send:disabled {
  opacity: 0.35;
  transform: none;
  cursor: default;
}
.thinking {
  display: inline-flex;
  gap: 4px;
  padding: 8px 0;
}
.thinking i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #888;
  animation: thinking 1.2s infinite ease-in-out;
}
.thinking i:nth-child(2) {
  animation-delay: 0.15s;
}
.thinking i:nth-child(3) {
  animation-delay: 0.3s;
}
.image-preview {
  max-width: 760px;
  padding: 6px;
  border-radius: 12px;
  background: #f5f5f5;
}
.video-panel {
  background: #f7f7f7;
  padding: 34px clamp(20px, 5vw, 64px);
}
.video-panel > header,
.video-grid {
  max-width: 1100px;
  margin-right: auto;
  margin-left: auto;
}
.video-panel > header h1 {
  margin-bottom: 4px;
  font-size: 26px;
}
.card {
  border-color: #e3e3e3;
  border-radius: 18px;
  box-shadow: 0 4px 18px #00000008;
}
.primary {
  background: #111;
  border-radius: 11px;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}
.primary:hover {
  background: #2b2b2b;
  transform: translateY(-1px);
}
.mobile-menu,
.close-sidebar,
.sidebar-backdrop {
  display: none;
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes thinking {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
}
.admin-side {
  background: #10182a;
  color: #fff;
  padding: 24px 18px;
}
.admin-side button {
  display: block;
  width: 100%;
  padding: 11px;
  margin-top: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c5cfdf;
  text-align: left;
}
.admin-side button.active {
  background: #26334c;
  color: #fff;
}
.admin-main {
  padding: 30px;
  overflow: auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.stat b {
  font-size: 26px;
  display: block;
}
.forms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}
.table th,
.table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}
.table th {
  color: #657187;
  background: #f8f9fc;
}
.link {
  color: var(--brand);
  cursor: pointer;
}
.modal {
  position: fixed;
  inset: 0;
  background: #0b1020aa;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  width: min(760px, 95vw);
  max-height: 85vh;
  overflow: auto;
}
.close {
  float: right;
  border: 0;
  background: #eef1f6;
  border-radius: 8px;
  padding: 7px 11px;
}
@media (max-width: 760px) {
  .app {
    display: block;
    height: 100dvh;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    box-shadow: 18px 0 50px #00000025;
  }
  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: #0008;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .app.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-menu {
    position: fixed;
    z-index: 20;
    top: 12px;
    left: 12px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #222;
    box-shadow: 0 2px 12px #00000012;
    font-size: 20px;
  }
  .close-sidebar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #aaa;
    font-size: 24px;
  }
  .main {
    width: 100%;
    height: 100dvh;
  }
  .workspace {
    height: 100dvh;
  }
  .topbar {
    min-height: 60px;
    height: auto;
    padding: 12px 12px 12px 58px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  .topbar h2 {
    padding-top: 8px;
  }
  .mode-options {
    width: 100%;
    order: 2;
    gap: 8px;
  }
  .mode-options label {
    flex: 1;
    display: grid;
    gap: 4px;
  }
  .mode-options label span {
    font-size: 12px;
  }
  .mode-options select {
    width: 100%;
    min-width: 0;
    height: 40px;
  }
  .messages {
    padding: 24px 15px 190px;
  }
  .empty {
    margin-top: 9vh;
  }
  .empty h2 {
    font-size: 21px;
  }
  .empty .sub {
    padding: 0 12px;
    font-size: 14px;
  }
  .chips {
    display: grid;
    padding: 0 10px;
  }
  .chip {
    width: 100%;
    text-align: left;
  }
  .message {
    margin-bottom: 24px;
    gap: 10px;
  }
  .message .avatar {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }
  .message.user .bubble {
    max-width: 88%;
    padding: 9px 13px;
  }
  .bubble {
    font-size: 16px;
    line-height: 1.65;
  }
  .composer {
    padding: 34px 10px max(10px, env(safe-area-inset-bottom));
  }
  .chat-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
  }
  .chat-tools::-webkit-scrollbar {
    display: none;
  }
  .tool-toggle,
  .tool-button {
    flex: 0 0 auto;
  }
  .compose-box {
    border-radius: 23px;
  }
  .video-panel {
    padding: 72px 14px 24px;
  }
  .video-grid,
  .forms {
    grid-template-columns: 1fr;
  }
  .video-grid {
    gap: 14px;
  }
  .card {
    padding: 18px;
  }
  .login-card {
    width: calc(100vw - 28px);
    padding: 26px 22px;
    border-radius: 20px;
  }
  .login h1 {
    font-size: 25px;
  }
  .admin-shell {
    grid-template-columns: 80px 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Refined product surfaces and custom select controls */
select[data-enhanced="true"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.custom-select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px 9px 14px;
  border: 1px solid #d9dce1;
  border-radius: 13px;
  color: #24272d;
  background: linear-gradient(180deg, #fff, #fbfbfc);
  box-shadow: 0 1px 2px #10182808, inset 0 1px 0 #ffffffcc;
  text-align: left;
  font-size: 15px;
  font-weight: 520;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.custom-select-trigger:hover {
  border-color: #c3c7ce;
  background: #fff;
}
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: #8f96a3;
  box-shadow: 0 0 0 4px #1118270d, 0 3px 9px #1018280f;
}
.custom-select-trigger svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: #737984;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}
.custom-select.open .custom-select-trigger svg {
  transform: rotate(180deg);
}
.custom-select-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  max-height: min(320px, 55vh);
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #e1e3e7;
  border-radius: 14px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px #10182820, 0 3px 12px #10182812;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(.985);
  transform-origin: top;
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
  scrollbar-width: thin;
  scrollbar-color: #c9cdd3 transparent;
}
.custom-select.open .custom-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.custom-select-menu button {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: #32363d;
  background: transparent;
  text-align: left;
  font-size: 15px;
  transition: background .12s ease, color .12s ease;
}
.custom-select-menu button:hover,
.custom-select-menu button:focus-visible {
  outline: none;
  background: #f1f3f5;
}
.custom-select-menu button[aria-selected="true"] {
  color: #111318;
  background: #eceff2;
  font-weight: 650;
}
.mode-options .custom-select-context { width: 176px; }
.mode-options .custom-select-tone { width: 132px; }
.custom-style-input {
  width: min(240px, 30vw);
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #d7dae0;
  border-radius: 12px;
  color: #202329;
  background: #fff;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.custom-style-input:focus {
  border-color: #9da3ad;
  box-shadow: 0 0 0 3px #1118270b;
}
.login {
  background:
    radial-gradient(900px 540px at 16% 0%, #e9eef8 0%, transparent 62%),
    radial-gradient(700px 460px at 100% 100%, #eceff4 0%, transparent 64%),
    #f7f8fa;
}
.login-card {
  border: 1px solid #e6e8eb;
  border-radius: 28px;
  box-shadow: 0 28px 80px #11182712, 0 3px 12px #1118270a;
}
.logo {
  letter-spacing: -0.025em;
  font-weight: 700;
}
.logo-mark {
  border-radius: 11px;
  background: #181a1f;
  box-shadow: 0 5px 16px #11182720;
}
.sidebar {
  background: #16181d;
  border-right: 1px solid #282b32;
}
.identity {
  border: 1px solid #31343c;
  background: #202329;
  box-shadow: inset 0 1px 0 #ffffff08;
}
.nav button {
  min-height: 44px;
  font-weight: 520;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav button:hover { transform: translateX(2px); }
.nav button.active {
  background: #2a2d34;
  box-shadow: inset 0 0 0 1px #ffffff08;
}
.topbar {
  box-shadow: 0 1px 0 #11182705;
}
.topbar h2 { letter-spacing: -0.02em; }
.message.user .bubble {
  border: 1px solid #e5e6e8;
  background: #f4f4f5;
}
.compose-box {
  border-color: #d6d9de;
  box-shadow: 0 12px 38px #1018280c, 0 2px 8px #1018280d;
}
.primary {
  background: #181a1f;
  box-shadow: 0 7px 18px #11182722;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.primary:hover {
  background: #292c32;
  box-shadow: 0 9px 22px #1118272b;
  transform: translateY(-1px);
}
.primary:disabled {
  color: #9b9fa7;
  background: #e6e8eb;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}
.reasoning {
  margin: 0 0 14px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.025);
  font-size: 14px;
}
.reasoning summary {
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-weight: 600;
}
.reasoning[open] summary {
  margin-bottom: 8px;
}
.reasoning div,
.answer {
  white-space: pre-wrap;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 760px) {
  .mode-options .custom-select-context,
  .mode-options .custom-select-tone {
    width: 100%;
  }
  .custom-style-input {
    width: 100%;
  }
  .custom-select-trigger {
    min-height: 42px;
    border-radius: 12px;
  }
  .custom-select-menu {
    max-height: 42vh;
  }
  .composer-options {
    gap: 8px;
    overflow: visible;
  }
  .composer-options label {
    min-width: 0;
  }
}
