/* Кабинет ADDspace — дизайн-система MoodWork (см. apps/index.html):
   фиолетовая бумага, плакатные веса, крупные скругления, пилюли.
   Селекторы 1:1 с прежней версией — app.js не трогали. */
:root {
  --paper:#efe9fd; --ink:#141018; --card:#ffffff; --card2:#f6f2ff;
  --violet:#6b4bf6; --lime:#c4f24c; --pink:#f3a8dc;
  /* заливка не зависит от темы: в тёмной схеме фиолетовый светлеет и белый текст теряет контраст */
  --fill-violet:#6b4bf6;
  --line: rgba(20,16,24,.14);
  --glass: rgba(20,16,24,.04);
  --text: var(--ink); --text-dim: rgba(20,16,24,.62); --text-faint: rgba(20,16,24,.42);
  --accent: #1b6b40; --bad: #c0392b;
  --bg: var(--paper); --bg-2: var(--card); --bg-3: var(--card2);
  --r-md: 14px; --r-lg: 24px; --r-pill: 999px;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:#17122a; --ink:#f4f0ff; --card:#221b3c; --card2:#2a2249;
    --violet:#7c5cff; --line: rgba(244,240,255,.16); --glass: rgba(244,240,255,.06);
    --text-dim: rgba(244,240,255,.66); --text-faint: rgba(244,240,255,.44);
    --accent:#7fe3ac; --bad:#ff8a7a;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 10px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); z-index: 5;
}
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 600; }
.back:hover { color: var(--violet); }
.brand { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }

.wrap { max-width: 680px; margin: 0 auto; padding: 24px 20px 64px; display: grid; gap: 16px; }
.skeleton { color: var(--text-faint); padding: 40px 0; text-align: center; }

.card {
  background: var(--card); border: 0; border-radius: var(--r-lg);
  padding: 24px; display: grid; gap: 12px;
}
.card.center { text-align: center; justify-items: center; padding: 32px 24px; }
.card.danger { border: 2.5px solid var(--bad); }
h1 { font-size: clamp(26px,4.2vw,38px); font-weight: 900; letter-spacing: -.035em; line-height: 1.05; }
h2 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.dim { color: var(--text-dim); font-size: 14px; }
.note { font-size: 13.5px; font-weight: 600; color: var(--accent); }
.note.err { color: var(--bad); }
code { font-family: var(--mono); background: var(--card2); padding: 2px 8px; border-radius: 8px; font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: var(--r-pill);
  background: var(--fill-violet); color: #fff; cursor: pointer; text-decoration: none;
  font-size: 15px; font-weight: 700; letter-spacing: -.01em; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.ghost:hover { background: var(--lime); color: #141018; filter: none; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 2px currentColor; }
.btn.danger:hover { background: var(--bad); color: #fff; box-shadow: none; filter: none; }
.btn[disabled] { opacity: .5; cursor: default; }

.providers { display: grid; gap: 10px; width: 100%; max-width: 340px; }
.providers.small { display: flex; flex-wrap: wrap; gap: 8px; max-width: none; }
.providers.small .btn { padding: 0 16px; font-size: 14px; }

.email-form { display: flex; gap: 8px; width: 100%; max-width: 340px; }
.email-form input {
  flex: 1; background: var(--card2); border: 1.5px solid var(--line);
  border-radius: var(--r-pill); padding: 12px 18px; min-width: 0; min-height: 44px;
}
.email-form input:focus { outline: none; border-color: var(--violet); }

.private { width: 100%; max-width: 440px; text-align: left; margin-top: 8px; }
.private summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-dim); font-size: 13.5px; font-weight: 600; }
.private p { margin-top: 8px; }

.profile { grid-template-columns: auto 1fr auto; align-items: center; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--card2) center/cover;
  display: grid; place-items: center; font-size: 19px; font-weight: 800; color: var(--violet);
}
.profile-main { min-width: 0; }
.name-input {
  background: transparent; border: 1.5px solid transparent; border-radius: var(--r-md);
  padding: 6px 10px; margin-left: -10px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; width: 100%;
}
.name-input:hover { border-color: var(--line); }
.name-input:focus { outline: none; border-color: var(--violet); background: var(--card2); }

.list { list-style: none; display: grid; gap: 8px; }
.list li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--card2); border: 0; border-radius: var(--r-md);
}
.list .grow { flex: 1; min-width: 0; }
.list .ttl { font-size: 14.5px; font-weight: 600; }
.list .sub { font-size: 12.5px; color: var(--text-dim); }
.list .x {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 13px; font-weight: 600; min-height: 44px; padding: 4px 12px; border-radius: var(--r-pill);
}
.list .x:hover { color: #fff; background: var(--bad); }
.badge { font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-widget { display: flex; justify-content: center; min-height: 40px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }
@media (max-width: 480px) {
  .wrap { padding: 20px 16px 48px; }
  .card { padding: 20px; border-radius: 20px; }
  .profile { grid-template-columns: auto 1fr; }
  .profile .btn { grid-column: 1 / -1; }
  .email-form { flex-direction: column; }
}
