:root {
  color-scheme: light;
  --bg: #f4f8ff;
  --surface: #ffffff;
  --surface-2: #edf5ff;
  --surface-3: #f8fbff;
  --text: #162033;
  --muted: #66758f;
  --line: #d8e5f5;
  --accent: #1f7ae0;
  --accent-deep: #155db1;
  --accent-soft: #ddecff;
  --danger: #d94848;
  --focus: #7bb7ff;
  --shadow: 0 18px 48px rgba(39, 89, 148, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body.locked .topbar,
body.locked .app-shell {
  filter: blur(1px);
  pointer-events: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 248, 255, 0.9);
  backdrop-filter: blur(10px);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  width: min(380px, 100%);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.login-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
p {
  margin: 0;
}

.topbar {
  position: relative;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 22px;
  height: 72px;
  padding: 0 20px 0 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  overflow: visible;
}

.topbar-brand,
.topbar-actions,
.editor-actions,
.panel-heading,
.dialog-head,
.dialog-actions,
.strip-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-actions {
  justify-content: flex-end;
}

.dialog-head .icon-button {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: var(--surface-2);
}

.topbar-brand {
  justify-content: flex-start;
  align-items: center;
}

.topbar-actions {
  position: relative;
  z-index: 130;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  align-content: center;
  min-height: 54px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.save-state {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.role-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--accent-deep);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.role-badge[data-role="super_admin"] {
  color: #ffffff;
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.role-badge[data-role="admin"] {
  color: var(--accent-deep);
  border-color: #b8d7ff;
  background: #eef6ff;
}

.role-badge[data-role="viewer"] {
  color: var(--muted);
  background: var(--surface-3);
}

.snapshot-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.avatar-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent-deep);
  font-weight: 900;
}

.user-menu {
  position: relative;
}

.avatar-menu {
  position: absolute;
  z-index: 200;
  top: calc(100% + 12px);
  right: -4px;
  display: grid;
  width: 184px;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.avatar-menu[hidden] {
  display: none;
}

.avatar-menu button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 850;
  text-align: left;
}

.avatar-menu button:hover {
  color: var(--accent-deep);
  background: var(--surface-2);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 6px;
}

.sidebar-section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  font-weight: 800;
}

.create-folder {
  color: var(--accent-deep);
  background: var(--surface-2);
}

.create-file,
.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.panel-heading {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ghost-button {
  min-height: 32px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.drawer-entry {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--accent-deep);
  font-weight: 900;
  text-align: left;
}

.drawer-entry.subtle {
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid transparent;
}

.drawer-entry.subtle:hover,
.drawer-entry.subtle.active {
  background: var(--surface-2);
  border-color: var(--line);
}

.workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 18px;
  gap: 14px;
  overflow: hidden;
}

.writing-surface,
.history-panel,
.folder-page,
.trash-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.folder-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.folder-page[hidden] {
  display: none;
}

.editor-area[hidden] {
  display: none;
}

.folder-header,
.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.folder-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.folder-stats article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.folder-stats span {
  display: block;
  color: var(--accent-deep);
  font-size: 26px;
  font-weight: 900;
}

.folder-stats p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.folder-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.folder-list .empty-state {
  align-self: start;
}

.folder-row {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-3);
  text-align: left;
}

.folder-row:hover,
.folder-row.active {
  border-color: var(--focus);
  background: var(--surface-2);
}

.folder-row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

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

.folder-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-row strong > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-row small {
  display: block;
}

.folder-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.folder-row-more {
  color: var(--muted);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.title-row button {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.editor-actions button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.editor-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.tool-button {
  border: 1px solid var(--line);
  color: var(--accent-deep);
  background: var(--surface-2);
}

.tool-button:hover:not(:disabled),
.create-folder:hover,
.create-file:hover {
  border-color: var(--focus);
  filter: brightness(0.99);
}

.icon-tool {
  display: inline-grid;
  place-items: center;
  width: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.tool-button:disabled {
  opacity: 0.42;
}

.text-tool {
  min-width: 48px;
}

.font-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.font-control input {
  width: 96px;
}

.tree-item:hover,
.tree-item.active {
  border-color: var(--focus);
  background: var(--surface-2);
}

.tree-item.located {
  box-shadow: inset 3px 0 0 var(--accent);
}

.tree-item.dragging {
  opacity: 0.45;
}

.tree-item.drop-target,
.folder-row.drop-target {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.tree-item.drop-target-folder,
.folder-row.drop-target-folder {
  border-color: var(--accent);
  background: #e7f2ff;
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 8px 18px rgba(31, 122, 224, 0.12);
}

.tree-item.drop-before::before,
.folder-row.drop-before::before,
.tree-item.drop-after::after,
.folder-row.drop-after::after {
  content: "";
  position: absolute;
  right: 8px;
  left: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.tree-item.drop-before::before,
.folder-row.drop-before::before {
  top: -3px;
}

.tree-item.drop-after::after,
.folder-row.drop-after::after {
  bottom: -3px;
}

.editor-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.editor-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  align-items: end;
  column-gap: 16px;
  row-gap: 8px;
  min-height: 62px;
}

.path-stack {
  grid-column: 1 / -1;
  min-width: 0;
}

.editor-header .editor-actions {
  margin-left: auto;
  max-width: min(760px, 100%);
  transform: translateY(-10px);
}

.folder-header .editor-actions {
  flex: 1;
}

.path-stack {
  max-width: none;
  min-width: 0;
}

#currentPath {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

#titleInput {
  flex: 0 1 min(520px, 42vw);
  min-width: 220px;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 26px;
  font-weight: 900;
}

#titleInput:focus {
  border-bottom-color: var(--focus);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  gap: 16px;
  min-height: 0;
  flex: 1;
}

.writing-surface {
  min-height: 430px;
  overflow: hidden;
}

#editor {
  width: 100%;
  height: 100%;
  min-height: 430px;
  padding: 24px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
  line-height: 1.72;
}

#editor[readonly] {
  cursor: text;
  background: #fbfdff;
}

.history-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px;
}

.history-hint,
.dialog-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.version-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.version-card.active {
  border-color: var(--accent);
  background: #edf6ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.version-card strong {
  font-size: 13px;
}

.version-current {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 7px;
  color: #ffffff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.version-card p {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-card button {
  justify-self: start;
  min-height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--accent-deep);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 800;
}

.version-card button:hover {
  background: var(--accent-soft);
}

.empty-state {
  padding: 16px 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
}

#collapseSidebarButton {
  width: 42px;
  height: 42px;
  font-size: 20px;
}

dialog {
  width: min(440px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog.wide-dialog {
  width: min(560px, calc(100vw - 28px));
  height: 100vh;
  max-height: 100vh;
  margin: 0 auto 0 0;
  border-radius: 0 8px 8px 0;
}

dialog::backdrop {
  background: rgba(19, 36, 61, 0.42);
  backdrop-filter: blur(3px);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
}

.directory-card {
  height: 100%;
  max-height: 100vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#nameInput,
#moveSelect,
.team-grid input,
.team-grid select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: 0;
  background: var(--surface);
}

#nameInput:focus,
#moveSelect:focus,
.team-grid input:focus,
.team-grid select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(123, 183, 255, 0.2);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.team-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.share-member-list {
  display: grid;
  max-height: 220px;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}

.share-member-list[hidden] {
  display: none;
}

.share-member-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 850;
}

.share-member-option:has(input:checked) {
  border-color: var(--focus);
  background: #eef6ff;
}

.share-member-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.share-member-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.share-member-option small,
.share-member-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.member-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.member-info {
  min-width: 0;
}

.member-row strong {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.member-row p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

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

.member-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--accent-deep);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 900;
}

.member-row button {
  flex: 0 0 auto;
  min-height: 30px;
  border-radius: 7px;
  padding: 0 9px;
  color: var(--accent-deep);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 850;
}

.member-row .danger-text-button {
  color: var(--danger);
  background: #fff1f1;
}

.member-row button:disabled {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-list button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-2);
  font-weight: 850;
  text-align: left;
}

.action-list button.danger-text {
  color: var(--danger);
  background: #fff1f1;
}

.danger-fill {
  background: var(--danger);
}

.context-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  min-width: 148px;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.context-menu button:hover:not(:disabled) {
  color: var(--accent-deep);
  background: var(--surface-2);
}

.context-menu button.danger-text {
  color: var(--danger);
}

.context-menu button.muted,
.context-menu button:disabled {
  color: var(--muted);
  cursor: default;
}

.tree {
  display: block;
  min-height: 0;
  overflow: auto;
}

.sidebar-tree {
  flex: 1;
  max-height: none;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.tree-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 22px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 7px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.tree-root {
  min-height: 34px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 900;
}

.tree-folder:not(.tree-root) {
  color: #233453;
}

.tree-file {
  grid-template-columns: 16px 22px minmax(0, 1fr) 24px;
  color: var(--muted);
  font-weight: 700;
}

.tree-caret {
  color: var(--muted);
  font-size: 12px;
}

.tree-folder-icon,
.tree-doc-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
}

.tree-folder-icon {
  position: relative;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.tree-folder-icon::before {
  content: "";
  width: 13px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.tree-folder-icon::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 7px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.tree-doc-icon {
  position: relative;
}

.tree-doc-icon::before {
  content: "";
  width: 12px;
  height: 15px;
  border: 2px solid #8aa0bf;
  border-radius: 3px;
  background: #ffffff;
}

.tree-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tree-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-badge {
  flex: 0 0 auto;
  min-width: max-content;
  border: 1px solid #b8d7ff;
  border-radius: 999px;
  padding: 1px 6px 2px;
  color: var(--accent-deep);
  background: #eef6ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.folder-row .shared-badge {
  font-size: 12px;
}

.tree-more {
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  opacity: 0;
}

.tree-item:hover .tree-more,
.tree-item.active .tree-more {
  opacity: 1;
}

.tree-children {
  margin-left: 15px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.tree-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tree-section-title {
  margin: 0 0 7px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tree-empty {
  margin: 0;
  padding: 6px 8px;
  color: #8a9ab5;
  font-size: 12px;
}

.tree-restored,
.tree-shared {
  color: #40516e;
}

.trash-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.trash-page[hidden] {
  display: none;
}

.trash-header,
.trash-row,
.trash-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trash-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.trash-back {
  justify-self: start;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--accent-deep);
  background: var(--surface-2);
  font-weight: 850;
}

.trash-row {
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.trash-folder-row {
  cursor: pointer;
}

.trash-folder-row:hover {
  border-color: var(--focus);
  background: var(--surface-2);
}

.trash-row > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.trash-row strong {
  display: block;
  margin-bottom: 3px;
}

.trash-row p {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
}

.trash-actions button {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--accent-deep);
  background: var(--surface-2);
  font-weight: 850;
}

.danger-text-button {
  color: var(--danger) !important;
  background: #fff1f1 !important;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 54px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  align-items: center;
  padding: 14px 8px;
}

body.sidebar-collapsed .sidebar-head div,
body.sidebar-collapsed .sidebar-tree,
body.sidebar-collapsed .sidebar-footer span:last-child {
  display: none;
}

body.sidebar-collapsed .drawer-entry {
  grid-template-columns: 1fr;
  width: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
}

body.sidebar-collapsed #collapseSidebarButton {
  transform: rotate(180deg);
}

@media (max-width: 900px) {
  .topbar,
  .app-shell,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    padding: 14px;
  }

  .topnav {
    overflow-x: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 14px;
  }

  .strip-heading,
  .editor-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .muted-text {
    text-align: left;
  }

  #titleInput {
    width: 100%;
    font-size: 23px;
  }
}
