@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Literata:wght@500;600;700&family=Outfit:wght@600;700;800&family=Playfair+Display:ital,wght@0,500;1,500&display=swap');

/* === Tokens === */
:root {
  --primary: hsl(18, 89%, 54%);    /* #F26522 - Expromyot Orange */
  --primary-light: hsl(18, 89%, 64%);
  --secondary: hsl(43, 98%, 53%);  /* #FDB813 - Feather Gold */
  --accent: hsl(25, 40%, 20%);     /* Quill Dark */
  --accent-glow: rgba(242, 101, 34, 0.15);

  --bg: #FFFDFB;                   /* Warm Paper */
  --bg-soft: #FFF9F5;
  --surface: #ffffff;
  --surface-soft: #FFF9F5;
  --surface-hover: #FFF5F0;

  --border: #FFE0D0;
  --border-light: #FFF0E8;
  --brand-pastel: #FFF0E8;
  --brand-soft-orange: rgba(242, 101, 34, 0.08);
  --brand-paper-glass: rgba(255, 253, 251, 0.78);
  --brand-soft-shadow: 0 22px 55px -18px rgba(82, 56, 43, 0.16),
                       0 10px 24px -14px rgba(242, 101, 34, 0.12);

  --ink: #1A1A1A;
  --muted: #665544;
  --soft: #A09080;

  --green: #27ae60;
  --red: #e74c3c;
  --amber: #f39c12;
  --blue: #3498db;

  --radius: 1rem;
  --radius-lg: 1.5rem;
  --shadow: 0 10px 30px -10px var(--accent-glow);
  --shadow-lg: 0 20px 50px -15px var(--accent-glow);

  --font-main: 'Inter', system-ui, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-prompt: 'Literata', Georgia, serif;
  --font-poem: 'Playfair Display', serif;

  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button,input,textarea,select{font:inherit;color:inherit}
[hidden]{display:none!important}
h1,h2,h3,p{margin-top:0}
h1,h2,h3 {
  font-family: var(--font-heading);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}
h2{font-size:2.25rem;margin-bottom:1.25rem}
h3{font-size:1.5rem;margin-bottom:.75rem}
p{color:var(--muted);font-size:1rem}

/* === Layout === */
.container{width:min(72rem,calc(100% - 2.5rem));margin-inline:auto}
#app-main{min-height:calc(100vh - 4rem);padding-top:5.5rem}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 3.25rem;
  padding: .75rem 1.75rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all var(--transition);
  background: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
/* === Admin Stats Refined === */
.admin-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.admin-stat-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(82, 56, 43, 0.04);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}
.admin-stat-card__icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.admin-stat-card__label { font-size: 0.75rem; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-stat-card__value { font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.admin-stat-card__detail { font-size: 0.75rem; color: var(--muted); opacity: 0.7; }
.admin-stat-card--ok { border-left: 4px solid var(--green); }
.admin-stat-card--err { border-left: 4px solid var(--red); }

@media (max-width: 1180px) {
  .admin-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-cards {
    grid-template-columns: 1fr;
  }
}

/* === Modal Animations === */
.auth-modal {
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-modal--visible {
  opacity: 1;
  visibility: visible;
}
.auth-modal__card {
  transform: scale(0.9) translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-modal--visible .auth-modal__card {
  transform: scale(1) translateY(0);
}
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  box-shadow: 0 8px 20px -6px var(--primary);
}
.btn--primary:hover {
  box-shadow: 0 12px 24px -8px var(--primary);
  filter: brightness(1.05);
}
.btn--outline {
  color: var(--primary);
  border-color: var(--primary);
  background: transparent;
}
.btn--outline:hover {
  background: var(--surface-soft);
}
.btn--ghost {
  color: var(--muted);
  background: transparent;
}
.poem-form__textarea {
  width: 100%;
  padding: 1.75rem 1.85rem;
  border: 1px solid rgba(242, 101, 34, 0.2);
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 246, 0.72));
  resize: vertical;
  min-height: 160px;
  font-family: var(--font-poem);
  font-size: 1.5rem;
  line-height: 1.58;
  transition: all var(--transition);
  color: var(--accent);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 12px 30px -24px rgba(82, 56, 43, 0.36);
}
.poem-form__textarea:focus {
  border-color: rgba(242, 101, 34, 0.46);
  box-shadow: 0 0 0 6px rgba(242, 101, 34, 0.075),
              0 16px 34px -28px rgba(82, 56, 43, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.95);
  background: #fff;
}
.poem-form__textarea--error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
}
.poem-form__textarea::placeholder {
  font-style: italic;
  opacity: 0.5;
}
.poem-form__hints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--soft);
}
.poem-form__counter--limit {
  color: var(--red);
  font-weight: 700;
}

.poem-form__ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(242, 101, 34, 0.18);
  border-radius: 0.8rem;
  background: rgba(255, 248, 239, 0.78);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 750;
  cursor: pointer;
}

.poem-form__ai-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

.btn--sm{min-height:2.5rem;padding:.5rem 1rem;font-size:.85rem}
.btn--lg{min-height:3.75rem;padding:1rem 2.25rem;font-size:1.1rem}
.btn--full{width:100%}
.btn--disabled,.btn:disabled{opacity:.45;pointer-events:none}

/* === Auth Page === */
.auth-page {
  min-height: calc(100vh - 5.5rem);
  display: flex;
  align-items: center;
  padding: 2rem 0;
}
.auth-page__inner {
  display: flex;
  justify-content: center;
}
.auth-page__panel {
  width: min(100%, 30rem);
  padding: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--brand-soft-shadow);
}
.auth-page__intro {
  margin-bottom: 1.75rem;
  text-align: center;
}
.auth-page__eyebrow {
  margin: 0 0 0.45rem;
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-page__intro h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1;
}
.auth-page__lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1.6rem;
  padding: 0.35rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--surface-soft);
}
.auth-switch__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-heading);
  font-weight: 800;
  transition: all var(--transition);
}
.auth-switch__tab:hover {
  color: var(--primary);
}
.auth-switch__tab--active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 8px 20px -14px rgba(82, 56, 43, 0.42);
}
.auth-page-form {
  display: grid;
  gap: 1.05rem;
}
.auth-page-form__field {
  display: grid;
  gap: 0.45rem;
}
.auth-page-form__field--hidden {
  display: none;
}
.auth-page-form__field label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}
.auth-page-form__field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: all var(--transition);
}
.auth-page-form__field input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(242, 101, 34, 0.11);
}
.auth-page-form__status {
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}
.auth-page-form__status--error { color: var(--red); }
.auth-page-form__status--ok { color: var(--green); }

@media(max-width: 640px) {
  .auth-page {
    align-items: flex-start;
    padding: 1.25rem 0;
  }
  .auth-page__panel {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
}

/* === Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 253, 251, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header__inner{display:flex;align-items:center;justify-content:space-between;min-height:4.5rem;gap:1rem}
.footer__logo-img {
  height: 1.5rem;
  width: auto;
  opacity: 0.8;
}
.footer__links{display:flex;gap:1.5rem}
.header__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
  font-family: var(--font-heading);
}
.header__logo-img {
  height: 2.5rem;
  width: auto;
  filter: drop-shadow(0 4px 8px var(--accent-glow));
}
.header__nav{display:none;align-items:center;gap:.5rem}
.nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--font-heading);
  transition: all var(--transition);
}
.nav-link:hover, .nav-link--active {
  color: var(--primary);
  background: var(--surface-soft);
}
.nav-link--admin{color:var(--amber)}
.header__right{display:flex;align-items:center;gap:1rem;min-width:0}
.header-user{display:flex;align-items:center;gap:.75rem}
.header-user__name{font-weight:700;font-size:.95rem;color:var(--primary)}
.header-auth{display:flex;gap:.75rem}
.header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.header__burger span{display:block;height:2.5px;background:var(--primary);border-radius:2px;transition:all var(--transition)}
.header__burger--open span:nth-child(1){transform:rotate(45deg) translate(5px,5px)}
.header__burger--open span:nth-child(2){opacity:0}
.header__burger--open span:nth-child(3){transform:rotate(-45deg) translate(5px,-5px)}

.mobile-nav {
  display: none;
  position: fixed;
  top: 4.5rem;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  z-index: 49;
  box-shadow: var(--shadow);
}
.mobile-nav--open { display: grid; gap: 0.5rem; }
.mobile-nav__link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft);
  transition: all var(--transition);
}
.mobile-nav__link--active {
  color: var(--primary);
  background: var(--surface-hover);
  border-left: 4px solid var(--primary);
}
.mobile-nav__auth {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media(min-width:1024px){.header__nav{display:flex}.header__burger,.mobile-nav{display:none!important}}

@media(max-width:720px){
  .container{width:min(100% - 2rem,72rem)}
  .header__inner{gap:.75rem}
  .header__title{font-size:1.25rem}
  .header__inner > .header__right > .header-auth,
  .header__inner > .header__right > .header-user{display:none}
  .mobile-nav .header-auth,
  .mobile-nav .header-user{display:grid;gap:.5rem}
  .mobile-nav .header-auth .btn,
  .mobile-nav .header-user .btn{width:100%}
}

@media(max-width:420px){
  .container{width:min(100% - 1.5rem,72rem)}
  .header__logo{font-size:1.55rem}
  .header__title{font-size:1.1rem}
  .header__burger{width:2.5rem;height:2.5rem}
}

/* === Layout Sections === */
section, .section {
  padding: 70px 0;
  box-sizing: border-box;
}

/* === Hero === */
.hero {
  position: relative;
  padding: 110px 0 70px; /* С учетом шапки 4.5rem (~72px) + отступ 70px */
  background: radial-gradient(circle at top right, rgba(253, 184, 19, 0.1), transparent 40%),
              radial-gradient(circle at bottom left, rgba(242, 101, 34, 0.05), transparent 40%);
}
.hero__content{max-width:42rem; text-align: left;}
.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  position: relative;
  z-index: 1;
}
.hero__title {
  margin-bottom: 2rem;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.1;
}
.hero__accent {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__subtitle {
  display: block;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  color: var(--accent);
  margin-top: .5rem;
  opacity: 0.8;
}
.hero__desc {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
  max-width: 32rem;
}
.hero__decoration {
  position: relative;
  animation: float 6s ease-in-out infinite;
}
@media(max-width:720px){
  .hero{padding:5rem 0 3.5rem}
  .hero .container{
    display:grid;
    grid-template-columns:1fr;
    gap:2rem;
  }
  .hero__content{max-width:none}
  .hero__desc{font-size:1.05rem}
  .hero__decoration{
    justify-self:center;
    max-width:12rem;
    opacity:.75;
  }
  .hero__quill-svg{
    width:100%;
    height:auto;
  }
}

@media(max-width:420px){
  .btn--lg{min-height:3.25rem;padding:.85rem 1.25rem;font-size:1rem}
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* Entrance Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: reveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Feature Cards === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.feature-card {
  padding: 2rem;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.feature-card__icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 12px var(--accent-glow));
}

/* === Hero Session Card === */
.hero-session-card {
  display: block;
  margin-top: 2rem;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(242, 101, 34, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(242, 101, 34, 0.08);
  max-width: 36rem;
  transition: all var(--transition);
}

.hero-session-card--link {
  cursor: pointer;
}

.hero-session-card:hover {
  transform: scale(1.02);
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.8);
}

.hero-session-card__label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero-session-card__line {
  margin: 0;
  font-family: var(--font-prompt);
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 650;
  color: var(--accent);
  line-height: 1.45;
}

.hero-session-card__count {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-session-card__count::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
}

.hero-session-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-session-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 8px 20px rgba(242, 101, 34, 0.22);
  pointer-events: none;
}

.hero-session-card--empty {
  border-style: dashed;
  background: rgba(0, 0, 0, 0.02);
  color: var(--muted);
}

/* === Play Page Arena === */
.first-line-card {
  padding: 1.65rem 2.35rem 2.65rem;
  background:
    radial-gradient(circle at 10% 0%, rgba(253, 184, 19, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(255, 253, 251, 0.92), rgba(255, 241, 233, 0.58));
  border: 1px solid rgba(242, 101, 34, 0.16);
  border-bottom-color: rgba(242, 101, 34, 0.08);
  border-radius: 2.1rem 2.1rem 1.55rem 1.55rem;
  box-shadow: 0 18px 50px -24px rgba(82, 56, 43, 0.28);
  text-align: center;
  backdrop-filter: blur(14px);
}
.first-line-card__topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}
.first-line-card__topline time {
  flex: 0 0 auto;
  font: inherit;
}
.first-line-card__text {
  font-family: var(--font-prompt);
  font-size: 2rem;
  font-weight: 650;
  color: var(--accent);
  font-style: normal;
  line-height: 1.35;
  margin: 2.25rem 0 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* === Poem Cards === */
.poems-section {
  margin-top: 3rem;
}

.poems-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.poems-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--border-light);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.poems-list {
  display: grid;
  gap: 0.85rem;
}

.poem-card {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  max-width: 48rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  transition: transform var(--transition);
}

.poem-card--with-ai-review {
  grid-template-columns: 2.5rem minmax(18rem, 42rem) minmax(16rem, 24rem);
  max-width: 76rem;
}

.poem-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 5px 16px var(--accent-glow);
}

.poem-card__bubble {
  position: relative;
  width: min(100%, 42rem);
  padding: 0.8rem 0.95rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem 0.95rem 0.95rem 0.95rem;
  background: var(--bg-soft);
  box-shadow: 0 10px 24px rgba(82, 56, 43, 0.08);
}

.poem-card__bubble::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: -0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

.poem-card--profile {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  width: 100%;
  max-width: 100%;
}

.poem-card--profile.poem-card--with-ai-review {
  grid-template-columns: minmax(18rem, 42rem) minmax(16rem, 24rem);
}

.poem-card--profile .poem-card__bubble {
  width: min(100%, 42rem);
  min-width: 0;
  justify-self: stretch;
  border-radius: 0.95rem;
}

.poem-card--profile .poem-card__bubble::before {
  display: none;
}

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

.poem-card:hover .poem-card__bubble {
  border-color: var(--primary);
  box-shadow: 0 14px 28px rgba(242, 101, 34, 0.12);
}

.poem-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.poem-card__author {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
}

.poem-card__meta {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.2;
}

.poem-card__dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.poem-card__time {
  font: inherit;
  color: inherit;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.badge--tg {
  background: rgba(253, 184, 19, 0.16);
  color: var(--accent);
}

.poem-card__body {
  margin: 0.4rem 0 0;
  color: var(--accent);
  font-family: var(--font-poem);
  font-size: 1.1rem;
  line-height: 1.5;
  white-space: pre-line;
}

.badge--web {
  background: rgba(242, 101, 34, 0.12);
  color: var(--primary);
}

.poem-line { display: block; }

.poem-card__footer {
  margin-top: 0.65rem;
}

.poem-card__ai-review {
  align-self: start;
  width: min(100%, 24rem);
}

.poem-card__ai-review--pending {
  padding: 0.72rem 0.85rem;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--border) 55%);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--surface-soft) 86%, #fff 14%);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.ai-review {
  border: 1px solid color-mix(in srgb, var(--secondary) 42%, var(--border) 58%);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,248,239,0.86));
  box-shadow: 0 10px 24px rgba(82, 56, 43, 0.08);
  overflow: hidden;
}

.ai-review__summary {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  min-height: 4.1rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  list-style: none;
}

.ai-review__summary::-webkit-details-marker {
  display: none;
}

.ai-review__score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(242, 101, 34, 0.22);
}

.ai-review__score--green {
  background: linear-gradient(135deg, #2f9e44, #69db7c);
  box-shadow: 0 8px 18px rgba(47, 158, 68, 0.22);
}

.ai-review__score--yellow {
  background: linear-gradient(135deg, #f59f00, #ffd43b);
  color: #4b2b00;
  box-shadow: 0 8px 18px rgba(245, 159, 0, 0.22);
}

.ai-review__score--orange {
  background: linear-gradient(135deg, #e8590c, #ff922b);
  box-shadow: 0 8px 18px rgba(232, 89, 12, 0.24);
}

.ai-review__score--pink {
  background: linear-gradient(135deg, #d6336c, #f783ac);
  box-shadow: 0 8px 18px rgba(214, 51, 108, 0.24);
}

.ai-review__score--gold {
  background: linear-gradient(135deg, #b8860b, #ffd700 48%, #fff3bf);
  color: #4b3200;
  box-shadow: 0 8px 20px rgba(184, 134, 11, 0.3);
}

.ai-review__score--unknown {
  background: var(--border-light);
  color: var(--primary);
  box-shadow: none;
}

.ai-review__title {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
  color: var(--accent);
  font-weight: 850;
  line-height: 1.15;
}

.ai-review__name {
  min-width: 0;
}

.ai-review__name-initial {
  color: var(--primary);
}

.ai-review__title small {
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 750;
}

.ai-review__summary-text {
  grid-column: 2;
  margin-top: -0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.ai-review__body {
  padding: 0 0.95rem 0.9rem;
  color: var(--accent);
}

.ai-review__criteria {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-review__criterion {
  display: grid;
  gap: 0.18rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.88rem;
  line-height: 1.35;
}

.ai-review__criterion strong {
  color: var(--primary);
  font-size: 0.82rem;
}

.ai-review__final {
  margin: 0.75rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ai-review__compact {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.ai-review__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.reaction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.reactions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.reaction-btn,
.reaction-total {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.8rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
}

.reaction-btn {
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.reaction-btn:hover {
  transform: translateY(-1px);
  border-color: var(--secondary);
  background: var(--surface-hover);
}

.reaction-btn--active {
  border-color: var(--primary);
  background: var(--accent-glow);
  color: var(--primary);
}

.reaction-btn--loading {
  opacity: 0.65;
  pointer-events: none;
}

.reaction-btn__emoji {
  font-size: 1rem;
}

.reaction-btn__count,
.reaction-total__value {
  min-width: 0.65rem;
  text-align: center;
}

.reaction-total {
  flex: 0 0 auto;
  background: transparent;
  border-color: transparent;
  color: var(--soft);
}

@media (max-width: 640px) {
  .first-line-card {
    padding: 1.25rem 1.2rem 1.8rem;
    overflow: hidden;
  }

  .first-line-card__topline {
    flex-direction: column;
    gap: 0.25rem;
    font-size: 1rem;
  }

  .first-line-card__text {
    font-size: 1.35rem;
    overflow-wrap: anywhere;
  }

  .poem-form__textarea {
    font-size: 1.12rem;
  }

  .poems-section {
    margin-top: 2rem;
  }

  .poem-card {
    grid-template-columns: 2.15rem minmax(0, 1fr);
    gap: 0.5rem;
  }

  .poem-card--profile {
    grid-template-columns: minmax(0, 1fr);
  }

  .poem-card--with-ai-review,
  .poem-card--profile.poem-card--with-ai-review {
    grid-template-columns: 2.15rem minmax(0, 1fr);
    max-width: 100%;
  }

  .poem-card--profile.poem-card--with-ai-review {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-profile-panel,
  .user-poems-tab,
  .user-poems-list,
  .poem-card--profile,
  .poem-card--profile.poem-card--with-ai-review {
    width: 100%;
    min-width: 0;
  }

  .poem-card__avatar {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.68rem;
  }

  .poem-card__bubble {
    padding: 0.75rem 0.8rem 0.65rem;
    border-radius: 0.25rem 0.8rem 0.8rem 0.8rem;
  }

  .poem-card--profile .poem-card__bubble {
    width: 100%;
    max-width: none;
    min-width: 0;
    border-radius: 0.8rem;
  }

  .poem-card__header,
  .reaction-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .poem-card__meta {
    flex-wrap: wrap;
  }

  .poem-card__body {
    font-size: 0.96rem;
  }

  .poem-card__ai-review {
    grid-column: 2;
    width: 100%;
  }

  .poem-card--profile .poem-card__ai-review {
    grid-column: 1;
  }

  .ratings-poem-row {
    grid-template-columns: 2.5rem minmax(0, 1fr);
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border-light) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite linear;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1.25rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Hero Decoration: Writing Quill (Fixed) === */

.hero__decoration {
  position: relative;
  flex: 0 0 45%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__writing-container {
  position: relative;
  width: 320px;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__quill-wrapper {
  width: 280px; /* Достаточная ширина для всего пера */
  height: 280px;
  overflow: visible;
  position: relative;
  z-index: 10;
  animation: quill-bounce 8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.hero__quill-image-only {
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(-10deg);
  filter: drop-shadow(0 10px 20px rgba(242, 101, 34, 0.2));
}

.hero__lines {
  position: absolute;
  top: 140px; /* Сразу под пером */
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: rotate(-15deg);
}

.hero__line {
  height: 6px;
  width: 0;
  border-radius: 3px;
  opacity: 0;
  transition: all 0.3s ease;
}

.hero__line--1 { background: #222; animation: line-reveal 8s infinite 1s; }
.hero__line--2 { background: #FFD700; animation: line-reveal 8s infinite 2.5s; }
.hero__line--3 { background: #FF4500; animation: line-reveal 8s infinite 4s; }
.hero__line--4 { background: #FF4500; animation: line-reveal 8s infinite 5s; }

@keyframes quill-bounce {
  0%, 100%, 20%, 35%, 55%, 70%, 90% { transform: translateY(0) rotate(-5deg); }
  10%, 15% { transform: translateY(30px) rotate(10deg); } /* Касание 1 */
  25%, 30% { transform: translateY(30px) rotate(10deg); } /* Касание 2 */
  45%, 50% { transform: translateY(30px) rotate(10deg); } /* Касание 3 (быстрее) */
  60%, 65% { transform: translateY(30px) rotate(10deg); } /* Касание 4 (быстрее) */
}

@keyframes line-reveal {
  0%, 5% { width: 0; opacity: 0; }
  10%, 85% { width: 150px; opacity: 0.8; }
  90%, 100% { width: 0; opacity: 0; }
}

/* === Footer === */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  padding: 0;
  width: 100%;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(72rem, calc(100% - 2.5rem));
  margin-inline: auto;
  gap: 2rem;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--primary);
  flex: 0 0 auto;
}
.footer__logo-img {
  height: 2rem;
  width: auto;
}
.footer__nav {
  display: flex;
  gap: 1.5rem;
}
.footer__nav a {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color var(--transition);
}
.footer__nav a:hover { color: var(--primary); }
.footer__copy {
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.7;
  white-space: nowrap;
}
.footer__social {
  display: flex;
  gap: 1rem;
}
.social-link {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary);
  transition: all var(--transition);
}
.social-link:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}
@media(max-width:1024px){
  .features-grid{grid-template-columns:repeat(2,1fr)}
  .footer__inner{flex-direction:column;gap:1.5rem;padding:3rem 0}
  .footer__nav{flex-wrap:wrap;justify-content:center}
}
@media(max-width:600px){
  .features-grid{grid-template-columns:1fr}
}

/* === Placeholder Pages === */
.placeholder-page { padding: 40px 0; }
.placeholder-page h2 { font-size: 2.5rem; margin-bottom: 1.5rem; }
.placeholder-page__desc { font-size: 1.1rem; margin-bottom: 2.5rem; max-width: 40rem; }

.tab-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  width: fit-content;
}
.tab-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 4px);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn--active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.placeholder-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  background: var(--surface-soft);
  padding: 1rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--soft);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}
.data-table__row:hover { background: var(--surface-hover); }
.data-table__row--gold { background: rgba(253, 184, 19, 0.05); }
.data-table__rank { font-weight: 800; color: var(--primary); width: 60px; }
.data-table__name { font-weight: 700; color: var(--accent); }
.data-table__total { color: var(--primary); font-size: 1.1rem; }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 1rem;
  align-items: start;
}
.featured-card {
  position: relative;
  min-height: 15rem;
  padding: 1.45rem 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.featured-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}
.featured-card__star {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(253, 184, 19, 0.24);
}
.featured-card__text {
  display: grid;
  gap: 0.18rem;
  padding-right: 2.5rem;
  color: var(--ink);
  font-family: var(--font-poem);
  font-size: 1.12rem;
  line-height: 1.55;
}
.featured-card__footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-light);
}
.featured-card__author {
  color: var(--accent);
  font-weight: 800;
}
.featured-card__date {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.featured-card__date--missing { color: var(--soft); }
.featured-card--loading,
.featured-card--empty,
.featured-card--error {
  min-height: auto;
  color: var(--muted);
  font-weight: 700;
}
.featured-card--error {
  border-color: var(--red);
  color: var(--red);
}

.placeholder-page__note {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border-left: 4px solid var(--amber);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.ratings-panel {
  min-height: 10rem;
}

.ratings-poems-list {
  display: grid;
  gap: 1rem;
}

.ratings-poem-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
}

.ratings-poem-row__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 900;
}

.archive-list { display: grid; gap: 1rem; }
.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.archive-item:hover {
  transform: translateX(8px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.archive-item__date { font-weight: 700; color: var(--soft); font-size: 0.9rem; }
.archive-item__line {
  font-family: var(--font-prompt);
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--accent);
  line-height: 1.35;
}
.archive-item__count { font-weight: 700; color: var(--primary); }
.archive-search {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 72rem;
  margin-top: 1.5rem;
  padding: 0.45rem;
  background: color-mix(in srgb, var(--surface) 88%, #fff 12%);
  border: 1px solid color-mix(in srgb, var(--border) 78%, #fff 22%);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: 0 12px 32px rgba(82, 56, 43, 0.08);
}
@media(min-width: 576px) {
  .archive-search {
    flex-direction: row;
    align-items: stretch;
  }
}
.archive-search .form-input {
  flex: 1;
  min-width: 0;
  min-height: 3.25rem;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--accent);
  background: #fffaf6;
  border: 1px solid rgba(214, 155, 124, 0.38);
  border-radius: calc(var(--radius) + 4px);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.archive-search .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  background: #fff;
}
.archive-search .form-input::placeholder {
  color: color-mix(in srgb, var(--soft) 72%, #fff 28%);
  opacity: 1;
}
.archive-search .btn {
  flex: 0 0 auto;
  min-height: 3.25rem;
  border-radius: calc(var(--radius) + 4px);
  padding-inline: 1.75rem;
}
.archive-years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 1.25rem;
}
.archive-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.25rem;
  min-height: 2.4rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-heading);
  font-weight: 800;
  transition: all var(--transition);
}
.archive-year:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.archive-year--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}
.user-profile-tab {
  cursor: pointer;
}
.user-profile-tab[aria-selected="true"] {
  cursor: default;
}
.archive-load-more {
  display: block;
  margin: 1.5rem auto 0;
}
.archive-question-title {
  margin-top: 2rem;
  font-family: var(--font-prompt);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
}
.archive-poems { display: grid; gap: 1rem; }
.archive-poem {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.archive-poem__text {
  white-space: pre-wrap;
  font-family: var(--font-poem);
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
}
.archive-poem__meta { margin-top: 0.85rem; color: var(--muted); font-size: 0.9rem; }

/* === Me Profile === */

.me-section {
  margin-top: 1.5rem;
  max-width: 760px;
}
.me-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.me-card--loading,
.me-card--error,
.me-card__empty {
  color: var(--muted);
  font-weight: 600;
}
.me-card--error { border-color: var(--red); color: var(--red); }
.me-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.me-card__header h3 {
  margin: 0.25rem 0 0;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.15;
}
.me-card__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.me-card__role {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.me-form { display: grid; gap: 1.25rem; }
.me-field {
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
  font-weight: 700;
}
.me-field .form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  padding: 0.9rem 1rem;
}
.me-field .form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 89, 48, 0.14);
}
.me-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.me-profile-field {
  border: 1px solid var(--border-light);
  border-radius: calc(var(--radius) - 4px);
  padding: 0.9rem 1rem;
  background: var(--surface-soft);
  min-width: 0;
}
.me-profile-field span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.me-profile-field strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.me-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.me-status {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}
.me-status--success { color: var(--green); }
.me-status--error { color: var(--red); }
.me-actions--transfer {
  padding-top: 0.25rem;
}
.me-transfer-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(26, 26, 26, 0.38);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.me-transfer-modal--visible {
  opacity: 1;
  visibility: visible;
}
.me-transfer-modal__panel {
  width: min(100%, 28rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 1.35rem;
  transform: translateY(0.75rem) scale(0.98);
  transition: transform var(--transition);
}
.me-transfer-modal--visible .me-transfer-modal__panel {
  transform: translateY(0) scale(1);
}
.me-transfer-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.me-transfer-modal__header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 1.35rem;
}
.me-transfer-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: all var(--transition);
}
.me-transfer-modal__close:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

@media(max-width: 640px) {
  .me-card { padding: 1.1rem; }
  .me-card__header { display: grid; }
  .me-profile-grid { grid-template-columns: 1fr; }
  .me-transfer-modal {
    align-items: flex-end;
    padding: 0.75rem;
  }
  .me-transfer-modal__panel {
    padding: 1rem;
  }
  .featured-card { padding: 1.25rem; }
  .featured-card__footer { display: grid; gap: 0.35rem; }
  .hero-session-card__footer {
    align-items: flex-start;
    display: grid;
  }
  .first-line-card { padding: 1.25rem; }
  .first-line-card__topline {
    display: grid;
    gap: 0.35rem;
    font-size: 1.05rem;
  }
  .first-line-card__text {
    font-size: 1.55rem;
    margin-top: 1.5rem;
  }
}

/* === Toast === */
.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  display: grid;
  gap: 0.65rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: rgba(255, 253, 251, 0.96);
  color: var(--accent);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: auto;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success { border-left-color: var(--green); }
.toast--error { border-left-color: var(--red); }
.toast--warning { border-left-color: var(--amber); }
.toast--info { border-left-color: var(--primary); }

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 900;
  flex: 0 0 auto;
}

.toast--success .toast__icon { color: var(--green); }
.toast--error .toast__icon { color: var(--red); }
.toast--warning .toast__icon { color: var(--amber); }
.toast__text { font-weight: 700; font-size: 0.92rem; }

/* === Admin Shell & Page Layout === */
.admin-page {
  display: flex;
  min-height: calc(100vh - 5.5rem);
  background: #fbf9f7;
  align-items: stretch;
}

.admin-sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: sticky;
  top: 5.5rem;
  height: calc(100vh - 5.5rem);
  z-index: 20;
}

.admin-sidebar__header {
  padding: 0 1.5rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.admin-nav {
  flex: 1;
  padding: 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 200ms ease;
}

.admin-nav__link:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.admin-nav__link--active {
  background: var(--brand-soft-orange);
  color: var(--primary);
  box-shadow: inset 2px 0 0 var(--primary);
  border-radius: 0.5rem 0.75rem 0.75rem 0.5rem;
}

.admin-sidebar__footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border-light);
}

.admin-main {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 1200px;
  width: 100%;
}

.admin-section {
  margin-bottom: 2.5rem;
}

.admin-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--accent);
  border-left: 3px solid var(--primary);
  padding-left: 0.75rem;
}

.admin-prototype-note {
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px dashed rgba(242, 101, 34, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 240, 232, 0.4);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.admin-plain-panel {
  max-width: 48rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(82, 56, 43, 0.05);
}

.admin-plain-panel h3 {
  margin-bottom: 0.65rem;
}

.admin-plain-panel p {
  max-width: 42rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.admin-plain-panel code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 0.88em;
}

/* Polished Toolbar */
.admin-toolbar-wrap {
  margin-bottom: 1.5rem;
}

.admin-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box span {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.4;
}

.search-box .form-input {
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  font-size: 0.9rem;
  border-radius: 0.6rem;
  min-height: auto;
}

.form-select.form-input {
  padding: 0.65rem 1rem;
  min-height: auto;
  font-size: 0.9rem;
  width: auto;
  cursor: pointer;
}

/* Polished Tables */
.data-table th {
  background: var(--surface-soft);
  padding: 0.85rem 1rem;
  color: var(--soft);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
  font-size: 0.9rem;
}

.data-table__row:hover {
  background: var(--surface-hover);
}

.data-table__line-main {
  font-weight: 600;
  color: var(--accent);
}

.data-table__date {
  font-size: 0.8rem;
  color: var(--soft);
  white-space: nowrap;
}

/* Session UI */
.admin-session-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-active-session {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  border-left: 4px solid var(--green);
  background: linear-gradient(to right, var(--surface-soft), var(--surface));
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left-width: 4px;
}

.admin-active-session__main { flex: 1; }
.admin-active-session__line .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--soft);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.admin-active-session__line p {
  font-family: var(--font-prompt);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}
.admin-active-session__stats { display: flex; gap: 2rem; margin-top: 1rem; }
.admin-active-session__stats .stat { display: flex; flex-direction: column; }
.admin-active-session__stats .stat__label { font-size: 0.7rem; font-weight: 700; color: var(--soft); }
.admin-active-session__stats .stat__value { font-size: 1.1rem; font-weight: 800; color: var(--primary); }

.admin-active-session__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-empty-state {
  padding: 3rem;
  text-align: center;
  background: var(--surface-soft);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

/* Badges */
.badge--active { background: rgba(39, 174, 96, 0.1); color: var(--green); }
.badge--inactive { background: var(--border-light); color: var(--soft); }
.badge--used { background: var(--border-light); color: var(--soft); }
.badge--unused { background: rgba(242, 101, 34, 0.1); color: var(--primary); }
.badge--closed { background: var(--border-light); color: var(--muted); }
.badge--admin { background: rgba(243, 156, 18, 0.15); color: var(--amber); }
.badge--guest { background: rgba(52, 152, 219, 0.15); color: var(--blue); }
.badge--registered { background: rgba(39, 174, 96, 0.15); color: var(--green); }

/* === Admin Users: ascetic, compact === */
.admin-title {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.admin-toolbar--compact {
  padding: 0.5rem;
  gap: 0.5rem;
  align-items: stretch;
}

.au-filter-tabs {
  display: flex;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.au-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 200ms ease;
}

.au-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.au-tab--active {
  background: var(--brand-soft-orange);
  color: var(--primary);
  border-color: var(--primary-light);
  box-shadow: inset 2px 0 0 var(--primary);
}

.au-layout {
  display: grid;
  grid-template-columns: 1fr 20rem;
  gap: 1rem;
  align-items: start;
}

.au-table-wrap {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.data-table--compact td,
.data-table--compact th {
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
}

.data-table__row--selected {
  background: var(--surface-hover);
  box-shadow: inset 2px 0 0 var(--primary);
}

.au-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.au-name-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.6rem;
  flex: 0 0 auto;
}

.au-name-text {
  font-weight: 700;
  color: var(--accent);
}

.au-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.au-detail {
  position: sticky;
  top: 1rem;
}

.au-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(82, 56, 43, 0.04);
  display: grid;
  gap: 0.75rem;
}

.au-detail-card--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--soft);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
}

.au-detail-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.au-detail-card--empty p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}

.au-detail-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.au-detail-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.72rem;
  flex: 0 0 auto;
}

.au-detail-name {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
}

.au-detail-sub {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.au-detail-fields {
  display: grid;
  gap: 0.35rem;
}

.au-detail-field {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  background: var(--surface-soft);
  font-size: 0.82rem;
}

.au-detail-field span {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.au-detail-field strong {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.au-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.au-detail-actions .btn {
  min-height: 2rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  justify-content: space-between;
}

.au-noapi {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .au-layout {
    grid-template-columns: 1fr;
  }
  .au-detail {
    position: static;
  }
}

@media (max-width: 1024px) {
  .admin-page {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
  }
  .admin-nav__link {
    white-space: nowrap;
    padding: 0.5rem 0.8rem;
  }
  .admin-sidebar__header, .admin-sidebar__footer {
    display: none;
  }
  .admin-main {
    padding: 1.5rem 1rem;
  }
  .admin-active-session {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Existing Scrollbar & Selection preserved but updated */
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:var(--primary-light)}

::selection{background:var(--primary);color:#fff}

/* === Play Page Arena - Textarea sliding/peeking out from under prompt card === */
.first-line-card {
  position: relative;
  z-index: 10;
  margin-bottom: 0; /* Clear default margin to control overlap precisely */
}

.submit-section {
  padding: 0 !important; /* Override general section padding */
  margin-top: -1.75rem;  /* Pull it up to tuck under prompt card */
  position: relative;
  z-index: 5;
}

.submit-section .card-glass {
  background:
    linear-gradient(180deg, rgba(255, 248, 244, 0.7), rgba(255, 253, 251, 0.92)),
    repeating-linear-gradient(135deg, rgba(242, 101, 34, 0.035) 0 1px, transparent 1px 14px);
  border: 1px solid rgba(242, 101, 34, 0.16);
  border-top: none; /* Flow seamlessly from the card above */
  border-radius: 0 0 2.1rem 2.1rem;
  padding: 3.35rem 2.35rem 2.35rem; /* Larger top padding because it's tucked */
  box-shadow: 0 26px 70px -34px rgba(82, 56, 43, 0.34),
              0 16px 38px -30px rgba(242, 101, 34, 0.28);
  transition: all var(--transition);
  backdrop-filter: blur(14px);
}

.submit-section .card-glass:focus-within {
  border-color: rgba(242, 101, 34, 0.28);
  box-shadow: 0 30px 78px -34px rgba(82, 56, 43, 0.38),
              0 18px 42px -28px rgba(242, 101, 34, 0.32);
}

@media (max-width: 640px) {
  .submit-section {
    margin-top: -1rem;
  }
  .submit-section .card-glass {
    padding: 2.25rem 1.1rem 1.5rem;
    border-radius: 0 0 1.35rem 1.35rem;
  }
}

/* === Telegram-style Chat Feed UX === */
.play-page--feed {
  padding-bottom: 2rem;
}

.feed-container {
  width: 100%;
  margin-top: 1.5rem;
  position: relative;
}

.feed-viewport {
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feed-history-trigger-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.feed-messages {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.feed-session {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.4s ease-out;
}

.feed-prompt-bubble {
  align-self: center;
  max-width: 90%;
  width: min(100%, 36rem);
  padding: 1.25rem 1.75rem;
  border-radius: 1.25rem;
  text-align: center;
  margin: 0.5rem auto;
  position: relative;
  transition: all var(--transition);
}

.feed-prompt-bubble__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.6rem;
  opacity: 0.85;
}

.feed-prompt-bubble__text {
  margin: 0;
  font-family: var(--font-prompt);
  font-size: 1.4rem;
  font-weight: 650;
  color: var(--accent);
  line-height: 1.45;
  font-style: normal;
}

.archive-session-prompt {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 240, 235, 0.9));
  box-shadow: 0 4px 15px rgba(82, 56, 43, 0.04);
}

.active-session-prompt {
  border: 1px solid rgba(242, 101, 34, 0.25);
  background: radial-gradient(circle at 10% 0%, rgba(253, 184, 19, 0.12), transparent 45%),
              linear-gradient(135deg, rgba(255, 253, 251, 0.95), rgba(255, 241, 233, 0.7));
  box-shadow: 0 10px 30px -10px rgba(242, 101, 34, 0.25),
              0 4px 12px rgba(82, 56, 43, 0.08);
}

.feed-poems-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.user-poems-tab {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-poems-tab__top {
  display: flex;
  justify-content: flex-start;
}

/* Floating Action Button */
.fab-write-poem {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  min-height: 3.5rem;
  width: auto;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  box-shadow: 0 8px 25px rgba(242, 101, 34, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  transition: all var(--transition);
}

.fab-write-poem:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(242, 101, 34, 0.45);
}

.fab-write-poem:active {
  transform: translateY(-1px);
}

.fab-write-poem__icon {
  font-size: 1.2rem;
}

/* Composer Panel / Drawer */
.composer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(82, 56, 43, 0.35);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.composer-backdrop--open {
  opacity: 1;
  visibility: visible;
}

.composer-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: min(100% - 1rem, 46rem);
  max-height: 85vh;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 1.75rem 1.75rem 0 0;
  box-shadow: 0 -15px 45px rgba(82, 56, 43, 0.2);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.composer-panel--open {
  transform: translate(-50%, 0);
}

.composer-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.composer-panel__title {
  font-size: 1.25rem;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  font-family: var(--font-heading);
}

.composer-panel__close {
  background: var(--border-light);
  border: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.composer-panel__close:hover {
  background: var(--border);
  color: var(--ink);
}

.composer-panel__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.composer-panel .poem-form__textarea {
  min-height: 130px;
  max-height: 300px;
  font-size: 1.35rem;
  padding: 1.25rem;
}

.composer-panel .submit-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* Read-only reaction buttons for archives */
.reaction-btn--readonly {
  cursor: default !important;
  opacity: 0.85;
}

.reaction-btn--readonly:hover {
  transform: none !important;
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

.reaction-btn--readonly.reaction-btn--active:hover {
  background: var(--border-light) !important;
}

/* === Authors Page === */
.authors-page__header {
  margin-bottom: 2rem;
}
.authors-search {
  margin-top: 1rem;
}
.authors-list {
  display: grid;
  gap: 0.85rem;
  opacity: 1;
}
.authors-list__status {
  color: var(--muted);
  font-weight: 600;
  padding: 2rem 0;
  text-align: center;
}
.authors-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  animation: authorsFadeSlide 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
  color: inherit;
  text-decoration: none;
}
.authors-card:hover {
  transform: translateX(8px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.authors-card__avatar {
  flex: 0 0 auto;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(242, 101, 34, 0.2);
}
.authors-card__initials {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.03em;
}
.authors-card__body {
  flex: 1;
  min-width: 0;
}
.authors-card__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.authors-card__bio {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.authors-card__stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.authors-card__stat {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}
.authors-card__excerpt {
  margin-top: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface-soft);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.authors-card__excerpt pre {
  margin: 0;
  font-family: var(--font-poem);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--accent);
  white-space: pre-wrap;
  word-break: break-word;
}
@keyframes authorsFadeSlide {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 576px) {
  .authors-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
  .authors-card__stats {
    justify-content: center;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustment for feed height */
@media (max-width: 768px) {
  .feed-viewport {
    padding: 1rem 0;
  }
  .fab-write-poem {
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0 1.25rem;
    min-height: 3.25rem;
  }
  .composer-panel {
    width: 100%;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 1.25rem;
  }
  .composer-panel .submit-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .poem-form__ai-toggle {
    justify-content: center;
  }
}
