/* acc.rhiz.ru — единый профиль rhiz: тёмная палитра поддоменов,
   идентификационная карточка, боковая колонка и ЛС.
   Рамки/фоны рисует shared/rhiz-decor.css — здесь только сетка и тон. */

:root {
  color-scheme: dark;
  --base: #0d0d10;
  --surface: #15151a;
  --surface-2: #1c1c23;
  --ink: #ece9e1;
  --dim: #8f8b83;
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .18);
  --amber: #fdb515;
  --red: #e9213d;
  --acc: #8bd3c7;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto Condensed", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(760px 420px at 88% -14%, rgba(139, 211, 199, .09), transparent 64%),
    radial-gradient(620px 360px at 4% 4%, rgba(253, 181, 21, .07), transparent 62%),
    linear-gradient(180deg, #121215 0%, var(--base) 100%);
  background-attachment: fixed;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

h1, h2, h3 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-weight: 600; letter-spacing: -.01em; margin: 0;
}
h1 { font-size: 22px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }

button, input, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface-2); padding: 8px 13px;
  transition: border-color .15s, background .15s, color .15s;
}
button:hover { border-color: var(--amber); }
button:disabled { opacity: .55; cursor: wait; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px;
  background: var(--surface-2); text-decoration: none; font-size: 14.5px;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--amber); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #15110a; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }

/* ───── шапка ───── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px clamp(14px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 13, 16, .84);
  backdrop-filter: blur(12px);
}
.mark {
  font-family: "Unbounded", system-ui, sans-serif; font-weight: 700;
  font-size: 18px; text-decoration: none; letter-spacing: -.02em;
  display: inline-flex; align-items: baseline; gap: 5px;
}
.mark small { color: var(--dim); font-size: .5em; font-weight: 500; letter-spacing: 0; }
.tabs { display: flex; gap: 4px; }
.tabs button {
  background: transparent; border-color: transparent; color: var(--dim);
  padding: 6px 12px; font-size: 14.5px;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current="page"] {
  color: var(--ink); border-color: var(--line-2); background: var(--surface-2);
}
.tab-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center;
}
.top-right {
  margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.proj {
  color: var(--dim); text-decoration: none; font-size: 14px;
  border-bottom: 1px solid transparent;
}
.proj:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.who { color: var(--ink); font-weight: 600; }
.login {
  text-decoration: none; padding: 6px 14px; border-radius: 10px;
  background: var(--amber); color: #15110a; font-weight: 700; font-size: 14px;
}

main { display: block; padding: clamp(16px, 4vw, 40px) clamp(14px, 4vw, 40px) 60px; }
#app { max-width: 1140px; margin: 0 auto; }

/* ───── карточка профиля ───── */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 18px; align-items: start; }
@media (max-width: 900px) { .profile { grid-template-columns: minmax(0, 1fr); } }

.id-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .9);
}
.id-hero {
  position: relative; height: 148px;
  background:
    radial-gradient(420px 200px at 78% 10%, rgba(139, 211, 199, .18), transparent 70%),
    linear-gradient(135deg, #1b1b22 0%, #121216 70%);
  border-bottom: 1px solid var(--line);
}
/* фон профиля из скина (панель/окно) ложится поверх подложки, но ниже текста */
.id-hero.rz-surface { background-size: cover; background-position: center; }
.id-hero-mark {
  position: absolute; right: 18px; bottom: 8px;
  font-family: "Unbounded", system-ui, sans-serif; font-weight: 700;
  font-size: clamp(38px, 9vw, 68px); line-height: 1;
  color: rgba(255, 255, 255, .07); letter-spacing: -.04em;
  pointer-events: none; user-select: none;
}
.id-body {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px;
  padding: 0 20px 4px;
}
.id-av-wrap { margin-top: -44px; }
.id-av { width: 112px; height: 112px; }
.id-main { padding-top: 14px; min-width: 0; }
.id-nick {
  font-size: clamp(22px, 4vw, 30px); line-height: 1.15;
  overflow-wrap: break-word;
}
.id-sub { margin: 4px 0 0; color: var(--dim); font-size: 14px; }
.id-bio { margin: 10px 0 0; color: var(--ink); font-size: 15px; white-space: pre-wrap; }
.id-stats {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0;
}
.stat {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.stat b { font-size: 16px; font-family: "Unbounded", system-ui, sans-serif; font-weight: 600; }
.stat small { color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.id-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.id-foot {
  margin: 16px 0 0; padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px;
}
@media (max-width: 620px) {
  .id-hero { height: 118px; }
  .id-body { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0 16px 4px; }
  .id-av-wrap { margin-top: -40px; }
  .id-av { width: 92px; height: 92px; }
  .id-main { padding-top: 0; }
  .id-foot { padding: 12px 16px 16px; }
}

/* ───── боковая колонка ───── */
.side { display: grid; gap: 14px; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 16px 18px;
}
.panel h2 { margin-bottom: 10px; }
.facts { display: grid; gap: 8px; margin: 0; }
.facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--dim); font-size: 13.5px; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.hint { color: var(--dim); font-size: 13.5px; margin: 10px 0 0; }
.panel .btn { width: 100%; margin-top: 12px; }

.proj-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.proj-list a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 8px; border-radius: 10px; text-decoration: none;
  transition: background .15s;
}
.proj-list a:hover { background: var(--surface-2); }
.proj-list b { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--acc); font-weight: 600; }
.proj-list span { color: var(--dim); font-size: 13.5px; }
.proj-list a:hover span { color: var(--ink); }

/* ───── гостевой экран ───── */
.guest {
  max-width: 560px; margin: 6vh auto; padding: 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: center;
}
.guest h1 { margin-bottom: 10px; }
.guest p { color: var(--dim); margin: 0 0 18px; }
.guest .btn { margin-top: 4px; }

/* ───── ЛС ───── */
.messages {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 14px; align-items: stretch;
  min-height: 60vh;
}
@media (max-width: 900px) { .messages { grid-template-columns: minmax(0, 1fr); } }

.dm-list, .dm-thread {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); display: flex; flex-direction: column; min-width: 0;
}
.dm-list-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.dm-list-head h1 { font-size: 16px; }
#threads { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
@media (max-width: 900px) {
  #threads { max-height: 38vh; overflow-y: auto; }
}

.conv {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center;
  gap: 10px; text-align: left; width: 100%;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 11px;
  background: transparent;
}
.conv:hover { border-color: var(--line); background: var(--surface-2); }
.conv[aria-current="true"] { border-color: var(--line-2); background: var(--surface-2); }
.conv-av { width: 40px; height: 40px; }
.conv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { color: var(--dim); font-size: 11.5px; flex: none; }
.conv-last {
  color: var(--dim); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-unread {
  min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700;
  line-height: 20px; text-align: center;
}

.dm-thread { min-height: 420px; }
.dm-empty { color: var(--dim); margin: auto; padding: 30px 20px; text-align: center; max-width: 48ch; }
.dm-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.dm-head .conv-av { width: 44px; height: 44px; }
.dm-head-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dm-head-main b { font-size: 16px; }
.dm-head-main .hint { margin: 0; text-decoration: underline; text-underline-offset: 3px; }
.dm-scroll {
  flex: 1 1 auto; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 58vh;
}
.msg {
  align-self: flex-start; max-width: min(78%, 60ch);
  padding: 8px 12px 6px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.msg.mine { align-self: flex-end; border-color: rgba(253, 181, 21, .34); background: rgba(253, 181, 21, .08); }
.msg-who { display: block; color: var(--dim); font-size: 11.5px; margin-bottom: 2px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-time { display: block; margin-top: 3px; color: var(--dim); font-size: 10.5px; text-align: right; }

.dm-form {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 14px; border-top: 1px solid var(--line);
}
.dm-form textarea {
  flex: 1 1 auto; resize: none; min-height: 40px; max-height: 140px;
  padding: 9px 12px; border-radius: 11px; line-height: 1.45;
  border: 1px solid var(--line-2); background: var(--base);
}
.dm-form textarea:focus { outline: none; border-color: var(--amber); }

/* ───── служебное сообщение ───── */
.note {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  margin: 0; padding: 9px 16px; border-radius: 11px; z-index: 40;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 13.5px; max-width: min(92vw, 560px);
  box-shadow: 0 12px 30px -18px #000;
}
.note.err { border-color: var(--red); color: #ffc9cf; }
