@import url("https://fonts.googleapis.com/css2?family=Inknut+Antiqua:wght@300;400;500;600;700&display=swap");

/* ============================================
   0. RESET & BASE
   Misma base que meowrhino.studio.
   Fuente: Inknut Antiqua (serif).
   ============================================ */

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inknut Antiqua", serif;
  font-weight: 400;
  line-height: 1.3;
  background: #ffffff;
  color: #000000;
}

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

a {
  color: inherit;
  text-decoration: none;
}

p, h1, h2, h3 {
  margin: 0;
  padding: 0;
}

/* ============================================
   1. VIEWS (login / dashboard)
   Solo una visible a la vez.
   ============================================ */

.view {
  display: none;
}

.view.active {
  display: flex;
}

.hidden {
  display: none !important;
}

/* ============================================
   2. LOGIN
   Centrado en pantalla, minimalista.
   ============================================ */

#login-view {
  width: 100dvw;
  height: 100dvh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.login-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5em;
}

.login-title {
  font-size: clamp(1.6rem, 3.5dvw, 3rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8em;
  width: 280px;
}

.login-form input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  font-family: "Inknut Antiqua", serif;
  font-size: 0.8rem;
  background: #fff;
  color: #000;
  transition: border-color 0.2s ease;
  outline: none;
}

.login-form input:focus {
  border-color: rgba(0,0,0,0.4);
}

.login-form input::placeholder {
  color: #bbb;
}

.login-btn {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-family: "Inknut Antiqua", serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  letter-spacing: 0.05em;
}

.login-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  color: #c00;
  font-size: 0.7rem;
  min-height: 1.2em;
  text-align: center;
}

/* ============================================
   3. DASHBOARD LAYOUT
   Header fijo + contenido scrollable.
   ============================================ */

#dashboard-view {
  width: 100dvw;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2dvh 5dvw;
  flex-shrink: 0;
}

.dash-logo {
  font-size: clamp(0.9rem, 1.5dvw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: #999;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 1.2em;
}

.dash-user {
  font-size: 0.75rem;
  color: #999;
}

.dash-logout {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.7rem;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
  letter-spacing: 0.05em;
}

.dash-logout:hover {
  color: #000;
}

/* ============================================
   3.1 PROJECT SELECTOR (admin only)
   ============================================ */

.project-selector {
  padding: 0 5dvw 1dvh;
  flex-shrink: 0;
}

.project-select {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #fff;
  color: #000;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.project-select:focus {
  border-color: rgba(0,0,0,0.4);
}

/* ============================================
   4. DASHBOARD SCROLL AREA
   ============================================ */

.dash-scroll-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0 5dvw 5dvh;
}

.dash-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3em;
  padding-bottom: 10dvh;
}

/* ============================================
   5. SECTIONS (each module)
   ============================================ */

.dash-section {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.section-title {
  font-size: clamp(0.75rem, 1dvw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #999;
  text-transform: lowercase;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 0.5em;
}

/* ============================================
   6. TIMELINE
   Barra horizontal con las 5 fases.
   ============================================ */

.timeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.timeline-phase {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  position: relative;
  padding: 0.8em 0.3em;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.15);
  background: #fff;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.timeline-phase.completed .timeline-dot {
  background: #000;
  border-color: #000;
}

.timeline-phase.current .timeline-dot {
  background: #fff;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.timeline-label {
  font-size: clamp(0.5rem, 0.7dvw, 0.65rem);
  text-align: center;
  color: #bbb;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.timeline-phase.completed .timeline-label,
.timeline-phase.current .timeline-label {
  color: #000;
}

.timeline-phase.current .timeline-label {
  font-weight: 600;
}

/* Línea conectora */
.timeline-phase:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(0.8em + 5px);
  left: calc(50% + 8px);
  width: calc(100% - 16px);
  height: 2px;
  background: rgba(0,0,0,0.1);
  z-index: 1;
}

.timeline-phase.completed:not(:last-child)::after {
  background: #000;
}

/* ============================================
   7. STATUS CARD
   ============================================ */

.status-card {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 1em 1.2em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator.active {
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46,204,113,0.4);
}

.status-indicator.waiting {
  background: #f39c12;
  box-shadow: 0 0 6px rgba(243,156,18,0.4);
}

.status-indicator.done {
  background: #000;
}

.status-text {
  font-size: clamp(0.75rem, 1dvw, 0.9rem);
  font-weight: 500;
}

.status-phase {
  font-size: 0.7rem;
  color: #999;
  margin-left: auto;
}

/* ============================================
   8. DATES
   ============================================ */

.dates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8em;
}

.date-item {
  padding: 0.8em 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.date-label {
  font-size: 0.6rem;
  color: #999;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3em;
}

.date-value {
  font-size: clamp(0.7rem, 0.9dvw, 0.85rem);
  font-weight: 500;
}

.date-value.pending {
  color: #ccc;
  font-style: italic;
}

/* ============================================
   9. MEETINGS
   ============================================ */

.meetings-list {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.meeting-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8em;
  padding: 0.8em 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.meeting-check {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.meeting-check.done {
  background: #000;
  border-color: #000;
  color: #fff;
}

.meeting-info {
  flex: 1;
}

.meeting-type {
  font-size: clamp(0.7rem, 0.9dvw, 0.85rem);
  font-weight: 500;
  text-transform: lowercase;
}

.meeting-date {
  font-size: 0.65rem;
  color: #999;
  margin-top: 0.2em;
}

.meeting-notes {
  font-size: 0.65rem;
  color: #777;
  margin-top: 0.3em;
  line-height: 1.4;
}

/* ============================================
   10. ROUNDS OF CHANGES
   ============================================ */

.rounds-container {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.rounds-summary {
  display: flex;
  align-items: center;
  gap: 1em;
}

.round-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.12);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.round-dot.used {
  background: #000;
  border-color: #000;
  color: #fff;
}

.round-dot.available {
  border-color: rgba(0,0,0,0.25);
  color: #bbb;
}

.rounds-text {
  font-size: 0.75rem;
  color: #666;
}

.rounds-text strong {
  color: #000;
}

.rounds-history {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.round-history-item {
  padding: 0.8em 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.round-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3em;
}

.round-history-label {
  font-size: 0.7rem;
  font-weight: 600;
}

.round-history-date {
  font-size: 0.6rem;
  color: #999;
}

.round-history-desc {
  font-size: 0.65rem;
  color: #666;
  line-height: 1.5;
}

/* ============================================
   11. PAYMENTS
   ============================================ */

.payments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8em;
}

.payment-card {
  padding: 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
}

.payment-label {
  font-size: 0.6rem;
  color: #999;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4em;
}

.payment-amount {
  font-size: clamp(1rem, 1.5dvw, 1.3rem);
  font-weight: 600;
}

.payment-status {
  font-size: 0.6rem;
  margin-top: 0.4em;
  letter-spacing: 0.03em;
}

.payment-status.paid {
  color: #2ecc71;
}

.payment-status.unpaid {
  color: #ccc;
}

.payment-date {
  font-size: 0.55rem;
  color: #bbb;
  margin-top: 0.2em;
}

/* ============================================
   12. MATERIALS CHECKLIST
   ============================================ */

.materials-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.7em 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.material-check {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

.material-check.done {
  background: #000;
  border-color: #000;
  color: #fff;
}

.material-name {
  font-size: 0.75rem;
  font-weight: 500;
  flex: 1;
}

.material-note {
  font-size: 0.6rem;
  color: #999;
}

/* ============================================
   13. DELIVERABLES
   ============================================ */

.deliverables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8em;
}

.deliverable-card {
  padding: 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
}

.deliverable-name {
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.5em;
  text-transform: lowercase;
}

.deliverable-status {
  font-size: 0.65rem;
  padding: 0.25em 0.6em;
  border-radius: 20px;
  display: inline-block;
}

.deliverable-status.approved {
  background: rgba(46,204,113,0.1);
  color: #2ecc71;
}

.deliverable-status.in_progress {
  background: rgba(243,156,18,0.1);
  color: #f39c12;
}

.deliverable-status.pending {
  background: rgba(0,0,0,0.05);
  color: #bbb;
}

.deliverable-date {
  font-size: 0.55rem;
  color: #bbb;
  margin-top: 0.4em;
}

/* ============================================
   14. PROCESS HISTORY
   Timeline cronológica vertical.
   ============================================ */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-empty {
  font-size: 0.7rem;
  color: #ccc;
  font-style: italic;
}

.history-item {
  display: flex;
  gap: 0.8em;
  min-height: 3em;
}

.history-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 12px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
  margin-top: 4px;
}

.history-dot.inicio { background: #000; }
.history-dot.reunión { background: #555; }
.history-dot.pago { background: #2ecc71; }
.history-dot.ronda { background: #f39c12; }
.history-dot.entregable { background: #3498db; }

.history-line {
  width: 1px;
  flex: 1;
  background: rgba(0,0,0,0.08);
  margin: 3px 0;
}

.history-item:last-child .history-line {
  display: none;
}

.history-content {
  flex: 1;
  padding-bottom: 1em;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.2em;
}

.history-type {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: lowercase;
  color: #999;
  letter-spacing: 0.03em;
}

.history-date {
  font-size: 0.55rem;
  color: #bbb;
}

.history-text {
  font-size: 0.7rem;
  color: #555;
  line-height: 1.4;
}

/* ============================================
   14.1 ROUND REQUEST FORM
   Formulario para solicitar cambios.
   ============================================ */

.round-request {
  padding: 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.round-request.exhausted {
  text-align: center;
  font-size: 0.7rem;
  color: #999;
  font-style: italic;
}

.round-request-title {
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.6em;
  color: #333;
}

.round-request-textarea {
  width: 100%;
  padding: 0.6em 0.8em;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  font-family: "Inknut Antiqua", serif;
  font-size: 0.65rem;
  background: #fff;
  color: #000;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  line-height: 1.5;
}

.round-request-textarea:focus {
  border-color: rgba(0,0,0,0.4);
}

.round-request-textarea::placeholder {
  color: #bbb;
}

.round-request-btn {
  margin-top: 0.6em;
  padding: 0.4em 1.2em;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-family: "Inknut Antiqua", serif;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  letter-spacing: 0.03em;
}

.round-request-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

.round-request-btn:active {
  transform: translateY(0);
}

.round-request-btn:disabled {
  background: #999;
  cursor: default;
  transform: none;
}

.round-request-msg {
  font-size: 0.6rem;
  margin-top: 0.4em;
  min-height: 1em;
}

.round-request-msg.success {
  color: #2ecc71;
}

.round-request-msg.error {
  color: #c00;
}

/* ============================================
   15. SUPPORT POST-DELIVERY
   ============================================ */

.support-card {
  padding: 1.2em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
}

.support-inactive {
  font-size: 0.75rem;
  color: #bbb;
  font-style: italic;
}

.support-countdown {
  font-size: clamp(1rem, 2dvw, 1.5rem);
  font-weight: 600;
  margin-bottom: 0.3em;
}

.support-label {
  font-size: 0.65rem;
  color: #999;
}

.support-expired {
  color: #c00;
  font-weight: 600;
}

/* ============================================
   16. NOTES
   ============================================ */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.note-item {
  padding: 0.8em 1em;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
  background: #fafafa;
}

.note-date {
  font-size: 0.55rem;
  color: #bbb;
  margin-bottom: 0.3em;
}

.note-text {
  font-size: 0.7rem;
  color: #555;
  line-height: 1.5;
}

/* ============================================
   17. SECTION TITLE ROW (with edit button)
   ============================================ */

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.section-title-row .section-title {
  flex: 1;
}

/* ============================================
   18. ADMIN EDITING UI
   ============================================ */

.admin-edit-btn {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.6rem;
  background: none;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 0.15em 0.5em;
  cursor: pointer;
  color: #bbb;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.admin-edit-btn:hover {
  color: #000;
  border-color: rgba(0,0,0,0.3);
}

.admin-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.admin-label {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  font-size: 0.6rem;
  color: #999;
  letter-spacing: 0.03em;
}

.admin-input {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.7rem;
  padding: 0.4em 0.6em;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #fff;
  color: #000;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}

.admin-input:focus {
  border-color: rgba(0,0,0,0.4);
}

.admin-actions {
  display: flex;
  gap: 0.5em;
  align-items: center;
  margin-top: 0.3em;
}

.admin-save-btn {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.3em 0.8em;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #000;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  letter-spacing: 0.03em;
}

.admin-save-btn:hover {
  background: #333;
}

.admin-cancel-btn {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.6rem;
  padding: 0.3em 0.8em;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-cancel-btn:hover {
  color: #000;
  border-color: rgba(0,0,0,0.3);
}

.admin-delete-btn {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.6rem;
  padding: 0.3em 0.8em;
  border: 1px solid rgba(200,0,0,0.15);
  border-radius: 4px;
  background: #fff;
  color: #c00;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-delete-btn:hover {
  background: #c00;
  color: #fff;
}

.admin-editable {
  flex-direction: column;
  align-items: stretch;
}

/* ============================================
   19. SHARE / PUBLIC LINK
   ============================================ */

.share-card {
  padding: 1em;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  background: #fafafa;
}

.share-url-row {
  display: flex;
  gap: 0.5em;
  align-items: center;
}

.share-url-input {
  font-family: "Inknut Antiqua", serif;
  font-size: 0.6rem;
  padding: 0.4em 0.6em;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #fff;
  color: #000;
  flex: 1;
  outline: none;
}

/* ============================================
   20. RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .dash-scroll-wrapper {
    padding: 0 4dvw 4dvh;
  }

  .dash-header {
    padding: 2dvh 4dvw;
    gap: 0.5em;
  }

  .dash-logo {
    font-size: 0.75rem;
  }

  .dash-user {
    font-size: 0.65rem;
  }

  .project-selector {
    padding: 0 4dvw 1dvh;
  }

  .dates-grid {
    grid-template-columns: 1fr 1fr;
  }

  .payments-grid {
    grid-template-columns: 1fr 1fr;
  }

  .deliverables-grid {
    grid-template-columns: 1fr 1fr;
  }

  .timeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3em;
  }

  .timeline-phase {
    padding: 0.5em 0.1em;
  }

  .timeline-label {
    font-size: 0.45rem;
  }

  .timeline-phase:not(:last-child)::after {
    display: none;
  }

  .status-card {
    flex-wrap: wrap;
  }

  .status-phase {
    margin-left: 0;
    width: 100%;
    padding-left: 1.3em;
  }
}

/* ============================================
   CHAT
   ============================================ */

.dash-section-chat .section-title {
  margin-bottom: 0.8em;
}

.chat-container {
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
  overflow: hidden;
  height: 60vh;
  min-height: 320px;
  max-height: 700px;
}

.chat-pinned {
  display: none;
  flex-direction: column;
  gap: 0.3em;
  padding: 0.6em 0.9em;
  background: #fff8e1;
  border-bottom: 1px solid #f0e6c0;
  font-size: 0.7rem;
}

.chat-pinned.has-items {
  display: flex;
}

.chat-pinned-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #998a5a;
}

.chat-pinned-item {
  cursor: pointer;
  color: #5a4d20;
  padding: 0.2em 0.4em;
  border-left: 2px solid #c9b870;
  background: #fffdf5;
  transition: background 0.15s;
}

.chat-pinned-item:hover {
  background: #fff5d6;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1em 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  background: #fff;
}

.chat-empty {
  text-align: center;
  color: #bbb;
  font-style: italic;
  font-size: 0.75rem;
  padding: 2em 1em;
}

.message {
  max-width: 75%;
  padding: 0.55em 0.85em;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  background: #f1f1f1;
  position: relative;
  word-wrap: break-word;
}

.message.mine {
  align-self: flex-end;
  background: #1a1a1a;
  color: #fff;
}

.message.theirs {
  align-self: flex-start;
  background: #f0f0f0;
  color: #1a1a1a;
}

.message.is-pinned {
  border: 1px solid #c9b870;
  box-shadow: 0 0 0 2px #fff8e1;
}

.message.is-round {
  background: #efe7ff;
  color: #2a1a4d;
  border: 1px dashed #b8a8e8;
}

.message.is-round.mine {
  background: #4a2a8a;
  color: #fff;
  border-color: #6b4eb8;
}

.message-tag {
  display: inline-block;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: #b8a8e8;
  color: #2a1a4d;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  margin-bottom: 0.4em;
}

.message.mine .message-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.message-text {
  white-space: pre-wrap;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.55rem;
  margin-top: 0.4em;
  opacity: 0.65;
}

.message.mine .message-meta {
  color: #ccc;
}

.message-author {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-actions {
  margin-left: auto;
  display: flex;
  gap: 0.2em;
}

.message-action {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: inherit;
  opacity: 0.6;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.message-action:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.message.mine .message-action:hover {
  background: rgba(255, 255, 255, 0.15);
}

.message-action.active {
  opacity: 1;
}

.message-reply-quote {
  background: rgba(0, 0, 0, 0.06);
  border-left: 2px solid currentColor;
  padding: 0.3em 0.5em;
  margin-bottom: 0.4em;
  font-size: 0.65rem;
  opacity: 0.85;
  border-radius: 3px;
}

.message.mine .message-reply-quote {
  background: rgba(255, 255, 255, 0.15);
}

.message-reply-author {
  text-transform: uppercase;
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  margin-right: 0.4em;
  opacity: 0.7;
}

.message-attachment-img {
  display: block;
  margin-top: 0.4em;
  max-width: 100%;
}

.message-attachment-img img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
  display: block;
}

.message-attachment-file {
  display: inline-block;
  margin-top: 0.4em;
  padding: 0.4em 0.7em;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  font-size: 0.7rem;
}

.message.mine .message-attachment-file {
  background: rgba(255, 255, 255, 0.15);
}

.message-attachment-file:hover {
  background: rgba(0, 0, 0, 0.1);
}

.chat-compose {
  border-top: 1px solid #eee;
  background: #fff;
  padding: 0.7em 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.chat-reply-banner,
.chat-attachment-banner {
  background: #f5f5f5;
  padding: 0.4em 0.7em;
  border-radius: 4px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5em;
  border-left: 2px solid #999;
}

.chat-reply-banner.hidden,
.chat-attachment-banner.hidden {
  display: none;
}

.chat-banner-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin-left: auto;
  opacity: 0.5;
  color: inherit;
}

.chat-banner-x:hover {
  opacity: 1;
}

.chat-compose-row {
  display: flex;
  gap: 0.5em;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  resize: none;
  font: inherit;
  font-size: 0.8rem;
  padding: 0.6em 0.8em;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  outline: none;
  min-height: 2.4em;
  max-height: 10em;
  line-height: 1.4;
}

.chat-input:focus {
  border-color: #1a1a1a;
  background: #fff;
}

.chat-attach-btn {
  cursor: pointer;
  padding: 0.5em 0.7em;
  font-size: 1rem;
  background: #f5f5f5;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.chat-attach-btn:hover {
  background: #ececec;
}

.chat-send-btn {
  padding: 0.6em 1em;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.chat-send-btn:hover {
  background: #000;
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .chat-container {
    height: 70vh;
  }
  .message {
    max-width: 90%;
  }
}

