:root {
  color: #20231f;
  background: #f7f7f4;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --ink: #20231f;
  --muted: #777b73;
  --line: #dedfd9;
  --panel: #ffffff;
  --soft: #efefea;
  --green: #216e5a;
  --green-dark: #185443;
  --coral: #b9573f;
  --danger: #a13d2d;
  --sidebar: #ecece7;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-width: 320px; overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mobile-only { display: none; }

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.icon-button:hover { background: rgba(32, 35, 31, .07); }
.icon-button svg, .text-button svg, .primary-button svg, .secondary-button svg, .new-chat-button svg { width: 17px; height: 17px; stroke-width: 1.8; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 680; }
.eyebrow { margin: 0 0 10px; color: var(--coral); font-size: 11px; font-weight: 750; letter-spacing: 1.5px; }
.primary-button, .secondary-button, .text-button, .danger-button, .new-chat-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 650;
}
.primary-button { background: var(--ink); color: white; }
.primary-button:hover { background: #000; }
.secondary-button { border-color: var(--line); background: white; }
.secondary-button:hover, .text-button:hover { background: var(--soft); }
.text-button { background: transparent; font-weight: 580; }
.danger-button { border-color: var(--danger); background: var(--danger); color: white; }
.danger-button:hover { background: #7f2e22; }
.wide { width: 100%; }

.auth-shell {
  height: 100vh;
  min-height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(360px, 1fr);
  overflow-y: auto;
  background: #f7f7f4;
}
.auth-panel { min-height: 100vh; display: flex; flex-direction: column; padding: 42px clamp(28px, 5vw, 78px); background: white; }
.auth-wordmark { align-self: flex-start; }
.auth-form { width: min(100%, 360px); margin: auto; display: grid; gap: 18px; padding: 48px 0; }
.auth-heading { margin-bottom: 8px; }
.auth-heading h1 { margin: 0 0 10px; font-family: Georgia, "Songti SC", serif; font-size: 36px; font-weight: 500; letter-spacing: 0; }
.auth-heading p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.field { display: grid; gap: 8px; }
.field > span:first-child { font-size: 13px; font-weight: 650; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: white;
  padding: 10px 12px;
}
.field input, .field select { height: 44px; }
.field textarea { min-height: 132px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33, 110, 90, .12); }
.field input[readonly] { background: var(--soft); color: var(--muted); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; right: 3px; top: 3px; }
.form-error { min-height: 18px; margin: -5px 0 0; color: var(--danger); font-size: 13px; line-height: 1.4; }
.legal-consent { display: grid; gap: 9px; }
.legal-consent label { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.legal-consent input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--green); }
.legal-consent a, .site-legal-footer a, .legal-document a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 2px; }
.auth-note {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(36px, 5vw, 72px);
  background: #243f38;
  color: #f5f3e9;
}
.auth-note::before { content: "年"; position: absolute; right: -2vw; top: -13vh; color: rgba(255,255,255,.055); font-family: Georgia, "Songti SC", serif; font-size: min(58vw, 700px); line-height: 1; }
.auth-year { position: relative; font-family: Georgia, serif; font-size: clamp(54px, 7vw, 112px); line-height: .83; }
.auth-note p { position: relative; margin: 0 0 7px; color: #cdd7d0; font-size: 14px; line-height: 1.8; text-align: right; }

.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 224px minmax(0, 1fr); background: #f5f6f3; }
.product-rail { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-right: 1px solid #303632; background: #181d1a; color: #f4f6f2; }
.product-brand { min-height: 94px; display: grid; align-content: center; gap: 5px; border-bottom: 1px solid #303632; padding: 18px 20px; }
.product-brand .wordmark { font-size: 18px; }
.product-brand > span { color: #8f9993; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.product-nav { display: grid; align-content: start; gap: 5px; padding: 18px 12px; }
.product-nav-item { width: 100%; height: 44px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 6px; background: transparent; color: #aeb7b1; padding: 0 12px; font-size: 13px; font-weight: 620; text-align: left; }
.product-nav-item:hover { background: #232925; color: white; }
.product-nav-item.active { background: #f2f5f1; color: #1e2622; }
.product-nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.product-account { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid #303632; padding: 14px 14px 13px; }
.product-account .account-copy span { color: #8f9993; }
.product-account-actions { display: flex; gap: 1px; }
.product-account .icon-button { width: 34px; height: 34px; color: #aeb7b1; }
.product-account .icon-button:hover { background: #2a302c; color: white; }
.workspace-filing { grid-column: 1 / -1; display: grid; gap: 2px; margin: 2px 0 0; color: #737d77; font-size: 8px; line-height: 1.4; }
.workspace-filing a:hover { color: #c5cdc8; }
.product-stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.product-view { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.chat-product { overflow: hidden; }
.chat-shell { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); overflow: hidden; }
.app-shell.sidebar-collapsed .chat-shell { grid-template-columns: minmax(0, 1fr); }
.app-shell.sidebar-collapsed .sidebar { display: none; }
.sidebar { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--sidebar); padding: 20px 14px 14px; }
.sidebar-header { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px; }
.sidebar-header > strong { font-size: 14px; }
.new-chat-button { width: 100%; justify-content: flex-start; margin-top: 17px; border-color: #d5d6cf; background: rgba(255,255,255,.65); }
.new-chat-button:hover { background: white; }
.sidebar-label { padding: 25px 10px 8px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-row { position: relative; display: flex; align-items: center; border-radius: 6px; }
.conversation-row:hover, .conversation-row.active { background: rgba(255,255,255,.72); }
.conversation-open { min-width: 0; flex: 1; height: 40px; overflow: hidden; border: 0; background: transparent; padding: 0 38px 0 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conversation-delete { position: absolute; right: 3px; width: 32px; height: 32px; opacity: 0; }
.conversation-row:hover .conversation-delete, .conversation-row:focus-within .conversation-delete { opacity: 1; }
.conversation-empty { padding: 12px 10px; color: var(--muted); font-size: 13px; }
.avatar { width: 35px; height: 35px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; background: #d9d9d2; }
.account-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.account-copy strong { font-size: 13px; }
.account-copy span { color: var(--muted); font-size: 11px; }

.workspace { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: 64px minmax(0, 1fr) auto; overflow: hidden; background: #fafaf8; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 22px; background: rgba(250,250,248,.94); }
.topbar-context { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.profile-switcher { min-width: 0; max-width: 300px; flex: 1; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(33,110,90,.12); }
.profile-switcher select { min-width: 0; width: 100%; height: 38px; appearance: none; border: 0; outline: 0; background: transparent; padding: 0 24px 0 0; overflow: hidden; font-weight: 650; text-overflow: ellipsis; }
.profile-switcher > svg { width: 15px; margin-left: -25px; pointer-events: none; }
.assistant-name { font-weight: 650; }
.ai-identity { flex: 0 0 auto; border-left: 1px solid var(--line); color: var(--muted); padding-left: 12px; font-size: 11px; }
.topbar-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.face-entry { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; border-radius: 6px; color: var(--green-dark); padding: 0 10px; font-size: 12px; font-weight: 700; }
.face-entry:hover { background: rgba(33,110,90,.08); }
.face-entry svg { width: 17px; height: 17px; }
.sidebar-open-button { display: none; }
.app-shell.sidebar-collapsed .sidebar-open-button { display: inline-grid; }
.chat-scroll { min-height: 0; height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.empty-state { width: min(760px, calc(100% - 40px)); min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 0; }
.empty-mark { width: 60px; height: 60px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--green); font-family: Georgia, "Songti SC", serif; font-size: 26px; }
.empty-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.empty-state h1 { margin: 24px 0 34px; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 500; letter-spacing: 0; }
.prompt-grid { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.prompt-grid button { min-height: 74px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 14px; text-align: left; font-size: 13px; line-height: 1.5; }
.prompt-grid button:hover { border-color: #b9bcb2; background: #fdfdfb; }
.prompt-grid svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--green); }
.message-list { width: min(780px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 56px; }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 13px; padding: 19px 0; }
.message + .message { border-top: 1px solid #ecece7; }
.message-avatar { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--soft); object-fit: cover; font-family: Georgia, "Songti SC", serif; font-size: 13px; }
.message.user .message-avatar { background: var(--ink); color: white; }
.message-body { min-width: 0; padding-top: 4px; }
.message-author { margin: 0 0 8px; font-size: 12px; font-weight: 750; }
.generated-label { display: inline-block; margin-left: 7px; border: 1px solid #cfd8d3; border-radius: 4px; color: var(--green-dark); padding: 1px 5px; font-size: 9px; font-weight: 700; vertical-align: 1px; }
.message-content { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 15px; line-height: 1.78; }
.admin-action-card { display: grid; gap: 11px; margin-top: 14px; border: 1px solid #cfd8d3; border-radius: 6px; background: #f8fbf9; padding: 14px; }
.admin-action-card.high-risk { border-color: #dfb6ad; background: #fff9f7; }
.admin-action-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-action-card > header strong { font-size: 14px; }
.admin-action-status { flex: 0 0 auto; border: 1px solid #c2d2ca; border-radius: 4px; color: var(--green-dark); padding: 2px 6px; font-size: 10px; font-weight: 700; }
.high-risk .admin-action-status, .status-failed .admin-action-status { border-color: #dfb6ad; color: var(--danger); }
.admin-action-summary, .admin-action-warning { margin: 0; font-size: 13px; line-height: 1.65; }
.admin-action-warning { color: var(--danger); font-weight: 650; }
.admin-action-change { border-top: 1px solid rgba(32,35,31,.1); padding-top: 9px; }
.admin-action-change summary { cursor: pointer; font-size: 12px; font-weight: 680; }
.admin-action-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.admin-action-comparison > div { min-width: 0; }
.admin-action-comparison span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.admin-action-comparison pre, .admin-action-result, .admin-action-error { max-height: 260px; margin: 0; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 9px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12px; line-height: 1.6; user-select: text; }
.admin-action-result { border-color: #b9d0c5; color: var(--green-dark); }
.admin-action-error { border-color: #dfb6ad; color: var(--danger); }
.admin-action-buttons { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid rgba(32,35,31,.1); padding-top: 11px; }
.error-message .message-avatar { background: #f8e5e1; color: var(--danger); }
.error-message .message-avatar svg { width: 16px; height: 16px; }
.message-error-header { min-height: 32px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.message-error-header .message-author { margin-top: 4px; color: var(--danger); }
.copy-error-button { min-height: 30px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; border: 1px solid #e0b8af; border-radius: 5px; background: white; color: var(--danger); padding: 0 9px; font-size: 12px; }
.copy-error-button:hover { background: #fcf3f1; }
.copy-error-button svg { width: 14px; height: 14px; }
.message-error-content { margin: 5px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; user-select: text; color: #713126; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.65; }
.typing-cursor::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 3px; background: var(--green); vertical-align: -2px; animation: blink .9s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer-wrap { padding: 10px 22px 13px; background: #fafaf8; }
.composer { width: min(780px, 100%); min-height: 54px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; border: 1px solid #cfd1ca; border-radius: 8px; background: white; padding: 9px 9px 9px 15px; box-shadow: 0 7px 26px rgba(32,35,31,.06); }
.composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33,110,90,.1), 0 7px 26px rgba(32,35,31,.06); }
.composer textarea { min-height: 34px; max-height: 160px; flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 6px 0; line-height: 1.5; }
.composer-tool { width: 36px; height: 36px; flex: 0 0 auto; color: var(--muted); }
.composer-tool:hover { color: var(--green-dark); }
.composer-tool.active { background: #e1eee9; color: var(--green-dark); box-shadow: inset 0 0 0 1px #bdd4cb; }
.composer-tool.recording { background: #f8e5e1; color: var(--danger); animation: recording-pulse 1.25s ease-in-out infinite; }
.composer-tool svg { width: 18px; height: 18px; }
.pending-attachment-list { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 1px; }
.pending-attachment { position: relative; width: 66px; height: 66px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.pending-attachment img { width: 100%; height: 100%; object-fit: cover; }
.pending-attachment button { position: absolute; top: 2px; right: 2px; width: 23px; height: 23px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(20,22,19,.72); color: white; padding: 0; }
.pending-attachment button svg { width: 13px; height: 13px; }
.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.message-attachment-wrap { width: min(360px, 100%); position: relative; }
.message-attachment-open { display: block; }
.message-attachment { width: 100%; max-height: 440px; display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); object-fit: contain; }
.message-attachment-download { width: 34px; height: 34px; position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 5px; background: rgba(20,22,19,.72); color: white; backdrop-filter: blur(8px); }
.message-attachment-download:hover { background: rgba(20,22,19,.9); }
.message-attachment-download svg { width: 16px; }
.image-generating .message-content { color: var(--muted); }
@keyframes recording-pulse { 50% { box-shadow: 0 0 0 5px rgba(161,61,45,.12); } }
.send-button { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 6px; background: var(--ink); color: white; }
.send-button:hover { background: #000; }
.send-button svg { width: 18px; }
.composer-wrap > p { margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.site-legal-footer { color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }
.site-legal-footer nav, .site-legal-footer p { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 12px; margin: 0; }
.site-legal-footer a { color: inherit; }
.auth-legal-footer { flex: 0 0 auto; padding-top: 14px; }
.auth-legal-footer p + p { margin-top: 2px; }
.app-legal-footer { margin-top: 5px; }
.app-legal-footer nav { margin-bottom: 1px; }

.workbench-home { overflow-y: auto; background: #f5f6f3; padding: 0 clamp(24px, 4vw, 58px) 48px; }
.product-page-header { min-height: 134px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); }
.product-page-header h1, .avatar-product-header h1 { margin: 0; font-size: 28px; font-weight: 680; }
.product-page-header > div:first-child > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.product-page-header .eyebrow, .avatar-product-header .eyebrow { margin-bottom: 8px; color: #8b503d; letter-spacing: 1.2px; }
.workbench-overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .75fr); gap: 40px; padding-top: 34px; }
.section-title-row { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-title-row h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.section-title-row > span { color: var(--muted); font-size: 11px; }
.product-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.product-card { min-width: 0; min-height: 128px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 15px; border: 1px solid #d8dad4; border-radius: 8px; background: white; padding: 20px; text-align: left; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.product-card:hover { border-color: #b9beb7; box-shadow: 0 10px 28px rgba(28,34,30,.07); transform: translateY(-1px); }
.product-card > svg { width: 17px; color: #92978f; }
.product-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; }
.product-icon svg { width: 22px; height: 22px; stroke-width: 1.7; }
.chat-card .product-icon { background: #dfece7; color: #226955; }
.files-card .product-icon { background: #e5ebf5; color: #3f5f91; }
.avatar-card .product-icon { background: #f1e6e1; color: #95533f; }
.product-card-copy { min-width: 0; display: grid; gap: 7px; }
.product-card-copy strong { font-size: 15px; }
.product-card-copy small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.workspace-activity { border-left: 1px solid var(--line); padding-left: 30px; }
.workspace-activity dl { display: grid; margin: 13px 0 0; }
.workspace-activity dl div { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.workspace-activity dt { color: var(--muted); font-size: 12px; }
.workspace-activity dd { margin: 0; font-size: 12px; font-weight: 680; }
.workspace-status { display: flex; align-items: center; gap: 11px; margin-top: 24px; border: 1px solid #d3ded8; border-radius: 7px; background: #f9fcfa; padding: 13px; }
.workspace-status > span { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #2c8067; box-shadow: 0 0 0 4px rgba(44,128,103,.1); }
.workspace-status p { display: grid; gap: 3px; margin: 0; }
.workspace-status strong { font-size: 11px; }
.workspace-status small { color: var(--muted); font-size: 10px; }

.files-product { display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; background: #fbfbf9; padding: 0 clamp(22px, 3vw, 44px) 28px; }
.files-header { min-height: 122px; }
.file-primary-actions { display: flex; gap: 8px; }
.file-commandbar { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 280px) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.file-breadcrumbs { min-width: 0; display: flex; align-items: center; overflow: hidden; }
.file-breadcrumbs button { min-width: 0; height: 34px; overflow: hidden; border: 0; background: transparent; padding: 0 6px; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-breadcrumbs button + button::before { margin-right: 10px; color: #a6aaa3; content: '/'; }
.file-breadcrumbs button:last-child { color: var(--green-dark); }
.file-search { height: 38px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 0 10px; }
.file-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(33,110,90,.09); }
.file-search svg { width: 15px; color: var(--muted); }
.file-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.view-segment { display: grid; grid-template-columns: repeat(2, 34px); border: 1px solid var(--line); border-radius: 6px; background: white; padding: 2px; }
.view-segment button { width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
.view-segment button.active { background: var(--soft); color: var(--ink); }
.view-segment svg { width: 15px; }
.file-browser { min-height: 0; position: relative; overflow-y: auto; overscroll-behavior: contain; }
.file-browser.dragging::after { position: absolute; inset: 10px; z-index: 4; display: grid; place-items: center; border: 1px dashed #6e9a8b; border-radius: 8px; background: rgba(238,247,243,.94); color: var(--green-dark); content: '松开以上传原始文件'; font-size: 14px; font-weight: 700; }
.file-list-head, .file-row { display: grid; grid-template-columns: minmax(220px, 1fr) 110px 150px 128px; align-items: center; gap: 14px; }
.file-list-head { height: 42px; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: #fbfbf9; color: var(--muted); padding: 0 10px; font-size: 10px; font-weight: 700; }
.file-row { min-height: 58px; border-bottom: 1px solid #ebede8; padding: 6px 8px 6px 10px; }
.file-row:hover { background: #f3f5f1; }
.file-name-button { min-width: 0; height: 44px; display: flex; align-items: center; gap: 12px; overflow: hidden; border: 0; background: transparent; padding: 0; text-align: left; }
.file-type-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: #e8ece7; color: #5f6962; }
.file-type-icon.folder { background: #e4eaf3; color: #46658e; }
.file-type-icon.image { background: #e7eee9; color: #39715f; }
.file-type-icon.has-thumbnail { overflow: hidden; background: #e7e9e5; }
.file-image-thumbnail { width: 100%; height: 100%; display: block; object-fit: contain; background: #f1f3f0; }
.file-type-icon.audio { background: #f2e9e2; color: #985a3c; }
.file-type-icon.video { background: #ece7ef; color: #735584; }
.file-type-icon svg { width: 17px; height: 17px; }
.file-name-copy { min-width: 0; display: grid; gap: 3px; }
.file-name-copy strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-name-copy small { display: none; color: var(--muted); font-size: 10px; }
.file-size, .file-updated { color: var(--muted); font-size: 11px; }
.file-row-actions { display: flex; justify-content: flex-end; gap: 1px; opacity: 0; }
.file-row:hover .file-row-actions, .file-row:focus-within .file-row-actions { opacity: 1; }
.file-row-actions button, .file-row-actions a { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #656a63; padding: 0; }
.file-row-actions button:hover, .file-row-actions a:hover { background: white; color: var(--ink); }
.file-row-actions svg { width: 15px; height: 15px; }
.file-more-button { display: none !important; }
.files-product.grid-view .file-list-head { display: none; }
.file-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 11px; padding: 16px 2px; }
.file-list.grid .file-row { min-height: 154px; position: relative; display: grid; grid-template-columns: 1fr; align-content: space-between; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 16px; }
.file-list.grid .file-name-button { height: auto; align-items: flex-start; flex-direction: column; gap: 17px; }
.file-list.grid .file-type-icon { width: 46px; height: 46px; }
.file-list.grid .file-type-icon.has-thumbnail { width: 100%; height: auto; aspect-ratio: 1; }
.file-list.grid .file-name-copy small { display: block; }
.file-list.grid .file-size, .file-list.grid .file-updated { display: none; }
.file-list.grid .file-row-actions { position: absolute; right: 9px; bottom: 9px; opacity: 1; }
.file-list.grid .file-row-actions button:not(.file-more-button), .file-list.grid .file-row-actions a { display: none; }
.file-list.grid .file-row-actions .file-more-button { display: grid !important; }
.file-list.grid .file-row.actions-open .file-row-actions { display: flex; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 3px; box-shadow: 0 8px 24px rgba(25,30,27,.14); }
.file-list.grid .file-row.actions-open .file-row-actions button, .file-list.grid .file-row.actions-open .file-row-actions a { display: grid; }
.file-empty { min-height: 330px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.file-empty > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 8px; background: #eef0ec; color: #727a73; }
.file-empty svg { width: 24px; }
.file-empty h2 { margin: 8px 0 0; color: var(--ink); font-size: 15px; }
.file-empty p { margin: 0 0 7px; font-size: 11px; }
.file-upload-progress { width: min(420px, calc(100% - 32px)); position: fixed; z-index: 25; right: 24px; bottom: 24px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 15px; box-shadow: 0 16px 42px rgba(25,30,27,.15); }
.file-upload-progress > span { height: 4px; display: block; overflow: hidden; border-radius: 2px; background: #e5e7e2; }
.file-upload-progress > span > span { width: 0; height: 100%; display: block; background: var(--green); transition: width .2s ease; }
.file-upload-progress p { margin: 9px 0 0; font-size: 11px; }

.avatar-product { background: #171b19; }
.avatar-frame-wrap { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.avatar-frame-wrap iframe { width: 100%; height: 100%; display: block; border: 0; background: #171b19; }

.share-dialog { width: min(540px, calc(100vw - 28px)); }
.share-summary { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fafbf9; padding: 13px; }
.share-summary > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: #e4eee9; color: var(--green-dark); }
.share-summary svg { width: 18px; }
.share-summary p { min-width: 0; display: grid; gap: 4px; margin: 0; }
.share-summary strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.share-summary small { color: var(--muted); font-size: 11px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.copy-field .secondary-button { height: 44px; }
.share-expiry { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 2px; font-size: 12px; }
.share-expiry span { color: var(--muted); }
.file-preview-dialog { width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: hidden; background: #f2f3f0; }
.file-preview-shell { max-height: calc(100dvh - 24px); display: grid; grid-template-rows: 68px minmax(0, 1fr); }
.file-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: white; padding: 0 18px; }
.file-preview-header > div:first-child { min-width: 0; }
.file-preview-header .eyebrow { margin-bottom: 3px; }
.file-preview-header h2 { max-width: 620px; margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-header > div:last-child { display: flex; gap: 7px; }
.file-preview-header .icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: white; color: #626a63; padding: 0; }
.file-preview-header .icon-button:hover { border-color: #aab6ad; background: #f8faf7; color: var(--ink); }
.file-preview-header .icon-button svg { width: 16px; }
.file-preview-content { width: 100%; min-height: min(360px, calc(100dvh - 110px)); max-height: calc(100dvh - 92px); display: grid; place-items: center; overflow: auto; padding: 20px; }
.file-preview-content img, .file-preview-content video { width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 132px); object-fit: contain; }
.file-preview-content audio { width: min(560px, 100%); }
.file-preview-content iframe { width: 100%; height: 100%; border: 0; background: white; }
.file-preview-fallback { display: grid; place-items: center; gap: 12px; color: var(--muted); text-align: center; }
.file-preview-fallback span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 8px; background: white; }
.file-preview-fallback svg { width: 25px; }

.panel-scrim, .sidebar-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(20,22,19,.27); }
.settings-panel { position: fixed; z-index: 40; top: 0; right: 0; width: min(580px, 100vw); height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: white; border-left: 1px solid var(--line); box-shadow: -15px 0 45px rgba(25,28,24,.12); transform: translateX(102%); transition: transform .22s ease; }
.settings-panel.open { transform: translateX(0); }
.settings-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 16px 22px; }
.settings-header .eyebrow, .dialog-header .eyebrow { margin-bottom: 5px; }
.settings-header h2, .dialog-header h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 24px; font-weight: 500; }
.settings-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding: 0 22px; }
.settings-tabs button { min-width: 0; height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 0 8px; font-size: 13px; font-weight: 650; }
.settings-tabs button.active { border-bottom-color: var(--green); color: var(--ink); }
.settings-view { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.product-settings-view { overflow: hidden; }
.product-config-heading { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 17px 22px; }
.product-config-heading > div { min-width: 0; }
.product-config-heading strong { display: block; margin-bottom: 3px; font-size: 14px; }
.product-config-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.product-config-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; background: var(--green); color: white; }
.product-config-icon svg { width: 18px; }
.settings-subtabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border-bottom: 1px solid var(--line); background: #f7f8f5; padding: 8px 22px; }
.settings-subtabs button { min-width: 0; height: 34px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.settings-subtabs button.active { border-color: var(--line); background: white; color: var(--ink); box-shadow: 0 1px 2px rgba(25,28,24,.05); }
.product-config-section { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.settings-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.settings-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-list { min-height: 0; flex: 1; overflow-y: auto; border-top: 1px solid #ededE8; }
.profile-row { padding: 19px 22px; border-bottom: 1px solid #ededE8; }
.profile-row.active { box-shadow: inset 3px 0 var(--green); }
.profile-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-copy { min-width: 0; }
.profile-copy strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; overflow-wrap: anywhere; font-size: 14px; }
.active-label { color: var(--green); font-size: 10px; font-weight: 750; }
.profile-copy p { margin: 3px 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; line-height: 1.5; }
.setting-preview { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; white-space: pre-wrap; }
.feedback-content { max-height: 140px; overflow-y: auto; border-left: 2px solid var(--line); color: var(--ink) !important; padding-left: 10px; white-space: pre-wrap; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.profile-actions button { height: 32px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 10px; font-size: 12px; }
.profile-actions button:hover { background: var(--soft); }
.profile-actions .danger { color: var(--danger); }
.profile-empty { padding: 50px 22px; color: var(--muted); text-align: center; }
.agent-row-identity { min-width: 0; display: flex; align-items: flex-start; gap: 11px; }
.agent-row-identity .profile-copy { flex: 1; }
.agent-list-avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--soft); object-fit: cover; color: var(--green-dark); font-family: Georgia, "Songti SC", serif; font-size: 15px; }
.agent-access { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-top: 14px; }
.agent-access > p { width: 100%; margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.agent-access label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.agent-access input { width: 15px; height: 15px; accent-color: var(--green); }
.agent-access input:disabled { cursor: not-allowed; opacity: .65; }
.toggle-control { position: relative; width: 40px; height: 24px; flex: 0 0 auto; cursor: pointer; }
.toggle-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-track { position: absolute; inset: 0; border-radius: 12px; background: #c9cbc4; transition: background .16s ease; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(20,22,19,.22); transition: transform .16s ease; }
.toggle-control input:checked + .toggle-track { background: var(--green); }
.toggle-control input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-control input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(33,110,90,.16); }
.toggle-control input:disabled + .toggle-track { opacity: .45; cursor: not-allowed; }
.model-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.model-picker .secondary-button { height: 44px; white-space: nowrap; }
.avatar-editor { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 14px; }
.agent-avatar-preview { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: var(--soft); color: var(--green-dark); font-family: Georgia, "Songti SC", serif; font-size: 25px; }
.agent-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-editor-copy { min-width: 0; }
.avatar-editor-copy > strong { font-size: 13px; }
.avatar-editor-copy > p { margin: 4px 0 9px; color: var(--muted); font-size: 11px; }
.avatar-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-editor-actions button { min-height: 34px; padding: 0 10px; font-size: 12px; }

.dialog { width: min(500px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; clip-path: inset(0 round 8px); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 22px 80px rgba(20,22,19,.25); }
.compact-dialog { width: min(440px, calc(100vw - 28px)); }
.dialog::backdrop { background: rgba(20,22,19,.38); }
.dialog-body { display: grid; gap: 17px; padding: 22px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 4px; }
.dialog-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.interview-dialog { width: min(720px, calc(100vw - 28px)); }
.interview-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.interview-tabs button { height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; }
.interview-tabs button[aria-selected="true"] { border-bottom-color: var(--green); color: var(--ink); }
.interview-form { display: grid; gap: 18px; }
.training-relationship-details { border: 1px solid var(--line); border-radius: 6px; background: #fafbf9; }
.training-relationship-details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 13px; cursor: pointer; list-style: none; }
.training-relationship-details summary::-webkit-details-marker { display: none; }
.training-relationship-details summary strong { font-size: 13px; }
.training-relationship-details summary span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.training-relationship-details summary::after { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); content: ''; transform: rotate(45deg); transition: transform .15s ease; }
.training-relationship-details[open] summary::after { transform: rotate(225deg); }
.training-relationship-content { display: grid; gap: 14px; border-top: 1px solid var(--line); padding: 14px; }
.training-relationship-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.training-inline-actions { display: flex; justify-content: flex-end; margin-top: -7px; }
.summary-review-actions { gap: 8px; margin-top: 2px; }
.training-drop-zone { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; min-height: 86px; border: 1px dashed #b9c5be; border-radius: 6px; padding: 14px; background: #fafbf9; transition: border-color .15s ease, background .15s ease; }
.training-drop-zone.dragging { border-color: var(--green); background: #f1f7f4; }
.training-file-summary { min-width: 0; display: grid; gap: 5px; }
.training-file-summary strong { font-size: 13px; }
.training-file-summary p { overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.training-file-summary .text-button { width: max-content; min-height: 28px; padding: 0; }
.training-progress { min-height: 20px; margin: -6px 0 0; color: var(--green-dark); font-size: 12px; }
.training-run-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.training-run.processing { border-color: #8eb5a6; }
.training-run.processing .training-run-status, .training-run.pending .training-run-status { color: var(--green-dark); }
.training-run.failed { border-color: #ddb6b1; }
.training-run.failed .training-run-status, .training-run.failed p { color: var(--danger); }
.training-change-review { display: grid; gap: 10px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.training-change-review section { display: grid; gap: 5px; }
.training-change-review ul { display: grid; gap: 4px; margin: 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.training-test-chat { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: #fafbf9; }
.training-test-chat > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.training-test-chat > header div { display: grid; gap: 3px; }
.training-test-chat > header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.training-test-chat > header .text-button { flex: 0 0 auto; white-space: nowrap; }
.training-test-messages { display: grid; gap: 7px; max-height: 260px; overflow-y: auto; padding: 4px 0; }
.training-test-message { width: fit-content; max-width: 82%; margin: 0; border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.training-test-message.user { justify-self: end; background: var(--ink); color: white; }
.training-test-message.assistant { justify-self: start; border: 1px solid var(--line); background: white; color: var(--ink); }
.training-test-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.training-test-composer textarea { min-height: 64px; resize: vertical; }
.summary-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.summary-toolbar select { width: min(280px, 60%); }
.summary-toolbar span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.interview-section { display: grid; gap: 12px; }
.interview-section h3, .daily-history h3 { margin: 4px 0 0; font-size: 15px; }
.interview-section > p { margin: -5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.interview-question { display: grid; gap: 7px; }
.interview-question span { font-size: 13px; line-height: 1.55; }
.interview-question textarea { min-height: 82px; resize: vertical; }
.daily-history { display: grid; gap: 10px; padding-top: 4px; }
.daily-record { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.daily-record header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.daily-record strong { font-size: 13px; }
.daily-record p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.daily-record p b { color: var(--ink); font-weight: 650; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; max-width: calc(100vw - 28px); transform: translate(-50%, 20px); border-radius: 6px; background: var(--ink); color: white; padding: 11px 15px; opacity: 0; pointer-events: none; font-size: 13px; transition: .18s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-note { display: none; }
  .auth-panel { min-height: 100vh; }
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 58px minmax(0, 1fr); }
  .product-rail { position: relative; z-index: 24; display: flex; align-items: center; border-right: 0; border-bottom: 1px solid #303632; }
  .product-brand { min-width: 0; min-height: 58px; flex: 1; border: 0; padding: 0 16px; }
  .product-brand > span { display: none; }
  .product-brand .wordmark { font-size: 15px; }
  .product-nav { position: fixed; z-index: 24; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); display: flex; gap: 0; border-top: 1px solid #303632; background: #181d1a; padding: 5px 4px env(safe-area-inset-bottom); }
  .product-nav-item { min-width: 0; height: 52px; flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 0 3px; font-size: 10px; }
  .product-nav-item.active { background: #2a302c; color: white; }
  .product-nav-item svg { width: 18px; height: 18px; }
  .product-account { display: flex; flex: 0 0 auto; border: 0; padding: 0 10px; }
  .product-account .account-copy { display: none; }
  .workspace-filing { display: none; }
  .product-stage { padding-bottom: 62px; }
  .chat-shell { grid-template-columns: 1fr; }
  .app-shell.sidebar-collapsed .sidebar { display: flex; }
  .mobile-only { display: inline-grid; }
  .sidebar { position: fixed; z-index: 35; inset: 58px auto 62px 0; width: min(300px, 88vw); height: auto; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 15px 0 45px rgba(20,22,19,.16); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-open-button, .app-shell.sidebar-collapsed .sidebar-open-button { display: inline-grid; }
  .conversation-delete { opacity: 1; }
  .topbar { padding: 0 13px; }
  .profile-switcher { margin-left: 6px; }
  .text-button span { display: none; }
  .workbench-home { padding-right: 24px; padding-left: 24px; }
  .workbench-overview { grid-template-columns: 1fr; gap: 30px; }
  .workspace-activity { border-top: 1px solid var(--line); border-left: 0; padding-top: 26px; padding-left: 0; }
  .files-product { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 620px) {
  .auth-panel { padding: 26px 22px; }
  .auth-form { padding: 36px 0; }
  .auth-heading h1 { font-size: 31px; }
  .topbar { height: 58px; gap: 6px; padding: 0 8px; }
  .workspace { grid-template-rows: 58px minmax(0, 1fr) auto; }
  .profile-switcher { max-width: none; margin-left: 0; }
  .profile-switcher select { max-width: 100%; }
  .topbar-actions { gap: 0; }
  .sidebar-open-button { width: 36px; flex: 0 0 auto; }
  .ai-identity { display: none; }
  .empty-state { width: calc(100% - 28px); padding: 36px 0; justify-content: flex-start; }
  .empty-state h1 { margin: 20px 0 26px; font-size: 25px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-grid button { min-height: 56px; align-items: center; }
  .message-list { width: calc(100% - 28px); padding-top: 20px; }
  .message { grid-template-columns: 29px minmax(0, 1fr); gap: 10px; }
  .message-avatar { width: 28px; height: 28px; }
  .message-content { font-size: 14px; }
  .admin-action-card { padding: 12px; }
  .admin-action-comparison { grid-template-columns: 1fr; }
  .admin-action-buttons { align-items: stretch; flex-direction: column-reverse; }
  .admin-action-buttons button { width: 100%; }
  .composer-wrap { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .composer { gap: 7px; padding-left: 11px; }
  .composer-tool { width: 34px; height: 34px; }
  .settings-toolbar { align-items: flex-start; }
  .settings-header { min-height: 70px; padding: 12px 16px; }
  .settings-tabs { padding: 0 8px; }
  .settings-tabs button { height: 42px; padding: 0 4px; font-size: 12px; }
  .settings-toolbar { padding: 14px 16px; }
  .product-config-heading { padding: 14px 16px; }
  .settings-subtabs { padding: 7px 16px; }
  .profile-row { padding: 17px 16px; }
  .training-drop-zone { grid-template-columns: 1fr; }
  .training-test-chat > header { align-items: center; }
  .training-test-message { max-width: 92%; }
  .dialog { max-height: calc(100dvh - 20px); }
  .dialog-body { padding: 18px 16px; }
  .interview-dialog { width: min(100vw - 20px, 720px); }
  .interview-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .training-relationship-grid { grid-template-columns: 1fr; }
  .training-drop-zone { grid-template-columns: 1fr; }
  .training-drop-zone .secondary-button { width: 100%; }
  .summary-toolbar { align-items: stretch; flex-direction: column; }
  .summary-toolbar select { width: 100%; }
  .message-error-header { align-items: center; }
  .model-picker { grid-template-columns: 1fr; }
  .model-picker .secondary-button { width: 100%; }
  .app-legal-footer p span { display: none; }
  .product-page-header { min-height: 108px; }
  .product-page-header h1 { font-size: 23px; }
  .product-page-header > div:first-child > p:last-child { font-size: 11px; }
  #homeSettingsButton span { display: none; }
  .product-card-grid { grid-template-columns: 1fr; }
  .product-card { min-height: 96px; padding: 15px; }
  .product-card-copy small { white-space: normal; }
  .files-product { padding: 0 13px 13px; }
  .files-header { min-height: 104px; }
  .files-header > div:first-child > p:last-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-primary-actions .secondary-button { width: 40px; padding: 0; }
  .file-primary-actions .secondary-button span { display: none; }
  .file-primary-actions .primary-button { padding: 0 12px; }
  .file-commandbar { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 8px 0; }
  .file-search { grid-column: 1 / -1; grid-row: 2; }
  .file-list-head { display: none; }
  .file-row { min-height: 68px; position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 8px 2px; }
  .file-row .file-size, .file-row .file-updated { display: none; }
  .file-name-copy small { display: block; }
  .file-row-actions { opacity: 1; }
  .file-row-actions button:not(.file-more-button), .file-row-actions a { display: none; }
  .file-row-actions .file-more-button { display: grid !important; }
  .file-row.actions-open .file-row-actions { position: absolute; z-index: 3; top: 8px; right: 2px; display: flex; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 3px; box-shadow: 0 8px 24px rgba(25,30,27,.14); }
  .file-row.actions-open .file-row-actions button, .file-row.actions-open .file-row-actions a { display: grid; }
  .file-list.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-list.grid .file-row { min-height: 142px; }
  .file-upload-progress { right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); }
  .file-preview-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .file-preview-shell { max-height: calc(100dvh - 12px); }
  .file-preview-header { padding: 0 10px; }
  .file-preview-header .icon-button { width: 36px; height: 36px; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-field .secondary-button { width: 100%; }
}

body.legal-page { min-width: 320px; overflow: auto; background: #f7f7f4; }
.legal-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.legal-back { color: var(--green-dark); font-size: 13px; }
.legal-document { background: white; border: 1px solid var(--line); border-radius: 8px; margin-top: 24px; padding: clamp(24px, 5vw, 48px); }
.legal-document h1 { margin: 0 0 8px; font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 5vw, 38px); font-weight: 500; }
.legal-document h2 { margin: 32px 0 10px; font-size: 18px; }
.legal-document p, .legal-document li { color: #4e534c; font-size: 14px; line-height: 1.85; }
.legal-document ul { padding-left: 20px; }
.legal-effective { margin: 0; color: var(--muted) !important; font-size: 12px !important; }
.legal-warning { border-left: 3px solid var(--coral); background: #fbf4f1; padding: 12px 14px; }
.legal-footer { margin-top: 24px; }
.contact-form { display: grid; gap: 18px; margin-top: 28px; }
.contact-result { min-height: 20px; margin: 0; font-size: 13px; }
.contact-result.success { color: var(--green-dark); }
.contact-result.error { color: var(--danger); }

@media (max-width: 480px) {
  .legal-shell { width: min(100% - 22px, 760px); padding-top: 14px; }
  .legal-document { margin-top: 14px; padding: 22px 17px; }
  .legal-header { padding: 0 4px 14px; }
  .auth-legal-footer { padding-top: 8px; }
  .settings-tabs { padding: 0 4px; }
  .settings-tabs button { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
