:root {
  --blue: #155eef;
  --cyan: #22b8cf;
  --violet: #6d5dfc;
  --ink: #0b1f4d;
  --blue-dark: #123b7a;
  --blue-soft: #edf4ff;
  --cyan-soft: #edfaff;
  --violet-soft: #f1efff;
  --gray-900: #172033;
  --gray-800: #333333;
  --gray-700: #4b5563;
  --gray-500: #687385;
  --gray-300: #cbd5e1;
  --gray-200: #e5eaf1;
  --gray-100: #f6f8fc;
  --white: #ffffff;
  --danger: #b42318;
  --success: #067647;
  --warning: #a15c00;
  --shadow: 0 22px 65px rgba(15, 23, 42, 0.12);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--gray-800);
  background:
    radial-gradient(circle at 9% 4%, rgba(21, 94, 239, 0.17), transparent 28%),
    radial-gradient(circle at 88% 9%, rgba(109, 93, 252, 0.14), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fc 46%, #ffffff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(21, 94, 239, 0.2) 0 2px, transparent 3px),
    radial-gradient(circle at 31% 34%, rgba(109, 93, 252, 0.16) 0 2px, transparent 3px),
    radial-gradient(circle at 62% 15%, rgba(34, 184, 207, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 42%, rgba(21, 94, 239, 0.14) 0 2px, transparent 3px),
    linear-gradient(115deg, transparent 0 20%, rgba(21, 94, 239, 0.045) 20.2% 20.45%, transparent 20.65% 46%, rgba(109, 93, 252, 0.04) 46.2% 46.45%, transparent 46.65%),
    linear-gradient(35deg, transparent 0 34%, rgba(34, 184, 207, 0.045) 34.2% 34.45%, transparent 34.65% 70%, rgba(21, 94, 239, 0.035) 70.2% 70.45%, transparent 70.65%);
  opacity: 0.75;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--gray-900);
  text-decoration: none;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(21, 94, 239, 0.15));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1;
  color: var(--ink);
  font-size: 1.08rem;
}

.brand small {
  margin-top: 4px;
  color: var(--gray-500);
  font-size: 0.78rem;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-700);
  font-size: 0.94rem;
  font-weight: 600;
}

.header-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
}

.header-actions a:hover,
.header-actions a:focus-visible {
  background: var(--gray-100);
  outline: none;
}

main {
  flex: 1;
}

.container {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  min-height: calc(100vh - 150px);
  padding: 66px 0 58px;
}

.hero-shell {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(203, 213, 225, 0.7);
  background:
    linear-gradient(90deg, rgba(4, 18, 49, 0.92) 0%, rgba(8, 35, 79, 0.83) 42%, rgba(246, 249, 255, 0.9) 100%),
    radial-gradient(circle at 33% 32%, rgba(34, 184, 207, 0.28), transparent 28%),
    url("./assets/ai-justice-bg.png");
  background-position: center;
  background-size: cover;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 26% 34%, rgba(125, 232, 255, 0.12), transparent 24%),
    linear-gradient(90deg, rgba(0, 10, 35, 0.16), transparent 48%, rgba(255, 255, 255, 0.22));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.68), transparent 86%);
}

.hero-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.82) 94%),
    radial-gradient(circle at 16% 55%, rgba(34, 184, 207, 0.2), transparent 24%);
}

.hero-copy,
.visual-panel,
.feature-band,
.card,
.auth-panel,
.table-wrap,
.editor-toolbar {
  position: relative;
}

.hero-copy {
  z-index: 1;
}

.hero-shell .eyebrow {
  color: #7de8ff;
}

.hero-shell h1 {
  color: #ffffff;
  text-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

.hero-shell .lead {
  color: rgba(239, 246, 255, 0.9);
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin: 10px 0 20px;
  color: var(--ink);
  font-size: 4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  color: var(--gray-900);
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  color: var(--gray-900);
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  color: var(--gray-700);
  line-height: 1.65;
}

.lead {
  max-width: 690px;
  margin-bottom: 28px;
  font-size: 1.12rem;
}

.hero-actions,
.form-actions,
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin-top: 28px;
}

.metric-item {
  position: relative;
  min-height: 88px;
  padding: 16px;
  border: 1px solid rgba(21, 94, 239, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.metric-item strong {
  display: block;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.metric-item span {
  display: block;
  margin-top: 8px;
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.35;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

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

.button:focus-visible,
.field input:focus,
.field select:focus,
.editor-toolbar input:focus,
.editor-toolbar select:focus {
  outline: 3px solid rgba(0, 102, 204, 0.22);
  outline-offset: 2px;
}

.editor-toolbar {
  position: sticky;
  top: 82px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  width: min(1120px, calc(100% - 36px));
  margin: 16px auto 0;
  padding: 14px;
  border: 1px solid rgba(19, 184, 238, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 34px rgba(7, 27, 95, 0.11);
  backdrop-filter: blur(14px);
}

.editor-toolbar strong {
  color: var(--ink);
}

.editor-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--gray-700);
  font-size: 0.8rem;
  font-weight: 800;
}

.editor-toolbar input,
.editor-toolbar select {
  min-height: 36px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: #ffffff;
}

.editor-toolbar input[type="number"] {
  width: 84px;
  padding: 0 9px;
}

.editor-toolbar input[type="color"] {
  width: 52px;
  padding: 4px;
}

.editor-toolbar select {
  min-width: 170px;
  padding: 0 9px;
}

.editor-toolbar span {
  color: var(--gray-500);
  font-size: 0.86rem;
}

.drag-handle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px dashed rgba(21, 94, 239, 0.28);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(237, 244, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: grab;
}

.drag-handle::before {
  content: "⋮⋮";
  color: var(--violet);
  font-size: 0.92rem;
  line-height: 1;
}

[data-draggable] {
  cursor: grab;
}

.is-dragging {
  opacity: 0.58;
  transform: scale(0.99);
}

.drag-over {
  border-color: rgba(109, 93, 252, 0.75) !important;
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.13), var(--shadow);
}

.button-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(0, 102, 204, 0.22);
}

.button-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.button-secondary {
  color: var(--blue);
  background: var(--white);
  border-color: rgba(21, 94, 239, 0.2);
}

.button-secondary:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.button-danger {
  color: var(--danger);
  background: var(--white);
  border-color: #f1b8b2;
}

.button-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--gray-200);
}

.button-ghost:hover,
.button-ghost.is-active {
  color: var(--blue);
  background: var(--cyan-soft);
  border-color: rgba(19, 184, 238, 0.45);
}

.hero-logo {
  display: block;
  width: min(390px, 100%);
  margin: 0 0 10px;
  object-fit: contain;
}

.hero-banner,
.hero-brand-card {
  width: min(780px, 100%);
  max-height: 210px;
  object-position: left center;
  margin: 0 0 16px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52));
  box-shadow: 0 20px 44px rgba(0, 12, 38, 0.18);
  backdrop-filter: blur(8px);
  opacity: 1;
}

.hero-banner {
  width: min(640px, 100%);
  max-height: 155px;
}

.hero-brand-card {
  width: min(660px, 100%);
  max-height: 180px;
  padding: 12px 18px;
}

.visual-panel {
  min-height: 440px;
  display: grid;
  align-content: center;
  padding: 28px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(237, 244, 255, 0.2));
  box-shadow: var(--shadow);
  border: 1px solid rgba(21, 94, 239, 0.14);
  z-index: 1;
}

.visual-card {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 26px;
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.visual-panel:has(.floating-visual-logo) .visual-card {
  margin-top: 138px;
}

.floating-visual-logo {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0.9;
  cursor: default;
  user-select: none;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(8px);
}

.floating-visual-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 45, 120, 0.14));
}

.floating-visual-logo.is-editable-logo {
  z-index: 4;
  opacity: 1;
  cursor: move;
  outline: 1px dashed rgba(21, 94, 239, 0.38);
  outline-offset: 8px;
}

.floating-logo-controls {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.floating-logo-controls label {
  display: grid;
  gap: 4px;
  color: var(--gray-700);
  font-size: 0.76rem;
  font-weight: 800;
}

.visual-logo-restore {
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 4;
}

.visual-panel p,
.visual-panel strong,
.visual-panel span {
  color: var(--ink);
}

.visual-heading {
  display: block;
  margin-bottom: 12px;
}

.visual-panel strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.16;
}

.visual-panel p {
  margin-bottom: 0;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--gray-200);
}

.section-muted {
  background: linear-gradient(180deg, #f6fbff 0%, #ffffff 100%);
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.feature-band {
  padding: 34px;
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 244, 255, 0.9)),
    radial-gradient(circle at 95% 0%, rgba(109, 93, 252, 0.16), transparent 34%);
  box-shadow: var(--shadow);
}

.anon-intro-section {
  padding-top: 46px;
}

.anon-intro-band {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 250, 255, 0.9)),
    radial-gradient(circle at 92% 12%, rgba(34, 184, 207, 0.18), transparent 30%);
}

#uso-responsable .section-head,
#uso-responsable .card-grid,
#links .section-head,
#links .card-grid {
  margin-left: 34px;
  width: calc(100% - 68px);
}

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

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

.info-card {
  min-height: 230px;
  display: grid;
  grid-template-rows: 58px auto;
  align-content: start;
  justify-content: stretch;
  gap: 18px;
}

.info-card > div {
  display: grid;
  align-content: start;
  gap: 8px;
}

.objective-grid .info-card,
.principle-grid .info-card {
  min-height: 245px;
}

.objective-grid .info-card h3,
.principle-grid .info-card h3 {
  min-height: 54px;
  display: flex;
  align-items: flex-start;
}

.info-card h3,
.info-card p {
  margin-bottom: 0;
}

.info-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: var(--blue);
  background: linear-gradient(135deg, var(--blue-soft), var(--violet-soft));
  font-size: 1.25rem;
  font-weight: 800;
}

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

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

.card {
  position: relative;
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.custom-block-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-text-card {
  min-height: 170px;
}

.card-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  padding: 4px;
  border: 1px solid rgba(19, 184, 238, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(7, 27, 95, 0.08);
}

.logo-upload {
  width: 100%;
  min-height: 38px;
  padding: 8px;
  border: 1px dashed rgba(0, 102, 204, 0.38);
  border-radius: 8px;
  color: var(--gray-700);
  background: #f8fdff;
}

.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 93, 252, 0.32);
  box-shadow: 0 18px 42px rgba(7, 27, 95, 0.11);
}

.card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.objective-grid,
.principle-grid {
  align-items: stretch;
}

.card.info-card {
  display: grid;
  grid-template-rows: 58px 1fr;
  justify-content: stretch;
  align-content: start;
  min-height: 245px;
  gap: 18px;
}

.card.info-card > div {
  display: grid;
  grid-template-rows: 58px 1fr;
  align-content: start;
  gap: 10px;
}

.card.info-card h3 {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  margin: 0;
}

.card.info-card p {
  margin: 0;
  align-self: start;
}

.card-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.url-editor {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(19, 184, 238, 0.32);
  border-radius: 8px;
  color: var(--gray-900);
  background: #f8fdff;
}

[data-editable] {
  white-space: pre-wrap;
}

.is-editable {
  min-width: min(100%, 180px);
  min-height: 38px;
  padding: 8px 10px;
  border: 1px dashed rgba(0, 102, 204, 0.45);
  border-radius: 8px;
  background: rgba(233, 250, 255, 0.72);
  outline: none;
}

.is-editable:focus {
  border-style: solid;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(19, 184, 238, 0.16);
}

.editable-box.is-editable {
  resize: both;
  overflow: auto;
  max-width: 100%;
}

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

.download-card {
  min-height: 240px;
}

.chat-entry-card {
  min-height: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.chat-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.chat-side,
.chat-panel {
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.chat-side {
  padding: 22px;
}

.chat-side strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.06rem;
}

.chat-side ul {
  margin: 14px 0;
  padding-left: 18px;
  color: var(--gray-700);
  line-height: 1.7;
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  min-height: 620px;
  overflow: hidden;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 92% 8%, rgba(109, 93, 252, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff, #f7fbff);
}

.chat-empty {
  margin: auto;
  max-width: 520px;
  text-align: center;
}

.chat-empty strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.chat-message {
  width: min(78%, 720px);
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: #ffffff;
}

.chat-message.user {
  align-self: flex-end;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-color: transparent;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message strong,
.chat-message p {
  color: inherit;
}

.chat-message p {
  margin-bottom: 6px;
}

.chat-message small {
  display: block;
  opacity: 0.78;
}

.chat-compose {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.96);
}

.chat-compose textarea {
  width: 100%;
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  resize: vertical;
  line-height: 1.5;
}

.file-drop {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px dashed rgba(21, 94, 239, 0.32);
  border-radius: 12px;
  color: var(--gray-700);
  background: var(--blue-soft);
  font-weight: 800;
}

.update-alert {
  margin-top: 14px;
}

.technical-note {
  margin-top: 12px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.steps-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--gray-700);
  line-height: 1.7;
}

.hash-line {
  margin-top: 14px;
  color: var(--gray-500);
  font-size: 0.84rem;
}

.hash-line code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--ink);
  background: var(--cyan-soft);
}

.edit-reset {
  margin-top: 18px;
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 154px);
  padding: 48px 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(19, 184, 238, 0.16), transparent 30%),
    var(--gray-100);
}

.auth-panel {
  width: min(100%, 480px);
  padding: 30px;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-panel.wide {
  width: min(100%, 720px);
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--gray-900);
  font-size: 0.93rem;
  font-weight: 700;
}

.field small {
  color: var(--gray-500);
  line-height: 1.45;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0 13px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  color: var(--gray-900);
  background: var(--white);
}

.field input,
.field select {
  min-height: 46px;
}

.field textarea {
  min-height: 120px;
  padding-top: 12px;
  resize: vertical;
  line-height: 1.5;
}

.human-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(21, 94, 239, 0.18);
  border-radius: 10px;
  color: var(--gray-800);
  background: rgba(237, 244, 255, 0.7);
  font-weight: 700;
}

.human-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--blue);
  font-weight: 700;
}

.alert {
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.5;
}

.alert.error {
  border-color: #f1b8b2;
  color: var(--danger);
  background: #fff3f1;
}

.alert.success {
  border-color: #a8d7bf;
  color: var(--success);
  background: #effaf4;
}

.alert.warning {
  border-color: #ffd18a;
  color: var(--warning);
  background: #fff8eb;
}

.dashboard {
  padding: 34px 0 72px;
  background:
    radial-gradient(circle at 92% 6%, rgba(109, 93, 252, 0.14), transparent 24%),
    linear-gradient(180deg, #f6f8fc, #ffffff);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gray-200);
}

.dashboard-header p {
  margin-bottom: 0;
}

.dashboard-section {
  margin-top: 34px;
}

.tool-card {
  min-height: 220px;
  justify-content: flex-start;
  gap: 16px;
  border-top: 4px solid var(--card-accent, var(--blue));
}

.tool-card > div:not(.module-card-head) {
  display: grid;
  align-content: start;
  gap: 8px;
}

.tool-card h3,
.tool-card p {
  margin-bottom: 0;
}

.tool-card .card-actions,
.tool-card .card-link,
.tool-card .button {
  margin-top: auto;
}

.public-tool .card-link {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--card-accent, var(--blue));
  background: color-mix(in srgb, var(--card-accent, var(--blue)) 11%, white);
}

.meta-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--gray-900);
  background: var(--gray-100);
  font-size: 0.86rem;
}

td {
  color: var(--gray-700);
  font-size: 0.92rem;
}

.pre-line {
  white-space: pre-line;
}

tr:last-child td {
  border-bottom: 0;
}

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

.table-actions .button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.admin-content-panel {
  padding: 26px;
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.admin-editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.admin-editor-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: #ffffff;
}

.admin-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-editor-head h3 {
  margin-bottom: 0;
}

.admin-edit-row {
  display: grid;
  grid-template-columns: 54px minmax(130px, 0.8fr) minmax(120px, 0.9fr) minmax(160px, 1fr) minmax(180px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: var(--gray-100);
}

.module-edit-row {
  grid-template-columns: 54px minmax(130px, 0.8fr) minmax(120px, 0.8fr) minmax(160px, 1fr) minmax(180px, 1.2fr) 56px auto auto;
}

.compact-edit-row {
  grid-template-columns: 54px 76px minmax(150px, 1fr) minmax(220px, 1.5fr) auto;
}

.admin-field-stack {
  display: grid;
  gap: 6px;
  color: var(--gray-700);
  font-size: 0.86rem;
  font-weight: 800;
}

.admin-field-stack textarea,
.admin-edit-row input,
.admin-edit-row textarea {
  min-height: 38px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  background: #ffffff;
}

.admin-field-stack textarea,
.admin-edit-row textarea {
  min-height: 74px;
  resize: vertical;
  line-height: 1.45;
}

.admin-edit-row .color-input {
  min-width: 44px;
  padding: 4px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  background: var(--white);
  font-size: 0.78rem;
  line-height: 1.45;
}

.site-footer div {
  display: grid;
  gap: 2px;
}

.site-footer strong {
  color: var(--gray-700);
  font-size: 0.82rem;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero,
  .card-grid,
  .link-grid,
  .objective-grid,
  .principle-grid,
  .custom-block-grid,
  .chat-entry-card,
  .chat-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .visual-panel {
    min-height: 360px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 1.95rem;
  }

  .admin-edit-row,
  .module-edit-row,
  .compact-edit-row {
    grid-template-columns: 54px 1fr;
  }

  .admin-edit-row .button,
  .module-edit-row .button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-header,
  .dashboard-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .brand small {
    white-space: normal;
  }

  .hero,
  .card-grid,
  .link-grid,
  .objective-grid,
  .principle-grid,
  .custom-block-grid,
  .chat-entry-card,
  .chat-shell,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 560px;
  }

  .chat-message {
    width: 100%;
  }

  .hero {
    padding: 44px 0;
  }

  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .visual-panel {
    min-height: 300px;
  }

  .auth-panel {
    padding: 22px;
  }

  .feature-band,
  .admin-content-panel {
    padding: 20px;
  }

  #uso-responsable .section-head,
  #uso-responsable .card-grid,
  #links .section-head,
  #links .card-grid {
    width: 100%;
    margin-left: 0;
  }

  .editor-toolbar {
    top: 0;
  }
}
