:root {
  /* Brand TAEO 2021 */
  --navy: #023668;
  --steel: #2771a4;
  --gold: #fdcc45;
  --denim: #235382;
  --sky: #4291b9;
  --cream: #ffe5a3;
  --peach: #f6b474;
  --orange: #f19123;

  --ink: #023668;
  --muted: #4d6480;
  --line: #d7e1ea;
  --soft: #eef3f8;
  --panel: rgba(255, 255, 255, 0.86);
  --page: #e9eef5;
  --accent: var(--steel);
  --accent-soft: #e8f2f9;
  --ok: #2771a4;
  --danger: #b42318;
  --mayluc: var(--steel);
  --henry: var(--orange);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(2, 54, 104, 0.05), 0 14px 36px rgba(2, 54, 104, 0.09);
  --font: "Hanken Grotesk", sans-serif;
  --bottom-nav: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --text: 1.125rem;
  --h1: clamp(2.45rem, 5.8vw, 3.35rem);
  --h2: clamp(1.5rem, 3vw, 1.9rem);
  --title: clamp(1.22rem, 2.5vw, 1.42rem);
}

* { box-sizing: border-box; }

.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

.btn .icon,
.filter .icon,
.owner-filter .icon,
.add-inline .icon,
.field-label .icon,
.who-label .icon,
.back-btn .icon,
.dialog-head h3 .icon,
.editor-label .icon,
.detail-files-head h4 .icon,
.count .icon,
.meta-chip .icon,
.paperclip .icon {
  margin-right: 0.35rem;
}

.filter,
.owner-filter,
.btn,
.add-inline,
.who-label,
.field-label,
.back-btn,
.dialog-head h3,
.editor-label,
.detail-files-head h4,
.count,
.meta-chip,
.paperclip,
.attach-btn {
  display: inline-flex;
  align-items: center;
}

.count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.drop-icon {
  display: grid;
  place-items: center;
  margin: 0 auto 0.45rem;
  color: var(--steel);
}

.drop-icon.icon,
.dropzone .icon {
  display: block;
  margin: 0 auto 0.45rem;
  color: var(--steel);
}

.empty-rich {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
}

.empty-rich .icon {
  color: var(--steel);
  opacity: 0.7;
}

.empty-rich p {
  margin: 0;
}

.status-chip.is-done {
  color: var(--steel);
  font-weight: 700;
}

.fab-plus .icon {
  margin: 0;
  color: var(--navy);
}

.person-check .icon {
  margin: 0;
  color: inherit;
}

.file-icon {
  color: var(--steel);
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  isolation: isolate;
  font-family: var(--font);
  font-size: var(--text);
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* Fondo TAEO: anillos, losas y blobs */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(160deg, #f7f9fc 0%, #e7eef6 42%, #f3efe4 100%);
}

.scene::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 12% 18%, rgba(253, 204, 69, 0.35), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(39, 113, 164, 0.28), transparent 30%),
    radial-gradient(circle at 78% 78%, rgba(241, 145, 35, 0.18), transparent 26%),
    radial-gradient(circle at 20% 85%, rgba(66, 145, 185, 0.2), transparent 24%);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(2, 54, 104, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2, 54, 104, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
}

.shape {
  position: absolute;
  display: block;
}

.ring {
  border-radius: 999px;
  border-style: solid;
  border-color: transparent;
}

.ring-a {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  top: -8%;
  right: -6%;
  border-width: 28px;
  border-color: rgba(2, 54, 104, 0.12);
  animation: drift 18s ease-in-out infinite;
}

.ring-b {
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  bottom: 8%;
  left: -4%;
  border-width: 22px;
  border-color: rgba(253, 204, 69, 0.42);
  animation: drift 22s ease-in-out infinite reverse;
}

.ring-c {
  width: min(18vw, 180px);
  height: min(18vw, 180px);
  top: 42%;
  right: 8%;
  border-width: 16px;
  border-color: rgba(39, 113, 164, 0.28);
  animation: drift 16s ease-in-out infinite;
}

.blob {
  border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%;
  filter: blur(2px);
}

.blob-a {
  width: min(36vw, 340px);
  height: min(28vw, 260px);
  top: 12%;
  left: 6%;
  background: linear-gradient(135deg, rgba(66, 145, 185, 0.28), rgba(255, 229, 163, 0.35));
  animation: morph 14s ease-in-out infinite;
}

.blob-b {
  width: min(30vw, 280px);
  height: min(24vw, 220px);
  bottom: 6%;
  right: 10%;
  background: linear-gradient(160deg, rgba(241, 145, 35, 0.22), rgba(253, 204, 69, 0.3));
  animation: morph 17s ease-in-out infinite reverse;
}

.slab {
  border-radius: 28px;
  transform: rotate(-18deg);
}

.slab-a {
  width: min(24vw, 220px);
  height: min(10vw, 88px);
  top: 22%;
  right: 18%;
  background: linear-gradient(90deg, rgba(2, 54, 104, 0.16), rgba(39, 113, 164, 0.22));
  animation: floaty 12s ease-in-out infinite;
}

.slab-b {
  width: min(18vw, 160px);
  height: min(8vw, 70px);
  bottom: 22%;
  left: 16%;
  background: linear-gradient(90deg, rgba(253, 204, 69, 0.5), rgba(246, 180, 116, 0.35));
  transform: rotate(14deg);
  animation: floaty 15s ease-in-out infinite reverse;
}

.dot {
  border-radius: 999px;
}

.dot-a {
  width: 18px;
  height: 18px;
  top: 30%;
  left: 42%;
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(253, 204, 69, 0.18);
  animation: pulse 4.5s ease-in-out infinite;
}

.dot-b {
  width: 12px;
  height: 12px;
  bottom: 28%;
  right: 30%;
  background: var(--steel);
  box-shadow: 0 0 0 7px rgba(39, 113, 164, 0.16);
  animation: pulse 5.5s ease-in-out infinite reverse;
}

.arc {
  width: min(50vw, 460px);
  height: min(50vw, 460px);
  bottom: -18%;
  right: -12%;
  border-radius: 999px;
  border: 3px dashed rgba(2, 54, 104, 0.14);
  animation: spin 48s linear infinite;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-18px, 22px); }
}

@keyframes morph {
  0%, 100% { border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; transform: translate(0, 0) rotate(0deg); }
  50% { border-radius: 58% 42% 45% 55% / 42% 58% 42% 58%; transform: translate(12px, -16px) rotate(6deg); }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-18deg); }
  50% { transform: translateY(-14px) rotate(-12deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.25); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 1.75rem) 2.5rem;
}

.page-home .shell {
  padding-bottom: calc(2.5rem + var(--bottom-nav) + var(--safe-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: block;
  box-shadow: var(--shadow);
}

.brand-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--navy);
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-size: var(--h1);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--navy);
}

.brand-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.filters {
  display: inline-flex;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.filter {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
}

.filter.active {
  background: var(--navy);
  color: #fff;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.who-label {
  white-space: nowrap;
}

.person-picker {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem 0.4rem 0.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.person-chip:hover {
  background: var(--soft);
  color: var(--navy);
}

.person-chip.active {
  background: var(--navy);
  color: #fff;
}

.person-chip.active .avatar.mayluc,
.person-chip.active .avatar.henry {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.person-chip-name {
  padding-right: 0.15rem;
}

input[type="text"],
input[type="password"],
textarea {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--steel);
  box-shadow: 0 0 0 4px rgba(39, 113, 164, 0.15);
}

.feed-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  font-weight: 700;
}

.owner-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.owner-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}

.owner-filter.active {
  border-color: var(--steel);
  background: var(--accent-soft);
  color: var(--navy);
}

.feed-panel {
  background: var(--panel);
  border: 1px solid rgba(215, 225, 234, 0.9);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  min-height: 60vh;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: rise 0.28s ease;
}

.card-owner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack .avatar + .avatar {
  margin-left: -0.45rem;
  box-shadow: 0 0 0 2px #fff;
}

.field-hint {
  margin: -0.15rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.detail-owners {
  margin: 0.35rem 0 1.1rem;
}

.person-cards.compact {
  margin-top: 0.35rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.avatar.mayluc { background: var(--steel); }
.avatar.henry { background: var(--orange); }

.session-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.35rem 0.3rem 0.45rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.session-name {
  font-weight: 750;
  color: var(--navy);
  font-size: 0.98rem;
}

/* Login */
.page-login .shell { display: none; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 1.5rem 1.35rem 1.4rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.login-brand h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.login-lead {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--navy);
}

.login-users {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.login-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.login-user:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(253, 204, 69, 0.25);
  transform: translateY(-1px);
}

.login-user-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.login-user-text strong {
  color: var(--navy);
  font-size: 1.08rem;
}

.login-user-text small {
  color: var(--muted);
}

.login-chevron {
  margin-left: auto;
  color: var(--steel);
}

.login-pass {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-pass[hidden],
#stepUsers[hidden] {
  display: none !important;
}

.login-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem 0.7rem 0.85rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef5fb 0%, #f7fafc 100%);
  border: 1px solid #d5e4f0;
}

.login-selected-text {
  flex: 1;
  min-width: 0;
}

.login-selected strong {
  display: block;
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.25;
}

.login-selected small {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-change-user {
  border: 0;
  background: transparent;
  color: var(--steel);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-change-user:hover {
  background: rgba(39, 113, 164, 0.1);
  color: var(--navy);
}

.login-pass-field {
  position: relative;
  display: flex;
  align-items: center;
}

.login-pass-field .login-pass-icon {
  position: absolute;
  left: 1rem;
  color: var(--steel);
  pointer-events: none;
  z-index: 1;
}

.login-pass-field input {
  width: 100%;
  border: 0;
  background: var(--soft);
  border-radius: 16px;
  padding: 1.05rem 3.1rem 1.05rem 2.85rem;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 550;
  color: var(--navy);
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.login-pass-field input::placeholder {
  color: #7a90a8;
  letter-spacing: 0;
  font-weight: 500;
}

.login-pass-field input:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--steel), 0 0 0 4px rgba(39, 113, 164, 0.14);
}

.login-pass-toggle {
  position: absolute;
  right: 0.45rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-pass-toggle:hover {
  background: rgba(2, 54, 104, 0.06);
  color: var(--navy);
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-weight: 650;
  font-size: 0.95rem;
}

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 0.95rem 1rem;
  border-radius: 14px;
}
.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 0.62rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 750;
  font-size: 1.08rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

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

.btn.primary {
  background: var(--gold);
  color: var(--navy);
}

.btn.primary:hover { background: #f5c233; }

.btn.ghost {
  background: #fff;
  color: var(--denim);
  border: 1.5px solid var(--line);
}

.btn.ghost:hover {
  border-color: var(--steel);
  color: var(--navy);
}

.btn.danger {
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn.small {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 10px;
}

.attach-btn {
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(253, 204, 69, 0.35);
}

.add-inline {
  margin-top: auto;
  border: 0;
  background: var(--gold);
  color: var(--navy);
  font: inherit;
  font-weight: 750;
  font-size: 1.08rem;
  text-align: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(253, 204, 69, 0.35);
}

.add-inline:hover {
  background: #f5c233;
  color: var(--navy);
  transform: translateY(-1px);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.empty {
  color: var(--muted);
  padding: 2rem 0.75rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 0.92rem;
}

.card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.05rem 1rem;
  box-shadow: 0 1px 2px rgba(2, 54, 104, 0.04);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease;
}

.card:hover {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(253, 204, 69, 0.28),
    0 10px 28px rgba(2, 54, 104, 0.08);
  transform: translateY(-2px);
  background: #fffef8;
}

.card.done { opacity: 0.62; }
.card.done .card-title {
  text-decoration: line-through;
  color: var(--muted);
}

.check {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 999px;
  border: 2px solid #b7c7d6;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.check:hover { border-color: var(--steel); }

.check.on {
  background: var(--steel);
  border-color: var(--steel);
  color: #fff;
}

.check svg {
  width: 12px;
  height: 12px;
}

.card-body { flex: 1; min-width: 0; }

.card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.card-title {
  margin: 0;
  font-size: var(--title);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--navy);
}

.card-notes {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.45;
}

.card-meta {
  margin: 0.55rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.paperclip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
}

.files {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  background: var(--soft);
  border-radius: 9px;
  font-size: 0.82rem;
}

.file-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.file-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.file-row a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
}

.file-row a:hover { color: var(--steel); }

.file-size {
  color: var(--muted);
  font-size: 0.72rem;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  width: min(480px, calc(100vw - 2rem));
  box-shadow: 0 24px 60px rgba(2, 54, 104, 0.18);
  background: #fff;
}

dialog::backdrop {
  background: rgba(2, 54, 104, 0.4);
}

#activityForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem 1.2rem 1.25rem;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-head h3 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-label {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.person-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.person-card:hover {
  border-color: var(--steel);
  transform: translateY(-1px);
}

.person-card.active {
  border-color: var(--steel);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(39, 113, 164, 0.14);
}

.person-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.person-card-text strong {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--navy);
  line-height: 1.2;
}

.person-card-text small {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

.person-check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: transparent;
  background: #fff;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
}

.person-card.active .person-check {
  color: #fff;
  background: var(--steel);
  border-color: var(--steel);
}

.dropzone {
  border: 1.5px dashed #b7c7d6 !important;
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
  background: var(--soft);
  cursor: pointer;
  position: relative;
  display: block;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-title {
  display: block;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.9rem;
}

.drop-sub {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Detalle */
.detail-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 0 2.5rem;
  min-height: 100vh;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem clamp(0.9rem, 3vw, 1.4rem);
  background: var(--navy);
  color: #fff;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  font-size: 1.12rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.back-btn img {
  display: block;
  filter: none;
}

.save-hint {
  margin-right: auto;
  font-size: 0.78rem;
  color: var(--cream);
  min-height: 1.1em;
}

.detail-bar-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.detail-bar .btn.ghost {
  background: var(--gold);
  color: var(--navy);
  border-color: transparent;
}

.detail-bar .btn.ghost:hover {
  background: #f5c233;
}

.detail-bar .btn.danger {
  background: #fff;
  color: var(--danger);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.detail-bar .btn.danger:hover {
  background: #fff5f5;
}

.detail-main {
  padding: 1rem clamp(0.9rem, 3vw, 1.4rem) 2rem;
}

.detail-title {
  width: 100%;
  border: 0;
  font: inherit;
  font-size: clamp(2.1rem, 5.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  padding: 0.35rem 0;
  color: var(--navy);
  background: transparent;
}

.detail-title:focus { outline: none; }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.editor-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.detail-files {
  margin-top: 1.35rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.detail-files-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
}

.detail-files-head h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--navy);
}


/* Mobile navigation */
.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  justify-content: center;
  padding: 0.55rem 0.85rem calc(0.55rem + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.bottom-item {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 1.2rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  border-radius: 10px;
}

.fab-plus {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

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

@media (prefers-reduced-motion: reduce) {
  .ring, .blob, .slab, .dot, .arc {
    animation: none !important;
  }
}

.page-detail {
  background: transparent;
}

.page-detail .detail-shell {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

@media (max-width: 860px) {
  .mobile-only { display: flex; }
  .desktop-only { display: none !important; }

  .bottom-nav { display: flex; }

  .feed-panel { min-height: auto; }

  .who {
    width: 100%;
    flex-wrap: wrap;
  }

  .person-picker {
    flex: 1;
  }

  .person-chip {
    flex: 1;
    justify-content: center;
  }

  .person-cards {
    grid-template-columns: 1fr;
  }

  .top-controls { width: 100%; }

  .filters {
    width: 100%;
    justify-content: space-between;
  }

  .filter {
    flex: 1;
    text-align: center;
  }

  .feed-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .owner-filters {
    width: 100%;
  }

  .owner-filter {
    flex: 1;
    justify-content: center;
  }

  .detail-bar { flex-wrap: wrap; }

  .detail-bar-actions { width: 100%; }

  .detail-bar-actions .btn { flex: 1; }

  .tox-tinymce {
    border-radius: 10px !important;
  }
}
