:root { --file-sidebar: 264px; }
body { min-height: 100vh; }
.file-login { min-height: 100vh; display: grid; place-items: center; background: var(--color-background); padding: 24px; }
.file-login-card { width: min(440px, 100%); border: 1px solid var(--color-border); border-radius: 18px; background: var(--color-surface); padding: 40px; box-shadow: var(--shadow-md); }
.file-login-card .kicker { margin: 52px 0 8px; }
.file-login-card h1 { margin: 0; font: 600 42px/1.2 var(--font-editorial); }
.file-login-card > p:not(.kicker,.field-error) { color: var(--color-secondary); line-height: 1.7; }
.file-login-card label { display: block; margin: 28px 0 9px; color: var(--color-secondary); font-size: 13px; font-weight: 650; }
.file-login-card input[type="password"] { width: 100%; height: 50px; margin-bottom: 8px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-foreground); padding: 0 14px; outline: 0; transition: border-color .18s,box-shadow .18s; }
.file-login-card input[type="password"]:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgb(37 99 235 / .12); }
.file-admin { min-height: 100vh; background: var(--color-background); }
.file-sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--file-sidebar); display: flex; flex-direction: column; border-right: 1px solid var(--color-border); background: #f0f1ee; padding: 22px 16px 18px; }
.file-sidebar-head { padding: 0 8px 24px; }
.file-sidebar nav { display: grid; gap: 3px; margin-top: 28px; }
.file-nav { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: var(--radius-sm); background: transparent; color: #5b5d59; padding: 0 11px; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; transition: background-color .16s,color .16s,box-shadow .16s; }
.file-nav svg { width: 18px; height: 18px; }
.file-nav:hover,.file-nav:focus-visible { background: rgb(255 255 255 / .7); color: var(--color-primary); }
.file-nav.active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); font-weight: 650; }
.file-sidebar-foot { display: grid; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--color-border-strong); }
.file-sidebar-foot .button { justify-content: flex-start; }
.file-sidebar-account { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.file-workspace { min-height: 100vh; margin-left: var(--file-sidebar); padding: 32px clamp(24px,3vw,48px) 64px; }
.file-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--color-border); padding-bottom: 20px; }
.file-header h1 { margin: 0; font: 600 30px/1.2 var(--font-editorial); letter-spacing: -.025em; }
.file-header p { margin: 3px 0 0; color: var(--color-secondary); font-size: 12px; }
.file-header-actions { display: flex; align-items: center; gap: 10px; }
.file-header-actions > span { color: var(--color-tertiary); font-size: 12px; white-space: nowrap; }
.storage-usage { min-height: 36px; display: flex; align-items: center; gap: 8px; color: var(--color-secondary); padding: 0 4px; white-space: nowrap; font-size: 12px; }
.storage-usage svg { width: 17px; height: 17px; color: var(--color-tertiary); }
.storage-usage strong { color: var(--color-primary); font-size: 12px; }
.file-tools { min-height: 48px; display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; }
.file-tools .search { width: min(360px,100%); height: 40px; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-surface); padding-inline: 11px; }
.file-tools .search:focus-within { border-color: #9a9992; box-shadow: 0 0 0 3px rgb(24 24 22 / .06); }
.file-tool-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.file-tool-actions .button,.file-tool-actions .icon-button { min-height: 38px; border-radius: 7px; }
.file-tool-actions .button svg { width: 17px; height: 17px; }
.file-filter { border: 1px solid var(--color-border); background: transparent; color: var(--color-secondary); font-weight: 500; }
.file-filter:hover,.file-filter.active { border-color: var(--color-border-strong); background: var(--color-surface); color: var(--color-primary); }
.file-tool-divider { width: 1px; height: 24px; margin: 0 2px; background: var(--color-border); }
.file-tool-actions .icon-button.active { border-color: var(--color-border-strong); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.file-table { overflow: visible; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); box-shadow: 0 1px 2px rgb(24 24 27 / .025); }
.file-list-head,.file-row { display: grid; grid-template-columns: minmax(320px,1.8fr) minmax(90px,.42fr) minmax(130px,.62fr) 110px 208px; align-items: center; }
.file-list-head { min-height: 40px; border-bottom: 1px solid var(--color-border); background: #f2f2ef; color: var(--color-tertiary); padding: 0 16px; font-size: 10px; font-weight: 700; letter-spacing: .035em; }
.file-sort { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: inherit; padding: 8px 0; font-size: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.file-sort:hover,.file-sort.active { color: var(--color-primary); }
.file-sort svg { width: 12px; height: 12px; opacity: 0; }
.file-sort:hover svg,.file-sort.active svg { opacity: 1; }
.file-sort.desc svg { transform: rotate(180deg); }
.file-list { display: block; }
.file-row { position: relative; min-height: 62px; border-bottom: 1px solid #e8e8e4; background: var(--color-surface); padding: 0 16px; transition: background-color .16s; }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #f8f8f6; }
.file-main { min-width: 0; display: flex; align-items: center; gap: 11px; padding-right: 20px; }
.file-type { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; color: var(--color-tertiary); }
.file-type svg { width: 24px; height: 24px; stroke-width: 1.55; }
.file-info { min-width: 0; }
.file-info h2,.key-row h2 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.file-info p { display: none; margin: 3px 0 0; color: var(--color-tertiary); font-size: 10px; }
.file-cell { color: var(--color-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.file-state { display: flex; align-items: center; gap: 7px; color: var(--color-tertiary); font-size: 11px; }
.file-state span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.file-state.shared { color: var(--color-success); }
.file-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.file-actions .button { min-height: 32px; border-radius: 6px; padding: 0 9px; white-space: nowrap; font-size: 11px; font-weight: 500; }
.file-actions .button-secondary { border-color: var(--color-border); background: var(--color-surface); }
.file-actions .button:hover { background: #ecece8; }
.file-more { position: relative; display: none; justify-self: end; }
.file-more > .icon-button { width: 38px; height: 38px; border: 0; background: transparent; color: var(--color-tertiary); }
.file-menu { position: absolute; z-index: 80; top: 42px; right: 0; width: 150px; display: none; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); padding: 5px; box-shadow: 0 16px 40px rgb(24 24 27 / .15); }
.file-more.open .file-menu { display: grid; }
.file-menu .button { min-height: 38px; justify-content: flex-start; border: 0; border-radius: 6px; background: transparent; padding: 0 9px; color: var(--color-secondary); font-size: 12px; }
.file-menu .button:hover { background: var(--color-surface-soft); color: var(--color-primary); }
.file-menu .button-danger-quiet { color: var(--color-danger); }
.file-menu svg { width: 17px; height: 17px; }
.file-table.grid-view { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; border: 0; background: transparent; box-shadow: none; }
.file-table.grid-view .file-list-head { display: none; }
.file-table.grid-view .file-list { display: contents; }
.file-table.grid-view .file-row { min-height: 150px; display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--color-border); border-radius: 8px; padding: 18px; box-shadow: var(--shadow-sm); }
.file-table.grid-view .file-main { align-items: flex-start; padding: 0 34px 18px 0; }
.file-table.grid-view .file-cell { margin: 5px 0 0 43px; }
.file-table.grid-view .file-cell.file-date { display: none; }
.file-table.grid-view .file-state { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--color-border); }
.file-table.grid-view .file-actions { display: none; }
.file-table.grid-view .file-more { position: absolute; top: 12px; right: 12px; display: block; }
.file-empty { margin-top: 40px; border: 1px dashed var(--color-border-strong); border-radius: 15px; padding: 54px 24px; color: var(--color-secondary); text-align: center; }
.file-empty h2 { color: var(--color-primary); font: 600 25px var(--font-editorial); }
.key-toolbar { display: flex; justify-content: flex-end; margin: 20px 0 12px; }
.key-notice { margin: 0 0 18px; border: 1px solid #dbe5ff; border-radius: 12px; background: #f5f8ff; padding: 18px 20px; }
.key-notice p { margin: 5px 0 0; color: var(--color-secondary); font-size: 12px; }
.key-list { display: grid; gap: 10px; }
.key-row { display: grid; grid-template-columns: minmax(230px,.9fr) minmax(0,1.35fr) 72px; align-items: center; gap: 18px; border: 1px solid var(--color-border); border-radius: 13px; background: var(--color-surface); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.key-row small { margin: 0; color: var(--color-tertiary); font-size: 11px; }
.key-row code { color: var(--color-secondary); font-size: 12px; }
.key-row > div:nth-child(2) { min-width: 0; display: grid; gap: 5px; }
.key-row > div:nth-child(2) span { color: var(--color-success); font-size: 11px; font-weight: 700; }
.key-row > .button { justify-self: end; }
.key-row.revoked { opacity: .58; }
.key-row.revoked > div:nth-child(2) span { color: var(--color-tertiary); }
.modal input[type="file"] { width: 100%; min-height: 48px; margin-bottom: 12px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-secondary); padding: 5px; cursor: pointer; }
.modal input[type="file"]::file-selector-button { min-height: 36px; margin-right: 12px; border: 0; border-radius: 6px; background: var(--color-primary); color: var(--color-on-primary); padding: 0 14px; font: 650 13px var(--font-sans); cursor: pointer; transition: background-color .18s; }
.modal input[type="file"]::file-selector-button:hover { background: #303035; }
.check-row { min-height: 44px; display: flex !important; align-items: center; gap: 10px; margin-bottom: 8px !important; cursor: pointer; }
.check-row input[type="checkbox"] { appearance: none; width: 20px !important; height: 20px; flex: 0 0 auto; margin: 0 !important; border: 1px solid var(--color-border-strong); border-radius: 5px; background: var(--color-surface); padding: 0; cursor: pointer; transition: border-color .18s,background-color .18s,box-shadow .18s; }
.check-row input[type="checkbox"]:checked { border-color: var(--color-accent); background-color: var(--color-accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m5 10 3 3 7-7'/%3E%3C/svg%3E"); }
.check-row input[type="checkbox"]:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgb(37 99 235 / .16); }
.form-hint { margin: -9px 0 8px; color: var(--color-tertiary); font-size: 11px; line-height: 1.5; }
.upload-progress-wrap { margin: 12px 0 4px; }
.upload-progress { height: 7px; overflow: hidden; border-radius: 99px; background: var(--color-muted); }
.upload-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--color-accent); transition: width .18s ease; }
.upload-progress-text { margin: 7px 0 0; color: var(--color-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.new-key-result { margin: 10px 0; border-radius: 10px; background: #fff8e8; padding: 14px; }
.new-key-result p { margin: 0 0 10px; color: #7a5200; font-size: 12px; }
.file-gate-page { min-height: 100vh; display: grid; place-items: center; background: #f7f7f5; padding: 24px; font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color: #18181b; }
.file-gate { width: min(520px,100%); border: 1px solid #e4e4e7; border-radius: 18px; background: white; padding: clamp(28px,6vw,48px); box-shadow: 0 18px 60px rgb(24 24 27 / .08); }
.file-gate h1 { overflow-wrap: anywhere; margin: 8px 0 12px; font: 600 clamp(30px,7vw,44px)/1.15 Georgia,"Songti SC",serif; letter-spacing: -.03em; }
.file-gate > p:not(.kicker,.file-gate-error) { color: #5b5b63; line-height: 1.7; }
.file-gate form { display: grid; gap: 10px; margin-top: 28px; }
.file-gate label { color: var(--color-secondary); font-size: 13px; font-weight: 650; }
.file-gate input { min-height: 46px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-foreground); padding: 0 13px; outline: 0; font-size: 16px; transition: border-color .18s,box-shadow .18s; }
.file-gate input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgb(37 99 235 / .12); }
.file-gate-error { color: #b42318; }
.file-gate-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; }
.share-link { display: flex; align-items: stretch; gap: 7px; }
.share-link input { min-width: 0; flex: 1; }
.share-link .button { flex: 0 0 auto; min-width: 72px; padding-inline: 14px; white-space: nowrap; writing-mode: horizontal-tb; }
@media (max-width:1280px) {
  .file-list-head,.file-row { grid-template-columns: minmax(280px,1.7fr) minmax(90px,.45fr) minmax(130px,.65fr) 110px 48px; }
  .file-actions { display: none; }
  .file-more { display: block; }
}
@media (max-width:900px) {
  :root { --file-sidebar: 100%; }
  .file-sidebar { position: static; width: auto; flex-direction: row; align-items: center; gap: 14px; padding: 14px 18px; }
  .file-sidebar-head { padding: 0; }
  .file-sidebar nav { display: flex; margin: 0 0 0 auto; }
  .file-sidebar-foot { display: none; }
  .file-sidebar .wordmark small { display: none; }
  .file-workspace { margin-left: 0; padding: 28px 20px 60px; }
  .file-list-head,.file-row { grid-template-columns: minmax(220px,1.4fr) 100px 100px 44px; }
  .file-list-head > :nth-child(3),.file-row .file-date { display: none; }
  .key-row { grid-template-columns: 1fr auto; }
  .key-row > div:nth-child(2) { grid-column: 1; }
}
@media (max-width:560px) {
  .file-sidebar .wordmark { display: none; }
  .file-sidebar nav { width: 100%; margin: 0; }
  .file-nav { flex: 1; justify-content: center; }
  .file-workspace { padding: 24px 14px 48px; }
  .file-header { min-height: 54px; margin-bottom: 14px; padding-bottom: 14px; }
  .file-header h1 { font-size: 24px; }
  .file-header-actions { align-items: flex-end; flex-direction: column; gap: 2px; }
  .storage-usage { min-height: 36px; border: 0; background: transparent; padding: 0; box-shadow: none; }
  .file-header p { display: none; }
  .file-tools { align-items: stretch; flex-wrap: wrap; }
  .file-tools .search { width: 100%; max-width: none; }
  .file-tool-actions { width: 100%; margin-left: 0; }
  .file-tool-actions #uploadAction { margin-left: auto; }
  .file-filter { width: 38px; padding: 0; }
  .file-filter span,.file-tool-divider { display: none; }
  .file-list-head { display: none; }
  .file-row { min-height: 64px; grid-template-columns: minmax(0,1fr) 42px; padding: 0 10px; }
  .file-row > .file-cell,.file-row > .file-state { display: none; }
  .file-info p { display: block; }
  .file-more { grid-column: 2; }
  .file-table.grid-view { grid-template-columns: 1fr; }
  .file-table.grid-view .file-row { min-height: 142px; }
  .file-table.grid-view .file-state { display: flex; }
}
@media (prefers-reduced-motion:reduce) { .upload-progress span { transition: none; } }
