:root {
  --cream: #fdebdb;
  --paper: #fff8f2;
  --paper-strong: #fffdf9;
  --sand: #f4df8c;
  --orange: #e97132;
  --orange-dark: #bd5725;
  --graphite: #1f1f1f;
  --brown: #8a6f52;
  --line: rgba(138, 111, 82, 0.34);
  --line-orange: rgba(233, 113, 50, 0.52);
  --success: #2d7048;
  --error: #9d3e28;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shell: min(1360px, calc(100vw - 32px));
  --font-display: Aptos, "Segoe UI Variable Display", "Segoe UI", "Trebuchet MS", sans-serif;
  --font-body: Aptos, "Segoe UI", "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--graphite);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cpath d='M0 95.5h96M95.5 0v96' stroke='%238A6F52' stroke-opacity='.08'/%3E%3C/svg%3E");
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.02;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

h1 {
  font-size: clamp(2.25rem, 11vw, 5.6rem);
  font-weight: 900;
  letter-spacing: -0.055em;
}

h2 {
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 850;
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.18rem;
  font-weight: 800;
}

p {
  margin: 0;
}

code {
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font: 0.92em "Cascadia Code", Consolas, monospace;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 0.7rem 1rem;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--graphite);
  color: var(--paper);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(233, 113, 50, 0.45);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 235, 219, 0.96);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--orange);
}

.brand__mark .icon {
  width: 36px;
  height: 36px;
  stroke-width: 1.55;
}

.brand__copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 0.94;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-toggle {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
}

.site-nav {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  display: none;
  padding: 12px 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.site-nav.is-open {
  display: grid;
}

.site-nav a {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(138, 111, 82, 0.16);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--orange-dark);
}

.site-actions {
  display: none;
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
}

.account-link .icon {
  color: var(--orange);
}

.nav-badge {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  font-size: 0.72rem;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0.72rem 1.12rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  border-color: var(--orange);
  background: var(--orange);
  color: white;
}

.button--primary:hover {
  border-color: var(--orange-dark);
  background: var(--orange-dark);
}

.button--secondary {
  border-color: var(--line-orange);
  background: transparent;
  color: var(--orange-dark);
}

.button--secondary:hover {
  border-color: var(--orange);
  background: rgba(233, 113, 50, 0.08);
}

.button--ghost,
.button--text {
  border-color: transparent;
  background: transparent;
  color: var(--brown);
}

.button--ghost {
  border-color: var(--line);
}

.button--dark {
  border-color: var(--graphite);
  background: var(--graphite);
  color: var(--paper);
}

.button--danger {
  border-color: var(--error);
  background: transparent;
  color: var(--error);
}

.button--compact {
  min-height: 36px;
  padding: 0.48rem 0.72rem;
  font-size: 0.82rem;
}

.button--wide {
  width: 100%;
}

.hero {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__grid {
  min-height: 650px;
  display: grid;
  align-items: center;
  gap: 28px;
  padding-block: 64px 48px;
}

.hero__copy {
  position: relative;
  z-index: 2;
}

.hero__copy h1 {
  max-width: none;
}

.hero__lead {
  max-width: 670px;
  margin-top: 24px;
  color: #584738;
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero__actions--spaced {
  margin-top: 20px;
}

.hero__art {
  position: relative;
  min-height: 310px;
  align-self: stretch;
  overflow: hidden;
}

.hero__art img {
  position: absolute;
  right: 0;
  bottom: -8%;
  z-index: 2;
  width: 100%;
  max-width: none;
  mix-blend-mode: normal;
}

.hero__sun {
  position: absolute;
  top: 2%;
  right: 4%;
  width: min(58vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sand);
}

.hero__dash {
  position: absolute;
  left: 4%;
  top: 34%;
  width: 38%;
  height: 34%;
  border: 2px dashed var(--orange);
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(12deg);
}

.home-rail {
  background: var(--paper);
}

.home-rail__grid {
  display: grid;
}

.editorial-column {
  min-width: 0;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.editorial-column--warm {
  position: relative;
}

.editorial-column--warm::before {
  position: absolute;
  inset: 0 -16px;
  z-index: 0;
  content: "";
  background: rgba(244, 223, 140, 0.52);
}

.editorial-column--warm > * {
  position: relative;
  z-index: 1;
}

.editorial-column__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.editorial-column__head h2 {
  font-size: 1.35rem;
}

.editorial-column__head a,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--orange-dark);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
}

.editorial-column__head .icon,
.text-link .icon {
  width: 16px;
}

.event-row,
.direction-list > a,
.news-list > a {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(138, 111, 82, 0.24);
  text-decoration: none;
}

.event-row {
  grid-template-columns: 54px 1fr;
}

.event-row time {
  display: grid;
  align-content: start;
  padding-right: 10px;
  border-right: 1px solid var(--line);
  color: var(--orange);
}

.event-row time strong {
  font-size: 1.7rem;
  line-height: 1;
}

.event-row time span {
  font-size: 0.75rem;
  font-weight: 750;
}

.event-row > span,
.direction-list span,
.news-list a > span:last-child {
  display: grid;
  gap: 4px;
}

.event-row b,
.direction-list b,
.news-list b {
  line-height: 1.2;
}

.event-row small,
.direction-list small,
.news-list small {
  color: var(--brown);
  font-size: 0.78rem;
  line-height: 1.35;
}

.direction-list > a {
  grid-template-columns: 34px 1fr;
}

.direction-list .icon {
  width: 28px;
  height: 28px;
  color: var(--orange);
}

.news-list > a {
  grid-template-columns: 38px 1fr;
}

.news-list__date {
  color: var(--orange);
  font-size: 1.3rem;
  font-weight: 850;
}

.empty-row {
  display: grid;
  gap: 6px;
  padding: 24px 0;
  color: var(--brown);
}

.join-band {
  padding: 56px 0;
  background: var(--sand);
}

.join-band__grid {
  display: grid;
  gap: 28px;
}

.join-band h2 {
  max-width: 10ch;
}

.join-band p {
  max-width: 620px;
  margin-top: 12px;
  color: #584738;
}

.join-steps {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}

.join-steps li {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid rgba(31, 31, 31, 0.24);
}

.join-steps span {
  font-weight: 850;
}

.join-steps p {
  margin: 0;
}

.join-band__action {
  align-self: end;
}

.section,
.page-hero,
.section--cabinet,
.workspace-section,
.auth-section {
  padding-block: 56px;
}

.section--tight {
  padding-top: 0;
}

.section-head {
  max-width: 880px;
  margin-bottom: 34px;
}

.section-head h1 {
  margin-bottom: 16px;
}

.section-head--compact {
  margin-bottom: 28px;
}

.lead {
  max-width: 820px;
  color: var(--brown);
  font-size: 1.05rem;
}

.eyebrow,
.card-kicker,
.hero-card__label {
  display: none;
}

.page-hero {
  border-bottom: 1px solid var(--line);
}

.page-hero__grid {
  display: grid;
  gap: 28px;
}

.page-hero h1 {
  max-width: 12ch;
  margin-bottom: 22px;
}

.hero-card {
  align-self: end;
  padding: 22px 0 0 22px;
  border-top: 1px solid var(--orange);
  border-left: 1px solid var(--orange);
  background: transparent;
}

.hero-card h2 {
  margin-bottom: 10px;
}

.hero-card p + .button {
  margin-top: 18px;
}

.panel {
  min-width: 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.panel h2,
.panel h3 {
  margin-bottom: 14px;
}

.panel p + p {
  margin-top: 10px;
}

.panel--compact {
  padding: 24px 0;
}

.public-grid,
.cards-grid,
.panel__split,
.editor-columns {
  display: grid;
  gap: 28px;
}

.cards-grid > .panel {
  border-top-color: var(--line-orange);
}

.icon-badge {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--line-orange);
  border-radius: 50%;
  color: var(--orange);
}

.timeline {
  counter-reset: timeline;
}

.timeline__item {
  counter-increment: timeline;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.timeline__item::before {
  content: counter(timeline, decimal-leading-zero);
  color: var(--orange);
  font-weight: 850;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 20px;
}

.tag-chip {
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #594637;
  font-size: 0.86rem;
}

.ordered-list {
  padding-left: 1.3rem;
}

.ordered-list li {
  padding: 7px 0;
}

.metric-grid {
  display: grid;
  gap: 0;
  border-block: 1px solid var(--line);
}

.metric-card {
  display: grid;
  gap: 3px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.metric-card:last-child {
  border-bottom: 0;
}

.metric-card strong {
  font-size: 1.12rem;
}

.metric-card span {
  color: var(--brown);
  font-size: 0.8rem;
}

.stack-list {
  display: grid;
}

.stack-card,
.message-card,
.mail-message,
.coauthor-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.stack-card--soft {
  padding-inline: 14px;
  background: rgba(244, 223, 140, 0.24);
}

.stack-inline,
.coauthor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-meta,
.small-note,
.coauthor-meta,
.mail-count,
.composer-hint {
  color: var(--brown);
  font-size: 0.8rem;
}

.input,
.input-prefix {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 249, 0.72);
  transition: border-color 150ms ease, background 150ms ease;
}

.input {
  padding: 0.68rem 0.8rem;
}

.input:focus,
.input-prefix:focus-within {
  border-color: var(--orange);
  background: var(--paper-strong);
  outline: none;
}

.input--textarea {
  min-height: 112px;
  resize: vertical;
}

.input-prefix {
  display: flex;
  align-items: center;
}

.input-prefix b {
  padding-left: 0.8rem;
  color: var(--orange);
}

.input-prefix input {
  width: 100%;
  min-width: 0;
  padding: 0.68rem;
  border: 0;
  background: transparent;
  outline: none;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-stack label,
.auth-form label,
.broadcast-form > label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}

.form-row,
.form-inline {
  display: grid;
  gap: 12px;
}

.field-counter {
  justify-self: end;
  color: var(--brown);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.check-chip,
.checkbox-row,
.radio-row {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.check-chip input,
.radio-row input {
  accent-color: var(--orange);
}

.flash-stack {
  position: relative;
  z-index: 60;
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

.flash {
  padding: 12px 14px;
  border-left: 3px solid var(--orange);
  background: var(--paper);
  font-size: 0.9rem;
}

.flash--success {
  border-left-color: var(--success);
}

.flash--error {
  border-left-color: var(--error);
}

.auth-section {
  min-height: calc(100vh - 260px);
}

.auth-layout {
  display: grid;
  gap: 38px;
}

.auth-intro {
  max-width: 680px;
}

.auth-intro__icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 30px;
  border: 1px solid var(--orange);
  color: var(--orange);
}

.auth-intro__icon .icon {
  width: 28px;
  height: 28px;
}

.auth-intro h1 {
  max-width: 9ch;
}

.auth-intro > p {
  max-width: 620px;
  margin-top: 20px;
  color: var(--brown);
  font-size: 1.08rem;
}

.auth-note {
  display: grid;
  gap: 6px;
  max-width: 620px;
  margin-top: 30px;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}

.auth-note span {
  color: var(--brown);
}

.auth-form {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.auth-form header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.auth-form header h2 {
  font-size: 1.55rem;
}

.auth-form header p {
  margin-top: 8px;
  color: var(--brown);
  font-size: 0.86rem;
}

.auth-form__links {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.auth-form__links a {
  color: var(--orange-dark);
  font-size: 0.84rem;
}

.auth-steps {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.auth-steps li {
  display: grid;
  grid-template-columns: 42px 1fr;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.auth-steps span {
  color: var(--orange);
  font-weight: 850;
}

.recovery-status {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-left: 2px solid var(--orange);
  background: rgba(244, 223, 140, 0.3);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.5s infinite;
}

.cabinet-layout {
  display: grid;
  gap: 30px;
}

.panel--sidebar {
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 248, 242, 0.48);
}

.panel--sidebar h3 {
  padding: 18px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.side-nav {
  display: grid;
}

.side-nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(138, 111, 82, 0.16);
  color: #4d3d31;
  font-size: 0.86rem;
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--orange-dark);
  background: rgba(244, 223, 140, 0.25);
}

.side-nav .icon {
  color: var(--orange);
}

.cabinet-main {
  min-width: 0;
}

.cabinet-main > .panel:first-child {
  padding-top: 0;
  border-top: 0;
}

.mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.mail-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.mail-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--brown);
  font-size: 0.88rem;
  text-decoration: none;
}

.mail-tab.is-active {
  border-bottom-color: var(--orange);
  color: var(--graphite);
  font-weight: 750;
}

.mail-layout,
.messenger-shell {
  display: grid;
  gap: 16px;
}

.mail-composer,
.conversation-list,
.messenger-panel {
  border: 1px solid var(--line);
  background: rgba(255, 248, 242, 0.7);
}

.mail-composer,
.conversation-list {
  padding: 18px;
}

.mail-message.is-unread {
  padding-inline: 14px;
  border-left: 3px solid var(--orange);
  background: rgba(244, 223, 140, 0.24);
}

.mail-message__head,
.coauthor-card__head,
.message-card__subject {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.messenger-sidebar {
  min-width: 0;
}

.messenger-sidebar__head,
.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.messenger-search {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.conversation-list__items {
  max-height: 560px;
  overflow: auto;
}

.conversation-link {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(138, 111, 82, 0.2);
  text-decoration: none;
}

.conversation-link.is-active {
  padding-inline: 10px;
  border-left: 3px solid var(--orange);
  background: rgba(244, 223, 140, 0.25);
}

.conversation-link__content,
.conversation-link__top {
  min-width: 0;
}

.conversation-link__content {
  display: grid;
  gap: 2px;
}

.conversation-link__top {
  display: flex;
  justify-content: space-between;
}

.conversation-link__content span,
.conversation-link__content small {
  overflow: hidden;
  color: var(--brown);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-orange);
  border-radius: 50%;
  background: var(--sand);
  color: var(--orange-dark);
  font-weight: 850;
}

.avatar--small {
  width: 36px;
  height: 36px;
}

.messenger-chat {
  display: grid;
  min-height: 620px;
  grid-template-rows: auto minmax(340px, 1fr) auto;
  padding: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.chat-header__identity,
.chat-header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.chat-header p {
  color: var(--brown);
  font-size: 0.8rem;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 18px;
  background: var(--paper);
}

.bubble {
  width: fit-content;
  max-width: min(78%, 650px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-strong);
}

.bubble--own {
  align-self: flex-end;
  border-color: var(--line-orange);
  background: rgba(244, 223, 140, 0.56);
}

.bubble__meta {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  color: var(--brown);
  font-size: 0.72rem;
  font-weight: 700;
}

.bubble__subject {
  margin-top: 7px;
  font-weight: 800;
}

.bubble__status {
  display: block;
  margin-top: 6px;
  color: var(--brown);
  font-size: 0.68rem;
  text-align: right;
}

.thread-date {
  display: flex;
  justify-content: center;
  margin: 8px 0;
  color: var(--brown);
  font-size: 0.72rem;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.chat-composer label {
  min-width: 0;
}

.chat-input {
  min-height: 46px;
  max-height: 180px;
}

.composer-hint {
  display: none;
}

.empty-chat {
  align-self: center;
  justify-self: center;
  display: grid;
  max-width: 420px;
  gap: 12px;
  justify-items: center;
  padding: 34px;
  text-align: center;
}

.coauthor-layout,
.coauthor-board {
  display: grid;
  gap: 24px;
}

.coauthor-card {
  position: relative;
}

.coauthor-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 2px;
  content: "";
  background: var(--orange);
}

.response-panel {
  margin-top: 16px;
  padding: 18px;
  border-left: 2px solid var(--orange);
  background: var(--paper);
}

.workspace {
  display: grid;
  gap: 26px;
}

.workspace-nav {
  border: 1px solid var(--line);
  background: var(--paper);
}

.workspace-nav__title {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.workspace-nav__title > span {
  color: var(--orange);
}

.workspace-nav__title div {
  display: grid;
}

.workspace-nav__title small {
  color: var(--brown);
}

.workspace-nav nav {
  display: grid;
}

.workspace-nav nav a,
.workspace-nav__back {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(138, 111, 82, 0.16);
  font-size: 0.86rem;
  text-decoration: none;
}

.workspace-nav nav a.is-active {
  border-left: 3px solid var(--orange);
  background: rgba(244, 223, 140, 0.28);
  color: var(--orange-dark);
  font-weight: 750;
}

.workspace-nav nav .icon,
.workspace-nav__back .icon {
  color: var(--orange);
}

.workspace-nav__back {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.workspace-head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.workspace-head h1 {
  font-size: clamp(2.2rem, 7vw, 3.8rem);
}

.workspace-head p,
.workspace-block__head p {
  margin-top: 7px;
  color: var(--brown);
}

.broadcast-layout {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.broadcast-form,
.broadcast-preview {
  padding: 28px 0;
}

.broadcast-form {
  display: grid;
  gap: 18px;
}

.broadcast-form fieldset {
  display: grid;
  padding: 0;
  border: 0;
}

.broadcast-form legend {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.broadcast-form .radio-row {
  border-right: 0;
  padding-inline: 0;
}

.form-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(233, 113, 50, 0.32);
  background: rgba(244, 223, 140, 0.34);
}

.form-warning .icon {
  color: var(--orange);
}

.broadcast-preview h2 {
  margin-bottom: 14px;
  font-size: 1.3rem;
}

.telegram-preview {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: rgba(253, 235, 219, 0.62);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M12 18h18M21 9v18M54 50l12 6-12 6zM12 58c8-9 17 8 25-2' fill='none' stroke='%238A6F52' stroke-opacity='.08'/%3E%3C/svg%3E");
}

.telegram-preview__date {
  position: absolute;
  top: 18px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(138, 111, 82, 0.72);
  color: white;
  font-size: 0.7rem;
}

.telegram-preview article {
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: 38px 1fr;
  gap: 10px;
}

.telegram-preview article > div {
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(138, 111, 82, 0.18);
  border-radius: var(--radius-lg);
  background: var(--paper-strong);
}

.telegram-preview article p {
  margin-top: 8px;
  white-space: pre-wrap;
}

.telegram-preview__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--orange);
}

.workspace-block {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.workspace-block__head {
  margin-bottom: 18px;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(255, 248, 242, 0.58);
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  background: rgba(244, 223, 140, 0.22);
  font-weight: 800;
}

.status-text {
  color: var(--orange-dark);
  font-weight: 750;
}

.admin-grid {
  display: grid;
  gap: 30px;
}

.compact-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.compact-list > div {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.compact-list span {
  display: grid;
}

.compact-list small,
.compact-list em {
  color: var(--brown);
  font-size: 0.76rem;
  font-style: normal;
}

.editor-form {
  display: grid;
  gap: 36px;
}

.editor-section {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 242, 0.55);
}

.repeater {
  display: grid;
  gap: 12px;
}

.editor-row-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.repeat-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.editor-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-orange);
  background: var(--paper);
}

.site-footer {
  padding: 36px 0 20px;
  border-top: 1px solid rgba(255, 248, 242, 0.22);
  background: var(--brown);
  color: var(--paper);
}

.site-footer__inner {
  display: grid;
  gap: 28px;
}

.footer-brand {
  display: flex;
  gap: 14px;
}

.brand__mark--footer {
  color: var(--paper);
}

.site-footer__title {
  font-size: 1.15rem;
  font-weight: 850;
}

.site-footer__text {
  max-width: 420px;
  margin-top: 5px;
  color: rgba(255, 248, 242, 0.74);
  font-size: 0.85rem;
}

.site-footer__links,
.footer-contact {
  display: grid;
  align-content: start;
  gap: 7px;
}

.site-footer__links a,
.footer-contact a {
  width: fit-content;
  color: rgba(255, 248, 242, 0.88);
  font-size: 0.86rem;
  text-decoration: none;
}

.footer-contact a {
  display: flex;
  gap: 8px;
  align-items: center;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@keyframes pulse {
  50% { opacity: 0.35; transform: scale(0.85); }
}

@media (min-width: 720px) {
  :root {
    --shell: min(1360px, calc(100vw - 64px));
  }

  .form-row,
  .form-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 1px solid var(--line);
  }

  .metric-card {
    padding-inline: 14px;
    border-right: 1px solid var(--line);
  }

  .public-grid,
  .panel__split,
  .editor-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.75fr);
    align-items: center;
  }

  .mail-layout {
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.5fr);
  }

  .messenger-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .coauthor-layout {
    grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.6fr);
  }

  .site-footer__inner {
    grid-template-columns: minmax(300px, 1.2fr) 0.7fr 0.8fr;
  }

  .repeat-row--pair {
    grid-template-columns: 0.8fr 1.4fr auto;
    align-items: start;
  }
}

@media (min-width: 1040px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    min-height: 88px;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex;
    justify-content: center;
    gap: clamp(14px, 1.6vw, 28px);
    padding: 0;
    border: 0;
    background: transparent;
  }

  .site-nav a {
    position: relative;
    padding: 32px 0;
    border: 0;
    font-size: 0.86rem;
    font-weight: 650;
  }

  .site-nav a[aria-current="page"]::after {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    height: 2px;
    content: "";
    background: var(--orange);
  }

  .site-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hero__grid {
    min-height: 670px;
    grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
    padding-block: 68px 40px;
  }

  .hero__copy h1 {
    font-size: clamp(4.2rem, 5.4vw, 5.2rem);
  }

  .hero__art {
    min-height: 570px;
  }

  .hero__art img {
    right: -16%;
    bottom: -4%;
    width: 124%;
  }

  .hero__sun {
    width: 360px;
  }

  .home-rail__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editorial-column {
    padding: 34px 28px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .editorial-column:first-child {
    padding-left: 0;
  }

  .editorial-column:last-child {
    padding-right: 0;
    border-right: 0;
  }

  .editorial-column--warm::before {
    inset: 0;
  }

  .join-band__grid {
    grid-template-columns: minmax(260px, 0.8fr) minmax(480px, 1.35fr) auto;
    align-items: start;
  }

  .page-hero__grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.55fr);
    align-items: end;
  }

  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cabinet-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
  }

  .panel--sidebar {
    position: sticky;
    top: 112px;
  }

  .workspace {
    grid-template-columns: 230px minmax(0, 1fr);
    align-items: start;
  }

  .workspace-nav {
    position: sticky;
    top: 112px;
    min-height: 650px;
    display: grid;
    grid-template-rows: auto 1fr auto;
  }

  .broadcast-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  }

  .broadcast-form {
    padding-right: 28px;
    border-right: 1px solid var(--line);
  }

  .broadcast-preview {
    padding-left: 28px;
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  .hero__actions .button,
  .join-band__action .button {
    width: 100%;
  }

  .hero__grid {
    padding-top: 44px;
  }

  .hero__art {
    min-height: 280px;
  }

  .section,
  .page-hero,
  .section--cabinet,
  .workspace-section,
  .auth-section {
    padding-block: 40px;
  }

  .chat-header__actions {
    width: 100%;
    overflow-x: auto;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }

  .chat-composer .button {
    width: 100%;
  }

  .messenger-chat {
    min-height: 560px;
  }

  .bubble {
    max-width: 90%;
  }

  .workspace-head .button {
    width: 100%;
  }

  .auth-form {
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Unified LMS-inspired interface. The brand palette and Aptos font stack stay unchanged. */
:root {
  --app-sidebar: 224px;
  --app-topbar: 78px;
  --app-canvas: #f8eadf;
  --surface: #fffaf6;
  --surface-strong: #ffffff;
  --surface-muted: #f7eee7;
  --app-line: rgba(138, 111, 82, 0.18);
  --app-shadow: 0 12px 36px rgba(78, 55, 35, 0.08);
  --app-shadow-soft: 0 6px 20px rgba(78, 55, 35, 0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

.panel,
.auth-form,
.hero-card {
  border: 1px solid var(--app-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 246, 0.94);
  box-shadow: var(--app-shadow-soft);
}

.button {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 750;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  box-shadow: 0 7px 16px rgba(233, 113, 50, 0.2);
}

.input,
.input-prefix,
.auth-form input,
.auth-form textarea,
.auth-form select {
  min-height: 48px;
  border: 1px solid rgba(138, 111, 82, 0.26);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: none;
}

.input:focus,
.input-prefix:focus-within,
.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(233, 113, 50, 0.11);
  outline: none;
}

.has-member-shell {
  min-height: 100vh;
  background: var(--app-canvas);
}

.has-member-shell::before {
  opacity: 0.12;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: var(--app-sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--app-line);
  background: rgba(255, 250, 246, 0.97);
  box-shadow: 12px 0 36px rgba(78, 55, 35, 0.04);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  color: var(--graphite);
  text-decoration: none;
}

.app-brand__mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--orange);
  color: white;
  box-shadow: 5px 5px 0 var(--sand);
}

.app-brand__mark .icon {
  width: 23px;
  height: 23px;
}

.app-brand strong,
.app-brand small {
  display: block;
}

.app-brand strong {
  font-family: var(--font-display);
  font-size: 0.83rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.app-brand small {
  color: var(--brown);
  font-size: 0.77rem;
}

.app-nav {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.app-nav__label {
  padding: 0 12px 7px;
  color: var(--brown);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.app-nav__label--spaced {
  margin-top: 20px;
}

.app-nav a {
  display: grid;
  min-height: 48px;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 13px;
  color: #5d5147;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.app-nav a:hover {
  background: var(--surface-muted);
  color: var(--graphite);
  transform: translateX(2px);
}

.app-nav a[aria-current="page"] {
  background: rgba(244, 223, 140, 0.45);
  color: var(--graphite);
}

.app-nav__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
}

.app-nav__icon .icon {
  width: 18px;
  height: 18px;
}

.app-nav a[aria-current="page"] .app-nav__icon {
  border-color: rgba(233, 113, 50, 0.18);
  background: var(--orange);
  color: white;
  box-shadow: 3px 3px 0 var(--sand);
}

.app-sidebar__foot {
  display: grid;
  gap: 3px;
  padding-top: 14px;
  border-top: 1px solid var(--app-line);
}

.app-sidebar__foot a,
.app-sidebar__foot button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--brown);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.app-sidebar__foot a:hover,
.app-sidebar__foot button:hover {
  background: var(--surface-muted);
  color: var(--graphite);
}

.app-stage {
  min-height: 100vh;
  margin-left: var(--app-sidebar);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--app-topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--app-line);
  background: rgba(255, 250, 246, 0.92);
  backdrop-filter: blur(14px);
}

.app-topbar__eyebrow {
  margin-bottom: 2px;
  color: var(--brown);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-topbar > div > strong {
  font-family: var(--font-display);
  font-size: 1.03rem;
  font-weight: 850;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-action,
.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--graphite);
  text-decoration: none;
}

.topbar-action .nav-badge {
  position: absolute;
  top: -5px;
  right: -5px;
}

.profile-chip {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: var(--surface-strong);
  text-decoration: none;
}

.profile-chip > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.profile-chip strong,
.profile-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chip strong {
  font-size: 0.79rem;
}

.profile-chip small {
  color: var(--brown);
  font-size: 0.69rem;
}

.profile-chip > .icon {
  width: 15px;
  color: var(--brown);
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: var(--sand);
  color: var(--graphite);
  font-family: var(--font-display);
  font-weight: 900;
}

.avatar--small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.app-flashes {
  width: auto;
  margin: 18px clamp(20px, 3vw, 42px) 0;
}

.app-main {
  min-width: 0;
}

.app-page,
.has-member-shell .section--cabinet,
.has-member-shell .workspace-section,
.has-member-shell .page-hero,
.has-member-shell .section--tight {
  padding: 26px clamp(20px, 3vw, 42px) 34px;
}

.has-member-shell .shell {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}

.app-page__head,
.has-member-shell .section-head--compact {
  margin-bottom: 22px;
}

.app-page__head h1,
.has-member-shell .section-head--compact h1,
.has-member-shell .page-hero h1,
.has-member-shell .workspace-head h1 {
  max-width: 820px;
  margin-top: 5px;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  letter-spacing: -0.045em;
}

.app-page__head > p:last-child,
.has-member-shell .section-head--compact .lead {
  max-width: 780px;
  margin-top: 9px;
  color: var(--brown);
  font-size: 0.94rem;
}

.has-member-shell .panel {
  padding: 24px;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--app-shadow-soft);
}

.has-member-shell .panel h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -0.03em;
}

.has-member-shell .panel--sidebar {
  display: none;
}

.has-member-shell .cabinet-layout {
  display: block;
}

.has-member-shell .cabinet-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.has-member-shell .cabinet-main > .panel {
  grid-column: 1 / -1;
  scroll-margin-top: calc(var(--app-topbar) + 18px);
}

.has-member-shell .cabinet-main > #profile,
.has-member-shell .cabinet-main > #messages {
  grid-column: auto;
}

.has-member-shell #messages .panel__split {
  grid-template-columns: 1fr;
}

.panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.status-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(45, 112, 72, 0.1);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.has-member-shell .metric-grid {
  gap: 10px;
}

.has-member-shell .checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
}

.has-member-shell .check-chip {
  position: relative;
  padding: 0;
  border: 0;
}

.has-member-shell .check-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.has-member-shell .check-chip span {
  display: block;
  padding: 8px 11px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--brown);
  font-size: 0.74rem;
  font-weight: 700;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.has-member-shell .check-chip input:checked + span {
  border-color: rgba(233, 113, 50, 0.34);
  background: rgba(244, 223, 140, 0.55);
  color: var(--graphite);
}

.has-member-shell .check-chip input:focus-visible + span {
  outline: 3px solid rgba(233, 113, 50, 0.35);
  outline-offset: 2px;
}

.has-member-shell .metric-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: var(--surface-strong);
}

.has-member-shell .metric-card strong {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.has-member-shell .metric-card span {
  color: var(--brown);
  font-size: 0.72rem;
  line-height: 1.35;
}

.profile-email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--app-line);
}

.profile-email-form label,
.form-columns label {
  display: grid;
  gap: 6px;
}

.profile-email-form label > span,
.form-columns label > span {
  font-size: 0.76rem;
  font-weight: 750;
}

.form-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-help,
.form-success {
  color: var(--brown);
  font-size: 0.78rem;
}

.form-success {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(45, 112, 72, 0.08);
  color: var(--success);
}

.app-mobile-nav {
  display: none;
}

/* Messenger */
.app-page--messenger {
  height: calc(100vh - var(--app-topbar));
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  overflow: hidden;
}

.messenger-page-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.messenger-page-head h1 {
  font-size: clamp(1.8rem, 2.7vw, 2.55rem);
}

.messenger-page-head > div > p:last-child {
  margin-top: 5px;
  color: var(--brown);
  font-size: 0.84rem;
}

.messenger-open {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  display: flex;
  min-width: 240px;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--brown);
}

.search-field .icon {
  width: 17px;
  height: 17px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--graphite);
  font-size: 0.83rem;
}

.messenger-workspace {
  min-height: 0;
  display: grid;
  flex: 1;
  grid-template-columns: 326px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--app-shadow);
}

.conversation-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--app-line);
  background: #fffaf6;
}

.conversation-pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}

.conversation-pane__head strong,
.conversation-pane__head small {
  display: block;
}

.conversation-pane__head strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 850;
}

.conversation-pane__head small {
  margin-top: 2px;
  color: var(--brown);
  font-size: 0.7rem;
}

.conversation-pane__head .icon-button {
  width: 36px;
  height: 36px;
  border-color: rgba(233, 113, 50, 0.2);
  background: rgba(233, 113, 50, 0.09);
  color: var(--orange-dark);
}

.conversation-filter {
  min-width: 0;
  margin: 0 14px 12px;
  background: var(--surface-muted);
}

.conversation-list__items {
  min-height: 0;
  flex: 1;
  padding: 0 8px 12px;
  overflow-y: auto;
}

.conversation-link {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border: 0;
  border-radius: 14px;
  color: var(--graphite);
  text-decoration: none;
  transition: background-color 140ms ease, transform 140ms ease;
}

.conversation-link:hover {
  background: var(--surface-muted);
  transform: translateX(2px);
}

.conversation-link.is-active {
  background: rgba(244, 223, 140, 0.42);
}

.conversation-link.is-active::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 999px;
  content: "";
  background: var(--orange);
}

.conversation-link .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.conversation-link__content {
  min-width: 0;
}

.conversation-link__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conversation-link__top strong {
  overflow: hidden;
  font-size: 0.81rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-link__top time {
  color: var(--brown);
  font-size: 0.64rem;
}

.conversation-link__preview {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--brown);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 42px 20px;
  color: var(--brown);
  text-align: center;
}

.conversation-empty .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 5px;
  color: var(--orange);
}

.conversation-empty small {
  max-width: 210px;
  font-size: 0.7rem;
}

.chat-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(253, 235, 219, 0.48), rgba(255, 255, 255, 0.9));
}

.chat-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--app-line);
  background: rgba(255, 255, 255, 0.82);
}

.chat-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.chat-header__identity {
  min-width: 0;
  flex: 1;
}

.chat-header__identity h2 {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header__identity p {
  margin-top: 2px;
  overflow: hidden;
  color: var(--brown);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-header__status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brown);
  font-size: 0.68rem;
}

.chat-header__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.chat-back {
  display: none;
}

.chat-thread {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 22px clamp(18px, 3vw, 42px);
  overflow-y: auto;
  scroll-behavior: smooth;
}

.thread-date {
  position: sticky;
  top: 0;
  z-index: 2;
  align-self: center;
  padding: 4px 9px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.9);
  color: var(--brown);
  font-size: 0.63rem;
  backdrop-filter: blur(8px);
}

.bubble {
  width: fit-content;
  max-width: min(68%, 680px);
  padding: 10px 12px 7px;
  border: 1px solid var(--app-line);
  border-radius: 7px 16px 16px 16px;
  background: var(--surface-strong);
  box-shadow: 0 4px 12px rgba(78, 55, 35, 0.05);
}

.bubble--own {
  align-self: flex-end;
  border-color: rgba(233, 113, 50, 0.24);
  border-radius: 16px 7px 16px 16px;
  background: #f9e8aa;
}

.bubble__subject {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
}

.bubble > p {
  white-space: pre-wrap;
  font-size: 0.86rem;
  line-height: 1.45;
}

.bubble__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  color: var(--brown);
  font-size: 0.6rem;
}

.bubble__foot .icon {
  width: 12px;
  height: 12px;
  color: var(--orange-dark);
}

.empty-chat {
  max-width: 430px;
  display: grid;
  align-self: center;
  justify-items: center;
  gap: 8px;
  margin: auto;
  padding: 24px;
  color: var(--brown);
  text-align: center;
}

.empty-chat h2,
.empty-chat h3 {
  color: var(--graphite);
}

.empty-chat p {
  font-size: 0.82rem;
}

.empty-chat__mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  background: var(--sand);
  color: var(--orange-dark);
  box-shadow: 5px 5px 0 rgba(233, 113, 50, 0.15);
}

.empty-chat__mark .icon {
  width: 25px;
  height: 25px;
}

.chat-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 9px;
  padding: 12px 18px 26px;
  border-top: 1px solid var(--app-line);
  background: rgba(255, 255, 255, 0.9);
}

.chat-composer label {
  min-width: 0;
}

.chat-composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  display: block;
  resize: none;
  padding: 11px 14px;
  border: 1px solid var(--app-line);
  border-radius: 14px;
  background: var(--surface-muted);
  outline: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.chat-composer textarea:focus {
  border-color: var(--orange);
  background: white;
  box-shadow: 0 0 0 4px rgba(233, 113, 50, 0.1);
}

.chat-send {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--orange);
  color: white;
  box-shadow: 0 7px 16px rgba(233, 113, 50, 0.24);
}

.chat-send:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chat-send .icon {
  width: 19px;
  height: 19px;
}

.composer-hint {
  position: absolute;
  right: 72px;
  bottom: 7px;
  color: var(--brown);
  font-size: 0.61rem;
}

/* Coauthoring board */
.has-member-shell .page-hero {
  padding-bottom: 12px;
}

.has-member-shell .page-hero__grid {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.48fr);
  align-items: stretch;
  gap: 18px;
}

.has-member-shell .page-hero__grid > div {
  align-self: center;
}

.has-member-shell .hero-card {
  padding: 18px 20px;
  border-color: rgba(233, 113, 50, 0.2);
  background: rgba(244, 223, 140, 0.27);
  box-shadow: none;
}

.has-member-shell .coauthor-layout {
  grid-template-columns: minmax(310px, 0.65fr) minmax(0, 1.35fr);
  align-items: start;
  gap: 18px;
}

.has-member-shell .coauthor-aside {
  position: sticky;
  top: calc(var(--app-topbar) + 22px);
  max-height: calc(100vh - var(--app-topbar) - 44px);
  overflow-y: auto;
}

.has-member-shell .coauthor-aside h2 {
  margin-bottom: 16px;
}

.has-member-shell .checkbox-grid--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.has-member-shell .check-chip span,
.has-member-shell .tag-chip {
  border-radius: 999px;
}

.has-member-shell .coauthor-board {
  gap: 14px;
}

.has-member-shell .coauthor-card {
  overflow: hidden;
}

.has-member-shell .coauthor-card::before {
  width: 4px;
}

.has-member-shell .coauthor-card__head h2 {
  margin-top: 4px;
}

.has-member-shell .response-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(233, 113, 50, 0.2);
  border-radius: 16px;
  background: rgba(253, 235, 219, 0.48);
}

/* Authentication */
.auth-section {
  min-height: calc(100vh - 88px);
  display: grid;
  align-items: center;
  padding-block: clamp(48px, 8vw, 88px);
  background: radial-gradient(circle at 17% 20%, rgba(244, 223, 140, 0.48), transparent 31%), linear-gradient(145deg, var(--cream), #fff8f2);
}

.auth-layout {
  gap: clamp(32px, 6vw, 84px);
}

.auth-intro {
  max-width: 650px;
}

.auth-intro h1 {
  max-width: 650px;
  margin-top: 10px;
  font-size: clamp(2.7rem, 5.8vw, 5rem);
  line-height: 0.94;
}

.auth-intro > p:not(.eyebrow) {
  max-width: 570px;
  margin-top: 20px;
  color: var(--brown);
  font-size: 1rem;
}

.auth-intro__icon {
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  border: 0;
  border-radius: 17px;
  background: var(--orange);
  color: white;
  box-shadow: 6px 6px 0 var(--sand);
}

.auth-note {
  max-width: 560px;
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid rgba(233, 113, 50, 0.2);
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.72);
}

.auth-form {
  width: 100%;
  max-width: 510px;
  justify-self: end;
  padding: clamp(22px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--app-shadow);
}

.auth-form header h2 {
  font-size: 1.65rem;
}

.auth-form__links {
  gap: 10px 18px;
}

.auth-form__links a:first-child {
  color: var(--orange-dark);
}

@media (max-width: 1120px) {
  .has-member-shell .cabinet-main {
    grid-template-columns: 1fr;
  }

  .has-member-shell .cabinet-main > #profile,
  .has-member-shell .cabinet-main > #messages {
    grid-column: 1;
  }

  .messenger-page-head > div > p:last-child {
    display: none;
  }

  .has-member-shell .coauthor-layout {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  }
}

@media (max-width: 900px) {
  :root {
    --app-topbar: 64px;
  }

  .app-sidebar {
    display: none;
  }

  .app-stage {
    margin-left: 0;
    padding-bottom: 72px;
  }

  .app-topbar {
    min-height: var(--app-topbar);
    padding: 9px 16px;
  }

  .app-topbar__eyebrow,
  .profile-chip > span:nth-child(2),
  .profile-chip > .icon {
    display: none;
  }

  .profile-chip {
    min-width: 0;
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .app-mobile-nav {
    position: fixed;
    inset: auto 10px 9px;
    z-index: 100;
    display: grid;
    height: 62px;
    grid-template-columns: repeat(4, 1fr);
    padding: 5px;
    border: 1px solid var(--app-line);
    border-radius: 18px;
    background: rgba(255, 250, 246, 0.96);
    box-shadow: 0 10px 30px rgba(78, 55, 35, 0.18);
    backdrop-filter: blur(14px);
  }

  .app-mobile-nav a {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    border-radius: 13px;
    color: var(--brown);
    font-size: 0.62rem;
    font-weight: 750;
    text-decoration: none;
  }

  .app-mobile-nav a[aria-current="page"] {
    background: rgba(244, 223, 140, 0.48);
    color: var(--graphite);
  }

  .app-mobile-nav .icon {
    width: 19px;
    height: 19px;
  }

  .app-mobile-nav b {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    min-width: 16px;
    padding: 1px 4px;
    border-radius: 99px;
    background: var(--orange);
    color: white;
    font-size: 0.57rem;
  }

  .app-page,
  .has-member-shell .section--cabinet,
  .has-member-shell .workspace-section,
  .has-member-shell .page-hero,
  .has-member-shell .section--tight {
    padding-inline: 16px;
  }

  .has-member-shell .page-hero__grid,
  .has-member-shell .coauthor-layout {
    grid-template-columns: 1fr;
  }

  .has-member-shell .coauthor-aside {
    position: static;
    max-height: none;
  }

  .messenger-workspace {
    grid-template-columns: 290px minmax(0, 1fr);
  }
}

@media (max-width: 719px) {
  .has-member-shell .app-topbar > div:first-child strong {
    font-size: 0.92rem;
  }

  .has-member-shell .topbar-action {
    width: 38px;
    height: 38px;
  }

  .app-page__head h1,
  .has-member-shell .section-head--compact h1,
  .has-member-shell .page-hero h1,
  .has-member-shell .workspace-head h1 {
    font-size: 2rem;
  }

  .has-member-shell .panel {
    padding: 18px 16px;
    border-radius: 17px;
  }

  .profile-email-form,
  .form-columns {
    grid-template-columns: 1fr;
  }

  .profile-email-form .button {
    width: 100%;
  }

  .has-member-shell .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-page--messenger {
    height: calc(100dvh - var(--app-topbar) - 72px);
    padding: 10px 10px 0;
  }

  .messenger-page-head {
    margin-bottom: 10px;
  }

  .app-page--chat-open .messenger-page-head {
    display: none;
  }

  .messenger-page-head > div {
    display: none;
  }

  .messenger-open {
    width: 100%;
  }

  .messenger-open label {
    min-width: 0;
    flex: 1;
  }

  .messenger-open .search-field {
    min-width: 0;
  }

  .messenger-workspace {
    min-height: 0;
    display: block;
    border-radius: 17px;
  }

  .conversation-pane,
  .chat-pane {
    width: 100%;
    height: 100%;
  }

  .conversation-pane {
    border-right: 0;
  }

  .messenger-workspace.has-active-chat .conversation-pane,
  .messenger-workspace:not(.has-active-chat) .chat-pane {
    display: none;
  }

  .chat-back {
    display: grid;
  }

  .chat-back .icon {
    transform: rotate(180deg);
  }

  .chat-header {
    min-height: 60px;
    padding: 8px 10px;
  }

  .chat-header__status {
    display: none;
  }

  .chat-thread {
    padding: 16px 10px;
  }

  .bubble {
    max-width: 88%;
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr) 42px;
    padding: 9px 9px 22px;
  }

  .composer-hint {
    right: 60px;
    bottom: 5px;
  }

  .auth-section {
    min-height: auto;
  }

  .auth-intro h1 {
    font-size: clamp(2.5rem, 13vw, 3.6rem);
  }

  .auth-intro__icon {
    width: 50px;
    height: 50px;
  }

  .auth-note {
    margin-top: 20px;
  }
}
