/* vault.samoylik.tech — дизайн «Pro»: те же токены, что у samoylik.tech, mail, meet и theme.css. */
:root {
  --bg: #000; --tile: #161617; --tile-2: #1d1d1f; --field: #0d0d0f;
  --text: #f5f5f7; --muted: #86868b; --soft: #a1a1a6; --hair: rgba(255,255,255,.1);
  --blue: #0071e3; --blue-hover: #0077ed; --link: #2997ff; --green: #30d158; --red: #ff453a;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.32,.72,0,1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 17px/1.47 var(--font);
  -webkit-font-smoothing: antialiased; letter-spacing: -.01em; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.sprite { position: absolute; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 17px; height: 17px; }
.ico.xl { width: 44px; height: 44px; stroke-width: 1.3; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }

/* кнопки */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 500; font-size: 17px; line-height: 1;
  transition: background .3s var(--ease), transform .3s var(--ease), opacity .3s var(--ease);
}
.pill:hover { background: var(--blue-hover); }
.pill:active { transform: scale(.97); }
.pill:disabled { opacity: .45; cursor: default; transform: none; }
.pill.ghost { background: var(--tile-2); color: var(--text); }
.pill.ghost:hover { background: #2c2c2e; }
.pill.sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.pill.wide { width: 100%; }
.pill.danger { color: #ff6961; }
.link { border: 0; background: none; padding: 6px 0; color: var(--link); font-size: 14px; }
.link:hover { text-decoration: underline; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: transparent; color: var(--soft); transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger:hover { color: var(--red); background: rgba(255,69,58,.12); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }

/* шапка */
.gnav {
  position: sticky; top: 0; z-index: 50; background: rgba(0,0,0,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.gnav-in { height: 48px; display: flex; gap: 18px; align-items: center; font-size: 13px; color: #d2d2d7; }
.gnav-in .logo { font-weight: 600; color: #fff; }
.nav-title { color: var(--muted); }
.nav-title::before { content: "/"; margin-right: 18px; color: #3a3a3c; }
.nav-user { margin-left: auto; display: flex; gap: 4px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: #d2d2d7;
  font-size: 13px; padding: 6px 10px; border-radius: 999px; transition: color .3s var(--ease), background .3s var(--ease);
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,.06); }

/* поля */
.form { display: grid; gap: 12px; }
.form.inline { grid-template-columns: 1fr auto; align-items: end; }
.form > .pill.sm { justify-self: start; }
.input { display: grid; gap: 6px; text-align: left; }
.input span { font-size: 13px; color: var(--muted); padding-left: 4px; }
.input input, .input textarea, .name-input.boxed, .search {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--hair);
  background: var(--field); outline: none; font-size: 17px; resize: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.input textarea { font-family: var(--mono); font-size: 15px; text-transform: uppercase; }
.input input:focus, .input textarea:focus, .name-input.boxed:focus, .search:focus { border-color: var(--link); box-shadow: 0 0 0 4px rgba(41,151,255,.18); }
.input input[readonly] { color: var(--soft); }
.hint { margin: 2px 0; font-size: 13px; color: var(--muted); text-align: left; line-height: 1.45; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--soft); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }

/* экран входа */
.auth { position: relative; min-height: calc(100svh - 49px); display: grid; place-items: center; align-content: center; gap: 28px; padding: 56px 16px; overflow: hidden; }
.auth-glow {
  position: absolute; inset: auto 0 -10% 0; height: 70%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 50% 60%, rgba(41,151,255,.22), transparent 70%);
  filter: blur(40px); animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .55; transform: scale(1.08); } }
.auth-card {
  width: min(420px, 100%); text-align: center; padding: 44px 32px 32px; border-radius: 32px;
  background: linear-gradient(180deg, rgba(29,29,31,.92), rgba(22,22,23,.92)); border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.9); animation: rise .9s var(--ease) both;
}
.auth-card h1 { margin: 18px 0 6px; font-size: clamp(34px, 9vw, 46px); overflow-wrap: break-word; }
.auth-sub { margin: 0 0 28px; color: var(--muted); font-size: 15px; }
.auth-msg { min-height: 22px; margin: 16px 0 0; font-size: 14px; color: var(--soft); }
.auth-msg.err { color: #ff6961; }
.auth-foot { max-width: 420px; margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
.seal { position: relative; width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.16); display: grid; place-items: center; }
.seal::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid transparent; transition: border-color .4s; }
.seal .ico { position: absolute; width: 30px; height: 30px; stroke-width: 1.5; transition: opacity .4s var(--ease), transform .5s var(--ease); }
.seal-lock { color: var(--soft); }
.seal-ok { color: var(--green); opacity: 0; transform: scale(.6); }
.seal.busy::after { border-top-color: var(--text); animation: spin 1.1s linear infinite; }
.seal.done { border-color: rgba(48,209,88,.5); box-shadow: 0 0 40px rgba(48,209,88,.25); }
.seal.done .seal-lock { opacity: 0; transform: scale(.6); }
.seal.done .seal-ok { opacity: 1; transform: none; }
.seal.shake { animation: shake .45s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
h1 {
  margin: 0; font: 600 clamp(40px, 7vw, 64px)/1.05 var(--display); letter-spacing: -.035em;
  background: linear-gradient(180deg, #fff 30%, #8e8e93); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.recovery { display: grid; gap: 14px; text-align: left; }
.rec-code, .secret {
  display: block; padding: 16px; border-radius: 14px; background: var(--field); border: 1px dashed rgba(255,255,255,.18);
  font: 600 15px/1.6 var(--mono); letter-spacing: .04em; overflow-wrap: anywhere; color: #fff; user-select: all;
}

/* хранилище */
.vault { padding: 56px 0 96px; animation: rise .8s var(--ease) both; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--green); font-size: 14px; font-weight: 500; }
.usage { margin: 12px 0 8px; color: var(--muted); font-size: 14px; }
.meter { width: min(320px, 70vw); height: 4px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--link)); transition: width 1s var(--ease); }
.actions { display: flex; gap: 10px; }
.toolbar { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.tabs { display: inline-flex; gap: 2px; padding: 2px; background: rgba(118,118,128,.24); border-radius: 10px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tab { flex: none; border: 0; background: transparent; min-height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px; transition: background .25s var(--ease); }
.tab[aria-checked="true"] { background: #636366; color: #fff; }
.tab:not([aria-checked="true"]):hover { background: rgba(255,255,255,.06); }
.search { width: min(280px, 100%); min-height: 38px; padding: 8px 14px; font-size: 15px; border-radius: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; text-align: left; padding: 10px 10px 14px; border: 0; border-radius: 22px;
  background: var(--tile); min-width: 0; animation: tileIn .6s var(--ease) both;
  transition: transform .5s var(--ease), background .35s var(--ease);
}
.tile:hover { transform: translateY(-3px) scale(1.015); background: var(--tile-2); }
.tile:active { transform: scale(.98); }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.thumb {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: #0f0f10; display: grid; place-items: center;
  overflow: hidden; margin-bottom: 12px; color: #48484a;
}
.thumb .ico { width: 42px; height: 42px; stroke-width: 1.2; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease), transform .8s var(--ease); transform: scale(1.04); }
.thumb img.on { opacity: 1; transform: none; }
.thumb[data-kind="doc"] { color: #64a8ff; }
.thumb[data-kind="archive"] { color: #ffb340; }
.thumb[data-kind="photo"] { color: #bf5af2; }
.ext { position: absolute; right: 8px; bottom: 8px; font: 600 10px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); background: rgba(0,0,0,.55); padding: 4px 6px; border-radius: 6px; }
.tile-name { font-size: 14px; font-weight: 500; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { font-size: 12px; color: var(--muted); padding: 2px 4px 0; }
.tile.broken .tile-name { color: #ff6961; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 96px 16px; color: var(--muted); border: 1.5px dashed rgba(255,255,255,.1); border-radius: 28px; animation: rise .8s var(--ease) both; }
.empty b { color: var(--text); font: 600 24px/1.2 var(--display); letter-spacing: -.02em; margin-top: 8px; }
.empty p { margin: 0; max-width: 28em; font-size: 15px; }

/* перетаскивание */
.drop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: fade .25s var(--ease); pointer-events: none; }
.drop > div { display: grid; justify-items: center; gap: 14px; padding: 64px 72px; border-radius: 32px; border: 2px dashed rgba(41,151,255,.7); color: var(--link); animation: pulse 1.6s ease-in-out infinite; text-align: center; }
.drop b { color: #fff; font: 600 22px/1.2 var(--display); }
@keyframes pulse { 50% { box-shadow: 0 0 60px rgba(41,151,255,.35); border-color: var(--link); } }
@keyframes fade { from { opacity: 0; } }

/* загрузки */
.uploads { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; width: min(340px, calc(100% - 32px)); }
.up {
  padding: 12px 14px; border-radius: 16px; background: rgba(29,29,31,.88); border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 20px 40px -20px #000;
  animation: slideIn .5s var(--ease) both; font-size: 13px;
}
.up.out { animation: slideOut .4s var(--ease) both; }
.up-row { display: flex; justify-content: space-between; gap: 10px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.up-state { color: var(--muted); flex: none; }
.up.ok .up-state { color: var(--green); }
.up.err .up-state { color: #ff6961; }
.up-bar { height: 3px; margin-top: 9px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--link); transition: width .3s var(--ease); }
.up.ok .up-bar i { background: var(--green); }
@keyframes slideIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(30px); } }

/* окна */
dialog.sheet {
  padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 28px; background: var(--tile); color: var(--text);
  width: min(960px, calc(100% - 32px)); max-height: calc(100svh - 48px); box-shadow: 0 60px 120px -40px #000;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: pop .45s var(--ease); }
dialog.sheet::backdrop { background: rgba(0,0,0,.66); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 24px; border-bottom: 1px solid var(--hair); }
.sheet-title { min-width: 0; flex: 1; display: grid; }
.sheet-title b { font: 600 19px/1.3 var(--display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-title span { color: var(--muted); font-size: 13px; }
.sheet-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.viewer { height: calc(100svh - 48px); }
.viewer-body { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; background: #0a0a0b; border-radius: 0 0 28px 28px; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: calc(100svh - 130px); object-fit: contain; animation: fade .5s var(--ease); }
.viewer-body audio { width: min(520px, 90%); }
.viewer-body pre {
  align-self: stretch; justify-self: stretch; margin: 0; padding: 24px 28px; white-space: pre-wrap; word-break: break-word;
  font: 14px/1.65 var(--mono); color: #e5e5ea; tab-size: 4; animation: fade .4s var(--ease);
}
.v-state { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--muted); font-size: 15px; }
.v-state b { color: var(--text); font: 600 21px/1.2 var(--display); }
.v-state .ico.xl { color: #48484a; }
.ring { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--text); animation: spin 1s linear infinite; }
.zip { align-self: start; justify-self: stretch; padding: 16px 20px 28px; }
.zip p { margin: 0 4px 12px; color: var(--muted); font-size: 13px; }
.zip ul { list-style: none; margin: 0; padding: 0; }
.zip li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.zip li:nth-child(odd) { background: rgba(255,255,255,.03); }
.zip li span:first-child { overflow-wrap: anywhere; }
.zip li span:last-child { color: var(--muted); flex: none; }
.zip li.dir span:first-child { color: var(--soft); }
.editor { height: calc(100svh - 48px); }
.name-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: 600 19px/1.3 var(--display); letter-spacing: -.02em; padding: 6px 0; }
.name-input.boxed { font: 17px/1.3 var(--font); padding: 12px 16px; }
.ed-text { flex: 1; width: 100%; border: 0; outline: none; resize: none; padding: 24px 28px; background: #0a0a0b; color: #e5e5ea; font: 14px/1.65 var(--mono); border-radius: 0 0 28px 28px; tab-size: 4; }
.settings { width: min(640px, calc(100% - 32px)); }
.settings-body { overflow: auto; padding: 16px; display: grid; gap: 12px; }
.card { background: var(--field); border-radius: 20px; padding: 22px; display: grid; gap: 14px; }
.card h3 { margin: 0; font: 600 19px/1.2 var(--display); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.badge { font: 600 11px/1 var(--font); padding: 5px 8px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); letter-spacing: .02em; }
.badge.on { background: rgba(48,209,88,.15); color: var(--green); }
.totp-setup { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; margin-top: 4px; }
.totp-setup canvas { border-radius: 14px; background: #fff; width: 168px; height: 168px; image-rendering: pixelated; }
.totp-setup .secret { margin: 8px 0 14px; font-size: 13px; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 280px; overflow: auto; }
.events li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 10px; border-radius: 10px; font-size: 13px; }
.events li:nth-child(odd) { background: rgba(255,255,255,.03); }
.events b { font-weight: 500; }
.events b.bad { color: #ff6961; }
.events small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.events time { color: var(--muted); }
.settings-msg { margin: 0; min-height: 20px; text-align: center; font-size: 14px; color: var(--green); }
.settings-msg.err { color: #ff6961; }
.ask { width: min(420px, calc(100% - 32px)); }
.ask-body { display: grid; gap: 14px; padding: 24px; }
.ask-body b { font: 600 21px/1.25 var(--display); letter-spacing: -.02em; }

@media (max-width: 720px) {
  .vault { padding-top: 36px; }
  .vhead { align-items: stretch; flex-direction: column; }
  .actions .pill { flex: 1; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { border-radius: 18px; padding: 8px 8px 12px; }
  .nav-btn { font-size: 0; gap: 0; padding: 8px; }
  .nav-btn .ico { width: 19px; height: 19px; }
  #settingsBtn { font-size: 13px; }
  dialog.sheet { width: 100%; max-width: 100%; max-height: 100svh; border-radius: 22px 22px 0 0; margin: auto 0 0; }
  .viewer, .editor { height: calc(100svh - 12px); }
  .viewer-body, .ed-text { border-radius: 0; }
  .sheet-head { padding-left: 16px; }
  .icon-btn { width: 36px; height: 36px; }
  .totp-setup { grid-template-columns: 1fr; }
  .form.inline { grid-template-columns: 1fr; }
  .auth-card { padding: 36px 20px 24px; border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
