:root {
  color-scheme: dark;
  --bg: #10100f;
  --surface: #181816;
  --surface-2: #20201d;
  --surface-3: #292925;
  --nav-bg: #11110f;
  --topbar-bg: rgba(16, 16, 15, 0.94);
  --input-bg: #11110f;
  --panel-bg: rgba(24, 24, 22, 0.96);
  --line: #383832;
  --text: #f4f1e8;
  --muted: #aaa69a;
  --accent: #55d6be;
  --accent-2: #8ab4f8;
  --rose: #f0a6ca;
  --amber: #f2c96d;
  --violet: #b8a3ff;
  --bad: #ff7a90;
  --good: #86e49d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --request-list-bg: #11120f;
  --request-active-bg: #14231f;
  --request-stream-bg: #121210;
  --bubble-user-bg: #11342d;
  --chat-inline-bg: #151512;
  --chat-active-bg: #17231f;
  --code-bg: #0d0d0b;
  --attachment-bg: #111915;
  --media-thumb-bg: #070807;
  --queue-input-bg: #0b0f0d;
  --queue-active-bg: #101915;
  --context-bg: #11110f;
  --item-bg: #151512;
  --item-folder-bg: #151512;
  --item-selected-bg: #17231f;
  --mini-bg: rgba(41, 41, 37, 0.72);
}

html[data-theme="gray"] {
  --bg: #111827;
  --surface: #1f2937;
  --surface-2: #273244;
  --surface-3: #334155;
  --nav-bg: #0f172a;
  --topbar-bg: rgba(17, 24, 39, 0.94);
  --input-bg: #111827;
  --panel-bg: rgba(31, 41, 55, 0.96);
  --line: #3f4a5d;
  --text: #f8fafc;
  --muted: #a7b0c0;
  --accent: #55d6be;
  --accent-2: #8ab4f8;
  --rose: #f0a6ca;
  --amber: #f2c96d;
  --violet: #b8a3ff;
  --bad: #ff7a90;
  --good: #86e49d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --request-list-bg: #111827;
  --request-active-bg: #12332f;
  --request-stream-bg: #111827;
  --bubble-user-bg: #0f3a35;
  --chat-inline-bg: #172033;
  --chat-active-bg: #14342f;
  --code-bg: #0b1220;
  --attachment-bg: #12231f;
  --media-thumb-bg: #0b1220;
  --queue-input-bg: #101b2a;
  --queue-active-bg: #132a28;
  --context-bg: #111827;
  --item-bg: #172033;
  --item-folder-bg: #162b31;
  --item-selected-bg: #14342f;
  --mini-bg: rgba(39, 50, 68, 0.84);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef6f7;
  --surface: #f8fbfb;
  --surface-2: #e8f1f3;
  --surface-3: #dce9ec;
  --nav-bg: #f7fbfb;
  --topbar-bg: rgba(239, 247, 248, 0.94);
  --input-bg: #fbfefe;
  --panel-bg: rgba(248, 251, 251, 0.98);
  --line: #c9dadd;
  --text: #1f2933;
  --muted: #667783;
  --accent: #2bb8ad;
  --accent-2: #68a9c7;
  --rose: #bd6d94;
  --amber: #aa7c2f;
  --violet: #7d79c8;
  --bad: #c94a59;
  --good: #2f8b63;
  --shadow: 0 18px 42px rgba(50, 72, 82, 0.12);
  --request-list-bg: #edf5f6;
  --request-active-bg: #d8f0ef;
  --request-stream-bg: #f7fbfb;
  --bubble-user-bg: #d8f0ef;
  --chat-inline-bg: #edf5f6;
  --chat-active-bg: #d8f0ef;
  --code-bg: #e5eef0;
  --attachment-bg: #e1f1ef;
  --media-thumb-bg: #dce9ec;
  --queue-input-bg: #f7fbfb;
  --queue-active-bg: #e0f2f0;
  --context-bg: #e8f1f3;
  --item-bg: #f7fbfb;
  --item-folder-bg: #e4f5f3;
  --item-selected-bg: #d8f0ef;
  --mini-bg: rgba(232, 241, 243, 0.92);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.focused-mode,
body.focused-mode {
  height: 100%;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] { display: none !important; }

h1, h2, h3, p {
  margin: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(85, 214, 190, 0.14), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(240, 166, 202, 0.12), transparent 30rem),
    var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  margin-bottom: 18px;
}

.brand-mark span {
  border-radius: 6px;
}

.brand-mark span:nth-child(1) { background: var(--accent); grid-column: span 2; }
.brand-mark span:nth-child(2) { background: var(--accent-2); }
.brand-mark span:nth-child(3) { background: var(--rose); }

.brand-mark.small {
  width: 34px;
  height: 34px;
  margin: 0;
  gap: 4px;
}

.login-panel h1 {
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(85, 214, 190, 0.14);
}

.login-panel > input {
  width: 100%;
  padding: 12px;
  margin: 8px 0 16px;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  margin: 8px 0 16px;
}

.password-row input {
  min-width: 0;
  padding: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.primary-icon-button,
.icon-link {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: #05211d;
  font-weight: 800;
}

.secondary-button {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line);
  font-weight: 800;
  padding: 0 12px;
}

.compact-action {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.compact-action svg {
  width: 17px;
  height: 17px;
}

.icon-button,
.icon-link {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
  text-decoration: none;
}

.icon-button.danger {
  color: var(--bad);
}

.primary-icon-button {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #05211d;
  background: var(--accent);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  padding: 0 14px;
}

.primary-button:hover,
.primary-icon-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.icon-link:hover {
  filter: brightness(1.06);
}

.form-error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--bad);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.app-shell.focused-section {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--nav-bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand strong {
  display: block;
  font-size: 16px;
}

.nav-brand small,
.empty-state,
small {
  color: var(--muted);
}

.side-nav nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-logout {
  width: 100%;
}

.mobile-more-button,
.mobile-more-menu {
  display: none;
}

main {
  min-width: 0;
  padding: 24px;
}

.focused-section main {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -24px -24px 20px;
  padding: 20px 24px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h2 {
  font-size: 28px;
  line-height: 1.1;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.top-actions,
.panel-actions,
.panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-badge {
  display: grid;
  gap: 3px;
  min-height: 42px;
  align-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.user-badge span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.user-badge strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
}

.panel-title-row {
  justify-content: space-between;
}

.profile-picker,
.model-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.theme-option {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.theme-option svg {
  width: 17px;
  height: 17px;
}

.theme-option.active {
  background: var(--accent);
  color: #05211d;
}

.chat-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-picker select,
.model-picker select {
  height: 42px;
  min-width: 130px;
  padding: 0 36px 0 12px;
}

.overview-panel {
  scroll-margin-top: 98px;
  margin-bottom: 14px;
}

.status-strip {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  margin-bottom: 12px;
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--muted);
}

.status-dot.ok { background: var(--good); }
.status-dot.down { background: var(--bad); }
.status-dot.unknown { background: var(--amber); }

.health-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font-weight: 750;
  font-size: 13px;
}

.health-pill:hover {
  border-color: #57574e;
  background: var(--surface-2);
}

.service-mini-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.service-mini-icon svg {
  width: 17px;
  height: 17px;
}

.overview-dashboard {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.overview-action-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.overview-action {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 10px 8px;
  font-weight: 850;
}

.overview-action svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.overview-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.overview-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.overview-card h3 {
  font-size: 20px;
  line-height: 1.15;
}

.overview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.overview-list li {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-photo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.overview-photo-strip img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 14px;
  align-items: start;
}

.home-section .workspace-grid {
  display: none;
}

.focused-section .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.focused-section .hub-panel {
  min-height: 0;
}

.focused-section .chat-section {
  height: 100%;
  overflow: hidden;
}

.hub-panel {
  scroll-margin-top: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 16px;
  min-width: 0;
}

.hub-panel h3 {
  font-size: 20px;
}

.files-panel,
.chat-section,
.requests-panel,
.account-panel,
.notes-panel {
  grid-column: 1 / -1;
}

.inline-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.doc-form {
  grid-template-columns: 150px minmax(0, 1fr) auto;
}

.inline-form input,
.inline-form select,
.note-form textarea {
  padding: 11px 12px;
}

.path-label {
  min-height: 36px;
  margin: 12px 0 10px;
  padding: 8px 12px;
  border: 1px solid rgba(244, 241, 232, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(85, 214, 190, 0.08), transparent 42%),
    #121210;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-location-row {
  margin: 12px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drive-breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.drive-crumb {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 20px;
  font-weight: 650;
  white-space: nowrap;
}

.drive-crumb.current {
  border-color: rgba(85, 214, 190, 0.38);
  background: rgba(85, 214, 190, 0.11);
  color: var(--text);
  padding: 0 14px;
}

.drive-crumb svg {
  width: 16px;
  height: 16px;
}

.drive-crumb-separator {
  color: var(--muted);
  font-size: 22px;
  opacity: 0.75;
}

.drive-view-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-switch {
  min-height: 42px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 999px;
  overflow: hidden;
  background: #121210;
}

.view-switch button,
.info-toggle {
  width: 48px;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
}

.view-switch button + button {
  border-left: 1px solid rgba(244, 241, 232, 0.16);
}

.view-switch button.active {
  background: rgba(85, 214, 190, 0.2);
  color: var(--text);
}

.info-toggle {
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 999px;
  background: #121210;
}

.info-toggle.active {
  border-color: rgba(85, 214, 190, 0.45);
  color: var(--accent);
  background: rgba(85, 214, 190, 0.11);
}

.drive-menu {
  position: fixed;
  z-index: 70;
  width: 280px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
  color: #1f211d;
  box-shadow: var(--shadow);
}

.drive-menu button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0 12px;
  font-weight: 650;
}

.drive-menu button:hover {
  background: #e7e7e1;
}

.drive-menu button:disabled {
  opacity: 0.36;
}

.drive-menu .danger {
  color: #b42335;
}

.drive-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 12px;
  align-items: start;
}

.drive-content .file-list {
  min-width: 0;
}

.file-info-panel {
  position: sticky;
  top: 88px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background: #151512;
  padding: 14px;
}

.file-info-header {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.file-info-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info-panel dl {
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.file-info-panel dl div {
  display: grid;
  gap: 3px;
}

.file-info-panel dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.file-info-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
}

.app-modal-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.app-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.app-modal-header h3 {
  font-size: 22px;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.modal-form input,
.modal-form select {
  min-height: 42px;
  padding: 0 12px;
}

.share-card {
  width: min(720px, 100%);
  background: var(--surface);
  color: var(--text);
}

.share-card .eyebrow,
.share-card small,
.share-status {
  color: var(--muted);
}

.share-card .icon-button,
.share-card .secondary-button,
.share-card .ghost-button {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}

.share-card .primary-button {
  width: auto;
  min-width: 128px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #05211d;
}

.share-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 22px;
}

.share-add-row input,
.share-general select {
  min-height: 46px;
  border-color: var(--line);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 14px;
}

.share-add-row input::placeholder {
  color: var(--muted);
}

.share-section h4,
.share-general h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 17px;
}

.share-people {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.share-person {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.share-avatar,
.share-globe {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #f4511e;
  color: #fff;
  font-weight: 800;
}

.share-avatar.muted {
  background: color-mix(in srgb, var(--accent-2) 22%, var(--surface));
  color: var(--accent-2);
}

.share-person div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.share-person strong,
.share-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-person em {
  color: var(--muted);
  font-style: normal;
}

.share-general {
  margin: 0 -16px 18px;
  padding: 16px;
  border-block: 1px solid var(--line);
  background: var(--surface-2);
}

.share-general-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 12px;
}

.share-globe {
  background: rgba(85, 214, 190, 0.16);
  background: color-mix(in srgb, var(--accent) 26%, var(--surface));
  color: var(--accent);
}

.share-access-controls {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.share-access-controls select {
  width: min(330px, 100%);
}

.share-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-footer .ghost-button {
  border-radius: 999px;
  color: var(--accent-2);
}

.share-status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
}

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  width: min(620px, calc(100vw - 32px));
  min-height: 44px;
  margin: 0;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111915;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  visibility: hidden;
}

.selection-bar.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}

.selection-bar strong {
  margin-right: auto;
}

.file-list,
.notes-list,
.conversation-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.file-list {
  max-height: 420px;
  overflow: auto;
}

.file-list.file-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-items: stretch;
}

.file-row {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(244, 241, 232, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--item-bg);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.file-grid .file-row {
  min-height: 158px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-content: start;
  align-items: start;
}

.file-grid .row-main {
  align-self: center;
}

.file-grid .row-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 8px;
}

.file-row[data-file-kind="folder"] {
  background:
    linear-gradient(90deg, rgba(85, 214, 190, 0.07), transparent 34%),
    var(--item-folder-bg);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0.92;
}

.mini-button,
.mini-icon-button {
  min-height: 32px;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 8px;
  background: var(--mini-bg);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
}

.mini-icon-button {
  width: 32px;
  display: inline-grid;
  place-items: center;
}

.mini-icon-button svg {
  width: 16px;
  height: 16px;
}

.mini-icon-button.danger {
  color: var(--bad);
}

.mini-button.danger {
  border-color: rgba(255, 122, 144, 0.42);
  color: var(--bad);
}

.primary-mini {
  background: var(--accent);
  border-color: var(--accent);
  color: #06231f;
}

.file-row:hover,
.file-row.selected,
.conversation-item:hover,
.media-item:hover {
  border-color: rgba(85, 214, 190, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
}

.file-row:hover {
  transform: translateY(-1px);
}

.file-row.selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 10px 26px rgba(0, 0, 0, 0.16);
}

.file-row:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.row-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(85, 214, 190, 0.14);
  border: 1px solid rgba(85, 214, 190, 0.22);
}

.file-row[data-file-kind="file"] .row-icon {
  color: var(--accent-2);
  background: rgba(138, 180, 248, 0.12);
  border-color: rgba(138, 180, 248, 0.2);
}

.file-context-menu {
  position: fixed;
  z-index: 60;
  width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
  color: #1f211d;
  box-shadow: var(--shadow);
}

.file-context-menu button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0 12px;
}

.file-context-menu button:hover {
  background: #e7e7e1;
}

.file-context-menu .danger {
  color: #b42335;
}

.row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.inline-edit-form {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-edit-form input[type="text"] {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 32px;
  padding: 0 9px;
}

.locked-name-control {
  min-width: min(320px, 100%);
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}

.locked-name-control input[type="text"] {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.locked-extension {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.inline-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--bad);
  font-size: 12px;
}

.pending-action {
  border-color: var(--amber) !important;
  color: var(--amber) !important;
  box-shadow: inset 0 0 0 1px rgba(242, 201, 109, 0.35);
}

.row-main strong,
.conversation-item strong,
.media-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main strong {
  font-size: 15px;
  line-height: 1.15;
}

.row-main small {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.note-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.calendar-quick-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.checkbox-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.note-form textarea,
.composer textarea {
  resize: vertical;
}

.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.request-chat,
.request-history {
  min-width: 0;
  min-height: 0;
}

.request-chat {
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  gap: 12px;
}

.request-chat-header,
.request-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.request-form,
.account-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.request-form {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.request-category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.request-category {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
}

.request-category.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #05211d;
}

.request-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: stretch;
  gap: 10px;
}

.request-form textarea {
  min-height: 56px;
  max-height: 150px;
  resize: vertical;
}

.request-status {
  min-height: 0;
  color: var(--muted);
  font-weight: 800;
}

.request-context-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.request-context-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
}

.request-context-button.active {
  border-color: var(--accent);
  background: var(--request-active-bg);
  color: var(--accent);
}

.request-context-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-list {
  min-height: 0;
  max-height: calc(100vh - 280px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--request-list-bg);
  padding: 10px;
}

.request-card {
  width: 100%;
  display: grid;
  gap: 7px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
}

.request-card.active {
  border-color: var(--accent);
  background: var(--request-active-bg);
}

.request-card-top,
.request-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}

.request-card-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 850;
  line-height: 1.25;
}

.request-card-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.request-pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.request-pill.done {
  border-color: rgba(85, 214, 190, 0.35);
  color: var(--accent);
}

.request-pill.needs {
  border-color: rgba(245, 190, 85, 0.45);
  color: var(--amber);
}

.request-pill.busy {
  border-color: rgba(130, 170, 255, 0.35);
  color: #9bb8ff;
}

.request-stream {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--request-stream-bg);
  padding: 14px;
}
.request-bubble {
  max-width: min(78ch, 92%);
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 11px 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.request-bubble.user {
  justify-self: end;
  background: var(--bubble-user-bg);
  border-color: rgba(85, 214, 190, 0.55);
}

.request-bubble.dm {
  justify-self: start;
}

.request-bubble.pending span::after {
  content: "A responder...";
  color: var(--muted);
}

.request-bubble.error {
  border-color: rgba(255, 89, 115, 0.5);
  color: var(--bad);
}

.request-bubble.history {
  opacity: 0.88;
}

.request-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.requests-panel {
  display: none;
}

.request-popup[hidden],
.request-launcher[hidden] {
  display: none !important;
}

.request-popup {
  position: fixed;
  z-index: 90;
  right: 22px;
  bottom: 92px;
  width: min(390px, calc(100vw - 28px));
  height: min(720px, calc(100dvh - 118px));
  pointer-events: none;
}

.request-popup-card {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-bg);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
}

.request-popup.history-open .request-popup-card {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.request-popup.history-open .request-stream,
.request-popup.history-open .request-form {
  display: none;
}

.request-popup-header {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--surface-3), color-mix(in srgb, var(--accent) 32%, var(--surface-3)));
  color: var(--text);
  padding: 10px 12px;
}

.request-popup-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.request-popup-title strong,
.request-popup-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-popup-title span {
  opacity: 0.86;
  font-size: 12px;
  font-weight: 700;
}

.request-header-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  color: var(--text);
}

.request-header-button svg,
.request-send-button svg,
.request-launcher svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.request-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #05211d;
  font-size: 12px;
  font-weight: 900;
}

.request-popup .request-context-row {
  min-height: 38px;
  align-items: flex-start;
  flex-wrap: wrap;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  padding: 8px 12px;
}

.request-popup .request-context-button {
  min-height: 28px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
  font-size: 12px;
}

.request-popup .request-context-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #05211d;
}

.request-popup .request-context-row span {
  flex: 1 1 160px;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.request-popup .request-stream {
  min-height: 0;
  overflow: auto;
  align-content: start;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  padding: 16px 18px;
}

.request-popup .request-bubble {
  max-width: 82%;
  border: 0;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  box-shadow: none;
}

.request-popup .request-bubble strong {
  font-size: 12px;
  color: var(--muted);
}

.request-popup .request-bubble.user {
  justify-self: end;
  background: var(--accent);
  color: #05211d;
}

.request-popup .request-bubble.user strong {
  color: rgba(5, 33, 29, 0.72);
}

.request-popup .request-bubble.error {
  background: color-mix(in srgb, var(--bad) 14%, var(--surface));
  color: var(--bad);
}

.request-popup .request-empty {
  min-height: 160px;
  border: 0;
  color: var(--muted);
  text-align: center;
}

.request-history-drawer {
  min-height: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.request-popup.history-open .request-history-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.request-history-drawer summary {
  cursor: pointer;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.request-popup .request-list {
  max-height: 160px;
  min-width: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  padding: 8px;
}

.request-popup.history-open .request-list {
  max-height: none;
  min-height: 0;
  overflow: auto;
  gap: 10px;
  padding: 12px;
}

.request-popup .request-card {
  min-width: 0;
  overflow: hidden;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.request-popup .request-card-top {
  align-items: flex-start;
}

.request-popup .request-card-title,
.request-popup .request-card-preview {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.request-popup.history-open .request-card-title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.request-popup.history-open .request-card-preview {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.request-popup .request-card.active {
  border-color: var(--accent);
  background: var(--request-active-bg);
}

.request-popup .request-card-preview,
.request-popup .request-card-meta,
.request-popup .request-pill {
  color: var(--muted);
}

.request-popup .request-form {
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  padding: 10px 12px 12px;
}

.request-popup .request-image-preview {
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
}

.request-popup .request-image-preview span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-popup .request-image-thumb {
  width: min(220px, 100%);
  margin: 4px 0;
}

.request-popup .request-composer-row {
  grid-template-columns: 1fr 42px;
  gap: 8px;
}

.request-popup .request-form textarea {
  min-height: 42px;
  max-height: 96px;
  resize: none;
  border: 3px solid var(--accent);
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 15px;
}

.request-send-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #05211d;
}

.request-popup #hubRequestHint {
  display: none;
}

.request-launcher {
  position: fixed;
  z-index: 91;
  right: 28px;
  bottom: 22px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #05211d;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
}

.account-form {
  max-width: 560px;
}

.notes-list {
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
}

.notes-calendar {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.calendar-toolbar {
  min-height: 44px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.calendar-toolbar strong {
  text-align: center;
  text-transform: capitalize;
}

.calendar-toolbar > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 112px;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151512;
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.calendar-day.muted {
  background: transparent;
  border-style: dashed;
  opacity: 0.35;
}

.calendar-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(85, 214, 190, 0.38);
}

.calendar-day strong {
  font-size: 14px;
}

.calendar-day small {
  color: var(--accent);
  font-weight: 800;
}

.calendar-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-pill.event {
  border-color: rgba(85, 214, 190, 0.48);
  color: var(--accent);
}

.calendar-pill.task {
  border-color: rgba(255, 198, 109, 0.5);
  color: var(--amber);
}

.calendar-pill.alarm {
  color: var(--bad);
}

.calendar-list-item.done {
  opacity: 0.65;
}

.calendar-list-item.done p {
  text-decoration: line-through;
}

.calendar-note-preview {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.calendar-entry,
.calendar-note-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.calendar-entry.event {
  color: var(--accent);
}

.calendar-entry.task {
  color: var(--amber);
}

.photo-toolbar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-toolbar select {
  width: auto;
  min-width: 120px;
}

.photo-toolbar .icon-button {
  flex: 0 0 42px;
}

.upload-status {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #121210;
  color: var(--muted);
  padding: 10px;
}

.transfer-panel {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.global-transfer {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 18px;
  width: min(520px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  box-shadow: var(--shadow);
}

.transfer-bar {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121210;
}

.transfer-bar span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
  transition: width 120ms ease;
}

.transfer-bar span.indeterminate {
  animation: transferPulse 900ms ease-in-out infinite alternate;
}

.transfer-queue {
  display: grid;
  gap: 5px;
  max-height: 170px;
  overflow: auto;
}

.transfer-queue-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 4px 8px;
}

.transfer-queue-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.transfer-queue-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.transfer-queue-item.active span,
.transfer-queue-item.done span {
  color: var(--accent);
}

.transfer-queue-item.failed span {
  color: var(--bad);
}

@keyframes transferPulse {
  from { transform: translateX(-30%); }
  to { transform: translateX(180%); }
}

.note-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151512;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.note-item p {
  white-space: pre-wrap;
  line-height: 1.45;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  touch-action: pan-y;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151512;
  padding: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-thumb-button {
  width: 100%;
  height: 100%;
  position: relative;
  display: block;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-tile.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(85, 214, 190, 0.45);
}

.photo-tile.pending-delete {
  border-color: var(--bad);
  box-shadow: inset 0 0 0 2px rgba(255, 122, 144, 0.45);
}

.photo-thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-badge,
.photo-check {
  position: absolute;
  z-index: 1;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 7px;
}

.photo-badge {
  left: 8px;
  bottom: 8px;
}

.photo-delete-mark {
  position: absolute;
  z-index: 2;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border-radius: 8px;
  background: rgba(20, 0, 6, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  padding: 8px;
  text-align: center;
  display: grid;
  gap: 7px;
  box-shadow: var(--shadow);
}

.photo-delete-mark span {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.photo-delete-mark .mini-button {
  min-height: 30px;
  background: rgba(255, 255, 255, 0.08);
}

.photo-check {
  top: 8px;
  right: 8px;
  min-width: 28px;
  text-align: center;
}

.media-grid {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.media-item {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--item-bg);
  color: var(--text);
  padding: 9px;
  text-decoration: none;
  text-align: left;
}

.media-item.selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--item-selected-bg);
}

.drive-file-media {
  grid-template-columns: 44px minmax(0, 1fr);
}

.drive-file-media .poster {
  width: 44px;
  height: 44px;
}

.media-details {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.poster {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  color: #141008;
  background: var(--amber);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drive-poster {
  color: #05211d;
  background: var(--accent);
}

.empty-state {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #141411;
  padding: 12px;
  text-align: center;
}

.chat-section {
  padding: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.chat-list-panel {
  min-height: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.chat-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-toolbar {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-toolbar > div:last-child {
  flex: 1 1 auto;
}

.project-inline-form {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--chat-inline-bg);
}

.project-inline-form input[type="text"] {
  flex: 1 1 180px;
}

.conversation-list {
  overflow: auto;
  padding-right: 2px;
}

.conversation-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--chat-inline-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.conversation-item.active {
  border-color: var(--accent);
  background: var(--chat-active-bg);
}

.messages {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.message {
  max-width: min(760px, 92%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message-content {
  white-space: pre-wrap;
}

.message pre {
  position: relative;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  overflow: auto;
  white-space: pre;
}

.code-copy-button {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
}

.message.user {
  justify-self: end;
  background: var(--bubble-user-bg);
  border-color: rgba(85, 214, 190, 0.36);
}

.message.assistant {
  justify-self: start;
}

.message.system {
  justify-self: center;
  max-width: 560px;
  color: var(--muted);
  background: transparent;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.composer-row {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr) 46px 42px;
  gap: 8px;
  align-items: end;
}

.composer textarea {
  min-height: 46px;
  max-height: 160px;
  padding: 12px;
  resize: vertical;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-status {
  color: var(--muted);
  font-size: 12px;
}

.chat-attachments,
.chat-image-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chat-attachment,
.chat-image-preview,
.chat-queue-bar {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--attachment-bg);
  color: var(--muted);
  font-size: 12px;
}

.chat-image-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  align-items: center;
}

.chat-image-thumb {
  width: 48px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--media-thumb-bg);
}

.chat-image-thumb img,
.message-image-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.message-image-thumb {
  display: block;
  width: min(260px, 72vw);
  aspect-ratio: 16 / 10;
  margin-bottom: 8px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--media-thumb-bg);
}

.chat-queue-bar {
  display: grid;
  align-items: stretch;
  gap: 8px;
}

.chat-queue-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-queue-head {
  justify-content: space-between;
}

.chat-queue-list {
  display: grid;
  gap: 6px;
}

.chat-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: flex-start;
}

.chat-queue-item textarea {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  max-height: 96px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--queue-input-bg);
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  resize: vertical;
}

.chat-queue-item.active textarea {
  border-color: rgba(85, 214, 190, 0.38);
  background: var(--queue-active-bg);
  color: var(--text);
}

.chat-queue-meta {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.chat-attachment button,
.chat-image-preview button,
.chat-queue-bar button {
  min-height: 22px;
  border: 0;
  background: transparent;
  color: var(--bad);
  padding: 0 4px;
}

.chat-queue-bar .chat-queue-edit-button {
  color: var(--accent);
}

.context-meter {
  position: relative;
  width: 118px;
  min-height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--context-bg);
  color: var(--text);
  font-size: 12px;
}

.context-meter span:last-child {
  position: relative;
  z-index: 1;
}

#contextMeterFill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(85, 214, 190, 0.35);
  transition: width 160ms ease, background 160ms ease;
}

.slash-hints,
.selection-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11110f;
  box-shadow: var(--shadow);
}

.slash-hints {
  display: grid;
  gap: 2px;
  padding: 5px;
}

.slash-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.slash-item.active,
.slash-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.selection-toolbar {
  position: fixed;
  z-index: 60;
  display: flex;
  overflow: hidden;
}

.selection-toolbar button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
}

.selection-toolbar button:hover {
  background: var(--surface-2);
}

.thinking-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.thinking-star {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: #ff8a3d;
}

.thinking-star::before {
  content: "*";
  font-size: 28px;
  line-height: 1;
}

.thinking-strip .thinking-star,
.work-details.working > summary .thinking-star {
  animation: thinking-spin 1.1s linear infinite;
}

@keyframes thinking-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.work-details {
  margin-bottom: 10px;
  border: 1px solid #353530;
  border-radius: 8px;
  background: #11110f;
  overflow: hidden;
}

.work-details summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}

.work-body {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.work-placeholder {
  padding: 8px 10px;
  color: var(--muted);
}

.tool-card {
  border: 1px solid #3b3b35;
  border-radius: 8px;
  background: #121713;
  overflow: hidden;
}

.tool-card-header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
}

.tool-card-icon {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(85, 214, 190, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 8px, rgba(85, 214, 190, 0.8) 8px 10px, transparent 10px),
    linear-gradient(0deg, transparent 8px, rgba(85, 214, 190, 0.8) 8px 10px, transparent 10px);
}

.tool-card-header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tool-card-header small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card-status {
  padding: 3px 7px;
  border: 1px solid rgba(85, 214, 190, 0.32);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

.tool-card-status.error {
  border-color: rgba(255, 105, 97, 0.4);
  color: var(--bad);
}

.tool-card pre {
  margin: 0;
  max-height: 220px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.86);
}

.chat-image-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.86);
}

.chat-image-modal[hidden] {
  display: none;
}

.chat-image-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-image-modal-toolbar > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-image-modal-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
}

.chat-image-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
}

.chat-image-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.chat-image-stage canvas {
  position: absolute;
  touch-action: none;
  pointer-events: none;
}

.chat-image-stage.drawing canvas {
  pointer-events: auto;
  cursor: crosshair;
}

.lightbox-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.lightbox-toolbar > div {
  display: flex;
  gap: 8px;
}

.lightbox img,
.lightbox video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 8px;
}

.media-player video {
  background: #000;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  pointer-events: none;
}

.drop-overlay > div {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #111915;
  color: var(--text);
  padding: 22px;
  display: grid;
  gap: 6px;
  text-align: center;
  box-shadow: var(--shadow);
}

.office-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--bg);
  padding: 12px;
}

.office-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.office-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
}

.office-toolbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-editor {
  min-height: 0;
  background: #ffffff;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1060px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 0;
    max-height: 210px;
  }

  .request-layout {
    grid-template-columns: 1fr;
  }

  .request-list {
    min-height: 220px;
    max-height: none;
  }
}

@media (max-width: 980px) {
  html.focused-mode,
  body.focused-mode {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.focused-section {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .side-nav {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: calc(70px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .nav-brand,
  .nav-logout {
    display: none;
  }

  .side-nav nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: visible;
    gap: 4px;
  }

  .nav-link {
    min-height: 54px;
    min-width: 0;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    font-size: 11px;
  }

  .nav-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-link.mobile-more-item {
    display: none;
  }

  .mobile-more-button {
    display: flex;
  }

  .mobile-more-menu {
    position: fixed;
    z-index: 35;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: min(210px, calc(100vw - 24px));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 6px;
  }

  .mobile-more-menu:not([hidden]) {
    display: grid;
    gap: 4px;
  }

  .mobile-more-menu button {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 0 12px;
    font-weight: 800;
  }

  .mobile-more-menu button:hover {
    background: var(--surface-2);
  }

  .nav-link svg {
    width: 18px;
    height: 18px;
  }

  .nav-link.active {
    box-shadow: inset 0 3px 0 var(--accent);
  }

  main {
    padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
  }

  .focused-section main {
    display: block;
    height: calc(100dvh - 70px - env(safe-area-inset-bottom));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .focused-section .workspace-grid {
    overflow: visible;
  }

  .overview-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focused-section .hub-panel {
    min-height: auto;
  }

  .focused-section .chat-section {
    height: auto;
    overflow: visible;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin: -18px -14px 16px;
    padding: 14px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 620px) {
  .login-panel {
    padding: 22px;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .user-badge span,
  .profile-picker span,
  .model-picker span {
    display: none;
  }

  .user-badge {
    min-height: 42px;
    padding: 0 10px;
  }

  .profile-picker select,
  .model-picker select {
    min-width: 118px;
    max-width: 44vw;
  }

  .theme-option {
    width: 36px;
    padding: 0;
  }

  .status-strip {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px 14px;
  }

  .overview-action-grid,
  .overview-card-grid {
    grid-template-columns: 1fr;
  }

  .overview-action {
    min-height: 54px;
    grid-template-columns: 28px 1fr;
    justify-items: start;
  }

  .hub-panel {
    padding: 14px;
  }

  .panel-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .panel-actions {
    flex-wrap: wrap;
  }

  .files-panel .panel-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .drive-location-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .drive-breadcrumbs,
  .drive-view-tools {
    width: 100%;
  }

  .drive-view-tools {
    justify-content: space-between;
  }

  .drive-crumb {
    font-size: 17px;
  }

  .drive-content {
    grid-template-columns: 1fr;
  }

  .file-info-panel {
    position: static;
    order: -1;
  }

  .drive-menu {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto;
  }

  .inline-form,
  .doc-form {
    grid-template-columns: 1fr;
  }

  .calendar-quick-form,
  .request-layout {
    grid-template-columns: 1fr;
  }

  .request-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-composer-row {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    grid-template-rows: minmax(0, 150px) minmax(0, 1fr);
  }

  .chat-panel {
    min-height: 0;
  }

  .messages {
    min-height: 0;
    overflow: auto;
  }

  .composer-row {
    grid-template-columns: 38px 38px minmax(0, 1fr) 42px 38px;
    gap: 6px;
  }

  .composer {
    padding: 10px;
  }

  .file-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .file-list {
    max-height: none;
    overflow: visible;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .selection-bar {
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .selection-bar strong {
    flex: 1 0 100%;
    margin-right: 0;
  }

  .selection-bar .secondary-button,
  .selection-bar .ghost-button {
    flex: 1 1 0;
  }

  .calendar-toolbar {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .calendar-toolbar > div {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .calendar-toolbar > div .secondary-button {
    flex: 1;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .calendar-weekdays span {
    font-size: 10px;
  }

  .calendar-day {
    min-height: 74px;
    padding: 6px;
  }

  .calendar-entry,
  .calendar-note-preview span {
    display: none;
  }

  .file-context-menu {
    left: 10px !important;
    right: 10px;
    top: auto !important;
    bottom: 82px;
    width: auto;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .global-transfer {
    bottom: 84px;
  }

  .app-modal {
    align-items: end;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
  }

  .app-modal-card {
    width: 100%;
  }

  .share-card {
    max-height: calc(100vh - 110px);
    overflow: auto;
  }

  .share-add-row,
  .share-general-row {
    grid-template-columns: 1fr;
  }

  .share-general {
    margin-left: -12px;
    margin-right: -12px;
  }

  .share-person {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .share-person em {
    grid-column: 2;
  }

  .share-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .share-footer .ghost-button,
  .share-card .primary-button {
    width: 100%;
  }

  .message {
    max-width: 100%;
  }

  .request-popup {
    inset: 10px 10px calc(82px + env(safe-area-inset-bottom)) 10px;
    width: auto;
    height: auto;
  }

  .request-popup-card {
    border-radius: 16px;
  }

  .request-launcher {
    right: 18px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
  }
}

html[data-theme="light"] .hub-panel,
html[data-theme="light"] .chat-section,
html[data-theme="light"] .request-chat,
html[data-theme="light"] .request-history {
  background: var(--panel-bg);
}

html[data-theme="light"] .view-switch,
html[data-theme="light"] .info-toggle,
html[data-theme="light"] .file-info-panel,
html[data-theme="light"] .calendar-day,
html[data-theme="light"] .upload-status,
html[data-theme="light"] .transfer-bar,
html[data-theme="light"] .note-item,
html[data-theme="light"] .photo-tile,
html[data-theme="light"] .slash-hints,
html[data-theme="light"] .selection-toolbar,
html[data-theme="light"] .work-details,
html[data-theme="light"] .tool-card {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme="light"] .request-list,
html[data-theme="light"] .request-stream {
  background: var(--request-stream-bg);
}

html[data-theme="light"] .request-list {
  background: var(--request-list-bg);
}

html[data-theme="light"] .request-card,
html[data-theme="light"] .request-bubble,
html[data-theme="light"] .message,
html[data-theme="light"] .conversation-item,
html[data-theme="light"] .chat-attachment,
html[data-theme="light"] .chat-image-preview,
html[data-theme="light"] .chat-queue-bar {
  background: var(--surface-2);
}

html[data-theme="light"] .request-card.active,
html[data-theme="light"] .conversation-item.active,
html[data-theme="light"] .request-bubble.user,
html[data-theme="light"] .message.user {
  background: var(--bubble-user-bg);
}

html[data-theme="light"] .message pre,
html[data-theme="light"] .chat-queue-item textarea,
html[data-theme="light"] .chat-queue-item.active textarea {
  background: var(--code-bg);
  border-color: var(--line);
}

html[data-theme="light"] .chat-image-thumb,
html[data-theme="light"] .message-image-thumb {
  background: var(--media-thumb-bg);
}

html[data-theme="light"] .path-label,
html[data-theme="light"] .selection-bar,
html[data-theme="light"] .upload-status,
html[data-theme="light"] .transfer-bar {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme="light"] .file-row,
html[data-theme="light"] .media-item {
  background: var(--item-bg);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .file-row[data-file-kind="folder"] {
  background:
    linear-gradient(90deg, rgba(43, 184, 173, 0.14), transparent 42%),
    var(--item-folder-bg);
}

html[data-theme="light"] .file-row:hover,
html[data-theme="light"] .file-row.selected,
html[data-theme="light"] .media-item:hover,
html[data-theme="light"] .media-item.selected {
  background: var(--item-selected-bg);
  border-color: rgba(43, 184, 173, 0.42);
}

html[data-theme="light"] .mini-button,
html[data-theme="light"] .mini-icon-button {
  background: var(--mini-bg);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .office-overlay {
  background: var(--bg);
}

html[data-theme="light"] .office-shell,
html[data-theme="light"] .office-toolbar {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="light"] .office-toolbar .icon-button {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
