:root {
  /* Палитра LinkedIn */
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #191919;
  --muted: #666666;
  --line: #e0dfdc;
  --accent: #0a66c2;
  --accent-hover: #004182;
  --accent-ink: #ffffff;
  --soft: #e8f3ff;
  --ok: #057642;
  --err: #cc1016;
  --radius: 10px;
  --shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 15px; padding: 12px 20px; border-radius: 999px;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:not(.primary):not(.dark):hover { border-color: var(--accent); color: var(--accent); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); }
.btn.big { width: 100%; padding: 15px; font-size: 16px; border-radius: 999px; }
.btn.sm { padding: 7px 14px; font-size: 14px; border-radius: 999px; }

input, textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; min-height: 84px; }
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 2px; }

.muted { color: var(--muted); }
.err { color: var(--err); font-size: 14px; min-height: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px;
  transition: all .25s ease; z-index: 50; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Публичная карточка ---------- */
.card-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 28px 16px 20px; }
.card {
  width: 100%; max-width: 420px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow);
  padding: 32px 20px 20px; text-align: center; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 110px;
  background: linear-gradient(135deg, #0a66c2, #004182 70%, #00305f);
}
.avatar {
  position: relative; width: 112px; height: 112px; border-radius: 50%; object-fit: cover;
  border: 5px solid var(--panel); margin: 18px auto 14px; display: block; background: var(--soft);
}
.avatar.ph { display: grid; place-items: center; font-size: 38px; font-weight: 700; color: var(--accent); }
.avatar.ph svg { width: 44px; height: 44px; }
.card h1 { font-size: 26px; }
.card .sub { color: var(--muted); margin: 6px 0 0; }
.card #save { margin-top: 22px; white-space: nowrap; padding-inline: 12px; font-size: clamp(14px, 4.2vw, 16px); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px;
  background: var(--soft); color: var(--accent); border: 0; border-radius: 14px; font: inherit;
  font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.rows { margin-top: 18px; text-align: left; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; text-decoration: none; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.row .rt { display: flex; flex-direction: column; min-width: 0; }
.row small { color: var(--muted); font-size: 12px; }
.row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { margin: 16px 4px 4px; text-align: left; color: var(--muted); font-size: 14px; white-space: pre-line; }
.card.msg { padding-bottom: 28px; }
.card.msg .btn { margin-top: 20px; }
.foot { margin-top: 18px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.foot a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.foot svg { width: 16px; height: 16px; }
.autosave-hint { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Vizitap: логотип и мелкие правки под LinkedIn ---------- */
.logo span { font-size: 22px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.logo b { color: var(--accent); font-weight: 800; }
.logo img { border-radius: 8px; }
.auth { border-radius: 12px !important; }
.tabs { border-radius: 999px !important; }
.tabs button { border-radius: 999px !important; }
.tabs button.on { color: var(--accent) !important; }
.step { border-radius: 12px !important; }
.step .n { background: var(--accent) !important; color: var(--accent-ink) !important; }
.hero h1 em { color: var(--accent); }

/* ---------- Шторка / окно ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: end center; z-index: 40; animation: fade .2s ease; }
.sheet-bg[hidden] { display: none; }
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--panel); border-radius: 16px 16px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
  animation: up .28s cubic-bezier(.2,.8,.2,1); transition: transform .22s ease;
}
.sheet .grab { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); }
.sheet h3 { font-size: 20px; margin-bottom: 6px; }
.sheet p { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.sheet form { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .sheet-bg { place-items: center; padding: 16px; }
  .sheet { border-radius: 16px; padding-top: 24px; animation-name: pop; }
  .sheet .grab { display: none; }
}
@keyframes up { from { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
body.locked { overflow: hidden; }

/* Меню действий в шторке */
.menu { display: grid; gap: 2px; margin: 4px -8px 0; }
.menu button, .menu a {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 12px; border: 0; background: none; border-radius: 10px;
  font: inherit; font-size: 16px; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.menu button:hover, .menu a:hover { background: var(--bg); }
.menu .danger { color: var(--err); }
.menu svg { color: var(--muted); }

/* ---------- Доступность и удобство ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Плавный переход между страницами (Chrome, Safari 18+) */
@view-transition { navigation: auto; }
main, .wrap, .doc { animation: fade .25s ease; }
