:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #768397;
  --line: #e8edf3;
  --canvas: #f5f7fb;
  --white: #fff;
  --blue: #356de2;
  --navy: #17253b;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.auth-overlay, .dialog-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #101c2eb8; backdrop-filter: blur(5px); }
.auth-card, .dialog-card { position: relative; width: min(100%, 440px); padding: 30px; border: 1px solid #e7ebf2; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px #0d1e3740; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.auth-brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.auth-brand strong { color: #1e2a3b; font-size: 14px; }
.auth-brand small { color: #8b97a8; font-size: 10px; }
.auth-card .eyebrow, .dialog-card .eyebrow { margin-bottom: 8px; }
.auth-card h1, .dialog-card h2 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.auth-description, .dialog-description { color: #8491a2; font-size: 12px; line-height: 1.6; margin: 8px 0 21px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; color: #536174; font-size: 11px; font-weight: 600; }
.auth-form input, .auth-form textarea, .auth-form select { width: 100%; border: 1px solid #dfe5ee; outline: 0; border-radius: 7px; padding: 10px 11px; color: #263348; background: #fff; font: inherit; font-size: 12px; resize: vertical; }
.auth-form input:focus, .auth-form textarea:focus, .auth-form select:focus { border-color: #81a1ed; box-shadow: 0 0 0 3px #4775df18; }
.auth-form label small { color: #9aa5b4; font-size: 9px; font-weight: 400; line-height: 1.5; }
.auth-submit { width: 100%; min-height: 39px; margin-top: 5px; }
.form-error { min-height: 17px; margin: 10px 0 0; color: #bd514d; font-size: 10px; line-height: 1.5; }
.dialog-card { width: min(100%, 480px); padding-top: 31px; }
.dialog-card h2 { font-size: 19px; }
.dialog-close { position: absolute; right: 16px; top: 14px; width: 27px; height: 27px; border: 0; border-radius: 6px; background: #f4f6f9; color: #748197; font-size: 20px; line-height: 1; }
.members-card { width: min(100%, 820px); max-height: calc(100vh - 40px); overflow: auto; }
.members-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 27px; margin-top: 20px; }
.members-columns h3 { margin: 0 0 12px; color: #526076; font-size: 11px; }
.membership-submit { justify-content: center; min-height: 38px; border-color: #dce4f3; color: #496da9; }
.members-list-heading { margin-top: 21px !important; }
.member-list { display: flex; flex-direction: column; gap: 7px; max-height: 160px; overflow: auto; }
.member-list-row { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid #edf0f4; border-radius: 7px; }
.member-list-row .avatar { width: 27px; height: 27px; font-size: 10px; }
.member-list-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.member-list-copy strong { color: #4a5668; font-size: 10px; font-weight: 600; }
.member-list-copy small { color: #9ba6b4; font-size: 8px; }
.role-chip { color: #6a7da0; background: #f1f4f9; border-radius: 10px; padding: 4px 7px; font-size: 8px; }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: #101c2e; color: #d7e1f0; min-height: 100vh; display: flex; flex-direction: column; padding: 25px 16px 14px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(140deg, #7c70ff, #3989ed); font-weight: 700; font-size: 17px; box-shadow: 0 6px 16px #315ed344; }
.brand-copy, .workspace-copy, .profile-copy { display: flex; flex-direction: column; }
.brand-copy strong { color: #fff; font-size: 15px; letter-spacing: -.25px; }
.brand-copy small { color: #8594a9; font-size: 11px; margin-top: 2px; }
.workspace-switcher { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #2c3a4f; border-radius: 11px; background: #18263b; margin-bottom: 25px; }
.workspace-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #c6bfff; background: #3c3e6b; font-size: 12px; }
.workspace-copy { flex: 1; gap: 3px; }
.workspace-copy small { color: #8b9bb2; font-size: 10px; }
.workspace-copy strong { color: #f0f4fb; font-size: 12px; }
.chevron { color: #91a0b4; }
.nav-label { color: #73839a; text-transform: uppercase; font-size: 10px; letter-spacing: 1.05px; margin: 0 11px 9px; font-weight: 700; }
.nav-label-spaced { margin-top: 27px; }
.main-nav { display: flex; flex-direction: column; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 11px; margin: 2px 0; border-radius: 8px; color: #aab7c9; font-size: 12px; transition: .16s ease; }
.nav-item:hover { background: #1b2a40; color: #edf3ff; }
.nav-item.active { background: #263b5a; color: #fff; box-shadow: inset 2px 0 #6b8dff; }
.nav-icon { width: 16px; text-align: center; color: #8e9fb7; font-size: 15px; }
.active .nav-icon { color: #9db7ff; }
.nav-count { margin-left: auto; border-radius: 10px; background: #344968; color: #c6d5ee; min-width: 19px; text-align: center; padding: 2px 5px; font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.storage-card { border-radius: 10px; padding: 13px; background: #18263b; border: 1px solid #28384e; margin-bottom: 15px; }
.storage-heading { display: flex; justify-content: space-between; color: #d5dfec; font-size: 11px; }
.storage-value { color: #96a6bc; }
.storage-track { height: 4px; background: #2e3c51; border-radius: 4px; margin: 11px 0 8px; overflow: hidden; }
.storage-track span { display: block; width: 12%; height: 100%; border-radius: inherit; background: #718cff; }
.storage-card small { color: #8494aa; font-size: 10px; }
.profile-button { display: flex; width: 100%; align-items: center; gap: 9px; border: 0; border-top: 1px solid #29374a; padding: 15px 3px 0; background: transparent; color: #fff; text-align: left; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #e1e8ff; color: #4d60a8; font-weight: 700; font-size: 12px; }
.profile-copy { gap: 3px; flex: 1; }
.profile-copy strong { font-size: 11px; font-weight: 600; }
.profile-copy small { font-size: 10px; color: #8796ab; }
.more { color: #8c9ab0; letter-spacing: 2px; }
.main-area { min-width: 0; }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 38px; display: flex; align-items: center; justify-content: space-between; }
.breadcrumbs { color: #8b97a8; display: flex; align-items: center; gap: 11px; font-size: 12px; }
.breadcrumbs strong { color: #374457; font-weight: 600; }
.slash { color: #c4ccd7; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-button { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #6c788a; font-size: 20px; }
.icon-button:hover, .user-chip:hover { background: #f4f6fa; }
.notification-button { font-size: 17px; }
.notification-button i { position: absolute; width: 5px; height: 5px; right: 7px; top: 6px; border-radius: 50%; background: #ee7a69; border: 1px solid white; }
.topbar-divider { width: 1px; height: 24px; background: #e9edf2; margin: 0 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: #435064; background: transparent; border: 0; padding: 4px 7px; border-radius: 8px; font-size: 11px; }
.small-avatar { width: 26px; height: 26px; font-size: 10px; }
.page-content { max-width: 1440px; margin: 0 auto; padding: 35px 38px 28px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.eyebrow { color: #99a5b5; font-size: 9px; font-weight: 700; letter-spacing: 1.3px; margin: 0 0 9px; }
h1 { margin: 0; font-size: 25px; letter-spacing: -.65px; font-weight: 700; }
.wave { color: #e6a149; font-size: 20px; }
.welcome-subtitle { color: #8290a2; font-size: 12px; margin: 8px 0 0; }
.primary-button { border: 0; border-radius: 8px; padding: 10px 15px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; box-shadow: 0 5px 12px #356de228; }
.primary-button:hover { background: #285fd2; }
.primary-button span { font-size: 16px; vertical-align: -1px; margin-right: 4px; }
.connection-banner { display: flex; align-items: center; gap: 13px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid #dce7fc; border-radius: 10px; background: linear-gradient(90deg, #f0f5ff, #f8faff); }
.connection-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #e1eaff; color: #527ce4; font-size: 16px; }
.connection-copy { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.connection-copy strong { color: #364c73; font-size: 11px; }
.connection-copy span { color: #7789a9; font-size: 10px; }
.secondary-button { border: 1px solid #cad8f5; color: #3868c2; background: #fff; border-radius: 7px; padding: 8px 11px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.secondary-button span { margin-left: 7px; font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px #273a5610; }
.metric-card { padding: 15px 16px 13px; min-height: 117px; }
.metric-top { display: flex; justify-content: space-between; align-items: center; }
.metric-label { color: #7c899b; font-size: 10px; font-weight: 500; }
.metric-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; }
.violet { color: #7866d6; background: #f0edff; }
.blue { color: #4b78d8; background: #eaf1ff; }
.orange { color: #d58c48; background: #fff2e6; }
.green { color: #48a584; background: #e8f7f1; }
.metric-number { font-size: 23px; letter-spacing: -.6px; font-weight: 700; margin: 5px 0 4px; }
.metric-foot { color: #9aa5b4; font-size: 9px; }
.positive-dot, .warning-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #56b58d; margin-right: 4px; vertical-align: 1px; }
.warning-dot { background: #edaa5e; }
.trend-up { color: #4ca985; font-weight: 600; margin-right: 4px; }
.muted { color: #aab3c0; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.27fr) minmax(330px, .9fr); gap: 16px; margin-bottom: 17px; }
.panel { padding: 17px 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.panel-heading h2 { font-size: 13px; margin: 0; letter-spacing: -.15px; }
.panel-heading p { color: #9aa5b4; font-size: 9px; margin: 5px 0 0; }
.text-link { color: #6f82a3; font-size: 10px; }
.text-link span, .activity-footer span { color: #7892bf; margin-left: 4px; }
.project-list { border-top: 1px solid #f0f2f6; }
.empty-state, .empty-activity { min-height: 158px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.empty-state { border-bottom: 1px solid #f2f4f7; }
.empty-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #7b8fb3; background: #eff3fa; font-size: 14px; margin-bottom: 8px; }
.empty-state strong, .empty-activity strong { color: #68768a; font-size: 10px; font-weight: 600; }
.empty-state p, .empty-activity p { max-width: 260px; margin: 5px 0 0; color: #a0aab7; font-size: 9px; line-height: 1.6; }
.empty-activity { min-height: 220px; }
.project-list:not(.empty-state) { display: block; min-height: 0; }
.project-row { grid-template-columns: 32px minmax(110px, 1fr) 82px 95px 16px; }
.project-row { display: grid; grid-template-columns: 32px minmax(110px, 1fr) 74px 100px 16px; gap: 10px; align-items: center; min-height: 58px; border-bottom: 1px solid #f2f4f7; }
.project-mark { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.mark-purple { background: #f0ecff; color: #7662ce; }
.mark-blue { background: #e8f1ff; color: #4b79d4; }
.mark-orange { background: #fff0e3; color: #cf8650; }
.project-details { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.project-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #354154; font-size: 10px; font-weight: 600; }
.project-details span { color: #9ba6b5; font-size: 9px; }
.project-status { justify-self: start; border-radius: 12px; padding: 4px 7px; font-size: 8px; white-space: nowrap; }
.status-green { color: #36896d; background: #eaf7f1; }
.status-blue { color: #5279bc; background: #edf3ff; }
.status-gray { color: #8a95a5; background: #f1f3f6; }
.project-time { color: #a2adbb; font-size: 8px; white-space: nowrap; }
.row-menu { border: 0; background: transparent; color: #a0aab8; letter-spacing: 1px; font-size: 13px; padding: 0; }
.add-project { width: 100%; padding: 11px 0 0; background: transparent; border: 0; color: #7790bf; font-size: 9px; text-align: left; }
.add-project span { font-size: 14px; margin-right: 3px; vertical-align: -1px; }
.filter-button { border: 1px solid #e6eaf0; border-radius: 6px; background: #fff; color: #8290a2; padding: 6px 8px; font-size: 9px; }
.filter-button span { margin-left: 6px; }
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f1f3f7; }
.activity-item:first-child { padding-top: 2px; }
.activity-avatar { width: 24px; height: 24px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; font-size: 8px; font-weight: 600; }
.avatar-blue { color: #4d77b8; background: #e9f1ff; }
.avatar-green { color: #3b9878; background: #e8f8f1; }
.avatar-orange { color: #d38b48; background: #fff1e5; }
.avatar-purple { color: #7865ce; background: #f0edff; }
.activity-item p { margin: 1px 0 4px; color: #8995a5; font-size: 9px; line-height: 1.5; }
.activity-item p strong { color: #4a5668; font-weight: 600; }
.activity-item a { color: #5f7db0; }
.activity-item small { display: block; color: #a4afbd; font-size: 8px; }
.activity-footer { display: block; padding-top: 11px; color: #7489ac; font-size: 9px; }
.templates-panel { margin-bottom: 16px; }
.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.template-card { position: relative; min-height: 93px; padding: 12px; display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 25px 18px 1fr; gap: 1px 9px; text-align: left; border: 1px solid #edf0f4; border-radius: 8px; background: #fff; transition: .16s ease; }
.template-card:hover { border-color: #cfdafb; background: #fbfcff; transform: translateY(-1px); }
.template-icon { grid-row: 1 / 3; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; }
.purple-bg { background: #f0edff; color: #7563d2; }
.blue-bg { background: #eaf2ff; color: #527cdc; }
.orange-bg { background: #fff1e5; color: #db9252; }
.green-bg { background: #e9f7f1; color: #4ca482; }
.template-card strong { align-self: center; color: #455165; font-size: 10px; font-weight: 600; }
.template-card small { grid-column: 2; align-self: start; color: #9aa5b3; font-size: 8px; line-height: 1.45; }
.template-arrow { position: absolute; right: 10px; top: 9px; color: #b3becd; font-size: 11px; }
.page-footer { display: flex; justify-content: space-between; color: #a5afbc; font-size: 8px; padding: 1px 2px; }
.settings-panel { margin-top: 16px; }
.settings-intro, .settings-scopes { color: #7e8ba0; font-size: 10px; line-height: 1.65; }
.settings-intro { margin: -4px 0 16px; }
.settings-intro code { padding: 2px 4px; border-radius: 4px; background: #f1f4fa; color: #c2672b; font-size: 9px; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-form label { display: flex; flex-direction: column; gap: 7px; color: #536174; font-size: 10px; font-weight: 600; }
.settings-form label:nth-child(3) { grid-column: 1 / -1; }
.settings-form input { width: 100%; border: 1px solid #dfe5ee; outline: 0; border-radius: 7px; padding: 10px 11px; color: #263348; background: #fff; font: inherit; font-size: 11px; }
.settings-form input:focus { border-color: #81a1ed; box-shadow: 0 0 0 3px #4775df18; }
.settings-form label small { color: #9aa5b4; font-size: 9px; font-weight: 400; line-height: 1.5; }
.settings-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 9px; }
.settings-actions button { min-height: 35px; }
.settings-actions button:disabled { cursor: not-allowed; opacity: .55; }
.danger-button { color: #b64f4b; border-color: #f0d8d6; }
.settings-scopes { margin: 0; color: #9aa5b4; }
.status-connected { color: #287b5b; background: #e7f6ef; border-color: #d3efe2; }
.status-pending { color: #916d24; background: #fff7e5; border-color: #f2e6bf; }
.status-error { color: #a64f4b; background: #fff0ef; border-color: #f1d9d7; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .page-content { padding: 28px 24px; }
  .topbar { padding: 0 24px; }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; padding: 13px 14px; }
  .brand { padding: 0 3px 12px; }
  .workspace-switcher, .sidebar-bottom, .nav-label, .nav-item:not(.active) { display: none; }
  .main-nav { flex-direction: row; gap: 3px; overflow-x: auto; }
  .nav-item { flex: 0 0 auto; padding: 8px 10px; margin: 0; }
  .nav-item.active { box-shadow: none; }
  .nav-count { display: none; }
  .topbar { height: 52px; padding: 0 15px; }
  .topbar-actions .icon-button:first-child, .topbar-divider { display: none; }
  .page-content { padding: 23px 15px; }
  .welcome-row { align-items: flex-start; gap: 12px; }
  h1 { font-size: 20px; }
  .welcome-subtitle { max-width: 300px; line-height: 1.5; }
  .primary-button { padding: 9px 10px; white-space: nowrap; }
  .connection-banner { align-items: flex-start; }
  .connection-copy span { line-height: 1.5; }
  .secondary-button { align-self: center; padding: 7px; }
  .secondary-button span { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .content-grid { gap: 12px; }
  .panel { padding: 14px 13px; }
  .project-row { grid-template-columns: 29px minmax(80px, 1fr) 69px 16px; gap: 7px; }
  .project-time { display: none; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .members-columns { grid-template-columns: 1fr; gap: 20px; }
  .members-card { padding: 25px 19px; }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form label:nth-child(3), .settings-actions { grid-column: auto; }
  .page-footer { gap: 10px; flex-wrap: wrap; }
}
/* Project-scoped WorkBuddy conversation panel */
.assistant-panel { margin: 22px 0 26px; }
.assistant-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) auto; gap: 14px; align-items: end; margin: 20px 0 16px; }
.assistant-controls label { display: grid; gap: 7px; color: var(--ink-soft, #5e6d82); font-size: 13px; font-weight: 650; }
.assistant-controls select, .assistant-form textarea { width: 100%; border: 1px solid #dce4f0; border-radius: 10px; background: #fff; color: #22324a; font: inherit; padding: 11px 13px; outline: none; }
.assistant-controls select:focus, .assistant-form textarea:focus { border-color: #7399f8; box-shadow: 0 0 0 3px rgba(57, 107, 222, .12); }
.assistant-messages { display: flex; flex-direction: column; gap: 12px; min-height: 190px; max-height: 480px; overflow-y: auto; padding: 16px; border: 1px solid #e7edf5; border-radius: 12px; background: #f8faff; }
.assistant-empty { display: grid; align-content: center; gap: 7px; min-height: 150px; text-align: center; color: #8290a6; }
.assistant-empty strong { color: #52637b; font-size: 15px; }
.assistant-message { max-width: 88%; padding: 12px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.assistant-message small { display: block; margin-bottom: 4px; color: #7e8da3; font-size: 11px; font-weight: 700; }
.assistant-message.from-user { align-self: flex-end; background: #e8efff; color: #233c75; }
.assistant-message.from-ai { align-self: flex-start; background: #fff; border: 1px solid #e8edf5; color: #27374c; }
.assistant-form { display: grid; gap: 10px; margin-top: 14px; }
.assistant-form textarea { resize: vertical; min-height: 80px; }
.assistant-form-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; color: #8492a8; font-size: 12px; }
.assistant-form-footer .primary-button { display: inline-flex; align-items: center; gap: 10px; }
.assistant-form-footer button:disabled, .assistant-controls button:disabled { opacity: .5; cursor: not-allowed; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .assistant-controls { grid-template-columns: 1fr; }
  .assistant-controls button { justify-self: start; }
  .assistant-form-footer { align-items: flex-start; flex-direction: column; }
  .assistant-message { max-width: 100%; }
}
