/* MAVAR Social — панель /meta/app/. Визуальная система mavar.uz (app/globals.css сайта):
   графит + тёплый камень + один металлик (сталь); Spectral (заголовки), Onest (текст), IBM Plex Mono (ярлыки).
   Шрифты — те же самохостящиеся файлы, что у сайта (латиница), без внешней сети. */

@font-face { font-family: "Spectral"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/spectral-300.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/spectral-400.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/onest-var.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/plexmono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/plexmono-500.woff2") format("woff2"); }

:root {
  --graphite: #0e0f11;
  --graphite-2: #131518;
  --graphite-3: #191c21;
  --graphite-4: #20242a;
  --paper: #eae6dd;
  --paper-dim: rgba(234, 230, 221, 0.68);
  --paper-faint: rgba(234, 230, 221, 0.54);
  --steel: #99a2aa;
  --steel-bright: #c4cace;
  --steel-deep: #5e656c;
  --line: rgba(234, 230, 221, 0.12);
  --line-strong: rgba(234, 230, 221, 0.22);
  --ok: #9cc3a6;
  --wait: #d8bf8f;
  --err: #e3a29b;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--graphite); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--graphite);
  color: var(--paper);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* зерно, как у сайта: одна растровая заливка, не фильтр */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--line-strong); transition: color .2s ease, text-decoration-color .2s ease; }
a:hover { color: var(--steel-bright); text-decoration-color: currentColor; }
:focus-visible { outline: 1.5px solid var(--steel-bright); outline-offset: 3px; border-radius: 1px; }
::selection { background: rgba(153, 162, 170, 0.28); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.012em; margin: 0; }
p { margin: 0; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- типографика ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font: 500 11px/1 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--steel);
}
.eyebrow.ruled::before { content: ""; width: 32px; height: 1px; background: var(--steel-deep); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.dim { color: var(--paper-dim); }
.faint { color: var(--paper-faint); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wordmark { font-family: var(--serif); text-transform: uppercase; letter-spacing: .16em; font-size: 19px; line-height: 1; }

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(14, 15, 17, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); min-height: 68px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand .product { font: 500 10.5px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--steel); padding-left: 12px; border-left: 1px solid var(--line-strong); }
.nav { display: flex; gap: 4px; margin: 0 auto 0 12px; }
.nav a {
  position: relative; padding: 23px 12px; text-decoration: none; color: var(--paper-dim); font-size: 14.5px;
}
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 1px; background: var(--paper); transform: scaleX(0); transform-origin: left; transition: transform .32s cubic-bezier(.22, 1, .36, 1); }
.nav a:hover { color: var(--paper); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--paper); }
.who { display: flex; align-items: center; gap: 14px; }
.who .mono { color: var(--paper-faint); }

/* ---------- каркас ---------- */
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 72px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 52px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.pagehead h1 { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.08; margin: 18px 0 12px; }
.pagehead .lead { max-width: 640px; color: var(--paper-dim); font-size: 16px; }
.section { margin-top: 44px; }
.section > h2 { font-size: 24px; margin-bottom: 6px; }
.section > .sub { color: var(--paper-faint); margin-bottom: 18px; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 2px; border: 1px solid transparent;
  font: 500 14.5px/1 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--paper); color: var(--graphite); }
.btn-primary:hover { background: #fff; color: var(--graphite); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--steel); color: var(--steel-bright); }
.btn-quiet { background: transparent; color: var(--paper-dim); border-color: transparent; padding: 0 12px; }
.btn-quiet:hover { color: var(--paper); border-color: var(--line); }
.btn-danger { background: transparent; color: var(--err); border-color: rgba(227, 162, 155, .4); }
.btn-danger:hover { border-color: var(--err); color: #f1beb8; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-ig { min-height: 48px; padding: 0 22px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; margin: 0; }

/* ---------- плашки ---------- */
.banner { display: flex; gap: 14px; align-items: baseline; padding: 12px 16px; margin-top: 24px; border: 1px solid var(--line); border-left: 2px solid var(--wait); background: var(--graphite-2); font-size: 14px; color: var(--paper-dim); }
.banner b { color: var(--paper); font-weight: 500; }
.banner .tag { font: 500 10.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--wait); white-space: nowrap; }
.flash { padding: 14px 16px; margin-bottom: 24px; border: 1px solid var(--line); border-left: 2px solid var(--steel); background: var(--graphite-2); font-size: 14.5px; }
.flash.ok { border-left-color: var(--ok); }
.flash.wait { border-left-color: var(--wait); }
.flash.err { border-left-color: var(--err); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font: 500 11.5px/1.2 var(--mono); letter-spacing: .03em; color: var(--paper-dim); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--steel); }
.pill.ok { color: var(--ok); border-color: rgba(156, 195, 166, .35); } .pill.ok::before { background: var(--ok); }
.pill.wait { color: var(--wait); border-color: rgba(216, 191, 143, .35); } .pill.wait::before { background: var(--wait); }
.pill.err { color: var(--err); border-color: rgba(227, 162, 155, .35); } .pill.err::before { background: var(--err); }
.pill.plain::before { display: none; }
.tagline { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); font: 500 10.5px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--steel); }

/* ---------- карточки ---------- */
.card { background: var(--graphite-2); border: 1px solid var(--line); border-radius: 2px; padding: 24px; }
.card + .card { margin-top: 16px; }
.empty { padding: 40px 32px; border: 1px dashed var(--line-strong); text-align: left; }
.empty h2 { font-size: 26px; margin-bottom: 10px; }
.empty p { color: var(--paper-dim); max-width: 620px; }
.steps { margin: 22px 0 26px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 14px; color: var(--paper-dim); }
.steps li::before { content: "0" counter(s); font: 500 12px/1.9 var(--mono); color: var(--steel); }

.acct { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 22px; align-items: start; }
.acct h3 { font-family: var(--sans); font-weight: 500; font-size: 19px; letter-spacing: 0; }
.acct .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; color: var(--paper-dim); font-size: 14px; }
.acct .perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.acct .side { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: 136px; }
.acct .side .btn, .acct .side details, .acct .side summary { width: 100%; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--graphite-4); border: 1px solid var(--line-strong); flex: none; }
.avatar.ph { display: inline-flex; width: 40px; height: 40px; font-size: 20px; align-items: center; justify-content: center; font-family: var(--serif); color: var(--steel-bright); }

/* выбор аккаунта */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 14px 5px 5px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--paper-dim); font-size: 14px; }
.chip:hover { border-color: var(--steel); color: var(--paper); }
.chip[aria-current="true"] { border-color: var(--paper); color: var(--paper); background: var(--graphite-2); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 2px; }
.seg a { padding: 9px 16px; text-decoration: none; color: var(--paper-dim); font-size: 14px; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a[aria-current="true"] { background: var(--paper); color: var(--graphite); }

/* посты */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.post { position: relative; display: block; text-decoration: none; background: var(--graphite-2); border: 1px solid var(--line); transition: border-color .2s ease, transform .2s ease; }
.post:hover { border-color: var(--steel); transform: translateY(-2px); color: inherit; }
.thumb { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; background: var(--graphite-3); }
.thumb.ph { display: flex; align-items: center; justify-content: center; font: 500 11px/1 var(--mono); letter-spacing: .2em; color: var(--steel); }
.post .pb { padding: 10px 12px 12px; font-size: 13px; }
.post .pb .mono { color: var(--paper-faint); font-size: 11.5px; }
.post .cap { color: var(--paper-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; min-height: 2.9em; }

/* список постов (комментарии) */
.mlist { display: grid; gap: 6px; max-height: 76vh; overflow: auto; padding-right: 4px; }
.mitem { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border: 1px solid transparent; text-decoration: none; font-size: 13.5px; }
.mitem:hover { border-color: var(--line-strong); color: inherit; }
.mitem[aria-current="true"] { border-color: var(--paper); background: var(--graphite-2); }
.mitem img, .mitem .thumb { width: 56px; height: 56px; }
.mitem .cap { color: var(--paper-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* комментарии */
.mhead { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.mhead img, .mhead .thumb { width: 88px; height: 88px; }
.comment { padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.comment .ch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.comment .ch b { font-weight: 500; }
.comment .ct { margin: 8px 0 14px; font-size: 16px; }
.comment .replies { margin: 0 0 14px 18px; padding-left: 14px; border-left: 1px solid var(--line-strong); font-size: 14px; color: var(--paper-dim); display: grid; gap: 6px; }
.comment.is-hidden .ct { color: var(--paper-faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.fl { display: block; font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--paper-faint); margin-top: 6px; }
textarea, input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], select {
  width: 100%; background: var(--graphite-3); color: var(--paper); border: 1px solid var(--line-strong); border-radius: 2px;
  padding: 11px 13px; font: 400 15px/1.5 var(--sans);
  transition: border-color .2s ease, background-color .2s ease;
}
textarea { min-height: 84px; resize: vertical; }
textarea:hover, input:hover { border-color: var(--steel-deep); }
textarea:focus, input:focus { outline: none; border-color: var(--steel-bright); background: var(--graphite-4); }
input[type="file"] { width: 100%; color: var(--paper-dim); font: 14px var(--sans); padding: 18px; border: 1px dashed var(--line-strong); background: var(--graphite-3); }
input[type="file"]::file-selector-button { font: 500 13.5px var(--sans); background: var(--paper); color: var(--graphite); border: 0; border-radius: 2px; padding: 9px 14px; margin-right: 14px; cursor: pointer; }
::-webkit-calendar-picker-indicator { filter: invert(.85); }
.field { margin-bottom: 22px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line-strong); cursor: pointer; font-size: 14.5px; }
.radios label:hover { border-color: var(--steel); }
.radios input { accent-color: var(--paper); }
.errors { margin: 0 0 22px; padding: 14px 18px 14px 34px; border: 1px solid rgba(227, 162, 155, .4); color: #f1beb8; background: rgba(227, 162, 155, .06); }
details.confirm { display: inline-block; position: relative; }
details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { border-color: var(--err); }
details.confirm .pop { position: absolute; right: 0; z-index: 5; margin-top: 8px; width: min(300px, 80vw); padding: 14px; background: var(--graphite-3); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); font-size: 13.5px; color: var(--paper-dim); }
details.confirm .pop .btn { margin-top: 10px; }

/* таблицы */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--graphite-2); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 500 10.5px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--steel); padding: 14px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td .tp { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 220px; }
td .tp img, td .tp .thumb { width: 48px; height: 48px; }
td .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--paper-dim); }

/* метрики */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--graphite-2); padding: 22px 22px 24px; }
.stat .v { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 4vw, 48px); line-height: 1; margin: 16px 0 10px; font-variant-numeric: lining-nums tabular-nums; }
.stat .s { font: 12px/1.4 var(--mono); color: var(--paper-faint); }

/* вход */
.signin { flex: 1; display: grid; place-items: center; padding: 48px var(--gutter); }
.signin .box { width: min(440px, 100%); }
.signin .brand { margin-bottom: 44px; }
.signin h1 { font-size: clamp(34px, 6vw, 46px); line-height: 1.05; margin: 18px 0 12px; }
.signin .lead { color: var(--paper-dim); margin-bottom: 30px; }
.signin form .field input { background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; padding: 12px 0; font-size: 16px; }
.signin form .field input:focus { border-bottom-color: var(--paper); background: transparent; }
.signin .btn { width: 100%; margin-top: 6px; }
.signin .note { margin-top: 26px; font-size: 13px; color: var(--paper-faint); }

/* подвал */
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 22px var(--gutter) 28px; display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; font: 12px/1.6 var(--mono); color: var(--paper-faint); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { text-decoration: none; color: var(--paper-dim); }
.foot a:hover { color: var(--paper); }


/* утилиты (CSP: style-src 'self' — никаких style="" в разметке) */
.mt-xs { margin-top: 6px; } .mt-s { margin-top: 8px; } .mt-m { margin-top: 12px; } .mt-l { margin-top: 22px; }
.av-26 { width: 26px; height: 26px; font-size: 13px; } .av-72 { width: 72px; height: 72px; font-size: 32px; }
.mcap { margin: 6px 0 10px; }
.card-title { font-size: 24px; margin-bottom: 18px; }
.actions.bar { justify-content: space-between; margin-bottom: 18px; }
.grid-2 > .card + .card { margin-top: 0; }
.post .kind { position: absolute; top: 8px; left: 8px; padding: 4px 8px; background: rgba(14, 15, 17, .78); border: 1px solid var(--line); font: 500 10px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--paper); }

/* ---------- телефон ---------- */
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .mlist { grid-auto-flow: column; grid-auto-columns: 240px; max-height: none; overflow-x: auto; padding-bottom: 6px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 12px; }
  .who { margin-left: auto; }
  .who .mono { display: none; }
  .nav { order: 3; width: 100%; margin: 4px 0 0; overflow-x: auto; }
  .nav a { padding: 14px 10px 16px; }
  .nav a:first-child { padding-left: 0; } .nav a:first-child::after { left: 0; }
  .pagehead { padding-top: 34px; }
  .acct { grid-template-columns: 56px minmax(0, 1fr); }
  .acct .avatar { width: 56px; height: 56px; }
  .acct .side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; width: auto; }
  .acct .side .btn, .acct .side details, .acct .side summary { width: auto; }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 18px; }
  .mhead { grid-template-columns: 64px minmax(0, 1fr); }
  .mhead img, .mhead .thumb { width: 64px; height: 64px; }
  .comment .replies { margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
