:root {
  --ug-brand-blue: #0033ff;
  --ug-brand-blue-60: #335cff;
  --ug-brand-blue-10: #e5ebff;
  --ug-brand-graphite: #25384a;
  --ug-brand-light-blue: #4c7fab;
  --ug-brand-gray: #e9ebed;
  --ug-green: var(--ug-brand-blue);
  --ug-green-hover: var(--ug-brand-blue-60);
  --ug-green-dark: var(--ug-brand-blue);
  --ug-green-soft: var(--ug-brand-blue-10);
  --ug-black: #000000;
  --ug-ink: #000000;
  --ug-text: #000000;
  --ug-muted: #51606e;
  --ug-line: #d3d7db;
  --ug-line-strong: #a8afb7;
  --ug-bg: var(--ug-brand-gray);
  --ug-card: #ffffff;
  --ug-danger: #c43c48;
  --ug-warning: #ad7310;
  --ug-info: #336aa6;
  --ug-shadow: 0 10px 28px rgba(23, 27, 25, .08);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ug-bg); color: var(--ug-ink); font-family: Arial, Helvetica, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; min-height: 100svh; background: var(--ug-bg); }
a { color: var(--ug-green-dark); text-decoration: none; }
a:hover { color: var(--ug-green-hover); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
input, select, textarea { font-size: 16px; }
button { cursor: pointer; }

.public-shell { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.public-header, .public-footer { width: min(1160px, 100%); margin: 0 auto; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding-bottom: 14px; border-bottom: 1px solid var(--ug-line); }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 190px; height: auto; }
.staff-link { color: var(--ug-muted); font-size: 14px; font-weight: 700; }
.public-main { display: grid; place-items: center; width: 100%; padding: 34px 0; }
.public-footer { display: flex; justify-content: space-between; gap: 18px; color: #737f7a; font-size: 12px; padding-top: 14px; border-top: 1px solid var(--ug-line); }

.portal-card { width: min(760px, 100%); border: 1px solid var(--ug-line); border-radius: var(--radius-xl); background: var(--ug-card); box-shadow: var(--ug-shadow); overflow: hidden; }
.portal-card__head { padding: 32px 36px 20px; border-top: 4px solid var(--ug-green); }
.portal-card__body { padding: 0 36px 34px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--ug-green-dark); background: var(--ug-green-soft); border: 1px solid #cce9d9; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
h1 { margin: 15px 0 8px; font-size: clamp(28px, 5vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
h3 { margin: 0 0 8px; font-size: 17px; }
.lead { color: var(--ug-muted); line-height: 1.6; margin: 0; max-width: 620px; }

.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; gap: 8px; }
.form-row label, .field-label { font-size: 13px; font-weight: 750; color: #313a36; }
.control { width: 100%; min-height: 50px; border: 1px solid var(--ug-line-strong); border-radius: var(--radius-md); background: #fff; color: var(--ug-ink); padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.control:hover { border-color: #9eaca6; }
.control:focus { border-color: var(--ug-green); box-shadow: 0 0 0 3px rgba(22, 160, 93, .14); }
textarea.control { min-height: 88px; resize: vertical; }
.help { font-size: 12px; line-height: 1.45; color: var(--ug-muted); }

.dropzone { position: relative; min-height: 148px; border: 2px dashed #aab8b2; border-radius: var(--radius-lg); background: #f8faf9; display: grid; place-items: center; text-align: center; padding: 24px; transition: border-color .15s, background .15s; }
.dropzone.is-dragover { border-color: var(--ug-green); background: var(--ug-green-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 46px; height: 46px; margin: 0 auto 10px; border: 1px solid #cce9d9; border-radius: 12px; display: grid; place-items: center; color: var(--ug-green-dark); background: var(--ug-green-soft); font-size: 25px; }
.dropzone strong { display: block; font-size: 16px; }
.dropzone span { display: block; color: var(--ug-muted); font-size: 13px; margin-top: 4px; }
.file-list { display: grid; gap: 8px; margin-top: 10px; }
.file-chip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid #e2e7e5; border-radius: 9px; background: #f7f9f8; font-size: 13px; }
.file-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip__meta { display: inline-flex; align-items: center; gap: 10px; justify-self: end; white-space: nowrap; }
.file-chip__size { color: var(--ug-muted); white-space: nowrap; }
.file-chip__remove { border: 0; padding: 4px 0; background: transparent; color: #b42318; cursor: pointer; font: inherit; font-weight: 700; }
.file-chip__remove:hover, .file-chip__remove:focus-visible { text-decoration: underline; }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.country-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.country-switch__item { min-height: 44px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--ug-line); border-radius: 10px; background: #f7f9f8; color: var(--ug-text); padding: 9px 11px; text-align: left; font-size: 13px; font-weight: 750; }
.country-switch__item:hover { border-color: #9eaca6; background: #f0f3f1; }
.country-switch__item.is-active { border-color: var(--ug-green); background: var(--ug-green-soft); box-shadow: 0 0 0 1px var(--ug-green); }
.country-switch__flag { font-size: 20px; line-height: 1; }
.country-switch__code { color: var(--ug-muted); font-size: 12px; }
.phone-control { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.password-generator { display: none; gap: 12px; padding: 14px; border: 1px solid var(--ug-line); border-radius: 12px; background: #f8faf9; }
.password-generator.is-visible { display: grid; }
.password-generator__button { width: 100%; }
.password-generator__result { display: grid; gap: 8px; }
.password-generator__result label { font-size: 13px; font-weight: 750; color: #313a36; }
.password-generator__field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.password-generator__field .control { min-width: 0; }
.password-generator__copy { min-height: 50px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: min(520px, calc(100% - 28px)); transform: translate(-50%, 24px); border: 1px solid #a9d8be; border-left: 5px solid var(--ug-green); border-radius: 11px; background: #fff; color: var(--ug-text); box-shadow: 0 14px 36px rgba(23, 27, 25, .16); padding: 13px 15px; font-size: 13px; font-weight: 750; opacity: 0; visibility: hidden; transition: opacity .16s, transform .16s, visibility .16s; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.clipboard-helper { position: fixed; left: -10000px; top: -10000px; width: 1px; height: 1px; opacity: 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: #34403b; font-size: 13px; line-height: 1.45; }
.check-row input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ug-green); flex: 0 0 auto; }
.permanent-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 7px; border-radius: 999px; background: #fff4dc; color: #805200; padding: 3px 7px; font-size: 10px; font-weight: 800; }

.btn { border: 1px solid transparent; border-radius: 10px; min-height: 50px; padding: 13px 18px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { color: #fff; background: var(--ug-green); border-color: var(--ug-green); }
.btn-primary:hover { color: #fff; background: var(--ug-green-hover); border-color: var(--ug-green-hover); }
.btn-secondary { color: var(--ug-ink); background: #f0f3f1; border-color: var(--ug-line); }
.btn-secondary:hover { color: var(--ug-ink); background: #e4e9e6; }
.btn-danger { color: #fff; background: var(--ug-danger); border-color: var(--ug-danger); }
.btn-danger:hover { color: #fff; background: #a9303b; }
.btn-block { width: 100%; }
.form-error { display: none; border: 1px solid #edbec3; color: #8f2530; background: #fff3f4; border-radius: 10px; padding: 11px 13px; font-size: 13px; }
.form-error.is-visible { display: block; }

.modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 18px; background: rgba(14, 18, 16, .68); }
.modal.is-open { display: grid; }
.modal-card { width: min(470px, 100%); max-height: calc(100svh - 36px); overflow: auto; background: #fff; border: 1px solid var(--ug-line); border-radius: 16px; box-shadow: 0 20px 55px rgba(0, 0, 0, .24); padding: 30px; text-align: center; }
.call-number { display: flex; align-items: center; justify-content: center; min-height: 76px; margin: 20px 0 12px; border-radius: 12px; color: #fff; background: var(--ug-black); font-size: clamp(22px, 6vw, 31px); font-weight: 850; letter-spacing: .02em; }
.call-number:hover { color: #fff; text-decoration: none; background: #252c29; }
.status-line { min-height: 22px; color: var(--ug-muted); font-size: 13px; }
.spinner { width: 32px; height: 32px; border: 3px solid #dfe6e2; border-top-color: var(--ug-green); border-radius: 50%; margin: 18px auto 10px; animation: spin .8s linear infinite; }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #e4e9e6; margin: 18px 0 9px; }
.progress > span { display: block; width: 0; height: 100%; background: var(--ug-green); transition: width .2s; }
@keyframes spin { to { transform: rotate(360deg); } }

.state-card { width: min(620px, 100%); text-align: center; padding: 40px; }
.state-icon { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 18px; border: 1px solid #cce9d9; border-radius: 16px; font-size: 34px; background: var(--ug-green-soft); color: var(--ug-green-dark); }
.state-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 24px; }
.meta-pill { border: 1px solid var(--ug-line); border-radius: 999px; padding: 7px 10px; color: var(--ug-muted); background: #f8faf9; font-size: 12px; }
.download-list { display: grid; gap: 10px; margin: 24px 0; text-align: left; }
.download-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--ug-line); border-radius: 10px; background: #fff; }
.download-item__name { font-weight: 750; word-break: break-word; }
.download-item__meta { color: var(--ug-muted); font-size: 12px; margin-top: 4px; }

.staff-body { background: var(--ug-bg); }
.staff-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.staff-sidebar { background: var(--ug-black); color: #fff; padding: 25px 18px; position: sticky; top: 0; height: 100vh; border-right: 4px solid var(--ug-green); }
.staff-sidebar .brand img { width: 180px; }
.staff-nav { display: grid; gap: 5px; margin-top: 28px; }
.staff-nav a { color: #d5ddd9; padding: 11px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.staff-nav a:hover, .staff-nav a.active { color: #fff; background: #29302d; text-decoration: none; }
.staff-main { min-width: 0; padding: 28px; }
.staff-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.staff-title { margin: 0; font-size: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--ug-line); border-top: 3px solid var(--ug-green); border-radius: 10px; padding: 17px; }
.stat__label { color: var(--ug-muted); font-size: 12px; font-weight: 750; }
.stat__value { margin-top: 8px; font-size: 25px; font-weight: 850; }
.panel { margin-top: 18px; border: 1px solid var(--ug-line); border-radius: 10px; background: #fff; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--ug-line); background: #f8faf9; }
.panel__body { padding: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: #59655f; background: #f8faf9; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--ug-line); }
td { padding: 12px; border-bottom: 1px solid #e9eeeb; vertical-align: top; }
tbody tr:hover { background: #fafcfb; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 800; background: #edf1ef; color: #53605a; }
.badge.published, .badge.none, .badge.clean, .badge.segmented_clean { background: #e4f5ec; color: #0d7042; }
.badge.medium, .badge.inconclusive { background: #fff2d9; color: #805200; }
.badge.high, .badge.infected, .badge.error, .badge.deleted { background: #fde9eb; color: #9f2d38; }
.badge.scanning, .badge.pending, .badge.uploaded { background: #e8f0fa; color: #315e91; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-bar .control { min-height: 42px; width: auto; min-width: 200px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-item { padding: 13px; border: 1px solid #e3e8e5; border-radius: 9px; background: #f8faf9; }
.detail-item span { display: block; color: var(--ug-muted); font-size: 11px; margin-bottom: 5px; }
.detail-item strong { word-break: break-word; }
.message { margin-bottom: 12px; padding: 11px 13px; border: 1px solid #cce9d9; border-left: 4px solid var(--ug-green); border-radius: 8px; background: var(--ug-green-soft); }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .staff-layout { grid-template-columns: 1fr; }
  .staff-sidebar { height: auto; position: static; padding: 16px; border-right: 0; border-bottom: 4px solid var(--ug-green); }
  .staff-nav { grid-template-columns: repeat(3, 1fr); margin-top: 15px; }
  .staff-main { padding: 18px; }
}
@media (max-width: 640px) {
  .public-shell { padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .public-header { min-height: 52px; }
  .brand img { width: 164px; }
  .staff-link { font-size: 12px; }
  .public-main { padding: 18px 0; align-items: start; }
  .portal-card { border-radius: 14px; }
  .portal-card__head { padding: 26px 21px 16px; }
  .portal-card__body { padding: 0 21px 24px; }
  .options-grid, .detail-grid { grid-template-columns: 1fr; }
  .country-switch, .password-generator__field { grid-template-columns: 1fr; }
  .public-footer { display: block; text-align: center; line-height: 1.6; }
  .public-footer span { display: block; }
  .modal-card { padding: 25px 19px; border-radius: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .staff-main { padding: 14px; }
  .staff-top { align-items: flex-start; flex-direction: column; }
  .staff-nav { grid-template-columns: 1fr; }
}
.state-card-wide { max-width: 700px; }
.state-card-narrow { max-width: 500px; }
.state-card-left { text-align: left; }
.text-center { text-align: center; }
.title-large { font-size: 34px; }
.lead-centered { margin-inline: auto; }
.form-spaced { margin-top: 25px; }
.help-danger { color: var(--ug-danger); }
.detail-wide { grid-column: 1 / -1; }
.verify-title { margin-top: 14px; }
.action-spaced { margin-top: 24px; }
.legal-card { width: min(820px, 100%); padding: 34px; }
.legal-card h1 { margin-bottom: 18px; }
.legal-card h2 { margin-top: 24px; }
.legal-card p, .legal-card li { color: var(--ug-muted); line-height: 1.65; }
.staff-logout-form { margin: 0; }
.staff-nav-button { width: 100%; border: 0; color: #d5ddd9; background: transparent; padding: 11px 12px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 14px; text-align: left; cursor: pointer; }
.staff-nav-button:hover { color: #fff; background: #29302d; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--ug-line); font-size: 13px; }
.pagination a { border: 1px solid var(--ug-line); border-radius: 8px; background: #f0f3f1; padding: 8px 12px; font-weight: 750; }

.notice { margin: 14px 0; border: 1px solid var(--ug-line); border-radius: 9px; padding: 13px 15px; line-height: 1.5; }
.notice-warning { border-color: #e6bf71; background: #fff7e8; color: #744a00; }

.health-panel { border-left-width: 5px; }
.health-panel--success { border-left-color: var(--ug-green); }
.health-panel--warning { border-left-color: #d99a22; }
.health-panel--error { border-left-color: var(--ug-danger); }
.health-panel__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 320px); gap: 22px; align-items: start; }
.health-summary { margin: 0 0 10px; }
.health-details { margin: 0; padding-left: 20px; color: var(--ug-muted); line-height: 1.65; }
.health-policy { display: grid; gap: 5px; padding: 14px; border: 1px solid #e3e8e5; border-radius: 9px; background: #f8faf9; }
.health-policy span { color: var(--ug-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.health-policy strong + span { margin-top: 10px; }
@media (max-width: 700px) { .health-panel__body { grid-template-columns: 1fr; } }

/* File access recency in staff views. */
.access-status { display: inline-flex; align-items: flex-start; gap: 8px; min-width: 145px; }
.access-status__dot { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: #8a9690; box-shadow: 0 0 0 1px #8a9690; }
.access-status__content { display: grid; gap: 2px; line-height: 1.25; }
.access-status__content strong { color: var(--ug-text); font-size: 12px; font-weight: 750; }
.access-status__content span { color: var(--ug-muted); font-size: 11px; }
.access-recent .access-status__dot { background: #15965f; box-shadow: 0 0 0 1px #15965f; }
.access-aging .access-status__dot { background: #d49a13; box-shadow: 0 0 0 1px #d49a13; }
.access-stale .access-status__dot { background: #c63c49; box-shadow: 0 0 0 1px #c63c49; }
.access-never .access-status__dot { background: #8a9690; box-shadow: 0 0 0 1px #8a9690; }
.access-legend { display: grid; gap: 10px; }
.access-legend__title { font-size: 12px; font-weight: 800; color: var(--ug-text); }
.access-legend__items { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.access-legend__item { display: inline-flex; align-items: flex-start; gap: 7px; max-width: 330px; color: var(--ug-muted); font-size: 11px; line-height: 1.4; }
.access-legend__item strong { color: var(--ug-text); }
.file-list-item + .file-list-item { margin-top: 10px; }
.file-access-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto; align-items: start; gap: 12px; }
.file-access-row + .file-access-row { margin-top: 10px; }
.file-access-row__name { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .access-legend__items { display: grid; }
  .file-access-row { grid-template-columns: 1fr; }
}


/* Official UserGate logo in the staff navigation. */
.staff-sidebar .brand {
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  background: #fff;
  padding: 7px 10px;
}
.staff-sidebar .brand img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
}

/* uFiles 1.0.47 unified interface */
.is-hidden { display: none !important; }
.upload-success, .download-page { max-width: 760px; margin-inline: auto; padding: 34px 36px; border-top: 4px solid var(--ug-green); text-align: center; }
.success-mark { width: 58px; height: 58px; margin: 6px auto 14px; display: grid; place-items: center; border-radius: 18px; background: #e8f1ff; color: #0b57ff; font-size: 32px; font-weight: 800; }
.share-box { margin: 24px 0; padding: 18px; border: 1px solid #d8e4f4; border-radius: 16px; background: #f7faff; text-align: left; }
.share-box label { display: block; margin-bottom: 8px; font-weight: 750; color: #172033; }
.share-row { display: flex; gap: 10px; }
.share-row .control { flex: 1; min-width: 0; }
.copy-result { min-height: 20px; margin: 8px 0 0; color: #0b57ff; font-size: 13px; }
.scan-state { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0; padding: 16px; border-radius: 14px; background: #eef4fb; text-align: left; }
.scan-state p { margin: 4px 0 0; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.download-list { display: grid; gap: 12px; margin: 24px 0; }
.download-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #d8e4f4; border-radius: 14px; background: #fff; }
.download-item__main { min-width: 0; display: grid; gap: 5px; text-align: left; }
.download-item__main strong { overflow-wrap: anywhere; }
.download-item__main span, .download-meta { color: #667085; font-size: 13px; }
.download-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.upload-queue { margin-top: 14px; padding: 16px; border: 1px solid #d8e4f4; border-radius: 16px; background: #f7faff; }
.upload-queue__head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.upload-queue__head p { margin: 4px 0 0; color: #667085; font-size: 13px; }
.upload-queue__head > span { white-space: nowrap; color: #0b57ff; font-weight: 750; }
.upload-queue__list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.upload-queue__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid #e0e9f5; border-radius: 11px; background: #fff; }
.upload-queue__list span { overflow-wrap: anywhere; }
.upload-queue__list small { color: #667085; }
.upload-queue__list button { border: 0; background: transparent; color: #b42318; cursor: pointer; font-weight: 700; }
.upload-queue__estimate { margin: 12px 0 0; color: #475467; font-size: 13px; }
.upload-queue.is-empty .upload-queue__list { display: none; }
.staff-kicker { margin: 0 0 4px; color: #0b57ff; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
.staff-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.staff-brand img { max-width: 40px; max-height: 40px; }
.staff-brand span { display: grid; }
.staff-brand small { color: #667085; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.history-filter { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .35fr) auto; gap: 12px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 18px 0; }
@media (max-width: 720px) {
  .share-row, .download-item { align-items: stretch; flex-direction: column; }
  .upload-queue__head { flex-direction: column; }
  .upload-queue__list li { grid-template-columns: 1fr auto; }
  .upload-queue__list small { grid-column: 1; }
  .two-column-grid { grid-template-columns: 1fr; }
  .history-filter { grid-template-columns: 1fr; }
}

/* Staff surfaces inherit the same light visual language as the public home page. */
.staff-sidebar { background: #fff; color: var(--ug-ink); border-right: 1px solid var(--ug-line); border-top: 4px solid var(--ug-green); }
.staff-brand { align-items: flex-start; flex-direction: column; }
.staff-brand img { display: block; width: 176px; max-width: 100%; height: auto; max-height: none; }
.staff-brand span { gap: 2px; }
.staff-brand strong { color: var(--ug-ink); font-size: 18px; }
.staff-brand small { color: var(--ug-muted); }
.staff-nav a, .staff-nav-button { color: #334155; }
.staff-nav a:hover, .staff-nav a.active, .staff-nav-button:hover { color: var(--ug-green-dark); background: var(--ug-green-soft); }
@media (max-width: 900px) { .staff-sidebar { border-right: 0; border-bottom: 1px solid var(--ug-line); border-top: 4px solid var(--ug-green); } }
@media (max-width: 640px) { .upload-success, .download-page { padding: 26px 21px; } }


/* uFiles 1.0.55: reviewed unified visual system for public and staff interfaces. */
.staff-main input:not([type="checkbox"]):not([type="radio"]),
.staff-main textarea,
.staff-main select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ug-ink);
  padding: 10px 12px;
  font: inherit;
}
.staff-main textarea { min-height: 112px; resize: vertical; }
.staff-main input:focus, .staff-main textarea:focus, .staff-main select:focus {
  border-color: var(--ug-blue);
  outline: 3px solid rgba(11, 87, 255, .12);
}
.form-row--checkbox { grid-template-columns: auto 1fr; align-items: center; }
.form-row--checkbox label { grid-column: 2; grid-row: 1; }
.form-row--checkbox input { grid-column: 1; grid-row: 1; width: 20px; height: 20px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-danger { background: #b42318; color: #fff; border-color: #b42318; }
.btn-danger:hover { background: #8f1b13; border-color: #8f1b13; }
.file-download-link { display: block; width: fit-content; margin-top: 4px; color: var(--ug-blue); font-size: 13px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.file-download-link:hover { color: #0847d1; }
.message--error, .message.error { border-color: #f1b7b1; background: #fff1ef; color: #8f1b13; }
.message--success, .message.success { border-color: #b7dec9; background: #edf9f2; color: #17623b; }
.message--warning, .message.warning { border-color: #efd39a; background: #fff8e8; color: #7d5100; }
.form-errors, .field-error { color: #b42318; font-size: 13px; }
.compact-summary { display: grid; gap: 8px; margin: 18px 0; }
.compact-summary > div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--ug-line); }
.compact-summary dt { color: var(--ug-muted); }
.compact-summary dd { margin: 0; font-weight: 800; }
.finding + .finding { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ug-line); }
.tag { display: inline-flex; margin: 2px 4px 2px 0; padding: 4px 8px; border-radius: 999px; background: var(--ug-blue-soft); color: var(--ug-blue); font-size: 12px; font-weight: 700; }
.metadata-code { display: block; max-width: 420px; white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
.history-filter--single { grid-template-columns: minmax(220px, 1fr) auto; }
.staff-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ug-bg); }
.staff-login-card { width: min(100%, 480px); display: grid; gap: 24px; padding: 34px; border: 1px solid var(--ug-line); border-radius: 24px; background: #fff; box-shadow: 0 22px 60px rgba(25, 56, 96, .12); }
.staff-login-brand { display: flex; align-items: flex-start; gap: 12px; color: var(--ug-ink); text-decoration: none; }
.staff-login-brand img { width: min(190px, 50%); height: auto; }
.staff-login-brand span { display: grid; gap: 2px; }
.staff-login-brand strong { font-size: 18px; }
.staff-login-brand small { color: var(--ug-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.text-link { color: var(--ug-blue); font-weight: 700; text-align: center; }
.pii-control-grid { align-items: start; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 20px 0; }
.pagination a { color: var(--ug-blue); font-weight: 750; }
@media (max-width: 700px) {
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .staff-login-card { padding: 24px; }
  .history-filter--single { grid-template-columns: 1fr; }
}

/* uFiles 1.0.55: reviewed UI, risk states and responsive staff navigation. */
:focus-visible {
  outline: 3px solid rgba(11, 87, 255, .28);
  outline-offset: 2px;
}
.staff-sidebar {
  overflow-y: auto;
  scrollbar-width: thin;
}
.staff-main {
  padding: 32px clamp(18px, 3vw, 44px);
}
.staff-top {
  margin-bottom: 20px;
}
.panel,
.stat,
.staff-login-card,
.portal-card {
  border-radius: 16px;
}
.panel {
  box-shadow: 0 8px 24px rgba(25, 56, 96, .045);
}
.panel--compact {
  max-width: 820px;
}
.panel__head {
  background: #f8fbff;
}
.table-wrap {
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.table-wrap table {
  min-width: 840px;
}
tbody tr {
  transition: background-color .12s ease;
}
.badge.conditional_safe {
  background: #fff4d6;
  color: #7a5200;
  border: 1px solid #efd18a;
}
.badge.conditional_unsafe {
  background: #fff0e8;
  color: #9a3412;
  border: 1px solid #f0b89d;
}
.badge.clean,
.badge.segmented_clean {
  border: 1px solid #b7dec9;
}
.file-access-row__name {
  display: block;
  font-weight: 750;
}
.file-download-link {
  margin-top: 5px;
}
.upload-queue__head {
  align-items: center;
}
.upload-queue__estimate {
  padding-top: 10px;
  border-top: 1px solid #e0e9f5;
}
.staff-nav a,
.staff-nav-button {
  min-height: 42px;
  display: flex;
  align-items: center;
}
@media (max-width: 900px) {
  .staff-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(25, 56, 96, .08);
  }
  .staff-brand {
    flex-direction: row;
    align-items: center;
  }
  .staff-brand img {
    width: 132px;
  }
  .staff-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .staff-nav a,
  .staff-nav-button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 38px;
    padding: 8px 11px;
  }
  .staff-logout-form {
    flex: 0 0 auto;
  }
}
@media (max-width: 640px) {
  .staff-main {
    padding: 16px 12px 24px;
  }
  .panel,
  .stat,
  .portal-card,
  .staff-login-card {
    border-radius: 13px;
  }
  .panel__body,
  .panel__head {
    padding: 14px;
  }
  .table-wrap {
    margin-inline: -1px;
  }
}

/* uFiles 1.0.56: compact PII state column in published history. */
.pii-status-stack { display: grid; gap: .55rem; min-width: 13rem; }
.pii-status-row { display: grid; gap: .25rem; }
.pii-status-row__name { color: var(--muted, #667085); font-size: .78rem; overflow-wrap: anywhere; }

/* uFiles 1.0.59: publication link appears only after mandatory AV clearance. */
.upload-summary {
  margin: 0.25rem 0 1.25rem;
  text-align: center;
  color: var(--muted, #667085);
  font-size: 0.95rem;
}

/* Public result-page logo link shared by status and download pages. */
.page-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  border-radius: 10px;
}
.page-logo-link:hover {
  text-decoration: none;
}
.page-logo-link .captive-logo {
  display: block;
}

/* uFiles 1.0.62: restore the original selected-file card and use one action component. */
.upload-queue--selected {
  width: 100%;
  margin-top: 14px;
}
.upload-queue--selected[hidden] {
  display: none !important;
}
.upload-queue--selected .upload-queue__head {
  align-items: baseline;
}
.upload-queue--selected .upload-queue__head > span {
  max-width: 65%;
  overflow-wrap: anywhere;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.upload-queue__name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}
.upload-queue__exact-size {
  color: var(--ug-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Button and link elements deliberately share this complete component instead
   of relying on element-specific browser defaults or container overrides. */
.ufiles-primary-action {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-height: 50px;
  margin: 0;
  border: 1px solid var(--ug-green);
  border-radius: 10px;
  background: var(--ug-green);
  color: #fff;
  padding: 13px 18px;
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.ufiles-primary-action:visited {
  color: #fff;
}
.ufiles-primary-action:hover {
  border-color: var(--ug-green-hover);
  background: var(--ug-green-hover);
  color: #fff;
  text-decoration: none;
}
.ufiles-primary-action:focus-visible {
  outline: 3px solid rgba(11, 87, 255, .28);
  outline-offset: 2px;
}
.ufiles-primary-action:disabled {
  opacity: .6;
  cursor: wait;
}
@media (max-width: 720px) {
  .upload-queue--selected .upload-queue__head {
    align-items: flex-start;
  }
  .upload-queue--selected .upload-queue__head > span {
    max-width: 100%;
    text-align: left;
  }
  .upload-queue__exact-size {
    white-space: normal;
  }
}
@media (max-width: 640px) {
  .ufiles-primary-action {
    width: 100%;
  }
}

/* uFiles 1.0.63: deterministic result-page actions and left-aligned logo. */
.upload-success .page-logo-link--left {
  display: flex;
  width: fit-content;
  margin-left: 0;
  margin-right: auto;
  justify-content: flex-start;
}

/* Explicit element selectors and important colors prevent legacy anchor/button
   rules, visited styles, and container rules from changing the component. */
button.ufiles-primary-action,
a.ufiles-primary-action,
a.ufiles-primary-action:link,
a.ufiles-primary-action:visited {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-height: 50px;
  margin: 0;
  border: 1px solid var(--ug-green) !important;
  border-radius: 10px;
  background-color: var(--ug-green) !important;
  color: #fff !important;
  padding: 13px 18px;
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  opacity: 1;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
button.ufiles-primary-action:hover,
a.ufiles-primary-action:hover {
  border-color: var(--ug-green-hover) !important;
  background-color: var(--ug-green-hover) !important;
  color: #fff !important;
  text-decoration: none !important;
}
button.ufiles-primary-action:focus-visible,
a.ufiles-primary-action:focus-visible {
  outline: 3px solid rgba(11, 87, 255, .28);
  outline-offset: 2px;
}

.result-action-stack {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}
.result-action-stack .ufiles-result-action {
  width: min(100%, 315px);
}

@media (max-width: 640px) {
  .result-action-stack .ufiles-result-action {
    width: 100%;
  }
}


/* uFiles 1.0.65: corrected staff login, user-role form and merged history/storage. */
.staff-login-brand {
  justify-content: flex-start;
  width: fit-content;
}
.staff-login-brand img {
  width: min(210px, 70vw);
  max-width: 100%;
}
.staff-login-card > div > h1 {
  margin-top: 0;
}
.staff-user-form .form-row--checkbox {
  display: block;
}
.checkbox-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}
.checkbox-control input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
}
.checkbox-control label {
  margin: 0;
  line-height: 1.35;
}
.form-row--choice-list {
  display: grid;
  gap: 9px;
}
.form-row--choice-list > .form-row__label {
  margin: 0;
}
.choice-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.choice-list li {
  margin: 0;
}
.choice-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  line-height: 1.35;
}
.choice-list input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
}
.users-table__roles {
  min-width: 180px;
}
.users-table__state {
  white-space: nowrap;
}
.history-storage-stats {
  margin-bottom: 18px;
}
.history-storage-operations {
  margin-top: 22px;
}
@media (max-width: 720px) {
  .users-role-grid {
    grid-template-columns: 1fr;
  }
}


/* uFiles 1.0.66: consolidated staff navigation, dialogs, mail diagnostics and history composition. */
.staff-brand {
  display: block;
  width: fit-content;
}
.staff-brand img {
  display: block;
}
.staff-sidebar-title {
  margin-top: 22px;
  color: var(--ug-ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
.staff-nav {
  margin-top: 12px;
}
.btn-compact {
  min-height: 36px;
  padding: 8px 13px;
  white-space: nowrap;
}
.publication-name {
  max-width: 420px;
  color: var(--ug-ink);
  font-weight: 800;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.inline-info-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ug-blue);
  padding: 2px 0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.inline-info-button:hover { text-decoration: underline; }
.composition-list {
  display: grid;
  gap: 10px;
  min-width: 260px;
}
.composition-item {
  display: grid;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ug-line);
}
.composition-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.composition-label {
  color: var(--ug-muted);
  font-size: 12px;
  font-weight: 700;
}
.composition-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.panel-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.staff-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--ug-line);
  border-radius: 18px;
  background: #fff;
  color: var(--ug-ink);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.staff-dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}
.staff-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 14px;
}
.staff-dialog__head h2 { margin: 0; }
.staff-dialog__body {
  padding: 0 24px 10px;
  line-height: 1.6;
}
.staff-dialog__actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 24px 24px;
}
.dialog-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ug-muted);
  padding: 0;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.dialog-list {
  display: grid;
  gap: 7px;
  padding-left: 22px;
}
.mail-test-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
}
.mail-diagnostic-outcome {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--ug-line);
  border-left-width: 5px;
  border-radius: 14px;
  background: #f8fafc;
}
.mail-diagnostic-outcome--success {
  border-left-color: #138a4b;
  background: #f0fbf5;
}
.mail-diagnostic-outcome--error {
  border-left-color: #c73939;
  background: #fff5f5;
}
.mail-diagnostic-outcome h3,
.mail-diagnostic-outcome p {
  margin: 0;
}
.mail-diagnostic-outcome p { color: var(--ug-muted); }
.mail-diagnostic-guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.mail-diagnostic-guidance article {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  background: #fff;
}
.mail-diagnostic-guidance article span {
  color: var(--ug-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mail-diagnostic-guidance article strong {
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.mail-diagnostic-running {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 16px;
  border: 1px solid var(--ug-line);
  border-radius: 14px;
  background: #f8fafc;
}
.mail-diagnostic-running .spinner { flex: 0 0 32px; }
.mail-diagnostic-running > div {
  display: grid;
  gap: 4px;
}
.mail-diagnostic-running span:last-child { color: var(--ug-muted); }
.mail-diagnostic-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--ug-line);
  border-radius: 14px;
  background: #f8fafc;
}
.mail-diagnostic-empty span { color: var(--ug-muted); }
.mail-diagnostic-steps {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.mail-diagnostic-steps h3 { margin: 0; font-size: 16px; }
.mail-diagnostic-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mail-diagnostic-step {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--ug-line);
  border-radius: 11px;
  background: #fff;
}
.mail-diagnostic-step__mark {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid #8795aa;
  border-radius: 50%;
  background: #fff;
}
.mail-diagnostic-step--success .mail-diagnostic-step__mark {
  border-color: #138a4b;
  background: #138a4b;
}
.mail-diagnostic-step--error .mail-diagnostic-step__mark {
  border-color: #c73939;
  background: #c73939;
}
.mail-diagnostic-step--warning .mail-diagnostic-step__mark {
  border-color: #b97800;
  background: #b97800;
}
.mail-diagnostic-step--pending .mail-diagnostic-step__mark {
  border-color: #3277cf;
  background: #3277cf;
}
.mail-diagnostic-step--skipped { opacity: .72; }
.mail-diagnostic-step > div { display: grid; gap: 4px; }
.mail-diagnostic-step > div > span {
  color: var(--ug-muted);
  overflow-wrap: anywhere;
}
.mail-diagnostic-technical {
  margin-top: 20px;
  padding: 0;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  background: #f8fafc;
}
.mail-diagnostic-technical summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
}
.mail-diagnostic-technical[open] summary { border-bottom: 1px solid var(--ug-line); }
.mail-diagnostic-technical .diagnostic-grid { padding: 16px; }
.mail-diagnostic-technical > .help { margin: 0; padding: 0 16px 16px; }
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.diagnostic-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--ug-line);
  border-radius: 10px;
  background: #fff;
}
.diagnostic-item span { color: var(--ug-muted); font-size: 12px; }
.diagnostic-item strong { overflow-wrap: anywhere; }
.diagnostic-item--wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .mail-test-form,
  .mail-diagnostic-guidance,
  .diagnostic-grid { grid-template-columns: 1fr; }
  .diagnostic-item--wide { grid-column: auto; }
  .staff-dialog__head { padding: 18px 18px 12px; }
  .staff-dialog__body { padding: 0 18px 8px; }
  .staff-dialog__actions { padding: 12px 18px 18px; }
}

/* uFiles 1.0.68: special access and staff administration controls. */
.access-section {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.access-section:first-of-type { margin-top: 0; }
.access-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.access-section__head h2,
.access-section__head p { margin: 0; }
.access-section__head p {
  margin-top: 6px;
  color: var(--ug-muted);
}
.access-policy-state {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  gap: 5px 12px;
  min-width: 300px;
  padding: 12px 14px;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  background: #f8fafc;
}
.access-policy-state span {
  color: var(--ug-muted);
  font-size: 12px;
}
.access-policy-state strong {
  overflow-wrap: anywhere;
  text-align: right;
}
.access-safety-note {
  margin-bottom: 16px;
}
.access-user-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.access-user-actions form { margin: 0; }
.access-users-table td:nth-child(2) { min-width: 190px; }
@media (max-width: 760px) {
  .access-section__head { flex-direction: column; }
  .access-policy-state { min-width: 0; width: 100%; }
  .access-policy-state strong { text-align: left; }
}

/* uFiles 1.0.87: stable public result layout and unified action typography. */
.download-page__identity {
  display: grid;
  justify-items: center;
  align-items: start;
  gap: 12px;
  width: 100%;
  margin: 0 0 10px;
}
.download-page__identity .page-logo-link {
  display: flex;
  width: fit-content;
  margin: 0 auto;
}
.download-page__security-pins {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.download-page__security-pin {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0;
}
.scan-state {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}
.scan-state .spinner {
  display: block;
  margin: 18px auto 10px;
}
.scan-state .scan-state__text {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  color: var(--ug-ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
}
.scan-state--without-spinner {
  display: block;
  text-align: center;
}
.scan-state--without-spinner .scan-state__text {
  width: 100%;
  text-align: center;
}
.btn,
.ufiles-primary-action,
button.ufiles-primary-action,
a.ufiles-primary-action,
a.ufiles-primary-action:link,
a.ufiles-primary-action:visited {
  min-height: 50px;
  border-radius: 10px;
  padding: 13px 18px;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
}


/* uFiles 1.0.88: concise expired-publication page using the shared action component. */
.unavailable-page__identity {
  margin-bottom: 18px;
}
.unavailable-page__actions {
  margin-top: 26px;
}

/* uFiles 1.0.90: shared upload action on the public download page. */
.download-page__actions {
  margin-top: 20px;
}

/* uFiles 1.0.91: real file-safety pins on the public download page. */

/* uFiles 1.0.92: every uFiles/UserGate logo starts at the left edge of its container. */
.public-header .brand,
.staff-sidebar .staff-brand,
.staff-login-card .staff-login-brand,
.upload-success .page-logo-link,
.download-page .page-logo-link,
.unavailable-page .page-logo-link {
  align-self: flex-start;
  justify-content: flex-start;
  width: fit-content;
  margin-left: 0;
  margin-right: auto;
}
.download-page__identity,
.unavailable-page__identity {
  justify-items: start;
}
.download-page__identity .page-logo-link,
.unavailable-page__identity .page-logo-link {
  margin-left: 0;
  margin-right: auto;
}
.download-page__security-pins {
  align-self: stretch;
  justify-content: center;
}

/* uFiles 1.0.93: keep real file-status pins centered independently of the left-aligned logo. */


/* uFiles 1.0.97: one shared circular spinner for phone verification, file checking and publication. */
.spinner {
  box-sizing: border-box;
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  aspect-ratio: 1 / 1;
  padding: 0;
  line-height: 0;
  border-radius: 50%;
  transform-origin: 50% 50%;
}

/* uFiles 1.0.100 permanent-publication editing */
.publication-edit-card {
  max-width: 860px;
}
.publication-edit-code-form,
.publication-edit-form {
  display: grid;
  gap: 16px;
}
.publication-edit-code {
  text-align: center;
  letter-spacing: .25em;
  font-variant-numeric: tabular-nums;
}
.publication-edit-current-files {
  margin: 0;
  padding: 0;
  border: 0;
}
.publication-edit-current-files legend {
  margin-bottom: 8px;
  font-weight: 600;
}
.publication-edit-file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.publication-edit-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color, #d8e2f2);
  border-radius: 14px;
  cursor: pointer;
}
.publication-edit-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.publication-edit-file-size {
  color: var(--muted-color, #66758f);
  white-space: nowrap;
}
.publication-edit-selected,
.publication-edit-status {
  padding: 12px 14px;
  border-radius: 14px;
  background: #eef5ff;
}
.publication-edit-selected ul {
  margin: 0;
  padding-left: 20px;
}
.publication-edit-status.is-error {
  background: #fff0f0;
  color: #a02323;
}
@media (max-width: 640px) {
  .publication-edit-file-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .publication-edit-file-size {
    grid-column: 2;
  }
}
.download-page__edit-form,
.download-page__edit-form .ufiles-primary-action {
  width: 100%;
}

/* uFiles 1.0.108: metadata below description, compact help, wide phone row and equal-width actions. */
.publication-meta-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 15px;
  width: 100%;
  min-width: 0;
}
.publication-meta-layout.is-permanent {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.publication-meta-layout > [data-ufiles-field-role] {
  min-width: 0;
  width: 100%;
  margin: 0;
}
.publication-meta-layout .permanent-owner-email[hidden] {
  display: none !important;
}
.publication-meta-layout .publication-download-limit[hidden] {
  display: none !important;
}
.publication-meta-layout .permanent-owner-email__help {
  margin: 0;
}
[data-ufiles-field-role="phone"] {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-width: 0;
}
[data-ufiles-field-role="phone"] .phone-control,
[data-ufiles-field-role="phone"] input[type="tel"] {
  width: 100%;
  max-width: none;
}
[data-ufiles-field-role="phone"] .help {
  margin: 0;
  white-space: nowrap;
}

/* Every action inside one action group occupies the same deterministic width,
   regardless of whether it is an anchor, button or a wrapping form. */
.result-action-stack > .ufiles-result-action,
.result-action-stack > .btn,
.result-action-stack > a,
.result-action-stack > button,
.result-action-stack > form {
  width: min(100%, 315px);
  max-width: 315px;
  justify-self: center;
  margin-inline: auto;
}
.result-action-stack > form > .ufiles-result-action,
.result-action-stack > form > .btn,
.result-action-stack > form > button {
  width: 100%;
  max-width: none;
}
.download-page__edit-form,
.download-page__edit-form .ufiles-primary-action {
  width: min(100%, 315px);
  max-width: 315px;
}
.publication-edit-code-form > .ufiles-primary-action,
.publication-edit-form > .ufiles-primary-action {
  width: min(100%, 315px);
  max-width: 315px;
  justify-self: center;
}
.form-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 12px;
  align-items: stretch;
}
.form-actions > .btn,
.form-actions > a.btn,
.form-actions > button.btn,
.form-actions > form {
  width: 100%;
  min-width: 0;
}
.form-actions > form > .btn,
.form-actions > form > button {
  width: 100%;
}

@media (max-width: 640px) {
  .publication-meta-layout,
  .publication-meta-layout.is-permanent {
    grid-template-columns: minmax(0, 1fr);
  }
  [data-ufiles-field-role="phone"] .help {
    white-space: normal;
  }
  .result-action-stack > .ufiles-result-action,
  .result-action-stack > .btn,
  .result-action-stack > a,
  .result-action-stack > button,
  .result-action-stack > form,
  .download-page__edit-form,
  .download-page__edit-form .ufiles-primary-action,
  .publication-edit-code-form > .ufiles-primary-action,
  .publication-edit-form > .ufiles-primary-action {
    width: 100%;
    max-width: none;
  }
  .form-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* uFiles 1.0.109: consistent staff action sizing bounded by owner form. */
.staff-main .btn,
.staff-dialog .btn {
  box-sizing: border-box;
  min-height: 44px;
  max-width: 100%;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}
.staff-main form,
.staff-dialog form {
  min-width: 0;
  max-width: 100%;
}
.staff-main form > .btn:not(.btn-block),
.staff-main form > button.btn:not(.btn-block),
.staff-dialog form > .btn:not(.btn-block),
.staff-dialog form > button.btn:not(.btn-block) {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}
.staff-main .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}
.staff-main .form-actions > .btn,
.staff-main .form-actions > a.btn,
.staff-main .form-actions > button.btn,
.staff-main .form-actions > form {
  flex: 0 1 220px;
  width: min(220px, 100%);
  max-width: 100%;
  min-width: 0;
}
.staff-main .form-actions > form > .btn,
.staff-main .form-actions > form > button.btn {
  width: 100%;
  max-width: 100%;
}
.staff-main .history-filter > .btn,
.staff-main .mail-test-form > .btn {
  width: 100%;
  max-width: 220px;
}
.staff-main .btn-compact {
  min-height: 36px;
  width: auto;
  max-width: 100%;
  padding: 8px 13px;
}
.staff-main .access-user-actions form,
.staff-main .access-user-actions .btn {
  max-width: 100%;
}
@media (max-width: 640px) {
  .staff-main .form-actions > .btn,
  .staff-main .form-actions > a.btn,
  .staff-main .form-actions > button.btn,
  .staff-main .form-actions > form {
    flex-basis: 100%;
    width: 100%;
  }
  .staff-main .history-filter > .btn,
  .staff-main .mail-test-form > .btn {
    max-width: none;
  }
}

/* uFiles 1.0.114: authoritative publication form layout and phone controls. */
.ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"] {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  gap: 15px !important;
  margin: 0 !important;
}
.ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"].is-permanent {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"] > [data-ufiles-field-role="retention"],
.ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"] > [data-ufiles-field-role="owner-email"] {
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}
.ufiles-publication-form-layout > [data-ufiles-field-role="phone"] {
  display: block !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}
.ufiles-publication-form-layout > [data-ufiles-field-role="phone"] input[data-ufiles-visible-phone="1"] {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
}
input[data-ufiles-phone-stabilized]:not([data-ufiles-visible-phone="1"]) {
  display: none !important;
}
#countryButton[data-ufiles-country-locked="1"] {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}
#countryButton[data-ufiles-country-locked="1"] [class*="chevron"],
#countryButton[data-ufiles-country-locked="1"] [class*="arrow"],
#countryButton[data-ufiles-country-locked="1"] [class*="caret"] {
  display: none;
}
@media (max-width: 640px) {
  .ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"],
  .ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"].is-permanent {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* uFiles 1.0.115: owner email must be confirmed before an edit code is sent. */
.result-action-stack > form.download-page__edit-form {
  display: grid;
  gap: 12px;
  width: min(100%, 630px);
  max-width: 630px;
}
.download-page__edit-email {
  display: grid;
  gap: 7px;
  width: 100%;
  text-align: left;
}
.download-page__edit-email label {
  font-weight: 700;
}
.download-page__edit-email .control {
  width: 100%;
  max-width: none;
}
.download-page__edit-email .help {
  margin: 0;
}
.download-page__edit-form .ufiles-result-action {
  width: min(100%, 315px);
  max-width: 315px;
  justify-self: center;
}
@media (max-width: 640px) {
  .result-action-stack > form.download-page__edit-form,
  .download-page__edit-form .ufiles-result-action {
    width: 100%;
    max-width: none;
  }
}

/* uFiles 1.0.130 live upload progress */
.upload-progress-panel { margin-top: 14px; text-align: left; }
.upload-progress-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; min-width: 0; }
.upload-progress-percent { flex: 0 0 auto; color: var(--ug-black); font-size: 21px; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.upload-progress-meta { min-width: 0; color: var(--ug-muted); font-size: 12px; line-height: 1.35; text-align: right; font-variant-numeric: tabular-nums; }
.upload-progress-panel .progress { margin: 9px 0 8px; }
.upload-progress-panel .progress > span { transition: width .12s linear; }
.upload-progress-status { margin: 0; text-align: left; }
.publication-edit-progress { margin-bottom: 10px; }
@media (max-width: 520px) {
  .upload-progress-summary { align-items: flex-start; flex-direction: column; gap: 5px; }
  .upload-progress-meta { text-align: left; }
}


/* uFiles 1.0.133 additive file selection */
.publication-edit-selected__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.publication-edit-selected__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.publication-edit-selected__name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.publication-edit-selected__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  white-space: nowrap;
}
.publication-edit-selected__size {
  color: var(--muted-color, #66758f);
  white-space: nowrap;
}
.publication-edit-selected__remove {
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.publication-edit-selected__remove:hover,
.publication-edit-selected__remove:focus-visible {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .file-chip { grid-template-columns: minmax(0, 1fr); }
  .file-chip__meta { justify-self: start; }
  .publication-edit-selected__item { grid-template-columns: minmax(0, 1fr); }
  .publication-edit-selected__meta { justify-self: start; }
}

/* uFiles 1.0.136: keep each remove action directly after that file's size. */
.file-chip__meta > .file-chip__size + .file-chip__remove,
.publication-edit-selected__meta > .publication-edit-selected__size + .publication-edit-selected__remove {
  margin-left: 0;
}

/* uFiles 1.0.145: publication-management polish and deterministic action sizing. */
.publication-edit-form + .publication-edit-cancel-form {
  margin-top: 5px;
}
.publication-edit-cancel-form > .btn,
.publication-edit-cancel-form > button.btn {
  width: min(100%, 315px);
  max-width: 315px;
  justify-self: center;
}

.staff-owner-email-full {
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: text;
}
.staff-publication-management__body {
  display: grid;
  gap: 0;
  padding: 0;
}
.staff-publication-management__section {
  min-width: 0;
  padding: 20px 18px;
}
.staff-publication-management__section + .staff-publication-management__section {
  border-top: 1px solid var(--ug-border, #d8dee8);
}
.staff-publication-management__section-head {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
}
.staff-publication-management__section-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}
.staff-publication-management__section-head p {
  margin: 0;
  max-width: 920px;
  color: var(--ug-muted, #66758f);
  line-height: 1.45;
}
.staff-publication-management__form {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
}
.staff-publication-management__fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  min-width: 0;
}
.staff-publication-management__fields--password {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}
.staff-publication-management__fields--password > .form-row:first-child {
  grid-column: 1 / -1;
  width: min(100%, 360px);
}
.staff-publication-management__fields .form-row,
.staff-publication-management__fields .control {
  min-width: 0;
  width: 100%;
  max-width: none;
}
.staff-publication-management__actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}
.staff-main .staff-publication-management__actions > .btn,
.staff-main .staff-publication-management__actions > button.btn {
  width: min(100%, 260px);
  max-width: 260px;
  justify-self: start;
}
.staff-publication-management__delete-confirm {
  width: fit-content;
  max-width: 100%;
}

/* Public publication actions use the same full row width as owner OTP forms. */
.download-page__actions > .ufiles-result-action,
.download-page__actions > .btn,
.download-page__actions > a,
.download-page__actions > button,
.download-page__actions > form {
  width: min(100%, 630px);
  max-width: 630px;
}
.download-page__actions > form > .ufiles-result-action,
.download-page__actions > form > .btn,
.download-page__actions > form > button,
.download-page__edit-form .ufiles-result-action {
  width: 100%;
  max-width: none;
}

@media (max-width: 900px) {
  .staff-publication-management__fields,
  .staff-publication-management__fields--password {
    grid-template-columns: minmax(0, 1fr);
  }
  .staff-publication-management__fields--password > .form-row:first-child {
    grid-column: auto;
    width: 100%;
  }
}
@media (max-width: 640px) {
  .staff-publication-management__section {
    padding: 18px 14px;
  }
  .staff-main .staff-publication-management__actions > .btn,
  .staff-main .staff-publication-management__actions > button.btn,
  .download-page__actions > .ufiles-result-action,
  .download-page__actions > .btn,
  .download-page__actions > a,
  .download-page__actions > button,
  .download-page__actions > form {
    width: 100%;
    max-width: none;
  }
}


/* uFiles 1.0.146: full-width public result actions. */
.result-action-stack .ufiles-result-action {
  width: min(100%, 630px);
  max-width: 630px;
}
@media (max-width: 640px) {
  .result-action-stack .ufiles-result-action {
    width: 100%;
    max-width: none;
  }
}


/* uFiles 1.0.147: authoritative full-width result actions and removed-file state. */
.result-action-stack {
  width: min(100%, 630px) !important;
  max-width: 630px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  justify-items: stretch !important;
}
.result-action-stack > .ufiles-result-action,
.result-action-stack > .btn,
.result-action-stack > a,
.result-action-stack > button,
.result-action-stack > form {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}
.result-action-stack > form > .ufiles-result-action,
.result-action-stack > form > .btn,
.result-action-stack > form > button,
.download-page__edit-form .ufiles-result-action {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}
.download-item--removed {
  align-items: flex-start;
  opacity: .82;
}
.download-item__removed-reason {
  display: block;
  margin-top: 4px;
}


/* uFiles 1.0.150: readable immutable SHA-256 evidence in staff views. */
.forensic-hash {
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: text;
}
.forensic-sha-panel .table-wrap code {
  white-space: normal;
}
.audit-context-line { margin: 0 0 4px; line-height: 1.35; }
.audit-context-line:last-child { margin-bottom: 0; }

/* uFiles 163: exchange access alignment and staff participant management. */
.publication-edit-code-form > .exchange-request-code-action {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
  box-sizing: border-box;
}
.exchange-member-admin {
  padding-top: 14px;
  padding-bottom: 14px;
}
.exchange-member-admin__add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.exchange-member-admin__add .form-row {
  margin: 0;
}
.exchange-member-admin__add .btn {
  min-width: 180px;
}
.btn-compact {
  min-height: 36px !important;
  padding: 7px 11px !important;
}
@media (max-width: 720px) {
  .exchange-member-admin__add {
    grid-template-columns: minmax(0, 1fr);
  }
  .exchange-member-admin__add .btn {
    width: 100%;
  }
}


/* uFiles 172: owner exchange members and deterministic edit/access actions. */
.publication-edit-code-form > .exchange-verify-login-action {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
  box-sizing: border-box;
}
.exchange-verify-back-actions {
  margin-top: 5px;
}
.publication-edit-file-row {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: default;
}
.publication-edit-current-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  white-space: nowrap;
}
.publication-edit-current-remove {
  flex: 0 0 auto;
}
.publication-edit-form > .publication-edit-save-action {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
  box-sizing: border-box;
}
.exchange-owner-members-action {
  width: min(100%, 315px);
}
.exchange-owner-members-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.exchange-owner-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-color, #d8e2f2);
  border-radius: 14px;
}
.exchange-owner-member-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.exchange-owner-member-email {
  overflow-wrap: anywhere;
}
.exchange-owner-member-status {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.exchange-owner-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.exchange-owner-member-actions form { margin: 0; }
.exchange-owner-member-admin-note { margin: 12px 0 0; }
.exchange-owner-member-add-form {
  display: grid;
  gap: 12px;
}
.exchange-owner-member-add-form > .ufiles-primary-action {
  width: 100% !important;
  max-width: none !important;
  justify-self: stretch !important;
}
.exchange-owner-member-back-actions {
  margin-top: 5px;
}
@media (max-width: 640px) {
  .publication-edit-file-row,
  .exchange-owner-member-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .publication-edit-current-meta {
    justify-self: start;
  }
  .exchange-owner-member-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .exchange-owner-member-actions form,
  .exchange-owner-member-actions .btn {
    width: 100%;
  }
}

/* uFiles 174: visible background AV queue and current scan state. */
.stat__action { margin-top: 12px; }
.stat__action .btn { width: 100%; }
.background-scan-live { margin-top: 18px; }
.background-scan-live__body { display: grid; gap: 12px; }
.background-scan-live__item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  background: #fff;
}
.background-scan-live__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.background-scan-live__title strong { min-width: 0; overflow-wrap: anywhere; }
.background-scan-live__file { font-weight: 700; overflow-wrap: anywhere; }
.background-scan-live__file span,
.background-scan-live__meta,
.background-scan-live__empty { color: var(--ug-muted); }
.background-scan-live__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.background-scan-live__footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--ug-line);
}
.background-scan-detail { margin-top: 6px; }
.background-scan-error { margin-top: 4px; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
@media (max-width: 720px) {
  .background-scan-live__title,
  .background-scan-live__footer { align-items: flex-start; flex-direction: column; }
}

/* uFiles 175 download-all action */
.download-page__download-all {
  margin: -8px 0 20px;
}
.download-page__download-all > .help {
  text-align: center;
}

/* uFiles 176: disabled download-all remains visible and explains why. */
.download-page__download-all .download-all-disabled {
  position: relative;
  border-color: #c7ccd3 !important;
  background: #e5e7eb !important;
  color: #6b7280 !important;
  cursor: not-allowed;
  user-select: none;
}
.download-page__download-all .download-all-disabled:hover,
.download-page__download-all .download-all-disabled:focus,
.download-page__download-all .download-all-disabled:focus-visible {
  border-color: #c7ccd3 !important;
  background: #e5e7eb !important;
  color: #6b7280 !important;
  text-decoration: none !important;
}
.download-page__download-all .download-all-disabled:focus-visible {
  outline: 3px solid rgba(107, 114, 128, .28);
  outline-offset: 2px;
}
.download-page__download-all .download-all-disabled::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(4px);
  border: 1px solid var(--ug-line);
  border-radius: 8px;
  background: #20242b;
  color: #fff;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.download-page__download-all .download-all-disabled:hover::after,
.download-page__download-all .download-all-disabled:focus::after,
.download-page__download-all .download-all-disabled:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 520px) {
  .download-page__download-all .download-all-disabled::after {
    max-width: calc(100vw - 40px);
  }
}

/* uFiles 177: centralized status reference on upload history. */
.status-info-dialog {
  width: min(780px, calc(100vw - 32px));
}
.status-info-dialog__body {
  display: grid;
  gap: 20px;
  overflow-y: auto;
}
.status-info-section {
  display: grid;
  gap: 10px;
}
.status-info-section h3 {
  margin: 0;
  font-size: 16px;
}
.status-info-list {
  display: grid;
  gap: 8px;
}
.status-info-item {
  display: grid;
  grid-template-columns: minmax(190px, max-content) minmax(0, 1fr);
  align-items: start;
  gap: 12px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ug-line);
}
.status-info-item:last-child {
  border-bottom: 0;
}
.status-info-item .badge {
  justify-self: start;
}
.status-info-item p {
  margin: 0;
  color: var(--ug-muted);
  line-height: 1.45;
}
@media (max-width: 640px) {
  .status-info-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}


/* uFiles 178: shared dashboard/history publication module and compact dashboard summary. */
.publication-name-link {
  display: inline-block;
  color: var(--ug-blue);
  text-decoration: none;
}
.publication-name-link:hover,
.publication-name-link:focus-visible {
  text-decoration: underline;
}
.publication-description { margin-top: 4px; max-width: 420px; }
.storage-summary-stat { min-width: 0; }
.storage-summary-list { display: grid; gap: 8px; margin-top: 10px; }
.storage-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--ug-line);
}
.storage-summary-row:last-child { padding-bottom: 0; border-bottom: 0; }
.storage-summary-row span { color: var(--ug-muted); font-size: 12px; font-weight: 700; }
.storage-summary-row strong { text-align: right; font-size: 14px; }
@media (max-width: 720px) {
  .storage-summary-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .storage-summary-row strong { text-align: left; }
}

/* uFiles 192: UserGate brandbook-aligned public UI and phone-owned My Files. */
.ufiles-primary-action,
button.ufiles-primary-action,
a.ufiles-primary-action,
a.ufiles-primary-action:link,
a.ufiles-primary-action:visited {
  min-height: 48px;
  border-radius: 8px;
  border-color: var(--ug-brand-blue) !important;
  background: var(--ug-brand-blue) !important;
  color: #fff !important;
  padding: 12px 20px;
}
button.ufiles-primary-action:hover,
a.ufiles-primary-action:hover {
  border-color: var(--ug-brand-blue-60) !important;
  background: var(--ug-brand-blue-60) !important;
}
button.ufiles-primary-action:focus-visible,
a.ufiles-primary-action:focus-visible {
  outline: 3px solid #99adff;
  outline-offset: 2px;
}

.download-page {
  padding: 32px 36px;
  border-top-color: var(--ug-brand-blue);
}
.download-list {
  gap: 16px;
}
.download-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 16px;
  border-color: #d3d7db;
  border-radius: 12px;
  background: #fff;
}
.download-item__main {
  gap: 4px;
}
.download-item > .help,
.download-item > .badge {
  justify-self: end;
}
.download-item > .ufiles-primary-action {
  grid-column: 1 / -1;
  width: 100% !important;
  max-width: none !important;
}
.download-meta {
  gap: 8px 16px;
  margin-top: 24px;
}
.download-page__actions,
.download-page__download-all {
  margin-top: 24px;
}
.result-action-stack {
  gap: 12px;
}

.ufiles-secondary-action,
a.ufiles-secondary-action,
button.ufiles-secondary-action {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ug-brand-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--ug-brand-blue) !important;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none !important;
  cursor: pointer;
}
.ufiles-secondary-action:hover,
a.ufiles-secondary-action:hover,
button.ufiles-secondary-action:hover {
  background: var(--ug-brand-blue-10);
  color: var(--ug-brand-blue) !important;
  text-decoration: none !important;
}
.ufiles-secondary-action:focus-visible,
a.ufiles-secondary-action:focus-visible,
button.ufiles-secondary-action:focus-visible {
  outline: 3px solid #99adff;
  outline-offset: 2px;
}

.home-footer-actions {
  width: min(760px, 100%);
  margin: 16px auto 0;
  display: grid;
}
.ufiles-upload-card {
  position: relative;
}
.ufiles-upload-my-files {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 2;
  min-height: 40px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ug-brand-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--ug-brand-blue) !important;
  padding: 8px 16px;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none !important;
  white-space: nowrap;
}
.ufiles-upload-my-files:hover {
  background: var(--ug-brand-blue-10);
  color: var(--ug-brand-blue) !important;
  text-decoration: none !important;
}
.ufiles-upload-my-files:focus-visible {
  outline: 3px solid #99adff;
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .ufiles-upload-my-files {
    position: static;
    display: flex;
    width: 100%;
    margin: 12px 0 20px;
  }
}

/* uFiles 217: primary public sections as tabs. */
.ufiles-home-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 20px 0 24px;
  padding: 4px;
  border-radius: 12px;
  background: #eef1f3;
}
.ufiles-home-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #4b5863 !important;
  padding: 10px 16px;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-decoration: none !important;
}
.ufiles-home-tab:hover {
  background: rgba(255, 255, 255, .65);
  color: #111 !important;
}
.ufiles-home-tab.is-active {
  border-color: #d5dadd;
  background: #fff;
  color: var(--ug-brand-blue) !important;
  box-shadow: 0 1px 3px rgba(22, 30, 36, .08);
}
.ufiles-home-tab:focus-visible {
  outline: 3px solid #99adff;
  outline-offset: 2px;
}
.my-files-page__head > .ufiles-home-tabs { margin: 0; }
@media (max-width: 480px) {
  .ufiles-home-tab { padding-left: 10px; padding-right: 10px; }
}

/* uFiles 195: My Files follows the same left-aligned logo rule as public pages. */
.my-files-auth-card .brand-block {
  text-align: left;
}
.my-files-auth-card .page-logo-link,
.my-files-page .page-logo-link {
  justify-self: start;
  align-self: start;
  justify-content: flex-start;
  margin-left: 0;
  margin-right: auto;
}

.my-files-auth-card .my-files-login-submit {
  width: 100%;
}
.my-files-access-note {
  margin: 12px 0 0;
  text-align: center;
}
.my-files-page {
  width: min(1120px, 100%);
  max-width: 1120px;
  padding: 32px;
  border-top: 4px solid var(--ug-brand-blue);
}
.my-files-page__head {
  display: grid;
  gap: 24px;
}
.my-files-page__identity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.my-files-page__identity h1 {
  margin: 0 0 8px;
}
.my-files-page__identity form {
  flex: 0 0 auto;
}
.my-files-page__session-note {
  margin: 20px 0 0;
}
.my-files-messages {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.my-files-message {
  padding: 12px 16px;
  border: 1px solid #99adff;
  border-radius: 8px;
  background: var(--ug-brand-blue-10);
  color: #000;
}
.my-files-message--error {
  border-color: #f50f50;
  background: #ffbaca;
}
.my-files-message--success {
  border-color: #22aa33;
  background: #c2e5c2;
}
.my-files-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.my-files-publication {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #d3d7db;
  border-radius: 12px;
  background: #fff;
}
.my-files-publication__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.my-files-publication__title {
  color: #000;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.my-files-publication__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  color: #51606e;
  font-size: 13px;
}
.my-files-publication__files {
  display: grid;
  gap: 8px;
}
.my-files-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 16px;
  padding: 12px;
  border-radius: 8px;
  background: #e9ebed;
}
.my-files-file--deleted {
  opacity: .68;
}
.my-files-file__name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.my-files-file__size {
  color: #51606e;
  white-space: nowrap;
}
.my-files-delete-form,
.my-files-delete-action {
  width: 100%;
}
.my-files-delete-action,
button.my-files-delete-action {
  min-height: 48px;
  border-radius: 8px;
  border-color: #f50f50;
  background: #f50f50;
  color: #fff;
  padding: 12px 20px;
}
.my-files-delete-action:hover,
button.my-files-delete-action:hover {
  border-color: #cf004c;
  background: #cf004c;
}
.my-files-publication__removed {
  padding: 12px 16px;
  border-radius: 8px;
  background: #e9ebed;
  color: #51606e;
}
.my-files-empty {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #d3d7db;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.my-files-empty p {
  margin: 8px 0 0;
}
.my-files-page__footer-actions {
  display: grid;
  margin-top: 24px;
}
.my-files-pagination {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

@media (max-width: 640px) {
  .download-page {
    padding: 24px 20px;
  }
  .download-item {
    grid-template-columns: 1fr;
  }
  .download-item > .help,
  .download-item > .badge {
    justify-self: start;
  }
  .my-files-page {
    padding: 24px 20px;
  }
  .my-files-page__identity,
  .my-files-publication__top,
  .my-files-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .my-files-page__identity form,
  .my-files-page__identity .btn,
  .my-files-publication__top .ufiles-secondary-action,
  .my-files-pagination .ufiles-secondary-action {
    width: 100%;
  }
  .my-files-file {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .my-files-file .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}


/* uFiles 192: map public status tags and common public spacing to the UserGate palette/grid. */
.download-page .badge,
.my-files-page .badge {
  padding: 4px 8px;
  border: 1px solid #d3d7db;
  background: #e9ebed;
  color: #25384a;
}
.download-page .badge.scanning,
.download-page .badge.pending,
.download-page .badge.uploaded,
.my-files-page .badge.scanning,
.my-files-page .badge.pending,
.my-files-page .badge.uploaded {
  border-color: #ccd6ff;
  background: #e5ebff;
  color: #0033ff;
}
.download-page .badge.conditional_safe,
.download-page .badge.medium,
.download-page .badge.inconclusive,
.my-files-page .badge.conditional_safe,
.my-files-page .badge.medium,
.my-files-page .badge.inconclusive {
  border-color: #ffea64;
  background: #fff6bd;
  color: #7c8500;
}
.download-page .badge.conditional_unsafe,
.download-page .badge.high,
.download-page .badge.infected,
.download-page .badge.error,
.download-page .badge.deleted,
.download-page .badge.expired,
.my-files-page .badge.conditional_unsafe,
.my-files-page .badge.high,
.my-files-page .badge.infected,
.my-files-page .badge.error,
.my-files-page .badge.deleted,
.my-files-page .badge.expired {
  border-color: #fc5f84;
  background: #ffbaca;
  color: #990046;
}
.download-page .badge.published,
.download-page .badge.none,
.download-page .badge.clean,
.download-page .badge.segmented_clean,
.my-files-page .badge.published,
.my-files-page .badge.none,
.my-files-page .badge.clean,
.my-files-page .badge.segmented_clean {
  border-color: #6fc373;
  background: #c2e5c2;
  color: #005a00;
}

.public-shell {
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.public-header {
  padding-bottom: 16px;
}
.public-main {
  padding: 32px 0;
}
.public-footer {
  gap: 20px;
  padding-top: 16px;
}
.portal-card {
  border-radius: 16px;
}
.portal-card__body {
  padding-bottom: 32px;
}
.form-grid {
  gap: 20px;
}
.control {
  min-height: 48px;
  border-radius: 8px;
  padding: 12px 16px;
}
.control:hover {
  border-color: #a8afb7;
}
.control:focus {
  border-color: #0033ff;
  box-shadow: 0 0 0 4px #ccd6ff;
}

/* uFiles 198: responsive full-width exchange workspace and desktop context menus. */
.public-main:has(.exchange-workspace-card) {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  padding: 16px;
  place-items: stretch;
}
.exchange-workspace-card {
  width: calc(100vw - 32px);
  max-width: none;
  justify-self: center;
  min-height: min(860px, calc(100vh - 150px));
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(15, 23, 42, .10);
}
.exchange-workspace-head {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ug-line);
}
.exchange-workspace-head__brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 22px;
}
.exchange-workspace-head .page-logo-link {
  margin: 0;
  flex: 0 0 auto;
}
.exchange-workspace-head .captive-logo { width: 126px; }
.exchange-workspace-head__title { min-width: 0; }
.exchange-workspace-head__title h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.exchange-workspace-head__title p {
  margin: 5px 0 0;
  max-width: 620px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ug-muted);
  font-size: 13px;
}
.exchange-workspace-head__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.exchange-workspace-head__actions form { margin: 0; }
.exchange-workspace-head__actions .btn { min-height: 40px; }
.exchange-workspace-body {
  min-height: 690px;
  display: grid;
  grid-template-columns: clamp(220px, 15vw, 300px) minmax(0, 1fr) clamp(280px, 18vw, 360px);
  background: #fff;
}
.exchange-workspace-sidebar {
  min-width: 0;
  padding: 18px 12px 20px;
  border-right: 1px solid var(--ug-line);
  background: #fafbfb;
}
.exchange-workspace-sidebar__head,
.exchange-workspace-activity__head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 10px;
}
.exchange-workspace-sidebar__head strong,
.exchange-workspace-activity__head strong { font-size: 13px; }
.workspace-context-hint {
  display: block;
  padding: 0 8px 9px;
  color: #8a9590;
  font-size: 10px;
  line-height: 1.3;
}
.workspace-context-hint--toolbar {
  align-self: center;
  padding: 0 0 0 5px;
  white-space: nowrap;
}
.workspace-icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ug-line-strong);
  border-radius: 8px;
  background: #fff;
  color: #232a27;
  font-size: 19px;
  line-height: 1;
}
.workspace-icon-button:hover { border-color: #7f8a85; background: #f6f7f7; }
.exchange-folder-tree { display: grid; gap: 3px; }
.exchange-folder-tree__item {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #28312d;
  display: grid;
  gap: 1px;
  justify-items: start;
  text-align: left;
  padding: 7px 9px 7px calc(9px + var(--folder-depth, 0) * 14px);
}
.exchange-folder-tree__item:hover { background: #f0f2f1; }
.exchange-folder-tree__item.is-active { background: #e9edf0; color: #111827; font-weight: 700; }
.exchange-folder-tree__item.is-drop-target { outline: 2px solid #0033ff; outline-offset: -2px; }
.exchange-folder-tree__item--root { display: block; }
.exchange-folder-tree__name {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.exchange-folder-tree__tags {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7b8681;
  font-size: 10px;
  font-weight: 500;
}
.exchange-workspace-main {
  min-width: 0;
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
}
.exchange-workspace-breadcrumbs {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  color: #909a95;
  scrollbar-width: thin;
}
.exchange-workspace-breadcrumbs button {
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: #344039;
  font-size: 13px;
  white-space: nowrap;
}
.exchange-workspace-breadcrumbs button:last-child { color: #111827; font-weight: 700; }
.exchange-workspace-toolbar {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 16px;
}
.exchange-workspace-toolbar__primary,
.exchange-workspace-toolbar__selection {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.workspace-toolbar-button,
.exchange-workspace-toolbar .btn { min-height: 40px; }
.exchange-workspace-toolbar .ufiles-primary-action {
  min-height: 40px;
  width: auto;
  padding: 9px 15px;
}
.exchange-selection-count {
  min-width: max-content;
  color: #505a55;
  font-size: 12px;
  font-weight: 700;
  padding-right: 2px;
}
.workspace-toolbar-field {
  display: grid;
  gap: 2px;
}
.workspace-toolbar-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.workspace-toolbar-field .control {
  min-height: 40px;
  height: 40px;
  max-width: 180px;
  padding: 7px 34px 7px 10px;
  font-size: 13px;
}
.exchange-workspace-message {
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid #cdd5d1;
  border-radius: 8px;
  background: #f8faf9;
  color: #36413c;
  font-size: 12px;
}
.exchange-workspace-message.is-error {
  border-color: #efb3b3;
  background: #fff4f4;
  color: #8b2020;
}
.exchange-workspace-progress { margin: 0 0 12px; }
.exchange-workspace-progress__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--ug-muted);
}
.exchange-workspace-progress__line strong { color: #111827; }
.exchange-workspace-drop {
  position: relative;
  flex: 1 1 auto;
  min-height: 510px;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.exchange-workspace-list-head,
.exchange-workspace-row {
  display: grid;
  grid-template-columns: 34px minmax(240px, 1.9fr) minmax(180px, 1fr) 110px 150px;
  align-items: center;
  gap: 10px;
}
.exchange-workspace-list-head {
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--ug-line);
  background: #fafbfb;
  color: #7b8681;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.exchange-workspace-row {
  min-height: 52px;
  padding: 7px 12px;
  border-bottom: 1px solid #edf0ef;
  transition: background .12s;
}
.exchange-workspace-row:last-child { border-bottom: 0; }
.exchange-workspace-row:hover { background: #fafbfb; }
.exchange-workspace-row:focus-visible { outline: 2px solid #0033ff; outline-offset: -2px; }
.exchange-workspace-row.is-selected { background: #eef3ff; }
.exchange-workspace-row.is-drop-target { box-shadow: inset 0 0 0 2px #0033ff; }
.exchange-workspace-row__selector { display: grid; place-items: center; }
.exchange-workspace-row__selector input { width: 16px; height: 16px; margin: 0; }
.exchange-workspace-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #18201c;
  padding: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}
.exchange-workspace-name:hover { color: #18201c; text-decoration: none; }
.exchange-workspace-name > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exchange-workspace-folder-icon {
  width: 21px;
  height: 16px;
  flex: 0 0 auto;
  position: relative;
  border-radius: 3px;
  background: #d9dee1;
}
.exchange-workspace-folder-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -4px;
  width: 9px;
  height: 5px;
  border-radius: 3px 3px 0 0;
  background: #d9dee1;
}
.exchange-workspace-file-icon {
  width: 18px;
  height: 22px;
  flex: 0 0 auto;
  border: 1.5px solid #8f9994;
  border-radius: 3px;
  position: relative;
}
.exchange-workspace-file-icon::after {
  content: "";
  position: absolute;
  right: -1.5px;
  top: -1.5px;
  width: 6px;
  height: 6px;
  border-left: 1.5px solid #8f9994;
  border-bottom: 1.5px solid #8f9994;
  background: #fff;
}
.exchange-workspace-tags {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.workspace-tag,
.workspace-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 150px;
  border: 1px solid #d4dad7;
  border-radius: 999px;
  background: #f6f7f7;
  color: #44504a;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}
.workspace-status--new { background: #f4f5f6; }
.workspace-status--in_progress { border-color: #a9c1ff; background: #edf2ff; color: #183d9a; }
.workspace-status--processed { border-color: #a8d9bc; background: #edf8f1; color: #17613a; }
.workspace-status--needs_changes { border-color: #efc1b2; background: #fff2ee; color: #9a3d20; }
.workspace-muted { color: #7b8681; font-size: 12px; }
.exchange-workspace-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.workspace-row-action {
  border: 0;
  background: transparent;
  color: #52605a;
  padding: 4px 2px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
a.workspace-row-action:hover,
.workspace-row-action:hover { color: #111827; text-decoration: none; }
.workspace-row-action--danger:hover { color: #a52626; }
.exchange-workspace-empty {
  min-height: 380px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 30px;
  text-align: center;
}
.exchange-workspace-empty strong { font-size: 15px; }
.exchange-workspace-empty span { max-width: 360px; color: var(--ug-muted); font-size: 12px; line-height: 1.5; }
.exchange-workspace-drop-overlay {
  position: absolute;
  inset: 8px;
  z-index: 10;
  border: 2px dashed #0033ff;
  border-radius: 10px;
  background: rgba(242, 246, 255, .94);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.exchange-workspace-drop-overlay > div { text-align: center; }
.exchange-workspace-drop-overlay strong { display: block; margin-bottom: 5px; font-size: 16px; }
.exchange-workspace-drop-overlay span { color: var(--ug-muted); font-size: 12px; }
.exchange-workspace-activity {
  min-width: 0;
  padding: 18px 12px 20px;
  border-left: 1px solid var(--ug-line);
  background: #fafbfb;
}
.exchange-workspace-activity__head > div { display: grid; gap: 2px; }
.exchange-workspace-activity__head span { color: #85908b; font-size: 10px; }
.exchange-workspace-activity__close { display: none; }
.exchange-workspace-activity__list { display: grid; gap: 5px; }
.exchange-workspace-activity__item {
  display: grid;
  gap: 3px;
  padding: 10px 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e7ebe9;
}
.exchange-workspace-activity__item strong { font-size: 12px; }
.exchange-workspace-activity__item span { color: #47534d; font-size: 11px; overflow-wrap: anywhere; }
.exchange-workspace-activity__item small { color: #89938e; font-size: 10px; }
.exchange-workspace-activity__empty { padding: 18px 9px; color: #84908a; font-size: 11px; line-height: 1.5; }
.exchange-workspace-head__activity-toggle { display: none; }
.exchange-workspace-context-menu {
  position: fixed;
  z-index: 140;
  min-width: 230px;
  max-width: min(310px, calc(100vw - 16px));
  padding: 6px;
  border: 1px solid #cfd5d2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, .18);
  color: #18201c;
}
.exchange-workspace-context-menu[hidden] { display: none !important; }
.workspace-context-menu__label {
  max-width: 286px;
  padding: 7px 10px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a8580;
  font-size: 10px;
  font-weight: 700;
}
.workspace-context-menu__separator {
  height: 1px;
  margin: 5px 4px;
  background: #e6eae8;
}
.workspace-context-menu__entry { position: relative; }
.workspace-context-menu__item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #26302b;
  padding: 7px 10px 7px calc(10px + var(--context-depth, 0) * 12px);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}
.workspace-context-menu__item:hover,
.workspace-context-menu__item:focus-visible {
  outline: none;
  background: #f0f3f2;
}
.workspace-context-menu__item:disabled {
  cursor: default;
  color: #9ca5a1;
  background: transparent;
}
.workspace-context-menu__item.is-danger { color: #a52626; }
.workspace-context-menu__item.is-danger:hover,
.workspace-context-menu__item.is-danger:focus-visible { background: #fff0f0; }
.workspace-context-menu__item--submenu { justify-content: space-between; }
.workspace-context-menu__arrow {
  flex: 0 0 auto;
  color: #78837e;
  font-size: 18px;
  line-height: 1;
}
.workspace-context-menu__submenu {
  position: absolute;
  z-index: 1;
  top: -6px;
  left: calc(100% + 5px);
  width: max-content;
  min-width: 220px;
  max-width: min(330px, calc(100vw - 24px));
  max-height: min(430px, calc(100vh - 24px));
  display: none;
  overflow: auto;
  padding: 6px;
  border: 1px solid #cfd5d2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .16);
  scrollbar-width: thin;
}
.workspace-context-menu__entry:hover > .workspace-context-menu__submenu,
.workspace-context-menu__entry:focus-within > .workspace-context-menu__submenu,
.workspace-context-menu__entry.is-open > .workspace-context-menu__submenu { display: block; }
.exchange-workspace-context-menu.opens-left .workspace-context-menu__submenu {
  left: auto;
  right: calc(100% + 5px);
}
.exchange-workspace-context-menu.opens-up .workspace-context-menu__submenu {
  top: auto;
  bottom: -6px;
}
.exchange-workspace-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--ug-line);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 20px 70px rgba(15, 23, 42, .18);
}
.exchange-workspace-dialog::backdrop { background: rgba(17, 24, 39, .28); }
.exchange-workspace-dialog__form { display: grid; gap: 18px; padding: 20px; }
.exchange-workspace-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.exchange-workspace-dialog__head strong { font-size: 17px; }
.exchange-workspace-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.exchange-workspace-dialog__actions .ufiles-primary-action { width: auto; min-height: 42px; padding: 10px 18px; }
.exchange-workspace-dialog__actions .btn { min-height: 42px; }

@media (max-width: 1180px) {
  .exchange-workspace-body { grid-template-columns: 220px minmax(0, 1fr); }
  .exchange-workspace-activity {
    position: fixed;
    z-index: 50;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: min(360px, calc(100vw - 40px));
    border: 1px solid var(--ug-line);
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .18);
    transform: translateX(calc(100% + 40px));
    transition: transform .18s ease;
    overflow-y: auto;
  }
  .exchange-workspace-activity.is-open { transform: translateX(0); }
  .exchange-workspace-activity__close,
  .exchange-workspace-head__activity-toggle { display: inline-grid; }
  .exchange-workspace-head__activity-toggle { display: inline-flex; }
  .exchange-workspace-list-head,
  .exchange-workspace-row {
    grid-template-columns: 34px minmax(200px, 1.7fr) minmax(150px, 1fr) 90px 125px;
  }
}

@media (max-width: 820px) {
  .public-shell { padding-left: 10px; padding-right: 10px; }
  .public-main:has(.exchange-workspace-card) { padding: 8px; }
  .exchange-workspace-card { width: calc(100vw - 16px); min-height: calc(100vh - 80px); border-radius: 14px; }
  .exchange-workspace-head { align-items: flex-start; padding: 16px; }
  .exchange-workspace-head__brand { gap: 14px; }
  .exchange-workspace-head .captive-logo { width: 104px; }
  .exchange-workspace-head__title h1 { font-size: 19px; }
  .exchange-workspace-head__title p { max-width: 42vw; }
  .exchange-workspace-body { grid-template-columns: 1fr; min-height: 0; }
  .exchange-workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ug-line);
    padding: 10px 12px;
  }
  .exchange-workspace-sidebar__head { padding-bottom: 6px; }
  .exchange-workspace-sidebar > .workspace-context-hint { display: none; }
  .exchange-folder-tree {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .exchange-folder-tree__item {
    width: auto;
    min-width: max-content;
    min-height: 34px;
    padding: 6px 9px;
  }
  .exchange-folder-tree__tags { display: none; }
  .exchange-workspace-main { padding: 14px 12px 18px; }
  .exchange-workspace-toolbar { align-items: flex-start; flex-direction: column; }
  .exchange-workspace-toolbar__selection { width: 100%; }
  .workspace-toolbar-field { flex: 1 1 150px; }
  .workspace-toolbar-field .control { width: 100%; max-width: none; }
  .exchange-workspace-list-head { display: none; }
  .exchange-workspace-drop { min-height: 430px; border-radius: 10px; }
  .exchange-workspace-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 62px;
    padding: 9px 10px;
  }
  .exchange-workspace-row > :nth-child(3) { grid-column: 2 / 4; }
  .exchange-workspace-row > :nth-child(4),
  .exchange-workspace-row > :nth-child(5) { display: none; }
  .workspace-context-hint--toolbar { display: none; }
  .exchange-workspace-name { font-size: 13px; }
}

@media (max-width: 560px) {
  .exchange-workspace-head { display: grid; gap: 12px; }
  .exchange-workspace-head__brand { align-items: flex-start; }
  .exchange-workspace-head__title p { max-width: calc(100vw - 170px); }
  .exchange-workspace-head__actions { justify-content: flex-start; }
  .exchange-workspace-head__actions .btn { min-height: 38px; padding-left: 11px; padding-right: 11px; }
  .exchange-workspace-toolbar__primary { width: 100%; }
  .exchange-workspace-toolbar__primary > * { flex: 1 1 0; }
  .exchange-workspace-toolbar__selection { align-items: stretch; }
  .exchange-selection-count { width: 100%; }
  .exchange-workspace-toolbar__selection > .btn { flex: 1 1 120px; }
}

/* Release 223: publication controls and session-aware actions. */
.ufiles-publication-options { align-items: start; }
.ufiles-phone-row { width: 100%; }
.my-files-page__footer-actions .ufiles-primary-action .button-icon { display: inline-flex; flex: 0 0 auto; }


/* Release 224: publication type and download limit share one desktop row. */
.ufiles-publication-options,
.ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"] {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start !important;
}
.ufiles-publication-options > .form-row,
.ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"] > .form-row {
  min-width: 0 !important;
  width: 100% !important;
}
@media (max-width: 640px) {
  .ufiles-publication-options,
  .ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"],
  .ufiles-publication-form-layout > .publication-meta-layout[data-ufiles-field-role="publication-metadata"].is-permanent {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Release 225: authoritative publication controls and authenticated upload modal. */
.ufiles-upload-card .ufiles-publication-options {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 15px !important;
  width: 100% !important;
}
.ufiles-upload-card .ufiles-publication-options > [data-ufiles-field-role="retention"] {
  grid-column: 1 !important;
}
.ufiles-upload-card .ufiles-publication-options > [data-ufiles-field-role="download-limit"] {
  grid-column: 2 !important;
}
.verify-call-panel--authenticated {
  text-align: center;
}
@media (max-width: 640px) {
  .ufiles-upload-card .ufiles-publication-options {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .ufiles-upload-card .ufiles-publication-options > [data-ufiles-field-role="retention"],
  .ufiles-upload-card .ufiles-publication-options > [data-ufiles-field-role="download-limit"] {
    grid-column: 1 !important;
  }
}

/* uFiles 238: My Files keeps collaborative workspaces as compact cards. */
.my-files-workspace-summary {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ug-muted);
  font-size: 12px;
}
.my-files-workspace-summary span {
  padding: 4px 8px;
  border: 1px solid var(--ug-line);
  border-radius: 999px;
  background: #f7f9f8;
}

/* uFiles 246: compact and aligned Office Online Server settings. */
.office-settings-panel {
  overflow: hidden;
}
.office-settings-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}
.office-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.office-settings-field {
  min-width: 0;
}
.office-settings-field--wide {
  grid-column: 1 / -1;
}
.office-settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--ug-line);
  border-radius: 12px;
  background: #fff;
}
.office-settings-switch-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.office-settings-switch-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ug-blue);
}
.office-settings-form .help {
  max-width: 920px;
  line-height: 1.4;
}
.office-settings-actions {
  margin-top: 2px;
}
.office-settings-actions > .btn {
  min-width: 150px;
}
.office-discovery-actions {
  display: grid;
  gap: 16px;
  padding: 20px;
}
.office-discovery-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.office-discovery-summary > span {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--ug-line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}
.office-discovery-summary strong {
  color: var(--ug-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
@media (max-width: 760px) {
  .office-settings-grid {
    grid-template-columns: 1fr;
  }
  .office-settings-switch-row {
    align-items: flex-start;
  }
  .office-settings-field--wide {
    grid-column: auto;
  }
}
