@font-face { font-family: "Outfit"; font-style: normal; font-display: swap; font-weight: 200; src: url(fonts/outfit-latin-200-normal.woff2) format("woff2"); }
@font-face { font-family: "Quicksand"; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/quicksand-latin-700-normal.woff2) format("woff2"); }
:root {
  --navy: #07173a;
  --bg: #ffffff; --surface: #ffffff; --line: #e5e5ea; --text: #1d1d1f; --muted: #86868b;
  --accent: #007aff; --accent-ink: #ffffff; --accent-soft: rgba(0, 122, 255, .12); --danger: #ff3b30; --hover: rgba(0, 0, 0, .045);
  --folder: #5ac8fa; --shadow: 0 20px 60px rgba(0, 0, 0, .22), 0 0 0 .5px rgba(0, 0, 0, .12);
  --side: rgba(246, 246, 248, .86); --press: rgba(0, 0, 0, .08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}
html.dark {
    --bg: #1e1e20; --surface: #2a2a2d; --line: #3a3a3e; --text: #f5f5f7; --muted: #98989f;
    --accent: #0a84ff; --accent-ink: #ffffff; --accent-soft: rgba(10, 132, 255, .22); --danger: #ff453a; --hover: rgba(255, 255, 255, .07);
    --folder: #64d2ff; --shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 .5px rgba(255, 255, 255, .12);
    --side: rgba(38, 38, 41, .86); --press: rgba(255, 255, 255, .12);
}
* { box-sizing: border-box; }
html, body, #app:not(.share-page) { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.icon { padding: 7px; border-color: transparent; background: transparent; color: var(--muted); }
.btn.icon:hover { background: var(--hover); color: var(--text); }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], input[type=date], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 10px; }

/* Sign in / setup */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.auth-card h1 { font-size: 22px; margin: 22px 0 4px; letter-spacing: -.02em; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 20px; padding: 10px; }
.pw { position: relative; } .pw input { padding-right: 62px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; padding: 6px 8px; cursor: pointer; }
.auth.login { position: relative; overflow: hidden; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 32px 20px;
  background: radial-gradient(900px 520px at 20% 0%, #1b4296 0%, rgba(27,66,150,0) 62%), radial-gradient(800px 500px at 90% 100%, #0f2a66 0%, rgba(15,42,102,0) 60%), linear-gradient(160deg, #0a1f4d 0%, #07173a 55%, #050f27 100%); }
.auth.login::before, .auth.login::after { content: ""; position: absolute; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2286 84 348 290%22%3E%3Cdefs%3E%3Cmask id=%22m%22 maskUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%22520%22 height=%22460%22%3E%3Crect width=%22520%22 height=%22460%22 fill=%22%23fff%22/%3E%3Cg fill=%22%23000%22%3E%3Ccircle cx=%22172%22 cy=%22262%22 r=%2268%22/%3E%3Ccircle cx=%22262%22 cy=%22206%22 r=%2292%22/%3E%3Ccircle cx=%22352%22 cy=%22262%22 r=%2268%22/%3E%3Crect x=%22172%22 y=%22200%22 width=%22180%22 height=%22130%22/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cg fill=%22%23fff%22 stroke=%22%23fff%22 stroke-width=%225%22 mask=%22url(%23m)%22%3E%3Ccircle cx=%22172%22 cy=%22262%22 r=%2268%22/%3E%3Ccircle cx=%22262%22 cy=%22206%22 r=%2292%22/%3E%3Ccircle cx=%22352%22 cy=%22262%22 r=%2268%22/%3E%3Crect x=%22172%22 y=%22200%22 width=%22180%22 height=%22130%22/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; opacity: .07; }
.auth.login::before { width: 520px; height: 440px; left: -120px; top: -60px; animation: drift 26s ease-in-out infinite alternate; }
.auth.login::after { width: 640px; height: 540px; right: -180px; bottom: -140px; opacity: .06; animation: drift 32s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(40px, 22px); } }
@media (prefers-reduced-motion: reduce) { .auth.login::before, .auth.login::after { animation: none; } }
.auth.login > * { position: relative; z-index: 1; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 18px; color: #fff; font-family: "Outfit", var(--font); font-size: 44px; letter-spacing: 0; line-height: 1; }
.auth-logo img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 18px 40px rgba(0,0,0,.35); }
.auth-logo .thin { font-weight: 200; } .auth-logo .bold { font-family: "Quicksand", "Outfit", var(--font); font-weight: 700; }
.auth.login .auth-card { width: 100%; max-width: 360px; padding: 0; background: none; border: 0; box-shadow: none; color: #fff; }
.auth.login .auth-card .tagline { text-align: center; color: rgba(255,255,255,.62); font-size: 15px; margin-bottom: 22px; }
.auth.login .auth-card input { width: 100%; padding: 14px 20px; margin-bottom: 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.09); color: #fff; font-size: 15px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .15s, border-color .15s, box-shadow .15s; }
.auth.login .auth-card input::placeholder { color: rgba(255,255,255,.5); }
.auth.login .auth-card input:focus { outline: 0; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.55); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.auth.login .auth-card input:-webkit-autofill { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 100px #14316f inset; }
.auth.login .pw { position: relative; } .pw input { padding-right: 74px; }
.auth.login .eye { position: absolute; right: 10px; top: 14px; transform: none; border: 0; background: none; color: rgba(255,255,255,.6); font: inherit; font-size: 13px; padding: 4px 10px; cursor: pointer; border-radius: 999px; }
.auth.login .eye:hover { color: #fff; background: rgba(255,255,255,.1); }
.auth.login .auth-card .error { color: #ffb4a8; text-align: center; min-height: 18px; margin: 2px 0 6px; }
.auth.login .auth-card .note { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: 14px; margin: 0 0 16px !important; }
.auth.login .auth-card .btn.primary { width: 100%; justify-content: center; margin-top: 8px; padding: 14px; border-radius: 999px; background: #fff; color: #07173a; border: 0; font-weight: 600; font-size: 15px; box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.auth.login .auth-card .btn.primary:hover { background: #e8eefc; }
.auth.login .auth-card .muted { color: rgba(255,255,255,.6); }
.auth.login .auth-card .linkbtn { color: #fff; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100%; }
.side { display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.side .brand { padding: 0 8px 18px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav:hover { background: var(--hover); }
.nav.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.usage { padding: 12px 10px; font-size: 13px; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.who { display: flex; align-items: center; gap: 4px; padding: 8px 4px 0 10px; border-top: 1px solid var(--line); }
.who b { flex: 1; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: auto; padding: 22px 28px 60px; }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bar h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.search { position: relative; width: 240px; max-width: 100%; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.search input { padding-left: 34px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--hover); color: var(--text); }
.crumbs a:last-child { color: var(--text); }
.crumbs span { color: var(--line); }

/* Lists */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 150px auto; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 10px; padding-bottom: 10px; }
.row:not(.head):hover { background: var(--hover); }
.row .name { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; background: none; border: 0; padding: 6px 0; text-align: left; }
.row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name:hover span { text-decoration: underline; }
.row .name svg { color: var(--muted); }
.row .name.dir svg { color: var(--folder); fill: color-mix(in srgb, var(--folder) 25%, transparent); }
.row .num { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .acts { display: flex; justify-content: flex-end; min-width: 170px; }
.tag { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; flex: none; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.drop-on .list { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* Dialogs */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 14, 22, .5); }
dialog.wide { width: min(980px, calc(100vw - 32px)); }
.dlg { padding: 22px; }
.dlg h3 { margin: 0 0 6px; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.copy { display: flex; gap: 8px; }
.tree { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; padding: 4px; }
.tree button { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 7px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.tree button:hover { background: var(--hover); }
.tree button.sel { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree button:disabled { opacity: .4; cursor: default; }
.preview { display: grid; place-items: center; background: var(--bg); border-radius: 8px; min-height: 200px; max-height: 72vh; overflow: auto; margin-top: 12px; }
.preview img, .preview video { max-width: 100%; max-height: 72vh; display: block; }
.preview iframe { width: 100%; height: 72vh; border: 0; }
.preview pre { margin: 0; padding: 16px; width: 100%; align-self: start; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* Upload tray + toast */
.tray { position: fixed; right: 20px; bottom: 20px; width: 320px; max-width: calc(100vw - 40px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 13.5px; }
.tray .item { margin-top: 10px; }
.tray .item div:first-child { display: flex; gap: 8px; justify-content: space-between; }
.tray .item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray .meter { margin: 5px 0 0; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 99px; font-size: 14px; box-shadow: var(--shadow); z-index: 10; }

/* Public share page */
.share-page { max-width: 760px; margin: 0 auto; padding: 36px 16px 60px; }
.share-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-top: 22px; }
.share-card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.02em; word-break: break-word; }


/* Plans, dashboard, settings */
textarea { min-height: 84px; resize: vertical; font: inherit; color: inherit; }
h2.section { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 0; }
.note { background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; white-space: pre-wrap; }
.note.warn { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile b { display: block; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan h4 { margin: 0; font-size: 16px; }
.plan .big { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.plan .btn { margin-top: auto; justify-content: center; }
.plan p { margin: 0 0 8px; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 20px 20px; max-width: 620px; }
.form .btn { margin-top: 18px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 15px; }
.row.four { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 110px auto; }
.tag.off { background: var(--line); color: var(--muted); }
.tag.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.sub { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; }

/* CloudBox brand: thin "Cloud", bold "Box", navy sidebar */
.brand { font-family: "Outfit", var(--font); font-weight: 600; font-size: 23px; letter-spacing: 0; }
.brand .thin { font-weight: 200; } .brand .bold { font-family: "Quicksand", "Outfit", var(--font); font-weight: 700; }
.brand img { width: 34px; height: 34px; }
.auth-card .brand, .share-page .brand { color: var(--navy); }
html.dark .auth-card .brand, html.dark .share-page .brand { color: #fff; }

/* Dashboard */
.stats { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.stat { flex: 1 1 130px; padding: 16px 20px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
a.stat:hover { background: var(--hover); }
.stat b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.disk { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; margin-bottom: 26px; }
.disk-t { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.disk .meter { margin: 0; }
.brand { display: flex; align-items: center; gap: 10px; }

/* ---- macOS look ---- */
body { -webkit-font-smoothing: antialiased; font-size: 14px; letter-spacing: -.003em; }
.side { background: var(--side); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border-right: 1px solid rgba(0, 0, 0, .09); color: var(--text); padding: 18px 12px; gap: 2px; }
html.dark .side { border-right-color: rgba(255, 255, 255, .08); }
.side .brand { color: var(--navy); padding: 2px 8px 18px; font-size: 21px; }
html.dark .side .brand { color: #fff; }
.nav { padding: 6px 10px; border-radius: 7px; color: var(--text); font-weight: 500; }
.nav svg { color: var(--accent); width: 17px; height: 17px; }
.nav:hover { background: var(--hover); }
.nav.active { background: var(--press); color: var(--text); font-weight: 600; }
.side .usage { color: var(--muted); font-size: 12px; }
.side .meter { background: var(--press); } .side .meter i { background: var(--accent); }
.side .who { border-top: 1px solid var(--line); }
.side .btn.icon { color: var(--muted); }
.main { background: var(--bg); padding: 22px 30px 60px; }
.bar h2, .hello h2, .crumbs { font-weight: 650; }
.btn { padding: 6px 13px; border-radius: 7px; border: .5px solid rgba(0, 0, 0, .16); background: var(--surface); font-weight: 500; box-shadow: 0 .5px 1px rgba(0, 0, 0, .1); }
html.dark .btn { border-color: rgba(255, 255, 255, .14); box-shadow: none; background: rgba(255, 255, 255, .1); }
.btn:hover { background: var(--hover); }
.btn:active { background: var(--press); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 .5px 1px rgba(0, 0, 0, .15); }
.btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn.icon { box-shadow: none; border: 0; background: transparent; }
.btn.icon:hover { background: var(--hover); }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], input[type=date], select, textarea {
  border-radius: 7px; border: .5px solid rgba(0, 0, 0, .2); background: var(--surface); box-shadow: inset 0 .5px 1px rgba(0, 0, 0, .06); }
html.dark input[type=text], html.dark input[type=password], html.dark input[type=search], html.dark input[type=number], html.dark input[type=email], html.dark input[type=date], html.dark select, html.dark textarea { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.search input { border-radius: 8px; background: var(--hover); border-color: transparent; box-shadow: none; }
.list, .stats, .disk, .share-card { border-radius: 10px; border: .5px solid var(--line); box-shadow: none; }
.row { padding: 5px 8px 5px 14px; border-top: .5px solid var(--line); }
.row.head { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.row:not(.head):hover { background: var(--hover); }
.row .name:hover span { text-decoration: none; }
.row .name.dir svg { fill: color-mix(in srgb, var(--folder) 35%, transparent); }
.note { background: var(--accent-soft); border-radius: 10px; }
.tile, .card { border-radius: 10px; border-width: .5px; }
dialog { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
dialog::backdrop { background: rgba(0, 0, 0, .28); }
.tray { border-radius: 12px; border: .5px solid var(--line); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.toast { background: rgba(40, 40, 44, .92); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.meter { height: 5px; } .meter i { background: var(--accent); }
.stat b { font-weight: 600; } h2.section { letter-spacing: .04em; font-weight: 600; }
.pill, .tag { border-radius: 6px; }
.row.head > :nth-child(4) { min-width: 170px; }
.main > * { flex-shrink: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5px; background: var(--line); overflow: hidden; }
.stat { background: var(--surface); border: 0 !important; }
.empty { padding: 36px 20px; }
.stats { gap: 0; background: var(--surface); }
.stat { box-shadow: 0 0 0 .5px var(--line); }
@media (min-width: 761px) { .row.four { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 110px 200px; } .row.head > :nth-child(4) { min-width: 0; } .row.four .acts { min-width: 0; } }

/* Light / dark switch */
html { color-scheme: light; } html.dark { color-scheme: dark; }
.theme { display: flex; gap: 2px; padding: 2px; margin: 0 10px 10px; border-radius: 8px; background: var(--press); }
.theme button { flex: 1; display: grid; place-items: center; padding: 5px 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.theme button svg { width: 15px; height: 15px; }
.theme button:hover { color: var(--text); }
.theme button.on { background: var(--surface); color: var(--text); box-shadow: 0 .5px 2px rgba(0, 0, 0, .18); }
.sharebtns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.num.gone { color: var(--danger); }
input[type=datetime-local] { width: 100%; padding: 6px 10px; margin-top: 8px; border-radius: 7px; border: .5px solid rgba(0,0,0,.2); background: var(--surface); }
html.dark input[type=datetime-local] { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); }
html.dark .btn.primary { background: var(--accent); border-color: transparent; }
html.dark .btn.icon { background: transparent; border: 0; }
html.dark .btn.icon:hover { background: var(--hover); }
html.dark .btn:hover:not(.primary):not(.icon) { background: rgba(255, 255, 255, .16); }

.kv { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: .5px solid var(--line); } .kv:first-of-type { border-top: 0; }
.kv span { width: 90px; color: var(--muted); font-size: 13px; flex: none; } .kv code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
code.big { font: 600 17px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
details { border-top: .5px solid var(--line); padding: 10px 0; } details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 600; } details ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); } details li { margin: 4px 0; }
.card .list.flat .row { grid-template-columns: minmax(0, 1fr) 0 0 auto; gap: 0; }
.form .sect { margin: 26px 0 4px; font-size: 15px; } .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; } .check input { width: auto; }
dialog.wide .drive { max-height: 52vh; overflow: auto; margin-bottom: 4px; } .drive-row { grid-template-columns: 22px minmax(0, 1fr) 90px !important; cursor: pointer; } .drive-row input { width: 16px; height: 16px; }
.bad { color: var(--danger) !important; }
.copy { display: flex; gap: 8px; }
.card { background: var(--surface); border: .5px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; max-width: 760px; min-width: 0; }
.card-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; } .card-h h3 { margin: 0; font-size: 15px; flex: 1; }
.card-sub { color: var(--muted); font-size: 13px; } .card-empty { color: var(--muted); font-size: 14px; padding: 14px 0; text-align: center; }
.list.flat { border: 0; border-radius: 0; background: none; }
.drive-row .name { color: var(--text); cursor: pointer; }

/* ---- Responsive: phones, tablets, desktops ---- */
.topbar, .scrim, .meta, .acts-more { display: none; }
.acts-full { display: flex; }
.row .name .nm { display: flex; flex-direction: column; min-width: 0; }
.row .name .nm > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-list { display: flex; flex-direction: column; margin: 8px -8px 0; }
.sheet-item { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border: 0; background: none; border-radius: 10px; font-size: 16px; text-align: left; color: var(--text); text-decoration: none; cursor: pointer; }
.sheet-item:hover, .sheet-item:active { background: var(--hover); } .sheet-item svg { width: 20px; height: 20px; color: var(--accent); } .sheet-item.danger, .sheet-item.danger svg { color: var(--danger); }
.themebtn { flex: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
  .topbar { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left));
    background: var(--side); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-bottom: .5px solid var(--line); z-index: 20; }
  .topbar .brand { color: var(--navy); font-size: 20px; padding: 0; } html.dark .topbar .brand { color: #fff; }
  .topbar .brand img { width: 30px; height: 30px; }
  .topbar .btn.icon { padding: 9px; } .topbar .btn.icon svg { width: 22px; height: 22px; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 60; background: var(--surface); transform: translateX(-104%); transition: transform .25s ease;
    padding: calc(18px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); overflow-y: auto; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html.dark .side { background: #262629; }
  .shell.open .side { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .38); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 55; }
  .shell.open .scrim { opacity: 1; pointer-events: auto; }
  .nav { padding: 10px 12px; font-size: 15px; }
  .main { height: auto; min-height: 0; padding: 16px calc(16px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  input[type=text], input[type=password], input[type=search], input[type=number], input[type=email], input[type=date], input[type=datetime-local], select, textarea { font-size: 16px; }
  .bar { gap: 8px; } .bar .spacer { display: none; } .bar h2, .bar .crumbs { flex: 1 1 100%; }
  .bar > .btn { flex: 1 1 auto; justify-content: center; } .search { width: 100%; order: 5; flex: 1 1 100%; }
  .row { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 6px 8px 14px; gap: 8px; }
  .row .num, .row.head { display: none; }
  .row .acts { min-width: 0 !important; }
  .acts-full { display: none; } .acts-more { display: inline-flex; padding: 10px; }
  .meta { display: block; font-size: 12.5px; color: var(--muted); }
  .row .name { padding: 4px 0; min-height: 44px; }
  .row.four { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 14px; }
  .row.four > :nth-child(2) { font-size: 13px; color: var(--muted); }
  .row.four > :nth-child(3) { display: none; }
  .row.four > .acts { justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
  .row.four .btn.icon { padding: 10px; }
  .btn.icon { padding: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); } .stat { padding: 14px 16px; }
  .disk-t { flex-direction: column; gap: 2px; }
  .card { padding: 16px; max-width: none; } .kv span { width: 70px; } .copy { flex-wrap: wrap; } .copy input { flex: 1 1 100%; }
  .form { padding: 4px 16px 18px; } .dlg form .two { grid-template-columns: 1fr; }
  dialog { max-height: 92vh; max-height: 92dvh; overflow: auto; width: calc(100vw - 20px); }
  dialog.wide { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; margin: 0; }
  dialog.wide .drive { max-height: calc(100dvh - 250px); }
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dlg { padding: 18px; }
  .foot { flex-wrap: wrap; } .foot .btn { flex: 1 1 auto; justify-content: center; }
  .tray { left: 10px; right: 10px; width: auto; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: none; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }
  .share-page { padding: 20px 12px 40px; } .share-card { padding: 16px; }
  .hello h2 { font-size: 22px; }
  .auth.login { padding: 24px 18px; gap: 26px; } .auth-logo { font-size: 36px; } .auth-logo img { width: 72px; height: 72px; }
  .auth::before, .auth::after { width: 340px; height: 290px; }
}
@media (hover: none) { .btn:hover { background: var(--surface); } .row:not(.head):hover { background: none; } }
@media (min-width: 1500px) { .main { padding-left: 40px; padding-right: 40px; } }
@supports (-webkit-touch-callout: none) { .shell { min-height: -webkit-fill-available; } }
.share-top { display: flex; align-items: center; margin-bottom: 18px; } .share-top .brand { color: var(--text); }
.row .name .nm > .meta { white-space: normal; }
.card-h { flex-wrap: wrap; }
/* Sharing with people */
.people { margin: 6px 0 4px; } .people:empty { display: none; }
h4.sect { margin: 18px 0 2px; font-size: 14px; }
.people .kv span { width: auto; min-width: 70px; color: var(--text); font-weight: 600; }

/* Public download page (WeTransfer-style) */
body.wt { margin: 0; min-height: 100vh; color: #111; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(900px 600px at 12% 8%, #ffd9ec 0, transparent 60%), radial-gradient(900px 700px at 92% 20%, #bfe3ff 0, transparent 60%), radial-gradient(900px 700px at 50% 110%, #d9d2ff 0, transparent 60%), #f4f7ff; }
.wt-page { min-height: 100vh; display: flex; flex-direction: column; padding: 22px 20px; max-width: none; margin: 0; }
.wt-loading { margin: auto; color: #667; }
.wt-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; color: #07173a; }
.wt-brand img { width: 34px; height: 34px; }
.wt-brand .thin { font-family: Outfit, sans-serif; font-weight: 200; } .wt-brand .bold { font-family: Quicksand, sans-serif; font-weight: 700; }
.wt-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 0; }
.wt-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 36px 32px 30px; text-align: center; box-shadow: 0 30px 80px -20px rgba(40, 60, 140, .28), 0 2px 8px rgba(40, 60, 140, .08); margin: 0; border: 0; }
.wt-card.wide { max-width: 620px; text-align: left; }
.wt-card h1 { font-size: 24px; letter-spacing: -.02em; margin: 14px 0 4px; word-break: break-word; color: #111; }
.wt-sub { color: #6b7280; margin: 0 0 14px; font-size: 15px; }
.wt-ic { width: 40px; height: 40px; border-radius: 12px; background: #eaf2ff; color: #409fff; display: grid; place-items: center; flex: none; }
.wt-ic svg { width: 20px; height: 20px; }
.wt-ic.big { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto; } .wt-ic.big svg { width: 38px; height: 38px; }
.wt-ic.off { background: #f1f2f6; color: #8a90a2; }
.wt-facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 22px; }
.wt-card.wide .wt-facts { justify-content: flex-start; margin: 14px 0 10px; }
.wt-facts span { background: #f2f4f9; color: #4b5563; font-size: 13px; padding: 5px 11px; border-radius: 99px; }
.wt-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 20px; border-radius: 14px; background: #409fff; color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; transition: background .15s, transform .1s; font-family: inherit; box-sizing: border-box; }
.wt-btn:hover { background: #2b8cf0; } .wt-btn:active { transform: scale(.99); }
.wt-btn svg { width: 20px; height: 20px; }
.wt-link { display: block; margin: 14px auto 0; background: none; border: 0; color: #409fff; font-size: 15px; cursor: pointer; font-family: inherit; }
.wt-card input[type=password] { width: 100%; box-sizing: border-box; padding: 13px 14px; border: 1px solid #d9deea; border-radius: 12px; font-size: 16px; margin: 6px 0 10px; background: #fff; color: #111; }
.wt-card .error { color: #d92d20; min-height: 18px; font-size: 14px; margin-bottom: 8px; }
.wt-head { display: flex; align-items: center; gap: 14px; } .wt-head h1 { margin: 0; font-size: 22px; } .wt-head .wt-sub { margin: 2px 0 0; } .wt-title { min-width: 0; }
.wt-crumbs { font-size: 14px; color: #6b7280; margin: 4px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; } .wt-crumbs a { color: #409fff; text-decoration: none; }
.wt-files { margin: 8px 0 20px; max-height: 46vh; overflow: auto; border-top: 1px solid #eef0f6; }
.wt-file { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #eef0f6; }
.wt-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 11px 4px; background: none; border: 0; cursor: pointer; font: inherit; color: #111; text-align: left; }
.wt-name span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; } .wt-name small { color: #8a90a2; font-size: 13px; flex: none; }
.wt-name .wt-ic { width: 34px; height: 34px; border-radius: 10px; } .wt-name .wt-ic svg { width: 17px; height: 17px; }
.wt-dl { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #409fff; flex: none; } .wt-dl:hover { background: #eaf2ff; } .wt-dl svg { width: 18px; height: 18px; }
.wt-empty { padding: 28px; text-align: center; color: #8a90a2; }
.wt-foot { text-align: center; color: #8a90a2; font-size: 13px; }
@media (max-width: 520px) { .wt-card { padding: 28px 20px 22px; border-radius: 18px; } .wt-page { padding: 16px 12px; } }

/* Strong password helper */
.pwtools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.pwtools .btn { padding: 6px 11px; font-size: 13px; }
.pwhint { font-size: 13px; color: var(--muted); } .pwhint.bad { color: #d92d20; } .pwhint.good { color: #1a9d4b; }
.auth.login .pwtools .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.auth.login .pwhint { color: rgba(255,255,255,.65); } .auth.login .pwhint.bad { color: #ff8a80; } .auth.login .pwhint.good { color: #6be08f; }
.pwtools .btn, .auth .pwtools .btn { width: auto; flex: 1 1 0; height: 38px; margin: 0; border-radius: 99px; }
.pwtools .pwhint { flex: 1 1 100%; }
@media (max-width: 760px) { .bar .search { order: -1; } .bar h2 { order: -2; } .check { align-items: flex-start; } .check input { margin-top: 3px; } }
