/* ============================================================
   Mitra Org Portal — shared stylesheet
   The partner-facing portal for academies, hagwons, tutoring
   centers and schools. Built on the brand vars in style.css.
   ============================================================ */

/* ---------- Shell: sidebar + content ---------- */
.org-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 991px) {
  .org-shell { grid-template-columns: 1fr; gap: 16px; }
}

.org-sidebar {
  position: sticky;
  top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 1px 3px rgba(27, 58, 92, 0.05);
}
@media (max-width: 991px) {
  .org-sidebar { position: static; padding: 14px; }
}

/* min-width:0 lets the content column shrink so wide tables/chat
   scroll inside it instead of blowing out the grid. */
.org-content { min-width: 0; }

.org-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.org-brand .org-brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1B3A5C 0%, #2A9D8F 130%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700; font-size: 1.05rem;
  flex-shrink: 0;
}
.org-brand .org-brand-text { min-width: 0; }
.org-brand .org-brand-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700; font-size: 0.98rem;
  color: var(--text); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-brand .org-brand-kind {
  font-size: 0.72rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------- Sidebar nav ---------- */
.org-nav { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 991px) {
  .org-nav {
    flex-direction: row; overflow-x: auto; gap: 4px;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
}
.org-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 500; font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.org-nav a:hover { background: var(--bg); color: var(--primary); }
.org-nav a.active {
  background: var(--primary-lt);
  color: var(--primary-dk);
  font-weight: 700;
  border-left-color: var(--accent);
}
@media (max-width: 991px) {
  .org-nav a { border-left: none; border-bottom: 3px solid transparent; }
  .org-nav a.active { border-left: none; border-bottom-color: var(--accent); }
}
.org-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.org-nav .org-nav-sep {
  height: 1px; background: var(--border);
  margin: 8px 4px;
}
@media (max-width: 991px) { .org-nav .org-nav-sep { display: none; } }
.org-nav a.org-nav-signout { color: var(--text-light); }
.org-nav a.org-nav-signout:hover { background: #fdecec; color: #c0392b; }

/* ---------- Page header ---------- */
.org-head {
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; gap: 14px;
  margin-bottom: 22px;
}
.org-head h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--text); margin: 0 0 3px 0;
}
.org-head .org-head-sub {
  font-size: 0.92rem; color: var(--text-muted); margin: 0;
}
.org-head .org-head-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}

/* ---------- Generic card ---------- */
.org-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.org-card-h {
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--primary); margin: 0 0 4px 0;
}
.org-card-sub {
  font-size: 0.86rem; color: var(--text-muted);
  margin: 0 0 16px 0;
}

/* ---------- Stat tiles ---------- */
.org-stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 22px;
}
@media (max-width: 768px) { .org-stat-row { grid-template-columns: repeat(2, 1fr); } }
.org-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.org-stat .v {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.85rem; font-weight: 700;
  color: var(--primary); line-height: 1.05;
}
.org-stat .l {
  font-size: 0.76rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-top: 5px;
}

/* ---------- Row list (classes / students / files) ---------- */
.org-rows { display: flex; flex-direction: column; }
.org-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.org-row:last-child { border-bottom: none; }
a.org-row:hover { background: var(--bg); border-radius: 8px; }
.org-row-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary-lt); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif; font-weight: 700;
  font-size: 1rem; flex-shrink: 0;
}
.org-row-icon.teal { background: #d9efe9; color: var(--accent-dk); }
.org-row-icon.amber { background: #fef0d9; color: #b45309; }
.org-row-icon svg { width: 20px; height: 20px; }
.org-row-main { flex: 1; min-width: 0; }
.org-row-title {
  font-weight: 700; color: var(--text); font-size: 1rem;
}
.org-row-meta {
  font-size: 0.84rem; color: var(--text-muted); margin-top: 2px;
}
.org-row-aside {
  text-align: right; font-size: 0.84rem; color: var(--text-muted);
  flex-shrink: 0;
}
.org-row-aside .big {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  display: block;
}

/* ---------- Badges ---------- */
.org-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.02em;
}
.org-badge.gray   { background: #eef1f5; color: #5a6678; }
.org-badge.navy   { background: var(--primary-lt); color: var(--primary-dk); }
.org-badge.teal   { background: #d9efe9; color: var(--accent-dk); }
.org-badge.amber  { background: #fef0d9; color: #b45309; }
.org-badge.green  { background: #d9f0e3; color: #1f7a48; }
.org-badge.red    { background: #fde4e4; color: #c0392b; }

/* ---------- Empty states ---------- */
.org-empty {
  text-align: center;
  padding: 52px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 14px;
}
.org-empty .org-empty-mark {
  width: 60px; height: 60px; margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--primary-lt); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.org-empty .org-empty-mark svg { width: 28px; height: 28px; }
.org-empty h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin: 0 0 6px 0;
}
.org-empty p {
  color: var(--text-muted); font-size: 0.92rem;
  max-width: 420px; margin: 0 auto 18px;
}

/* ---------- Accordion: section-level (class detail) ---------- */
.org-accordion {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}
.org-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 22px;
  display: flex; align-items: center; gap: 12px;
}
.org-accordion > summary::-webkit-details-marker { display: none; }
.org-accordion > summary:hover { background: var(--bg); }
.org-accordion .acc-title {
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--primary);
}
.org-accordion .acc-count {
  font-family: 'DM Sans', sans-serif; font-weight: 700;
  color: var(--text-muted); font-size: 0.92rem;
}
.org-accordion .acc-chev {
  margin-left: auto; color: var(--text-light);
  transition: transform 0.15s; flex-shrink: 0;
}
.org-accordion .acc-chev svg { width: 18px; height: 18px; display: block; }
.org-accordion[open] > summary .acc-chev { transform: rotate(180deg); }
.org-accordion[open] > summary { border-bottom: 1px solid var(--border); }
.org-accordion .acc-body { padding: 6px 22px 18px; }

/* ---------- Accordion: row-level (student list) ---------- */
details.org-row-acc { border-bottom: 1px solid var(--border); }
details.org-row-acc:last-child { border-bottom: none; }
details.org-row-acc > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 8px;
}
details.org-row-acc > summary::-webkit-details-marker { display: none; }
details.org-row-acc > summary:hover { background: var(--bg); border-radius: 8px; }
details.org-row-acc .acc-chev {
  color: var(--text-light); transition: transform 0.15s; flex-shrink: 0;
}
details.org-row-acc .acc-chev svg { width: 16px; height: 16px; display: block; }
details.org-row-acc[open] > summary .acc-chev { transform: rotate(180deg); }
details.org-row-acc .acc-detail {
  padding: 4px 8px 18px 66px;
}
@media (max-width: 575px) {
  details.org-row-acc .acc-detail { padding-left: 12px; }
}
.acc-field-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-light); margin-bottom: 6px;
}
.acc-class-chip {
  display: inline-block; margin: 0 6px 6px 0;
  padding: 5px 12px; border-radius: 8px;
  background: var(--primary-lt); color: var(--primary-dk);
  font-size: 0.86rem; font-weight: 600;
}

/* ---------- Section title ---------- */
.org-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--primary);
  margin: 30px 0 14px 0;
}

/* ============================================================
   ANALYTICS  (the org home / overview page)
   ============================================================ */
.ana-hero {
  background: linear-gradient(135deg, #1B3A5C 0%, #2B4C7E 60%, #2A9D8F 140%);
  color: #fff; padding: 28px 32px; border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(27, 58, 92, 0.18);
}
.ana-hero .head { display: flex; justify-content: space-between; align-items: flex-start;
                   flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.ana-hero h2 { color: #fff; margin: 0 0 4px 0; font-size: 1.7rem; font-weight: 700; }
.ana-hero .sub { opacity: 0.85; font-size: 0.95rem; }
.ana-hero .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ana-hero .btn-light { color: #1B3A5C; }
.ana-hero .btn-outline-light { border-color: rgba(255,255,255,0.5); color: #fff; }
.ana-hero .btn-outline-light:hover { background: rgba(255,255,255,0.1); color: #fff; }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
.hero-stat { padding: 14px 16px; background: rgba(255,255,255,0.10);
              border-radius: 10px; backdrop-filter: blur(2px); }
.hero-stat .v { font-family: 'DM Sans', sans-serif; font-size: 1.9rem;
                  font-weight: 700; line-height: 1.05; color: #fff; }
.hero-stat .l { font-size: 0.78rem; opacity: 0.78;
                  text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

.hero-health { display: flex; align-items: center; gap: 14px; padding: 12px 18px;
                 background: rgba(255,255,255,0.10); border-radius: 12px;
                 border: 1.5px solid rgba(255,255,255,0.30); }
.hero-health .score { font-family: 'DM Sans', sans-serif; font-size: 2.2rem;
                        font-weight: 700; color: #fff; line-height: 1; }
.hero-health .lab { font-size: 0.82rem; opacity: 0.9; }
.hero-health .badge-lg { padding: 4px 10px; border-radius: 999px;
                           font-size: 0.78rem; font-weight: 700;
                           text-transform: uppercase; letter-spacing: 0.05em;
                           display: inline-block; margin-top: 4px; }
.badge-good { background: #2A9D8F; color: #fff; }
.badge-warn { background: #f59e0b; color: #fff; }
.badge-risk { background: #ef4444; color: #fff; }
.badge-muted { background: rgba(255,255,255,0.3); color: #fff; }

.panel-h { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em;
            text-transform: uppercase; color: var(--primary);
            margin: 0 0 12px 0; }
.panel-sub { font-size: 0.85rem; color: var(--text-muted); margin: -8px 0 16px 0; }

.heatmap-wrap { display: flex; gap: 8px; align-items: flex-start; }
.heatmap-labels { display: flex; flex-direction: column; gap: 3px;
                    padding-top: 0; font-size: 0.7rem; color: var(--text-muted); }
.heatmap-labels span { height: 25px; line-height: 25px; }
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 25px);
  grid-auto-flow: column;
  grid-auto-columns: 25px;
  gap: 3px;
}
.heatmap-cell { width: 25px; height: 25px; border-radius: 4px;
                  background: #eef2f7; transition: transform 0.1s; }
.heatmap-cell:hover { transform: scale(1.15); cursor: default; }
.heatmap-cell.l1 { background: #c8d8eb; }
.heatmap-cell.l2 { background: #93b6dd; }
.heatmap-cell.l3 { background: #5b8fcc; }
.heatmap-cell.l4 { background: #2B4C7E; }
.heatmap-cell.l5 { background: #1B3A5C; }
.heatmap-legend { display: flex; align-items: center; gap: 6px;
                    font-size: 0.72rem; color: var(--text-muted); margin-top: 12px; }
.heatmap-legend .swatch { width: 14px; height: 14px; border-radius: 3px;
                            display: inline-block; }

.topic-list { padding: 0; margin: 0; list-style: none; }
.topic-item { display: grid;
                grid-template-columns: 32px 1fr 130px;
                align-items: center; gap: 14px;
                padding: 14px 0; border-bottom: 1px solid var(--border); }
.topic-item:last-child { border-bottom: none; }
.topic-rank { font-family: 'DM Sans', sans-serif; font-weight: 700;
                font-size: 1.1rem; color: var(--primary);
                background: var(--primary-lt); height: 32px; width: 32px;
                border-radius: 50%; text-align: center; line-height: 32px; }
.topic-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.topic-name { font-weight: 700; color: var(--text); font-size: 1.02rem; }
.topic-bar-track { height: 10px; background: #eef2f7; border-radius: 5px;
                     overflow: hidden; }
.topic-bar-fill { height: 100%; border-radius: 5px;
                    background: linear-gradient(90deg, #2A9D8F 0%, #2B4C7E 100%); }
.topic-meta { text-align: right; font-size: 0.82rem; color: var(--text-muted);
                font-variant-numeric: tabular-nums; }
.topic-meta strong { display: block; color: var(--text); font-size: 1.05rem;
                       font-family: 'DM Sans', sans-serif; }

.challenge-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 18px;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3e2 100%);
  border: 1px solid #fed7aa; border-left: 5px solid #f97316;
  border-radius: 12px; padding: 18px 22px; margin-bottom: 14px;
}
.challenge-icon {
  width: 56px; height: 56px; border-radius: 12px;
  background: #f97316; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700;
}
.challenge-body .ch-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem; font-weight: 700; color: #7c2d12; margin-bottom: 4px;
}
.challenge-body .ch-meta {
  font-size: 0.85rem; color: #9a3412; margin-bottom: 10px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.challenge-body .ch-meta strong { font-weight: 700; }
.challenge-body .ch-action {
  background: rgba(255,255,255,0.7); border-radius: 8px;
  padding: 12px 14px; font-size: 0.95rem; line-height: 1.55; color: var(--text);
}
.challenge-body .ch-action b { color: #7c2d12; }

.class-tile {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 26px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.class-tile .cls-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.class-tile .cls-name {
  font-family: 'DM Sans', sans-serif; font-size: 1.35rem; font-weight: 700;
  color: var(--primary); margin: 0;
}
.cls-pill { display: inline-block; padding: 3px 12px; border-radius: 999px;
              background: var(--primary-lt); color: var(--primary);
              font-size: 0.72rem; font-weight: 700;
              text-transform: uppercase; letter-spacing: 0.05em;
              margin-left: 10px; vertical-align: middle; }
.cls-counts { font-size: 0.88rem; color: var(--text-muted); }
.cls-counts strong { color: var(--text); }

.cls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 768px) { .cls-grid { grid-template-columns: 1fr; } }
.cls-block { padding: 18px 20px; border-radius: 12px; }
.cls-block.topic { background: linear-gradient(135deg, #f0f7f4 0%, #e7f3ee 100%);
                     border: 1px solid #b6d8c9; }
.cls-block.challenge { background: linear-gradient(135deg, #fff7ed 0%, #fef3e2 100%);
                         border: 1px solid #fed7aa; }
.cls-block .blk-h {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 8px;
}
.cls-block.topic .blk-h { color: #2A9D8F; }
.cls-block.challenge .blk-h { color: #9a3412; }
.cls-block .blk-main {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.4rem; font-weight: 700; line-height: 1.2;
  color: var(--text); margin-bottom: 6px;
}
.cls-block.challenge .blk-main { color: #7c2d12; }
.cls-block .blk-meta {
  font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px;
}
.cls-block.challenge .blk-meta { color: #9a3412; }
.cls-block .blk-action {
  background: rgba(255,255,255,0.65);
  border-radius: 8px; padding: 10px 12px;
  font-size: 0.9rem; line-height: 1.5; color: var(--text);
}
.cls-block .blk-action b { color: #7c2d12; }

.ana-card { background: var(--bg-card); border: 1px solid var(--border);
              border-radius: 12px; padding: 22px 24px; margin-bottom: 20px; }

/* ============================================================
   CHAT WITH MITRA  (peer mode)
   ============================================================ */
.org-chat {
  display: flex; flex-direction: column;
  height: calc(100vh - 190px);
  min-height: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.org-chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.org-chat-head .who { display: flex; align-items: center; gap: 11px; }
.org-chat-head .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #1B3A5C 0%, #2A9D8F 130%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'DM Sans', sans-serif;
}
.org-chat-head .name { font-weight: 700; color: var(--text); line-height: 1.2; }
.org-chat-head .status { font-size: 0.78rem; color: var(--accent-dk); }
.org-chat-head .status::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 5px; vertical-align: middle;
}

.chat-scroll {
  flex: 1; overflow-y: auto;
  padding: 22px 20px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 14px;
}
.chat-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 85%; }
.chat-msg.assistant { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700; font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.chat-msg-col { display: flex; flex-direction: column; min-width: 0; }
.chat-msg.user .chat-msg-col { align-items: flex-end; }
.chat-bubble {
  padding: 9px 13px; border-radius: 14px;
  font-size: 0.93rem; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}
.chat-msg.user .chat-bubble {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant .chat-bubble {
  background: #eef2f7; color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-ts { font-size: 0.68rem; color: var(--text-light); margin-top: 4px; padding: 0 4px; }

.chat-day {
  align-self: center;
  font-size: 0.72rem; color: var(--text-light);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 12px;
}

.chat-empty {
  margin: auto; text-align: center; max-width: 380px;
  color: var(--text-muted);
}
.chat-empty .avatar-lg {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, #1B3A5C 0%, #2A9D8F 130%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; font-family: 'DM Sans', sans-serif;
}
.chat-empty h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }

/* typing indicator */
.chat-typing { display: flex; gap: 4px; padding: 14px 16px; }
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-light);
  animation: chat-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-composer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--bg-card);
}
.chat-composer form { display: flex; gap: 10px; align-items: flex-end; }
.chat-composer textarea {
  flex: 1; resize: none;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font-size: 0.95rem; line-height: 1.5;
  max-height: 140px; font-family: inherit;
}
.chat-composer textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,157,143,0.12);
}
.chat-send-btn {
  flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 12px;
  border: none; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.12s;
}
.chat-send-btn:hover:not(:disabled) { background: var(--accent-dk); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-send-btn svg { width: 20px; height: 20px; }

.chat-cap-bar {
  font-size: 0.8rem; padding: 7px 16px;
  background: #fef0d9; color: #b45309;
  border-top: 1px solid #fed7aa;
}
.chat-cap-bar.full { background: #fde4e4; color: #c0392b; border-top-color: #f5b5b5; }
