:root {
  --blue: #1e5799;
  --blue-dark: #174a85;
  --sky: #bfe3fb;
  --bg: #e3e3e3;
  --card: #e8e8e8;
  --pink: #cc0a8c;
  --orange: #e2601f;
  --text: #2b2b2b;
  --muted: #7b7b7b;
  --line: rgba(0, 0, 0, .08);
  --shadow: 0 2px 6px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #0f2c4f; }
body { font-family: 'Montserrat', system-ui, -apple-system, sans-serif; color: var(--text); font-size: 15px; line-height: 1.4; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- Contenedor (solo celular) ---------- */
#app {
  position: relative; max-width: 480px; height: 100dvh; margin: 0 auto;
  background: var(--bg); overflow: hidden; display: flex; flex-direction: column;
}
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- Logo (placeholder; reemplazar por el SVG de Figma) ---------- */
.logo { display: inline-flex; align-items: center; gap: .08em; color: var(--sky); font-weight: 700; line-height: 1; }
.logo-lg { font-size: 54px; }
.logo-sm { font-size: 26px; }
.logo-img {
  display: block;
  width: 70px;
  height: auto;
  max-width: 100px;
  object-fit: contain;
}
/* Logo grande (login, recuperar contraseña): como en el diseño de Inicio */
.logo-lg .logo-img { width: 186px; max-width: 70vw; }
.logo-word { letter-spacing: -.02em; }
.logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.12em; height: 1.12em; border-radius: .28em; margin-left: .06em;
  background: var(--sky); color: var(--blue); font-size: 1em;
}

/* ---------- Autenticación ---------- */
.auth { background: var(--blue); color: #fff; }
.center-col { align-items: center; justify-content: center; padding: 24px; }
.auth-form { width: 100%; max-width: 330px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-top: 16px; }
.auth .logo { align-self: center; }
.pill {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px;
  background: #e3e3e3; border-radius: 999px; box-shadow: var(--shadow); color: var(--text);
}
.pill input, .pill select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 42px; font-size: 15px; }
.pill input::placeholder { color: #8b8b8b; }
.pill .toggle-eye { color: var(--blue); width: 22px; height: 22px; flex: none; }
.link { color: var(--sky); font-weight: 600; font-size: 13px; text-decoration: underline; text-align: center; padding: 4px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 24px;
  border-radius: 999px; font-weight: 700; letter-spacing: .01em; box-shadow: var(--shadow);
}
.btn[disabled] { opacity: .55; }
.btn-sky { background: var(--sky); color: var(--blue); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); box-shadow: none; border: 2px solid var(--blue); }
.btn-danger { background: transparent; color: #b3261e; box-shadow: none; }
.btn svg { width: 22px; height: 22px; }
.auth-title { font-size: 20px; font-weight: 700; text-align: center; }
.auth-sub { font-size: 13px; text-align: center; opacity: .9; }
.auth .scroll {
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px;
}
.auth .scroll .auth-form { margin-inline: auto; }
.field-label { font-size: 12px; font-weight: 600; margin: 4px 0 -4px 14px; opacity: .9; }
.setup { max-width: 320px; display: grid; gap: 12px; text-align: center; }
.setup code { background: rgba(255, 255, 255, .15); padding: 1px 6px; border-radius: 6px; }

/* Escáner de QR */
.qr-box { background: rgba(255, 255, 255, .1); border-radius: 22px; padding: 14px; display: grid; gap: 10px; }
.qr-video-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; }
.qr-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.qr-frame { position: absolute; inset: 18%; border: 3px solid var(--sky); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.qr-ok { display: flex; align-items: center; gap: 10px; background: #e3f6e8; color: #1c6b34; border-radius: 16px; padding: 12px 14px; font-weight: 600; }
.qr-ok svg { width: 22px; height: 22px; flex: none; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-btns .btn { padding: 0 10px; font-size: 13px; }

/* ---------- Barra inferior ---------- */

.nav {
  position: relative; flex: none; display: flex; align-items: center; justify-content: space-around;
  height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--blue); color: #fff;
}
.nav a { flex: 1; height: 60px; display: flex; align-items: center; justify-content: center; }

.nav a span {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s;
}

.nav a:not(.active) span {
  opacity: .95;
}

.nav a.active span {
  width: 66px;
  height: 66px;
  margin-top: -30px;
  padding: 14px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 7px var(--bg);
}

.nav-icon {
  display: block;
  width: 40px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

  


/* ---------- Barra superior ---------- */
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 52px 24px 28px; background: var(--blue); color: #fff; }
.topbar .icon-btn { width: 30px; height: 30px; color: #fff; }

/* ---------- Feed ---------- */
.stage { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px 24px; }
.card { position: relative; }
.card-media {
  position: relative; height: min(56dvh, 440px); border-radius: 10px; background: #263a52 center / cover no-repeat;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25); touch-action: pan-y; user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.card-media.noimg { background: linear-gradient(135deg, #1e5799, #6bb6ee); }
.card-tint { position: absolute; inset: 0; border-radius: 10px; opacity: 0; pointer-events: none; }
.owner-chip {
  position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 14px;
  padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(0, 0, 0, .35); backdrop-filter: blur(3px);
}
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #9aa6b4 center / cover no-repeat; border: 2px solid var(--blue); flex: none; display: inline-block; }
.avatar-empty { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; background: var(--blue-dark); }
.actions { display: flex; justify-content: center; gap: 82px; margin: -42px 0 10px; position: relative; z-index: 2; }
.actions.flat { margin: 22px 0 6px; }
.round {
  width: 82px; height: 82px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transition: transform .12s;
}
.round:active { transform: scale(.93); }
.round svg { width: 46px; height: 46px; }
.round.like { background: var(--pink); }
.round.nope { background: var(--orange); }
.card h2 { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip svg { width: 14px; height: 14px; }
.chip-blue { background: var(--blue); color: #fff; }
.chip-gray { background: #c9c9c9; color: #666; }
.chip-tag { background: #b9d0ea; color: var(--blue); font-size: 10.5px; padding: 3px 10px; }
.link-more { display: block; margin: 14px 0 6px; font-size: 15px; color: #555; text-decoration: underline; }
.info { background: var(--card); border-radius: 10px; padding: 12px 14px; margin-top: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.info h3 { display: flex; align-items: center; gap: 10px; color: var(--blue); font-size: 15.5px; font-weight: 600; margin-bottom: 6px; }
.info h3 svg { width: 22px; height: 22px; flex: none; }
.info p { padding-left: 32px; font-size: 14px; color: #444; white-space: pre-line; }
.info .chips { padding: 10px 0 2px 32px; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 32px; color: #555; }
.empty h2 { font-size: 20px; color: var(--text); }
.empty .btn { margin-top: 8px; }

/* ---------- Perfil ---------- */
/* ---------- Perfil ---------- */
.hero {
  position: relative;
  flex: none;
  height: 305px;
  background-image: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0)), url('../imagenes/Patron.png');
  background-position: top left;
  background-repeat: repeat;
  background-position: center top;
  background-size: 126% auto;
  border-radius: 0 0 76px 76px;

}

.hero .icon-btn { position: absolute; top: 18px; width: 34px; height: 34px; color: #fff; }
.hero .left { left: 20px; } .hero .right { right: 20px; }
.hero .mini-badge { position: absolute; top: 18px; left: 20px; }
.hero .logo-badge { font-size: 22px; }
.profile-avatar {
  position: absolute; left: 50%; bottom: -78px; transform: translateX(-50%);
  width: 172px; height: 172px; border-radius: 50%; border: 6px solid var(--blue); background: #9aa6b4 center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 64px; font-weight: 700;
}
.profile-body { padding: 96px 22px 30px; }
.profile-name { text-align: center; font-size: 24px; font-weight: 600; line-height: 1.15; }
.profile-career { text-align: center; color: var(--muted); font-size: 15px; }
.section-title { color: var(--blue); font-weight: 700; font-size: 15.5px; letter-spacing: .02em; text-transform: uppercase; margin: 26px 0 8px; }
.profile-body p.bio { font-size: 14.5px; margin-bottom: 10px; white-space: pre-line; }
.review { background: var(--card); border-radius: 10px; padding: 12px 14px; box-shadow: 0 2px 4px rgba(0, 0, 0, .22); margin-bottom: 10px; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.review-author { font-weight: 500; }
.stars { display: inline-flex; gap: 2px; color: var(--blue); vertical-align: middle; }
.stars svg { width: 15px; height: 15px; }
.review-meta { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.review p { font-size: 14.5px; color: #444; }
.center-link { display: block; text-align: center; color: var(--blue); font-weight: 600; font-size: 13px; text-decoration: underline; margin: 14px auto 0; }
.verified { margin-top: 190px; text-align: center; font-size: 11px; font-weight: 700; color: #666; letter-spacing: .03em; text-transform: uppercase; }
.verified.no { color: #a35b00; }
.my-projects { display: grid; gap: 10px; }
.mini-project { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 10px; padding: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, .18); }
.mini-thumb { width: 54px; height: 54px; border-radius: 8px; background: linear-gradient(135deg, #1e5799, #6bb6ee) center / cover; flex: none; }
.mini-project strong { display: block; font-size: 14.5px; }
.mini-project small { color: var(--muted); }




/* ---------- Formularios (app) ---------- */
.page-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--blue); color: #fff; }
.page-head h1 { font-size: 19px; font-weight: 700; }
.page-head .icon-btn { width: 28px; height: 28px; color: #fff; }
.form { padding: 18px 20px 28px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--blue); }
.field input, .field textarea, .field select {
  width: 100%; border: 0; outline: 0; background: #f2f2f2; border-radius: 12px; padding: 11px 14px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .15);
}
.field textarea { min-height: 92px; resize: vertical; }
.field small { color: var(--muted); font-size: 12px; }
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; border-radius: 14px;
  border: 2px dashed #9bb3cf; color: var(--blue); background: #eaf1f9 center / cover no-repeat; font-weight: 600; cursor: pointer; overflow: hidden;
}
.upload svg { width: 34px; height: 34px; }
.upload.has { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); border-style: solid; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { padding: 7px 14px; border-radius: 999px; background: #d1d1d1; font-weight: 600; font-size: 13px; color: #555; }
.cat.on { background: var(--blue); color: #fff; }

/* ---------- Chat (lista) ---------- */
.list { padding: 16px 20px; display: grid; gap: 10px; }
.list-item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, .18); }
.list-item .avatar { width: 46px; height: 46px; }
.list-item strong { display: block; font-size: 14.5px; }
.list-item small { color: var(--muted); font-size: 12.5px; }
.note { margin: 6px 20px 0; padding: 12px 14px; background: #d8e6f5; color: var(--blue-dark); border-radius: 12px; font-size: 13px; }

/* ---------- Hoja inferior y toast ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0); display: flex; align-items: flex-end; z-index: 30; transition: background .2s; }
.sheet-backdrop.open { background: rgba(0, 0, 0, .45); }
.sheet { width: 100%; max-height: 88%; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; display: grid; gap: 14px; }
.sheet-backdrop.open .sheet { transform: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #b5b5b5; margin: 0 auto 4px; }
.sheet h2 { font-size: 18px; color: var(--blue); }
.star-pick { display: flex; gap: 6px; justify-content: center; }
.star-pick button { width: 40px; height: 40px; color: var(--blue); }
.star-pick svg { width: 100%; height: 100%; }
#toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); max-width: min(92vw, 420px);
  background: #222; color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(30, 87, 153, .25); border-top-color: var(--blue); animation: spin .8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chat ---------- */
.icon-btn { display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 100%; height: 100%; }
.logo-dark { color: var(--blue); }
.logo-dark .logo-badge { background: var(--blue); color: var(--bg); }

.chat-top { flex: none; padding: 52px 24px 28px; }
.chat-top .logo-img {
  width: 70px;
  height: auto;
}
.search {
  flex: none; display: flex; align-items: center; gap: 10px; margin: 6px 20px 14px; height: 48px; padding: 0 18px;
  background: #e3e3e3; border-radius: 999px; box-shadow: var(--shadow); color: #666;
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search input::placeholder { color: #8b8b8b; }
.search input::-webkit-search-cancel-button { display: none; }
.search svg { width: 26px; height: 26px; flex: none; }
.chat-item { display: flex; align-items: center; gap: 24px; padding: 14px 24px; border-bottom: 1px solid #aebfd6; }
.chat-item:last-child { border-bottom: 0; }
.avatar-lg { width: 58px; height: 58px; border: 3px solid var(--blue); }
.chat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-info strong { color: var(--blue); font-size: 20px; font-weight: 600; line-height: 1.2; }
.chat-info span { color: #6e6e6e; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item time { align-self: center; margin-top: 6px; font-size: 10.5px; color: #777; flex: none; }

.chat-head {
  flex: none; display: flex; align-items: center; gap: 19px; padding: 40px 20px 22px; color: #fff;
  background: var(--blue); border-radius: 0 0 46px 46px; position: relative; z-index: 2;
}
.chat-head .icon-btn { width: 32px; height: 32px; color: #fff; flex: none; }
.chat-head .avatar { width: 46px; height: 46px; border-color: var(--sky); }
.head-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.head-user span { display: flex; flex-direction: column; min-width: 0; }
.head-user strong { font-size: 20px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-user small { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0px 18px 0px;
  background-image:  url('../imagenes/tramachat.svg');
  

}
.hint { margin: 30px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.stamp { text-align: center; font-size: 10.5px; color: #7a7a7a; margin: 14px 0 4px; }
.msg { display: flex; margin: 4px 0; }
.msg.mine { justify-content: flex-end; }
.bubble { max-width: 78%; padding: 12px 17px; border-radius: 18px; font-size: 15.5px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine .bubble { background: #b9cce3; }
.msg.theirs .bubble { background: #c9c9c9; }
.bubble.media { padding: 5px; white-space: normal; }
.bubble-img { display: block; max-width: 100%; max-height: 300px; min-height: 90px; border-radius: 14px; object-fit: cover; }
.bubble audio { display: block; width: 230px; max-width: 100%; height: 40px; }
.file-chip { display: flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 600; text-decoration: underline; word-break: break-all; }
.file-chip svg { width: 20px; height: 20px; flex: none; }
.composer { flex: none; padding: 6px 20px 14px; background: var(--bg); }
.media-row { display: flex; gap: 10px; margin-bottom: 10px; }
.mini-round {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 9px;
  background: #e3e3e3; color: var(--blue); box-shadow: var(--shadow); cursor: pointer;
}
.mini-round svg { width: 100%; height: 100%; }
.msg-input {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px;
  background: #e3e3e3; border-radius: 999px; box-shadow: var(--shadow);
}
.msg-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.msg-input input::placeholder { color: #8b8b8b; }
.msg-input .clip, .msg-input .send { width: 26px; height: 26px; color: #777; flex: none; cursor: pointer; }
.msg-input .send { color: #666; }
.msg-input svg { width: 100%; height: 100%; }
.closed { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 10px 0 6px; color: #555; font-weight: 500; }
.closed .btn { width: 100%; max-width: 280px; }
.rec-bar { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 10px 0 20px; background: #e3e3e3; border-radius: 999px; box-shadow: var(--shadow); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #d62828; animation: pulse 1s infinite; }
.rec-label { flex: 1; color: #777; font-size: 14px; }
.send-round { background: var(--blue); color: #fff; }
@keyframes pulse { 50% { opacity: .25; } }

.drawer-backdrop, .dialog-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0); transition: background .2s; }
.drawer-backdrop.open { background: rgba(0, 0, 0, .55); }
.dialog-backdrop { background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.drawer {
  position: absolute; top: 0; right: 0; width: 76%; padding: 38px 30px 32px; background: #e3e3e3;
  border-radius: 0 0 0 30px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); transform: translateY(-105%); transition: transform .22s ease-out;
}
.drawer-backdrop.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer-head h2 { color: var(--blue); font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.drawer-head .icon-btn { width: 28px; height: 28px; color: var(--blue); }
.drawer-item { display: block; width: 100%; text-align: left; padding: 13px 0; font-size: 16.5px; color: #666; }
.dialog { width: 100%; max-width: 310px; border-radius: 30px; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.dialog-head { padding: 26px 16px; text-align: center; color: #fff; font-size: 24px; font-weight: 700; letter-spacing: .01em; }
.dialog-head.red { background: #ab1c1c; }
.dialog-head.blue { background: var(--blue); }
.dialog-body { padding: 22px 22px 20px; text-align: center; font-size: 16px; line-height: 1.35; color: #333; display: grid; gap: 14px; }
.dialog-btns { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #d0d0d0; }
.dialog-btns button { padding: 16px 8px; font-weight: 700; font-size: 15px; color: #222; }
.dialog-btns button + button { border-left: 1px solid #d0d0d0; }

/*   la fila de íconos para que empieza oculta y colapsada */
.media-row {
  display: flex;
  gap: 10px;
  max-height: 0;         /* Se esconde reduciendo su altura a cero */
  opacity: 0;            /* Se vuelve completamente transparente */
  overflow: hidden;      /* Evita que los íconos se desborden mientras se oculta */
  margin-bottom: 0;      /* Quitamos el margen por defecto mientras esté cerrado */
  
  /* Animación suave para que se abra con efecto de cortina */
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out, margin 0.2s ease-out;
}

/*  Cuando el botón se presione y JavaScript le ponga la clase .open al contenedor... */
/* Cuando el composer está abierto, le damos espacio INTERNO abajo */
.composer.open .media-row {
  max-height: 70px;        
  opacity: 1;
  padding-bottom: 12px;      /*  Empuja los círculos hacia arriba alejándolos del borde blanco */
}


/*  Animación para que el alfiler de gancho rote levemente al abrirse */
.composer.open .clip {
  transform: rotate(45deg);
  color: var(--blue);    /* Cambia al color azul principal de tu app al estar activo */
}
.clip {
  transition: transform 0.2s ease, color 0.2s ease;
}


/* ---------- Chat: estado en línea ---------- */
.head-avatar { position: relative; display: inline-flex; flex: none; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 13px; height: 13px; border-radius: 50%; background: #3ddc84; border: 2px solid var(--blue); }
.head-user small b { font-weight: 700; color: #9ff0c3; }

/* ---------- Ajustes: panel lateral ---------- */
.side-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0); transition: background .22s; }
.side-backdrop.open { background: rgba(0, 0, 0, .55); }
.side {
  position: absolute; top: 0; right: 0; bottom: 0; width: 76%; display: flex; flex-direction: column;
  padding: calc(56px + env(safe-area-inset-top)) 30px calc(34px + env(safe-area-inset-bottom));
  background: #e3e3e3; border-radius: 0 0 0 34px; box-shadow: -4px 0 20px rgba(0, 0, 0, .3);
  transform: translateX(105%); transition: transform .24s ease-out;
}
.side-backdrop.open .side { transform: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side-head h2 { color: var(--blue); font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.side-gear {
  width: 32px; height: 32px; background: var(--blue);
  -webkit-mask: url('../imagenes/iconoajustes.svg') center / contain no-repeat;
  mask: url('../imagenes/iconoajustes.svg') center / contain no-repeat;
}
.side-user { margin: 12px 0 6px; color: #7b7b7b; font-size: 15.5px; overflow-wrap: anywhere; }
.side-list { display: flex; flex-direction: column; }
.side-list button { text-align: left; padding: 11px 0; color: #666; font-size: 17px; font-weight: 500; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.side-out { color: #666; font-size: 15px; font-weight: 500; }
.side-del { color: var(--blue); font-size: 16px; font-weight: 600; text-decoration: underline; }

/* ---------- Ajustes: subpantallas ---------- */
.sub { background: var(--bg); }
.sub-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(58px + env(safe-area-inset-top)) 28px 18px 24px; }
.sub-head h1 { color: var(--blue); font-size: 22px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
.sub-head .icon-btn { width: 34px; height: 34px; color: var(--blue); flex: none; }
.sub-body { padding: 4px 20px 40px; }
.panel { background: #e8e8e8; border-radius: 20px; box-shadow: 0 2px 8px rgba(0, 0, 0, .22); padding: 16px 16px 18px; display: grid; gap: 14px; }
.panel-title { color: #777; font-size: 17px; font-weight: 500; letter-spacing: .01em; text-transform: uppercase; }
.f { display: grid; gap: 7px; }
.f-label { color: #6a6a6a; font-size: 15.5px; font-weight: 500; padding-left: 4px; }
.f-label.blue { color: var(--blue); }
.f-box {
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 16px; border-radius: 13px;
  border: 1px solid #b4b4b4; background: #e6e6e6; font-size: 16.5px; color: #2b2b2b;
}
.f-box.readonly { background: #d9d9d9; border-color: #d0d0d0; }
.f-box.focus, .f-box:focus-within { border: 2px solid var(--blue); padding: 0 15px; }
.f-box input, .f-box select, .f-box textarea { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 16.5px; height: 52px; }
.f-box input::placeholder, .f-box textarea::placeholder { color: #9a9a9a; }
.f-box.area { align-items: flex-start; padding-top: 12px; }
.f-box.area textarea { height: 130px; resize: none; line-height: 1.4; }
.f-box .eye { width: 26px; height: 26px; color: #6b6b6b; flex: none; }
.f-hint { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #666; line-height: 1.35; margin-top: -4px; }
.f-hint svg { width: 22px; height: 22px; flex: none; color: #777; }
.f-note { font-size: 12.5px; color: #666; line-height: 1.4; padding: 0 4px; }
.f-note.small { font-size: 11.5px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px 6px 0; }
.btn-row.one { grid-template-columns: 1fr; }
.btn-soft { background: #e8e8e8; color: #777; }
.btn-red { background: #ab1c1c; color: #fff; }

.switch { position: relative; flex: none; width: 76px; height: 36px; border-radius: 18px; background: #bdbdbd; transition: background .18s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: #f3f3f3; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }
.switch.on { background: var(--blue); }
.switch.on span { transform: translateX(40px); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #e3e3e3; border-radius: 13px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); text-align: left; width: 100%; }
.row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row strong { color: #6a6a6a; font-size: 17px; font-weight: 500; line-height: 1.2; }
.row small { color: #707070; font-size: 11px; line-height: 1.3; }
.row-link { min-height: 56px; }
.row-link strong { flex: 1; }
.row-dots { color: #8a8a8a; font-size: 13px; letter-spacing: .08em; }
.row-link svg { width: 18px; height: 18px; color: #777; flex: none; }

.priv-avatar {
  position: relative; width: 164px; height: 164px; margin: 0 auto 8px; border-radius: 50%; border: 5px solid var(--blue);
  background: #9aa6b4 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 60px; font-weight: 700;
}
.priv-badge { position: absolute; right: -4px; bottom: 2px; width: 42px; height: 42px; padding: 9px; border-radius: 50%; background: var(--blue); color: #fff; border: 3px solid var(--bg); }
.priv-badge svg { width: 100%; height: 100%; }
.priv-state { text-align: center; color: var(--blue); font-size: 15.5px; font-weight: 500; margin-bottom: 14px; }
.priv-state.no { color: #a35b00; }

.radio { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 16px; margin-bottom: 12px; border-radius: 11px; border: 1px solid #b4b4b4; background: #e6e6e6; font-size: 17px; font-weight: 500; color: #2b2b2b; text-align: left; }
.radio .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #aaa; background: #eee; flex: none; }
.radio.sel { border-color: var(--blue); background: #d9d9d9; }
.radio.sel .dot { border-color: var(--blue); background: radial-gradient(circle, var(--blue) 0 9px, #eee 10px); }

.uni-box { background: #e3e3e3; border-radius: 18px; box-shadow: 0 1px 5px rgba(0, 0, 0, .22); padding: 10px 10px 4px; }
.uni-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 13px; border: 1px solid #b4b4b4; background: #e6e6e6; color: #666; }
.uni-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15.5px; }
.uni-search svg { width: 26px; height: 26px; flex: none; }
.uni-list { max-height: 196px; overflow-y: auto; overscroll-behavior: contain; margin-top: 4px; }
.uni { display: block; width: 100%; text-align: left; padding: 10px 8px; color: var(--blue); font-size: 13.5px; font-weight: 500; border-bottom: 1px solid #aebfd6; }
.uni:last-child { border-bottom: 0; }
.uni.sel { background: #d3dff0; border-radius: 8px; font-weight: 700; }
.uni-empty { padding: 18px 8px; text-align: center; color: #777; font-size: 13.5px; }
.uni-more { display: flex; justify-content: center; color: #6b6b6b; }
.uni-more svg { width: 20px; height: 20px; }

.edit-avatar {
  position: relative; display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; margin: 0 auto; border-radius: 50%;
  border: 4px solid var(--blue); background: #9aa6b4 center / cover no-repeat; color: #fff; font-size: 46px; font-weight: 700; cursor: pointer;
}
.edit-cam { position: absolute; right: -4px; bottom: -2px; width: 38px; height: 38px; padding: 8px; border-radius: 50%; background: var(--blue); color: #fff; border: 3px solid #e8e8e8; }
.edit-cam svg { width: 100%; height: 100%; }
.panel .qr-box { background: #d9d9d9; }

/* En pantallas grandes la app se ve como un celular centrado */
@media (min-width: 520px) {
  #app { height: min(100dvh, 920px); margin-block: max(0px, calc((100dvh - 920px) / 2)); border-radius: 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
}

/* ---------- Buscar proyectos (filtros) ---------- */
.search-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 52px 24px 22px; }
.search-top .logo-img { width: 70px; height: auto; }
.search-top .icon-btn { width: 30px; height: 30px; color: var(--blue); }
.search-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 22px; }

.fcard { position: relative; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; }
.fcard h3 { font-size: 15px; font-weight: 500; color: #a3a3a3; margin-bottom: 12px; }
.career-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; max-height: 122px; overflow: hidden; }
.career-grid.open { max-height: none; }
.career { height: 23px; padding: 0 6px; border-radius: 999px; background: #b9d0ea; color: var(--blue); font-size: 10.5px; font-weight: 500; line-height: 23px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.career:active { background: var(--blue); color: #fff; }
.more { display: flex; justify-content: flex-end; width: 100%; margin-top: 4px; color: #777; }
.more svg { width: 18px; height: 18px; transition: transform .2s; }
.more.open svg { transform: rotate(180deg); }

.date-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px; color: #a3a3a3; font-size: 15px; font-weight: 500; }
.date-card.set { color: var(--text); }
.date-card svg { width: 22px; height: 22px; color: #7a7a7a; }
.date-card input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.date-clear { position: relative; z-index: 1; width: 28px; height: 28px; padding: 4px; color: #666; }

.res-list { display: grid; gap: 12px; }
.res { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); text-align: left; }
.res-img { flex: none; width: 66px; height: 66px; border-radius: 10px; background: #c5d3e3 center / cover no-repeat; }
.res-info { min-width: 0; display: grid; gap: 5px; }
.res-info h3 { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-info small { color: var(--muted); font-size: 12px; }
.sheet-owner { color: var(--blue); font-size: 13px; font-weight: 600; }

.no-results { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 52px; text-align: center; color: #6f6f6f; }
.no-results svg { width: 62px; height: 62px; margin-bottom: 12px; }
.no-results h2 { font-size: 13px; font-weight: 700; }
.no-results p { font-size: 12px; line-height: 1.35; color: #7a7a7a; }

/* ---------- Crear (pantalla inicial) ---------- */
.create-top { flex: none; padding: 52px 24px 26px; }
.create-top .logo-img { width: 70px; height: auto; }
.create-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 26px; display: flex; flex-direction: column; gap: 18px; }
.create-btn { display: flex; align-items: center; gap: 16px; height: 62px; padding: 0 14px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .01em; box-shadow: var(--shadow); }
.create-btn svg { width: 36px; height: 36px; flex: none; color: #fff; }
.ccard { display: block; background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 14px; }
.ccard h3 { font-size: 14px; font-weight: 700; color: var(--blue); letter-spacing: .01em; }
.ccard p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.drafts-card { flex: 1; min-height: 280px; }
.drafts-head { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; color: var(--blue); }
.drafts-head svg { width: 36px; height: 36px; flex: none; }
.draft, .arow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 6px 14px 2px; border-bottom: 1px solid #7fa0c9; }
.draft:last-child, .arow:last-child { border-bottom: 0; }
.draft-open { flex: 1; min-width: 0; display: grid; gap: 4px; }
.draft-open strong { font-size: 15px; font-weight: 600; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-open small { font-size: 13px; color: var(--muted); }
.trash { flex: none; width: 28px; height: 28px; padding: 2px; color: #6b6b6b; }
.trash svg { width: 100%; height: 100%; }
.drafts-empty { padding: 18px 4px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Proyectos activos (perfil) ---------- */
.hero.compact { height: 156px; border-radius: 0 0 56px 56px; }
.hero-row { position: absolute; left: 22px; right: 70px; bottom: 22px; display: flex; align-items: center; gap: 14px; color: #fff; }
.avatar-hero { flex: none; width: 82px; height: 82px; border: 3px solid #fff; }
.hero-name { font-size: 25px; font-weight: 600; line-height: 1.15; }
.hero-career { font-size: 15px; color: #dbe8f7; }
.active-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 26px 22px 0; }
.active-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.active-head h1 { font-size: 20px; font-weight: 700; color: var(--blue); }
.active-head .icon-btn { width: 28px; height: 28px; color: var(--blue); }
.arow { margin-bottom: 10px; padding: 10px 12px 10px 20px; background: var(--card); border: 0; border-radius: 10px; box-shadow: var(--shadow); font-size: 15px; font-weight: 500; color: #555; }
.arow span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified.foot { margin-top: auto; padding: 24px 0 24px; font-size: 10px; }

/* ---------- Diálogos de aviso y confirmación ---------- */
.notice { width: 100%; max-width: 340px; background: #e8e8e8; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.notice-main { display: flex; align-items: center; gap: 16px; padding: 20px 22px 16px; }
.notice-ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700; }
.notice-ico svg { width: 28px; height: 28px; }
.notice.ok .notice-ico { background: #2fa72f; }
.notice.err .notice-ico { background: #a81c1c; }
.notice h2 { font-size: 22px; font-weight: 600; line-height: 1.15; }
.notice.ok h2 { color: #2f9e2f; }
.notice.err h2 { color: #a81c1c; }
.notice p { margin-top: 2px; font-size: 12.5px; color: #666; line-height: 1.3; }
.notice-ok { display: block; width: calc(100% - 36px); margin: 0 18px 4px; padding: 14px 0 15px; border-top: 1px solid #c8c8c8; text-align: center; font-size: 17px; font-weight: 600; color: #333; }

.pdialog { width: 100%; max-width: 304px; background: #fdfbfd; border-radius: 30px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); text-align: center; color: #333; }
.pdialog-title { padding: 20px 24px 16px; font-size: 21px; line-height: 1.2; }
.pdialog-body { display: grid; gap: 14px; padding: 18px 22px 20px; border-top: 1px solid #cfcfcf; font-size: 14px; line-height: 1.35; }
.pdialog-btns { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #cfcfcf; }
.pdialog-btns button { padding: 16px 8px; font-size: 19px; font-weight: 500; color: #333; }
.pdialog-btns button + button { border-left: 1px solid #cfcfcf; }
.hero.compact .icon-btn img { width: 100%; height: 100%; object-fit: contain; }
.avatar-hero.avatar-empty { font-size: 32px; }
