/* Salvage Cloud — an original, quiet interface for personal files. */
:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f7faf8;
  --surface-hover: #eef5f1;
  --sidebar: #fbfcfb;
  --text: #172722;
  --text-soft: #556861;
  --text-muted: #7b8b84;
  --line: #dfe8e3;
  --line-strong: #cedbd4;
  --primary: #176b5b;
  --primary-strong: #105447;
  --primary-soft: #e4f2ed;
  --primary-faint: #f0f8f4;
  --accent: #b9e675;
  --accent-soft: #eff9df;
  --danger: #b44242;
  --danger-strong: #973535;
  --danger-soft: #fff0ef;
  --warning: #8c5b18;
  --warning-soft: #fff7e8;
  --folder: #d79a38;
  --folder-soft: #fff5df;
  --image: #5475c7;
  --image-soft: #edf1ff;
  --video: #9965bd;
  --video-soft: #f5edfb;
  --shadow-sm: 0 1px 2px rgb(20 48 39 / 4%), 0 3px 12px rgb(20 48 39 / 3%);
  --shadow-md: 0 12px 36px rgb(20 48 39 / 10%), 0 2px 8px rgb(20 48 39 / 5%);
  --shadow-dialog: 0 28px 80px rgb(7 29 23 / 24%);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --control-height: 44px;
  --card-padding: 18px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-density="compact"] {
  --control-height: 39px;
  --card-padding: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111815;
  --surface: #19221e;
  --surface-raised: #202b26;
  --surface-soft: #1d2722;
  --surface-hover: #25342d;
  --sidebar: #151e1a;
  --text: #eef5f0;
  --text-soft: #b0c0b7;
  --text-muted: #85988e;
  --line: #2b3932;
  --line-strong: #3a4b42;
  --primary: #72c5ac;
  --primary-strong: #94d8c2;
  --primary-soft: #213e34;
  --primary-faint: #1b2e26;
  --accent: #b9e675;
  --accent-soft: #2b3b24;
  --danger: #ef9792;
  --danger-strong: #ffafa9;
  --danger-soft: #3b2524;
  --warning: #e7b976;
  --warning-soft: #382f20;
  --folder: #e1ae58;
  --folder-soft: #3a3120;
  --image: #9eb4f3;
  --image-soft: #262e45;
  --video: #cba0e0;
  --video-soft: #362a40;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 15%);
  --shadow-md: 0 14px 38px rgb(0 0 0 / 24%);
  --shadow-dialog: 0 28px 90px rgb(0 0 0 / 55%);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #111815;
    --surface: #19221e;
    --surface-raised: #202b26;
    --surface-soft: #1d2722;
    --surface-hover: #25342d;
    --sidebar: #151e1a;
    --text: #eef5f0;
    --text-soft: #b0c0b7;
    --text-muted: #85988e;
    --line: #2b3932;
    --line-strong: #3a4b42;
    --primary: #72c5ac;
    --primary-strong: #94d8c2;
    --primary-soft: #213e34;
    --primary-faint: #1b2e26;
    --accent: #b9e675;
    --accent-soft: #2b3b24;
    --danger: #ef9792;
    --danger-strong: #ffafa9;
    --danger-soft: #3b2524;
    --warning: #e7b976;
    --warning-soft: #382f20;
    --folder: #e1ae58;
    --folder-soft: #3a3120;
    --image: #9eb4f3;
    --image-soft: #262e45;
    --video: #cba0e0;
    --video-soft: #362a40;
    --shadow-sm: 0 1px 3px rgb(0 0 0 / 15%);
    --shadow-md: 0 14px 38px rgb(0 0 0 / 24%);
    --shadow-dialog: 0 28px 90px rgb(0 0 0 / 55%);
  }
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong, b { letter-spacing: -.015em; }
button, [role="button"], a, select { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 2px;
}
::selection { color: var(--text); background: color-mix(in srgb, var(--accent) 55%, transparent); }
.icon { display: block; flex: 0 0 auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 10px 16px; border-radius: 8px; background: var(--primary-strong); color: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.noscript-message { max-width: 480px; margin: 15vh auto; padding: 30px; text-align: center; font-family: var(--font); }

/* Shared controls */
.button { min-height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; font-weight: 650; font-size: 13px; line-height: 1.2; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .58; cursor: not-allowed; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 9px color-mix(in srgb, var(--primary) 18%, transparent); }
:root[data-theme="dark"] .button-primary, :root[data-theme="system"] .button-primary { color: #10251e; }
.button-primary:hover:not(:disabled) { background: var(--primary-strong); box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 24%, transparent); }
.button-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.button-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.button-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .button-danger, :root[data-theme="system"] .button-danger { color: #321715; }
.button-danger:hover:not(:disabled) { background: var(--danger-strong); }
.button-full { width: 100%; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text-soft); cursor: pointer; transition: color .15s ease, background .15s ease; flex: 0 0 auto; }
.icon-button:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.icon-button:disabled { opacity: .5; cursor: not-allowed; }
.danger-hover:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.spinner { animation: spin .75s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { display: block; margin-bottom: 10px; color: var(--primary); font-size: 11px; line-height: 1.2; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-light { color: #d6edb8; }
.inline-notice { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 9px; font-size: 12px; line-height: 1.45; margin-bottom: 20px; }
.inline-notice .icon { margin-top: 1px; }
.notice-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 20%, transparent); }
.form-error { display: flex; gap: 8px; align-items: flex-start; color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.45; }
.form-error .icon { margin-top: 1px; }

input, select { min-height: var(--control-height); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); transition: border-color .15s ease, box-shadow .15s ease; }
input { width: 100%; padding: 10px 13px; }
input::placeholder { color: var(--text-muted); }
input:hover, select:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); outline: none; }
select { padding: 8px 34px 8px 12px; cursor: pointer; }
label, legend { font-weight: 650; font-size: 13px; }

/* Brand and global states */
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; border-radius: 9px; }
.brand-mark { color: var(--primary); flex: 0 0 auto; }
.brand-copy { display: flex; align-items: baseline; gap: 5px; font-size: 20px; line-height: 1; letter-spacing: -.045em; }
.brand-copy strong { font-weight: 760; }
.brand-copy span { color: var(--text-soft); font-weight: 450; }
.loading-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; background: var(--bg); }
.loading-brand { display: flex; flex-direction: column; align-items: center; gap: 15px; font-size: 22px; font-weight: 720; letter-spacing: -.04em; }
.loading-indicator { display: flex; align-items: center; gap: 10px; color: var(--text-soft); margin-top: 35px; }
.loading-indicator .spinner { color: var(--primary); }
.loading-indicator p { margin: 0; }
.loading-footnote { position: absolute; bottom: 28px; color: var(--text-muted); font-size: 12px; }
.standalone-page { min-height: 100vh; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.standalone-brand { margin-bottom: 30px; }
.standalone-card { width: min(100%, 540px); padding: 42px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.standalone-help { color: var(--text-muted); font-size: 12px; margin: 18px 0 0; text-align: center; }
.not-found-card h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 12px; }
.not-found-card p { color: var(--text-soft); margin-bottom: 25px; }
.state-card { width: 100%; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 44px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 65%, transparent); }
.state-card h2 { margin: 17px 0 7px; font-size: 20px; }
.state-card p { max-width: 440px; margin: 0 0 20px; color: var(--text-soft); font-size: 13px; }
.state-icon { width: 50px; height: 50px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; }
.state-icon-error { background: var(--danger-soft); color: var(--danger); }
.standalone-page .state-card { max-width: 540px; background: var(--surface); }
.empty-illustration { position: relative; width: 100px; height: 82px; }
.empty-cloud { position: absolute; right: 1px; top: 0; color: var(--primary); opacity: .42; }
.empty-folder { position: absolute; left: 7px; bottom: 0; color: var(--folder); }
.empty-state .button { margin-top: 2px; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .9fr) minmax(540px, 1.1fr); background: var(--surface); }
.login-story { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-height: 100vh; padding: clamp(28px, 4vw, 58px); color: #fff; background: radial-gradient(circle at 90% 10%, #2f8872 0, transparent 36%), linear-gradient(145deg, #103f36 0%, #13594a 55%, #176b58 100%); }
.login-story-top { position: relative; z-index: 2; }
.login-story .brand-copy { color: #fff; }
.login-story .brand-copy span { color: #c3dcd2; }
.login-story .brand-mark { color: #0e493d; }
.story-content { position: relative; z-index: 2; width: min(100%, 500px); margin: auto 0; padding: 70px 0; }
.story-content h1 { margin: 0 0 23px; font-size: clamp(42px, 4.2vw, 66px); font-weight: 630; line-height: 1.03; letter-spacing: -.055em; }
.story-content > p { max-width: 430px; margin-bottom: 42px; color: #c7dfd5; font-size: 16px; line-height: 1.65; }
.story-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.story-benefits li { display: flex; gap: 14px; align-items: flex-start; }
.story-benefits li > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 15%); border-radius: 11px; color: #d6edb8; background: rgb(255 255 255 / 7%); }
.story-benefits strong { font-size: 13px; }
.story-benefits p { margin: 3px 0 0; color: #a9cabd; font-size: 12px; }
.story-foot { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; color: #b9d4c8; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #65bfa5; box-shadow: 0 0 0 3px color-mix(in srgb, #65bfa5 12%, transparent); flex: 0 0 auto; }
.story-orb { position: absolute; z-index: 0; border: 1px solid rgb(255 255 255 / 6%); border-radius: 50%; }
.story-orb-one { width: 440px; height: 440px; right: -250px; bottom: -120px; box-shadow: 0 0 0 70px rgb(255 255 255 / 2%), 0 0 0 140px rgb(255 255 255 / 2%); }
.story-orb-two { width: 180px; height: 180px; left: -100px; top: 26%; }
.login-workspace { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 42px 30px 24px; background: var(--surface); }
.login-mobile-brand { display: none; }
.login-card { width: min(100%, 420px); margin: auto; }
.login-progress { display: flex; align-items: center; margin-bottom: 40px; }
.progress-step { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.progress-step i { width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-style: normal; font-weight: 700; }
.progress-step b { font-size: 10px; font-weight: 600; }
.progress-step.is-current { color: var(--primary); }
.progress-step.is-current i { color: #fff; background: var(--primary); border-color: var(--primary); }
.progress-step.is-complete { color: var(--primary); }
.progress-step.is-complete i { background: var(--primary-soft); border-color: var(--primary-soft); }
.progress-line { height: 1px; background: var(--line); flex: 1; margin: 0 9px; }
.login-heading { margin-bottom: 28px; }
.login-heading h2 { margin: 0 0 10px; font-size: clamp(27px, 3vw, 34px); font-weight: 680; line-height: 1.15; letter-spacing: -.04em; }
.login-heading > p { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.65; }
.login-heading > p strong { color: var(--text); font-weight: 650; }
.auth-form { display: grid; gap: 12px; }
.auth-form > label { margin-bottom: -4px; }
.auth-form .field-help { margin: -3px 0 4px; color: var(--text-muted); font-size: 11px; }
.input-with-icon { position: relative; }
.input-with-icon input { padding-left: 43px; }
.input-prefix { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.auth-submit { margin-top: 5px; min-height: 47px; }
.auth-submit > span { flex: 1; }
.auth-submit > span:first-child:last-child { flex: initial; }
.code-input { height: 59px; text-align: center; font-size: 25px; font-weight: 650; letter-spacing: .35em; padding-left: calc(13px + .35em); }
.qr-login-code { display: grid; place-items: center; margin: 20px auto; padding: 16px; width: min(290px, 100%); border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.qr-login-code svg { display: block; width: 100%; height: auto; }
.password-input { position: relative; }
.password-input input { padding-right: 48px; }
.password-input .icon-button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.back-button { display: inline-flex; align-items: center; gap: 5px; margin: -12px 0 22px -5px; padding: 5px; border: 0; background: none; color: var(--text-soft); font-size: 12px; cursor: pointer; }
.back-button:hover { color: var(--primary); }
.login-security-note { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin-top: 27px; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.login-security-note .icon { margin-top: 1px; }
.login-footer { display: flex; gap: 9px; margin-top: 35px; color: var(--text-muted); font-size: 10px; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 260px; display: flex; flex-direction: column; padding: 26px 18px 18px; border-right: 1px solid var(--line); background: var(--sidebar); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 9px; }
.sidebar-close { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 47px; }
.nav-section-label { padding: 0 12px; margin-bottom: 7px; color: var(--text-muted); font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.nav-section-spaced { margin-top: 26px; }
.nav-link { min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-soft); font-size: 13px; font-weight: 540; transition: color .15s ease, background .15s ease; }
.nav-link .icon { color: var(--text-muted); }
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 680; }
.nav-link.is-active .icon { color: var(--primary); }
.nav-badge { margin-left: auto; padding: 2px 6px; border-radius: 5px; color: var(--text-muted); background: var(--surface-hover); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-bottom { margin-top: auto; }
.privacy-note { display: flex; gap: 10px; margin: 0 3px 18px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.privacy-icon { color: var(--primary); padding-top: 1px; }
.privacy-note strong, .privacy-note span { display: block; }
.privacy-note strong { font-size: 10px; margin-bottom: 3px; }
.privacy-note div > span { color: var(--text-muted); font-size: 9px; line-height: 1.45; }
.account-row { display: flex; align-items: center; gap: 9px; padding: 14px 3px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11px; }
.account-copy span { color: var(--text-muted); font-size: 9px; margin-top: 2px; }
.app-frame { min-height: 100vh; margin-left: 260px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 3.5vw, 52px); border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); }
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar h1 { margin: 0; font-size: 15px; font-weight: 680; }
.mobile-menu, .topbar-mobile-logo { display: none; }
.topbar-account { display: flex; align-items: center; gap: 9px; max-width: 230px; color: var(--text-soft); font-size: 11px; }
.topbar-account > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-content { width: min(100%, 1500px); margin: 0 auto; padding: 31px clamp(22px, 3.5vw, 52px) 60px; outline: none; }
.sidebar-backdrop { display: none; }

/* Drive */
.breadcrumbs { min-height: 22px; display: flex; align-items: center; gap: 6px; margin-bottom: 21px; color: var(--text-muted); font-size: 11px; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 6px; padding: 3px; border-radius: 5px; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { color: var(--text-soft); }
.drive-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.drive-heading h2 { margin: 0 0 6px; font-size: clamp(25px, 3vw, 33px); line-height: 1.15; font-weight: 690; letter-spacing: -.04em; }
.drive-heading p { margin: 0; color: var(--text-soft); font-size: 12px; }
.new-folder-button { flex: 0 0 auto; }
.drive-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 25px; }
.search-form { position: relative; display: flex; align-items: center; width: min(100%, 490px); }
.search-form input { height: var(--control-height); padding: 9px 104px 9px 41px; border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 12px; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: 13px; z-index: 1; color: var(--text-muted); pointer-events: none; }
.search-clear { position: absolute; right: 67px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; }
.search-clear:hover { color: var(--text); background: var(--surface-hover); }
.search-submit { position: absolute; right: 5px; height: calc(var(--control-height) - 10px); padding: 0 10px; border: 0; border-radius: 7px; color: var(--primary); background: var(--primary-faint); font-size: 10px; font-weight: 650; cursor: pointer; }
.search-submit:hover { background: var(--primary-soft); }
.view-switcher { display: flex; align-items: center; gap: 3px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.view-switcher button { width: 34px; height: 33px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--text-muted); background: transparent; cursor: pointer; }
.view-switcher button:hover { color: var(--text); }
.view-switcher button.is-active { color: var(--primary); background: var(--primary-soft); }
.drive-entries.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: 13px; }
.entry-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.entry-card:hover { border-color: color-mix(in srgb, var(--primary) 25%, var(--line)); box-shadow: 0 5px 18px rgb(20 48 39 / 7%); transform: translateY(-1px); }
.is-grid .entry-card { min-height: 95px; padding: var(--card-padding); }
.entry-main { min-width: 0; display: flex; align-items: center; gap: 13px; border-radius: 8px; }
.is-grid .folder-card .entry-main { padding-right: 24px; }
.entry-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.folder-icon { color: var(--folder); background: var(--folder-soft); }
.file-icon { color: var(--primary); background: var(--primary-soft); }
.image-icon { color: var(--image); background: var(--image-soft); }
.video-icon { color: var(--video); background: var(--video-soft); }
.audio-icon { color: var(--video); background: var(--video-soft); }
.archive-icon { color: var(--folder); background: var(--folder-soft); }
.entry-copy { min-width: 0; flex: 1; }
.entry-copy strong { display: block; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.entry-copy > span { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.folder-open-icon { display: none; color: var(--text-muted); }
.entry-actions { display: flex; align-items: center; gap: 1px; }
.is-grid .entry-actions { position: absolute; right: 7px; top: 7px; opacity: 0; transition: opacity .15s ease; }
.entry-card:hover .entry-actions, .entry-card:focus-within .entry-actions { opacity: 1; }
.is-grid .entry-actions .icon-button { width: 29px; height: 29px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.is-grid .entry-actions .danger-hover { position: absolute; top: 31px; right: 0; }
.file-type-label { display: none; }
.protected-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; color: var(--text-muted); background: var(--surface-soft); font-size: 8px; }
.is-grid .protected-badge { position: absolute; right: 12px; bottom: 9px; }
.is-grid .protected-badge span { display: none; }
.detail-separator { color: var(--line-strong); }
.drive-entries.is-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.is-list .entry-list-header { display: grid; grid-template-columns: minmax(0, 1fr) 180px 86px; gap: 15px; padding: 10px 17px; border-bottom: 1px solid var(--line); color: var(--text-muted); background: var(--surface-soft); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.is-list .entry-card { display: flex; align-items: center; min-height: 65px; padding: 9px 13px 9px 17px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.is-list .entry-card:last-child { border-bottom: 0; }
.is-list .entry-card:hover { transform: none; box-shadow: none; background: var(--surface-soft); }
.is-list .entry-main { flex: 1; }
.is-list .entry-icon { width: 38px; height: 38px; border-radius: 10px; }
.is-list .entry-copy strong { font-size: 12px; }
.is-list .entry-copy > span { font-size: 10px; }
.is-list .entry-actions { width: 80px; justify-content: flex-end; }
.is-list .file-type-label { display: block; width: 180px; padding-right: 15px; overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.is-list .protected-badge { margin-right: 10px; }
.pagination-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; color: var(--text-muted); font-size: 11px; }
.drive-skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: 13px; }
.skeleton-card { min-height: 95px; display: flex; align-items: center; gap: 13px; padding: var(--card-padding); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skeleton-card > div { flex: 1; }
.skeleton { display: block; border-radius: 6px; background: linear-gradient(100deg, var(--surface-hover) 30%, var(--line) 50%, var(--surface-hover) 70%); background-size: 220% 100%; animation: shimmer 1.5s ease infinite; }
.skeleton-icon { width: 44px; height: 44px; border-radius: 12px; }
.skeleton-title { width: 65%; height: 10px; margin: 3px 0 10px; }
.skeleton-subtitle { width: 40%; height: 8px; }
@keyframes shimmer { to { background-position-x: -220%; } }

/* Dialogs */
.dialog { width: min(480px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--text); background: var(--surface-raised); box-shadow: var(--shadow-dialog); }
.dialog::backdrop { background: rgb(6 24 18 / 55%); backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 24px 24px 0; }
.dialog-header h2 { margin: 2px 0 7px; font-size: 21px; letter-spacing: -.035em; }
.dialog-header p { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.dialog-header .icon-button { margin: -4px -7px 0 0; }
.dialog-body { padding: 23px 24px 24px; }
.dialog-form { display: grid; gap: 12px; }
.dialog-form > label { margin-bottom: -4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.delete-confirmation { display: flex; align-items: center; gap: 14px; padding: 15px; border-radius: 11px; background: var(--danger-soft); }
.delete-confirmation .state-icon { width: 42px; height: 42px; flex: 0 0 auto; background: color-mix(in srgb, var(--danger) 10%, transparent); }
.delete-confirmation p { margin: 0; color: var(--text-soft); font-size: 12px; }
.delete-confirmation strong { color: var(--text); overflow-wrap: anywhere; }
.delete-confirmation + .form-error { margin-top: 14px; }

/* Settings */
.settings-intro { margin-bottom: 29px; }
.settings-intro h2 { margin: 0 0 8px; font-size: clamp(25px, 3vw, 33px); line-height: 1.15; letter-spacing: -.04em; }
.settings-intro p { margin: 0; color: var(--text-soft); font-size: 12px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 20px; }
.settings-main { display: grid; gap: 18px; }
.settings-card { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.settings-card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.settings-card-icon { width: 39px; height: 39px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--primary); background: var(--primary-soft); }
.settings-card h3 { margin: 0 0 4px; font-size: 14px; }
.settings-card p { margin: 0; color: var(--text-soft); font-size: 11px; }
.settings-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-fieldset legend { margin-bottom: 11px; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-option { position: relative; display: flex; flex-direction: column; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.theme-option:hover { background: var(--surface-soft); }
.theme-option.is-selected { border-color: var(--primary); background: var(--primary-faint); }
.theme-option > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme-option:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 2px; }
.theme-option > span:nth-of-type(2) { padding: 0 3px 2px; }
.theme-option strong, .theme-option small { display: block; }
.theme-option strong { font-size: 11px; }
.theme-option small { margin-top: 2px; color: var(--text-muted); font-size: 9px; font-weight: 400; }
.theme-preview { position: relative; height: 64px; overflow: hidden; border: 1px solid #e0e6e2; border-radius: 7px; background: #f4f7f6; }
.theme-preview i { position: absolute; inset: 0 auto 0 0; width: 25%; background: #fff; border-right: 1px solid #e0e6e2; }
.theme-preview b { position: absolute; left: 34%; right: 10%; top: 12px; height: 7px; border-radius: 4px; background: #d7e3dd; }
.theme-preview em { position: absolute; left: 34%; right: 25%; top: 29px; height: 24px; border: 1px solid #dbe5df; border-radius: 5px; background: #fff; }
.theme-preview-light { background: #f8faf9; }
.theme-preview-dark { border-color: #34463c; background: #111815; }
.theme-preview-dark i { background: #19221e; border-color: #34463c; }
.theme-preview-dark b { background: #40564a; }
.theme-preview-dark em { border-color: #34463c; background: #202b26; }
.theme-preview-system { background: linear-gradient(110deg, #f4f7f6 49.5%, #111815 50%); }
.theme-preview-system i { background: linear-gradient(110deg, #fff 70%, #19221e 72%); }
.theme-preview-system b { background: linear-gradient(90deg, #d7e3dd 49%, #40564a 51%); }
.theme-preview-system em { background: linear-gradient(110deg, #fff 49%, #202b26 50%); }
.radio-indicator { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; display: none; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); }
.theme-option.is-selected .radio-indicator { display: grid; }
.settings-control-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.settings-control-row label { display: block; margin-bottom: 3px; }
.settings-control-row p { margin: 0; }
.settings-control-row select { min-width: 135px; font-size: 11px; }
.segmented-settings { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.segmented-settings label { display: flex; align-items: center; gap: 7px; min-width: 105px; justify-content: center; padding: 8px 15px; border-radius: 7px; color: var(--text-soft); cursor: pointer; font-size: 11px; }
.segmented-settings label.is-selected { color: var(--primary); background: var(--surface); box-shadow: var(--shadow-sm); }
.segmented-settings input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented-settings label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--text-muted); font-size: 10px; font-weight: 400; }
.switch { appearance: none; position: relative; width: 39px; min-width: 39px; height: 23px; min-height: 23px; padding: 0; border: 0; border-radius: 20px; background: var(--line-strong); cursor: pointer; }
.switch::after { content: ""; position: absolute; width: 17px; height: 17px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 18%); transition: transform .16s ease; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(16px); }
.settings-side { display: grid; gap: 14px; }
.account-settings-card { text-align: center; }
.account-settings-card .settings-card-icon { margin-bottom: 12px; }
.settings-account-name { margin: 12px 0 7px !important; color: var(--text) !important; font-size: 13px !important; font-weight: 650; overflow-wrap: anywhere; }
.account-settings-card > p:not(.settings-account-name) { margin-bottom: 20px; line-height: 1.6; }
.storage-notice { display: flex; align-items: flex-start; gap: 10px; padding: 15px; border-radius: 12px; color: var(--text-soft); background: var(--primary-faint); }
.storage-notice > .icon { margin-top: 2px; color: var(--primary); }
.storage-notice strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 10px; }
.storage-notice p { margin: 0; color: var(--text-muted); font-size: 9px; line-height: 1.6; }

/* Transfer center */
.transfers-page { max-width: 800px; margin: clamp(15px, 6vh, 65px) auto 0; }
.transfer-hero { display: flex; flex-direction: column; align-items: center; padding: clamp(30px, 5vw, 55px); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); text-align: center; }
.transfer-illustration { position: relative; width: 112px; height: 112px; display: grid; place-items: center; margin-bottom: 29px; border-radius: 32px; color: var(--primary); background: var(--primary-soft); }
.transfer-ring { position: absolute; border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent); border-radius: 38px; }
.transfer-ring-one { inset: -10px; }
.transfer-ring-two { inset: -21px; opacity: .6; }
.transfer-hero h2 { margin: 0 0 12px; font-size: clamp(25px, 4vw, 35px); letter-spacing: -.04em; }
.transfer-hero > p { max-width: 520px; margin: 0 0 26px; color: var(--text-soft); font-size: 13px; line-height: 1.7; }
.transfer-status-card { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 12px; color: var(--text-soft); background: var(--surface-soft); font-size: 11px; }
.transfer-status-card > div { display: flex; align-items: center; gap: 9px; }
.transfer-status-card strong { color: var(--text); }
.status-dot-muted { background: var(--text-muted); box-shadow: none; opacity: .6; }
.transfer-status-card > span { color: var(--text-muted); }
.transfer-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; color: var(--text-muted); font-size: 10px; }

@media (max-width: 1100px) {
  .login-page { grid-template-columns: minmax(340px, .8fr) minmax(480px, 1.2fr); }
  .story-content h1 { font-size: 45px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .is-grid .entry-actions { opacity: 1; }
}

@media (max-width: 860px) {
  .login-page { display: block; background: var(--surface); }
  .login-story { display: none; }
  .login-workspace { padding: 30px 24px 22px; }
  .login-mobile-brand { display: block; width: min(100%, 420px); margin: 0 auto 55px; }
  .login-footer { margin-top: 45px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-md); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; width: 100%; height: 100%; border: 0; background: rgb(6 24 18 / 45%); opacity: 0; pointer-events: none; display: block; transition: opacity .2s ease; }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .app-frame { margin-left: 0; }
  .mobile-menu { display: inline-flex; margin-left: -8px; }
  .topbar-mobile-logo { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 62px; padding: 0 17px; }
  .topbar-account { display: none; }
  .main-content { padding: 22px 16px 40px; }
  .breadcrumbs { margin-bottom: 17px; }
  .drive-heading { align-items: flex-end; margin-bottom: 22px; }
  .drive-heading h2 { font-size: 26px; }
  .drive-heading p { max-width: 300px; font-size: 11px; }
  .new-folder-button { width: 43px; min-width: 43px; padding: 10px; }
  .new-folder-button span { display: none; }
  .drive-toolbar { gap: 9px; }
  .search-submit { display: none; }
  .search-form input { padding-right: 41px; }
  .search-clear { right: 5px; }
  .view-switcher button { width: 31px; }
  .drive-entries.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .is-grid .entry-card { min-height: 139px; padding: 14px; }
  .is-grid .entry-main { height: 100%; flex-direction: column; align-items: flex-start; justify-content: center; gap: 11px; }
  .is-grid .folder-card .entry-main { padding-right: 0; }
  .is-grid .entry-copy { width: 100%; flex: 0 0 auto; padding-right: 8px; }
  .is-grid .entry-copy strong { font-size: 11px; }
  .is-grid .entry-icon { width: 40px; height: 40px; }
  .is-grid .entry-actions { right: 7px; top: 7px; }
  .is-grid .protected-badge { bottom: 14px; right: 12px; }
  .is-list .entry-list-header { display: none; }
  .is-list .entry-card { padding-left: 12px; }
  .is-list .entry-main { gap: 10px; }
  .is-list .file-type-label { display: none; }
  .is-list .entry-actions { width: 73px; }
  .is-list .protected-badge { display: none; }
  .is-list .entry-copy > span { flex-wrap: wrap; }
  .drive-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .skeleton-card { min-height: 120px; flex-direction: column; align-items: flex-start; justify-content: center; }
  .skeleton-card > div { width: 100%; flex: 0; }
  .dialog-header { padding: 21px 20px 0; }
  .dialog-body { padding: 21px 20px; }
  .dialog-actions .button { flex: 1; }
  .settings-card { padding: 19px; }
  .theme-options { gap: 7px; }
  .theme-option { padding: 6px; }
  .theme-preview { height: 52px; }
  .theme-option small { display: none; }
  .settings-side { grid-template-columns: 1fr; }
  .transfer-hero { padding: 38px 22px; }
  .transfer-footnote { align-items: flex-start; text-align: center; }
}

@media (max-width: 390px) {
  .login-workspace { padding-inline: 18px; }
  .login-mobile-brand { margin-bottom: 38px; }
  .progress-step b { display: none; }
  .progress-line { margin-inline: 7px; }
  .login-progress { max-width: 180px; margin-bottom: 34px; }
  .drive-heading p { max-width: 235px; }
  .theme-option strong { font-size: 10px; }
  .settings-control-row { align-items: flex-start; flex-direction: column; }
  .settings-control-row select { width: 100%; }
}

/* Live uploads, downloads, and drive file actions */
.drive-heading-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.is-grid .file-card .entry-main { padding-right: 25px; }
.file-download-error { display: flex; align-items: flex-start; gap: 5px; margin-top: 9px; color: var(--danger); font-size: 9px; line-height: 1.45; }
.file-download-error .icon { margin-top: 1px; }
.is-grid .file-download-error { position: absolute; inset: auto 10px 8px; padding: 5px 7px; border-radius: 6px; background: var(--danger-soft); }
.is-grid .file-card:has(.file-download-error) { min-height: 128px; }
.is-list .file-card { flex-wrap: wrap; }
.is-list .file-download-error { width: 100%; padding: 0 50px 5px; }

.transfers-live-page { max-width: 1040px; margin: 0 auto; }
.transfers-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.transfers-heading h2 { margin: 0 0 7px; font-size: clamp(25px, 3vw, 33px); line-height: 1.15; letter-spacing: -.04em; }
.transfers-heading p { max-width: 600px; margin: 0; color: var(--text-soft); font-size: 12px; }
.transfers-heading > .button { flex: 0 0 auto; }
.upload-panel { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line)); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--primary-faint), var(--surface) 65%); box-shadow: var(--shadow-sm); }
.upload-panel-icon { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.upload-panel-copy { min-width: 0; flex: 1; }
.upload-panel-copy h3 { margin: 0 0 4px; font-size: 15px; }
.upload-panel-copy p { margin: 0 0 4px; color: var(--text-soft); font-size: 11px; }
.upload-panel-copy > span { display: block; color: var(--text-muted); font-size: 10px; }
.upload-picker { position: relative; flex: 0 0 auto; overflow: hidden; cursor: pointer; }
.upload-picker input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.upload-picker:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 3px; }
.resume-explainer { display: flex; align-items: flex-start; gap: 9px; margin: 13px 3px 26px; color: var(--text-muted); }
.resume-explainer .icon { margin-top: 2px; color: var(--primary); }
.resume-explainer p { margin: 0; font-size: 10px; line-height: 1.6; }
.transfer-list-summary { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 12px; }
.transfer-list-summary h3 { margin: 0; font-size: 14px; }
.transfer-list-summary > span { color: var(--text-muted); font-size: 10px; }
.transfer-list { display: grid; gap: 10px; }
.transfer-row { display: flex; align-items: flex-start; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.transfer-direction-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.transfer-row-main { min-width: 0; flex: 1; }
.transfer-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 1px 0 11px; }
.transfer-row-title > strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.transfer-status { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 6px; font-size: 8px; font-weight: 700; letter-spacing: .02em; }
.transfer-status.is-active { color: var(--primary); background: var(--primary-soft); }
.transfer-status.is-completed { color: var(--primary); background: var(--accent-soft); }
.transfer-status.is-failed { color: var(--danger); background: var(--danger-soft); }
.transfer-status.is-cancelled { color: var(--text-muted); background: var(--surface-hover); }
.transfer-progress-line { display: flex; align-items: center; gap: 10px; }
.transfer-progress-line progress { appearance: none; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 10px; background: var(--surface-hover); }
.transfer-progress-line progress::-webkit-progress-bar { border-radius: 10px; background: var(--surface-hover); }
.transfer-progress-line progress::-webkit-progress-value { border-radius: 10px; background: var(--primary); transition: width .2s ease; }
.transfer-progress-line progress::-moz-progress-bar { border-radius: 10px; background: var(--primary); }
.transfer-progress-line > span { width: 32px; flex: 0 0 auto; color: var(--text-muted); font-size: 9px; text-align: right; }
.transfer-meta { display: flex; gap: 12px; margin-top: 7px; color: var(--text-muted); font-size: 9px; }
.transfer-meta > span + span { position: relative; padding-left: 12px; }
.transfer-meta > span + span::before { content: "·"; position: absolute; left: 2px; }
.transfer-error { margin: 10px 0 0; padding: 8px 10px; border-radius: 7px; color: var(--danger); background: var(--danger-soft); font-size: 10px; line-height: 1.5; }
.transfer-action-hint { margin: 8px 0 0; color: var(--text-muted); font-size: 9px; line-height: 1.5; }
.transfer-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 40px; flex: 0 0 auto; }
.button-small { min-height: 35px; padding: 7px 11px; font-size: 10px; }
.transfer-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); font-size: 11px; }
.transfer-loading .spinner { color: var(--primary); }

@media (max-width: 620px) {
  .drive-heading-actions { gap: 7px; }
  .upload-drive-button { width: 43px; min-width: 43px; padding: 10px; }
  .upload-drive-button span { display: none; }
  .is-grid .file-card:has(.file-download-error) { min-height: 158px; }
  .is-list .file-download-error { padding-left: 10px; padding-right: 10px; }
  .transfers-heading { align-items: flex-start; }
  .transfers-heading .button > span { display: none; }
  .transfers-heading .button { width: 42px; padding: 10px; }
  .upload-panel { flex-wrap: wrap; gap: 13px; padding: 18px; }
  .upload-panel-icon { width: 42px; height: 42px; }
  .upload-panel-copy { flex-basis: calc(100% - 60px); }
  .upload-picker { width: 100%; }
  .transfer-row { gap: 10px; padding: 13px; }
  .transfer-direction-icon { width: 35px; height: 35px; }
  .transfer-row-actions { flex-direction: column; align-items: flex-end; }
  .transfer-row-title { gap: 6px; }
}

/* Inline preview and public share dialogs */
.is-grid .file-card { min-height: 125px; padding-bottom: 49px; }
.is-grid .file-card .entry-main { padding-right: 0; }
.is-grid .file-actions { inset: auto auto 7px 10px; opacity: 1; }
.is-grid .file-card .protected-badge { inset: 10px 10px auto auto; }
.is-list .file-actions { width: 112px; }
.protected-action-note { display: flex; align-items: flex-start; gap: 5px; color: var(--text-muted); font-size: 8px; line-height: 1.45; }
.protected-action-note .icon { margin-top: 1px; }
.is-grid .protected-action-note { position: absolute; inset: auto 13px 43px; }
.is-grid .file-card:has(.protected-action-note) { min-height: 153px; }
.is-grid .file-card:has(.file-download-error) { min-height: 165px; }
.is-grid .file-download-error { bottom: 43px; }
.is-list .protected-action-note { width: 100%; padding: 0 50px 5px; }
.dialog:has(.preview-content) { width: min(1000px, calc(100vw - 32px)); }
.dialog:has(.share-content) { width: min(650px, calc(100vw - 32px)); }
.dialog:has(.preview-content) .dialog-body { padding-top: 18px; }
.preview-content { min-height: 260px; }
.preview-loading { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; color: var(--text-muted); text-align: center; }
.preview-loading .spinner { color: var(--primary); }
.preview-loading p { margin: 0; font-size: 11px; }
.preview-content .state-card { min-height: 260px; }
.media-preview { display: flex; align-items: center; justify-content: center; min-height: 320px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.image-preview { max-height: 65vh; }
.image-preview img { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; }
.pdf-preview { display: block; width: 100%; height: min(65vh, 720px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.audio-preview { min-height: 190px; flex-direction: column; gap: 24px; padding: 30px; color: var(--primary); }
.audio-preview audio { width: min(100%, 520px); }
.video-preview { max-height: 65vh; background: #0b100e; }
.video-preview video { display: block; width: 100%; max-height: 65vh; }
.text-preview { box-sizing: border-box; width: 100%; max-height: 62vh; min-height: 260px; margin: 0; padding: 18px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-soft); font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.unsupported-preview { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; }
.unsupported-preview .state-icon { color: var(--primary); background: var(--primary-soft); }
.unsupported-preview h3 { margin: 15px 0 7px; font-size: 17px; }
.unsupported-preview p { max-width: 440px; margin: 0; color: var(--text-soft); font-size: 11px; line-height: 1.6; }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 14px; }
.preview-footer > span { min-width: 0; overflow: hidden; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.share-content { display: grid; gap: 18px; }
.share-warning { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid color-mix(in srgb, var(--warning) 18%, transparent); border-radius: 9px; color: var(--warning); background: var(--warning-soft); }
.share-warning .icon { margin-top: 1px; }
.share-warning p { margin: 0; font-size: 11px; line-height: 1.55; }
.share-create-form { display: grid; gap: 8px; }
.share-create-row { display: flex; gap: 9px; }
.share-create-row select { min-width: 130px; }
.share-create-row .button { flex: 1; }
.created-share-link { padding: 16px; border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); border-radius: 12px; background: var(--primary-faint); }
.created-link-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.created-link-heading .state-icon { width: 38px; height: 38px; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.created-link-heading h3 { margin: 0 0 3px; font-size: 13px; }
.created-link-heading p { margin: 0; color: var(--text-soft); font-size: 10px; }
.created-share-link > label { display: block; margin-bottom: 7px; font-size: 11px; }
.share-link-input-row { display: flex; align-items: stretch; gap: 8px; }
.share-link-input-row input { min-width: 0; flex: 1; font-size: 10px; }
.share-link-input-row .button { flex: 0 0 auto; }
.copy-status { margin: 9px 0 0; color: var(--text-soft); font-size: 10px; line-height: 1.5; }
.existing-shares { padding-top: 2px; }
.existing-shares-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.existing-shares-heading h3 { margin: 0; font-size: 13px; }
.existing-shares-heading > span { min-width: 22px; padding: 2px 6px; border-radius: 6px; color: var(--text-muted); background: var(--surface-hover); font-size: 9px; text-align: center; }
.share-metadata-explanation { margin: 6px 0 13px; color: var(--text-muted); font-size: 10px; line-height: 1.55; }
.share-list { display: grid; gap: 8px; }
.share-metadata-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.share-metadata-main { min-width: 0; flex: 1; }
.share-metadata-main > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 5px; }
.share-metadata-main strong { overflow-wrap: anywhere; font-size: 10px; }
.share-metadata-main p { margin: 2px 0 0; color: var(--text-muted); font-size: 9px; }
.share-status { padding: 2px 6px; border-radius: 5px; font-size: 8px; font-weight: 700; }
.share-status.is-active { color: var(--primary); background: var(--primary-soft); }
.share-status.is-inactive { color: var(--text-muted); background: var(--surface-hover); }
.shares-empty { margin: 15px 0; padding: 22px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--text-muted); font-size: 11px; text-align: center; }
.existing-shares .preview-loading, .existing-shares .state-card { min-height: 130px; }

@media (max-width: 620px) {
  .is-grid .file-card { min-height: 155px; }
  .is-grid .file-card:has(.protected-action-note) { min-height: 185px; }
  .is-grid .file-card:has(.file-download-error) { min-height: 190px; }
  .is-list .protected-action-note { padding-inline: 10px; }
  .dialog:has(.preview-content) .dialog-header, .dialog:has(.share-content) .dialog-header { padding-inline: 17px; }
  .dialog:has(.preview-content) .dialog-body, .dialog:has(.share-content) .dialog-body { padding-inline: 17px; }
  .media-preview { min-height: 230px; }
  .pdf-preview { height: 58vh; }
  .preview-footer { align-items: flex-start; flex-direction: column; }
  .preview-footer .button { width: 100%; }
  .share-create-row { flex-direction: column; }
  .share-create-row select { width: 100%; }
  .share-link-input-row { flex-direction: column; }
  .share-link-input-row .button { width: 100%; }
  .share-metadata-row { align-items: flex-start; }
  .share-metadata-row .button { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
