:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #e5eaf1;
  --text: #111827;
  --muted: #7b8494;
  --accent: #178eea;
  --accent-soft: #e9f5ff;
  --danger: #c43060;
  --success: #335d48;
  --warning: #a87809;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Prompt", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100dvh; }
.login-locked, .login-locked body { height: 100dvh; overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(23, 142, 234, .2);
  outline-offset: 2px;
}
img { max-width: 100%; }
a { color: var(--accent); overflow-wrap: anywhere; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none; }

.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 12;
  display: flex;
  width: 250px;
  flex-direction: column;
  padding: 26px 18px calc(22px + var(--safe-bottom));
  border-right: 1px solid rgba(219, 226, 236, .9);
  background: rgba(255, 255, 255, .88);
  box-shadow: 10px 0 32px rgba(29, 51, 78, .035);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}
.app-brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 24px; font-size: 20px; font-weight: 750; letter-spacing: -.35px; }
.app-brand img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(35, 160, 231, .16)); }
.side-nav { display: grid; gap: 6px; }
.nav-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 13px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #657084;
  cursor: pointer;
  font-size: 14px;
  font-weight: 630;
  text-align: left;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: #f2f6fa; color: #263448; }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: var(--accent-soft); color: #087ac8; }
.nav-item svg { flex: 0 0 auto; }
.storage-links { display: grid; gap: 2px; margin: 0 0 3px 46px; }
.storage-links button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7a8495;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.storage-links button.active { background: #eef5fb; color: var(--accent); font-weight: 650; }
.sidebar-user { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

.workspace { min-height: 100dvh; margin-left: 250px; padding: 0 34px 48px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 102px;
  padding: 24px 0 18px;
  background: linear-gradient(to bottom, rgba(244, 247, 251, .98) 72%, rgba(244, 247, 251, 0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.topbar h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.12; letter-spacing: -.8px; }
.primary-button, .secondary-button, .danger-button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 670;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.primary-button { border: 0; background: linear-gradient(145deg, #20bce9, #2789f2); color: #fff; box-shadow: 0 9px 22px rgba(31, 142, 228, .22); }
.primary-button:hover { filter: brightness(1.035); }
.primary-button:active, .secondary-button:active, .danger-button:active { transform: scale(.98); }
.primary-button svg { width: 18px; height: 18px; stroke-width: 2.2; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: #344054; }
.danger-button { border: 1px solid #f2c8d6; background: #fff1f6; color: var(--danger); }
.text-button { min-height: 36px; padding: 7px 10px; border: 0; background: transparent; color: var(--accent); }
.text-button.danger { color: var(--danger); }
.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #526072;
  cursor: pointer;
}
.icon-button:hover { background: #f5f8fb; }
.icon-button svg { width: 18px; height: 18px; }

.storage-tabs { display: flex; gap: 5px; width: max-content; max-width: 100%; margin: 0 auto 18px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.78); overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.storage-tabs button { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 7px; padding: 8px 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; scroll-snap-align: center; }
.storage-tabs button.active { background: #fff; color: var(--text); font-weight: 680; box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.content { width: min(100%, 1080px); margin: 0 auto; }
.content-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box svg { position: absolute; top: 50%; left: 15px; width: 19px; height: 19px; color: #8490a2; transform: translateY(-50%); pointer-events: none; }
.search-box input { width: 100%; height: 46px; padding: 0 16px 0 46px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); outline: 0; box-shadow: 0 4px 12px rgba(0,0,0,.035); }
.search-box input:focus { border-color: rgba(23,142,234,.4); box-shadow: 0 0 0 3px rgba(23,142,234,.09); }

.item-list { display: grid; gap: 10px; }
.item-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  color: inherit;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
button.item-row { cursor: pointer; }
.item-row:hover { transform: translateY(-1px); border-color: #d7e2ed; box-shadow: 0 9px 24px rgba(27,52,79,.075); }
.service-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, #29d3e9, #3887f5);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 7px 14px rgba(30, 143, 220, .16);
  font-size: 19px;
  font-weight: 760;
  text-transform: uppercase;
}
.service-icon img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.service-icon > span, .service-icon > img { grid-area: 1 / 1; }
.service-icon > img { position: relative; z-index: 1; }
.item-main { min-width: 0; }
.row-main-button { display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.item-title { margin: 0 0 3px; font-size: 15px; font-weight: 720; line-height: 1.35; }
.item-subtitle { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.item-owner { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; background: #eef5fb; color: #2f6f9f; font-size: 10px; font-weight: 700; line-height: 1.2; }
.chip:nth-child(3n+2) { background: #f1edff; color: #6953a8; }
.chip:nth-child(3n) { background: #ecf8f0; color: #3e7455; }
.chip.permission { background: #fff5df; color: #946515; }
.chip.shared { background: #eaf7ff; color: #177bb7; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions .icon-button { width: 38px; height: 38px; }
.row-chevron { color: #a3adba; }
.personal-group { display: grid; gap: 8px; }
.personal-group-row .item-main { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 7px 9px; }
.personal-group-row .item-title { margin: 0; }
.group-count { flex: 0 0 auto; }
.personal-group-row .row-chevron { transition: transform .16s ease; }
.personal-group.expanded .personal-group-row .row-chevron { transform: rotate(90deg); }
.personal-group-children { display: grid; gap: 8px; padding-left: 26px; }
.personal-group-children[hidden] { display: none; }
.personal-child-row { background: rgba(255,255,255,.72); box-shadow: 0 3px 9px rgba(0,0,0,.025); }

.empty-state, .loading-state, .error-state {
  display: grid;
  min-height: 270px;
  place-items: center;
  padding: 36px 20px;
  border: 1px dashed #d7dfe9;
  border-radius: 18px;
  background: rgba(255,255,255,.52);
  color: var(--muted);
  text-align: center;
}
.empty-state strong, .error-state strong { display: block; margin-bottom: 6px; color: #445166; font-size: 16px; }
.empty-state p, .error-state p { margin: 0; font-size: 13px; }
.spinner { width: 28px; height: 28px; border: 3px solid #dce5ed; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { color: var(--text); }
.app-dialog, .confirm-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: auto; }
.app-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(25, 35, 49, .52); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog-card {
  width: min(680px, calc(100vw - 36px));
  max-height: calc(100dvh - 44px);
  margin: 22px auto;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(20,34,52,.28);
  animation: dialogIn .24s cubic-bezier(.2,.8,.2,1) both;
}
.dialog-card > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.dialog-card > header h2 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.dialog-card > footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding: 16px 22px 22px; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 20px 22px 24px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: #596579; font-size: 12px; font-weight: 680; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dfe5ed;
  border-radius: var(--radius);
  background: #fbfcfe;
  outline: 0;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(23,142,234,.48); background: #fff; box-shadow: 0 0 0 3px rgba(23,142,234,.08); }
.form-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.file-picker { position: relative; display: grid; min-height: 132px; place-items: center; padding: 18px; border: 1.5px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; color: #667085; text-align: center; cursor: pointer; }
.file-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview { max-height: 220px; margin-top: 10px; border-radius: 12px; object-fit: contain; }
.upload-preview.pdf { width: 100%; height: 220px; border: 0; }
.clipboard-helper { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.detail-hero { display: flex; align-items: center; gap: 14px; min-width: 0; }
.detail-hero .service-icon { width: 48px; height: 48px; flex: 0 0 auto; }
.detail-hero h2 { margin: 0 0 2px; }
.detail-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.wallet-card {
  margin: 20px 22px 8px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(145deg, #162e52, #1d70a7 55%, #20b6ca);
  color: #fff;
  box-shadow: 0 20px 38px rgba(22,63,105,.23), inset 0 1px 0 rgba(255,255,255,.3);
}
.wallet-card.bank { background: linear-gradient(145deg, #1c2330, #434d60 58%, #7c8ba5); }
.wallet-card.api { background: linear-gradient(145deg, #3c266d, #5d4cb2 58%, #4a9bd2); }
.detail-fields { display: grid; gap: 1px; margin: 12px 0; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.12); }
.detail-field { display: grid; grid-template-columns: minmax(105px, .42fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; background: rgba(12,28,51,.18); }
.detail-field > span:first-child { color: rgba(255,255,255,.72); font-size: 11px; }
.detail-value { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; font-weight: 590; }
.detail-value.masked { letter-spacing: .16em; }
.field-tools { display: flex; gap: 5px; }
.field-tools button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.field-tools svg { width: 16px; height: 16px; }
.metadata { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; color: rgba(255,255,255,.7); font-size: 10px; }
.view-only-note { padding: 13px; color: rgba(255,255,255,.82); font-size: 12px; line-height: 1.5; }
.recipients { margin: 0 22px 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; color: #596579; font-size: 12px; line-height: 1.6; }

.share-list, .admin-list, .identity-list { display: grid; gap: 9px; padding: 18px 22px 22px; }
.share-user, .admin-user, .identity-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
.share-user input { width: 19px; height: 19px; accent-color: var(--accent); }
.share-user select { max-width: 142px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.share-user strong, .admin-user strong { display: block; font-size: 13px; }
.share-user small, .admin-user small { color: var(--muted); }
.share-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 0 22px 22px; }

.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.035); }
.panel.full { grid-column: 1 / -1; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 17px; }
.panel-actions { display: flex; margin-top: 20px; }
.muted-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.user-summary { display: flex; align-items: center; gap: 13px; }
.user-avatar { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 750; }
.user-summary p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.link-code { padding: 16px; border-radius: 14px; background: #f0f7fc; color: #23648e; text-align: center; }
.link-code strong { display: block; margin: 6px 0; font-size: 24px; letter-spacing: .18em; }
.identity-list.compact { padding: 0; }
.identity-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 750; text-transform: uppercase; }
.identity-row strong, .identity-row small { display: block; }
.identity-row small { margin-top: 2px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.primary-button[disabled], .secondary-button[disabled] { cursor: wait; opacity: .6; }
.admin-user { grid-template-columns: minmax(0,1fr) auto; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.admin-actions button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #526072; cursor: pointer; font-size: 11px; }

.confirm-dialog { display: none; place-items: center; }
.confirm-dialog[open] { display: grid; }
.confirm-card { width: min(400px, calc(100vw - 34px)); padding: 24px; border: 0; border-radius: 20px; background: #fff; text-align: center; box-shadow: 0 24px 70px rgba(20,34,52,.3); }
.confirm-icon { display: grid; width: 42px; height: 42px; margin: 0 auto 12px; place-items: center; border-radius: 50%; background: #fff1f6; color: var(--danger); font-weight: 800; }
.confirm-card h2 { margin: 0 0 8px; font-size: 20px; }
.confirm-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.button-row { display: flex; justify-content: center; gap: 9px; }

.toast {
  --toast-bg: #f0fbfe;
  --toast-primary: #0e86be;
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 80;
  width: max-content;
  min-width: min(22rem, calc(100vw - 32px));
  max-width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  border-left: 4px solid var(--toast-primary);
  border-radius: 10px;
  color: var(--toast-primary);
  background: var(--toast-bg);
  box-shadow: 0 18px 50px rgba(15,23,42,.2);
  transform: translate(-50%,30px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.toast[data-type="success"] { --toast-bg: #ecfbf2; --toast-primary: #335d48; }
.toast[data-type="failure"] { --toast-bg: #fff1f6; --toast-primary: #c43060; }
.toast[data-type="warning"] { --toast-bg: #fff9eb; --toast-primary: #a87809; }
.toast[data-type="info"] { --toast-bg: #f0fbfe; --toast-primary: #0e86be; }
.toast.show { animation: toast-fade 3s linear both; }
.toast__body { display: flex; align-items: center; gap: 9px; min-height: 58px; padding: 14px 13px; font-size: 14px; font-weight: 750; line-height: 1.4; }
.toast__icon { display: inline-grid; flex: 0 0 26px; width: 26px; height: 26px; place-items: center; border: 2px solid currentColor; border-radius: 50%; }
.toast__icon svg { width: 16px; height: 16px; stroke-width: 2.6; }
.toast__progress { position: absolute; left: 4px; bottom: 3px; width: calc(100% - 8px); height: 3px; border-radius: 999px; background: linear-gradient(to right,var(--toast-bg),var(--toast-primary)); transform: scaleX(0); transform-origin: left; }
.toast.show .toast__progress { animation: toast-progress 2.5s .3s linear both; }
@keyframes toast-fade { 0% { opacity:0; visibility:hidden; transform:translate(-50%,30px); } 5%,95% { opacity:1; visibility:visible; transform:translate(-50%,0); } 100% { opacity:0; visibility:hidden; transform:translate(-50%,0); } }
@keyframes toast-progress { to { transform: scaleX(1); } }

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at 50% 28%, rgba(255,255,255,.46) 0 8%, rgba(255,255,255,.16) 25%, transparent 52%), linear-gradient(145deg,#d8dee7 0%,#c7cfda 100%);
}
.login-gate[hidden] { display: none; }
.login-card {
  position: relative;
  width: min(100%, 430px);
  padding: 34px 28px 28px;
  border-radius: 28px;
  background: linear-gradient(145deg,rgba(255,255,255,.985) 0%,rgba(252,253,255,.97) 48%,rgba(239,243,248,.98) 100%);
  box-shadow: -24px -24px 42px rgba(255,255,255,.9),30px 34px 62px rgba(82,94,112,.5),0 18px 34px rgba(71,83,101,.28),inset 2px 2px 0 #fff,inset -2px -2px 0 rgba(145,156,173,.34),inset 0 12px 24px rgba(255,255,255,.3),inset 0 -14px 26px rgba(134,145,163,.08);
  animation: loginCardIn .72s cubic-bezier(.16,1,.3,1) both;
}
.login-card::before, .login-card::after { content:""; position:absolute; inset:1px; border-radius:inherit; pointer-events:none; }
.login-card::before { border-top:1px solid rgba(255,255,255,.98); border-left:1px solid rgba(255,255,255,.98); }
.login-card::after { inset:0; border-right:1px solid rgba(112,124,142,.3); border-bottom:1px solid rgba(112,124,142,.36); }
.login-brand { display:flex; flex-direction:column; align-items:center; margin-bottom:28px; }
.login-brand img { width:74px; height:74px; object-fit:contain; filter:drop-shadow(0 9px 15px rgba(38,154,235,.14)); }
.login-brand h1 { margin:12px 0 0; font-size:25px; line-height:1.12; font-weight:720; letter-spacing:-.55px; }
.login-field { position:relative; display:grid; grid-template-columns:48px minmax(0,1fr) 48px; column-gap:10px; align-items:center; min-height:58px; overflow:hidden; border:1px solid rgba(255,255,255,.78); border-radius:18px; background:#e9eef4; box-shadow:inset 7px 8px 15px rgba(121,135,155,.27),inset -6px -6px 13px rgba(255,255,255,.96),0 2px 2px rgba(255,255,255,.92); transition:box-shadow .22s ease,background .22s ease; }
.login-field:focus-within { background:#f1f5f9; box-shadow:inset 3px 4px 9px rgba(126,143,165,.16),inset -4px -4px 9px rgba(255,255,255,.98),0 0 0 3px rgba(34,183,238,.11),0 8px 20px rgba(96,133,171,.1); }
.login-field.invalid { animation: shake .34s ease; box-shadow: inset 4px 5px 10px rgba(129,145,166,.18),inset -4px -4px 10px rgba(255,255,255,.96),0 0 0 3px rgba(209,67,67,.11); }
.id-card-icon { width:20px; height:20px; justify-self:center; color:#6b7687; }
#loginId { width:100%; height:56px; min-width:0; padding:0; border:0; outline:0; background:transparent; color:#168fe5; text-align:center; font-size:18px; font-weight:720; letter-spacing:1.35px; caret-color:#168fe5; }
#loginId::placeholder { color:#a2aab7; font-weight:560; letter-spacing:.05px; }
.login-eye { display:grid; width:40px; height:40px; place-items:center; justify-self:center; padding:0; border:0; border-radius:14px; background:transparent; color:#9aa3af; cursor:pointer; }
.login-eye[aria-pressed="true"] { color:#111; }
.login-eye:hover { background:rgba(104,120,143,.08); }
.login-eye:active { transform:scale(.93); }
.login-eye svg { width:20px; height:20px; }
.login-submit { display:grid; width:58px; height:54px; margin:18px auto 0; place-items:center; border:1px solid rgba(255,255,255,.9); border-radius:17px; background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(241,245,250,.96)); color:#111827; cursor:pointer; box-shadow:-7px -7px 14px rgba(255,255,255,.96),7px 9px 18px rgba(122,141,168,.3),inset 0 1px 0 rgba(255,255,255,.96); transition:transform .16s ease,box-shadow .16s ease; }
.login-submit:hover { transform:translateY(-1px); box-shadow:-8px -8px 16px rgba(255,255,255,.98),9px 11px 21px rgba(122,141,168,.32),inset 0 1px 0 rgba(255,255,255,.98); }
.login-submit:active { transform:translateY(1px) scale(.995); box-shadow:inset 4px 5px 10px rgba(127,145,170,.19),inset -4px -4px 10px rgba(255,255,255,.95),0 4px 8px rgba(112,130,155,.12); }
.login-submit svg { width:23px; height:23px; stroke-width:2.2; }
.login-submit[disabled] { cursor:wait; opacity:.65; }
@keyframes loginCardIn { from { opacity:0; transform:translateY(24px) scale(.965) rotateX(2.5deg); } }
@keyframes shake { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-5px); } 50% { transform:translateX(4px); } 75% { transform:translateX(-2px); } }

.mobile-nav { display:none; }

@media (max-width: 800px) {
  .sidebar { display:none; }
  .workspace { margin-left:0; padding:0 18px calc(var(--nav-height) + var(--safe-bottom) + 26px); }
  .topbar { min-height:90px; padding-top:max(18px,env(safe-area-inset-top)); }
  .topbar .primary-button span { display:none; }
  .topbar .primary-button { width:42px; height:42px; padding:0; border-radius:50%; }
  .mobile-nav { position:fixed; inset:auto 0 0; z-index:20; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); min-height:calc(var(--nav-height) + var(--safe-bottom)); padding:7px 4px calc(7px + var(--safe-bottom)); border-top:1px solid rgba(218,225,234,.9); background:rgba(255,255,255,.92); box-shadow:0 -8px 24px rgba(22,39,61,.06); backdrop-filter:blur(20px) saturate(150%); -webkit-backdrop-filter:blur(20px) saturate(150%); }
  .mobile-nav .nav-item { display:flex; min-width:0; min-height:54px; flex-direction:column; justify-content:center; gap:3px; padding:4px 1px; border-radius:11px; font-size:9px; text-align:center; }
  .mobile-nav .nav-item svg { width:21px; height:21px; }
  .content { width:100%; }
  .storage-tabs { max-width:100%; }
  .account-grid { grid-template-columns:1fr; }
  .panel.full { grid-column:auto; }
}

@media (max-width: 560px) {
  .workspace { padding-right:14px; padding-left:14px; }
  .topbar h1 { font-size:26px; }
  .content-toolbar { margin-bottom:13px; }
  .item-row { grid-template-columns:46px minmax(0,1fr) auto; gap:11px; padding:12px; border-radius:14px; }
  .service-icon { width:46px; height:46px; border-radius:12px; }
  .item-title { font-size:14px; }
  .item-subtitle { font-size:12px; }
  .personal-group-children { padding-left:14px; }
  .dialog-card { width:100%; min-height:0; max-height:calc(100dvh - 10px); margin:10px 0 0; border-radius:22px 22px 0 0; }
  .app-dialog { align-items:end; }
  .app-dialog[open] { display:grid; }
  .detail-dialog .dialog-card { min-height:calc(100dvh - 10px); }
  .sheet-dialog .dialog-card { margin-top:auto; max-height:82dvh; }
  .form-grid { grid-template-columns:1fr; padding:18px 16px calc(22px + var(--safe-bottom)); }
  .field.full, .form-actions { grid-column:auto; }
  .dialog-card > header { padding:17px 16px 13px; }
  .dialog-card > footer { padding:14px 16px calc(18px + var(--safe-bottom)); }
  .wallet-card { margin:16px 12px 8px; padding:17px 14px; border-radius:18px; }
  .detail-field { grid-template-columns:minmax(82px,.38fr) minmax(0,1fr) auto; gap:7px; padding:9px; }
  .detail-field > span:first-child { font-size:10px; }
  .detail-value { font-size:12px; }
  .recipients { margin:0 12px 14px; }
  .share-list, .admin-list, .identity-list { padding:15px 14px 18px; }
  .share-user { grid-template-columns:auto minmax(0,1fr); }
  .share-user select { grid-column:2; max-width:none; width:100%; }
  .share-actions { padding:0 14px calc(18px + var(--safe-bottom)); }
  .admin-user { grid-template-columns:1fr; }
  .admin-actions { justify-content:flex-start; }
  .toast { bottom:calc(var(--nav-height) + var(--safe-bottom) + 12px); }
  .login-card { padding:30px 20px 22px; border-radius:26px; }
  .login-brand { margin-bottom:24px; }
  .login-brand img { width:68px; height:68px; }
}

@media (min-width: 1440px) {
  .workspace { padding-right:58px; padding-left:58px; }
  .content { width:min(100%,1180px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
  .toast.show { animation:toast-fade-reduced 3s linear both; }
  @keyframes toast-fade-reduced { 0% { opacity:0; visibility:hidden; } 1%,99% { opacity:1; visibility:visible; } 100% { opacity:0; visibility:hidden; } }
}
