:root {
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, Arial, sans-serif;
  color: #252a28;
  background: #f5f3ef;
  --ink: #252a28;
  --wine: #713e47;
  --wine-hover: #60313a;
  --oak: #c9aa82;
  --paper: #fffefa;
  --canvas: #f5f3ef;
  --line: #e4dfd7;
  --muted: #696f6a;
  --sage: #6c8178;
  --shadow: 0 12px 35px rgba(35, 40, 37, .055);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 91% 0, rgba(201, 170, 130, .13), transparent 35%), var(--canvas);
  font-size: 16px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #799489;
  outline-offset: 3px;
}
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
p { line-height: 1.6; }
.shell { min-height: 100vh; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 15px clamp(20px, 4vw, 64px);
  background: #252a28;
  color: #fbf7f0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .055em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: linear-gradient(135deg, #dec39c, #b89167);
  color: #252a28;
  font-size: 1.35rem;
  font-weight: 900;
}
.brand small {
  display: block;
  margin-top: 1px;
  color: #d5b996;
  font-size: .66rem;
  letter-spacing: .2em;
}
.top-right { display: flex; align-items: center; gap: 20px; font-size: .88rem; }
.role-label { color: #e4ded3; }
.quiet {
  border: 0;
  background: none;
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px;
  font-weight: 650;
}
.top .quiet { color: #f8f1e6; }
.loading, .empty, .error-state {
  max-width: 640px;
  margin: 80px auto;
  padding: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  line-height: 1.6;
}
.error-state h1 { margin-top: 0; }
.wrap { width: min(100%, 1320px); margin: auto; padding: 36px clamp(18px, 3vw, 44px) 88px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--wine);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow:before { content: ""; width: 22px; height: 2px; border-radius: 3px; background: currentColor; }
h1 { margin: 12px 0 13px; font-size: clamp(2.3rem, 4.5vw, 4rem); letter-spacing: -.055em; line-height: 1.07; }
h2 { font-size: clamp(1.45rem, 2vw, 1.8rem); letter-spacing: -.035em; line-height: 1.2; }
h3 { font-size: 1.12rem; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small, .hint { font-size: .875rem; }
.hint { color: var(--muted); line-height: 1.55; }
.topline { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.topline p { color: var(--muted); margin: 0; max-width: 730px; }
.topline > .pill { margin-bottom: 3px; }
.grid { display: grid; gap: 18px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 21px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--wine);
  color: white;
  font-weight: 750;
  text-decoration: none;
  transition: background .18s, transform .18s, box-shadow .18s;
}
.button:hover { background: var(--wine-hover); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(113, 62, 71, .17); }
.button:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.button.secondary { background: #fffefa; color: var(--ink); border-color: #d8d0c5; }
.button.secondary:hover { background: #eee9e1; box-shadow: none; }
.button.wide { width: 100%; }
.button.slim { min-height: 42px; padding: 9px 15px; font-size: .9rem; }
.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e7eee9;
  color: #3f6354;
  font-size: .8rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.pill.warn { background: #f7ead5; color: #875b29; }
.pill.bad { background: #f6e3e1; color: #874349; }
.message {
  margin-top: 17px;
  padding: 16px 18px;
  border: 1px solid #dce7dc;
  border-radius: 14px;
  background: #eaf1ea;
  color: #345342;
  font-size: .9rem;
  line-height: 1.55;
}
.message p:last-child { margin-bottom: 0; }
.message.error { border-color: #edcecb; background: #faeae8; color: #713d46; }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .8fr);
  align-items: stretch;
  gap: 24px;
  width: min(100%, 1260px);
  margin: 36px auto;
  padding: 0 24px;
}
.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 600px;
  padding: clamp(34px, 5vw, 65px);
  border-radius: 28px;
  background: linear-gradient(130deg, #29312e 0%, #1e2522 72%);
  color: #f8f3ea;
}
.auth-story:before {
  content: "";
  position: absolute;
  top: -20%;
  right: -13%;
  width: 53%;
  height: 140%;
  border-radius: 80px;
  background: repeating-linear-gradient(90deg, #c7a67f 0 21px, #dec09a 21px 25px, #b58d65 25px 27px);
  opacity: .78;
  transform: rotate(15deg);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .2);
}
.auth-story > * { position: relative; z-index: 1; }
.auth-story .eyebrow { color: #d9bc95; }
.auth-story h1 { max-width: 560px; font-size: clamp(3.2rem, 6vw, 5.4rem); }
.auth-story p { max-width: 455px; color: #e9e3d9; }
.auth-card, .card, .paper {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.auth-card { align-self: center; padding: clamp(29px, 4vw, 48px); }
.auth-card h2 { margin: 12px 0; font-size: 2rem; }
.tabs { display: flex; gap: 6px; margin: 27px 0 20px; padding: 5px; border-radius: 14px; background: #f0ede7; }
.tabs button { flex: 1; border: 0; border-radius: 10px; padding: 11px 12px; background: transparent; color: var(--muted); font-weight: 720; }
.tabs button.active { background: #fffefa; color: var(--wine); box-shadow: 0 2px 9px rgba(37, 42, 40, .09); }
.field { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.field label { font-size: .9rem; font-weight: 720; }
.field input, .field select {
  width: 100%;
  min-height: 49px;
  padding: 11px 14px;
  border: 1px solid #d5d0c8;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(108, 129, 120, .15); }
.field input::placeholder { color: #938f89; }
.headbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0 30px; }
.headbar nav { display: flex; flex-wrap: wrap; gap: 8px; }
.manager-nav { display: flex; gap: 6px; flex-wrap: wrap; width: fit-content; max-width: 100%; margin-bottom: 34px; padding: 5px; border: 1px solid var(--line); border-radius: 16px; background: #eae6df; }
.nav-button { min-height: 43px; padding: 10px 17px; border: 0; border-radius: 11px; background: transparent; color: #565f59; font-size: .9rem; font-weight: 730; }
.nav-button.active { background: var(--paper); color: var(--wine); box-shadow: 0 3px 10px rgba(37, 42, 40, .08); }
.nav-button:hover:not(.active) { background: rgba(255,255,255,.55); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 33px; }
.metrics-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { min-height: 124px; padding: 22px 23px; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: var(--shadow); }
.metric strong { display: block; margin-bottom: 8px; font-size: clamp(1.65rem, 2.5vw, 2.2rem); letter-spacing: -.055em; line-height: 1; }
.metric span { color: var(--muted); font-size: .9rem; }
.feature {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 37px;
  padding: 31px 35px;
  border-radius: 24px;
  background: radial-gradient(circle at 95% 25%, rgba(115, 145, 130, .33), transparent 38%), #27302b;
  color: #f8f4ec;
  box-shadow: 0 16px 34px rgba(37, 42, 40, .11);
}
.feature .eyebrow { color: #dcc39e; }
.feature h2 { margin: 8px 0; font-size: 2rem; }
.feature p { margin: 0; color: #e5e3da; }
.feature .button { background: #dec6a3; color: #252a28; }
.feature .button:hover { background: #f0d4af; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 37px 0 17px; }
.section-head h2 { margin: 0 0 4px; }
.section-head p { margin: 0; }
.course-picker { margin: 30px 0 34px; }
.course-picker .section-head { margin: 0 0 16px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 15px; }
.course-card { display: flex; flex-direction: column; gap: 12px; min-height: 196px; padding: 25px 27px; border: 1px solid var(--line); border-radius: 23px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink); text-align: left; transition: border-color .18s, transform .18s, box-shadow .18s; }
.course-card.active { border-color: #b69a77; background: linear-gradient(135deg, #fffdfa, #f0e7d9); }
.course-card:hover, .course-card:focus-visible { transform: translateY(-2px); border-color: #b69a77; box-shadow: 0 18px 35px rgba(37, 42, 40, .1); }
.course-card strong { font-size: 1.65rem; letter-spacing: -.035em; }
.course-card > span:not(.eyebrow) { color: var(--muted); line-height: 1.45; }
.course-card small { margin-top: auto; color: var(--wine); font-weight: 750; }
.module { margin: 28px 0 37px; }
.module-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.module-head h2, .module-head h3 { margin: 0; font-size: 1.25rem; }
.module-head small { color: var(--muted); font-size: .9rem; }
.lesson-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lesson-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 132px;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.lesson-card:hover, .lesson-card:focus-visible { border-color: #c8ad8e; transform: translateY(-2px); box-shadow: 0 16px 33px rgba(37, 42, 40, .09); }
.lesson-card strong { display: block; font-size: 1rem; line-height: 1.35; }
.lesson-card small { display: block; margin-top: 16px; color: var(--muted); font-size: .85rem; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; min-width: 0; }
.paper { min-width: 0; max-width: 100%; padding: clamp(25px, 4vw, 43px); }
.paper h2 { margin: 13px 0 23px; font-size: 2rem; }
.paper p { font-size: 1rem; }
.paper li { margin-bottom: 9px; line-height: 1.55; }
.knowledge-content, .knowledge-block { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.knowledge-content { line-height: 1.68; }
.knowledge-content pre { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.knowledge-content h2 { margin: 2.1em 0 .6em; font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
.knowledge-content h3 { margin: 1.7em 0 .55em; font-size: 1.2rem; }
.knowledge-content h4 { margin: 1.45em 0 .45em; font-size: 1.05rem; }
.knowledge-content p { margin: 0 0 1.15em; }
.knowledge-content ul, .knowledge-content ol { padding-left: 1.45rem; margin: .7em 0 1.25em; }
.knowledge-content blockquote { margin: 1.5em 0; padding: 14px 18px; border-left: 3px solid var(--wine); border-radius: 0 12px 12px 0; background: #f5efe9; }
.knowledge-content blockquote p:last-child { margin-bottom: 0; }
.knowledge-content table { display: block; min-width: 0; width: 100%; overflow-x: auto; }
.knowledge-content th, .knowledge-content td { padding: 8px 11px; }
.knowledge-content hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.knowledge-content code { background: #eee8df; border-radius: 5px; padding: 1px 5px; }
.side { padding: 25px; border: 1px solid #ddd3c6; border-radius: 20px; background: #ebe4d9; }
.side h3 { margin-bottom: 12px; }
.source { display: inline-block; margin: 14px 0 8px; color: var(--wine); font-weight: 750; text-underline-offset: 4px; }
.question { padding: 22px 0; border-top: 1px solid var(--line); }
.question h3 { margin: 0 0 13px; }
.answer { display: block; margin: 8px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; font-size: .95rem; cursor: pointer; }
.answer:hover { border-color: #c7b7aa; }
.answer:has(input:checked) { border-color: var(--wine); background: #f8f0ef; }
.answer input { margin-right: 9px; accent-color: var(--wine); }
.preview-answers { margin: 0; padding-left: 26px; }
.preview-answers li { padding: 4px 0; font-size: .96rem; }
.result { margin: 19px 0; padding: 19px 21px; border: 1px solid #dce7dc; border-radius: 14px; background: #eaf1ea; }
.result.fail { border-color: #edcecb; background: #faeae8; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
table { width: 100%; min-width: 800px; border-collapse: collapse; }
th, td { padding: 17px 19px; border-bottom: 1px solid #eee9e2; text-align: left; vertical-align: top; font-size: .9rem; }
th { background: #eee8df; color: #565951; font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.sort-button { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; padding:0; border:0; background:none; color:inherit; font:inherit; letter-spacing:inherit; text-align:left; text-transform:inherit; white-space:nowrap; }
.sort-button span { color:#9a8e7f; font-size:.85rem; }
.sort-button.active { color:var(--wine); }
.sort-button.active span { color:var(--wine); }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 5px; color: var(--muted); font-size: .83rem; }
tr[data-profile] { cursor: pointer; }
tr[data-profile]:hover { background: #f7f2eb; }
.branch-pill { background:#f0e9df; color:#65533f; white-space:nowrap; }
.invite { display: grid; grid-template-columns: 1.3fr 1fr auto; align-items: end; gap: 15px; margin: 26px 0; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.invite .field { margin: 0; }
.detail { margin-top: 22px; padding: 27px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
.activity-list { display: grid; gap: 9px; }
.activity-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.activity-row:last-child { border-bottom: 0; }
.course-notice { margin: 0 0 31px; }
.barber-nav { display:flex; justify-content:flex-end; margin-bottom:18px; }
.telegram-card { display:flex; justify-content:space-between; align-items:center; gap:24px; margin:22px 0; padding:24px; border:1px solid var(--line); border-radius:22px; background:var(--paper); box-shadow:var(--shadow); }
.telegram-card h2 { margin:8px 0; }
.telegram-card p { margin:0; color:var(--muted); font-size:.92rem; }
.telegram-card .button { flex:none; }
.updates-card, .publication-panel { margin:24px 0 32px; padding:26px; border:1px solid var(--line); border-radius:24px; background:var(--paper); box-shadow:var(--shadow); }
.updates-card h2 { margin:12px 0 17px; }
.update-item { display:flex; justify-content:space-between; align-items:center; width:100%; gap:18px; padding:15px 0; border:0; border-top:1px solid var(--line); background:none; color:var(--ink); text-align:left; }
.update-item small { color:var(--muted); max-width:52%; }
.update-item:hover strong { color:var(--wine); }
.ack-card { margin:24px 0; padding:22px; border:1px solid #d9c8b5; border-radius:18px; background:#f7f0e5; }
.ack-card strong { display:block; margin-bottom:8px; }
.ack-card p { margin-bottom:12px; }
.ack-card small { color:var(--muted); }
.publication-row { display:flex; justify-content:space-between; gap:24px; padding:18px 0; border-top:1px solid var(--line); }
.publication-row p { margin:6px 0 0; color:var(--muted); font-size:.9rem; }
.publication-row details { margin-top:10px; max-width:440px; font-size:.88rem; }
.publication-row summary { color:var(--wine); cursor:pointer; font-weight:700; }
.publication-row details p { color:var(--ink); }
.editor-panel { margin-top:22px; }
.feedback-card { margin-top:20px; }
.lesson-next { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-top:20px; padding:28px 32px; border-radius:22px; background:var(--ink); color:#fff; }
.lesson-next h2 { margin:8px 0 0; color:#fff; }
.lesson-next .eyebrow { color:#dac09a; }
.lesson-next .button { flex:none; }
.pathway-card { margin:22px 0; padding:25px 28px; border:1px solid var(--line); border-radius:24px; background:var(--paper); box-shadow:var(--shadow); }
.pathway-card p { margin:17px 0 0; color:var(--muted); }
.pathway-steps { display:flex; flex-wrap:wrap; gap:8px; margin-top:19px; }
.pathway-steps span { padding:9px 12px; border:1px solid var(--line); border-radius:999px; color:var(--muted); font-size:.78rem; font-weight:750; }
.pathway-steps span.current { border-color:#bca384; background:#f2e8db; color:var(--ink); }
.pathway-steps span.done { border-color:#bfd0c0; background:#eaf1ea; color:#315b45; }
.lesson-card.locked { opacity:.54; cursor:not-allowed; background:#f0ece6; }
.lesson-card.locked:hover { transform:none; box-shadow:none; }
.pathway-admin .section-head { margin-bottom:13px; }
.stage-row { display:flex; align-items:center; justify-content:space-between; gap:25px; padding:19px 0; border-top:1px solid var(--line); }
.stage-row p { margin:6px 0 0; color:var(--muted); font-size:.87rem; }
.stage-row small { display:block; margin-top:6px; color:var(--muted); }
.stage-row .pill { flex:none; }
.stage-action { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; max-width:470px; }
.stage-action input { min-width:190px; max-width:260px; padding:11px 13px; border:1px solid #d5d0c8; border-radius:12px; font:inherit; }
.feedback-card h2 { margin:10px 0; }
.feedback-history { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); }
.feedback-history p { margin:9px 0; font-size:.9rem; }
.feedback-history small { color:var(--muted); }
.feedback-row { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; padding:18px 0; border-top:1px solid var(--line); }
.feedback-row p { margin:5px 0; color:var(--muted); font-size:.9rem; }
.feedback-row p:last-child { color:var(--ink); white-space:pre-wrap; }
.feedback-row .button { flex:none; }
.field textarea { width:100%; min-height:95px; padding:13px 14px; border:1px solid #d5d0c8; border-radius:12px; color:var(--ink); background:white; font:inherit; resize:vertical; }
.field textarea.markdown-editor { min-height:320px; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.88rem; line-height:1.55; }
.field textarea:focus { border-color:var(--sage); outline:3px solid rgba(108,129,120,.15); }
.profile-onboarding { min-height:calc(100vh - 76px); padding:12px 0; background:radial-gradient(circle at 88% 4%, rgba(201,170,130,.2), transparent 34%), var(--canvas); }
.profile-form-card { max-width:980px; margin:0 auto; padding:clamp(26px,4vw,48px); border:1px solid var(--line); border-radius:28px; background:var(--paper); box-shadow:0 22px 55px rgba(37,42,40,.09); }
.profile-form-intro { max-width:700px; margin-bottom:24px; }
.profile-form-intro h1 { margin-bottom:13px; }
.profile-form-intro p { color:var(--muted); }
.profile-public-notice { display:flex; align-items:flex-start; gap:16px; margin:0 0 28px; padding:20px 22px; border:1px solid #d8b4aa; border-left:5px solid var(--wine); border-radius:16px; background:#f9eee9; color:#422d2e; }
.profile-public-notice-icon { display:grid; place-items:center; flex:none; width:30px; height:30px; border-radius:50%; background:var(--wine); color:#fff; font-weight:800; }
.profile-public-notice strong { display:block; margin:1px 0 6px; font-size:1.08rem; }
.profile-public-notice p { margin:0; line-height:1.55; }
.profile-public-mark { color:var(--wine); font-weight:900; font-size:1.1em; }
.profile-photo-field { display:flex; align-items:center; gap:22px; margin:8px 0 24px; padding:20px; border:1px solid var(--line); border-radius:20px; background:#f6f1e9; }
.profile-photo-field input[type="file"] { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.profile-photo-field .hint { margin:8px 0 0; }
.member-avatar { display:grid; place-items:center; flex:none; width:82px; height:82px; border-radius:24px; object-fit:cover; background:linear-gradient(135deg,#d8bea0,#9fb3a8); color:#253029; font-size:1.35rem; font-weight:850; box-shadow:0 8px 20px rgba(37,42,40,.12); }
.member-avatar.xlarge { width:112px; height:112px; border-radius:30px; font-size:1.8rem; }
.profile-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; }
.profile-form-grid .span-2 { grid-column:1 / -1; }
.profile-form-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:23px; }
.member-directory { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.member-directory > .empty { grid-column:1 / -1; width:100%; margin:0; }
.member-card { display:flex; align-items:flex-start; gap:20px; min-width:0; padding:25px; border:1px solid var(--line); border-radius:24px; background:var(--paper); box-shadow:var(--shadow); }
.member-card-main { min-width:0; flex:1; }
.member-card-title { display:flex; justify-content:space-between; gap:15px; align-items:flex-start; }
.member-card-title h2 { margin:0 0 8px; overflow-wrap:anywhere; }
.member-card-title > strong { color:var(--wine); font-size:1.45rem; }
.member-progress { overflow:hidden; height:8px; margin:17px 0 10px; border-radius:999px; background:#e7e1d8; }
.member-progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--wine),#9c6c70); }
.member-meta { margin:0 0 18px; color:var(--muted); font-size:.86rem; }
.member-card dl { margin:0; }
.member-card dl div { padding:12px 0; border-top:1px solid var(--line); }
.member-card dt { margin-bottom:5px; color:var(--wine); font-size:.74rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.member-card dd { margin:0; color:#4f5651; font-size:.9rem; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.knowledge-block { scroll-margin-top:30px; }
.knowledge-block:target { outline:3px solid #dac09a; border-radius:9px; }
.search-form { padding:24px; border:1px solid var(--line); border-radius:22px; background:var(--paper); box-shadow:var(--shadow); }
.search-form label { display:block; margin-bottom:10px; font-weight:750; }
.search-row { display:flex; gap:10px; }
.search-row input { flex:1; min-width:0; min-height:49px; padding:12px 15px; border:1px solid #d5d0c8; border-radius:12px; font:inherit; }
.search-results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:18px; }
.search-hit { display:block; padding:23px; border:1px solid var(--line); border-radius:20px; background:var(--paper); text-decoration:none; box-shadow:var(--shadow); }
.search-hit:hover { border-color:#c8ad8e; }
.search-hit h3 { margin:11px 0; }
.search-hit p { color:var(--muted); font-size:.93rem; }
.search-hit small { color:var(--wine); font-weight:750; }
.choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.new-question { margin:25px 0; padding:19px; border:1px solid var(--line); border-radius:17px; }
.new-question legend { padding:0 8px; font-weight:800; }
.lesson-video { margin-bottom:20px; overflow:hidden; }
.lesson-video .section-head { margin-bottom:16px; }
.video-frame { position:relative; overflow:hidden; border-radius:20px; background:#161817; aspect-ratio:16/9; box-shadow:0 16px 38px rgba(25,29,27,.18); }
.video-frame video { display:block; width:100%; height:100%; object-fit:contain; background:#111; }
.video-loading { position:absolute; inset:0; display:grid; place-items:center; padding:25px; color:#f7f3ed; background:linear-gradient(135deg,#202421,#343936); text-align:center; }
.video-status { padding:24px; border:1px dashed #c7baa9; border-radius:18px; color:var(--muted); background:#f6f1e9; }
.video-status.error { border-color:#d7aaaa; color:#7a3239; background:#fff2f1; }
.video-upload { margin-top:18px; }
.video-upload .hint { margin:10px 0 0; }
.upload-progress { overflow:hidden; height:9px; margin-top:15px; border-radius:999px; background:#e5ddd2; }
.upload-progress span { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--wine),#9c6c70); transition:width .18s ease; }
.toast { position: fixed; z-index: 10; bottom: 24px; left: 50%; max-width: min(90vw, 500px); padding: 13px 18px; border-radius: 12px; background: var(--ink); box-shadow: 0 15px 35px rgba(0, 0, 0, .22); color: white; font-size: .9rem; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-layout { grid-template-columns: 1fr; max-width: 760px; }
  .auth-story { min-height: 385px; }
  .member-directory { grid-template-columns:1fr; }
}
@media (max-width: 680px) {
  .search-results { grid-template-columns:1fr; }
  .search-row { flex-direction:column; }
  .choice-grid { grid-template-columns:1fr; }
  .publication-row, .update-item { flex-direction:column; align-items:flex-start; }
  .feedback-row { flex-direction:column; }
  .lesson-next { flex-direction:column; align-items:flex-start; padding:24px; }
  .stage-row { flex-direction:column; align-items:flex-start; }
  .stage-action { justify-content:flex-start; width:100%; }
  .stage-action input { width:100%; max-width:none; }
  .telegram-card { flex-direction:column; align-items:flex-start; }
  .update-item small { max-width:none; }
  .top { min-height: 68px; padding: 12px 17px; }
  .role-label { display: none; }
  .wrap { padding: 25px 16px 70px; }
  .topline { display: block; }
  .topline > .pill { margin-top: 17px; }
  .manager-nav { width: 100%; margin-bottom: 27px; }
  .manager-nav .nav-button { flex: 1; }
  .feature { display: block; padding: 26px; }
  .feature .button { width: 100%; margin-top: 21px; }
  .metrics { gap: 10px; }
  .metric { min-height: 115px; padding: 17px; }
  .metric strong { font-size: 1.7rem; }
  .lesson-list { grid-template-columns: 1fr; }
  .lesson-card { min-height: 104px; }
  .invite { grid-template-columns: 1fr; }
  .auth-layout { margin: 18px auto; padding: 0 14px; }
  .auth-story { min-height: 320px; padding: 29px; }
  .auth-story:before { opacity: .4; }
  .auth-story h1 { font-size: 3rem; }
  .auth-card { padding: 27px; }
  .section-head { display: block; }
  .section-head .muted { margin-top: 6px; }
  .headbar { flex-wrap: wrap; }
  .activity-row { display: block; }
  .profile-form-grid { grid-template-columns:1fr; }
  .profile-form-grid .span-2 { grid-column:auto; }
  .profile-form-card { padding:24px 19px; border-radius:22px; }
  .profile-photo-field, .member-card { flex-direction:column; align-items:flex-start; }
  .member-card { padding:21px; }
  .member-card-title { width:100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

.panel-history { margin-top: 10px; border-top: 1px solid var(--line); }
.panel-history > summary { padding: 18px 0 4px; color: var(--wine); font-weight: 750; cursor: pointer; }
.panel-history > summary:hover { text-decoration: underline; text-underline-offset: 4px; }
.panel-history > .muted { margin: 12px 0 0; }
@media (max-width: 700px) { .metrics-three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
