/* Стиль прототипа IPWHC: белый фон, серые карточки, бирюзовый акцент, лёгкие заголовки, много воздуха. */
:root {
  --bg: #fff; --card: #F4F5F5; --mist: #EFF4F4; --teal: #0A96A2; --deep: #00626E;
  --ink: #2F2C31; --mute: #65737A; --line: #DBDDDD; --warn: #B3471F;
  --need: #B8651B;            /* второй ряд на карте возможностей: спрос */
  --r-card: 18px; --r-btn: 16px; --pad: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Manrope", "Inter", "Noto Sans", system-ui, sans-serif; font-size: 15px; line-height: 1.45;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--deep); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- каркас: телефон во всю ширину, на компьютере колонка по центру ---------- */
.app { max-width: 460px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column;
  background: var(--bg); position: relative; }
@media (min-width: 560px) {
  body { background: var(--mist); }
  .app { margin: 24px auto; min-height: calc(100dvh - 48px); border-radius: 28px; overflow: clip; }
}
.body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 8px var(--pad) 24px; }
.body.center { justify-content: center; }
.top { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px var(--pad) 6px; }
.top h2 { flex: 1; font-weight: 400; font-size: 19px; letter-spacing: -.01em; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--deep); flex: none; margin: 0 -8px; }
.icon-btn:active { background: var(--mist); }
.spacer { flex: 1; }

/* ---------- текст ---------- */
h1 { font-weight: 300; font-size: 29px; line-height: 1.16; letter-spacing: -.02em; }
h3 { font-weight: 500; font-size: 16px; line-height: 1.3; }
.m { color: var(--mute); }
.s { font-size: 13px; line-height: 1.4; }
.label { font-size: 13px; color: var(--mute); }
.logo { font-weight: 600; font-size: 15px; letter-spacing: .04em; display: flex; align-items: center; gap: 10px;
  padding-top: 16px; }
.logo i { width: 9px; height: 9px; background: var(--teal); transform: rotate(45deg); flex: none; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round;
  stroke-linejoin: round; flex: none; }

/* ---------- кнопки ---------- */
.btn { min-height: 52px; padding: 10px 18px; border-radius: var(--r-btn); background: var(--deep); color: #fff;
  font-weight: 500; font-size: 15.5px; display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; text-decoration: none; width: 100%; }
.btn:disabled { background: var(--line); color: var(--mute); cursor: default; }
.btn.ghost { background: #fff; color: var(--deep); border: 1.5px solid var(--teal); }
.btn.quiet { background: var(--card); color: var(--ink); }
.btn.danger { background: #fff; color: var(--warn); border: 1.5px solid #E8C4B4; }
.btn.small { min-height: 42px; font-size: 14px; border-radius: 13px; width: auto; padding: 8px 16px; }
/* действия на карточке всегда под рукой, даже если карточка длинная */
.actions { position: sticky; bottom: 0; margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 0 calc(4px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255, 255, 255, 0), #fff 16px); }
.row { display: flex; align-items: center; gap: 10px; }
.row > .grow { flex: 1; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.link { color: var(--deep); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; padding: 6px 0; text-align: start; }

/* ---------- карточки, чипы, аватар ---------- */
.card { background: var(--card); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.white { background: #fff; border: 1.5px solid var(--line); }
.card.mist { background: var(--mist); }
.card.tap { cursor: pointer; text-align: start; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.3px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; background: #fff;
  line-height: 1.25; text-align: start; }
.chip.on { border-color: var(--teal); background: var(--mist); color: var(--deep); font-weight: 500; }
.chip.tag { padding: 4px 11px; font-size: 12.5px; cursor: default; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--deep);
  border: 1.2px solid var(--teal); border-radius: 999px; padding: 3px 10px; white-space: nowrap; align-self: flex-start; }
.badge.gray { color: var(--mute); border-color: var(--line); }
.av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 15px; color: #fff; background: linear-gradient(140deg, #0A96A2, #00626E); }
.av.big { width: 64px; height: 64px; font-size: 22px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.input { min-height: 50px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16px;
  background: #fff; width: 100%; }
textarea.input { min-height: 112px; resize: vertical; line-height: 1.4; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--mist); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.check { display: flex; gap: 12px; align-items: flex-start; text-align: start; width: 100%; }
.check .box { width: 24px; height: 24px; border-radius: 8px; border: 1.6px solid var(--line); background: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; margin-top: 1px; }
.check.on .box { background: var(--teal); border-color: var(--teal); }
.check .box svg { width: 16px; height: 16px; stroke-width: 2.4; }
.langs { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- нижние вкладки ---------- */
.tabs { position: sticky; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px;
  font-weight: 500; color: var(--mute); position: relative; padding: 4px 0; }
.tabs button.on { color: var(--deep); }
.tabs svg.i { width: 23px; height: 23px; }
.dot { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--teal); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--teal); color: #fff;
  font-size: 12px; line-height: 22px; text-align: center; flex: none; }

/* ---------- переписка ---------- */
.chat { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 6px var(--pad) 12px; }
.strip { padding: 0 var(--pad) 8px; }
.msg { max-width: 84%; border-radius: 18px; padding: 10px 14px; font-size: 15px; line-height: 1.4; background: var(--card);
  align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--deep); color: #fff; }
.msg small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 11.5px; margin-top: 6px;
  color: var(--mute); white-space: normal; }
.msg.me small { color: rgba(255, 255, 255, .75); }
.msg small svg.i { width: 14px; height: 14px; }
.msg small button { color: var(--deep); font-size: 11.5px; text-decoration: underline; text-underline-offset: 2px; }
.msg small .time { margin-inline-start: auto; }
.send { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; background: #fff;
  padding: 10px var(--pad) calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.send textarea { min-height: 48px; max-height: 120px; resize: none; }
.send .btn { width: 52px; min-height: 48px; padding: 0; flex: none; }

/* ---------- всплывающее: уведомление и лист с действием ---------- */
.toasts { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 24px));
  display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.toast { background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 16px; font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start; text-align: start; width: 100%; }
.toast b { font-weight: 600; }
.veil { position: fixed; inset: 0; background: rgba(47, 44, 49, .45); display: flex; align-items: flex-end;
  justify-content: center; z-index: 10; }
.sheet { background: #fff; width: 100%; max-width: 460px; border-radius: 24px 24px 0 0; padding: 22px var(--pad) 26px;
  display: flex; flex-direction: column; gap: 14px; max-height: 88vh; overflow-y: auto; }
.doc h2 { font-weight: 400; font-size: 22px; line-height: 1.2; margin: 6px 0 4px; }
.doc h3 { margin: 12px 0 2px; }
.doc ul, .doc ol { padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }
.doc { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
@media (prefers-reduced-motion: no-preference) {
  .toast, .sheet { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } }
}

/* ---------- панель организатора ---------- */
body.wide { background: #fff; }
.admin { max-width: 1160px; margin: 0 auto; padding: 28px 24px 60px; display: flex; flex-direction: column; gap: 28px; }
.admin header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin header h1 { flex: 1; font-size: 30px; }
.admin h2 { font-weight: 400; font-size: 21px; letter-spacing: -.01em; }
.admin section { display: flex; flex-direction: column; gap: 14px; }
.admin .login { max-width: 380px; margin: 12vh auto 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--card); border-radius: var(--r-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-weight: 300; font-size: 38px; line-height: 1.1; letter-spacing: -.02em; }
.tile span { font-size: 13.5px; color: var(--mute); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--mute); }
.legend i, .bars i { display: inline-block; border-radius: 0 4px 4px 0; }
.legend i { width: 14px; height: 10px; margin-inline-end: 6px; border-radius: 3px; }
.offer { background: var(--teal); } .need { background: var(--need); }
.bars { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 14px 16px; align-items: center; }
.bars .name { font-size: 14px; line-height: 1.25; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.bars .pair { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bars .bar { display: flex; align-items: center; gap: 8px; font-size: 13px; height: 14px; }
.bars .bar i { height: 12px; min-width: 2px; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--warn); }
.flag svg.i { width: 14px; height: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--card); border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.item .grow { flex: 1; min-width: 0; }
.item .num { font-weight: 300; font-size: 24px; width: 44px; flex: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 500; color: var(--mute); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.off td { color: var(--mute); }
.admin .input { min-height: 44px; font-size: 15px; }
.admin textarea.input { min-height: 76px; }
.admin .btn { width: auto; }
.admin-side { display: flex; flex-direction: column; gap: 28px; }
.empty { color: var(--mute); font-size: 14px; padding: 6px 0; }

.langs button { white-space: nowrap; }
