:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --border: #e7e7e7;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.topbar {
  min-height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
}

nav a:hover { text-decoration: underline; }

.commercial-empty {
  min-height: calc(100vh - 72px);
}

@media (max-width: 720px) {
  .topbar {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  nav {
    flex-wrap: wrap;
    gap: 14px;
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: 18px;
}

.auth-card h1 { margin-top: 0; }

.auth-card label {
  display: block;
  margin-top: 16px;
  font-size: 14px;
}

.auth-card input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.auth-card button {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.error {
  padding: 10px;
  border-radius: 10px;
  background: #fff1f1;
  color: #8a0000;
}

.private-body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  border-right: 1px solid var(--border);
  padding: 22px;
}

.side-title {
  font-weight: 700;
  margin-bottom: 24px;
}

.sidebar a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
}

.sidebar a.active,
.sidebar a:hover {
  background: #f3f3f3;
}

.side-group {
  margin: 22px 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.private-main {
  flex: 1;
}

.private-top {
  height: 72px;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.private-top span {
  margin-left: 16px;
  color: var(--muted);
}

.private-top a {
  margin-left: 18px;
  color: var(--fg);
}

.private-content {
  min-height: calc(100vh - 72px);
}

@media (max-width: 800px) {
  .private-body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

.private-content-pad {
  padding: 32px;
}

.private-content-pad h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.private-content-pad p {
  color: var(--muted);
}

.public-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 18px;
  cursor: pointer;
}

.public-footer {
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  color: var(--muted);
  font-size: 13px;
}

.auth-logo {
  display: block;
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 999px;
  margin: 0 auto 18px;
  border: 1px solid var(--border);
}

.sidebar-toggle {
  width: 42px;
  height: 38px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
}

.sidebar-collapsed .sidebar {
  width: 74px;
  padding: 18px 10px;
}

.sidebar-collapsed .side-title,
.sidebar-collapsed .side-group {
  display: none;
}

.sidebar-collapsed .sidebar a {
  font-size: 0;
  text-align: center;
}

.sidebar-collapsed .sidebar a::first-letter {
  font-size: 16px;
}

@media (max-width: 720px) {
  .mobile-menu-btn {
    display: block;
    position: absolute;
    right: 18px;
    top: 17px;
  }

  .topbar {
    position: relative;
  }

  .topbar nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 10px;
  }

  .topbar nav.open {
    display: flex;
  }

  .auth-page {
    align-items: start;
    padding-top: 32px;
  }

  .auth-card {
    max-width: 100%;
  }
}

@media (max-width: 800px) {
  .sidebar {
    width: 100%;
  }

  .sidebar-collapsed .sidebar {
    width: 100%;
  }

  .private-top {
    height: auto;
    min-height: 72px;
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }
}

.mobile-private-header {
  display: none;
}

.sidebar .ico {
  display: inline-flex;
  width: 24px;
  justify-content: center;
  margin-right: 8px;
  color: var(--muted);
}

.sidebar-collapsed .sidebar {
  width: 82px;
}

.sidebar-collapsed .sidebar .label,
.sidebar-collapsed .side-title,
.sidebar-collapsed .side-group {
  display: none;
}

.sidebar-collapsed .sidebar a {
  font-size: 16px;
  text-align: center;
  padding: 12px 8px;
}

.sidebar-collapsed .sidebar .ico {
  margin-right: 0;
}

.wiki-doc {
  max-width: 980px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  background: #fafafa;
}

.wiki-doc pre {
  white-space: pre-wrap;
  line-height: 1.55;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

@media (max-width: 800px) {
  .private-body {
    display: block;
  }

  .mobile-private-header {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
  }

  .desktop-only {
    display: none;
  }

  .sidebar {
    display: none;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-collapsed .sidebar {
    display: block;
    width: 100%;
  }

  .sidebar-collapsed .sidebar .label,
  .sidebar-collapsed .side-title,
  .sidebar-collapsed .side-group {
    display: inline;
  }

  .sidebar-collapsed .sidebar a {
    font-size: 15px;
    text-align: left;
    padding: 10px 12px;
  }

  .sidebar-collapsed .sidebar .ico {
    margin-right: 8px;
  }

  .private-main {
    width: 100%;
  }

  .private-top {
    display: none;
  }

  .private-content-pad {
    padding: 26px 20px;
  }
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1100px;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  background: #fff;
}

.info-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.info-card dl {
  margin: 0;
}

.info-card dt {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.info-card dd {
  margin: 4px 0 0;
  font-weight: 500;
}

.soft-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
}

.soft-button:hover {
  background: #f3f3f3;
}

.danger-card {
  border-color: #f0caca;
}

.soft-button.danger {
  border-color: #d9a5a5;
}

@media (max-width: 800px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

.form-card {
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  background: #fff;
}

.form-card label {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.form-card input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.form-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
}

.form-actions button {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.form-actions a {
  color: var(--fg);
}

.password-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.password-wrap input {
  flex: 1;
}

.password-toggle {
  margin-top: 6px;
  min-width: 78px;
  padding: 11px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
  cursor: pointer;
}

.password-toggle:hover {
  background: #f3f3f3;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
  object-fit: cover;
}

.avatar-form input {
  margin-top: 10px;
}

.avatar-form button {
  margin-top: 10px;
}

.top-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.account-avatar-block {
  margin-bottom: 16px;
}

.account-avatar {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #f6f6f6;
}

.muted-text {
  color: var(--muted);
  font-size: 14px;
}

.avatar-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.avatar-form input {
  max-width: 100%;
}

.avatar-form button {
  width: fit-content;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.form-card textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  font-family: inherit;
}

.danger-button {
  background: #8a0000 !important;
}

.goodbye-page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px;
}

.goodbye-card {
  width: 100%;
  max-width: 620px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px;
  text-align: center;
}

.goodbye-card h1 {
  margin-top: 0;
}

/* Grid profesional reutilizable */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.primary-button,
.grid-footer button,
.modal-actions button {
  border: 1px solid var(--border);
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.primary-button:disabled,
.modal-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.grid-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.grid-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.grid-toolbar label {
  width: min(520px, 100%);
  font-size: 13px;
  color: var(--muted);
}

.grid-toolbar input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.table-wrap {
  overflow-x: auto;
}

.data-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-grid th,
.data-grid td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-grid th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.data-grid th[data-sort]::after {
  content: " ↕";
  color: var(--muted);
  font-size: 12px;
}

.data-grid tr:hover {
  background: #f8f8f8;
}

.data-grid tr.selected {
  background: #f1f1f1;
}

.select-col {
  width: 42px;
  text-align: center !important;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  border: 1px solid var(--border);
}

.status-pill.ok {
  background: #f2fff5;
}

.status-pill.warn {
  background: #fff8e8;
}

.grid-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 16px;
}

.grid-footer button {
  background: #fff;
  color: #111;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
}

.modal-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 0;
  margin: 16px 0 0;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-grid dt {
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-head,
  .grid-toolbar {
    flex-direction: column;
  }

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

  .detail-grid dt {
    padding-bottom: 2px;
  }

  .detail-grid dd {
    padding-top: 0;
  }
}

.grid-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.grid-toolbar {
  padding: 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
}

.grid-toolbar input {
  padding: 8px;
  width: 260px;
}

.data-grid {
  width: 100%;
  border-collapse: collapse;
}

.data-grid th {
  background: #fafafa;
  cursor: pointer;
  font-weight: 600;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.data-grid td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.grid-row:hover {
  background: #f5f5f5;
}

.select-cell {
  cursor: pointer;
  font-size: 18px;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 400px;
}

.grid-toolbar-vertical {
  align-items: stretch;
  flex-direction: column;
}

.grid-toolbar-vertical input {
  width: 100%;
}

.grid-toolbar-vertical .grid-count {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.row-action {
  width: 30px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.row-action:hover {
  background: #f2f2f2;
}

.modal-backdrop[hidden],
.modal[hidden] {
  display: none !important;
}

/* Ajuste menú lateral */
.sidebar {
  flex: 0 0 240px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  white-space: nowrap;
}

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

.sidebar .ico {
  flex: 0 0 24px;
}

.private-main {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.data-grid td,
.data-grid th {
  vertical-align: middle;
}

/* Ajuste menú lateral */
.sidebar {
  flex: 0 0 240px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  white-space: nowrap;
}

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

.sidebar .ico {
  flex: 0 0 24px;
}

.private-main {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.data-grid td,
.data-grid th {
  vertical-align: middle;
}

/* Campos largos tipo motivo, observaciones o descripción */
.note-block {
  margin-top: 18px;
}

.note-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.note-box {
  min-height: 92px;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  padding: 12px;
  line-height: 1.45;
  color: #222;
}

.detail-grid-hidden {
  display: none;
}

.modal-card {
  overflow-x: hidden;
}

.note-block-full {
  display: block;
  width: 100%;
  clear: both;
}

.note-block-full .note-box {
  width: 100%;
  min-height: 110px;
}

.modal-form {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.form-grid input,
.form-grid select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
}

.form-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.form-wide {
  grid-column: 1 / -1;
}

.modal-actions-right {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.modal-form {
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.form-grid input,
.form-grid select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
}

.form-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.form-wide {
  grid-column: 1 / -1;
}

.modal-actions-right {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.flash-area {
  margin: 0 0 16px;
}

.flash {
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 14px;
}

.flash.success {
  background: #f2fff5;
  border: 1px solid #cdebd4;
  color: #1d5f2c;
}

.flash.error {
  background: #fff1f1;
  border: 1px solid #efcaca;
  color: #8a0000;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.danger-outline-button {
  border: 1px solid #8a0000 !important;
  background: #fff !important;
  color: #8a0000 !important;
}

.password-wrap {
  display: flex;
  gap: 8px;
}

.password-wrap input {
  flex: 1;
}

.password-wrap button {
  margin-top: 6px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
}

.role-inline-form select {
  min-width: 130px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.modal-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.note-box-wide {
  width: 100%;
  min-height: 110px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.site-form-card {
  max-width: 720px;
}

.site-form label {
  display: block;
  margin-bottom: 18px;
}

.site-form input[type="text"],
.site-form input[type="url"] {
  width: 100%;
}

.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 18px 0;
}

.toggle-row input {
  width: auto !important;
  margin: 0;
}

.auth-footnote {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.public-auth-page {
  flex: 1;
  min-height: calc(100vh - 72px - 56px);
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.public-auth-page .auth-card {
  margin: 0 auto;
}

.public-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}

.db-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.db-sidebar {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.db-sidebar h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.db-sidebar a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid transparent;
}

.db-sidebar a:hover,
.db-sidebar a.active {
  background: #f6f6f6;
  border-color: var(--border);
}

.db-sidebar small {
  color: var(--muted);
  white-space: nowrap;
}

.db-panel {
  min-width: 0;
}

.db-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.db-panel-head h2 {
  margin: 0 0 6px;
}

.db-panel-head p {
  margin: 0;
  color: var(--muted);
}

.db-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.db-search input {
  min-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.db-search button,
.pager a {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.db-search a {
  color: var(--fg);
}

.db-grid {
  min-width: 900px;
}

.db-grid th a {
  color: var(--fg);
  text-decoration: none;
}

.db-grid td {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.pager span {
  padding: 10px 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.empty-state {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  background: #fff;
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .db-layout {
    grid-template-columns: 1fr;
  }

  .db-panel-head {
    flex-direction: column;
  }

  .db-search {
    width: 100%;
  }

  .db-search input {
    min-width: 0;
    width: 100%;
  }
}

.db-table-select {
  max-width: 520px;
  margin-bottom: 24px;
}

.db-table-select label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.db-table-select select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.db-edit-card {
  max-width: 860px;
}

.db-edit-card label {
  display: block;
  margin-bottom: 16px;
}

.db-edit-card input,
.db-edit-card select,
.db-edit-card textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}

.db-edit-card textarea {
  resize: vertical;
}

.db-grid td {
  vertical-align: top;
}

.danger-outline-button {
  color: #b00000;
  border: 1px solid #b00000;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.danger-outline-button:hover {
  background: #fff5f5;
}

/* Sidebar moderno */
.private-body {
  background: #fafafa;
}

.sidebar {
  width: 258px;
  min-width: 258px;
  background: #ffffff;
  border-right: 1px solid #dedede;
  padding: 18px 14px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 8px 22px;
  font-size: 17px;
  letter-spacing: .2px;
}

.side-logo-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 13px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #181818;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
}

.sidebar a:hover {
  background: #f4f4f4;
}

.sidebar a.active {
  background: #eeeeee;
  border-color: #eeeeee;
  font-weight: 700;
}

.sidebar .ico {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  margin-right: 0;
  color: #4f4f4f;
  font-size: 15px;
}

.side-group {
  margin: 24px 8px 8px;
  font-size: 11px;
  color: #6a6a6a;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  margin: 0 0 16px;
  border: 1px solid #dedede;
  background: #fff;
  border-radius: 10px;
}

.private-main {
  background: #ffffff;
}

.private-top {
  background: #ffffff;
  height: 64px;
  border-bottom: 1px solid #e4e4e4;
}

.sidebar-collapsed .sidebar {
  width: 76px;
  min-width: 76px;
  padding: 16px 10px;
}

.sidebar-collapsed .side-brand strong,
.sidebar-collapsed .side-group,
.sidebar-collapsed .sidebar .label {
  display: none;
}

.sidebar-collapsed .side-brand {
  justify-content: center;
  padding: 8px 0 18px;
}

.sidebar-collapsed .sidebar a {
  justify-content: center;
  padding: 10px 8px;
}

@media (max-width: 800px) {
  .sidebar {
    width: 100%;
    min-width: 0;
  }

  .sidebar-collapsed .sidebar {
    width: 100%;
    min-width: 0;
  }
}

/* Corrección final sidebar: colapso limpio */
.sidebar {
  width: 256px;
  min-width: 256px;
  background: #fff;
  border-right: 1px solid #e5e5e5;
}

.sidebar a {
  justify-content: flex-start;
}

.sidebar a.active {
  background: #f0f0f0;
}

.sidebar-collapsed .sidebar {
  display: none !important;
}

.sidebar-collapsed .private-main {
  width: 100%;
}

.sidebar-collapsed .mobile-private-header {
  display: none;
}

.sidebar-collapsed .private-top {
  padding-left: 28px;
}

.side-logo-mark {
  display: none;
}

.side-brand {
  padding-left: 8px;
}

.side-brand strong {
  display: inline;
}

@media (max-width: 800px) {
  .sidebar-collapsed .sidebar {
    display: none !important;
  }
}

/* Corrección definitiva del colapso del menú lateral */
.sidebar-collapsed .sidebar {
  display: block !important;
  width: 72px !important;
  min-width: 72px !important;
  padding: 14px 8px !important;
}

.sidebar-collapsed .private-main {
  width: auto;
}

.sidebar-collapsed .side-brand strong,
.sidebar-collapsed .side-group,
.sidebar-collapsed .sidebar .label {
  display: none !important;
}

.sidebar-collapsed .side-brand {
  justify-content: center;
  padding: 6px 0 18px !important;
}

.sidebar-collapsed .side-logo-mark {
  display: none !important;
}

.sidebar-collapsed .sidebar a {
  justify-content: center !important;
  padding: 10px 8px !important;
  min-height: 42px;
}

.sidebar-collapsed .sidebar .ico {
  margin: 0 !important;
  width: 24px;
  min-width: 24px;
}

.sidebar-collapsed .sidebar-toggle {
  display: block !important;
  margin: 0 auto 18px !important;
}

.sidebar-collapsed .private-top {
  padding-left: 28px;
}

@media (max-width: 800px) {
  .sidebar-collapsed .sidebar {
    display: block !important;
    width: 72px !important;
    min-width: 72px !important;
  }
}

/* Colapso lateral por nombres, sin iconos */
.sidebar-collapsed .sidebar {
  display: block !important;
  width: 170px !important;
  min-width: 170px !important;
  padding: 14px 10px !important;
}

.sidebar-collapsed .side-brand {
  display: flex !important;
  justify-content: flex-start !important;
  padding: 8px 8px 18px !important;
}

.sidebar-collapsed .side-brand strong {
  display: inline !important;
  font-size: 15px;
}

.sidebar-collapsed .side-logo-mark,
.sidebar-collapsed .sidebar .ico,
.sidebar-collapsed .side-group {
  display: none !important;
}

.sidebar-collapsed .sidebar .label {
  display: inline !important;
  font-size: 14px;
}

.sidebar-collapsed .sidebar a {
  justify-content: flex-start !important;
  padding: 10px 12px !important;
  min-height: 40px;
}

.sidebar-collapsed .sidebar-toggle {
  display: block !important;
  margin: 0 0 14px 0 !important;
}

.sidebar-collapsed .private-main {
  width: auto;
}

@media (max-width: 800px) {
  .sidebar-collapsed .sidebar {
    width: 170px !important;
    min-width: 170px !important;
  }
}


/* FASE 1A - modo diurno/nocturno: login */
html[data-theme="dark"] {
  --bg: #111111;
  --fg: #f3f3f3;
  --muted: #b8b8b8;
  --border: #333333;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .public-body {
  background: var(--bg);
  color: var(--fg);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .public-footer {
  background: #171717;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] .topbar a,
html[data-theme="dark"] .auth-card a,
html[data-theme="dark"] .public-footer a {
  color: var(--fg);
}

html[data-theme="dark"] .auth-card input {
  background: #151515;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] .auth-card input::placeholder {
  color: #9a9a9a;
}

.ui-theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 8px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
}

.ui-theme-toggle:hover {
  background: rgba(127, 127, 127, 0.12);
}

.ui-theme-toggle:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* FASE 1C - modo diurno/nocturno privado */
html[data-theme="dark"] .private-body {
  background: var(--bg);
  color: var(--fg);
}

html[data-theme="dark"] .mobile-private-header,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .private-main,
html[data-theme="dark"] .private-top,
html[data-theme="dark"] .private-content,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .site-form-card,
html[data-theme="dark"] .grid-card,
html[data-theme="dark"] .db-sidebar,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .modal-card {
  background: #171717;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] .private-content-pad {
  background: var(--bg);
  color: var(--fg);
}

html[data-theme="dark"] .sidebar a,
html[data-theme="dark"] .private-top a,
html[data-theme="dark"] .mobile-private-header a,
html[data-theme="dark"] .top-user a,
html[data-theme="dark"] .db-sidebar a {
  color: var(--fg);
}

html[data-theme="dark"] .sidebar a:hover,
html[data-theme="dark"] .sidebar a.active,
html[data-theme="dark"] .db-sidebar a:hover,
html[data-theme="dark"] .db-sidebar a.active {
  background: #242424;
  color: var(--fg);
}

html[data-theme="dark"] .side-group,
html[data-theme="dark"] .private-top span,
html[data-theme="dark"] .db-sidebar small,
html[data-theme="dark"] .private-content-pad p {
  color: var(--muted);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #151515;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #9a9a9a;
}

html[data-theme="dark"] .data-grid {
  background: #171717;
  color: var(--fg);
}

html[data-theme="dark"] .data-grid th,
html[data-theme="dark"] .data-grid td {
  border-color: var(--border);
  color: var(--fg);
}

html[data-theme="dark"] .data-grid th {
  background: #242424;
}

html[data-theme="dark"] .data-grid tr:hover,
html[data-theme="dark"] .data-grid tr.selected {
  background: #202020;
}

html[data-theme="dark"] .flash,
html[data-theme="dark"] .error {
  border-color: var(--border);
}

.private-theme-toggle {
  white-space: nowrap;
}

/* FASE 1C.1 - cuenta y wiki en modo nocturno */
html[data-theme="dark"] .account-grid {
  background: transparent;
  color: var(--fg);
}

html[data-theme="dark"] .info-card,
html[data-theme="dark"] .danger-card,
html[data-theme="dark"] .wiki-doc {
  background: #171717;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] .info-card h2,
html[data-theme="dark"] .danger-card h2,
html[data-theme="dark"] .wiki-doc h1 {
  color: var(--fg);
}

html[data-theme="dark"] .info-card p,
html[data-theme="dark"] .danger-card p,
html[data-theme="dark"] .info-card dd,
html[data-theme="dark"] .wiki-doc p {
  color: var(--fg);
}

html[data-theme="dark"] .info-card dt,
html[data-theme="dark"] .muted-text {
  color: var(--muted);
}

html[data-theme="dark"] .wiki-doc pre {
  background: #171717;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] .soft-button {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

html[data-theme="dark"] .soft-button:hover {
  background: #242424;
}

html[data-theme="dark"] .soft-button.danger {
  color: #ffb4b4;
  border-color: #7a3a3a;
}

html[data-theme="dark"] .avatar-form input[type="file"] {
  background: #151515;
  color: var(--fg);
  border-color: var(--border);
}

/* FIX dark mode status pill */
html[data-theme="dark"] .status-pill.ok {
  background: #15351f;
  color: #d9ffe2;
  border-color: #2f7a45;
}

html[data-theme="dark"] .status-pill.warn {
  background: #3a2b12;
  color: #ffe7b0;
  border-color: #8a641c;
}

html[data-theme="dark"] .status-pill.danger,
html[data-theme="dark"] .status-pill.error {
  background: #3a1515;
  color: #ffd6d6;
  border-color: #8a2f2f;
}

/* FIX dark mode status pill strong */
html[data-theme="dark"] .data-grid .status-pill,
html[data-theme="dark"] .grid-card .status-pill,
html[data-theme="dark"] .status-pill {
  border-width: 1px !important;
  border-style: solid !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .data-grid .status-pill.ok,
html[data-theme="dark"] .grid-card .status-pill.ok,
html[data-theme="dark"] .status-pill.ok {
  background: #0f3d22 !important;
  color: #eafff0 !important;
  border-color: #3fa060 !important;
}

html[data-theme="dark"] .data-grid .status-pill.warn,
html[data-theme="dark"] .grid-card .status-pill.warn,
html[data-theme="dark"] .status-pill.warn {
  background: #49330f !important;
  color: #fff0c2 !important;
  border-color: #b98222 !important;
}

html[data-theme="dark"] .data-grid .status-pill.danger,
html[data-theme="dark"] .data-grid .status-pill.error,
html[data-theme="dark"] .grid-card .status-pill.danger,
html[data-theme="dark"] .grid-card .status-pill.error,
html[data-theme="dark"] .status-pill.danger,
html[data-theme="dark"] .status-pill.error {
  background: #4a1717 !important;
  color: #ffe0e0 !important;
  border-color: #b44a4a !important;
}

/* FASE 2A - selector de idioma */
.ui-lang-select {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
}

.ui-lang-select:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.private-lang-select {
  white-space: nowrap;
}

html[data-theme="dark"] .ui-lang-select {
  background: #171717;
  color: var(--fg);
  border-color: var(--border);
}

/* Ajuste estético de usuario en cabecera privada */
.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  overflow: hidden;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.top-avatar-link:hover {
  transform: translateY(-1px);
  border-color: rgba(0,0,0,.32);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}

.top-avatar-link .top-avatar,
.top-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.top-user-alias,
.top-user-logout {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.top-user-alias:hover,
.top-user-logout:hover {
  background: #fff;
  border-color: rgba(0,0,0,.32);
  text-decoration: none;
}

.top-user-logout {
  color: #111;
}

html[data-theme="dark"] .top-avatar-link,
html[data-theme="dark"] .top-user-alias,
html[data-theme="dark"] .top-user-logout {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.14);
  color: #f5f5f5;
}

html[data-theme="dark"] .top-avatar-link:hover,
html[data-theme="dark"] .top-user-alias:hover,
html[data-theme="dark"] .top-user-logout:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.32);
}

@media (max-width: 720px) {
  .top-user {
    gap: 6px;
  }

  .top-user-alias {
    display: none;
  }

  .top-user-logout {
    padding: 0 10px;
  }
}

/* FIX DEFINITIVO - topbar usuario privada */
.private-top .top-user,
.mobile-private-header .top-user {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}

.private-top .top-avatar-link,
.mobile-private-header .top-avatar-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  text-decoration: none !important;
  overflow: hidden !important;
  cursor: pointer !important;
}

.private-top .top-avatar-link:hover,
.mobile-private-header .top-avatar-link:hover {
  border-color: #111 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.14) !important;
  transform: translateY(-1px) !important;
}

.private-top .top-avatar-link .top-avatar,
.mobile-private-header .top-avatar-link .top-avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  display: block !important;
}

.private-top .top-user-alias,
.private-top .top-user-logout,
.mobile-private-header .top-user-alias,
.mobile-private-header .top-user-logout {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 0 13px !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  color: #111 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.private-top .top-user-alias:hover,
.private-top .top-user-logout:hover,
.mobile-private-header .top-user-alias:hover,
.mobile-private-header .top-user-logout:hover {
  border-color: #111 !important;
  background: #f7f7f7 !important;
  text-decoration: none !important;
}

html[data-theme="dark"] .private-top .top-avatar-link,
html[data-theme="dark"] .mobile-private-header .top-avatar-link,
html[data-theme="dark"] .private-top .top-user-alias,
html[data-theme="dark"] .private-top .top-user-logout,
html[data-theme="dark"] .mobile-private-header .top-user-alias,
html[data-theme="dark"] .mobile-private-header .top-user-logout {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.18) !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .private-top .top-avatar-link:hover,
html[data-theme="dark"] .mobile-private-header .top-avatar-link:hover,
html[data-theme="dark"] .private-top .top-user-alias:hover,
html[data-theme="dark"] .private-top .top-user-logout:hover,
html[data-theme="dark"] .mobile-private-header .top-user-alias:hover,
html[data-theme="dark"] .mobile-private-header .top-user-logout:hover {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.38) !important;
}

@media (max-width: 720px) {
  .mobile-private-header .top-user-alias {
    display: none !important;
  }

  .mobile-private-header .top-user-logout {
    padding: 0 10px !important;
  }
}

/* FIX TOPBAR DERECHA COMPACTA */
.private-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.private-top > div:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.private-top > .top-user,
.mobile-private-header > .top-user {
  margin-left: auto !important;
  flex: 0 0 auto !important;
}

.private-top .top-user,
.mobile-private-header .top-user {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  width: auto !important;
}

.private-top .top-avatar-link,
.mobile-private-header .top-avatar-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  text-decoration: none !important;
  overflow: hidden !important;
  cursor: pointer !important;
}

.private-top .top-avatar-link:hover,
.mobile-private-header .top-avatar-link:hover {
  border-color: #111 !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.12) !important;
}

.private-top .top-avatar,
.mobile-private-header .top-avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  display: block !important;
}

.private-top .top-user-alias,
.mobile-private-header .top-user-alias {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 34px !important;
  padding: 0 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  cursor: default !important;
}

.private-top .top-user-logout,
.mobile-private-header .top-user-logout {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  color: #111 !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  line-height: 1 !important;
}

.private-top .top-user-logout:hover,
.mobile-private-header .top-user-logout:hover {
  border-color: #111 !important;
  background: #f7f7f7 !important;
  text-decoration: none !important;
}

html[data-theme="dark"] .private-top .top-avatar-link,
html[data-theme="dark"] .mobile-private-header .top-avatar-link,
html[data-theme="dark"] .private-top .top-user-logout,
html[data-theme="dark"] .mobile-private-header .top-user-logout {
  background: rgba(255,255,255,.05) !important;
  border-color: rgba(255,255,255,.18) !important;
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .private-top .top-user-alias,
html[data-theme="dark"] .mobile-private-header .top-user-alias {
  color: #f5f5f5 !important;
}

html[data-theme="dark"] .private-top .top-avatar-link:hover,
html[data-theme="dark"] .mobile-private-header .top-avatar-link:hover,
html[data-theme="dark"] .private-top .top-user-logout:hover,
html[data-theme="dark"] .mobile-private-header .top-user-logout:hover {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.38) !important;
}

@media (max-width: 720px) {
  .mobile-private-header .top-user {
    gap: 6px !important;
  }

  .mobile-private-header .top-user-alias {
    display: none !important;
  }
}

/* FIX icono salir inline SVG */
.top-user-logout .topbar-icon {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.top-user-logout .topbar-icon path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.private-top .top-user-logout,
.mobile-private-header .top-user-logout {
  cursor: pointer !important;
}

/* FASE EMAIL 2 - plantillas de email */
.page-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.email-template-card {
  margin-top: 18px;
}

.template-head {
  margin-bottom: 16px;
}

.email-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.email-template-grid textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

.template-variable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.template-variable-list code {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0,0,0,.04);
}

.sticky-form-actions {
  position: sticky;
  bottom: 0;
  padding: 16px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

html[data-theme="dark"] .template-variable-list code {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}

@media (max-width: 900px) {
  .email-template-grid {
    grid-template-columns: 1fr;
  }

  .page-head-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* FASE 3.2 - registro público */
.public-password-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.public-password-wrap input {
  flex: 1 1 auto;
}

.public-password-wrap button {
  flex: 0 0 auto;
}

/* FIX UI registro público - campos password */
.auth-card .auth-password-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-card .auth-password-wrap input[type="password"],
.auth-card .auth-password-wrap input[type="text"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}

.auth-card .auth-password-wrap .password-toggle,
.auth-card .auth-password-wrap button {
  flex: 0 0 auto;
  min-width: 72px;
  width: auto;
  margin: 0;
  padding: 0 14px;
  border-radius: 12px;
  white-space: nowrap;
}

.auth-register-link {
  margin-top: 18px;
  text-align: center;
}

.auth-register-link a {
  font-weight: 700;
}

/* FIX FINAL - login/register público */
.auth-card .auth-register-link {
  margin-top: 18px;
  text-align: center;
  display: block;
  color: var(--muted);
}

.auth-card .auth-register-link span {
  display: inline;
}

.auth-card .auth-register-link a {
  display: inline;
  font-weight: 700;
  text-decoration: underline;
}

.auth-card .auth-password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0 0 14px;
}

.auth-card .auth-password-field input[type="password"],
.auth-card .auth-password-field input[type="text"] {
  width: 100% !important;
  min-width: 0;
  height: 40px;
  margin: 0 !important;
  box-sizing: border-box;
}

.auth-card .auth-password-field .auth-password-toggle {
  width: auto !important;
  min-width: 74px;
  height: 40px;
  margin: 0 !important;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #111;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.auth-card .auth-password-field .auth-password-toggle:hover {
  background: #f5f5f5;
}

.auth-card .auth-password-field .auth-password-toggle:disabled {
  opacity: .55;
  cursor: not-allowed;
}

html[data-theme="dark"] .auth-card .auth-password-field .auth-password-toggle {
  background: #161616;
  color: #fff;
  border-color: rgba(255,255,255,.18);
}

html[data-theme="dark"] .auth-card .auth-password-field .auth-password-toggle:hover {
  background: #222;
}

/* FIX password toggle con icono de librería */
.auth-card .auth-password-field {
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0 0 14px;
}

.auth-card .auth-password-field input[type="password"],
.auth-card .auth-password-field input[type="text"] {
  width: 100% !important;
  min-width: 0;
  height: 40px;
  margin: 0 !important;
  box-sizing: border-box;
}

.auth-card .auth-password-field .auth-password-toggle {
  width: 46px !important;
  min-width: 46px !important;
  height: 40px;
  margin: 0 !important;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  font-size: 18px;
  line-height: 1;
}

.auth-card .auth-password-field .auth-password-toggle:hover {
  background: #f5f5f5;
}

.auth-card .auth-password-field .auth-password-toggle:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.auth-card .auth-password-field .auth-password-toggle i {
  display: block;
  line-height: 1;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html[data-theme="dark"] .auth-card .auth-password-field .auth-password-toggle {
  background: #161616;
  color: #fff;
  border-color: rgba(255,255,255,.18);
}

html[data-theme="dark"] .auth-card .auth-password-field .auth-password-toggle:hover {
  background: #222;
}

/* FIX Font Awesome - iconografía pública */
.topbar nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.topbar nav a i {
  width: 16px;
  min-width: 16px;
  text-align: center;
  font-size: 14px;
  opacity: .86;
}

.auth-card .auth-password-field .auth-password-toggle i.fa-solid {
  display: block;
  font-size: 16px;
  line-height: 1;
}

.auth-card .auth-password-field .auth-password-toggle {
  color: #111;
}

html[data-theme="dark"] .auth-card .auth-password-field .auth-password-toggle {
  color: #fff;
}

/* FASE 3.3A - recuperación de contraseña */
.auth-secondary-link {
  margin-top: 12px;
  text-align: center;
}

.auth-secondary-link a {
  font-weight: 700;
  text-decoration: underline;
}

/* FIX enlace recuperar contraseña en login */
.auth-card .auth-secondary-link {
  margin-top: 12px;
  margin-bottom: 10px;
  text-align: center;
}

.auth-card .auth-secondary-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  text-decoration: underline;
}

.auth-card .auth-secondary-link a::before {
  content: "\f084";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 13px;
}

/* FASE 3.4 - modo mantenimiento */
.maintenance-card {
  text-align: center;
}

.maintenance-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.06);
  color: #111;
  font-size: 22px;
}

html[data-theme="dark"] .maintenance-icon {
  background: rgba(255,255,255,.10);
  color: #fff;
}

/* FASE 11 - compliance público */
.public-footer {
  gap: 14px;
  flex-wrap: wrap;
}

.public-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 24, 38, 0.96);
  color: #fff;
  box-shadow: 0 18px 45px rgba(0,0,0,.24);
  display: flex;
  align-items: center;
  gap: 14px;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
  font-size: .92rem;
  line-height: 1.45;
}

.cookie-banner button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
}

.public-legal-page {
  max-width: 980px;
  margin: 44px auto;
  padding: 0 18px;
}

.public-legal-card {
  background: #fff;
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 18px 50px rgba(15,23,42,.10);
}

.legal-text {
  white-space: normal;
  line-height: 1.7;
  color: #334155;
}

.terms-check {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  font-size: .92rem;
  line-height: 1.45;
}

.terms-check input {
  width: auto !important;
  margin-top: 3px;
}

.terms-check a {
  font-weight: 700;
}

.compliance-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

html[data-theme="dark"] .public-legal-card {
  background: #111827;
  color: #e5e7eb;
}

html[data-theme="dark"] .legal-text {
  color: #d1d5db;
}


/* FASE 11.2 - footer público y banner de cookies */
.public-footer {
  width: 100%;
  margin-top: 32px;
  padding: 18px 24px;
  font-size: 0.92rem;
}

.public-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.public-footer-link {
  text-decoration: underline;
  font-weight: 600;
}

.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(20, 24, 31, 0.96);
  color: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-text {
  line-height: 1.45;
  font-size: 0.94rem;
}

.cookie-accept-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 18px;
  line-height: 1.45;
}

.terms-check input {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-accept-btn {
    width: 100%;
  }
}

/* FASE 12.1 - enlaces de cabecera publico/privado */
.public-brand-link,
.private-home-link {
  color: inherit;
  text-decoration: none;
}

.public-brand-link:hover,
.private-home-link:hover {
  text-decoration: none;
}

/* FASE 12.1C - enlaces exactos de logo publico y titulo privado */
.public-logo-link,
.private-title-home-link,
.private-home-link {
  color: inherit;
  text-decoration: none;
}

.public-logo-link:hover,
.private-title-home-link:hover,
.private-home-link:hover {
  text-decoration: none;
}

.public-logo-link {
  display: inline-flex;
  align-items: center;
}




.auth-card .auth-logo,
.login-card .auth-logo,
.register-card .auth-logo {
    width: 74px;
    height: 74px;
    max-width: 74px;
    max-height: 74px;
    object-fit: contain;
    border-radius: 999px;
}

.public-header span,
.public-brand span,
.site-brand span {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}

@media (max-width: 640px) {
    .public-logo-link img,
    .public-brand img,
    .site-brand img,
    .brand img,
    .app-brand img,
    .header-brand img,
    .logo-img,
    img[alt="Thydom"] {
        width: 30px;
        height: 30px;
        max-width: 30px;
        max-height: 30px;
    }
}

/* THYDOM FASE 7.4E - icono corporativo único.
   Favicon_Thydom1.png se usa como icono visible de app y favicon del navegador. */
.public-logo-link img,
.public-brand img,
.site-brand img,
.brand img,
.app-brand img,
.header-brand img,
.logo-img,
img[alt="Thydom"] {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
    border-radius: 999px;
}

.auth-logo,
.auth-card .auth-logo,
.login-card .auth-logo,
.register-card .auth-logo {
    width: 74px;
    height: 74px;
    max-width: 74px;
    max-height: 74px;
    object-fit: contain;
    border-radius: 999px;
}

.public-header span,
.public-brand span,
.site-brand span {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}

@media (max-width: 640px) {
    .public-logo-link img,
    .public-brand img,
    .site-brand img,
    .brand img,
    .app-brand img,
    .header-brand img,
    .logo-img,
    img[alt="Thydom"] {
        width: 30px;
        height: 30px;
        max-width: 30px;
        max-height: 30px;
    }

    .auth-logo,
    .auth-card .auth-logo,
    .login-card .auth-logo,
    .register-card .auth-logo {
        width: 66px;
        height: 66px;
        max-width: 66px;
        max-height: 66px;
    }
}


/* THYDOM FASE 10.6 - navegación privada inicial de producto */
.side-nav-group {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  display: grid;
  gap: 6px;
}

.side-nav-label {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .52);
}

.product-shell {
  display: grid;
  gap: 22px;
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  align-items: stretch;
  padding: 24px;
  border: 1px solid rgba(167, 139, 250, .22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(167, 139, 250, .18), transparent 34%),
    rgba(15, 15, 26, .72);
  box-shadow: 0 0 42px rgba(106, 76, 255, .12);
  backdrop-filter: blur(10px);
}

.product-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(216, 180, 254, .78);
}

.product-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.product-hero p {
  margin: 0;
  max-width: 760px;
  color: rgba(255, 255, 255, .72);
  line-height: 1.6;
}

.product-status-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(234, 179, 8, .24);
  border-radius: 20px;
  background: rgba(234, 179, 8, .08);
}

.product-status-card span {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(253, 224, 71, .70);
}

.product-status-card strong {
  font-size: 18px;
  color: rgba(255, 255, 255, .92);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid rgba(167, 139, 250, .18);
  border-radius: 20px;
  background: rgba(255, 255, 255, .045);
}

.product-card-mark {
  display: inline-flex;
  margin-bottom: 12px;
  color: rgba(234, 179, 8, .86);
}

.product-card p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.5;
}

.product-note {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .72);
}

@media (max-width: 900px) {
  .product-hero {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* THYDOM FASE 10.7 - CRUD mínimo de comunidades */
.thydom-shell {
  display: grid;
  gap: 18px;
}

.thydom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(167, 139, 250, .22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(167, 139, 250, .18), transparent 34%),
    rgba(15, 15, 26, .72);
  box-shadow: 0 0 42px rgba(106, 76, 255, .12);
}

.thydom-header h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.thydom-header p {
  margin: 0;
  color: rgba(255, 255, 255, .72);
}

.thydom-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
}

.thydom-table {
  width: 100%;
  border-collapse: collapse;
}

.thydom-table th,
.thydom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: left;
  vertical-align: top;
}

.thydom-table th {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .52);
}

.thydom-table td small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, .58);
  line-height: 1.4;
}

.thydom-table code {
  font-size: 12px;
  color: rgba(216, 180, 254, .92);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(234, 179, 8, .26);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(234, 179, 8, .08);
  color: rgba(253, 224, 71, .86);
  font-size: 12px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.actions form {
  margin: 0;
}

.thydom-form {
  display: grid;
  gap: 16px;
  max-width: 760px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 22px;
  background: rgba(255, 255, 255, .04);
}

.thydom-form label {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, .78);
  font-weight: 600;
}

.thydom-form input,
.thydom-form textarea,
.thydom-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, .22);
  color: rgba(255, 255, 255, .92);
}

.thydom-form textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notice {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
}

.notice.success {
  border-color: rgba(34, 197, 94, .32);
  background: rgba(34, 197, 94, .10);
  color: rgba(187, 247, 208, .96);
}

.notice.error {
  border-color: rgba(239, 68, 68, .34);
  background: rgba(239, 68, 68, .10);
  color: rgba(254, 202, 202, .96);
}

.empty-state {
  padding: 30px;
  border: 1px dashed rgba(167, 139, 250, .28);
  border-radius: 24px;
  background: rgba(255, 255, 255, .035);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, .68);
}

@media (max-width: 760px) {
  .thydom-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* THYDOM FASE 10.9M - panel inicial conservador */
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
}

.dashboard-hero h1 {
  margin: 0.25rem 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-card,
.dashboard-note {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
}

.dashboard-card h2,
.dashboard-note h2 {
  margin-top: 0;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  opacity: 0.75;
}

@media (max-width: 760px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
  }
}

/* THYDOM FASE 11.3 - detalle de comunidad */
.thydom-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
}

.thydom-detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.thydom-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.thydom-detail-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
}

.thydom-detail-card h2 {
  margin-top: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) 1fr;
  gap: 0.5rem 1rem;
}

.detail-list dt {
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

@media (max-width: 760px) {
  .thydom-detail-hero {
    flex-direction: column;
  }

  .thydom-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}

/* THYDOM FASE 11.4 - miembros de comunidad */
.thydom-member-add {
  margin-bottom: 1.5rem;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.member-actions form {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.member-actions select {
  min-width: 110px;
}

.btn.danger {
  border-color: rgba(220, 38, 38, 0.45);
}

/* THYDOM FASE 11.6 - actividad de comunidad */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item p {
  margin: 0.35rem 0;
}

.activity-item small {
  opacity: 0.75;
}

/* ============================================================
   THYDOM FASE 13.3A - Marketplace visual conservador
   ============================================================ */

.thy-page {
  color: var(--text, #f7f2ff);
}

.thy-page h1,
.thy-page h2,
.thy-page h3 {
  letter-spacing: -0.03em;
}

.thy-kicker {
  margin: 0 0 0.45rem;
  color: #b58cff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.thy-marketplace,
.thy-dashboard,
.thy-detail,
.thy-members,
.thy-activity,
.thy-form-page {
  max-width: 1180px;
  margin: 0 auto;
}

.thy-marketplace-head,
.thy-dashboard-hero,
.thy-subhero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.thy-brand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.thy-brand-mark,
.thy-card-icon,
.thy-empty-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 1rem;
  color: #d9b7ff;
  background:
    radial-gradient(circle at 30% 20%, rgba(168, 91, 255, 0.5), transparent 55%),
    linear-gradient(135deg, rgba(119, 58, 238, 0.35), rgba(8, 11, 24, 0.85));
  border: 1px solid rgba(174, 112, 255, 0.42);
  box-shadow: 0 0 28px rgba(124, 76, 255, 0.24);
}

.thy-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(229, 176, 60, 0.42);
  background: linear-gradient(135deg, rgba(229, 176, 60, 0.12), rgba(20, 18, 8, 0.6));
  color: #f4d06f;
  white-space: nowrap;
}

.thy-coin {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(229, 176, 60, 0.14);
  border: 1px solid rgba(229, 176, 60, 0.48);
}

.thy-search-panel,
.thy-panel,
.thy-form-card,
.thy-status-panel,
.thy-dashboard-card,
.thy-list-card,
.thy-featured-card,
.thy-empty-state {
  border: 1px solid rgba(151, 122, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(18, 23, 42, 0.94), rgba(8, 11, 24, 0.94));
  border-radius: 1.35rem;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

.thy-search-panel {
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.thy-search-box {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.35rem;
  padding: 0 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(151, 122, 255, 0.18);
  background: rgba(0, 0, 0, 0.22);
}

.thy-search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.thy-filter-chips,
.thy-meta-row,
.thy-action-row,
.thy-form-actions,
.thy-action-stack {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.thy-filter-chips {
  margin-top: 1rem;
}

.thy-chip,
.thy-badge,
.thy-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(151, 122, 255, 0.2);
  background: rgba(151, 122, 255, 0.08);
  color: #cfc7e8;
  font-size: 0.88rem;
}

.thy-chip.active,
.thy-badge {
  color: #efe6ff;
  background: linear-gradient(135deg, rgba(117, 67, 255, 0.6), rgba(158, 83, 255, 0.34));
  border-color: rgba(181, 140, 255, 0.6);
}

.thy-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}

.thy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.68rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(151, 122, 255, 0.28);
  background: rgba(12, 15, 29, 0.72);
  color: #efe6ff;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.thy-btn.primary {
  background: linear-gradient(135deg, #6f3cff, #a65dff);
  border-color: rgba(195, 156, 255, 0.68);
  box-shadow: 0 0 24px rgba(137, 84, 255, 0.28);
}

.thy-btn.ghost {
  background: rgba(151, 122, 255, 0.08);
}

.thy-btn.danger {
  color: #ffd6d6;
  border-color: rgba(255, 102, 102, 0.35);
  background: rgba(140, 28, 42, 0.25);
}

.thy-featured-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
  border-color: rgba(162, 98, 255, 0.46);
}

.thy-featured-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 20%, rgba(153, 77, 255, 0.45), transparent 32%),
    radial-gradient(circle at 15% 20%, rgba(229, 176, 60, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(12, 14, 27, 0.95), rgba(30, 17, 57, 0.95));
}

.thy-featured-content {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.3rem;
  align-items: center;
  padding: 1.45rem;
}

.thy-featured-icon,
.thy-list-icon,
.thy-detail-icon {
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(162, 98, 255, 0.76);
  background:
    radial-gradient(circle, rgba(168, 91, 255, 0.38), transparent 62%),
    rgba(3, 5, 12, 0.88);
  box-shadow: 0 0 30px rgba(151, 89, 255, 0.38);
  color: #d8c2ff;
  font-size: 2rem;
}

.thy-featured-icon img,
.thy-list-icon img,
.thy-detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thy-featured-main h2,
.thy-list-main h3 {
  margin: 0.35rem 0;
}

.thy-featured-main p,
.thy-list-main p,
.thy-dashboard-card p,
.thy-panel p,
.thy-subhero p,
.thy-dashboard-hero p,
.thy-form-head p {
  color: #b7b1c9;
}

.thy-featured-actions,
.thy-list-actions,
.thy-member-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.thy-list {
  display: grid;
  gap: 0.85rem;
}

.thy-list-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
}

.thy-list-icon {
  width: 4.2rem;
  height: 4.2rem;
}

.thy-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.thy-empty-state .thy-empty-icon {
  margin: 0 auto 1rem;
}

.thy-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.thy-dashboard-card {
  display: block;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
}

.thy-dashboard-card.primary {
  border-color: rgba(162, 98, 255, 0.45);
}

.thy-card-link {
  color: #b58cff;
  font-weight: 700;
}

.thy-status-panel,
.thy-panel {
  padding: 1.2rem;
  margin-top: 1rem;
}

.thy-detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border-radius: 1.4rem;
  border: 1px solid rgba(162, 98, 255, 0.38);
  background: #090d1b;
  margin-bottom: 1rem;
}

.thy-detail-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 10%, rgba(165, 93, 255, 0.52), transparent 30%),
    radial-gradient(circle at 20% 25%, rgba(229, 176, 60, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(8, 10, 20, 0.98), rgba(27, 16, 58, 0.94));
}

.thy-detail-top,
.thy-detail-main {
  position: relative;
  z-index: 1;
}

.thy-detail-top {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
}

.thy-detail-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.3rem;
  align-items: end;
  padding: 4rem 1.4rem 1.4rem;
}

.thy-detail-icon {
  width: 7rem;
  height: 7rem;
}

.thy-detail-slug {
  color: #b58cff;
  font-weight: 700;
}

.thy-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(151, 122, 255, 0.16);
  border-radius: 1rem;
  background: rgba(8, 11, 24, 0.72);
}

.thy-tabs a {
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  color: #cfc7e8;
  text-decoration: none;
}

.thy-tabs a.active,
.thy-tabs a:hover {
  background: rgba(151, 122, 255, 0.16);
  color: #fff;
}

.thy-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 1rem;
}

.thy-detail-list {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 0.6rem 1rem;
}

.thy-detail-list dt {
  color: #9f98b5;
}

.thy-detail-list dd {
  margin: 0;
}

.thy-action-stack {
  align-items: stretch;
  flex-direction: column;
}

.thy-form-shell {
  max-width: 860px;
  margin: 0 auto;
}

.thy-form-card {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.thy-form-card label,
.thy-form-inline label {
  display: grid;
  gap: 0.35rem;
  color: #cfc7e8;
  font-weight: 700;
}

.thy-form-card input,
.thy-form-card textarea,
.thy-form-card select,
.thy-form-inline input,
.thy-form-inline select,
.thy-member-actions select {
  width: 100%;
  border: 1px solid rgba(151, 122, 255, 0.18);
  border-radius: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  padding: 0.75rem 0.85rem;
}

.thy-form-card .wide,
.thy-form-actions {
  grid-column: 1 / -1;
}

.thy-form-actions {
  justify-content: flex-end;
}

.thy-form-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 0.8rem;
  align-items: end;
}

.thy-member-list {
  display: grid;
  gap: 0.85rem;
}

.thy-member-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(151, 122, 255, 0.16);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.16);
}

.thy-member-card h3 {
  margin: 0 0 0.25rem;
}

.thy-member-card p {
  margin: 0 0 0.65rem;
}

.thy-timeline {
  display: grid;
  gap: 0.9rem;
}

.thy-timeline-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(151, 122, 255, 0.16);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.14);
}

.thy-timeline-dot {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(151, 122, 255, 0.16);
  color: #d8c2ff;
}

.thy-notice {
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  border-radius: 0.9rem;
  border: 1px solid rgba(151, 122, 255, 0.22);
}

.thy-notice.success {
  color: #bff4d0;
  background: rgba(18, 110, 55, 0.18);
  border-color: rgba(85, 214, 139, 0.22);
}

.thy-notice.error {
  color: #ffd1d1;
  background: rgba(120, 28, 43, 0.2);
  border-color: rgba(255, 101, 101, 0.22);
}

.thy-empty-inline {
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.16);
  color: #b7b1c9;
}

[data-thy-card].is-hidden {
  display: none;
}

@media (max-width: 820px) {
  .thy-marketplace-head,
  .thy-dashboard-hero,
  .thy-subhero,
  .thy-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .thy-featured-content,
  .thy-list-card,
  .thy-detail-main,
  .thy-detail-grid,
  .thy-dashboard-grid,
  .thy-form-card,
  .thy-form-inline {
    grid-template-columns: 1fr;
  }

  .thy-featured-actions,
  .thy-list-actions,
  .thy-member-actions {
    justify-content: flex-start;
  }

  .thy-detail-list {
    grid-template-columns: 1fr;
  }

  .thy-member-card {
    flex-direction: column;
  }
}


/* ============================================================
   FASE 13.5B - Marketplace visual real Thydom
   Scope: .thydom-marketplace, .thydom-detail, .thydom-form
   ============================================================ */

.thydom-marketplace,
.thydom-detail,
.thydom-form {
  --tm-bg: #070a12;
  --tm-panel: rgba(15, 23, 42, .82);
  --tm-panel-2: rgba(2, 6, 23, .78);
  --tm-line: rgba(148, 163, 184, .18);
  --tm-text: #eef2ff;
  --tm-muted: #9ca3af;
  --tm-purple: #8b5cf6;
  --tm-purple-2: #a855f7;
  --tm-gold: #fbbf24;
  --tm-red: #f87171;
  color: var(--tm-text);
  max-width: 1500px;
  margin: -8px auto 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.thydom-marketplace *,
.thydom-detail *,
.thydom-form * {
  box-sizing: border-box;
}

.tm-shell {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 96px);
  padding: 30px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 0%, rgba(139, 92, 246, .36), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(59, 130, 246, .18), transparent 24%),
    linear-gradient(145deg, #070a12 0%, #0c1020 48%, #05070c 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .26);
}

.tm-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 80%);
}

.tm-inner {
  position: relative;
  z-index: 1;
}

.tm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.tm-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tm-logo,
.tm-emblem,
.tm-row-icon {
  display: grid;
  place-items: center;
  background: rgba(15,23,42,.82);
  border: 2px solid rgba(168,85,247,.70);
  color: #d8b4fe;
  box-shadow: 0 0 42px rgba(168,85,247,.34);
}

.tm-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.tm-brand h1,
.tm-hero h1,
.td-title h1,
.tf-head h1 {
  margin: 0;
  color: #fff;
  letter-spacing: -.055em;
  line-height: 1;
}

.tm-brand h1 { font-size: 36px; }
.tm-brand p,
.tf-head p {
  margin: 4px 0 0;
  color: var(--tm-muted);
  font-size: 15px;
}

.tm-wallet {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tm-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(251,191,36,.38);
  background: rgba(251,191,36,.09);
  color: var(--tm-gold);
  font-size: 19px;
  font-weight: 900;
}

.tm-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--tm-purple);
  box-shadow: 0 0 24px rgba(139,92,246,.55);
}

.tm-searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  margin-bottom: 18px;
}

.tm-search {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-radius: 26px;
  border: 1px solid var(--tm-line);
  background: rgba(15,23,42,.76);
}

.tm-search strong {
  color: var(--tm-purple);
  font-size: 30px;
}

.tm-search input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  outline: 0;
  font: inherit;
  font-size: 20px;
}

.tm-search input::placeholder { color: #6b7280; }

.tm-button {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid rgba(168,85,247,.48);
  border-radius: 18px;
  background: rgba(15,23,42,.76);
  color: #e9d5ff;
  text-decoration: none;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tm-button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  box-shadow: 0 20px 50px rgba(124,58,237,.32);
}

.tm-button.danger {
  color: #fecaca;
  border-color: rgba(248,113,113,.50);
}

.tm-create {
  min-width: 210px;
  min-height: 72px;
  border-radius: 26px;
  font-size: 17px;
}

.tm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.tm-chip {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-radius: 18px;
  border: 1px solid var(--tm-line);
  background: rgba(15,23,42,.70);
  color: #d1d5db;
  font-weight: 850;
}

.tm-chip.active {
  color: #fff;
  border-color: rgba(168,85,247,.76);
  background: linear-gradient(135deg, rgba(124,58,237,.58), rgba(88,28,135,.38));
  box-shadow: 0 0 28px rgba(124,58,237,.22);
}

.tm-hero,
.td-cover {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(168,85,247,.58);
  background:
    linear-gradient(90deg, rgba(3,7,18,.95), rgba(17,24,39,.72) 46%, rgba(49,46,129,.30)),
    radial-gradient(circle at 74% 20%, rgba(216,180,254,.36), transparent 22%),
    linear-gradient(135deg, #0f172a, #1e1b4b 54%, #020617);
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
}

.tm-hero {
  min-height: 360px;
  margin-bottom: 30px;
}

.tm-hero::after,
.td-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 32%, rgba(168,85,247,.25), transparent 16%),
    linear-gradient(120deg, transparent, rgba(255,255,255,.045), transparent);
  pointer-events: none;
}

.tm-hero-content {
  position: relative;
  z-index: 1;
  min-height: 360px;
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) 300px;
  align-items: end;
  gap: 28px;
  padding: 34px;
}

.tm-emblem {
  width: 130px;
  height: 130px;
  border-radius: 42px;
  font-size: 60px;
}

.tm-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(251,191,36,.14);
  color: var(--tm-gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.tm-hero h1 {
  font-size: 54px;
  margin-bottom: 10px;
}

.tm-hero p,
.td-title p {
  margin: 0 0 18px;
  max-width: 760px;
  color: #d1d5db;
  font-size: 18px;
  line-height: 1.55;
}

.tm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tm-tags span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(139,92,246,.20);
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 850;
}

.tm-hero-side {
  display: grid;
  gap: 13px;
}

.tm-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tm-stat {
  border-radius: 20px;
  padding: 16px;
  background: rgba(2,6,23,.58);
  border: 1px solid var(--tm-line);
}

.tm-stat strong {
  display: block;
  color: #fff;
  font-size: 22px;
}

.tm-stat small {
  color: var(--tm-muted);
}

.tm-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 16px;
}

.tm-section-title h2 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  letter-spacing: -.03em;
}

.tm-section-title a {
  color: #c084fc;
  text-decoration: none;
  font-weight: 900;
}

.tm-list {
  display: grid;
  gap: 16px;
}

.tm-row {
  min-height: 128px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 280px;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid var(--tm-line);
  background:
    linear-gradient(90deg, rgba(15,23,42,.90), rgba(15,23,42,.70)),
    radial-gradient(circle at 80% 50%, rgba(168,85,247,.24), transparent 26%);
}

.tm-row-icon {
  width: 78px;
  height: 78px;
  border-radius: 26px;
  color: var(--tm-gold);
  border-color: rgba(251,191,36,.42);
  font-size: 34px;
}

.tm-row h3 {
  margin: 0 0 7px;
  color: #fff;
  font-size: 25px;
  letter-spacing: -.025em;
}

.tm-row p {
  margin: 0 0 12px;
  color: var(--tm-muted);
}

.tm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #d1d5db;
  font-size: 14px;
}

.tm-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.td-cover {
  min-height: 390px;
  margin-bottom: 22px;
}

.td-cover-main {
  position: relative;
  z-index: 1;
  min-height: 390px;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: end;
  padding: 34px;
}

.td-back {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
}

.td-edit {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
}

.td-title h1 {
  font-size: 58px;
  margin-bottom: 10px;
}

.td-side {
  display: grid;
  gap: 12px;
}

.td-side div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(2,6,23,.60);
  border: 1px solid var(--tm-line);
}

.td-side span { color: var(--tm-muted); }
.td-side strong { color: #fff; }

.td-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.td-tabs a {
  min-height: 70px;
  border-radius: 22px;
  background: rgba(15,23,42,.76);
  border: 1px solid var(--tm-line);
  color: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 17px;
}

.td-tabs a.active,
.td-tabs a:hover {
  color: #fff;
  border-color: rgba(168,85,247,.64);
  background: linear-gradient(135deg, rgba(124,58,237,.52), rgba(30,41,59,.72));
}

.td-grid,
.tf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
}

.tm-card {
  border: 1px solid var(--tm-line);
  border-radius: 28px;
  background: rgba(15,23,42,.76);
  padding: 24px;
}

.tm-card h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 26px;
  letter-spacing: -.03em;
}

.tm-info {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}

.tm-info dt,
.tm-info dd {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148,163,184,.12);
}

.tm-info dt { color: var(--tm-muted); }
.tm-info dd { color: #fff; font-weight: 750; }

.tf-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.tf-head small {
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}

.tf-head h1 {
  margin-top: 8px;
  font-size: 48px;
}

.tf-form {
  display: grid;
  gap: 18px;
}

.tf-form label {
  display: grid;
  gap: 8px;
  color: #e5e7eb;
  font-weight: 900;
}

.tf-form input,
.tf-form textarea {
  width: 100%;
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 18px;
  padding: 15px 16px;
  background: rgba(2,6,23,.62);
  color: #fff;
  outline: 0;
  font: inherit;
}

.tf-form textarea {
  min-height: 190px;
  resize: vertical;
}

.tf-preview {
  overflow: hidden;
  padding: 0;
}

.tf-preview-cover {
  min-height: 310px;
  display: flex;
  align-items: end;
  gap: 18px;
  padding: 26px;
  background:
    linear-gradient(90deg, rgba(3,7,18,.96), rgba(17,24,39,.66)),
    radial-gradient(circle at 76% 12%, rgba(216,180,254,.40), transparent 26%),
    linear-gradient(135deg, #0f172a, #312e81 55%, #020617);
}

.tf-preview-cover h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 34px;
  letter-spacing: -.04em;
}

.tf-preview-cover p {
  margin: 0;
  color: #d1d5db;
  line-height: 1.5;
}

.tf-meta {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.tf-meta div {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid rgba(148,163,184,.12);
}

.tf-meta span { color: var(--tm-muted); }
.tf-meta strong { color: #fff; }

@media (max-width: 1180px) {
  .tm-hero-content,
  .td-cover-main,
  .td-grid,
  .tf-grid {
    grid-template-columns: 1fr;
  }

  .tm-row {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .tm-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .tm-searchbar,
  .tf-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}


/* ============================================================
   FASE 13.6C - private global dark shell
   ============================================================ */

html[data-theme="dark"],
html[data-theme="dark"] body.private-body,
body.private-body,
body.private-body.theme-dark-forced {
  background:
    radial-gradient(circle at 38% 0%, rgba(124, 58, 237, .22), transparent 34rem),
    radial-gradient(circle at 80% 10%, rgba(245, 158, 11, .08), transparent 26rem),
    linear-gradient(180deg, #121214 0%, #0b0b0f 48%, #08080b 100%) !important;
  color: #f8f4ff !important;
}

body.private-body .private-main,
body.private-body .private-content,
body.private-body .private-content-pad {
  background: transparent !important;
}

body.private-body .private-content {
  max-width: 1320px;
  width: min(1320px, calc(100vw - 320px));
  margin: 0 auto;
  padding: 2.2rem 2rem 5rem;
}

body.private-body .private-top,
body.private-body .mobile-private-header {
  background: rgba(19, 19, 22, .94) !important;
  color: #fff !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  backdrop-filter: blur(18px);
}

body.private-body .sidebar {
  background: linear-gradient(180deg, #171719 0%, #101013 100%) !important;
  border-right: 1px solid rgba(255,255,255,.12) !important;
  color: #fff !important;
}

body.private-body .side-brand,
body.private-body .private-title-home-link,
body.private-body .private-home-link,
body.private-body .top-user-alias {
  color: #fff !important;
}

body.private-body .sidebar .side-group {
  color: #b7abc9 !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  margin: 1.25rem .8rem .45rem;
}

body.private-body .sidebar a {
  color: #f8f4ff !important;
  border: 1px solid transparent;
  border-radius: 14px;
  margin: .16rem .45rem;
}

body.private-body .sidebar a.active,
body.private-body .sidebar a:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(255,255,255,.05)) !important;
  border-color: rgba(196,181,253,.62) !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.22);
}

body.private-body .side-sub-link {
  margin-left: 1rem !important;
  opacity: .88;
}

body.private-body .side-disabled-future {
  opacity: .56;
}

body.private-body h1,
body.private-body h2,
body.private-body h3 {
  color: #fff !important;
  text-shadow: 0 0 18px rgba(139,92,246,.20);
}

body.private-body p,
body.private-body small,
body.private-body label,
body.private-body dt,
body.private-body dd,
body.private-body li,
body.private-body span {
  color: #e6def8;
}

body.private-body a {
  color: #c084fc;
}

body.private-body a:hover {
  color: #f0abfc;
}

body.private-body input,
body.private-body textarea,
body.private-body select,
body.private-body .ui-lang-select,
body.private-body .ui-theme-toggle {
  background: rgba(255,255,255,.06) !important;
  color: #f8f4ff !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  border-radius: 14px !important;
}

body.private-body option {
  background: #15151c !important;
  color: #f8f4ff !important;
}

body.private-body .private-dark-locked {
  pointer-events: none;
  opacity: .92;
}

body.private-body .grid-card,
body.private-body .thydom-table-wrap,
body.private-body .thydom-detail-card,
body.private-body .modal-card,
body.private-body .note-block,
body.private-body .empty-state,
body.private-body .notice,
body.private-body .market-card,
body.private-body .thydom-card,
body.private-body .thydom-shell > section,
body.private-body .thydom-shell > article {
  background: linear-gradient(145deg, rgba(25,27,43,.96), rgba(10,12,24,.98)) !important;
  border: 1px solid rgba(139,92,246,.30) !important;
  color: #f8f4ff !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.34) !important;
}

body.private-body table,
body.private-body .data-grid,
body.private-body .thydom-table {
  background: transparent !important;
  color: #f8f4ff !important;
}

body.private-body th {
  color: #d8cff0 !important;
  background: rgba(255,255,255,.045) !important;
}

body.private-body td {
  color: #f8f4ff !important;
  border-color: rgba(255,255,255,.08) !important;
}

body.private-body .btn.primary,
body.private-body .primary-button,
body.private-body button[type="submit"] {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  color: #fff !important;
  border: 1px solid rgba(216,180,254,.48) !important;
  box-shadow: 0 16px 38px rgba(124,58,237,.28);
}

body.private-body .btn.secondary,
body.private-body .soft-button {
  background: rgba(255,255,255,.06) !important;
  color: #f8f4ff !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}

body.private-body .top-avatar {
  box-shadow:
    0 0 0 2px rgba(168,85,247,.52),
    0 0 24px rgba(168,85,247,.42);
}

@media (max-width: 900px) {
  body.private-body .private-content {
    width: 100%;
    padding: 1.4rem 1rem 4rem;
  }
}


/* ============================================================
   FASE 13.6B - dark privado cerrado y menú Thydom expandido
   ============================================================ */

html[data-theme="dark"],
html[data-theme="dark"] body.private-body,
body.private-body,
body.private-body.theme-dark-forced {
  background:
    radial-gradient(circle at 42% 0%, rgba(124, 58, 237, 0.22), transparent 34rem),
    radial-gradient(circle at 75% 12%, rgba(250, 204, 21, 0.07), transparent 26rem),
    linear-gradient(180deg, #101015 0%, #0b0b10 42%, #08080c 100%) !important;
  color: #f6f1ff !important;
}

/* La parte privada no ofrece modo claro. */
body.private-body .private-dark-locked {
  pointer-events: none;
  opacity: .92;
}

body.private-body .private-main,
body.private-body .private-content,
body.private-body .private-content-pad {
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 92, 246, .08), transparent 42rem),
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)) !important;
}

body.private-body .private-content {
  max-width: 1320px;
  width: min(1320px, calc(100vw - 340px));
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

body.private-body .private-top,
body.private-body .mobile-private-header {
  background: rgba(18, 18, 22, .92) !important;
  color: #f8f4ff !important;
  border-bottom: 1px solid rgba(255, 255, 255, .10) !important;
  backdrop-filter: blur(18px);
}

body.private-body .sidebar {
  background:
    linear-gradient(180deg, rgba(23,23,27,.98), rgba(13,13,16,.98)) !important;
  border-right: 1px solid rgba(255,255,255,.12) !important;
  color: #f8f4ff !important;
}

body.private-body .sidebar .side-group {
  color: #aaa0c7 !important;
  text-transform: uppercase;
  letter-spacing: .085em;
  font-size: .72rem;
  margin-top: 1.35rem;
  margin-bottom: .45rem;
}

body.private-body .sidebar a {
  color: #f8f4ff !important;
  border-radius: 14px;
  border: 1px solid transparent;
  margin: .12rem .45rem;
}

body.private-body .sidebar a:hover,
body.private-body .sidebar a.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, .24), rgba(255, 255, 255, .045)) !important;
  border-color: rgba(196, 181, 253, .62) !important;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, .16), 0 10px 30px rgba(0,0,0,.24);
}

body.private-body .sidebar .side-sub-link {
  margin-left: 1rem;
  font-size: .94rem;
  opacity: .92;
}

body.private-body .sidebar .side-disabled-future {
  opacity: .62;
}

body.private-body .sidebar .side-disabled-future:hover {
  opacity: .86;
}

body.private-body .side-brand,
body.private-body .private-title-home-link,
body.private-body .private-home-link,
body.private-body .top-user-alias {
  color: #ffffff !important;
}

body.private-body h1,
body.private-body h2,
body.private-body h3 {
  color: #fff !important;
  text-shadow: 0 0 18px rgba(139, 92, 246, .24);
}

body.private-body p,
body.private-body small,
body.private-body span,
body.private-body dt,
body.private-body dd,
body.private-body label,
body.private-body li {
  color: #ddd6f5;
}

body.private-body a {
  color: #c084fc;
}

body.private-body a:hover {
  color: #f0abfc;
}

body.private-body input,
body.private-body textarea,
body.private-body select,
body.private-body .ui-lang-select,
body.private-body .ui-theme-toggle {
  background: rgba(255,255,255,.055) !important;
  color: #f8f4ff !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 14px !important;
}

body.private-body option {
  background: #15151c !important;
  color: #f8f4ff !important;
}

body.private-body .grid-card,
body.private-body .thydom-table-wrap,
body.private-body .thydom-detail-card,
body.private-body .modal-card,
body.private-body .note-block,
body.private-body .empty-state,
body.private-body .notice,
body.private-body .market-card,
body.private-body .thydom-card,
body.private-body .thydom-shell > section,
body.private-body .thydom-shell > article {
  background:
    linear-gradient(145deg, rgba(25, 27, 43, .96), rgba(10, 12, 24, .98)) !important;
  border: 1px solid rgba(139, 92, 246, .30) !important;
  color: #f8f4ff !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35) !important;
}

body.private-body table,
body.private-body .data-grid,
body.private-body .thydom-table {
  background: transparent !important;
  color: #f8f4ff !important;
}

body.private-body th {
  color: #cfc6ea !important;
  background: rgba(255,255,255,.04) !important;
}

body.private-body td {
  color: #f8f4ff !important;
  border-color: rgba(255,255,255,.08) !important;
}

body.private-body .status-pill {
  background: rgba(34, 197, 94, .12) !important;
  color: #86efac !important;
  border: 1px solid rgba(34,197,94,.34) !important;
}

body.private-body .btn.primary,
body.private-body .primary-button,
body.private-body button[type="submit"] {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  color: #fff !important;
  border: 1px solid rgba(216, 180, 254, .48) !important;
  box-shadow: 0 16px 38px rgba(124,58,237,.28);
}

body.private-body .btn.secondary,
body.private-body .soft-button {
  background: rgba(255,255,255,.06) !important;
  color: #f8f4ff !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}

body.private-body .btn.danger,
body.private-body .danger-outline-button {
  background: rgba(239,68,68,.12) !important;
  color: #fecaca !important;
  border: 1px solid rgba(239,68,68,.42) !important;
}

body.private-body .modal-backdrop {
  background: rgba(0,0,0,.76) !important;
  backdrop-filter: blur(12px);
}

body.private-body .top-avatar {
  box-shadow:
    0 0 0 2px rgba(168, 85, 247, .52),
    0 0 24px rgba(168, 85, 247, .42);
}

/* Neutraliza cualquier regla clara anterior dentro de private. */
html:not([data-theme="dark"]) body.private-body,
html[data-theme="light"] body.private-body {
  background:
    radial-gradient(circle at 42% 0%, rgba(124, 58, 237, 0.22), transparent 34rem),
    linear-gradient(180deg, #101015 0%, #0b0b10 42%, #08080c 100%) !important;
  color: #f6f1ff !important;
}

@media (max-width: 900px) {
  body.private-body .private-content {
    width: min(100vw - 2rem, 100%);
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


/* ============================================================
   FASE 13.6A - integración visual global Thydom
   ============================================================ */

html[data-theme="dark"],
html[data-theme="dark"] body,
body.private-body {
  background:
    radial-gradient(circle at 58% 0%, rgba(112, 59, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 82% 18%, rgba(255, 193, 55, 0.08), transparent 24rem),
    #0b0b10 !important;
  color: #f5f2ff !important;
}

body.private-body {
  min-height: 100vh;
}

.private-main,
.private-content,
.private-content-pad {
  background: transparent !important;
}

.private-top,
.mobile-private-header {
  background: rgba(14, 14, 19, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #f5f2ff !important;
  backdrop-filter: blur(16px);
}

.sidebar {
  background: rgba(14, 14, 19, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f5f2ff !important;
}

.sidebar a,
.sidebar .side-group,
.sidebar .label,
.side-brand,
.private-title-home-link,
.private-home-link,
.top-user-alias {
  color: #f5f2ff !important;
}

.sidebar .side-group {
  margin-top: 1.45rem;
  color: #a89dc7 !important;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .72rem;
}

.sidebar a {
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.sidebar a:hover,
.sidebar a.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(255, 193, 55, .06)) !important;
  border-color: rgba(168, 85, 247, .55) !important;
  color: #ffffff !important;
}

.sidebar .side-sub-link {
  margin-left: .55rem;
  opacity: .88;
  font-size: .94rem;
}

.private-content {
  max-width: 1320px;
  margin: 0 auto;
}

.private-content h1,
.private-content h2,
.private-content h3 {
  color: #ffffff !important;
  text-shadow: 0 0 18px rgba(139, 92, 246, .24);
}

.private-content p,
.private-content span,
.private-content small,
.private-content dt,
.private-content dd,
.private-content label {
  color: #d8d2ef;
}

.private-content a {
  color: #c084fc;
  font-weight: 700;
}

.private-content a:hover {
  color: #f0abfc;
}

button,
.primary-button,
.btn,
.soft-button,
input[type="submit"] {
  border-radius: 14px !important;
}

.private-content input,
.private-content textarea,
.private-content select,
.ui-lang-select,
.ui-theme-toggle {
  background: rgba(255,255,255,.045) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #f5f2ff !important;
  border-radius: 14px !important;
}

.private-content input::placeholder,
.private-content textarea::placeholder {
  color: rgba(245,242,255,.55) !important;
}

.ui-theme-toggle,
.ui-lang-select,
.top-user-logout,
.top-avatar-link {
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  color: #f5f2ff !important;
}

.top-avatar {
  box-shadow: 0 0 0 2px rgba(168, 85, 247, .45), 0 0 22px rgba(168, 85, 247, .45);
}

.grid-card,
.thydom-table-wrap,
.thydom-detail-card,
.modal-card,
.auth-card,
.note-block,
.empty-state,
.notice,
.thydom-card,
.market-card,
.marketplace-card {
  background: linear-gradient(145deg, rgba(24, 26, 42, .96), rgba(10, 12, 24, .98)) !important;
  border: 1px solid rgba(139, 92, 246, .28) !important;
  color: #f5f2ff !important;
  border-radius: 24px !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.35) !important;
}

table,
.data-grid,
.thydom-table {
  color: #f5f2ff !important;
  background: transparent !important;
}

.data-grid th,
.thydom-table th {
  color: #bfb5df !important;
  background: rgba(255,255,255,.035) !important;
}

.data-grid td,
.thydom-table td {
  color: #f5f2ff !important;
  border-color: rgba(255,255,255,.08) !important;
}

.status-pill {
  background: rgba(34, 197, 94, .12) !important;
  border: 1px solid rgba(34, 197, 94, .34) !important;
  color: #86efac !important;
}

.modal-backdrop {
  background: rgba(0,0,0,.74) !important;
  backdrop-filter: blur(10px);
}

/* Layout de producto: contenedor ancho y coherente */
.thydom-shell,
.thydom-detail-hero,
.thydom-detail-grid,
.marketplace-shell,
.thydom-shell {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

.thydom-header,
.page-head {
  margin-bottom: 1.4rem;
}

/* Botones de acción con estética de producto */
.btn.primary,
.primary-button,
button[type="submit"] {
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  border: 1px solid rgba(216, 180, 254, .45) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(124, 58, 237, .25);
}

.btn.secondary,
.soft-button {
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #f5f2ff !important;
}

.btn.danger,
.danger-outline-button {
  background: rgba(239, 68, 68, .10) !important;
  border: 1px solid rgba(239, 68, 68, .40) !important;
  color: #fecaca !important;
}

/* Modo claro: si el usuario lo elige, no se rompe, pero el producto nace oscuro. */
html:not([data-theme="dark"]) body.private-body {
  background: #f6f4fb !important;
  color: #15121f !important;
}


/* THYDOM FASE 13.6C - integración global privada */
html[data-private-theme="dark"],
html[data-private-theme="dark"] body.private-body,
body.private-body.thydom-private-shell {
  background:
    radial-gradient(circle at 35% 0%, rgba(132, 84, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 85% 8%, rgba(232, 179, 68, 0.08), transparent 28rem),
    #0d0d10 !important;
  color: #f5f0ff !important;
}

body.private-body.thydom-private-shell .sidebar {
  background: rgba(16, 16, 18, 0.96) !important;
  border-right: 1px solid rgba(151, 108, 255, 0.18) !important;
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.24) !important;
}

body.private-body.thydom-private-shell .private-main {
  background: transparent !important;
}

body.private-body.thydom-private-shell .private-top,
body.private-body.thydom-private-shell .mobile-private-header {
  background: rgba(16, 16, 18, 0.82) !important;
  border-bottom: 1px solid rgba(151, 108, 255, 0.16) !important;
  backdrop-filter: blur(18px);
}

body.private-body.thydom-private-shell .private-content {
  background: transparent !important;
}

body.private-body.thydom-private-shell .side-group {
  color: #a9a0ba !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.private-body.thydom-private-shell .sidebar a {
  color: #f5f0ff !important;
  border: 1px solid transparent;
}

body.private-body.thydom-private-shell .sidebar a:hover,
body.private-body.thydom-private-shell .sidebar a.active {
  background: linear-gradient(135deg, rgba(151, 84, 255, 0.18), rgba(255, 255, 255, 0.035)) !important;
  border-color: rgba(190, 150, 255, 0.48) !important;
  box-shadow: 0 0 22px rgba(135, 78, 255, 0.16);
}

body.private-body.thydom-private-shell .top-user-alias,
body.private-body.thydom-private-shell .private-title-home-link,
body.private-body.thydom-private-shell .private-home-link {
  color: #ffffff !important;
}

body.private-body.thydom-private-shell .ui-lang-select {
  background: rgba(20, 20, 24, 0.92) !important;
  color: #ffffff !important;
  border: 1px solid rgba(190, 150, 255, 0.28) !important;
}

body.private-body.thydom-private-shell input,
body.private-body.thydom-private-shell textarea,
body.private-body.thydom-private-shell select {
  background: rgba(18, 18, 22, 0.96);
  color: #f5f0ff;
  border-color: rgba(190, 150, 255, 0.28);
}

body.private-body.thydom-private-shell table,
body.private-body.thydom-private-shell .grid-card,
body.private-body.thydom-private-shell .thydom-table-wrap,
body.private-body.thydom-private-shell .modal-card {
  background: rgba(14, 17, 31, 0.88) !important;
  color: #f5f0ff !important;
  border-color: rgba(125, 83, 230, 0.28) !important;
}

body.private-body.thydom-private-shell a {
  color: #b985ff;
}

body.private-body.thydom-private-shell .primary-button,
body.private-body.thydom-private-shell .btn.primary,
body.private-body.thydom-private-shell button[type="submit"] {
  background: linear-gradient(135deg, #7c3cff, #a45cff) !important;
  color: #ffffff !important;
  border-color: rgba(190, 150, 255, 0.36) !important;
}

/* FASE 14.2B - THY wallet inicial y cuenta sin avatar editable */
.private-body input[type="file"][name*="avatar"],
.private-body input[type="file"][id*="avatar"],
.private-body .avatar-upload,
.private-body .account-avatar-upload,
.private-body .profile-avatar-upload {
  display: none !important;
}

.thy-wallet-hero {
  align-items: center;
}

.thy-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.25rem;
  border: 1px solid rgba(245, 183, 49, .5);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 183, 49, .18), rgba(17, 17, 24, .92));
  color: #f5c451;
  box-shadow: 0 0 36px rgba(245, 183, 49, .12);
}

.thy-balance-pill strong {
  font-size: 1.35rem;
}

.thy-wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.thy-wallet-card {
  border: 1px solid rgba(139, 92, 246, .28);
  border-radius: 1.35rem;
  background: linear-gradient(145deg, rgba(17, 24, 39, .92), rgba(12, 12, 18, .95));
  padding: 1.15rem;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
}

.thy-wallet-label {
  display: block;
  color: rgba(226, 232, 240, .72);
  font-size: .82rem;
  margin-bottom: .55rem;
}

.thy-wallet-card strong {
  color: #ffffff;
  font-size: 1.25rem;
}

.thy-panel {
  border: 1px solid rgba(139, 92, 246, .3);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, .94), rgba(10, 10, 15, .98));
  padding: 1.25rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

.thy-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.thy-muted {
  color: rgba(226, 232, 240, .62);
  max-width: 36rem;
}

.thy-table-wrap {
  overflow-x: auto;
}

.thy-table {
  width: 100%;
  border-collapse: collapse;
}

.thy-table th,
.thy-table td {
  padding: .85rem;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  text-align: left;
}

.thy-table th {
  color: rgba(226, 232, 240, .72);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.thy-table td {
  color: rgba(248, 250, 252, .92);
}

.thy-table .positive {
  color: #86efac;
}

.thy-table .negative {
  color: #fca5a5;
}

.thy-empty-state {
  padding: 2rem;
  border: 1px dashed rgba(139, 92, 246, .36);
  border-radius: 1rem;
  color: rgba(248, 250, 252, .86);
  background: rgba(15, 23, 42, .5);
}

@media (max-width: 1100px) {
  .thy-wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .thy-wallet-grid {
    grid-template-columns: 1fr;
  }

  .thy-panel-head {
    display: block;
  }
}



/* FASE 14.2C - account thy scroll ui */
.thy-page-shell {
  width: min(1280px, calc(100vw - 64px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

.thy-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.thy-page-head h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
}

.thy-page-head p {
  color: rgba(232, 225, 255, 0.82);
}

.thy-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: #c6adff;
  font-weight: 800;
}

.thy-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.thy-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.thy-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thy-card {
  border: 1px solid rgba(139, 92, 246, 0.28);
  background:
    radial-gradient(circle at 14% 0%, rgba(139, 92, 246, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(16, 18, 35, 0.96), rgba(9, 11, 22, 0.98));
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color: #f7f2ff;
}

.thy-card h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  color: #ffffff;
}

.thy-card p {
  color: rgba(232, 225, 255, 0.82);
}

.thy-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(54, 23, 104, 0.82));
  color: #ffffff;
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.42);
}

.thy-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.thy-detail-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 10px 0;
}

.thy-detail-list dt {
  color: rgba(205, 198, 231, 0.72);
}

.thy-detail-list dd {
  margin: 0;
  color: #ffffff;
  font-weight: 700;
}

.thy-form-grid {
  display: grid;
  gap: 16px;
}

.thy-form-grid label {
  display: grid;
  gap: 8px;
  color: rgba(232, 225, 255, 0.9);
  font-weight: 700;
}

.thy-form-grid input,
.thy-form-grid select,
.thy-form-grid textarea {
  width: 100%;
  border: 1px solid rgba(139, 92, 246, 0.26);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(7, 8, 14, 0.86);
  color: #ffffff;
}

.thy-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.thy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(139, 92, 246, 0.42);
  border-radius: 14px;
  padding: 12px 18px;
  background: rgba(20, 17, 32, 0.92);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.thy-btn.primary {
  border-color: rgba(167, 139, 250, 0.7);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.thy-btn.danger {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.thy-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(234, 179, 8, 0.42);
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(234, 179, 8, 0.08);
  color: #facc15;
  font-weight: 900;
}

.thy-balance-pill.big {
  font-size: 1.2rem;
  padding: 18px 26px;
}

.thy-table-wrap {
  overflow: auto;
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 18px;
}

.thy-table {
  width: 100%;
  border-collapse: collapse;
}

.thy-table th,
.thy-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.thy-table th {
  color: rgba(205, 198, 231, 0.72);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thy-table td {
  color: #ffffff;
}

.thy-table .positive {
  color: #86efac;
}

.thy-table .negative {
  color: #fca5a5;
}

.thy-empty-state {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px;
  color: rgba(232, 225, 255, 0.78);
}

.back-to-top-btn {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.58);
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 0 18px 50px rgba(124, 58, 237, 0.45);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .thy-page-shell {
    width: min(100% - 28px, 720px);
    padding-top: 32px;
  }

  .thy-page-head {
    display: grid;
  }

  .thy-grid.two,
  .thy-grid.three {
    grid-template-columns: 1fr;
  }

  .thy-detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* FASE 14.2D2 - account ergonomic desktop */
.account-ergonomic-page {
  width: min(1320px, calc(100vw - 80px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.account-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.account-head-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(250, 196, 70, .45);
  background: linear-gradient(135deg, rgba(250, 196, 70, .18), rgba(126, 59, 238, .10));
  color: #f6d47b;
  box-shadow: 0 16px 40px rgba(250, 196, 70, .10);
}

.account-head-pill span {
  color: rgba(255,255,255,.68);
  font-size: 13px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .85fr);
  gap: 22px;
  align-items: start;
}

.account-card {
  padding: 28px;
  border-radius: 26px;
  border: 1px solid rgba(138, 83, 255, .30);
  background:
    radial-gradient(circle at 0 0, rgba(147, 69, 255, .18), transparent 38%),
    linear-gradient(145deg, rgba(16, 20, 39, .98), rgba(8, 10, 20, .98));
  box-shadow: 0 26px 80px rgba(0,0,0,.34);
}

.account-identity-card,
.account-password-card {
  grid-column: 1;
}

.account-stats-card,
.account-danger-card {
  grid-column: 2;
}

.account-card .thy-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(162, 97, 255, .52);
  background: radial-gradient(circle at 35% 20%, rgba(180, 95, 255, .85), rgba(62, 30, 120, .62) 48%, rgba(13, 15, 30, .92));
  box-shadow: 0 0 26px rgba(142, 74, 255, .25);
}

.account-card .thy-card-icon.danger {
  border-color: rgba(255, 91, 111, .45);
  background: radial-gradient(circle at 35% 20%, rgba(255, 91, 111, .55), rgba(62, 30, 80, .58) 48%, rgba(13, 15, 30, .92));
}

.account-card-title h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.05;
}

.account-card-title p {
  margin: 0 0 24px;
  color: rgba(239, 232, 255, .76);
  line-height: 1.55;
}

.account-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.account-data-grid.compact {
  grid-template-columns: 1fr;
}

.account-data-grid div {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
}

.account-data-grid dt {
  margin: 0 0 8px;
  color: rgba(222, 211, 255, .64);
  font-size: 13px;
  letter-spacing: .02em;
}

.account-data-grid dd {
  margin: 0;
  color: rgba(255,255,255,.95);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-avatar-note,
.account-danger-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(138, 83, 255, .24);
  background: rgba(138, 83, 255, .08);
  color: rgba(242, 236, 255, .82);
}

.account-avatar-note strong {
  display: block;
  color: #fff;
  margin-bottom: 6px;
}

.account-form-wrap form {
  display: grid;
  gap: 14px;
  margin: 0;
}

.account-form-wrap label {
  display: grid;
  gap: 7px;
  color: rgba(242, 236, 255, .82);
  font-weight: 700;
}

.account-form-wrap input,
.account-form-wrap textarea,
.account-form-wrap select {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(0,0,0,.24);
  color: #fff;
  padding: 11px 13px;
}

.account-form-wrap button,
.account-delete-link-wrap .thy-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(124,58,237,.26);
}

.account-delete-link-wrap .thy-btn,
.account-delete-link-wrap .danger {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  box-shadow: 0 14px 34px rgba(239,68,68,.22);
}

.account-form-wrap .password-wrap {
  width: 100%;
}

@media (max-width: 1100px) {
  .account-ergonomic-page {
    width: min(100%, calc(100vw - 36px));
    padding: 32px 0 64px;
  }

  .account-head,
  .account-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-identity-card,
  .account-password-card,
  .account-stats-card,
  .account-danger-card {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .account-data-grid {
    grid-template-columns: 1fr;
  }

  .account-card {
    padding: 22px;
    border-radius: 22px;
  }
}


/* FASE 14.3A - account inventory marketplace appstore */
.account-ordered-page,
.inventory-page,
.marketplace-page {
  width: min(1480px, calc(100vw - 80px));
  margin: 0 auto;
  padding: 48px 0 84px;
}

.account-sequence {
  display: grid;
  gap: 22px;
}

.account-section-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(138, 83, 255, .30);
  background:
    radial-gradient(circle at 0 0, rgba(147, 69, 255, .18), transparent 36%),
    linear-gradient(145deg, rgba(16, 20, 39, .98), rgba(8, 10, 20, .98));
  box-shadow: 0 28px 90px rgba(0,0,0,.34);
}

.account-section-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(162, 97, 255, .55);
  background: radial-gradient(circle at 35% 20%, rgba(180, 95, 255, .85), rgba(62, 30, 120, .62) 48%, rgba(13, 15, 30, .92));
  box-shadow: 0 0 28px rgba(142, 74, 255, .26);
}

.account-section-icon.danger {
  border-color: rgba(255, 91, 111, .45);
  background: radial-gradient(circle at 35% 20%, rgba(255, 91, 111, .60), rgba(62, 30, 80, .58) 48%, rgba(13, 15, 30, .92));
}

.thy-coin-icon {
  color: #f7c948;
  border-color: rgba(247, 201, 72, .54);
  background: radial-gradient(circle at 35% 20%, rgba(247, 201, 72, .42), rgba(83, 63, 23, .52) 48%, rgba(13, 15, 30, .92));
}

.account-section-title h2,
.account-section-title h3 {
  margin: 0 0 8px;
}

.account-section-title p {
  margin: 0 0 22px;
  color: rgba(239, 232, 255, .76);
  line-height: 1.55;
}

.account-section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
}

.account-thy-summary,
.account-inventory-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.account-inventory-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-thy-summary > div,
.account-inventory-preview > div {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.account-thy-summary span,
.account-inventory-preview span {
  display: block;
  margin-bottom: 8px;
  color: rgba(222, 211, 255, .64);
  font-size: 13px;
}

.account-thy-summary strong,
.account-inventory-preview strong {
  color: #fff;
  font-size: 20px;
}

.account-password-wrap {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.market-hero {
  min-height: 260px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
  padding: 42px;
  border-radius: 36px;
  border: 1px solid rgba(138, 83, 255, .32);
  background:
    radial-gradient(circle at 12% 10%, rgba(142, 68, 255, .35), transparent 34%),
    radial-gradient(circle at 85% 10%, rgba(247, 201, 72, .13), transparent 30%),
    linear-gradient(135deg, rgba(25, 20, 55, .98), rgba(8, 12, 24, .99));
  box-shadow: 0 34px 110px rgba(0,0,0,.40);
}

.market-logo-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.market-logo-mark {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 22px 60px rgba(124,58,237,.36);
}

.market-hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 74px);
  letter-spacing: -.045em;
}

.market-hero p {
  max-width: 780px;
  color: rgba(239, 232, 255, .78);
  line-height: 1.55;
  font-size: 18px;
}

.market-hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.thy-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  justify-content: center;
  padding: 15px 18px;
  border-radius: 999px;
  border: 1px solid rgba(247, 201, 72, .42);
  background: rgba(247, 201, 72, .10);
  color: #f7c948;
}

.market-search-card {
  margin-top: -44px;
  margin-left: 42px;
  margin-right: 42px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10, 13, 28, .86);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(0,0,0,.30);
}

.market-search-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}

.market-search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
}

.market-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.market-filter-row a {
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.11);
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-weight: 800;
}

.market-filter-row a.active,
.market-filter-row a:hover {
  border-color: rgba(168,85,247,.70);
  background: rgba(124,58,237,.25);
  color: #fff;
}

.featured-experience-card {
  margin-top: 34px;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  padding: 42px;
  border-radius: 36px;
  border: 1px solid rgba(168,85,247,.55);
  background:
    radial-gradient(circle at 72% 20%, rgba(168,85,247,.35), transparent 28%),
    linear-gradient(135deg, rgba(5,8,20,.98), rgba(30,24,62,.98));
  box-shadow: 0 36px 120px rgba(0,0,0,.45);
}

.featured-content {
  align-self: end;
}

.featured-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(247, 201, 72, .14);
  color: #f7c948;
  font-weight: 900;
}

.featured-content h2 {
  margin: 0 0 12px;
  font-size: clamp(46px, 5.5vw, 86px);
  letter-spacing: -.055em;
}

.featured-content p {
  max-width: 760px;
  color: rgba(239, 232, 255, .78);
  font-size: 20px;
  line-height: 1.5;
}

.featured-tags,
.appstore-card-meta,
.my-thydom-meta,
.inventory-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.featured-tags span,
.appstore-card-meta span,
.my-thydom-meta span,
.inventory-item-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(168,85,247,.28);
  background: rgba(168,85,247,.12);
  color: rgba(244, 238, 255, .86);
  font-size: 13px;
  font-weight: 800;
}

.featured-stats {
  display: grid;
  gap: 16px;
  align-content: end;
}

.featured-stats > div {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.24);
}

.featured-stats strong {
  display: block;
  color: #fff;
  font-size: 30px;
}

.featured-stats span {
  color: rgba(222,211,255,.72);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 34px 0 18px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 34px;
}

.appstore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.appstore-card {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(138,83,255,.28);
  background: linear-gradient(145deg, rgba(15,19,38,.98), rgba(8,10,22,.98));
  box-shadow: 0 26px 80px rgba(0,0,0,.30);
}

.appstore-card-art {
  height: 190px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(168,85,247,.38), transparent 34%),
    linear-gradient(135deg, rgba(37, 31, 79, .9), rgba(7, 10, 22, .95));
}

.appstore-card-art span {
  width: 86px;
  height: 86px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: rgba(124,58,237,.42);
  border: 1px solid rgba(168,85,247,.60);
  color: #fff;
  font-size: 36px;
}

.appstore-card-body {
  padding: 24px;
}

.appstore-card-body h3 {
  margin: 0 0 8px;
  font-size: 26px;
}

.appstore-card-body p {
  min-height: 58px;
  color: rgba(239,232,255,.72);
}

.appstore-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.my-thydoms-list {
  margin-top: 28px;
}

.my-thydom-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 14px;
  border-radius: 24px;
  border: 1px solid rgba(138,83,255,.25);
  background: linear-gradient(135deg, rgba(15,19,38,.98), rgba(8,10,22,.98));
}

.my-thydom-icon,
.inventory-item-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: rgba(124,58,237,.30);
  border: 1px solid rgba(168,85,247,.50);
}

.my-thydom-main h3 {
  margin: 0 0 6px;
}

.my-thydom-actions {
  display: flex;
  gap: 10px;
}

.inventory-toolbar {
  display: grid;
  gap: 16px;
  padding: 22px;
  margin-bottom: 24px;
}

.inventory-toolbar input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #fff;
}

.inventory-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inventory-filters button {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.78);
  font-weight: 800;
}

.inventory-filters button.active {
  border-color: rgba(168,85,247,.62);
  background: rgba(124,58,237,.22);
  color: #fff;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.inventory-empty,
.market-empty {
  grid-column: 1 / -1;
  padding: 34px;
  border-radius: 28px;
}

@media (max-width: 1200px) {
  .appstore-grid,
  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-experience-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .account-ordered-page,
  .inventory-page,
  .marketplace-page {
    width: min(100%, calc(100vw - 32px));
    padding: 32px 0 70px;
  }

  .account-section-card,
  .my-thydom-row {
    grid-template-columns: 1fr;
  }

  .account-section-title-row,
  .market-hero,
  .section-title-row {
    display: grid;
  }

  .account-thy-summary,
  .account-inventory-preview,
  .appstore-grid,
  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .market-search-card {
    margin-left: 0;
    margin-right: 0;
  }

  .market-hero {
    padding: 28px;
  }
}


/* FASE 14.3B PRODUCT UI CORRECTION */
.side-thy-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.account-shell,
.market-shell,
.thy-wallet-shell,
.inventory-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 44px 42px 80px;
}

.account-hero,
.market-hero,
.thy-panel {
  border: 1px solid rgba(155, 92, 255, .35);
  background:
    radial-gradient(circle at top left, rgba(142, 72, 255, .18), transparent 38%),
    linear-gradient(135deg, rgba(20, 22, 38, .96), rgba(10, 12, 22, .96));
  box-shadow: 0 24px 70px rgba(0,0,0,.36);
  border-radius: 28px;
}

.account-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
  margin-bottom: 28px;
}

.account-grid-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.account-wide {
  grid-column: 1 / -1;
}

.account-avatar-static {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  background: rgba(255,255,255,.04);
}

.account-avatar-static img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(155, 92, 255, .75);
  box-shadow: 0 0 24px rgba(155,92,255,.35);
}

.thy-panel {
  padding: 26px;
}

.thy-panel-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.thy-panel-icon,
.thy-panel-img-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(166,87,255,.75), rgba(48,22,86,.45));
  border: 1px solid rgba(155,92,255,.58);
  box-shadow: 0 0 24px rgba(155,92,255,.28);
}

.thy-panel-img-icon {
  object-fit: contain;
  padding: 8px;
}

.account-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-data-grid div {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}

.account-data-grid span {
  display: block;
  color: rgba(235,230,255,.68);
  font-size: .88rem;
  margin-bottom: 5px;
}

.account-data-grid strong {
  color: #fff;
  overflow-wrap: anywhere;
}

.thy-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.thy-form-grid-3 .form-actions {
  grid-column: 1 / -1;
}

.thy-balance-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 14px;
}

.thy-balance-big strong {
  font-size: 2.6rem;
  color: #fff;
}

.thy-balance-big span {
  color: #f1bd3a;
  font-weight: 800;
}

/* Marketplace tipo App Store */
.appstore-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  padding: 34px;
  margin-bottom: 28px;
  overflow: hidden;
}

.appstore-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: .28;
  pointer-events: none;
}

.market-hero-copy,
.market-wallet-badge {
  position: relative;
  z-index: 1;
}

.market-brand-logo {
  max-width: 220px;
  max-height: 58px;
  object-fit: contain;
  margin-bottom: 18px;
}

.market-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 24px 0 20px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.1);
}

.market-search input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 1rem;
}

.style-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.style-pill {
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(155,92,255,.35);
  background: rgba(255,255,255,.04);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.style-pill.active {
  background: linear-gradient(135deg, rgba(126,55,242,.75), rgba(166,87,255,.55));
}

.market-wallet-badge {
  align-self: start;
  justify-self: end;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(241,189,58,.45);
  background: rgba(241,189,58,.08);
  color: #f1bd3a;
}

.market-wallet-badge img {
  width: 28px;
  height: 28px;
}

.featured-experience-card {
  position: relative;
  min-height: 340px;
  border: 1px solid rgba(155,92,255,.55);
  border-radius: 32px;
  overflow: hidden;
  margin-bottom: 34px;
  box-shadow: 0 26px 80px rgba(0,0,0,.42);
}

.featured-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 120px minmax(0,1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 34px;
  background: linear-gradient(90deg, rgba(5,7,15,.92), rgba(10,8,24,.76), rgba(10,8,24,.45));
}

.featured-app-icon,
.appstore-icon,
.my-thydom-icon {
  object-fit: cover;
  border-radius: 26px;
  border: 1px solid rgba(155,92,255,.7);
  box-shadow: 0 0 28px rgba(155,92,255,.35);
}

.featured-app-icon {
  width: 112px;
  height: 112px;
}

.featured-overlay h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  margin: 0 0 10px;
}

.market-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.market-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(155,92,255,.34);
  background: rgba(155,92,255,.11);
  color: #d9c8ff;
  font-weight: 700;
  font-size: .82rem;
}

.market-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.appstore-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.appstore-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(155,92,255,.32);
  background: linear-gradient(135deg, rgba(17,20,35,.96), rgba(10,12,22,.96));
  box-shadow: 0 22px 62px rgba(0,0,0,.35);
}

.appstore-card-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  opacity: .85;
}

.appstore-card-body {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  padding: 18px;
  flex: 1;
}

.appstore-icon {
  width: 72px;
  height: 72px;
}

.thy-btn.full {
  margin: 0 18px 18px;
  width: auto;
  text-align: center;
}

.thy-btn.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.my-thydoms-list {
  display: grid;
  gap: 16px;
}

.my-thydom-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(155,92,255,.32);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(17,20,35,.96), rgba(10,12,22,.96));
}

.my-thydom-icon {
  width: 72px;
  height: 72px;
}

.my-thydom-actions {
  display: flex;
  gap: 10px;
}

/* Botón global subir arriba */
.back-to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 10000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(155,92,255,.65);
  background: radial-gradient(circle at top, #a657ff, #5f29d8);
  color: white;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 18px 46px rgba(100,55,220,.42);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .account-grid-main,
  .appstore-grid,
  .account-grid-2,
  .appstore-hero {
    grid-template-columns: 1fr;
  }

  .featured-overlay {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .thy-form-grid-3 {
    grid-template-columns: 1fr;
  }

  .my-thydom-row {
    grid-template-columns: 1fr;
  }
}

/* === THYDOM FULL UI REBUILD START === */

:root {
  --th-bg: #0f1117;
  --th-surface: #171a22;
  --th-surface-strong: #202431;
  --th-border: rgba(255, 255, 255, 0.10);
  --th-text: #f4f1ea;
  --th-muted: #a7a9b4;
  --th-soft: #d8d1c2;
  --th-accent: #d7b46a;
  --th-accent-soft: rgba(215, 180, 106, 0.15);
  --th-radius-xl: 32px;
  --th-radius-lg: 24px;
  --th-shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.24);
  --th-shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.th-eyebrow {
  margin: 0 0 8px;
  color: var(--th-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.th-store-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background:
    radial-gradient(circle at 82% 10%, rgba(215, 180, 106, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    var(--th-surface);
  box-shadow: var(--th-shadow-soft);
}

.th-store-head h1 {
  margin: 0;
  color: var(--th-text);
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 1.02;
}

.th-store-head p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--th-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.th-store-head__logo {
  display: block;
  width: 220px;
  height: 72px;
  object-fit: contain;
  justify-self: end;
}

.th-store-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.th-store-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--th-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--th-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
}

.th-store-filter:hover,
.th-store-filter.is-active {
  border-color: rgba(215, 180, 106, 0.58);
  background: var(--th-accent-soft);
  color: var(--th-text);
}

.th-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.th-store-card {
  display: flex;
  flex-direction: column;
  min-height: 318px;
  padding: 26px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background:
    radial-gradient(circle at top, rgba(215, 180, 106, 0.14), transparent 43%),
    var(--th-surface);
  box-shadow: var(--th-shadow-soft);
  color: var(--th-text);
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.th-store-card:hover {
  transform: translateY(-5px);
  border-color: rgba(215, 180, 106, 0.54);
  background:
    radial-gradient(circle at top, rgba(215, 180, 106, 0.22), transparent 45%),
    var(--th-surface-strong);
  box-shadow: var(--th-shadow-strong);
}

.th-store-card__icon-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  margin-bottom: 20px;
}

.th-store-card__icon {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  background: rgba(255, 255, 255, 0.05);
}

.th-store-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.th-store-card__body h2 {
  margin: 0;
  color: var(--th-text);
  font-size: 1.14rem;
  line-height: 1.25;
  text-align: center;
}

.th-store-card__tags,
.th-store-card__stats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--th-muted);
  font-size: 0.84rem;
}

.th-store-card__tags span,
.th-store-card__stats span {
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-product {
  display: flex;
  flex-direction: column;
}

.th-product-hero {
  position: relative;
  min-height: 300px;
  border-radius: var(--th-radius-xl);
  overflow: hidden;
  background-color: var(--th-surface-strong);
  background-position: center;
  background-size: cover;
  box-shadow: var(--th-shadow-soft);
}

.th-product-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 17, 23, 0.04), rgba(15, 17, 23, 0.84)),
    radial-gradient(circle at 22% 18%, rgba(215, 180, 106, 0.20), transparent 34%);
}

.th-product-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) auto;
  gap: 26px;
  align-items: end;
  margin: -74px 28px 34px;
}

.th-product-summary__icon-frame {
  width: 158px;
  height: 158px;
  padding: 11px;
  border: 1px solid var(--th-border);
  border-radius: 36px;
  background: rgba(15, 17, 23, 0.95);
  box-shadow: var(--th-shadow-strong);
}

.th-product-summary__icon {
  display: block;
  width: 136px;
  height: 136px;
  object-fit: cover;
  border-radius: 28px;
}

.th-product-summary__copy {
  min-width: 0;
}

.th-product-summary__copy h1 {
  margin: 0;
  color: var(--th-text);
  font-size: clamp(2.2rem, 4.3vw, 4rem);
  line-height: 1.02;
}

.th-product-summary__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.th-product-summary__meta span {
  padding: 7px 11px;
  border: 1px solid var(--th-border);
  border-radius: 999px;
  background: rgba(15, 17, 23, 0.74);
  color: var(--th-soft);
  font-size: 0.88rem;
}

.th-product-summary__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.th-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.th-btn--primary {
  background: var(--th-accent);
  color: #17120a;
}

.th-btn--secondary {
  border-color: var(--th-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--th-text);
}

.th-product-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 24px;
}

.th-panel,
.th-empty-state {
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background: var(--th-surface);
  box-shadow: var(--th-shadow-soft);
}

.th-panel {
  padding: 26px;
}

.th-panel h2,
.th-empty-state h2 {
  margin: 0 0 14px;
  color: var(--th-text);
}

.th-panel p,
.th-empty-state p {
  margin: 0;
  color: var(--th-soft);
  line-height: 1.75;
}

.th-fact-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.th-fact-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--th-border);
}

.th-fact-list dt {
  color: var(--th-muted);
}

.th-fact-list dd {
  margin: 0;
  color: var(--th-text);
  font-weight: 800;
}

.th-fact-list__thy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.th-fact-list__thy img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.th-empty-state {
  grid-column: 1 / -1;
  padding: 36px;
  text-align: center;
}

.th-empty-state__icon {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 24px;
  margin: 0 auto 18px;
}

@media (max-width: 1100px) {
  .th-product-summary {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .th-product-summary__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .th-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .th-store-head {
    grid-template-columns: 1fr;
  }

  .th-store-head__logo {
    justify-self: start;
  }

  .th-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .th-product-grid {
    grid-template-columns: 1fr;
  }

  .th-product-summary {
    grid-template-columns: 1fr;
    margin: -66px 18px 30px;
  }

  .th-product-summary__icon-frame {
    width: 144px;
    height: 144px;
  }

  .th-product-summary__icon {
    width: 122px;
    height: 122px;
  }
}

@media (max-width: 520px) {
  .th-store-grid {
    grid-template-columns: 1fr;
  }
}

/* === THYDOM FULL UI REBUILD END === */

/* === THYDOM FIX SIDEBAR STORE RENDER START === */

/* La moneda THY no se usa como elemento de menú lateral. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"] {
  display: none !important;
}

/* Defensa contra imágenes gigantes en navegación lateral. */
aside img,
nav img,
.sidebar img,
.app-sidebar img,
.private-sidebar img,
.layout-sidebar img,
.sidenav img,
#sidebar img {
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
}

/* Excepciones para logotipo de marca, con tamaño controlado. */
.th-store-head__logo,
.brand-logo,
.app-brand img,
.sidebar-brand img,
.private-brand img {
  width: 220px;
  max-width: 220px;
  height: 72px;
  max-height: 72px;
  object-fit: contain;
}

/* Rebuild visual marketplace. */
:root {
  --th-bg: #0f1117;
  --th-surface: #171a22;
  --th-surface-strong: #202431;
  --th-border: rgba(255, 255, 255, 0.10);
  --th-text: #f4f1ea;
  --th-muted: #a7a9b4;
  --th-soft: #d8d1c2;
  --th-accent: #d7b46a;
  --th-accent-soft: rgba(215, 180, 106, 0.15);
  --th-radius-xl: 32px;
  --th-shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.24);
  --th-shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.th-eyebrow {
  margin: 0 0 8px;
  color: var(--th-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.th-store-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: center;
  margin: 0 0 28px;
  padding: 28px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background:
    radial-gradient(circle at 82% 10%, rgba(215, 180, 106, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    var(--th-surface);
  box-shadow: var(--th-shadow-soft);
}

.th-store-head h1 {
  margin: 0;
  color: var(--th-text);
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 1.02;
}

.th-store-head p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--th-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.th-store-head__logo {
  display: block;
  justify-self: end;
}

.th-store-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.th-store-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--th-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--th-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
}

.th-store-filter:hover,
.th-store-filter.is-active {
  border-color: rgba(215, 180, 106, 0.58);
  background: var(--th-accent-soft);
  color: var(--th-text);
}

.th-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.th-store-card {
  display: flex;
  flex-direction: column;
  min-height: 318px;
  padding: 26px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background:
    radial-gradient(circle at top, rgba(215, 180, 106, 0.14), transparent 43%),
    var(--th-surface);
  box-shadow: var(--th-shadow-soft);
  color: var(--th-text);
  text-decoration: none;
  overflow: hidden;
}

.th-store-card:hover {
  transform: translateY(-5px);
  border-color: rgba(215, 180, 106, 0.54);
  background:
    radial-gradient(circle at top, rgba(215, 180, 106, 0.22), transparent 45%),
    var(--th-surface-strong);
  box-shadow: var(--th-shadow-strong);
}

.th-store-card__icon-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  margin-bottom: 20px;
}

.th-store-card__icon {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  background: rgba(255, 255, 255, 0.05);
}

.th-store-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.th-store-card__body h2 {
  margin: 0;
  color: var(--th-text);
  font-size: 1.14rem;
  line-height: 1.25;
  text-align: center;
}

.th-store-card__tags,
.th-store-card__stats {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--th-muted);
  font-size: 0.84rem;
}

.th-store-card__tags span,
.th-store-card__stats span {
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-empty-state {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background: var(--th-surface);
  box-shadow: var(--th-shadow-soft);
  text-align: center;
}

.th-empty-state__icon {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 24px;
  margin: 0 auto 18px;
}

.th-product-hero {
  position: relative;
  min-height: 300px;
  border-radius: var(--th-radius-xl);
  overflow: hidden;
  background-color: var(--th-surface-strong);
  background-position: center;
  background-size: cover;
  box-shadow: var(--th-shadow-soft);
}

.th-product-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 17, 23, 0.04), rgba(15, 17, 23, 0.84)),
    radial-gradient(circle at 22% 18%, rgba(215, 180, 106, 0.20), transparent 34%);
}

.th-product-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr) auto;
  gap: 26px;
  align-items: end;
  margin: -74px 28px 34px;
}

.th-product-summary__icon-frame {
  width: 158px;
  height: 158px;
  padding: 11px;
  border: 1px solid var(--th-border);
  border-radius: 36px;
  background: rgba(15, 17, 23, 0.95);
  box-shadow: var(--th-shadow-strong);
}

.th-product-summary__icon {
  display: block;
  width: 136px;
  height: 136px;
  object-fit: cover;
  border-radius: 28px;
}

.th-product-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 24px;
}

.th-panel {
  padding: 26px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-xl);
  background: var(--th-surface);
  box-shadow: var(--th-shadow-soft);
}

@media (max-width: 760px) {
  .th-store-head {
    grid-template-columns: 1fr;
  }

  .th-store-head__logo {
    justify-self: start;
  }

  .th-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .th-product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .th-store-grid {
    grid-template-columns: 1fr;
  }
}

/* === THYDOM FIX SIDEBAR STORE RENDER END === */

/* === THYDOM VISUAL STORE V2 START === */

/* THY no se pinta en marketplace, detalle ni navegación. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.th-product img[src*="THY_Mini"],
.th-store-page img[src*="THY_Mini"] {
  display: none !important;
}

/* Evitar imágenes gigantes en navegación. */
aside img,
nav img,
.sidebar img,
.app-sidebar img,
.private-sidebar img,
.layout-sidebar img,
.sidenav img,
#sidebar img {
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
}

:root {
  --th-bg: #0f1117;
  --th-surface: #171a22;
  --th-surface-strong: #202431;
  --th-border: rgba(255, 255, 255, 0.10);
  --th-text: #f4f1ea;
  --th-muted: #a7a9b4;
  --th-soft: #d8d1c2;
  --th-accent: #d7b46a;
  --th-accent-soft: rgba(215, 180, 106, 0.15);
  --th-radius-xl: 32px;
  --th-shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.24);
  --th-shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.38);
}

/* Ampliar contenedores del layout privado solo en vistas Thydom. */
body:has(.th-store-page) main,
body:has(.th-product) main,
body:has(.th-store-page) .content,
body:has(.th-product) .content,
body:has(.th-store-page) .main-content,
body:has(.th-product) .main-content,
body:has(.th-store-page) .private-content,
body:has(.th-product) .private-content,
body:has(.th-store-page) .page-content,
body:has(.th-product) .page-content,
body:has(.th-store-page) .app-content,
body:has(.th-product) .app-content,
body:has(.th-store-page) .app-main,
body:has(.th-product) .app-main,
body:has(.th-store-page) .layout-main,
body:has(.th-product) .layout-main {
  width: 100% !important;
  max-width: none !important;
}

.th-store-page,
.th-product {
  width: 100% !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding: 42px 48px 72px !important;
  box-sizing: border-box !important;
}

.th-eyebrow {
  margin: 0 0 8px !important;
  color: var(--th-accent) !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.th-store-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 240px !important;
  gap: 28px !important;
  align-items: center !important;
  margin: 0 0 28px !important;
  padding: 28px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-xl) !important;
  background:
    radial-gradient(circle at 82% 10%, rgba(215, 180, 106, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    var(--th-surface) !important;
  box-shadow: var(--th-shadow-soft) !important;
}

.th-store-head h1 {
  margin: 0 !important;
  color: var(--th-text) !important;
  font-size: clamp(2.1rem, 4vw, 3.8rem) !important;
  line-height: 1.02 !important;
}

.th-store-head p {
  max-width: 760px !important;
  margin: 12px 0 0 !important;
  color: var(--th-muted) !important;
  font-size: 1rem !important;
  line-height: 1.65 !important;
}

.th-store-head__logo {
  display: block !important;
  width: 220px !important;
  height: 72px !important;
  max-width: 220px !important;
  max-height: 72px !important;
  object-fit: contain !important;
  justify-self: end !important;
}

.th-store-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin: 0 0 28px !important;
  padding: 0 !important;
}

.th-store-filter {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  padding: 0 16px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: var(--th-soft) !important;
  text-decoration: none !important;
  font-size: 0.92rem !important;
  font-weight: 750 !important;
}

.th-store-filter:hover,
.th-store-filter.is-active {
  border-color: rgba(215, 180, 106, 0.58) !important;
  background: var(--th-accent-soft) !important;
  color: var(--th-text) !important;
}

/* Grid store: 2-4 columnas reales. */
.th-store-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)) !important;
  gap: 24px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: none !important;
}

.th-store-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 318px !important;
  padding: 26px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-xl) !important;
  background:
    radial-gradient(circle at top, rgba(215, 180, 106, 0.14), transparent 43%),
    var(--th-surface) !important;
  box-shadow: var(--th-shadow-soft) !important;
  color: var(--th-text) !important;
  text-decoration: none !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.th-store-card:hover {
  transform: translateY(-5px) !important;
  border-color: rgba(215, 180, 106, 0.54) !important;
  background:
    radial-gradient(circle at top, rgba(215, 180, 106, 0.22), transparent 45%),
    var(--th-surface-strong) !important;
  box-shadow: var(--th-shadow-strong) !important;
}

.th-store-card__icon-frame {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 148px !important;
  margin-bottom: 20px !important;
}

.th-store-card__icon {
  display: block !important;
  width: 120px !important;
  height: 120px !important;
  max-width: 120px !important;
  max-height: 120px !important;
  object-fit: cover !important;
  border-radius: 28px !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

.th-store-card__body {
  display: flex !important;
  flex: 1 !important;
  flex-direction: column !important;
  gap: 11px !important;
  min-width: 0 !important;
}

.th-store-card__body h2 {
  margin: 0 !important;
  color: var(--th-text) !important;
  font-size: 1.14rem !important;
  line-height: 1.25 !important;
  text-align: center !important;
  text-decoration: none !important;
}

.th-store-card__tags,
.th-store-card__stats {
  display: flex !important;
  justify-content: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  color: var(--th-muted) !important;
  font-size: 0.84rem !important;
}

.th-store-card__tags span,
.th-store-card__stats span {
  max-width: 100% !important;
  padding: 5px 9px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Detalle producto. */
.th-product-hero {
  position: relative !important;
  min-height: 320px !important;
  border-radius: var(--th-radius-xl) !important;
  overflow: hidden !important;
  background-color: var(--th-surface-strong) !important;
  background-position: center !important;
  background-size: cover !important;
  box-shadow: var(--th-shadow-soft) !important;
}

.th-product-hero__shade {
  position: absolute !important;
  inset: 0 !important;
  background:
    linear-gradient(180deg, rgba(15, 17, 23, 0.04), rgba(15, 17, 23, 0.84)),
    radial-gradient(circle at 22% 18%, rgba(215, 180, 106, 0.20), transparent 34%) !important;
}

.th-product-summary {
  position: relative !important;
  z-index: 2 !important;
  display: grid !important;
  grid-template-columns: 158px minmax(0, 1fr) auto !important;
  gap: 26px !important;
  align-items: end !important;
  margin: -74px 28px 34px !important;
}

.th-product-summary__icon-frame {
  width: 158px !important;
  height: 158px !important;
  padding: 11px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: 36px !important;
  background: rgba(15, 17, 23, 0.95) !important;
  box-shadow: var(--th-shadow-strong) !important;
}

.th-product-summary__icon {
  display: block !important;
  width: 136px !important;
  height: 136px !important;
  max-width: 136px !important;
  max-height: 136px !important;
  object-fit: cover !important;
  border-radius: 28px !important;
}

.th-product-summary__copy h1 {
  margin: 0 !important;
  color: var(--th-text) !important;
  font-size: clamp(2.2rem, 4.3vw, 4rem) !important;
  line-height: 1.02 !important;
}

.th-product-summary__meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 14px !important;
}

.th-product-summary__meta span {
  padding: 7px 11px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: 999px !important;
  background: rgba(15, 17, 23, 0.74) !important;
  color: var(--th-soft) !important;
  font-size: 0.88rem !important;
}

.th-product-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr) !important;
  gap: 24px !important;
}

.th-panel,
.th-empty-state {
  padding: 26px !important;
  border: 1px solid var(--th-border) !important;
  border-radius: var(--th-radius-xl) !important;
  background: var(--th-surface) !important;
  box-shadow: var(--th-shadow-soft) !important;
}

.th-empty-state {
  grid-column: 1 / -1 !important;
  text-align: center !important;
}

.th-empty-state__icon {
  display: block !important;
  width: 104px !important;
  height: 104px !important;
  max-width: 104px !important;
  max-height: 104px !important;
  object-fit: cover !important;
  border-radius: 24px !important;
  margin: 0 auto 18px !important;
}

.th-fact-list {
  display: grid !important;
  gap: 14px !important;
  margin: 0 !important;
}

.th-fact-list div {
  display: flex !important;
  justify-content: space-between !important;
  gap: 18px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--th-border) !important;
}

.th-fact-list dt {
  color: var(--th-muted) !important;
}

.th-fact-list dd {
  margin: 0 !important;
  color: var(--th-text) !important;
  font-weight: 800 !important;
}

@media (max-width: 1100px) {
  .th-store-page,
  .th-product {
    padding: 28px 24px 56px !important;
  }

  .th-product-summary {
    grid-template-columns: 150px minmax(0, 1fr) !important;
  }

  .th-product-summary__actions {
    grid-column: 1 / -1 !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 760px) {
  .th-store-head {
    grid-template-columns: 1fr !important;
  }

  .th-store-head__logo {
    justify-self: start !important;
  }

  .th-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .th-product-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 520px) {
  .th-store-grid {
    grid-template-columns: 1fr !important;
  }
}

/* === THYDOM VISUAL STORE V2 END === */

/* === THYDOM VISUAL HARD SAFETY START === */

aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

aside img,
nav img,
.sidebar img,
.app-sidebar img,
.private-sidebar img,
.layout-sidebar img,
.sidenav img,
#sidebar img {
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
}

/* === THYDOM VISUAL HARD SAFETY END === */

/* === THYDOM SIDEBAR MARKETPLACE MYTHYDOMS FIX START === */

/* Sidebar: anular falso activo permanente de THY. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Sidebar: activos reales por ruta. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual para THY si falta icono en el enlace. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈";
  display: inline-flex;
  width: 18px;
  margin-right: 10px;
  opacity: .82;
  color: #e7b84a;
}

/* THY no se usa como imagen en sidebar/marketplace/detalle. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.th-store-app img[src*="THY_Mini"],
.th-product img[src*="THY_Mini"] {
  display: none !important;
}

/* Layout ancho para Marketplace y My Thydoms. */
body:has(.th-store-app) main,
body:has(.th-store-app) .content,
body:has(.th-store-app) .main-content,
body:has(.th-store-app) .private-content,
body:has(.th-store-app) .page-content,
body:has(.th-store-app) .app-content,
body:has(.th-store-app) .app-main,
body:has(.th-store-app) .layout-main {
  width: 100% !important;
  max-width: none !important;
  overflow-x: hidden !important;
}

.th-store-app,
.th-store-app * {
  box-sizing: border-box !important;
}

.th-store-app {
  --panel: rgba(14, 18, 32, .82);
  --panel2: rgba(21, 25, 43, .94);
  --line: rgba(174, 120, 255, .24);
  --line2: rgba(174, 120, 255, .52);
  --text: #f6f2ff;
  --muted: #aaa3ba;
  --purple: #8b49ff;
  --purple2: #c084fc;
  --gold: #e7b84a;

  width: 100% !important;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding: 34px 44px 76px !important;
  color: var(--text) !important;
}

.th-store-app__top {
  display: grid !important;
  grid-template-columns: 220px minmax(280px, 1fr) !important;
  gap: 22px !important;
  align-items: center !important;
  margin-bottom: 24px !important;
}

.th-store-app__logo {
  display: block !important;
  width: 220px !important;
  height: 72px !important;
  max-width: 220px !important;
  max-height: 72px !important;
  object-fit: contain !important;
}

.th-store-app__search {
  min-height: 54px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 18px !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.045) !important;
  color: var(--muted) !important;
  font-weight: 800 !important;
}

.th-store-app__filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin: 0 0 30px !important;
}

.th-store-app__filters a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 46px !important;
  padding: 0 18px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.045) !important;
  color: var(--text) !important;
  text-decoration: none !important;
  font-weight: 900 !important;
}

.th-store-app__filters a.is-active {
  border-color: rgba(139,73,255,.9) !important;
  background: linear-gradient(135deg, rgba(139,73,255,.42), rgba(139,73,255,.14)) !important;
}

.th-store-app__section-head {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-bottom: 22px !important;
}

.th-store-app__section-head h1 {
  margin: 0 !important;
  color: var(--text) !important;
  font-size: clamp(2.2rem, 4vw, 4rem) !important;
  line-height: 1 !important;
}

.th-store-app__section-head p {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 1rem !important;
}

/* Grid App Store: varias columnas reales. */
.th-app-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)) !important;
  gap: 22px !important;
  width: 100% !important;
}

.th-app-card {
  position: relative !important;
  min-height: 250px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  padding: 22px !important;
  border: 1px solid var(--line) !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  background-position: center !important;
  background-size: cover !important;
  color: var(--text) !important;
  text-decoration: none !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.34) !important;
}

.th-app-card__shade {
  position: absolute !important;
  inset: 0 !important;
  background:
    linear-gradient(180deg, rgba(5,7,13,.18), rgba(5,7,13,.92)),
    radial-gradient(circle at 20% 24%, rgba(139,73,255,.28), transparent 34%) !important;
  z-index: 0 !important;
}

.th-app-card__main,
.th-app-card__cta {
  position: relative !important;
  z-index: 1 !important;
}

.th-app-card__main {
  display: grid !important;
  grid-template-columns: 96px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: center !important;
}

.th-app-card__icon {
  display: block !important;
  width: 96px !important;
  height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: cover !important;
  border-radius: 24px !important;
  border: 2px solid rgba(174,120,255,.72) !important;
  background: rgba(255,255,255,.06) !important;
  box-shadow: 0 0 30px rgba(139,73,255,.38) !important;
}

.th-app-card__copy h2 {
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 1.45rem !important;
  line-height: 1.08 !important;
  text-decoration: none !important;
}

.th-app-card__copy p {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  margin: 8px 0 0 !important;
  color: rgba(246,242,255,.76) !important;
  line-height: 1.35 !important;
}

.th-app-card__meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 12px !important;
}

.th-app-card__meta span {
  display: inline-flex !important;
  min-height: 28px !important;
  align-items: center !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  background: rgba(139,73,255,.18) !important;
  color: #e9ddff !important;
  font-size: .82rem !important;
  font-weight: 800 !important;
}

.th-app-card__cta {
  width: fit-content !important;
  margin-top: 18px !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #a66cff, #6f32e7) !important;
  color: #fff !important;
  font-weight: 900 !important;
}

.th-app-empty {
  grid-column: 1 / -1 !important;
  padding: 32px !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  background: var(--panel) !important;
}

@media (max-width: 980px) {
  .th-store-app {
    padding: 28px 22px 58px !important;
  }

  .th-store-app__top {
    grid-template-columns: 1fr !important;
  }

  .th-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .th-app-grid {
    grid-template-columns: 1fr !important;
  }

  .th-app-card__main {
    grid-template-columns: 1fr !important;
  }
}

/* === THYDOM SIDEBAR MARKETPLACE MYTHYDOMS FIX END === */

/* === THYDOM SAFETY NO MOCK START === */

/* THY no se muestra en sidebar, Marketplace ni detalle. Solo debe aparecer en Cuenta/THY. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* Evitar imágenes gigantes en navegación. */
aside img,
nav img,
.sidebar img,
.app-sidebar img,
.private-sidebar img,
.layout-sidebar img,
.sidenav img,
#sidebar img {
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
}

/* Anular falso activo permanente de THY. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Activos reales. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual si el enlace THY no tiene icono real. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈";
  display: inline-flex;
  width: 18px;
  margin-right: 10px;
  opacity: .82;
  color: #e7b84a;
}

/* === THYDOM SAFETY NO MOCK END === */

/* === THYDOM V069 SAFETY START === */

/* THY no se muestra en sidebar, Marketplace ni detalle. Solo debe aparecer en Cuenta/THY. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* Imágenes de navegación siempre controladas. */
aside img,
nav img,
.sidebar img,
.app-sidebar img,
.private-sidebar img,
.layout-sidebar img,
.sidenav img,
#sidebar img {
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain !important;
}

/* Anular falso activo permanente de THY. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Activos reales. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual para THY si el menú no tiene icono propio. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈";
  display: inline-flex;
  width: 18px;
  margin-right: 10px;
  opacity: .82;
  color: #e7b84a;
}

/* === THYDOM V069 SAFETY END === */

/* === THYDOM V070 SIDEBAR THY FIX START === */

/* Neutralizar cualquier clase activa heredada sobre THY salvo en ruta THY. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"],
body:not(.route-thy) li:has(a[href="/app/thy"]),
body:not(.route-thy) li:has(a[href$="/thy"]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Evitar doble icono si el layout ya trae uno. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈" !important;
  display: inline-flex !important;
  width: 18px !important;
  min-width: 18px !important;
  margin-right: 10px !important;
  opacity: .92 !important;
  color: #e7b84a !important;
}

/* Activo real solo según ruta. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* THY_Mini solo fuera de navegación/Marketplace/detalle. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* === THYDOM V070 SIDEBAR THY FIX END === */

/* === THYDOM V070B SIDEBAR HARD FIX START === */

/* THY nunca queda activo salvo en /app/thy. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"],
body:not(.route-thy) li:has(a[href="/app/thy"]),
body:not(.route-thy) li:has(a[href$="/thy"]),
body:not(.route-thy) .active:has(a[href="/app/thy"]),
body:not(.route-thy) .is-active:has(a[href="/app/thy"]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Activo real por ruta. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual para THY. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈" !important;
  display: inline-flex !important;
  width: 18px !important;
  min-width: 18px !important;
  margin-right: 10px !important;
  opacity: .92 !important;
  color: #e7b84a !important;
}

/* No usar imagen THY_Mini en menú, Marketplace o detalle. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* === THYDOM V070B SIDEBAR HARD FIX END === */

/* === THYDOM V070C REAL SIDEBAR FIX START === */

/* Regla dura: THY NO está activo salvo en ruta /app/thy. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"],
body:not(.route-thy) li:has(a[href="/app/thy"]),
body:not(.route-thy) li:has(a[href$="/thy"]),
body:not(.route-thy) .active:has(a[href="/app/thy"]),
body:not(.route-thy) .is-active:has(a[href="/app/thy"]),
body:not(.route-thy) [class*="active"]:has(a[href="/app/thy"]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* También neutralizar estilos del propio enlace THY cuando no toca. */
body:not(.route-thy) a[href="/app/thy"] {
  background: transparent !important;
  border: 1px solid transparent !important;
}

/* Activo real por ruta. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual controlado para THY. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈" !important;
  display: inline-flex !important;
  width: 18px !important;
  min-width: 18px !important;
  margin-right: 10px !important;
  opacity: .92 !important;
  color: #e7b84a !important;
}

/* No usar imagen THY_Mini en menú, Marketplace ni detalle. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* === THYDOM V070C REAL SIDEBAR FIX END === */

/* === THYDOM V070D VISIBLE FIX START === */

/* THY no queda activo salvo en /app/thy. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"],
body:not(.route-thy) li:has(a[href="/app/thy"]),
body:not(.route-thy) li:has(a[href$="/thy"]),
body:not(.route-thy) .active:has(a[href="/app/thy"]),
body:not(.route-thy) .is-active:has(a[href="/app/thy"]),
body:not(.route-thy) [class*="active"]:has(a[href="/app/thy"]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body:not(.route-thy) a[href="/app/thy"] {
  background: transparent !important;
  border: 1px solid transparent !important;
}

/* Activos reales por ruta. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual controlado para THY. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈" !important;
  display: inline-flex !important;
  width: 18px !important;
  min-width: 18px !important;
  margin-right: 10px !important;
  opacity: .92 !important;
  color: #e7b84a !important;
}

/* No usar imagen THY_Mini en menú, Marketplace ni detalle. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* Tres columnas reales en escritorio. */
.thx-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
}

@media (max-width: 1180px) {
  .thx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .thx-grid {
    grid-template-columns: 1fr !important;
  }
}

/* === THYDOM V070D VISIBLE FIX END === */

/* === THYDOM V070E SIDEBAR DEFINITIVE START === */

/* THY nunca activo salvo en /app/thy. */
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href$="/thy"],
body:not(.route-thy) a[href*="/thy"],
body:not(.route-thy) li:has(a[href="/app/thy"]),
body:not(.route-thy) li:has(a[href$="/thy"]),
body:not(.route-thy) .active:has(a[href="/app/thy"]),
body:not(.route-thy) .is-active:has(a[href="/app/thy"]),
body:not(.route-thy) [class*="active"]:has(a[href="/app/thy"]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body:not(.route-thy) a[href="/app/thy"] {
  background: transparent !important;
  border: 1px solid transparent !important;
}

/* Activo real por ruta. */
body.route-marketplace a[href="/app/thydoms"],
body.route-marketplace a[href$="/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-my-thydoms a[href$="/my-thydoms"],
body.route-thy a[href="/app/thy"],
body.route-account a[href*="/app/account"],
body.route-inventory a[href*="/app/inventory"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

/* Icono textual THY. */
a[href="/app/thy"]::before,
a[href$="/thy"]::before {
  content: "◈" !important;
  display: inline-flex !important;
  width: 18px !important;
  min-width: 18px !important;
  margin-right: 10px !important;
  opacity: .92 !important;
  color: #e7b84a !important;
}

/* No usar THY_Mini en menú, Marketplace ni detalle. */
aside img[src*="THY_Mini"],
nav img[src*="THY_Mini"],
.sidebar img[src*="THY_Mini"],
.app-sidebar img[src*="THY_Mini"],
.private-sidebar img[src*="THY_Mini"],
.layout-sidebar img[src*="THY_Mini"],
.sidenav img[src*="THY_Mini"],
#sidebar img[src*="THY_Mini"],
.thx-store img[src*="THY_Mini"],
.thx-detail img[src*="THY_Mini"] {
  display: none !important;
}

/* Tres columnas. */
.thx-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
}

@media (max-width: 1180px) {
  .thx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .thx-grid {
    grid-template-columns: 1fr !important;
  }
}

/* === THYDOM V070E SIDEBAR DEFINITIVE END === */

/* === THYDOM V070F FINAL SIDEBAR FIX START === */

.thy-nav-link:not(.active),
body:not(.route-thy) .thy-nav-link,
body:not(.route-thy) a[href="/app/thy"],
body:not(.route-thy) a[href="/app/thy"] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.route-thy .thy-nav-link,
.thy-nav-link.active,
body.route-marketplace a[href="/app/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-inventory a[href*="/app/inventory"],
body.route-account a[href*="/app/account"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

.thy-nav-link .ico {
  color: #e7b84a !important;
}

.thx-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
}

@media (max-width: 1180px) {
  .thx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .thx-grid {
    grid-template-columns: 1fr !important;
  }
}

/* === THYDOM V070F FINAL SIDEBAR FIX END === */

/* === THYDOM V070G FINAL FIX START === */

body:not(.route-thy) .thy-nav-link,
body:not(.route-thy) a[href="/app/thy"] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body.route-thy .thy-nav-link,
body.route-marketplace a[href="/app/thydoms"],
body.route-my-thydoms a[href="/app/my-thydoms"],
body.route-inventory a[href*="/app/inventory"],
body.route-account a[href*="/app/account"] {
  background: rgba(139, 73, 255, 0.16) !important;
  border-color: rgba(174, 120, 255, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 120, 255, 0.24) !important;
}

.thy-nav-link .ico {
  color: #e7b84a !important;
}

.thx-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
}

@media (max-width: 1180px) {
  .thx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 760px) {
  .thx-grid { grid-template-columns: 1fr !important; }
}

/* === THYDOM V070G FINAL FIX END === */
