body [hidden]:not([hidden="until-found"]) { display:none!important; }
body .preview-overlay { animation:none; }
.preview-content { min-height:0; box-sizing:border-box; }
.preview-content.is-text-document { padding:20px 80px 48px; align-items:stretch; }
.preview-content.is-text-document > :is(.text-preview, .code-preview, .markdown-preview, .text-editor) { width:100%; max-width:1400px; min-height:0; margin:0 auto; box-sizing:border-box; }
.preview-content.is-text-document > :is(.text-preview, .code-preview) { font-size:15px; line-height:1.65; overflow-wrap:anywhere; }
.text-editor { display:flex; flex-direction:column; flex:1; min-width:0; min-height:0; overflow:hidden; border:1px solid var(--c-border); border-radius:12px; background:var(--c-surface); color:var(--c-text); }
.text-editor-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:12px 16px; border-bottom:1px solid var(--c-border); }
.text-editor-status { flex:1 1 180px; font-size:13px; line-height:1.5; color:var(--c-text2); overflow-wrap:anywhere; }
.text-editor-status.is-error { color:var(--c-danger); }
.text-editor-toolbar button { min-height:36px; border:1px solid var(--c-border2); border-radius:8px; padding:6px 12px; background:var(--c-surface2); color:var(--c-text); font-family:inherit; font-size:13px; font-weight:500; line-height:1.4; cursor:pointer; }
.text-editor-toolbar button:disabled { opacity:.5; cursor:default; }
.text-editor-body { position:relative; display:flex; flex:1; min-width:0; min-height:0; }
.text-editor-gutter { position:relative; flex:none; width:calc(var(--text-editor-digits, 2) * 1ch + 28px); padding-right:12px; box-sizing:border-box; overflow:hidden; border-right:1px solid var(--c-border); color:var(--c-text3); font:15px ui-monospace,SFMono-Regular,Consolas,monospace; line-height:1.65; font-variant-numeric:tabular-nums; user-select:none; -webkit-user-select:none; pointer-events:none; }
html.light-theme .text-editor-gutter { background:var(--c-surface2); color:var(--c-text2); }
.text-editor-line-numbers { position:absolute; inset:0; width:100%; height:100%; }
.text-editor-measure { position:absolute; top:0; left:0; width:0; height:0; border:0; visibility:hidden; pointer-events:none; }
.text-editor-input { flex:1; min-width:0; min-height:0; width:100%; box-sizing:border-box; border:0; border-radius:0; margin:0; padding:24px 24px 24px 16px; background:transparent; color:inherit; font:15px ui-monospace,SFMono-Regular,Consolas,monospace; line-height:1.65; resize:none; outline:none; tab-size:4; cursor:text; }
.text-editor-input.is-scrollbar-hover { cursor:default; }
.text-editor-input:focus-visible { box-shadow:inset 0 0 0 1px var(--c-border2); }
.text-editor-modal-card { width:min(1400px,94vw); max-width:1400px; height:88dvh; display:flex; flex-direction:column; }
#editorBody { display:flex; flex:1; min-height:0; }
body #detailsPanel:not(.hidden) { display:block!important; position:fixed; inset:72px 16px 16px auto; width:min(440px,calc(100vw - 32px)); max-height:calc(100dvh - 88px); border:1px solid var(--c-border); border-radius:12px; z-index:10000; box-shadow:0 16px 48px #0006; }
@media(max-width:640px) {
  .preview-header { flex-wrap:wrap; padding:12px; gap:12px; }
  .preview-header-info { flex-basis:100%; }
  .preview-header-actions { margin-left:auto; }
  .preview-content.is-text-document { padding:8px 12px 70px; }
  .text-editor-input { padding:16px 16px 16px 10px; font-size:14px; }
  .text-editor-gutter { width:calc(var(--text-editor-digits, 2) * 1ch + 18px); padding-right:8px; }
  .preview-overlay:has(.is-text-document) .preview-nav { top:auto; bottom:12px; transform:none; width:40px; height:40px; }
  .text-editor-modal-card { padding:16px; }
}
.file-grid:not(.grid-view) .file-quick-actions .qa-btn:not(.qa-share) { display:none; }
.file-grid:not(.grid-view) .file-quick-actions { opacity:1; pointer-events:auto; }
.file-grid:not(.grid-view) .file-name { min-width:0; }
:is(#forgotPasswordView, #resetPasswordView) { gap:24px; padding:32px 12px; justify-content:safe center; }
:is(#forgotPasswordView, #resetPasswordView) > .auth-brand,
:is(#forgotPasswordView, #resetPasswordView) > .auth-card { position:relative; inset:auto; }
:is(#forgotPasswordView, #resetPasswordView) > .auth-card { display:grid; gap:18px; height:auto; min-height:0; padding:28px; overflow:visible; }
.auth-card-recovery > :is(.auth-title, .auth-divider, .auth-field, .auth-primary, .auth-error, .auth-footer, [role="status"]) { position:static; inset:auto; width:auto; margin:0; }
.auth-card-recovery > .auth-divider { width:100%; }
.auth-card-recovery > .auth-primary { width:100%; min-height:48px; height:auto; padding:14px 18px; line-height:1.4; }
.auth-card-recovery > .auth-primary:hover { transform:none; }
.auth-card-recovery > :is(.auth-error, [role="status"]):empty { display:none; }
.auth-card-recovery > :is(.auth-error, [role="status"]) { font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.auth-card-recovery > .auth-footer a { margin:0; }
body .cloud-section, body .cloud-recent, body .cloud-starred { width:100%; max-width:1440px; margin-inline:auto; padding:28px; box-sizing:border-box; }
body .cloud-section > h2, body .cloud-recent > h2, body .cloud-starred > h2 { margin:0 0 24px; font-size:22px; line-height:1.3; letter-spacing:-.02em; }
body .cloud-section > div:first-child:has(> h2) { gap:20px; padding-bottom:20px; margin-bottom:24px!important; border-bottom:1px solid var(--c-border); flex-wrap:wrap; }
body .cloud-section > div:first-child > h2 { font-size:22px!important; line-height:1.3; }
body .cloud-section > div:first-child > button, body .view-state-retry { min-height:42px; padding:10px 16px!important; border-radius:9px!important; font-size:14px; font-weight:600; cursor:pointer; }
body .view-state { grid-column:1/-1; width:100%; box-sizing:border-box; min-height:280px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:40px 24px; border:1px solid var(--c-border); border-radius:14px; background:var(--c-surface); text-align:center; }
body .view-state-icon { width:40px; height:40px; margin:0 0 4px; opacity:.8; }
body .view-state-title { font-size:17px!important; font-weight:600; margin:0; color:var(--c-text); }
body .view-state-sub { max-width:480px; font-size:14px!important; line-height:1.6; margin:0; color:var(--c-text2); }
body .view-state .view-state-retry { display:inline-flex; align-items:center; justify-content:center; gap:8px; margin-top:8px; border:1px solid transparent; background:#2563eb; color:#fff; font:500 14px/20px Inter,system-ui; text-align:center; user-select:none; }
body .view-state .view-state-retry:hover { background:#1d4ed8; }
body .view-state .view-state-retry:focus-visible { outline:2px solid var(--c-accent,#3b82f6); outline-offset:3px; }
body #notesGrid:has(> .view-state) { grid-template-columns:minmax(0,1fr)!important; }
body .cloud-note-card { display:flex; flex-direction:column; gap:12px; min-height:160px; padding:20px; border:1px solid var(--c-border2); border-radius:12px; background:var(--c-surface); color:var(--c-text); font:inherit; font-size:14px; line-height:1.5; text-align:left; cursor:pointer; }
body .cloud-note-card:hover { background:var(--c-surface2); }
body .cloud-note-card:focus-visible { outline:2px solid var(--c-accent); outline-offset:3px; }
body .cloud-note-card strong { font-size:16px; overflow-wrap:anywhere; }
body .cloud-note-card span { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; color:var(--c-text2); }
body .cloud-note-card time { margin-top:auto; color:var(--c-text2); font-size:14px; }
body :is(#uploadLinkForm,#groupCreateForm) { padding:24px!important; background:var(--c-surface)!important; }
body #groupCreateForm > div { flex-wrap:wrap; }
body .cloud-create-row { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
body .cloud-create-row > input { flex:1 1 220px!important; min-width:0; }
body .cloud-form-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-inline-start:auto; }
body :is(.cloud-form-actions,#trashToolbar) button, body .cloud-section > div:first-child > button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:10px 14px!important; font:500 14px/20px Inter,system-ui!important; border-radius:8px!important; text-align:center; user-select:none; }
body .cloud-form-actions button { flex:0 1 auto; }
body .cloud-section > div:first-child > button > svg { width:16px; height:16px; flex:0 0 16px; }
body .cloud-section > div:first-child:has(> h2) > button { flex-shrink:0; }
body .modal-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
body .modal-actions > button { min-height:40px; padding:9px 14px; line-height:20px; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-align:center; user-select:none; }
body .cloud-section :is(input,select) { min-height:42px; border-radius:8px!important; font-size:14px!important; }
body .cloud-section label { font-size:14px!important; text-transform:none!important; letter-spacing:normal!important; color:var(--c-text2)!important; }
body :is(#webdavModal,#fileSettingsModal,#groupDetailModal,#changePwModal,#renameModal,#moveModal,#totpModal) > .modal-card { width:min(560px,calc(100vw - 32px))!important; max-width:calc(100vw - 32px)!important; min-width:0!important; max-height:calc(100dvh - 40px); overflow:auto; padding:24px!important; background:var(--c-surface)!important; border:1px solid var(--c-border2); border-radius:16px; color:var(--c-text); }
body :is(#webdavModal,#fileSettingsModal,#groupDetailModal,#changePwModal,#renameModal,#moveModal,#totpModal) :is(h3,h4) { font-size:18px!important; line-height:1.4; }
body :is(#webdavModal,#fileSettingsModal,#groupDetailModal,#changePwModal,#renameModal,#moveModal,#totpModal) :is(p,label,span,button,input,select,code) { font-size:14px!important; line-height:1.5; }
body #fileSettingsModal label { display:flex!important; align-items:flex-start!important; gap:12px!important; margin:0!important; padding:13px 0; border-bottom:1px solid var(--c-border); color:var(--c-text); }
body #fileSettingsModal input[type=checkbox] { width:18px; height:18px; flex:0 0 18px; margin:2px 0 0!important; accent-color:var(--c-accent,#3b82f6); }
body :is(#webdavModal,#fileSettingsModal,#groupDetailModal,#changePwModal,#renameModal,#moveModal,#totpModal) .modal-actions { margin-top:24px; padding-top:18px; border-top:1px solid var(--c-border); display:flex; gap:10px; justify-content:flex-end; }
body :is(#webdavModal,#fileSettingsModal,#groupDetailModal,#changePwModal,#renameModal,#moveModal,#totpModal) button { min-height:38px; border-radius:8px; }
@media(max-width:700px) {
  body .cloud-create-row .cloud-form-actions { width:100%; }
  body .cloud-form-actions > button { flex:1 1 auto; }
  body #trashToolbar > div:empty { display:none; }
  body #trashToolbar > button { flex:1 1 auto; }
  body .cloud-section, body .cloud-recent, body .cloud-starred { padding:20px 14px; }
  body #uploadLinkForm > div { grid-template-columns:minmax(0,1fr)!important; }
  body .view-state { min-height:240px; padding:28px 16px; }
}
@media(prefers-reduced-motion:no-preference) {
  body .cloud-section:not(.hidden), body .cloud-recent:not(.hidden), body .cloud-starred:not(.hidden) { animation:cloud-view-enter .16s ease-out; }
  @keyframes cloud-view-enter { from { opacity:.45; transform:translateY(4px); } to { opacity:1; transform:none; } }
}
