:root {
  color-scheme: light;
  --green: #5ebd5e;
  --green-dark: #3fa348;
  --green-soft: #eef8ee;
  --bg: #f9f9f8;
  --surface: #ffffff;
  --surface-soft: #fcfcfc;
  --text: #1b1b1b;
  --ink: #1b1b1b;
  --muted: #737373;
  --faint: #aaa;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .12);
  --soft: rgba(0, 0, 0, .045);
  --shadow: 0 2px 8px rgba(0, 0, 0, .14);
  --shadow-popover: 0 12px 36px rgba(0, 0, 0, .12);
  --shadow-modal: 0 22px 70px rgba(0, 0, 0, .20);
  --font-ui: Manrope, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --radius-control: 8px;
  --radius-panel: 11px;
  --radius-composer: 16px;
  --radius-pill: 999px;
  --fast: 150ms ease;

  /* Legacy aliases resolve to the same product system. */
  --panel: #f2f2f1;
  --panel-2: #e8e8e7;
  --purple: var(--green);
  --purple-2: var(--green-soft);
  --mint: var(--green-soft);
  --cyan: #eef2f7;
  --orange: #ff7a45;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 16px;
  --shadow-tight: 0 1px 4px rgba(0, 0, 0, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-ui);
}

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(94, 189, 94, .55);
  outline-offset: 2px;
}

button > svg,
[role="button"] > svg,
button > span > svg {
  display: block;
  flex: 0 0 auto;
  align-self: center;
}

#ambient {
  display: none;
}

/* App shell */
.app {
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  position: relative;
  gap: 16px;
  padding: 48px 12px 12px;
  border-right: .5px solid var(--line-strong);
  background: var(--surface);
}

.sidebar::before {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 50%;
  background: #ff4747;
  box-shadow: 23px 0 #ffcd45, 46px 0 #5ebd5e;
  content: "";
}

.brand-row {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 0;
  min-height: 32px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #111;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.brand-row b {
  color: #111;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand-row span {
  display: none;
}

.nav-scroll {
  padding-top: 0;
}

.nav-btn,
.history-toggle,
.history-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(0, 0, 0, .62);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--fast), color var(--fast), transform var(--fast);
}

.nav-btn {
  min-height: 36px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 0 8px;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  color: #111;
  stroke-width: 2;
}

.nav-btn:hover,
.nav-btn.active,
.sidebar .nav-btn:hover,
.sidebar .nav-btn.active {
  background: var(--soft);
  color: #111;
  transform: translateX(1px);
}

.nav-btn.active {
  font-weight: 600;
}

.nav-badge {
  min-width: 0;
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 600;
}

.history-group {
  gap: 4px;
  margin-top: 14px;
  padding-left: 0;
}

.history-toggle {
  min-height: 28px;
  padding: 0;
  color: rgba(0, 0, 0, .42);
  font-size: 12px;
}

.history-item {
  min-height: 36px;
  padding: 0 10px;
  color: rgba(0, 0, 0, .58);
  font-size: 13px;
}

.history-item:hover,
.history-item.active {
  background: var(--soft);
  color: #333;
}

.sidebar-foot .user {
  min-height: 40px;
  padding: 4px 0;
  border-radius: 8px;
}

.sidebar-foot .avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #151515;
}

.sidebar-foot .user b {
  font-size: 12px;
}

.sidebar-foot .user span {
  color: #999;
  font-size: 10px;
}

.main,
.view,
#driveView,
#assistantView,
.assistant-workspace {
  background: var(--bg);
}

.topbar {
  min-height: 56px;
  height: 56px;
  padding: 0 20px;
  border-bottom: .5px solid var(--line-strong);
  background: var(--bg);
}

.crumbs {
  gap: 8px;
}

.crumbs > svg:first-child,
.crumbs > svg:nth-child(2) {
  display: none;
}

.crumbs b {
  color: #222;
  font-size: 13px;
  font-weight: 600;
}

.crumbs b::before {
  display: inline-block;
  width: 14px;
  height: 12px;
  margin-right: 9px;
  border-radius: 3px;
  background: #202020;
  vertical-align: -1px;
  content: "";
}

.top-actions,
.drive-header-actions,
.assistant-header-actions {
  align-items: center;
  gap: 8px;
}

.drive-sync-status,
.assistant-header-actions > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.drive-sync-status svg,
.assistant-header-actions > span svg {
  width: 15px;
  height: 15px;
  color: var(--green-dark);
}

/* Shared controls */
.ghost-btn,
.chip-btn,
.send-btn,
.comment-mode-toggle,
.assistant-tool-btn {
  min-height: 36px;
  border: .5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: #222;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.ghost-btn:hover,
.chip-btn:hover,
.assistant-tool-btn:hover {
  border-color: rgba(0, 0, 0, .20);
  background: #f4f4f3;
  transform: none;
}

.ghost-btn.primary,
.send-btn,
.assistant-send,
.comment-submit {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.ghost-btn.primary:hover,
.send-btn:hover,
.assistant-send:hover,
.comment-submit:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.round-icon,
.icon-toggle {
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
}

.social-tabs {
  border-right-color: var(--line);
  background: var(--surface);
}

.social-tab {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}

.social-tab.active,
.social-tab:hover {
  background: var(--soft);
  color: var(--text);
}

.suggested-card,
.dialog-panel,
.result-card,
.library-card,
.calendar-shell,
.schedule-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: none;
}

.dialog-head h1,
.data-head h1,
.drive-path-title h1,
.section-title h1 {
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -.02em;
}

.composer,
.assistant-composer {
  border: .5px solid var(--line-strong);
  border-radius: var(--radius-composer);
  background: var(--surface);
  box-shadow: 0 0 20px rgba(0, 0, 0, .07);
}

.composer:focus-within,
.assistant-composer:focus-within {
  border-color: rgba(94, 189, 94, .55);
  box-shadow: 0 0 20px rgba(0, 0, 0, .08), 0 0 0 3px rgba(94, 189, 94, .08);
}

.variable-token,
.tag-pill,
.status-pill {
  border-color: rgba(94, 189, 94, .22);
  border-radius: 8px;
  background: var(--green-soft);
  color: #2d7e35;
}

/* Assistant */
.assistant-mode .topbar {
  background: var(--bg);
}

.assistant-mode .crumbs b::before {
  border-radius: 50%;
  background: var(--green);
}

.assistant-workspace {
  grid-template-rows: minmax(0, 1fr) auto;
  max-width: none;
  padding: 0;
}

.assistant-hero {
  display: none;
}

.assistant-hero h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.assistant-hero p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

#assistantOpenDrive {
  min-height: 36px;
  padding: 0 13px;
  border: .5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: #222;
  font-size: 12px;
  font-weight: 600;
}

#assistantOpenDrive:hover {
  border-color: rgba(94, 189, 94, .42);
  background: var(--green-soft);
  color: #2d7e35;
}

#assistantOpenDrive small {
  display: none;
}

.assistant-thread {
  grid-row: 1;
  width: min(960px, calc(100% - 64px));
  padding-top: 36px;
}

.assistant-message {
  gap: 8px;
}

.assistant-avatar {
  width: 24px;
  height: 24px;
  border: .5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--green-dark);
}

.assistant-avatar svg {
  width: 15px;
  height: 15px;
}

.assistant-bubble {
  max-width: none;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.assistant-message-meta b {
  font-size: 13px;
}

.assistant-message-meta span {
  color: var(--faint);
  font-size: 10px;
}

.assistant-bubble > p {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.55;
}

.assistant-starter-grid {
  gap: 8px;
  margin-top: 12px;
}

.assistant-starter-grid button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
}

.assistant-starter-grid button:hover {
  border-color: rgba(94, 189, 94, .35);
  background: var(--green-soft);
}

.assistant-starter-grid button > svg,
.assistant-starter-grid button:hover > svg {
  width: 16px;
  height: 16px;
  color: var(--green-dark);
}

.assistant-composer-zone {
  grid-row: 2;
  width: min(960px, calc(100% - 64px));
  padding-bottom: 18px;
}

.assistant-composer {
  min-height: 124px;
  padding: 12px;
}

.assistant-composer textarea {
  color: var(--text);
  font-size: 13px;
}

.assistant-composer textarea::placeholder {
  color: #929292;
}

.assistant-tool-btn {
  padding: 0 10px;
  font-weight: 500;
}

.assistant-context-count {
  color: var(--faint);
  font-size: 10px;
}

.assistant-send {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.assistant-privacy {
  margin-top: 7px;
  color: var(--faint);
  font-size: 10px;
}

/* Cloud drive */
.drive-mode .view {
  height: 100vh;
}

.drive-mode .topbar {
  display: none;
}

.drive-shell {
  grid-template-rows: 82px 50px 64px minmax(0, 1fr);
  color: var(--text);
}

.drive-actions {
  gap: 10px;
  padding: 17px 32px;
}

.drive-new-btn,
.drive-ai-btn,
.drive-icon-btn,
.drive-selection-tools button,
.drive-view-toggle button,
.drive-back-btn {
  min-height: 38px;
  border: .5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: #222;
  font-size: 12px;
  font-weight: 600;
}

.drive-new-btn {
  min-width: 112px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.drive-new-btn > svg:first-child {
  width: 19px;
  height: 19px;
  color: #222;
}

.drive-ai-btn {
  height: 42px;
  padding: 0 15px;
  border-color: rgba(94, 189, 94, .30);
  border-radius: 21px;
  background: var(--green-soft);
  color: #2d7e35;
}

.drive-new-btn:hover,
.drive-icon-btn:hover,
.drive-selection-tools button:hover,
.drive-view-toggle button:hover,
.drive-back-btn:hover {
  border-color: rgba(0, 0, 0, .18);
  background: #f4f4f3;
}

.drive-ai-btn:hover {
  border-color: var(--green);
  background: #e6f5e6;
  color: #26712e;
}

.drive-icon-btn,
.drive-back-btn {
  width: 38px;
  padding: 0;
}

.drive-search {
  height: 48px;
  max-width: 640px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: #eef2f7;
  color: var(--muted);
}

.drive-search:hover {
  background: #e9eef5;
}

.drive-search:focus-within {
  border-color: rgba(94, 189, 94, .50);
  background: var(--surface);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .16), 0 0 0 3px rgba(94, 189, 94, .08);
}

.drive-search input {
  color: var(--text);
  font-size: 14px;
}

.drive-search input::placeholder {
  color: #90959c;
}

.drive-tabs {
  min-height: 50px;
  padding-inline: 32px;
  border-bottom: 1px solid var(--line);
}

.drive-tabs button {
  height: 44px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.drive-tabs button::after {
  height: 2px;
  background: var(--green);
}

.drive-tabs button.active {
  color: var(--green-dark);
}

.drive-tabs button span,
.drive-tabs button.active > span {
  background: transparent;
  color: var(--faint);
}

.drive-space-overview {
  display: none;
}

.drive-browser-head {
  min-height: 64px;
  padding: 0 32px;
}

.drive-path-title h1 {
  font-size: 17px;
  font-weight: 600;
}

.drive-path-title span {
  margin-left: 9px;
  color: var(--faint);
  font-size: 12px;
}

.drive-view-toggle {
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.drive-view-toggle button {
  width: 32px;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #999;
}

.drive-view-toggle button.active {
  background: #f0f1f0;
  color: #222;
}

.drive-content {
  margin: 0 32px 32px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.drive-table-head {
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 0;
  background: #fcfcfc;
  color: #888;
  font-size: 12px;
  font-weight: 400;
}

.drive-row {
  min-height: 58px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.drive-row:hover {
  background: #fafcfa;
}

.drive-file-icon,
.drive-file-icon.document,
.drive-file-icon.image,
.drive-file-icon.video,
.drive-card .drive-file-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
}

.drive-file-icon.folder {
  color: #f8bc35;
}

.drive-file-icon.document {
  color: #ff5b5b;
}

.drive-name b {
  font-size: 13px;
  font-weight: 600;
}

.drive-name small,
.drive-cell {
  color: var(--muted);
  font-size: 11px;
}

.drive-location,
.drive-location.synced,
.drive-location.pending,
.drive-location.conflict,
.drive-location.local-only,
.drive-location.cloud-only {
  padding: 0;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 11px;
}

.drive-grid-view {
  padding: 16px;
}

.drive-card {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: none;
}

.drive-card:hover,
.drive-card.selected {
  border-color: rgba(94, 189, 94, .42);
  background: #fbfefb;
  box-shadow: 0 9px 24px rgba(0, 0, 0, .06);
  transform: translateY(-2px);
}

.drive-select-box.checked {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.drive-popover,
.drive-item-menu {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.drive-popover button,
.drive-item-menu button {
  border-radius: 7px;
}

.drive-popover button:hover,
.drive-item-menu button:hover {
  background: var(--soft);
}

/* Modal and settings */
.drive-modal-layer {
  background: rgba(0, 0, 0, .26);
  backdrop-filter: blur(3px);
}

.drive-modal {
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-modal);
}

.drive-modal-head {
  min-height: 58px;
  padding: 13px 16px 13px 20px;
  border-bottom: 1px solid var(--line);
}

.drive-modal-head h2 {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.drive-modal-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.drive-modal-head > button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.drive-modal-head > button:hover {
  background: var(--soft);
}

.drive-modal-body {
  padding: 0;
}

.drive-settings-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 520px;
  gap: 0;
}

.drive-settings-nav {
  gap: 4px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #fbfbfb;
}

.drive-settings-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.drive-settings-nav button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.drive-settings-nav button:hover,
.drive-settings-nav button.active {
  background: var(--green-soft);
  color: #2d7e35;
}

.drive-settings-nav button.active {
  font-weight: 600;
  box-shadow: none;
}

.drive-settings-panel {
  padding: 28px 34px 24px;
}

.drive-settings-panel h3 {
  margin: 0 0 18px;
  font-family: var(--font-ui);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.drive-storage-card,
.drive-setting-group,
.drive-plugin-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.drive-storage-card {
  padding: 18px;
}

.drive-storage-card + .drive-storage-card {
  margin-top: 12px;
}

.drive-storage-heading {
  margin-bottom: 16px;
}

.drive-storage-heading b,
.drive-storage-heading small {
  display: block;
}

.drive-storage-heading b {
  font-size: 13px;
  font-weight: 600;
}

.drive-storage-heading small,
.drive-storage-heading em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.drive-storage-track {
  height: 6px;
  background: #e7e7e4;
}

.drive-storage-track span {
  background: var(--green);
}

.drive-settings-actions {
  gap: 8px;
  margin-top: 16px;
}

.drive-settings-actions button,
.drive-plugin-row button,
.drive-setting-segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: .5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.drive-settings-actions button.primary,
.drive-plugin-row button.connected,
.drive-setting-segmented button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.drive-setting-group,
.drive-plugin-list {
  overflow: hidden;
}

.drive-setting-row,
.drive-plugin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.drive-setting-row:last-child,
.drive-plugin-row:last-child {
  border-bottom: 0;
}

.drive-setting-row b,
.drive-setting-row small,
.drive-plugin-row b,
.drive-plugin-row small {
  display: block;
}

.drive-setting-row b,
.drive-plugin-row b {
  font-size: 12px;
  font-weight: 600;
}

.drive-setting-row small,
.drive-plugin-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.drive-setting-row select {
  min-height: 36px;
  padding: 0 32px 0 12px;
  border: .5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11px;
}

.drive-setting-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.drive-setting-segmented {
  display: flex;
  gap: 4px;
}

.drive-plugin-row {
  justify-content: flex-start;
}

.drive-plugin-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.drive-toast {
  border: 0;
  border-radius: 8px;
  background: #202020;
  color: #fff;
  box-shadow: var(--shadow-popover);
}

/* Other product surfaces inherit the same dense desktop language. */
.data-view,
.chat-shell {
  background: var(--bg);
}

.data-shell {
  padding: 24px 32px;
}

.section-title h1,
.dialog-head h1 {
  font-size: 21px;
}

.library-categories,
.segmented {
  border-radius: 9px;
  background: var(--soft);
}

.library-categories button,
.segmented button {
  border-radius: 7px;
}

.library-categories button.active,
.segmented button.active {
  background: var(--surface);
  color: var(--green-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.calendar-toolbar,
.material-library,
.resource-intake,
.schedule-editor,
.daily-report,
.conversation-panel {
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: none;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 10px;
  }

  .brand-row > div:last-child,
  .nav-btn > span,
  .sidebar-foot .user > div:nth-child(2),
  .history-group {
    display: none;
  }

  .nav-btn {
    display: grid;
    place-items: center;
    grid-template-columns: 1fr;
    padding: 0;
  }

  .drive-actions,
  .drive-tabs,
  .drive-browser-head {
    padding-inline: 20px;
  }

  .drive-content {
    margin-inline: 20px;
  }

  .drive-settings-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .drive-settings-nav {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .drive-settings-nav button {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 52px;
    height: 52px;
    padding-inline: 14px;
  }

  .drive-header-actions .drive-sync-status,
  .assistant-header-actions > span {
    display: none;
  }

  .assistant-hero {
    padding: 12px 16px;
  }

  .assistant-hero p {
    display: none;
  }

  .assistant-thread,
  .assistant-composer-zone {
    width: calc(100% - 24px);
  }

  .assistant-thread {
    padding-top: 20px;
  }

  .assistant-starter-grid {
    grid-template-columns: 1fr;
  }

  .drive-mode .view {
    height: 100vh;
  }

  .drive-shell {
    grid-template-rows: auto 48px auto minmax(0, 1fr);
  }

  .drive-actions {
    flex-wrap: wrap;
    padding: 12px;
  }

  .drive-new-btn {
    min-width: 94px;
    height: 40px;
    border-radius: 12px;
  }

  .drive-search {
    order: 3;
    width: 100%;
    min-width: 0;
    height: 42px;
  }

  .drive-action-spacer {
    display: none;
  }

  .drive-tabs,
  .drive-browser-head {
    padding-inline: 12px;
  }

  .drive-content {
    margin: 0 12px 16px;
  }

  .drive-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .drive-settings-panel {
    padding: 20px 16px;
  }

  .drive-settings-nav {
    gap: 2px;
    padding: 6px;
  }

  .drive-settings-nav button {
    gap: 5px;
    min-height: 36px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .drive-settings-nav button svg {
    width: 14px;
    height: 14px;
  }

  .drive-setting-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

/* Unified library: surface sync truth and keep file context visible while browsing. */
.drive-shell {
  grid-template-rows: 82px 50px minmax(0, 1fr);
}

.drive-workarea {
  position: relative;
  display: grid;
  grid-template-rows: auto 64px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.drive-space-overview {
  display: block;
  padding: 14px 32px 0;
  transition: margin-right 180ms ease;
}

.drive-sync-summary {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.drive-summary-title {
  padding-right: 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.drive-summary-metric {
  display: grid;
  grid-template-columns: 16px auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  min-width: 100px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.drive-summary-metric svg {
  grid-row: 1 / span 2;
  align-self: center;
  width: 15px;
  height: 15px;
}

.drive-summary-metric b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
}

.drive-summary-metric small {
  margin-top: 3px;
  overflow: visible;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.1;
  text-overflow: clip;
  white-space: nowrap;
}

.drive-summary-metric.is-synced svg {
  color: var(--green);
}

.drive-summary-metric.is-pending svg {
  color: #d58b19;
}

.drive-summary-metric.is-conflict svg {
  color: #d84c44;
}

.drive-device-state {
  display: grid;
  grid-template-columns: 22px auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  min-width: 142px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.drive-device-state svg {
  grid-row: 1 / span 2;
  align-self: center;
  width: 20px;
  height: 20px;
  color: #333;
}

.drive-device-state b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
}

.drive-device-state small {
  margin-top: 2px;
  color: var(--green-dark);
  font-size: 10px;
}

.drive-local-privacy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.drive-local-privacy svg {
  width: 14px;
  height: 14px;
  color: var(--green-dark);
}

.drive-sync-summary > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin-left: 14px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.drive-sync-summary > button.has-pending {
  border-color: rgba(94, 189, 94, .34);
  background: var(--green-soft);
  color: var(--green-dark);
}

.drive-sync-summary > button svg {
  width: 14px;
  height: 14px;
}

.drive-sync-caption {
  display: block;
  min-height: 15px;
  padding: 4px 2px 0;
  color: var(--faint);
  font-size: 10px;
}

.drive-browser-head {
  transition: margin-right 180ms ease;
}

.drive-content {
  transition: margin-right 180ms ease;
}

.drive-workarea.inspector-open .drive-space-overview,
.drive-workarea.inspector-open .drive-browser-head {
  margin-right: 328px;
}

.drive-workarea.inspector-open .drive-content {
  margin-right: 360px;
}

.drive-workarea.inspector-open .drive-table-head,
.drive-workarea.inspector-open .drive-row {
  grid-template-columns: minmax(230px, 1.35fr) 112px 86px 124px 66px 38px;
  min-width: 760px;
}

.drive-row.inspected,
.drive-card.inspected {
  background: #f7fbf7;
  box-shadow: inset 2px 0 0 var(--green);
}

.drive-location.pending-upload,
.drive-location.pending-download {
  background: #fff7e8;
  color: #9a6413;
}

.drive-location.device-offline {
  background: #f2f2f2;
  color: #6f6f6f;
}

.drive-inspector {
  position: absolute;
  z-index: 7;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto 46px minmax(0, 1fr);
  width: 328px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -14px 0 34px rgba(0, 0, 0, .035);
  opacity: 0;
  transform: translateX(100%);
  transition: transform 180ms ease, opacity 180ms ease;
  pointer-events: none;
}

.drive-inspector.open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.drive-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 18px 18px 12px;
}

.drive-inspector-head > div {
  min-width: 0;
}

.drive-inspector-head span,
.drive-inspector-head b {
  display: block;
}

.drive-inspector-head span {
  color: var(--faint);
  font-size: 10px;
}

.drive-inspector-head b {
  margin-top: 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-inspector-head button {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
}

.drive-inspector-head button:hover {
  background: #f3f3f2;
  color: var(--text);
}

.drive-inspector-head svg {
  width: 17px;
  height: 17px;
}

.drive-inspector-tabs {
  display: flex;
  gap: 22px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.drive-inspector-tabs button {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.drive-inspector-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
  opacity: 0;
  content: "";
}

.drive-inspector-tabs button.active {
  color: var(--green-dark);
}

.drive-inspector-tabs button.active::after {
  opacity: 1;
}

.drive-inspector-body {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 30px;
}

.drive-inspector-file {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 16px;
}

.drive-inspector-file > span {
  min-width: 0;
}

.drive-inspector-file b,
.drive-inspector-file small {
  display: block;
}

.drive-inspector-file b {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-inspector-file small {
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
}

.drive-inspector-file em {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.drive-inspector-alert,
.drive-inspector-privacy,
.drive-version-intro {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px;
  border: 1px solid #e8e8e8;
  border-radius: 9px;
  background: #f8f8f7;
}

.drive-inspector-alert.danger {
  border-color: #f0d1ce;
  background: #fff7f6;
}

.drive-inspector-alert svg,
.drive-inspector-privacy svg,
.drive-version-intro svg {
  width: 17px;
  height: 17px;
  color: var(--green-dark);
}

.drive-inspector-alert.danger svg {
  color: #c94942;
}

.drive-inspector-alert b,
.drive-inspector-alert small,
.drive-inspector-privacy b,
.drive-inspector-privacy small,
.drive-version-intro b,
.drive-version-intro small {
  display: block;
}

.drive-inspector-alert b,
.drive-inspector-privacy b,
.drive-version-intro b {
  color: var(--text);
  font-size: 11px;
}

.drive-inspector-alert small,
.drive-inspector-privacy small,
.drive-version-intro small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.drive-inspector-section {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.drive-inspector-section h3 {
  margin: 0 0 11px;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.drive-inspector-section dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.drive-inspector-section dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.drive-inspector-section dt {
  color: var(--faint);
  font-size: 10px;
}

.drive-inspector-section dd {
  margin: 0;
  color: var(--text);
  font-size: 10px;
  text-align: right;
}

.drive-inspector-section .drive-location {
  min-height: 23px;
}

.drive-source-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 0;
  text-align: left;
}

.drive-source-link > svg:first-child {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.drive-source-link > svg:last-child {
  width: 14px;
  height: 14px;
  color: var(--faint);
}

.drive-source-link b,
.drive-source-link small {
  display: block;
}

.drive-source-link b {
  color: var(--text);
  font-size: 11px;
}

.drive-source-link small,
.drive-source-files {
  margin-top: 3px;
  color: var(--faint);
  font-size: 9px;
}

.drive-inspector-privacy {
  margin: 0 0 4px;
  border-color: #dbeade;
  background: #f5faf6;
}

.drive-inspector-actions {
  display: grid;
  gap: 7px;
}

.drive-inspector-actions h3 {
  margin-bottom: 4px;
}

.drive-inspector-actions > button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  text-align: left;
}

.drive-inspector-actions > button:hover:not(:disabled) {
  border-color: rgba(94, 189, 94, .45);
  background: #f7fbf7;
}

.drive-inspector-actions > button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.drive-inspector-actions > button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.drive-version-list {
  display: grid;
}

.drive-version-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
}

.drive-version-row > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f1f0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.drive-version-row.current > span {
  background: var(--green-soft);
  color: var(--green-dark);
}

.drive-version-row b,
.drive-version-row small {
  display: block;
}

.drive-version-row b {
  color: var(--text);
  font-size: 11px;
}

.drive-version-row small {
  margin-top: 3px;
  color: var(--faint);
  font-size: 9px;
}

.drive-version-row button,
.drive-version-row em {
  color: var(--green-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .drive-local-privacy {
    display: none;
  }

  .drive-workarea.inspector-open .drive-space-overview,
  .drive-workarea.inspector-open .drive-browser-head {
    margin-right: 0;
  }

  .drive-workarea.inspector-open .drive-content {
    margin-right: 32px;
  }

  .drive-inspector {
    box-shadow: -18px 0 50px rgba(0, 0, 0, .11);
  }
}

@media (max-width: 760px) {
  .drive-summary-metric {
    min-width: 74px;
    padding-inline: 10px;
  }

  .drive-device-state {
    margin-left: auto;
  }

  .drive-sync-summary > button span,
  .drive-summary-title {
    display: none;
  }

  .drive-inspector {
    position: fixed;
    z-index: 95;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .20);
  }
}

@media (max-width: 520px) {
  .drive-space-overview {
    padding: 10px 12px 0;
  }

  .drive-sync-summary {
    overflow-x: auto;
  }

  .drive-summary-metric {
    flex: 0 0 74px;
  }

  .drive-device-state {
    flex: 0 0 136px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drive-inspector,
  .drive-space-overview,
  .drive-browser-head,
  .drive-content {
    transition: none;
  }
}

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