:root {
  --bg: #f4f6f7; --card: #ffffff; --text: #1f2933; --muted: #616e7c; --line: #dde3e7;
  --brand: #0f5c63; --brand-2: #e6f1f2; --danger: #b42318; --danger-2: #fdecea; --ok: #1d7a46; --ok-2: #e7f5ec;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111719; --card: #1a2225; --text: #e7ecee; --muted: #9aa8b0; --line: #2c373b;
    --brand: #4fb3bb; --brand-2: #17343a; --danger: #ff8a7a; --danger-2: #3a1f1c; --ok: #6fd39b; --ok-2: #173326;
    --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: var(--brand); font-weight: 600; }
.small { font-size: 13px; }
.pad { padding: 0 16px; }
h1 { font-size: 24px; margin: 18px 0 6px; }
h2 { font-size: 20px; margin: 0; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 24px; }
.login { width: 100%; max-width: 420px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand.small { font-size: 16px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type=email] { width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); }
input:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 9px 14px; border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b1a1c; } }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.wide { width: 100%; margin-top: 16px; padding: 12px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 8px 0; margin-top: 8px; }
.msg { min-height: 1.5em; color: var(--danger); margin: 10px 0 0; }

.steps { padding-left: 22px; margin: 14px 0; color: var(--muted); }
.steps li { margin: 6px 0; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.done { color: var(--ok); }
.otp { display: block; width: 100%; margin-top: 18px; padding: 12px; text-align: center; font-size: 34px; font-weight: 800;
  letter-spacing: .25em; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); }
.otp::placeholder { color: var(--line); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.status { text-align: center; color: var(--muted); margin: 14px 0 0; }
.status.ok { color: var(--ok); font-weight: 600; }
.status.bad { color: var(--danger); font-weight: 600; }

.top { display: flex; align-items: center; gap: 20px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.storage { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.storage .bar { width: 140px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
#storage-fill { height: 100%; background: var(--brand); width: 0; }
.storage.full #storage-fill { background: var(--danger); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 62px); }
aside { border-right: 1px solid var(--line); background: var(--card); padding: 12px 0; }
.aside-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 16px 8px; }
.tree-row { display: flex; align-items: stretch; padding-left: calc(6px + var(--lvl, 0) * 18px); }
#folders .tw { flex: 0 0 26px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
#folders .tw:hover { color: var(--brand); }
#folders .fbtn { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; border: 0; background: none; color: var(--text);
  padding: 10px 16px 10px 4px; font: inherit; text-align: left; cursor: pointer; border-radius: 8px 0 0 8px; }
#folders .fbtn:hover { background: var(--bg); }
#folders .fbtn.sel { background: var(--brand-2); font-weight: 700; }
#folders .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.badge.new { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .badge.new { color: #0b1a1c; } }
main { padding: 20px 24px; min-width: 0; }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.folder-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.selbar { display: flex; gap: 20px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.selbar label { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.file { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.file.sel { border-color: var(--brand); }
.file .thumb { height: 140px; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.file .thumb img { display: block; width: 100%; height: 140px; object-fit: cover; object-position: top; }
.file .ext { font-weight: 800; font-size: 20px; color: var(--brand); border: 2px solid currentColor; border-radius: 8px; padding: 10px 12px; }
.file .meta { padding: 8px 10px 10px; background: var(--card); border-top: 1px solid var(--line); }
.file .row { display: flex; align-items: center; gap: 6px; }
.file .row .sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fname { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sub { font-size: 12px; color: var(--muted); }
.file input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--brand); }
.file .tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.tag.printed { background: var(--ok-2); color: var(--ok); }
.tag.noprint { background: var(--danger-2); color: var(--danger); }
.file .open { border: 0; padding: 0; background: none; color: var(--brand); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }

.modal { position: fixed; inset: 0; background: rgba(10,15,18,.45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal .card { width: 100%; max-width: 460px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); }
.print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; }
.countdown { font-size: 40px; font-weight: 800; text-align: center; margin: 12px 0; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  .who { margin-left: 0; width: 100%; justify-content: space-between; }
  main { padding: 16px; }
}
.legal { text-align: center; margin: 18px 0 0; }
.doc { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.doc h1 { font-size: 28px; } .doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc p, .doc li { line-height: 1.6; } .doc ul { padding-left: 22px; }
.notice { background: #fff4d6; color: #5c4400; border: 1px solid #f0d58a; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .notice { background: #3a3014; color: #f3dd9b; border-color: #6b5a24; } }
.gate-icon { font-size: 44px; margin: 18px 0 0; line-height: 1; }
input[type=password] { width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 2px; font-size: 14px; }
.crumbs .crumb { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.crumbs .crumb:hover { background: var(--brand-2); }
.crumbs .sep { color: var(--muted); }
.aside-head.flush { padding: 18px 0 8px; }
.subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.sub-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; cursor: pointer; }
.sub-tile:hover { border-color: var(--brand); }
.sub-tile .ico { grid-row: span 2; font-size: 26px; }
.sub-tile .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-tile .badge { grid-column: 2; justify-self: start; margin-top: 4px; }
.text-input { width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); margin: 6px 0 4px; }
.file .row .open + .open { margin-left: 8px; }
.file .row { flex-wrap: wrap; row-gap: 2px; }
.file .row .sub { flex: 1 1 100%; }
.file .row .open:first-of-type { margin-left: 0; }
