/* Shared files: a quiet folder browser, not a workflow dashboard. */
[hidden] { display: none !important; }
.file-portal:not(.auth-page) { padding-bottom: 0; background: #f7f8fa; }
.file-portal .page-shell:not(.auth-shell) { width: min(100%, 76rem); padding: 1.7rem clamp(.85rem, 3vw, 2rem) 2rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.drive-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin: .4rem 0 1.5rem; }
.drive-heading > div { min-width: 0; }
.drive-heading h1 { overflow-wrap: anywhere; margin-top: .4rem; font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 750; }
.drive-heading p { margin: .5rem 0 0; color: var(--muted); font-size: .9rem; }
.drive-heading .button { flex-shrink: 0; }
.drive-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.archive-download { gap: .45rem; }
.archive-download svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.archive-format { font-size: .63rem; font-weight: 700; opacity: .65; }
.drive-breadcrumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .6rem; margin-bottom: 1rem; font-size: .82rem; color: var(--muted); }
.drive-breadcrumbs > * { min-width: 0; overflow-wrap: anywhere; }
.drive-breadcrumbs a, .back-link { color: var(--accent-dark); text-underline-offset: .2rem; }
.drive-breadcrumbs a { text-decoration: none; }
.drive-breadcrumbs a:hover { text-decoration: underline; }
.drive-breadcrumbs [aria-current] { color: var(--ink); }
.drive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.drive-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-shrink: 0; }
.drive-trash-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.75rem; padding: .4rem .5rem; border-radius: .5rem; color: var(--muted); font-size: .82rem; text-decoration: none; white-space: nowrap; }
.drive-trash-link:hover { color: var(--accent-dark); background: var(--accent-soft); }
.drive-trash-link svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-search { display: flex; position: relative; align-items: center; width: min(100%, 24rem); min-width: 0; border: 1px solid var(--border); border-radius: .65rem; background: white; }
.file-search input { min-width: 0; width: 100%; min-height: 2.75rem; padding: .6rem .7rem; border: 0; border-radius: .65rem; background: transparent; font-size: .86rem; }
.file-search button, .search-clear { display: grid; place-items: center; flex-shrink: 0; width: 2.75rem; min-height: 2.75rem; padding: .7rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.file-search svg, .file-download svg, .upload-icon { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.item-count { flex-shrink: 0; color: var(--muted); font-size: .8rem; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: .9rem; }
.folder-card { display: flex; min-width: 0; min-height: 10.3rem; flex-direction: column; align-items: flex-start; padding: 1.15rem; border: 1px solid var(--border); border-radius: .85rem; background: white; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.folder-card:hover { border-color: #b9a2c9; box-shadow: 0 4px 16px #3923480b; }
.folder-icon { width: 3.2rem; height: 2.6rem; flex: 0 0 auto; color: #b79acb; margin-bottom: .8rem; }
.client-folder .folder-icon { color: #9170aa; }
.folder-card strong { display: block; width: 100%; overflow-wrap: anywhere; font-size: .95rem; font-weight: 700; line-height: 1.35; }
.folder-card > span { margin-top: .45rem; color: var(--muted); font-size: .78rem; }
.inner-folders { margin: 1rem 0; }
.inner-folders .folder-card { min-height: 8rem; padding: .9rem 1rem; }
.inner-folders .folder-icon { width: 2.55rem; height: 2.1rem; margin-bottom: .6rem; }
.drive-empty { grid-column: 1 / -1; padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: .8rem; text-align: center; background: #ffffff80; }
.drive-empty h2 { font-size: 1rem; font-weight: 650; }
.drive-empty p { color: var(--muted); font-size: .85rem; }
.drive-empty a { color: var(--accent-dark); }
.drive-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; color: var(--muted); font-size: .75rem; }
.drive-footer a { color: var(--accent-dark); }
.drive-upload { border: 1px dashed #b5a1c3; border-radius: .8rem; background: #f4f0f7; padding: 1.05rem 1.15rem .8rem; margin-bottom: 1.1rem; }
.drive-upload.drag-over { border: 2px solid var(--accent); background: #eae0f1; }
.drive-upload form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1rem; align-items: center; }
.upload-copy { display: flex; gap: .8rem; align-items: center; min-width: 0; }
.upload-icon { width: 1.75rem; height: 1.75rem; flex-shrink: 0; color: var(--accent-dark); }
.upload-copy div { display: flex; flex-direction: column; gap: .22rem; }
.upload-copy strong { font-size: .92rem; font-weight: 700; }
.upload-copy span { font-size: .8rem; color: var(--muted); }
.upload-picker { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.upload-picker input { max-width: 20rem; font-size: .78rem; }
.upload-picker .upload-choice { display: none; }
[data-enhanced] .upload-choice { display: inline-flex; }
[data-enhanced] .upload-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; padding: 0; }
.upload-picker:focus-within .upload-choice { outline: 3px solid #76558f50; outline-offset: 2px; }
.upload-help, .upload-feedback, .upload-progress, .drive-upload .errorlist { grid-column: 1 / -1; }
.upload-help { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.upload-feedback { margin: 0; font-size: .83rem; font-weight: 650; overflow-wrap: anywhere; }
.upload-feedback:empty { display: none; }
.upload-feedback.error { color: var(--danger); }
.upload-progress { width: 100%; height: .5rem; accent-color: var(--accent); }
.upload-busy .upload-choice { pointer-events: none; opacity: .65; }
.button:disabled { opacity: .6; cursor: wait; }
.file-list { border: 1px solid var(--border); border-radius: .8rem; background: white; }
.file-list-head, .file-row { display: grid; grid-template-columns: minmax(0, 1fr) 8.4rem 5.2rem 6.3rem; align-items: center; gap: .75rem; padding: .75rem 1rem; }
.file-list-head { border-radius: .8rem .8rem 0 0; border-bottom: 1px solid var(--border); background: #fbfbfd; color: var(--muted); font-size: .73rem; }
.file-row { min-height: 4.4rem; }
.file-row + .file-row { border-top: 1px solid #edf0f2; }
.file-row:hover { background: #faf8fc; }
.file-name-cell { display: flex; min-width: 0; gap: .75rem; align-items: center; }
.file-name-cell > div { min-width: 0; }
.file-name { display: block; color: var(--ink); text-decoration: none; font-size: .87rem; font-weight: 650; overflow-wrap: anywhere; }
.file-name:hover { text-decoration: underline; text-underline-offset: .18rem; }
.file-name-cell small { display: block; margin-top: .2rem; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.file-type { display: grid; flex-shrink: 0; place-items: center; width: 2.3rem; height: 2.65rem; border: 1px solid #d9dfe5; border-radius: .3rem .7rem .3rem .3rem; background: #f2f5f8; color: #536778; font-size: .57rem; font-weight: 800; }
.type-pdf { background: #fff3f1; border-color: #f1d7d1; color: #b15546; }
.type-png, .type-jpg, .type-jpeg { background: #f0f5ed; border-color: #d8e5cf; color: #557443; }
.type-dwg, .type-dxf { background: #eef4fb; border-color: #d1e1f3; color: #45678e; }
.file-date, .file-size { color: var(--muted); font-size: .75rem; }
.file-actions { display: flex; justify-content: flex-end; align-items: center; gap: .15rem; }
.file-download { display: grid; min-width: 2.75rem; min-height: 2.75rem; place-items: center; border-radius: .5rem; color: var(--accent-dark); }
.file-download:hover { background: var(--accent-soft); }
.file-move { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .35rem; color: var(--accent-dark); font-size: .73rem; }
.mobile-file-size { display: none; }
.item-menu { position: relative; flex-shrink: 0; }
.item-menu > summary { display: flex; justify-content: center; align-items: center; cursor: pointer; list-style: none; min-height: 2.75rem; min-width: 2.75rem; border-radius: .5rem; color: var(--accent-dark); }
.item-menu > summary::-webkit-details-marker { display: none; }
.item-menu[open] > summary { background: var(--accent-soft); }
.item-menu-options { position: absolute; z-index: 10; top: calc(100% + .2rem); right: 0; width: 13rem; max-width: calc(100vw - 2.5rem); padding: .3rem; background: white; border: 1px solid var(--border); border-radius: .65rem; box-shadow: 0 6px 22px #39234820; }
.file-row:last-child .item-menu-options { top: auto; bottom: calc(100% + .2rem); }
.item-menu-options a { display: flex; align-items: center; min-height: 2.75rem; padding: .55rem .7rem; text-decoration: none; font-size: .82rem; color: var(--accent-dark); border-radius: .4rem; }
.item-menu-options a:hover, .item-menu-options a:focus-visible { background: var(--accent-soft); }
.item-menu-options .danger-link { color: var(--danger); }
.file-name-cell small a { color: var(--accent-dark); }
.history-list { border: 1px solid var(--border); border-radius: .8rem; background: white; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; }
.history-row + .history-row { border-top: 1px solid var(--border); }
.history-row > div { min-width: 0; }
.history-row strong { font-size: .95rem; overflow-wrap: anywhere; }
.history-row p { color: var(--muted); font-size: .8rem; margin: .4rem 0 0; overflow-wrap: anywhere; }
.version-current { display: inline-block; margin-left: .5rem; color: var(--accent-dark); background: var(--accent-soft); padding: .2rem .4rem; border-radius: .3rem; font-size: .72rem; }
.simple-file-form { width: min(100%, 36rem); margin: .25rem auto; }
.simple-file-form .panel { padding: 1.4rem; box-shadow: none; }
.simple-file-form .field + .field { margin-top: 1rem; }
.simple-file-form .field-help ul { padding-left: 1.1rem; }
.simple-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.access-list { margin-bottom: 1rem; }
.new-folder-form { margin: -.25rem 0 1rem; border: 1px solid var(--border); border-radius: .7rem; background: white; }
.drive-toolbar [data-toggle-details] { display: none; }
.file-js .drive-toolbar [data-toggle-details] { display: inline-flex; }
.file-js .new-folder-form:not([open]) { display: none; }
.new-folder-form > summary { min-height: 2.75rem; padding: .75rem 1rem; color: var(--accent-dark); font-size: .85rem; cursor: pointer; }
.new-folder-form form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; padding: 0 1rem 1rem; }
.new-folder-form .field { flex: 1 1 14rem; }
.new-folder-form .errorlist { flex-basis: 100%; }
@media (max-width: 760px) {
  .history-row { flex-wrap: wrap; }
  .file-portal .header-actions { gap: .5rem; }
  .file-portal .workspace-badge { display: none; }
  .drive-heading { align-items: flex-start; flex-direction: column; gap: .85rem; margin-bottom: 1.1rem; }
  .drive-heading p { font-size: .82rem; }
  .drive-toolbar { flex-wrap: wrap; }
  .drive-toolbar .file-search { flex: 1 1 12rem; }
  .drive-toolbar-actions { flex: 1 0 auto; justify-content: space-between; }
  .drive-toolbar-actions .drive-trash-link { margin-left: auto; }
  .item-count { font-size: .75rem; }
  .file-list-head, .file-row { grid-template-columns: minmax(0, 1fr) 6.3rem; gap: .4rem; padding: .7rem .65rem; }
  .file-list-head span:not(:first-child), .file-date, .file-size { display: none; }
  .mobile-file-size { display: inline; }
  .file-name-cell { gap: .55rem; }
  .file-name { font-size: .8rem; }
  .drive-upload { padding: .85rem; }
  .drive-upload form { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .upload-picker { flex-wrap: wrap; }
  .upload-help { font-size: .67rem; }
  .folder-grid { gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .folder-card { min-height: 10rem; padding: 1rem .85rem; }
  .folder-card strong { font-size: .86rem; }
  .folder-card > span { font-size: .73rem; }
  .simple-file-form .panel { padding: 1rem; }
  .file-portal .brand { font-size: .87rem; gap: .5rem; }
  .file-portal .brand img { width: 32px; height: 32px; }
  .file-portal .link-button { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .folder-card { transition: none; } }
