:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #65716a;
  --line: #dce2de;
  --line-strong: #c6cec8;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --sidebar: #18221e;
  --sidebar-2: #233029;
  --green: #19734a;
  --green-dark: #105536;
  --green-soft: #e3f3ea;
  --amber: #9a650b;
  --amber-soft: #fff0cd;
  --red: #b13b3b;
  --red-soft: #fbe7e5;
  --blue: #286f9b;
  --blue-soft: #e3f0f7;
  --shadow: 0 16px 42px rgba(22, 35, 28, 0.12);
  --sidebar-width: 244px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: #eef5f1; padding: 24px 14px 16px; display: flex; flex-direction: column; z-index: 40; }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; }
.sidebar .brand { padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--green); }
.brand-mark.large { width: 50px; height: 50px; font-size: 23px; }
.brand span:last-child { min-width: 0; display: flex; flex-direction: column; }
.brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .98rem; }
.brand small { color: #9fb0a7; font-size: .72rem; margin-top: 2px; }
.primary-nav { display: flex; flex-direction: column; gap: 4px; padding-top: 20px; overflow-y: auto; }
.primary-nav a { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border-radius: 6px; color: #b9c8c0; font-size: .9rem; }
.primary-nav a i { width: 18px; font-size: 18px; text-align: center; }
.primary-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.primary-nav a.active { color: #fff; background: var(--green); }
.nav-label { color: #7e9187; font-size: .68rem; text-transform: uppercase; font-weight: 700; margin: 20px 12px 6px; }
.sidebar-account { margin-top: auto; padding: 14px 5px 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; }
.sidebar-account > span { min-width: 0; display: flex; flex-direction: column; }
.sidebar-account strong { font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account small { font-size: .68rem; color: #91a39a; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--green-soft); color: var(--green-dark); font-weight: 750; }
.avatar.small { width: 30px; height: 30px; flex-basis: 30px; }
.workspace { min-width: 0; }
.content { width: min(100%, 1540px); margin: 0 auto; padding: 32px 38px 60px; }
.mobile-bar { display: none; }

.page-header { min-height: 88px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 3px 0 5px; font-size: clamp(1.65rem, 3vw, 2.15rem); line-height: 1.15; }
.page-header p { margin: 0; color: var(--muted); max-width: 660px; }
.eyebrow { color: var(--green); font-size: .71rem; text-transform: uppercase; font-weight: 800; margin: 0; }
.file-page-header { align-items: center; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); font-size: .77rem; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 5px; }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs > i { font-size: 12px; }
.search-form { width: min(360px, 40vw); height: 42px; position: relative; }
.search-form i { position: absolute; left: 13px; top: 13px; color: var(--muted); }
.search-form input { width: 100%; height: 100%; padding: 0 14px 0 38px; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; }

.button, .icon-button { border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
.button { min-height: 40px; padding: 0 15px; border-radius: 6px; font-size: .85rem; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--ink); background: var(--paper); border-color: var(--line-strong); }
.button.secondary:hover { border-color: var(--green); color: var(--green); }
.button.ghost { background: transparent; color: var(--muted); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.wide { width: 100%; }
.button.small { min-height: 33px; padding: 0 10px; font-size: .75rem; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.icon-button:hover, .icon-button.active { background: #e8eeea; color: var(--ink); }
.icon-button.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-button.inverse { color: #b7c5bd; }
.icon-button.inverse:hover { background: rgba(255,255,255,.08); color: #fff; }
.command-group, .inline-actions, .view-controls { display: flex; align-items: center; gap: 8px; }
.selection-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: 5px; padding-left: 8px; border-left: 1px solid var(--line); }
.segmented { height: 38px; display: flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); }
.segmented .icon-button { width: 32px; height: 32px; flex-basis: 32px; }
select, input, textarea { color: var(--ink); border: 1px solid var(--line-strong); background: var(--paper); border-radius: 5px; outline: none; }
select { min-height: 38px; padding: 0 30px 0 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(25,115,74,.12); }

.cloud-overview { margin: -8px 0 22px; padding: 18px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 240px minmax(200px, 1fr) minmax(360px, 1.8fr); align-items: center; gap: 22px; }
.quota-copy { display: flex; flex-direction: column; }
.quota-copy span, .section-kicker { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.quota-copy strong { font-size: 1.25rem; margin-top: 5px; }
.quota-copy small { color: var(--muted); font-size: .8rem; }
.quota-progress { width: 100%; height: 8px; border: 0; overflow: hidden; appearance: none; background: #dfe7e2; border-radius: 5px; }
.quota-progress::-webkit-progress-bar { background: #dfe7e2; border-radius: 5px; }
.quota-progress::-webkit-progress-value { background: var(--green); border-radius: 5px; }
.quota-progress::-moz-progress-bar { background: var(--green); border-radius: 5px; }
.recent-strip { min-width: 0; display: flex; align-items: center; gap: 8px; overflow-x: auto; }
.recent-strip > span { flex: 0 0 auto; margin-right: 3px; }
.recent-strip a { flex: 0 0 auto; max-width: 190px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); background: var(--paper); border-radius: 5px; }
.recent-strip a i { color: var(--blue); }
.recent-strip a span { min-width: 0; display: flex; flex-direction: column; font-size: .75rem; }
.recent-strip a span:first-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-strip a small { color: var(--muted); font-size: .65rem; }

.file-surface, .data-section { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.file-toolbar { min-height: 62px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.drop-zone.dragging { outline: 2px dashed var(--green); outline-offset: -8px; background: var(--green-soft); }
.file-table, .data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table th, .data-table th { height: 42px; padding: 0 14px; text-align: left; color: var(--muted); background: #f8faf9; border-bottom: 1px solid var(--line); font-size: .7rem; text-transform: uppercase; font-weight: 800; }
.file-table td, .data-table td { height: 64px; padding: 8px 14px; border-bottom: 1px solid #e9eeeb; color: #3f4b44; font-size: .82rem; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.file-table tr:last-child td, .data-table tr:last-child td { border-bottom: 0; }
.file-table tbody tr:hover, .data-table tbody tr:hover { background: #fafcfb; }
.file-table th:nth-child(2) { width: 40%; }
.file-table th:nth-child(3) { width: 21%; }
.file-table th:nth-child(4) { width: 12%; }
.file-table th:nth-child(5) { width: 18%; }
.file-table .check-cell { width: 44px; padding-left: 16px; padding-right: 4px; }
.file-table .row-actions { width: 52px; }
.file-table input[type=checkbox], .file-tile input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; }
.file-name { min-width: 0; display: flex; align-items: center; gap: 11px; color: var(--ink); }
.file-name > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.file-name > span:last-child > :first-child, .file-name > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-name small, .data-table small { color: var(--muted); font-size: .67rem; margin-top: 3px; display: block; }
.file-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; font-size: 19px; background: var(--blue-soft); color: var(--blue); }
.file-icon img { width: 100%; height: 100%; object-fit: cover; }
.file-icon.folder { color: var(--amber); background: var(--amber-soft); }
.file-icon.image { color: var(--green); background: var(--green-soft); }
.file-icon.video, .file-icon.audio { color: #7654a6; background: #eee8f7; }
.file-icon.pdf { color: var(--red); background: var(--red-soft); }

.file-grid { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 10px; }
.file-tile { min-width: 0; position: relative; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); overflow: hidden; }
.file-tile:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(30,50,40,.07); }
.file-tile > input { position: absolute; top: 9px; left: 9px; z-index: 2; }
.file-tile > .icon-button { position: absolute; right: 5px; bottom: 5px; }
.tile-preview { height: 118px; display: grid; place-items: center; background: #eef3f0; color: var(--green); font-size: 42px; }
.tile-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-tile > div { min-width: 0; padding: 11px 44px 12px 11px; display: flex; flex-direction: column; }
.file-tile strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.file-tile small { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.empty-state { min-height: 260px; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.empty-state > i { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 25px; }
.empty-state h2 { margin: 14px 0 3px; color: var(--ink); font-size: 1rem; }
.empty-state p { margin: 0; font-size: .82rem; }

.section-heading { min-height: 64px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 1rem; }
.data-table th:first-child, .data-table td:first-child { padding-left: 18px; }
.data-table td strong { color: var(--ink); }
.data-table.compact td { height: 48px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell > span:last-child { display: flex; flex-direction: column; }
.role-pill, .default-badge { display: inline-flex; padding: 3px 7px; border-radius: 4px; background: #edf1ef; color: #46534c; font-size: .68rem; font-weight: 700; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 4px; text-transform: capitalize; font-size: .67rem; font-weight: 800; }
.status-pill.online { background: var(--green-soft); color: var(--green-dark); }
.status-pill.offline { background: var(--red-soft); color: var(--red); }
.status-pill.unknown { background: #edf1ef; color: var(--muted); }
.status-pill.degraded { background: var(--amber-soft); color: var(--amber); }
.health-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid #bedcca; color: var(--green-dark); background: var(--green-soft); border-radius: 5px; font-size: .72rem; font-weight: 700; }
.health-badge span, .status-dot { width: 7px; height: 7px; background: #2cb06c; border-radius: 50%; }
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--sidebar); color: white; border-radius: 8px; margin-bottom: 24px; }
.stat-band > div { min-width: 0; padding: 22px; display: flex; align-items: center; gap: 13px; border-right: 1px solid rgba(255,255,255,.1); }
.stat-band > div:last-child { border-right: 0; }
.stat-band i { color: #7cd7a7; font-size: 22px; }
.stat-band span { display: flex; flex-direction: column; color: #aebdb5; font-size: .7rem; text-transform: uppercase; font-weight: 700; }
.stat-band strong { color: #fff; font-size: 1.35rem; margin-top: 2px; }
.storage-health-list { padding: 0 18px; }
.storage-health { min-height: 78px; display: grid; grid-template-columns: auto minmax(160px,1fr) auto minmax(130px, auto); align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.storage-health:last-child { border-bottom: 0; }
.storage-icon { width: 42px; height: 42px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border-radius: 7px; font-size: 19px; }
.storage-health > div:nth-child(2), .storage-free { display: flex; flex-direction: column; }
.storage-health small, .storage-row small { color: var(--muted); margin-top: 3px; }
.storage-free span { color: var(--muted); font-size: .67rem; text-transform: uppercase; }
.storage-list { border-top: 1px solid var(--line); }
.storage-row { min-height: 104px; padding: 18px 4px; display: grid; grid-template-columns: auto minmax(220px,1fr) auto; gap: 15px; align-items: center; border-bottom: 1px solid var(--line); }
.storage-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.storage-main > div { display: flex; align-items: center; gap: 8px; }
.storage-main code { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--green-dark); font-size: .78rem; }
.default-badge { background: var(--amber-soft); color: var(--amber); }
.share-created { margin-bottom: 20px; padding: 15px 17px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; color: var(--green-dark); background: var(--green-soft); border: 1px solid #badcc8; border-radius: 7px; }
.share-created > i { font-size: 24px; }
.share-created p { margin: 2px 0 6px; font-size: .78rem; }
.share-created code { display: block; color: var(--ink); word-break: break-all; }
.permission-dots { display: flex; gap: 3px; }
.permission-dots span { width: 23px; height: 23px; display: grid; place-items: center; background: #e9eeeb; color: #88928d; border-radius: 4px; font-size: .62rem; font-weight: 800; }
.permission-dots span.on { background: var(--green-soft); color: var(--green); }
.settings-band { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(260px, .8fr); gap: 34px; border-top: 1px solid var(--line); padding-top: 24px; }
.settings-form { max-width: 620px; }
.runtime-facts { border-left: 1px solid var(--line); padding-left: 30px; }
.runtime-facts > div { min-height: 76px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.runtime-facts i { color: var(--green); font-size: 20px; }
.runtime-facts span { display: flex; flex-direction: column; color: var(--muted); font-size: .72rem; }
.runtime-facts strong { margin-top: 2px; color: var(--ink); font-size: .85rem; }

dialog { width: min(520px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); color: var(--ink); }
dialog::backdrop { background: rgba(15, 25, 20, .55); backdrop-filter: blur(2px); }
.dialog-form { padding: 0 22px 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog-form header { min-height: 64px; margin: 0 -4px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-form h2 { margin: 0; font-size: 1.05rem; }
.dialog-form p { color: var(--muted); margin: 0; }
.dialog-form footer { padding-top: 6px; display: flex; justify-content: flex-end; gap: 8px; }
.dialog-form label, .stack-form label { display: flex; flex-direction: column; gap: 6px; color: #354139; font-size: .78rem; font-weight: 700; }
.dialog-form input, .stack-form input, .dialog-form select, .stack-form select { width: 100%; min-height: 42px; padding: 0 11px; }
.dialog-form small, .stack-form small { color: var(--muted); font-size: .67rem; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-label { flex-direction: row !important; align-items: center; }
.check-label input { width: 17px; min-height: 17px; accent-color: var(--green); }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: 6px; }
legend { padding: 0 6px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 7px; }
.permission-grid label { flex-direction: row; align-items: center; }
.permission-grid input { width: 16px; min-height: 16px; accent-color: var(--green); }
.action-list { display: flex; flex-direction: column; }
.action-list button { min-height: 45px; padding: 0 9px; border: 0; border-bottom: 1px solid var(--line); background: transparent; display: flex; align-items: center; gap: 11px; cursor: pointer; text-align: left; }
.action-list button:hover { background: var(--canvas); }
.action-list .danger-text { color: var(--red); }
.upload-picker { min-height: 112px; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); background: var(--canvas); cursor: pointer; }
.upload-picker i { color: var(--green); font-size: 27px; }
.upload-list { max-height: 340px; overflow-y: auto; }
.upload-row { padding: 10px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; border-bottom: 1px solid var(--line); }
.upload-row > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.upload-row strong { font-size: .77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-row small { color: var(--muted); font-size: .65rem; }
.upload-progress { grid-column: 1 / -1; width: 100%; height: 5px; border: 0; overflow: hidden; appearance: none; background: #e2e8e4; border-radius: 4px; }
.upload-progress::-webkit-progress-bar { background: #e2e8e4; }
.upload-progress::-webkit-progress-value { background: var(--green); }
.upload-progress::-moz-progress-bar { background: var(--green); }
.conflict-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.conflict-actions .ghost { grid-column: 1 / -1; }
.preview-dialog { width: min(900px, calc(100vw - 28px)); background: #111814; }
.preview-dialog .dialog-form { padding-bottom: 18px; }
.preview-dialog header { color: #fff; border-color: rgba(255,255,255,.12); }
.preview-dialog header .icon-button { color: #fff; }
.preview-dialog video, .preview-dialog img { width: 100%; max-height: 72vh; object-fit: contain; background: #080c0a; border-radius: 5px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 360px; padding: 11px 14px; display: flex; align-items: center; gap: 9px; color: #fff; background: var(--sidebar); border-radius: 6px; box-shadow: var(--shadow); font-size: .8rem; }
.toast.error { background: #812f2f; }
.alert { padding: 11px 13px; display: flex; align-items: flex-start; gap: 9px; border-radius: 6px; font-size: .78rem; }
.alert.error { color: #792c2c; background: var(--red-soft); border: 1px solid #efc7c3; }

.auth-body { min-height: 100vh; background: var(--sidebar); }
.login-shell, .setup-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .9fr) minmax(430px, 1.1fr); }
.login-brand, .setup-brand { min-height: 100%; padding: clamp(42px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: var(--sidebar); }
.login-brand .eyebrow, .setup-brand .eyebrow { color: #79d4a4; margin-top: 24px; }
.login-brand h1, .setup-brand h1 { margin: 9px 0 12px; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; }
.login-brand p, .setup-brand > p { max-width: 520px; color: #aebdb5; font-size: 1.05rem; }
.login-panel, .setup-form-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 7vw, 100px); background: var(--paper); }
.login-panel { max-width: none; }
.login-panel > * { width: min(100%, 460px); margin-left: auto; margin-right: auto; }
.login-panel h2 { margin: 44px auto 5px; font-size: 1.8rem; }
.login-panel > p { color: var(--muted); margin-top: 0; margin-bottom: 25px; }
.login-heading { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: .72rem; font-weight: 700; }
.stack-form { display: flex; flex-direction: column; gap: 17px; }
.input-with-icon { position: relative; }
.input-with-icon i { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.input-with-icon input { padding-left: 39px; }
.setup-status { margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; list-style: none; color: #c3d1ca; }
.setup-status li { display: flex; align-items: center; gap: 10px; }
.setup-status i { color: #79d4a4; }
.setup-form-panel { overflow-y: auto; }
.setup-form-panel .stack-form { width: min(100%, 680px); margin: auto; }
.form-heading { margin-top: 5px; display: flex; align-items: center; gap: 9px; }
.form-heading span { color: var(--green); font-size: .7rem; font-weight: 800; }
.form-heading h2 { margin: 0; font-size: .92rem; }
.error-page, .share-gate { min-height: 100vh; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; }
.error-page h1 { max-width: 620px; }
.error-code { color: #79d4a4; font-size: 6rem; font-weight: 800; }

.share-body { min-height: 100vh; background: var(--canvas); }
.share-gate { width: min(100%, 480px); margin: auto; color: var(--ink); }
.share-gate .eyebrow { margin-top: 20px; }
.share-gate h1 { margin: 8px 0; font-size: 2rem; }
.share-gate > p { color: var(--muted); margin: 0 0 24px; }
.share-gate form { width: 100%; text-align: left; }
.share-header { min-height: 74px; padding: 12px max(20px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--sidebar); }
.share-content { width: min(1180px, calc(100% - 36px)); margin: 34px auto 60px; }
.share-file-list { border-top: 1px solid var(--line-strong); }
.share-file-list article { min-height: 67px; padding: 9px 4px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.share-file-list article > div { min-width: 0; display: flex; flex-direction: column; }
.share-file-list strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-file-list small { color: var(--muted); margin-top: 3px; font-size: .72rem; }

@media (max-width: 1020px) {
  :root { --sidebar-width: 210px; }
  .content { padding: 26px 24px 50px; }
  .cloud-overview { grid-template-columns: 200px 1fr; }
  .recent-strip { grid-column: 1 / -1; }
  .stat-band { grid-template-columns: 1fr 1fr; }
  .stat-band > div:nth-child(2) { border-right: 0; }
  .stat-band > div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.1); }
  .file-table th:nth-child(3), .file-table td:nth-child(3) { display: none; }
  .file-table th:nth-child(2) { width: 48%; }
  .login-brand, .setup-brand { padding: 55px; }
  .login-panel, .setup-form-panel { padding: 45px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; width: min(82vw, 280px); transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-bar { height: 58px; padding: 0 14px; position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .content { padding: 23px 14px 42px; }
  .page-header, .file-page-header { min-height: 0; flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 22px; }
  .page-header h1 { font-size: 1.65rem; }
  .search-form { width: 100%; }
  .cloud-overview { grid-template-columns: 1fr; gap: 12px; }
  .recent-strip { grid-column: auto; }
  .file-toolbar { align-items: stretch; flex-direction: column; }
  .file-toolbar .view-controls { overflow-x: auto; }
  .file-toolbar .view-controls select { min-width: 124px; }
  .file-table th:nth-child(3), .file-table td:nth-child(3), .file-table th:nth-child(4), .file-table td:nth-child(4), .file-table th:nth-child(5), .file-table td:nth-child(5) { display: none; }
  .file-table th:nth-child(2) { width: auto; }
  .file-table .check-cell { width: 40px; }
  .file-table td { padding-left: 8px; padding-right: 8px; }
  .file-name { gap: 8px; }
  .file-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .stat-band { grid-template-columns: 1fr 1fr; }
  .stat-band > div { padding: 16px 13px; }
  .stat-band strong { font-size: 1.05rem; }
  .storage-health { padding: 12px 0; grid-template-columns: auto 1fr auto; }
  .storage-free { grid-column: 2 / -1; }
  .storage-row { grid-template-columns: auto 1fr; }
  .storage-row > .inline-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .mobile-table-wrap { overflow-x: auto; }
  .data-table { min-width: 760px; }
  .settings-band { grid-template-columns: 1fr; }
  .runtime-facts { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0 0; }
  .login-shell, .setup-shell { display: block; background: var(--paper); }
  .login-brand, .setup-brand { min-height: 34vh; padding: 38px 24px; justify-content: flex-end; }
  .login-brand h1, .setup-brand h1 { font-size: 2.45rem; }
  .setup-status { display: none; }
  .login-panel, .setup-form-panel { min-height: 66vh; padding: 34px 22px 50px; }
  .login-panel h2 { margin-top: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .share-header { padding: 12px 16px; }
  .share-header .status-pill { display: none; }
  .share-content { width: calc(100% - 28px); margin-top: 24px; }
  .share-created { grid-template-columns: auto 1fr; }
  .share-created .button { grid-column: 1 / -1; }
}

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