:root {
  --sage: #52816b;
  --sage-dark: #2d644b;
  --sage-header: #15382e;
  --sage-soft: #e8f0e9;
  --page-bg: #f3f4ef;
  --surface: #fffefb;
  --surface-muted: #f5f7f2;
  --ink: #172b24;
  --ink-soft: #293e34;
  --muted: #52645a;
  --dim: #52645a;
  --line: #dce3da;
  --line-strong: #a9baaf;
  --danger: #942f2c;
  --shadow-sm: 0 1px 3px rgba(92, 84, 72, .07), 0 1px 2px rgba(92, 84, 72, .04);
  --shadow-md: 0 8px 28px rgba(92, 84, 72, .11);
  --shadow-float: 0 22px 70px rgba(63, 58, 49, .22);
  --radius-sm: 8px;
  --radius: 12px;
  --header-height: 56px;
  --sidebar-width: 232px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--page-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--ink-soft);
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: .021;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.74'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

button,
input,
select { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--sage-dark);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
  transition: transform .18s ease;
}

.skip-link:focus { transform: translateY(0); }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 12;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 0 12px 14px;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.brand-block {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -12px 10px;
  padding: 0 16px;
  background: var(--sage-header);
  color: var(--surface);
}

.brand-mark,
.auth-seal {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 252, 246, .3);
  border-radius: 10px;
  background: rgba(255, 252, 246, .13);
  color: var(--surface);
  font-family: "STSong", "SimSun", serif;
  font-size: 16px;
}

.brand-block strong,
.brand-block span { display: block; }

.brand-block strong {
  color: var(--surface);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}

.brand-block span {
  margin-top: 1px;
  color: rgba(255, 252, 246, .9);
  font-size: 12px;
}

.root-button,
.tree-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.root-button { margin-top: 2px; font-weight: 650; }
.root-button:hover,
.tree-button:hover { background: var(--surface-muted); color: var(--ink); }
.root-button.is-active,
.tree-button.is-active {
  background: var(--sage-soft);
  color: var(--sage-dark);
  box-shadow: inset 0 0 0 1px rgba(107, 125, 99, .13);
}

.folder-glyph {
  position: relative;
  width: 17px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: currentColor;
  opacity: .8;
}

.folder-glyph::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 1px;
  width: 8px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.folder-tree {
  flex: 1;
  margin-top: 4px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 125, 99, .28) transparent;
}

.tree-button { font-size: 14px; }
.tree-button span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }

.sidebar-footer {
  padding: 13px 8px 0;
  border-top: 1px solid var(--line);
}

.sidebar-footer span { margin-top: 2px; color: var(--dim); font-size: 12px; }
.index-status { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.index-status.is-stale,
.preview-title-wrap .preview-update { color: var(--danger); }

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.breadcrumbs {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.breadcrumbs:empty + .top-actions { flex: 1; justify-content: space-between; }
.breadcrumbs:empty { display: none; }

.up-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
}
.up-button:hover { border-color: var(--line-strong); background: var(--sage-soft); }

.crumb {
  min-width: 0;
  min-height: 38px;
  padding: 0 3px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.crumb:hover { color: var(--ink); }
.crumb-separator { flex: none; padding: 0 5px; color: var(--muted); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  width: min(32vw, 360px);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--muted);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.search-box:focus-within {
  border-color: var(--sage-dark);
  background: var(--surface);
  box-shadow: 0 0 0 2px #2d644b26;
}

.search-glyph {
  position: relative;
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin-right: 3px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.search-glyph::after {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 5px;
  height: 1.5px;
  transform: rotate(45deg);
  background: currentColor;
  content: "";
}
.menu-glyph {
  display: block;
  width: 16px;
  height: 2px;
  margin: auto;
  background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.search-box input::placeholder { color: var(--muted); }

.quiet-button,
.icon-button,
.primary-button {
  min-height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.quiet-button:hover { border-color: var(--line-strong); background: var(--surface-muted); }

.icon-button {
  width: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}


.primary-button {
  width: 100%;
  padding: 0 20px;
  border: 1px solid var(--sage-dark);
  background: var(--sage-dark);
  color: var(--surface);
  font-weight: 700;
}
.primary-button:hover { background: var(--sage-header); }
.primary-button:disabled { opacity: .56; cursor: not-allowed; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

.browser-panel {
  min-width: 0;
  padding: 18px 18px 34px;
}

.content-grid:has(.preview-panel.is-open) {
  grid-template-columns: minmax(390px, 1fr) minmax(390px, 47%);
}

.preview-panel {
  display: none;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--page-bg);
}
.preview-panel.is-open { display: block; }

.panel-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.panel-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.18;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.count-block {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.list-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px 78px;
  align-items: center;
  gap: 12px;
}

.list-head {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-muted);
  color: var(--dim);
  font-size: 13px;
  font-weight: 650;
}
.list-head span:last-child,
.file-size { text-align: right; }

.file-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.file-row {
  width: 100%;
  min-height: 54px;
  padding: 6px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, box-shadow .15s ease;
}

.file-row:last-child { border-bottom: 0; }
.file-row:focus-visible { outline-offset: -2px; }
.file-row:hover { background: var(--surface-muted); }
.file-row.is-selected {
  background: var(--sage-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(107, 125, 99, .2);
}

.file-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-copy { min-width: 0; }
.file-copy strong,
.file-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-copy strong { color: var(--ink); font-size: 14px; font-weight: 650; }
.file-copy span { margin-top: 2px; color: var(--dim); font-size: 12px; }
.file-date,
.file-size { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }

.file-icon {
  position: relative;
  width: 30px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.file-icon.folder {
  width: 31px;
  height: 23px;
  border: 0;
  border-radius: 4px;
  background: var(--sage);
  color: var(--surface);
}
.file-icon.folder::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 3px;
  width: 13px;
  height: 6px;
  border-radius: 3px 3px 0 0;
  background: var(--sage);
}
.file-icon.image { color: #4f775d; background: #f1f5ef; }
.file-icon.pdf { color: #a75e50; background: #f8eeeb; }
.file-icon.sheet { color: #4e755b; background: #eef4ed; }
.file-icon.docx,
.file-icon.document { color: #5c7287; background: #eef1f3; }
.file-icon.email { color: #8a6d3e; background: #f7f1e7; }
.file-icon.archive { color: #725f82; background: #f2eef4; }
.file-icon.video,
.file-icon.audio { color: #6c6f82; background: #f0f0f4; }




.preview-active {
  position: sticky;
  top: var(--header-height);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  background: var(--surface);
}

.preview-header {
  min-height: 66px;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.preview-title-wrap {
  min-width: 0;
  flex: 1 1 10rem;
  display: flex;
  align-items: center;
  gap: 9px;
}
.preview-title-wrap > div { min-width: 0; }
.preview-title-wrap h2 { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 15px; }
.preview-title-wrap p { margin: 3px 0 0; color: var(--dim); font-size: 12px; }

.file-badge {
  flex: 0 0 auto;
  padding: 5px 6px;
  border-radius: 6px;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-size: 9px;
  font-weight: 800;
}
.preview-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-actions .quiet-button { white-space: nowrap; }
.preview-actions #wpsOriginalLink { color: var(--sage-dark); border-color: var(--line-strong); background: var(--sage-soft); }
.preview-options { position: relative; }
.preview-options > summary { list-style: none; cursor: pointer; }
.preview-options > summary::-webkit-details-marker { display: none; }
.preview-options > summary::after { content: "⌄"; margin-left: 5px; }
.preview-options:focus-within > summary { border-color: var(--sage-dark); }
.preview-option-actions {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 4px) 0 auto auto;
  display: grid;
  min-width: max-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.preview-close { font-size: 20px; }

.preview-stage,
.extract-panel {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(107, 125, 99, .35) transparent;
}

.preview-stage {
  background: #e9ede6;
}

.extract-panel {
  padding: 18px 22px;
  background: var(--surface);
}

.extract-status {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.extract-panel pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.7;
}
.preview-stage > iframe,
.preview-stage > video,
.preview-stage > audio { width: 100%; border: 0; }
.preview-stage > iframe { height: 100%; background: var(--surface); }
.preview-stage > video { height: 100%; background: #222622; }
.preview-stage > audio { width: calc(100% - 48px); margin: 24px; }

.preview-image-wrap { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.preview-image-wrap img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 4px; box-shadow: var(--shadow-md); }

.text-preview,
.email-preview,
.generic-preview,
.archive-preview,
.sheet-preview {
  min-height: 100%;
  margin: 0;
  padding: 22px;
  background: var(--surface);
  color: var(--ink-soft);
}
.text-preview { white-space: pre-wrap; word-break: break-word; font: 12px/1.72 Consolas, "Microsoft YaHei UI", monospace; }
.email-preview h3,
.generic-preview h3 { margin-top: 0; color: var(--ink); }
.email-fields { display: grid; grid-template-columns: 62px 1fr; gap: 8px 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); font-size: 11px; }
.email-fields dt { color: var(--dim); }
.email-fields dd { margin: 0; word-break: break-word; }
.email-body { white-space: pre-wrap; line-height: 1.72; font-size: 12px; }

.generic-preview { display: grid; place-content: center; justify-items: center; text-align: center; }
.generic-preview p { max-width: 420px; color: var(--muted); line-height: 1.7; font-size: 12px; }
.archive-preview > p { color: var(--muted); font-size: 11px; }
.archive-preview ul { margin: 0; padding: 0; list-style: none; }
.archive-preview li { padding: 8px 0; border-bottom: 1px solid var(--line); font: 11px Consolas, monospace; word-break: break-all; }
.archive-image { display: block; max-width: 100%; height: auto; max-height: 70vh; margin: 8px auto 4px; object-fit: contain; border-radius: 4px; }

.sheet-tabs { display: flex; gap: 5px; overflow: auto; margin-bottom: 10px; }
.sheet-tab { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); color: var(--muted); cursor: pointer; }
.sheet-tab.is-active { border-color: var(--sage-dark); background: var(--sage-dark); color: var(--surface); }
.sheet-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sheet-table-wrap table { min-width: 100%; border-collapse: collapse; background: var(--surface); font-size: 10px; }
.sheet-table-wrap td,
.sheet-table-wrap th { max-width: 360px; padding: 6px 8px; border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-table-wrap th { background: var(--sage-soft); color: var(--sage-dark); }

.docx-preview-wrap { min-height: 100%; padding: 18px; overflow: auto; background: #ddd9d2; }
.docx-preview-wrap .docx-wrapper { width: max-content; min-width: 0; align-items: flex-start; margin: 0 auto; padding: 0; background: transparent; transform-origin: top center; }
.docx-preview-wrap .docx { margin-left: 0 !important; margin-right: 0 !important; }
.pptx-preview-wrap { min-height: 100%; padding: 16px; overflow: auto; background: #30352f; }
.pptx-preview-wrap > div { min-height: 100%; }

.skeleton-row {
  height: 54px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent 0, rgba(139, 157, 131, .11) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: skeleton 1.25s ease-in-out infinite;
}
@keyframes skeleton { to { background-position: -200% 0; } }

.empty-state {
  min-height: 240px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  padding: 24px;
  color: var(--dim);
  text-align: center;
}
.empty-state strong { color: var(--ink-soft); }
.empty-state span { font-size: 11px; }
.load-error .retry-button { margin-top: 10px; }

.auth-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 38%, rgba(238, 241, 234, .22), transparent 42%),
    rgba(64, 75, 59, .82);
  backdrop-filter: blur(14px) saturate(.72);
}

.auth-card {
  width: min(416px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 252, 246, .42);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}

.auth-card-top {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--sage-header);
  color: var(--surface);
}

.auth-card .auth-seal {
  width: 36px;
  height: 36px;
  color: var(--surface);
  border-color: rgba(255, 252, 246, .3);
  background: rgba(255, 252, 246, .13);
}

.auth-brand-copy { min-width: 0; }
.auth-brand-copy strong { color: var(--surface); font-size: 15px; }


.auth-prompt { padding: 27px 28px 28px; }
.auth-card h2 { margin: 5px 0 7px; color: var(--ink); font-size: 22px; line-height: 1.22; letter-spacing: -.025em; text-wrap: balance; }
.auth-prompt > p:not(.form-error) { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.auth-card label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.auth-card input,
.auth-card select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 16px;
}
.auth-card select { margin-bottom: 12px; }
.auth-card input { letter-spacing: .14em; }
.auth-card input:hover { border-color: rgba(107, 125, 99, .38); }
.auth-card input:focus, .auth-card select:focus { border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(107, 125, 99, .14); }
.form-error { min-height: 18px; margin: 5px 0; color: var(--danger); font-size: 13px; }

.auth-card .primary-button { min-height: 46px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 110;
  max-width: min(380px, calc(100vw - 36px));
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--sage-dark);
  color: var(--surface);
  box-shadow: var(--shadow-float);
  font-size: 11px;
}

.mobile-only { display: none; }

@media (max-width: 1180px) {
  .list-head,
  .file-row { grid-template-columns: minmax(0, 1fr) 104px 64px; gap: 8px; }
}

@media (max-width: 1060px) {
  .content-grid:has(.preview-panel.is-open) { grid-template-columns: minmax(0, 1fr); }
  .preview-panel {
    position: fixed;
    inset: var(--header-height) 0 0 var(--sidebar-width);
    z-index: 15;
    display: none;
    border-left: 0;
    box-shadow: var(--shadow-float);
  }
}

@media (max-width: 760px) {
  :root { --sidebar-width: min(84vw, 294px); --header-height: 50px; }
  body { overscroll-behavior-y: none; }
  .app-shell { display: block; }
  .workspace { width: 100%; }
  .sidebar {
    z-index: 50;
    transform: translateX(-104%);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
    box-shadow: var(--shadow-float);
  }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-only { display: inline-block; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(62, 58, 51, .42); backdrop-filter: blur(2px); }
  .topbar { padding: 5px 10px; gap: 7px; }
  .breadcrumbs { display: none; }
  .top-actions { flex: 1; min-width: 0; }
  .search-box { width: 100%; height: 44px; }
  .up-button,
  .quiet-button,
  .icon-button,
  .primary-button,
  .sheet-tab { min-height: 44px; }
  .icon-button { width: 44px; }
  .browser-panel { padding: 13px 12px calc(28px + env(safe-area-inset-bottom)); }
  .panel-heading { min-height: 56px; margin-bottom: 5px; }
  .panel-heading h1 { font-size: 22px; }
  .count-block { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
  .list-head { display: none; }
  .file-list { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .file-row {
    grid-template-columns: minmax(0, 1fr) 66px;
    min-height: 54px;
    margin-bottom: 4px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }
  .file-row:last-child { border-bottom: 1px solid var(--line); }
  .file-row.is-folder { grid-template-columns: minmax(0, 1fr); }
  .file-row:hover { background: var(--surface); }
  .file-row:active { background: var(--sage-soft); }
  .file-date { display: none; }
  .file-size { font-size: 12px; }
  .file-copy strong { white-space: normal; overflow-wrap: anywhere; }
  .preview-panel { inset: 0; z-index: 70; }
  .preview-active { top: 0; height: 100vh; height: 100dvh; }
  .preview-header { min-height: 64px; padding-top: calc(9px + env(safe-area-inset-top)); }
  .docx-preview-wrap { padding: 10px; }
  .preview-actions .quiet-button,
  .preview-close { min-height: 44px; }
  .auth-mask { place-items: end center; padding: 0; }
  .auth-card {
    width: 100%;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  .auth-card-top { padding: 10px 18px; }
  .auth-prompt { padding: 23px 22px calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .up-button { width: 44px; justify-content: center; padding: 0; font-size: 18px; }
  .up-button span:last-child { display: none; }
  .topbar .quiet-button { min-width: 44px; padding: 0 8px; }
  .preview-title-wrap { gap: 7px; }
  .preview-actions { gap: 4px; }
  .preview-actions .quiet-button { padding: 0 10px; }
}

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

body.is-embed .app-shell { grid-template-columns: 1fr; }
body.is-embed .sidebar { display: none; }
body.is-embed .workspace { grid-column: 1; }
body.is-embed #menuButton,
body.is-embed #logoutButton { display: none; }
body.is-embed .preview-panel { left: 0; }

@media (max-width: 760px) {
  body.is-embed .topbar { padding-left: 10px; }
}
