
/* X-style platform UI for Hodoyán */
.x-app { min-height: 100vh; background: var(--cream); padding-top: 72px; }
.x-shell { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr 300px; gap: 24px; padding: 0 24px 48px; }
.x-shell-no-right { grid-template-columns: 220px 1fr; max-width: 1280px; }
.x-side { position: sticky; top: 88px; height: fit-content; }
.x-main { min-width: 0; border-left: 1px solid rgba(45,74,53,0.12); border-right: 1px solid rgba(45,74,53,0.12); min-height: 70vh; }
.x-card { background: rgba(255,255,255,0.45); border: 1px solid rgba(45,74,53,0.12); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.x-nav a { display: block; padding: 12px 16px; border-radius: 999px; text-decoration: none; color: var(--charcoal); font-weight: 500; margin-bottom: 4px; }
.x-nav a:hover, .x-nav a.active { background: rgba(45,74,53,0.08); color: var(--forest); }
.x-head { padding: 16px 20px; border-bottom: 1px solid rgba(45,74,53,0.12); position: sticky; top: 72px; background: rgba(245,240,232,0.95); backdrop-filter: blur(8px); z-index: 10; }
.x-head h1 { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; color: var(--forest); }
.x-compose { padding: 16px 20px; border-bottom: 1px solid rgba(45,74,53,0.12); }
.x-compose textarea { width: 100%; min-height: 90px; border: 1px solid rgba(45,74,53,0.15); border-radius: 12px; padding: 12px; font: inherit; resize: vertical; background: #fff; }
.x-compose-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; flex-wrap: wrap; }
.x-compose-tools { display: flex; gap: 4px; align-items: center; }
.x-compose-tool { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; cursor: pointer; color: #1d9bf0; font-size: 1.15rem; }
.x-compose-tool:hover { background: rgba(29,155,240,0.1); }
.x-compose-remove-media { border: none; background: rgba(179,51,51,0.12); color: #b33; width: 32px; height: 32px; border-radius: 999px; cursor: pointer; font-size: 1.2rem; line-height: 1; }
.x-compose-preview { margin-top: 12px; border-radius: 16px; overflow: hidden; border: 1px solid rgba(45,74,53,0.12); background: rgba(0,0,0,0.04); }
.x-compose-preview img, .x-compose-preview video { width: 100%; max-height: min(320px, 55vh); height: auto; object-fit: contain; object-position: center; display: block; }
.x-compose-preview audio { width: 100%; display: block; padding: 12px; box-sizing: border-box; }
.x-compose-status { margin-top: 8px; font-size: 0.82rem; min-height: 1.2em; }
.x-compose-status.is-error { color: #b33; }
.x-compose-status.is-ok { color: #1d7a46; }
.x-compose-hint { font-size: 0.78rem; margin: 8px 0 0; opacity: 0.55; }
.x-upload-progress-wrap { margin-top: 12px; }
.x-upload-progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.82rem; color: rgba(44,44,44,0.65); margin-bottom: 6px; }
.x-upload-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-upload-percent { font-variant-numeric: tabular-nums; color: #1d9bf0; font-weight: 600; }
.x-upload-progress { height: 4px; background: rgba(29,155,240,0.15); border-radius: 999px; overflow: hidden; }
.x-upload-progress-bar { height: 100%; width: 0%; background: #1d9bf0; border-radius: 999px; transition: width 0.12s linear; }
.x-post { padding: 16px 20px; border-bottom: 1px solid rgba(45,74,53,0.08); transition: background 0.15s; }
.x-post:hover { background: rgba(255,255,255,0.35); }
.x-post-inner { display: flex; gap: 12px; }
.x-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: center center; flex-shrink: 0; }
.x-avatar-fallback { display:flex; align-items:center; justify-content:center; background: var(--forest); color: var(--cream); font-weight: 600; }
.x-post-main { min-width: 0; flex: 1; }
.x-post-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.x-post-name { font-weight: 600; color: var(--charcoal); }
.x-post-handle, .x-post-time { color: rgba(44,44,44,0.55); font-size: 0.85rem; }
.x-post-body { line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.x-post-media {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
  max-width: 100%;
}
.x-post-media img,
.x-post-media video {
  display: block;
  width: 100%;
  max-height: min(512px, 68vh);
  height: auto;
  object-fit: contain;
  object-position: center;
  background: rgba(0,0,0,0.04);
}
.x-post-media--video video {
  max-height: min(480px, 60vh);
  background: #0f1419;
}
.x-post-media audio { width: 100%; margin: 0; display: block; padding: 12px; box-sizing: border-box; background: rgba(255,255,255,0.5); }
.x-post-footer { margin-top: 10px; }
.x-post-views { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; color: rgba(44,44,44,0.5); }
.x-post-views-icon { opacity: 0.75; flex-shrink: 0; }
.x-post-views-count { font-variant-numeric: tabular-nums; font-weight: 600; color: rgba(44,44,44,0.62); }
.x-post-delete { margin-left: auto; border: none; background: transparent; color: #b33; cursor: pointer; font-size: 1.2rem; }
.x-post-repost-label { padding: 8px 20px 0 68px; color: rgba(44,44,44,0.55); font-size: 0.82rem; }
.x-post-actions { display: flex; align-items: center; gap: 20px; margin-top: 10px; max-width: 420px; }
.x-post-action { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: rgba(44,44,44,0.55); cursor: pointer; font: inherit; font-size: 0.85rem; padding: 4px 8px; border-radius: 999px; }
.x-post-action:hover:not(:disabled) { background: rgba(29,155,240,0.1); color: #1d9bf0; }
.x-post-action--like.is-liked { color: #f91880; }
.x-post-action:disabled { opacity: 0.4; cursor: default; }
.x-post-views-inline { margin-left: auto; font-size: 0.82rem; color: rgba(44,44,44,0.5); }

/* Expandable publication cards */
.x-post-expandable { padding: 0; border-bottom: 1px solid rgba(45,74,53,0.08); }
.x-post-summary {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: rgba(255,255,255,0.35);
  padding: 16px 20px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s;
}
.x-post-summary:hover { background: rgba(255,255,255,0.55); }
.x-post-summary-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.x-post-summary-time { font-size: 0.82rem; color: rgba(44,44,44,0.55); font-family: 'DM Mono', monospace; }
.x-post-media-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(45,74,53,0.1);
  color: var(--forest);
}
.x-post-summary-text {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--charcoal);
}
.x-post-summary-placeholder { opacity: 0.65; font-style: italic; }
.x-post-summary-thumb {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 280px;
  border: 1px solid rgba(45,74,53,0.12);
  background: rgba(0,0,0,0.03);
}
.x-post-summary-thumb-img { display: block; width: 100%; height: auto; max-height: 180px; object-fit: contain; object-position: center; }
.x-post-summary-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--forest);
}
.x-post-expandable.is-expanded .x-post-summary { border-bottom: 1px solid rgba(45,74,53,0.08); }
.x-post-detail { padding: 0; }
.x-post-detail .x-post-inner { padding: 12px 20px 16px; }
.x-profile-post-list { display: grid; gap: 0; }
.x-profile-posts .x-post-expandable { border: 1px solid rgba(45,74,53,0.1); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.x-profile-posts .x-post-expandable:last-child { margin-bottom: 0; }
.x-verified { width: 18px; height: 18px; vertical-align: -3px; margin-left: 2px; }
.x-doctor-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(45,74,53,0.08); }
.x-doctor-row:last-child { border-bottom: none; }
.x-btn { border: none; border-radius: 999px; padding: 8px 18px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.x-btn-primary { background: var(--forest); color: var(--cream); }
.x-btn-ghost { background: transparent; border: 1px solid rgba(45,74,53,0.25); color: var(--forest); }
.x-btn-followed { background: rgba(45,74,53,0.12); color: var(--forest); }
.x-readonly-note { padding: 12px 20px; background: rgba(29,155,240,0.08); border-bottom: 1px solid rgba(29,155,240,0.15); font-size: 0.85rem; }
.x-stealth-feed-note { background: rgba(201,168,76,0.12); border-bottom-color: rgba(201,168,76,0.25); }
.x-feed-flash { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; }
.x-feed-flash.is-ok { background: rgba(29,155,240,0.1); color: #1d7a46; }
.x-post-stealth-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(201,168,76,0.2);
  color: #6b5520;
  vertical-align: middle;
}
.x-dm-layout { display: grid; grid-template-columns: 280px 1fr; min-height: 60vh; }
.x-thread-list { border-right: 1px solid rgba(45,74,53,0.12); overflow: auto; }
.x-thread-item { display: block; padding: 14px 16px; border-bottom: 1px solid rgba(45,74,53,0.08); text-decoration: none; color: inherit; }
.x-thread-item.active, .x-thread-item:hover { background: rgba(45,74,53,0.06); }
.x-thread-item strong { display: flex; align-items: center; gap: 4px; }
.x-chat { display: flex; flex-direction: column; height: 60vh; }
.x-chat-msgs { flex: 1; overflow: auto; padding: 16px; }
.x-msg {
  max-width: 75%;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'DM Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  font-size: 0.95rem;
}
.x-msg.me { margin-left: auto; background: var(--forest); color: var(--cream); }
.x-msg.them { background: rgba(45,74,53,0.1); }
.x-chat-form { padding: 12px 16px; border-top: 1px solid rgba(45,74,53,0.12); position: relative; }
.x-chat-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  position: relative;
}
.x-chat-compose textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 14px;
  border-radius: 22px;
  border: 1px solid rgba(45,74,53,0.2);
  font: inherit;
  resize: none;
  line-height: 1.4;
  background: #fff;
  font-family: 'DM Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.x-emoji-toggle {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.x-emoji-toggle:hover,
.x-emoji-toggle[aria-expanded="true"] {
  background: rgba(45,74,53,0.08);
}
.x-emoji-picker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: #fff;
  border: 1px solid rgba(45,74,53,0.12);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14);
  overflow: hidden;
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: 320px;
}
.x-emoji-picker[hidden] { display: none !important; }
.x-emoji-picker-head {
  padding: 10px 12px 0;
  border-bottom: 1px solid rgba(45,74,53,0.08);
}
.x-emoji-search {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(45,74,53,0.15);
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  margin-bottom: 10px;
  background: rgba(245,240,232,0.6);
}
.x-emoji-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
}
.x-emoji-btn {
  border: none;
  background: transparent;
  font-size: 1.45rem;
  line-height: 1;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.x-emoji-btn:hover { background: rgba(45,74,53,0.08); }
.x-emoji-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 12px;
  opacity: 0.55;
  font-size: 0.88rem;
}
.x-emoji-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  border-top: 1px solid rgba(45,74,53,0.08);
  background: rgba(245,240,232,0.5);
  overflow-x: auto;
}
.x-emoji-tab {
  border: none;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0.55;
  flex-shrink: 0;
}
.x-emoji-tab:hover { opacity: 0.85; background: rgba(45,74,53,0.06); }
.x-emoji-tab.active { opacity: 1; background: rgba(45,74,53,0.1); }
.x-chat-form input { flex: 1; padding: 12px 14px; border-radius: 999px; border: 1px solid rgba(45,74,53,0.2); }
.x-monica-box { padding: 20px; }
.x-monica-input { display: flex; gap: 8px; margin-top: 12px; }
.x-monica-input input { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(45,74,53,0.2); }
.x-monica-answer { margin-top: 16px; padding: 16px; background: rgba(45,74,53,0.06); border-radius: 12px; white-space: pre-wrap; }
.x-store-buy { display: inline-block; margin-top: 8px; }

/* Doctor portfolio profile */
.x-profile { background: rgba(255,255,255,0.35); }
.x-profile-cover { height: 180px; background-size: cover; background-position: center; border-bottom: 1px solid rgba(45,74,53,0.1); }
.x-profile-cover--default { background: linear-gradient(135deg, var(--forest) 0%, #3d6248 45%, rgba(201,168,76,0.45) 100%); }
.x-profile-head {
  position: relative;
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(45,74,53,0.1);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  grid-template-areas:
    "avatar actions"
    "meta meta";
  column-gap: 16px;
  row-gap: 16px;
  align-items: start;
}
.x-profile-avatar-wrap {
  grid-area: avatar;
  margin-top: -56px;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
  width: fit-content;
}
.x-profile-avatar { width: 112px; height: 112px; border-radius: 50%; border: 4px solid var(--cream); box-shadow: 0 4px 20px rgba(45,74,53,0.15); object-fit: cover; object-position: center center; display: block; }
.avatar-img { object-fit: cover; object-position: center center; }
.x-profile-avatar.x-avatar-fallback { font-size: 2.2rem; }
.x-profile-actions {
  grid-area: actions;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  align-self: start;
  justify-self: end;
  max-width: 100%;
  margin: 0;
  padding-top: 8px;
  position: relative;
  z-index: 1;
}
.x-profile-meta {
  grid-area: meta;
  min-width: 0;
  clear: both;
}
.x-profile-actions .x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.x-profile-name { font-family: 'Cormorant Garamond', serif; font-size: 1.75rem; color: var(--forest); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.x-profile-handle { color: rgba(44,44,44,0.55); font-size: 0.88rem; margin-top: 2px; }
.x-profile-headline { font-size: 0.95rem; margin-top: 8px; color: var(--charcoal); font-weight: 500; }
.x-profile-bio { margin-top: 10px; line-height: 1.55; opacity: 0.85; max-width: 640px; }
.x-profile-stats { display: flex; gap: 18px; margin-top: 12px; font-size: 0.88rem; }
.x-profile-stats strong { color: var(--forest); }
.x-profile-details { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; font-size: 0.85rem; opacity: 0.8; }
.x-profile-link { color: var(--forest); text-decoration: none; }
.x-profile-link:hover { text-decoration: underline; }
.x-profile-hint { font-size: 0.78rem; opacity: 0.55; align-self: center; }
.x-profile-body { padding: 8px 0 24px; }
.x-profile-section { padding: 20px 24px; border-bottom: 1px solid rgba(45,74,53,0.08); }
.x-profile-section h2 { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; color: var(--forest); margin-bottom: 12px; }
.x-profile-text { line-height: 1.65; opacity: 0.88; max-width: 720px; white-space: pre-line; }
.x-profile-list { list-style: none; display: grid; gap: 10px; }
.x-profile-list li { padding: 12px 14px; background: rgba(255,255,255,0.45); border: 1px solid rgba(45,74,53,0.1); border-radius: 10px; line-height: 1.45; }
.x-profile-year { display: inline-block; margin-left: 6px; font-size: 0.78rem; opacity: 0.55; font-family: 'DM Mono', monospace; }
.x-profile-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.x-profile-gallery-item { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 1; border: 1px solid rgba(45,74,53,0.12); }
.x-profile-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.x-profile-gallery-item:hover img { transform: scale(1.04); }
.x-profile-empty { opacity: 0.55; font-size: 0.9rem; padding: 8px 0; }
.x-profile-posts .x-post { border-bottom-color: rgba(45,74,53,0.06); }
.x-doctor-avatar-link { text-decoration: none; flex-shrink: 0; }
.x-post-avatar-link, .x-post-name-link { text-decoration: none; color: inherit; }
.x-post-handle-link { color: rgba(44,44,44,0.55); text-decoration: none; }
.x-post-handle-link:hover { color: var(--forest); text-decoration: underline; }
.x-profile-media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 12px; }
.x-profile-media-item { display: flex; flex-direction: column; gap: 6px; cursor: pointer; font-size: 0.72rem; opacity: 0.85; }
.x-profile-media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 2px solid transparent; }
.x-profile-media-item input:checked + img { border-color: var(--forest); }
.x-profile-editor-row { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed rgba(45,74,53,0.12); }

@media (max-width: 960px) {
  .x-shell { grid-template-columns: 1fr; }
  .x-side-right { display: none; }
  .x-dm-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .x-profile-head {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "actions"
      "meta";
    row-gap: 12px;
  }
  .x-profile-actions {
    justify-content: flex-start;
    justify-self: stretch;
    padding-top: 0;
  }
  .x-profile-actions .x-btn {
    white-space: normal;
    text-align: center;
  }
}
