:root {
  --forest: #09152b;
  --forest-2: #102141;
  --forest-3: #18325f;
  --sage: #8090ad;
  --sand: #e9edf7;
  --cream: #f4f6fb;
  --paper: #ffffff;
  --clay: #5f7ec7;
  --gold: #d7b77a;
  --ink: #0d1525;
  --muted: #6c7993;
  --line: rgba(13, 21, 37, .12);
  --soft-line: rgba(13, 21, 37, .08);
  --shadow: 0 18px 45px rgba(9, 21, 43, .12);
  --shadow-sm: 0 8px 22px rgba(9, 21, 43, .07);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); font-family: "DM Sans", system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(24,50,95,.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(16,33,65,.10), transparent 26%),
    linear-gradient(180deg, #f4f7fc 0%, #fbfcff 52%, #eef2f9 100%);
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a, button, details, summary { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1100px, calc(100% - 30px)); margin-inline: auto; position: relative; z-index: 2; }
.ambient { position: fixed; border-radius: 50%; opacity: .55; pointer-events: none; z-index: 0; filter: blur(4px); }
.ambient-one { width: 320px; height: 320px; background: rgba(24,50,95,.12); top: -120px; right: -80px; }
.ambient-two { width: 260px; height: 260px; background: rgba(16,33,65,.10); left: -110px; bottom: 5vh; }
.ambient-three { width: 180px; height: 180px; background: rgba(215,183,122,.10); right: 12%; top: 28%; }
.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  padding-top: 8px;
  backdrop-filter: blur(14px);
}
.brand { color: inherit; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  color: #fff; background: linear-gradient(145deg, var(--forest), var(--forest-3));
  box-shadow: 0 8px 24px rgba(9,21,43,.28); font: 800 24px/1 "Manrope", sans-serif; letter-spacing: -2px;
}
.brand-mark span { color: var(--gold); }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font: 800 16px/1.1 "Manrope", sans-serif; letter-spacing: -.4px; }
.brand-copy small { color: var(--muted); margin-top: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .unlock-button, .refresh-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  color: var(--forest);
  min-height: 42px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow: var(--shadow-sm);
}
.icon-button { width: 42px; }
.unlock-button, .refresh-button { padding: 0 14px; gap: 8px; font-weight: 700; }
.unlock-button { background: linear-gradient(145deg, var(--forest), var(--forest-2)); color: #fff; border-color: transparent; }
.icon-button:hover, .refresh-button:hover, .icon-button:focus-visible, .refresh-button:focus-visible {
  background: #fff; border-color: rgba(9,21,43,.20); transform: translateY(-1px); outline: none;
}
.unlock-button:hover, .unlock-button:focus-visible { background: linear-gradient(145deg, var(--forest-2), var(--forest-3)); transform: translateY(-1px); outline: none; }
.main-content { padding-top: 14px; padding-bottom: 52px; }
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: stretch;
  margin: 14px 0 18px;
}
.hero-copy-block,
.hero-side {
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
}
.hero-copy-block { padding: 22px 24px; position: relative; overflow: hidden; min-height: 132px; display: flex; flex-direction: column; justify-content: center; }
.hero-copy-block::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -68px;
  top: -68px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24,50,95,.15), transparent 70%);
}
.hero-side { padding: 14px; display: flex; align-items: center; min-width: 220px; }
.eyebrow { margin: 0 0 10px; color: var(--clay); font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.hero-copy-block h1 { margin: 0; font: 800 clamp(32px, 4vw, 54px)/.98 "Manrope", sans-serif; letter-spacing: -2.4px; max-width: 640px; }
.hero-copy-block h1 span { color: var(--forest-2); }
.status-card {
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(9,21,43,.96), rgba(16,33,65,.94));
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 32px rgba(9,21,43,.18);
  display: flex;
  gap: 10px;
  align-items: center;
}
.status-card strong, .status-card small { display: block; }
.status-card strong { font-size: 13px; }
.status-card small { color: rgba(255,255,255,.72); font-size: 11px; margin-top: 3px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(215,183,122,.12); }
.status-dot.online { background: #76a3ff; box-shadow: 0 0 0 5px rgba(118,163,255,.12); }
.status-dot.offline { background: #c28aa1; box-shadow: 0 0 0 5px rgba(194,138,161,.12); }
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 16px; }
.search-wrap {
  height: 50px; background: rgba(255,255,255,.84); border: 1px solid var(--line); border-radius: 16px;
  display: flex; align-items: center; gap: 10px; padding: 0 15px; transition: border-color .2s, box-shadow .2s, background .2s; box-shadow: var(--shadow-sm);
}
.search-wrap:focus-within { background: #fff; border-color: rgba(9,21,43,.35); box-shadow: 0 0 0 4px rgba(24,50,95,.10); }
.search-wrap svg { color: var(--sage); }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-wrap input::placeholder { color: #99a5bb; }
.refresh-button { height: 50px; padding-inline: 16px; background: rgba(255,255,255,.84); }
.refresh-button.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.message {
  margin: 0 0 14px; border: 1px solid rgba(24,50,95,.18); background: rgba(24,50,95,.08);
  border-radius: 14px; padding: 12px 14px; color: #28477d; font-size: 13px;
}
.groups { display: grid; gap: 12px; }
.group {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 7px 24px rgba(9,21,43,.04);
  transition: background .2s, box-shadow .2s, transform .2s;
}
.group[open] { background: rgba(255,255,255,.98); box-shadow: var(--shadow); }
.group summary {
  list-style: none; min-height: 60px; display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 12px; padding: 13px 16px; cursor: pointer; user-select: none;
}
.group summary::-webkit-details-marker { display: none; }
.group-badge {
  width: 38px; height: 38px; border-radius: 14px;
  background: linear-gradient(145deg, #edf3ff, #dce8fb);
  color: var(--forest); display: grid; place-items: center; font: 800 12px/1 "Manrope", sans-serif;
}
.group-title strong { display: block; font: 700 16px/1.25 "Manrope", sans-serif; }
.group-title small { color: var(--muted); font-size: 12px; }
.chevron { color: var(--sage); transition: transform .2s ease; }
.group[open] .chevron { transform: rotate(180deg); }
.link-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; padding: 0 12px 12px; }
.link-card {
  min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; padding: 10px 11px; border-radius: 18px; background: #fff;
  border: 1px solid rgba(13,21,37,.08); box-shadow: 0 5px 14px rgba(9,21,43,.025);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.link-card:hover { transform: translateY(-2px); border-color: rgba(9,21,43,.20); box-shadow: 0 10px 20px rgba(9,21,43,.07); }
.link-photo {
  width: 38px; height: 38px; border-radius: 13px;
  background: linear-gradient(145deg, #edf3ff, #dce8fb);
  color: var(--forest); display: grid; place-items: center; overflow: hidden; font-weight: 800;
}
.link-photo img { width: 100%; height: 100%; object-fit: cover; }
.link-copy { min-width: 0; }
.link-copy strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.link-copy small { display: flex; align-items: center; gap: 5px; color: var(--muted); margin-top: 3px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-copy small svg { width: 13px; height: 13px; flex: none; }
.open-icon {
  width: 30px; height: 30px; border-radius: 10px; background: #edf3ff; color: var(--forest);
  display: grid; place-items: center; flex: none;
}
.open-icon svg { width: 15px; height: 15px; }
.protected-pill {
  color: #4563a2; background: rgba(24,50,95,.14); border-radius: 999px;
  padding: 2px 7px; font-size: 10px; font-weight: 700;
}
.empty-state { text-align: center; padding: 56px 16px 32px; color: var(--muted); }
.empty-icon {
  margin: 0 auto 16px; width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: 20px; background: linear-gradient(145deg, var(--forest), var(--forest-3));
  color: #f6f8fd; font: 800 22px/1 "Manrope", sans-serif;
}
.empty-state h2 { color: var(--ink); margin: 0 0 8px; font-family: "Manrope"; }
.empty-state p { margin: 0; }
.footer {
  min-height: 66px; padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: center;
  justify-content: center; gap: 8px; color: #7c879b; font-size: 11px;
}
.footer-dot { color: var(--gold); }
.unlock-dialog { width: min(440px, calc(100% - 28px)); border: 0; padding: 0; border-radius: 28px; color: var(--ink); background: transparent; overflow: visible; }
.unlock-dialog::backdrop { background: rgba(9,21,43,.52); backdrop-filter: blur(5px); }
.dialog-card { position: relative; background: var(--paper); border: 1px solid rgba(255,255,255,.6); border-radius: 28px; padding: 30px; box-shadow: 0 24px 80px rgba(9,21,43,.25); }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #edf3ff; color: var(--muted); font-size: 23px; line-height: 1; }
.dialog-icon {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px;
  background: linear-gradient(145deg, var(--forest), var(--forest-3)); color: #fff; margin-bottom: 21px;
}
.dialog-card h2 { font: 800 29px/1.05 "Manrope", sans-serif; letter-spacing: -1px; margin: 0 0 12px; }
.dialog-card > p:not(.eyebrow):not(.unlock-error) { color: var(--muted); line-height: 1.6; font-size: 14px; }
.password-field {
  margin-top: 18px; height: 54px; display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 0 8px 0 15px;
}
.password-field:focus-within { border-color: rgba(9,21,43,.4); box-shadow: 0 0 0 4px rgba(24,50,95,.10); }
.password-field input { border: 0; outline: 0; min-width: 0; background: transparent; }
.password-field button { border: 0; background: #edf3ff; color: var(--forest); border-radius: 10px; padding: 8px 10px; font-size: 11px; font-weight: 700; }
.primary-button { width: 100%; height: 52px; margin-top: 12px; border: 0; border-radius: 15px; background: linear-gradient(145deg, var(--forest), var(--forest-2)); color: #fff; font-weight: 800; }
.primary-button:disabled { opacity: .6; cursor: wait; }
.dialog-note { color: #909caf; display: block; text-align: center; margin-top: 12px; font-size: 10px; }
.unlock-error { color: #92536d; background: rgba(146,83,109,.08); border-radius: 10px; padding: 9px 11px; margin: 10px 0 0; font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; transform: translate(-50%, 20px);
  opacity: 0; pointer-events: none; background: var(--forest); color: white; border-radius: 999px; padding: 11px 16px;
  font-size: 12px; box-shadow: 0 12px 35px rgba(9,21,43,.25); transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 980px) {
  .hero-panel { grid-template-columns: 1fr; }
  .hero-side { min-width: 0; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 680px); }
  .topbar { min-height: 68px; padding-top: 6px; }
  .brand-copy { display: none; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .main-content { padding-top: 8px; padding-bottom: 38px; }
  .hero-copy-block, .hero-side { border-radius: 24px; }
  .hero-copy-block { padding: 20px 18px; min-height: 118px; }
  .hero-copy-block h1 { font-size: clamp(32px, 11vw, 48px); letter-spacing: -2px; }
  .toolbar { grid-template-columns: 1fr 50px; }
  .refresh-button { width: 50px; padding: 0; }
  .group summary { min-height: 56px; padding: 12px 13px; }
  .group-title strong { font-size: 15px; }
  .link-grid { grid-template-columns: 1fr; padding-inline: 10px; }
  .link-card { min-height: 60px; }
  .unlock-button span, .refresh-button span { display: none; }
  .unlock-button, .refresh-button { width: 42px; padding: 0; }
  .dialog-card { padding: 26px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
