/* ============================================================
   AI Viajar — hoja de estilos (mobile-first, temas claro/oscuro)
   ============================================================ */

:root {
  --brand: #0d9488;
  --brand-strong: #0f766e;
  --brand-soft: #ccfbf1;
  --accent: #f59e0b;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #16181d;
  --text-soft: #5b6472;
  --border: #dfe3e9;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 14px rgba(16, 24, 40, .06);
  --radius: 14px;
}
[data-theme="dark"] {
  --brand: #2dd4bf;
  --brand-strong: #14b8a6;
  --brand-soft: #134e4a;
  --accent: #fbbf24;
  --bg: #0e1116;
  --surface: #171b22;
  --surface-2: #1f2530;
  --text: #e8eaee;
  --text-soft: #9aa3b0;
  --border: #2a313d;
  --danger: #f87171;
  --success: #4ade80;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  transition: background .25s, color .25s;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* --- Barra superior --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand { font-size: 1.25rem; font-weight: 800; color: var(--text); display: flex; gap: 6px; align-items: center; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; align-items: center; gap: 12px; }
.topnav a { color: var(--text-soft); font-weight: 600; }
.topnav a.btn { color: #fff; }
.inline { display: inline; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px;
  font-size: .95rem; font-weight: 700; cursor: pointer; transition: filter .15s, background .15s;
  background: var(--surface-2); color: var(--text); text-decoration: none;
}
.btn:hover { filter: brightness(.96); text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-icon {
  background: transparent; border: none; cursor: pointer; font-size: 1rem;
  color: var(--text-soft); padding: 6px; border-radius: 8px;
}
.btn-icon:hover { background: var(--surface-2); }

/* --- Layout --- */
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.footer { text-align: center; color: var(--text-soft); font-size: .85rem; padding: 24px 16px; border-top: 1px solid var(--border); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 18px; }
.page-head h1 { margin: 0; }
.section-title { margin: 34px 0 14px; }
.hint { color: var(--text-soft); font-size: .88rem; }
.two-col { display: grid; gap: 18px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

/* --- Tarjetas --- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 { margin-top: 0; }

/* --- Flash --- */
.flash { max-width: 1100px; margin: 12px auto 0; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.flash-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border: 1px solid var(--danger); }
.flash-success { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); border: 1px solid var(--success); }

/* --- Landing --- */
.hero { text-align: center; padding: 60px 10px 40px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 14px; }
.grad { background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--text-soft); max-width: 640px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 30px; }
.feature { text-align: center; }
.feature-icon { font-size: 2rem; }

/* --- Formularios --- */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 12px; }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); color: var(--text); font-size: .95rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
fieldset { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 14px; padding: 12px; }
legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.form-card { max-width: 760px; }
.form-grid { display: grid; gap: 4px 16px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.auth-card { max-width: 420px; margin: 40px auto; }
.auth-links { text-align: center; font-size: .9rem; }
.check-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }

/* --- Chips --- */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; }
.chip span {
  display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  cursor: pointer; font-weight: 600; font-size: .88rem; transition: all .15s; background: var(--bg);
}
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--brand); }

/* --- Dashboard --- */
.trip-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.trip-card { padding: 0; overflow: hidden; color: var(--text); display: block; }
.trip-card:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.trip-cover {
  height: 130px; background: linear-gradient(120deg, var(--brand), var(--accent));
  background-size: cover; background-position: center; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.trip-cover-emoji { font-size: 2.6rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.trip-card-body { padding: 14px 16px; }
.trip-card-body h3 { margin: 0 0 6px; }
.trip-dest, .trip-dates { margin: 2px 0; color: var(--text-soft); font-size: .9rem; }
.badge {
  position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
}
.badge-dreaming { background: #ede9fe; color: #6d28d9; }
.badge-planning { background: #dbeafe; color: #1d4ed8; }
.badge-booked { background: #dcfce7; color: #15803d; }
.badge-completed { background: #f1f5f9; color: #475569; }
.badge-shared { background: var(--brand-soft); color: var(--brand-strong); }
.empty-state { text-align: center; padding: 50px 20px; }

/* --- Hero del viaje --- */
.trip-hero {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; min-height: 170px;
  background: linear-gradient(120deg, var(--brand), var(--accent)); background-size: cover; background-position: center;
  display: flex; align-items: flex-end;
}
.trip-hero-overlay {
  width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 40px 20px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .65));
  color: #fff;
}
.trip-hero-overlay h1 { margin: 6px 0 4px; font-size: clamp(1.4rem, 4vw, 2.1rem); }
.trip-hero-overlay p { margin: 0; opacity: .92; }
.trip-hero-overlay .badge { position: static; }
.trip-hero-actions { display: flex; gap: 8px; }
.trip-hero-actions .btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }

/* --- Pestañas --- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px;
  scrollbar-width: none; position: sticky; top: 58px; z-index: 50;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; border: none; background: transparent; padding: 9px 14px; border-radius: 9px;
  font-weight: 700; font-size: .9rem; color: var(--text-soft); cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--brand); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* --- Chat --- */
.chat-box { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-messages { padding: 18px; overflow-y: auto; max-height: 55vh; min-height: 260px; display: flex; flex-direction: column; gap: 12px; }
.chat-welcome { color: var(--text-soft); background: var(--surface-2); border-radius: 12px; padding: 14px; }
.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.msg-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2);
  overflow-wrap: break-word; font-size: .95rem;
}
.msg-user .msg-bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
/* La respuesta del asistente usa casi todo el ancho: menos altura, menos scroll */
.msg-assistant { width: 100%; }
.msg-assistant .msg-bubble { max-width: 100%; width: 100%; background: transparent; padding: 4px 2px; border-radius: 0; }
.msg-bubble :is(h1, h2, h3) { font-size: 1rem; margin: 8px 0 4px; }
.msg-bubble p { margin: 6px 0; }
.msg-bubble ul, .msg-bubble ol { margin: 6px 0; padding-left: 20px; }
.msg-bubble.typing::after { content: '▍'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-suggestions { display: flex; gap: 8px; padding: 8px 14px; overflow-x: auto; border-top: 1px solid var(--border); scrollbar-width: none; }
.chip-btn {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-soft); font-size: .82rem; font-weight: 600; cursor: pointer;
}
.chip-btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.chat-input textarea { resize: none; margin: 0; max-height: 120px; }
.chat-input .btn { align-self: flex-end; }

/* --- Itinerario --- */
.itinerary-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.itinerary-toolbar input { flex: 1; min-width: 220px; margin: 0; }
.day-card { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.day-head h2 { margin: 0; font-size: 1.15rem; color: var(--brand-strong); }
.day-title { margin: 0; font-weight: 700; }
.day-summary { color: var(--text-soft); margin: 6px 0 10px; font-style: italic; }
.day-actions { display: flex; gap: 6px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity {
  display: flex; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--border);
  align-items: flex-start;
}
.act-time { font-weight: 800; color: var(--brand-strong); min-width: 48px; font-variant-numeric: tabular-nums; }
.act-icon { flex-shrink: 0; }
.act-body { flex: 1; min-width: 0; }
.act-body p { margin: 4px 0 2px; color: var(--text-soft); font-size: .9rem; }
.act-loc { color: var(--text-soft); font-size: .88rem; }
.act-cost { font-size: .85rem; font-weight: 700; color: var(--accent); }
.act-actions { display: flex; gap: 2px; flex-shrink: 0; }
.act-actions .btn-icon { font-size: .85rem; }

/* --- Mapa --- */
.map-card { padding: 0; overflow: hidden; }
#map { height: 65vh; min-height: 380px; width: 100%; }

/* --- Presupuesto --- */
.budget-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.budget-bar-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; font-size: .9rem; }
.budget-bar-track { background: var(--surface-2); border-radius: 999px; height: 12px; overflow: hidden; }
.budget-bar-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.budget-total { margin-top: 14px; font-weight: 800; font-size: 1.05rem; }
.expense-form { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.expense-form input, .expense-form select { margin: 0; }
.expense-form button { grid-column: 1 / -1; }
@media (min-width: 700px) { .expense-form { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; } .expense-form button { grid-column: auto; } }
.expense-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 2px; border-top: 1px solid var(--border); font-size: .92rem; }
.expense-cat { font-size: .78rem; color: var(--text-soft); }
.expense-amount { font-weight: 700; white-space: nowrap; }
#expense-summary { margin: 10px 0; font-weight: 700; }

/* --- Checklist --- */
.checklist-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.check-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-top: 1px solid var(--border); }
.check-item input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.check-item.done label { text-decoration: line-through; color: var(--text-soft); }
.check-item label { margin: 0; font-weight: 500; flex: 1; cursor: pointer; }
.check-add { display: flex; gap: 6px; margin-top: 10px; }
.check-add input { margin: 0; }

/* --- Herramientas --- */
.tools-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.tool-card h3 { margin-bottom: 10px; }
.fx-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fx-form input, .fx-form select { margin: 0; width: auto; flex: 1; min-width: 80px; }
.fx-arrow { font-weight: 800; color: var(--text-soft); }
#fx-result { margin-top: 12px; font-size: 1.15rem; font-weight: 800; }
#fx-result .hint { font-weight: 400; }
.weather-grid { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.weather-day { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; flex-shrink: 0; min-width: 86px; }
.weather-day .w-icon { font-size: 1.6rem; }
.weather-day .w-date { font-size: .75rem; color: var(--text-soft); }
.weather-day .w-temp { font-weight: 700; font-size: .9rem; }
.weather-day .w-desc { font-size: .75rem; color: var(--text-soft); }
.country-info dt { font-weight: 700; margin-top: 8px; }
.country-info dd { margin: 0; color: var(--text-soft); }
.phrase-row { padding: 8px 0; border-top: 1px solid var(--border); }
.phrase-row .p-local { font-weight: 700; }
.phrase-row .p-pron { color: var(--brand-strong); font-size: .85rem; }
.phrase-row .p-es { color: var(--text-soft); font-size: .88rem; }
.booking-links { display: flex; flex-direction: column; gap: 8px; }
.zone-item { padding: 8px 0; border-top: 1px solid var(--border); }

/* --- Notas --- */
.notes-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.note-card p { color: var(--text-soft); font-size: .92rem; }
.note-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.note-form label { margin-bottom: 8px; }

/* --- Compartir --- */
.share-user-form { display: flex; gap: 8px; }
.share-user-form input { margin: 0; }
.share-list { list-style: none; padding: 0; margin: 12px 0 0; }
.share-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px; border-top: 1px solid var(--border); font-size: .92rem; }
#share-link-box { display: flex; gap: 8px; margin-bottom: 10px; }
#share-link-box input { margin: 0; font-size: .85rem; }
.danger-zone { border-color: var(--danger); }

/* --- Público / errores --- */
.public-head { text-align: center; margin: 20px 0 26px; }
.public-head .badge { position: static; }
.error-page { text-align: center; padding: 70px 20px; }
.error-emoji { font-size: 3.4rem; margin-bottom: 8px; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: var(--surface); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.alt-option { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.alt-option:hover { border-color: var(--brand); background: var(--surface-2); }

/* --- Utilidades --- */
.spinner {
  display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-note { color: var(--text-soft); display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.tool-error { color: var(--danger); font-size: .9rem; }

/* ============================================================
   Panel de administración
   ============================================================ */
.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav-item { flex-shrink: 0; padding: 9px 14px; border-radius: 9px; font-weight: 700; font-size: .9rem; color: var(--text-soft); white-space: nowrap; }
.admin-nav-item:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav-item.active { background: var(--brand); color: #fff; }

.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 8px; }
.stat { text-align: center; padding: 20px 14px; }
.stat-num { font-size: 1.9rem; font-weight: 800; color: var(--brand-strong); line-height: 1.1; }
.stat-sub { font-size: 1rem; color: var(--text-soft); font-weight: 600; }
.stat-label { color: var(--text-soft); font-size: .85rem; margin-top: 4px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 10px 0; }
.spark-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.spark-fill { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 3px; transition: height .3s; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); color: var(--text-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table .nowrap { white-space: nowrap; }
.admin-table .truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-table .cell-preview { max-width: 280px; font-size: .82rem; color: var(--text-soft); }
.filter-bar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }

.suggestion-list { list-style: none; margin: 0; padding: 0; }
.suggestion { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.suggestion:first-child { border-top: none; }
.suggestion p { margin: 4px 0 0; }
.suggestion-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

/* Editor de blog */
.blog-editor .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; line-height: 1.6; }
.editor-toolbar { display: flex; gap: 8px; margin: -6px 0 12px; }
.editor-footer { display: flex; gap: 14px; align-items: flex-end; justify-content: flex-end; margin-top: 10px; }
.md-preview { border: 1px dashed var(--border); border-radius: 10px; padding: 16px; margin-bottom: 14px; background: var(--bg); }
.cover-row { display: flex; gap: 16px; flex-wrap: wrap; }
.cover-preview { width: 240px; height: 135px; border-radius: 10px; background: var(--surface-2); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: var(--text-soft); flex-shrink: 0; }
.cover-controls { flex: 1; min-width: 220px; }

/* ============================================================
   Blog público
   ============================================================ */
.blog-head { text-align: center; margin: 20px 0 30px; }
.blog-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 8px; }
.blog-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.blog-card { padding: 0; overflow: hidden; }
.blog-card-link { color: var(--text); display: block; }
.blog-card-link:hover { text-decoration: none; }
.blog-card:hover { transform: translateY(-2px); transition: transform .15s; }
.blog-cover { height: 160px; background: linear-gradient(120deg, var(--brand), var(--accent)); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.blog-card-body { padding: 16px; }
.blog-card-body h2 { font-size: 1.15rem; margin: 0 0 8px; }
.blog-excerpt { color: var(--text-soft); font-size: .92rem; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-meta { color: var(--text-soft); font-size: .82rem; margin: 0; }

.blog-article { max-width: 760px; margin: 0 auto; }
.crumbs { margin-bottom: 12px; font-size: .9rem; }
.article-head h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 8px; }
.article-cover { width: 100%; border-radius: var(--radius); margin: 16px 0; aspect-ratio: 16/9; object-fit: cover; }
.article-lead { font-size: 1.2rem; color: var(--text-soft); line-height: 1.5; margin: 16px 0; }
.article-body { font-size: 1.08rem; line-height: 1.75; }
.article-body h2 { margin: 32px 0 12px; font-size: 1.5rem; }
.article-body h3 { margin: 24px 0 10px; font-size: 1.2rem; }
.article-body p { margin: 14px 0; }
.article-body ul, .article-body ol { margin: 14px 0; padding-left: 24px; }
.article-body li { margin: 6px 0; }
.article-body img { max-width: 100%; border-radius: 10px; margin: 16px 0; }
.article-body blockquote { border-left: 4px solid var(--brand); margin: 16px 0; padding: 4px 16px; color: var(--text-soft); font-style: italic; }
.article-body pre { background: var(--surface-2); padding: 14px; border-radius: 10px; overflow-x: auto; }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.tag-pill { background: var(--surface-2); color: var(--text-soft); padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.article-cta { text-align: center; margin: 32px 0; background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface)); }
.related { max-width: 1100px; margin: 0 auto; }

/* Badges en contextos en línea (tablas admin, sugerencias) deben ser estáticos */
.admin-table .badge, .suggestion .badge { position: static; display: inline-block; top: auto; right: auto; box-shadow: none; }

/* ============================================================
   Chat de invitado en la portada
   ============================================================ */
.hero-compact { padding: 40px 10px 10px; }
.hero-compact h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.home-chat { max-width: 820px; margin: 16px auto 36px; }
.home-chat .chat-messages { min-height: 360px; max-height: 66vh; }
.home-chat .chat-input textarea { font-size: 1.05rem; }
.guest-note { text-align: center; margin: 0; padding: 8px 14px 12px; }
.signup-card {
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface));
  border: 1px solid var(--brand); border-radius: 12px; padding: 14px 16px; margin: 4px 8px;
  text-align: center; animation: fadein .3s;
}
.signup-card p { color: var(--text-soft); margin: 6px 0 10px; font-size: .92rem; }

/* ============================================================
   Tarjetas de opciones seleccionables en el chat
   ============================================================ */
.option-card {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  background: var(--surface-2); border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: 10px 12px; margin: 8px 0; animation: fadein .25s;
}
.option-card.streaming { border-left-color: var(--accent); opacity: .85; }
.option-title { font-weight: 800; margin-bottom: 4px; }
.option-body { flex: 1; min-width: 0; }
.option-body p { margin: 4px 0; }
.option-body ul { margin: 4px 0; padding-left: 18px; }
/* Botón «Guardar» discreto (enlace con icono, no un botón grande) */
.opt-save {
  flex-shrink: 0; align-self: center; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-soft); font-size: .8rem; font-weight: 600; font-family: inherit;
  padding: 4px 6px; border-radius: 8px; transition: color .15s, background .15s;
}
.opt-save:hover { color: var(--brand-strong); background: var(--surface-2); }
.opt-save .opt-save-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: .8rem; line-height: 1;
}
.opt-save:disabled, .opt-save.saved { opacity: 1; color: var(--success); background: transparent; cursor: default; }
.opt-save.saved .opt-save-ico { border-color: var(--success); }
@media (max-width: 560px) {
  .option-card { flex-direction: column; }
  .opt-save { align-self: flex-end; }
}

/* Home logueado: el chat es solo inspiración, sin guardar opciones (no hay viaje asociado) */
.chat-box.member .opt-save { display: none; }
.home-trips { margin-top: 34px; }
.home-trips .page-head h2 { margin: 0; }
