:root {
  --ink: #191716;
  --ink-soft: #3d3936;
  --muted: #746e68;
  --paper: #f3efe7;
  --surface: #fffdf9;
  --surface-soft: #f8f4ed;
  --line: #ded6cb;
  --line-strong: #c8bdb0;
  --red: #b5242d;
  --red-dark: #81171e;
  --red-soft: #f6e5e4;
  --gold: #b98424;
  --gold-soft: #f5ead3;
  --green: #237052;
  --green-soft: #dff0e8;
  --blue: #245e91;
  --blue-soft: #e0edf8;
  --grey-soft: #ece8e2;
  --shadow-sm: 0 8px 24px rgba(48, 36, 25, .07);
  --shadow-lg: 0 24px 70px rgba(48, 36, 25, .11);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --content: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 12%, rgba(181, 36, 45, .055), transparent 27rem),
    radial-gradient(circle at 96% 40%, rgba(185, 132, 36, .045), transparent 29rem),
    var(--paper);
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(181, 36, 45, .3);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid rgba(200, 189, 176, .72);
  background: rgba(243, 239, 231, .9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark,
.footer-mark {
  display: grid;
  place-items: center;
  color: white;
  background: var(--red);
  font: 800 1.18rem/1 Georgia, "Times New Roman", serif;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px 10px 10px 3px;
  box-shadow: 0 8px 18px rgba(181, 36, 45, .2);
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: -.025em;
}

.brand-name span {
  color: var(--red);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header nav a,
.link-button {
  position: relative;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: none;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}

.site-header nav a:hover,
.link-button:hover,
.site-header nav a.active {
  color: var(--ink);
  background: rgba(255, 253, 249, .75);
}

.site-header nav a.active::after {
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  content: "";
}

.page-shell {
  width: min(var(--content), calc(100% - 40px));
  min-height: calc(100vh - 153px);
  margin: 0 auto;
  padding: clamp(42px, 6vw, 78px) 0 90px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}

.footer-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px 7px 7px 2px;
  font-size: .75rem;
}

.eyebrow,
.muted-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(181, 36, 45, .1);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, .96);
  box-shadow: var(--shadow-sm);
}

.messages {
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}

.message {
  padding: 14px 17px 14px 46px;
  border: 1px solid #b9dcca;
  border-radius: 12px;
  color: #18583f;
  background: #e7f4ed;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.message::before {
  position: absolute;
  margin-left: -29px;
  content: "✓";
  font-weight: 900;
}

.message.error {
  border-color: #e7bfba;
  color: var(--red-dark);
  background: #f9e9e7;
}

.message.error::before {
  content: "!";
}

/* Propuesta */

.beta-gate {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.beta-gate-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.beta-gate p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.beta-code-group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: center;
  min-height: min(650px, calc(100vh - 190px));
}

.hero {
  max-width: 690px;
}

.hero h1,
.case-heading h1,
.admin-heading h1,
.login-intro h1,
.narrow-card h1 {
  margin: 15px 0 24px;
  font: 700 clamp(3.2rem, 6.4vw, 6.2rem)/.91 Georgia, "Times New Roman", serif;
  letter-spacing: -.058em;
}

.hero h1 em,
.case-heading h1 em,
.admin-heading h1 em,
.login-intro h1 em {
  color: var(--red);
  font-weight: 500;
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.06rem, 1.8vw, 1.22rem);
  line-height: 1.65;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.trust-row span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.trust-row i {
  color: var(--red);
  font: 700 .73rem Georgia, serif;
}

.proposal-card {
  position: relative;
  padding: clamp(25px, 4vw, 40px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.proposal-card::before {
  position: absolute;
  top: -1px;
  right: 28px;
  left: 28px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--red);
  content: "";
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 25px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.card-number {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  font-size: 1.5rem;
  font-weight: 300;
}

.card-kicker h2 {
  margin: 3px 0 0;
  font: 700 1.5rem/1.2 Georgia, serif;
  letter-spacing: -.025em;
}

.proposal-guide {
  margin: 0 0 25px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.proposal-guide p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.55;
}

.proposal-guide p strong {
  color: var(--ink);
}

.proposal-guide ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 15px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.proposal-guide li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.3;
}

.proposal-guide li b {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--red);
  font-size: .65rem;
}

.field-group {
  margin-top: 18px;
}

form label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: .9rem;
  font-weight: 800;
}

.field-hint {
  float: right;
  margin: -29px 0 7px;
  color: var(--muted);
  font-size: .74rem;
}

.proposal-card .field-hint {
  float: none;
  margin: -3px 0 9px;
}

input[type="url"],
input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: white;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input::placeholder {
  color: #aaa198;
}

input:hover {
  border-color: #aa9d8e;
}

input:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 0 0 4px rgba(181, 36, 45, .11);
}

.has-error input {
  border-color: var(--red);
}

.field-error {
  margin: 8px 0;
  color: var(--red-dark);
  font-size: .86rem;
  font-weight: 700;
}

.field-error ul,
.errorlist {
  margin: 0;
  padding-left: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 0 20px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.primary-button {
  margin-top: 24px;
  border: 1px solid var(--red);
  color: white;
  background: var(--red);
  box-shadow: 0 10px 22px rgba(181, 36, 45, .18);
}

.primary-button:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
  box-shadow: 0 12px 26px rgba(129, 23, 30, .23);
  transform: translateY(-1px);
}

.primary-button-wide {
  width: 100%;
  justify-content: space-between;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--surface);
}

.secondary-button:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.form-assurance {
  margin: 14px 8px 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
  text-align: center;
}

.telegram-delivery-option,
.telegram-delivery-state {
  margin: 1rem 0 0;
  padding: .85rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(183, 45, 35, .07);
  color: var(--muted);
  font-size: .9rem;
}

.telegram-delivery-option strong { color: var(--ink); }
.telegram-audio-button { margin-top: 1.2rem; }

.process-section {
  margin-top: clamp(64px, 9vw, 110px);
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.section-heading h2 {
  margin: 6px 0 0;
  font: 700 clamp(1.65rem, 3vw, 2.4rem)/1.08 Georgia, serif;
  letter-spacing: -.035em;
}

.three-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.three-steps li {
  display: flex;
  min-height: 130px;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 249, .58);
}

.three-steps > li > strong {
  color: var(--red);
  font: 700 1rem Georgia, serif;
}

.three-steps div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.three-steps b {
  font-size: 1rem;
}

.three-steps span {
  color: var(--muted);
  font-size: .87rem;
}

/* Expediente público */

.case-heading,
.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.case-heading h1,
.admin-heading h1 {
  margin: 8px 0 0;
  font-size: clamp(2.8rem, 5.8vw, 5.4rem);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  color: #4d4944;
  background: var(--grey-soft);
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-large {
  padding: 10px 15px;
  font-size: .79rem;
}

.status-pending {
  color: #76540f;
  background: var(--gold-soft);
}

.status-queued,
.status-running {
  color: #1c527e;
  background: var(--blue-soft);
}

.status-running i {
  animation: blink 1.6s infinite;
}

.status-completed {
  color: #185d43;
  background: var(--green-soft);
}

.status-failed,
.status-rejected,
.status-cancelled {
  color: #7c211f;
  background: var(--red-soft);
}

.status-archived {
  color: #5d5852;
  background: var(--grey-soft);
}

@keyframes blink {
  50% { opacity: .25; }
}

.case-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 249, .58);
  list-style: none;
}

.case-progress li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aaa29a;
}

.case-progress li::after {
  position: absolute;
  top: 17px;
  right: 12px;
  left: 48px;
  height: 1px;
  background: var(--line);
  content: "";
}

.case-progress li:last-child::after {
  display: none;
}

.case-progress li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: .76rem;
  font-weight: 850;
}

.case-progress li > div {
  position: relative;
  z-index: 1;
  padding-right: 10px;
  background: var(--paper);
}

.case-progress strong,
.case-progress small {
  display: block;
}

.case-progress strong {
  color: inherit;
  font-size: .85rem;
}

.case-progress small {
  color: inherit;
  font-size: .7rem;
}

.case-progress .is-complete,
.case-progress .is-current {
  color: var(--green);
}

.case-progress .is-complete > span {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.case-progress .is-complete::after {
  background: var(--green);
}

.case-progress .is-current > span {
  box-shadow: 0 0 0 5px rgba(35, 112, 82, .1);
}

.case-target,
.verdict,
.waiting-card,
.notice-card {
  margin-bottom: 24px;
  padding: clamp(22px, 4vw, 32px);
}

.case-target {
  display: flex;
  gap: 18px;
}

.target-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--red);
  background: var(--surface-soft);
  font-size: 1.1rem;
}

.target-content {
  min-width: 0;
  flex: 1;
}

.case-target .target-content > a {
  display: block;
  margin: 7px 0 20px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 750;
  text-decoration-color: rgba(181, 36, 45, .35);
  text-underline-offset: 3px;
}

.case-target .target-content > a:hover {
  color: var(--red-dark);
  text-decoration-color: var(--red);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  color: var(--muted);
  font-size: .84rem;
}

.case-meta span {
  display: flex;
  flex-direction: column;
}

.case-meta b {
  color: var(--ink-soft);
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.verdict {
  position: relative;
  overflow: hidden;
  border-color: #cfc4b8;
  box-shadow: var(--shadow-lg);
}

.verdict::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--red);
  content: "";
}

.verdict-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.verdict-heading h2 {
  margin: 5px 0 0;
  font: 700 clamp(1.8rem, 4vw, 2.8rem)/1 Georgia, serif;
  letter-spacing: -.035em;
}

.smoke-badge {
  min-width: 130px;
  padding: 11px 15px;
  border-radius: 12px;
  color: #795610;
  background: var(--gold-soft);
  text-align: center;
}

.smoke-badge span,
.smoke-badge strong {
  display: block;
}

.smoke-badge span {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.smoke-badge strong {
  margin-top: 1px;
  font-size: 1rem;
}

.smoke-alto {
  color: #7c211f;
  background: var(--red-soft);
}

.smoke-bajo {
  color: #185d43;
  background: var(--green-soft);
}

.result-text {
  max-width: 78ch;
  margin: 28px auto 8px;
  overflow-x: auto;
  color: #2d2927;
  font: 1.055rem/1.78 Georgia, "Times New Roman", serif;
}

.result-text p {
  margin: 0 0 1.25em;
}

.result-text p:first-child {
  color: var(--ink);
  font-weight: 700;
}

.result-text h1,
.result-text h2,
.result-text h3,
.result-text h4 {
  margin: 1.5em 0 .55em;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.2;
}

.result-text blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--red);
  color: var(--muted);
}

.result-text table {
  margin: 1.5em 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: .88rem;
}

.audio-button {
  margin-top: 12px;
}

.waiting-card,
.notice-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.waiting-card p,
.notice-card p {
  margin: 3px 0 0;
  color: var(--muted);
}

.pulse {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 8px rgba(185, 132, 36, .14);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  50% { transform: scale(.78); opacity: .6; }
}

.live-label {
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.notice-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--red-dark);
  background: var(--red-soft);
  font-size: 1.15rem;
  font-weight: 850;
}

.neutral-card .notice-icon {
  color: #59534c;
  background: var(--grey-soft);
}

.timeline-section {
  margin-top: 50px;
}

.section-heading-inline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.event-count {
  color: var(--muted);
  font-size: .78rem;
}

.timeline {
  position: relative;
  margin: 26px 0 0 8px;
  padding: 0;
  list-style: none;
}

.timeline::before {
  position: absolute;
  top: 10px;
  bottom: 16px;
  left: 5px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline li {
  position: relative;
  display: flex;
  min-height: 65px;
  gap: 18px;
}

.timeline li > span {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  margin-top: 7px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(181, 36, 45, .11);
}

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

.timeline strong {
  font-size: .9rem;
}

.timeline small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .75rem;
}

/* Gestión */

.admin-heading {
  align-items: center;
}

.admin-heading > div > p {
  max-width: 580px;
  margin: 14px 0 0;
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(100px, 1fr));
  gap: 9px;
  margin-bottom: 24px;
}

.status-card {
  position: relative;
  display: flex;
  min-height: 88px;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 253, 249, .72);
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.status-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.status-card strong {
  font-size: 1.55rem;
  line-height: 1;
}

.status-card-all strong {
  font-size: 1rem;
}

.status-card span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
}

.status-card i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9d968f;
}

.status-card-pending i { background: var(--gold); }
.status-card-queued i,
.status-card-running i { background: var(--blue); }
.status-card-completed i { background: var(--green); }
.status-card-rejected i,
.status-card-failed i,
.status-card-cancelled i { background: var(--red); }

.status-card.selected {
  border-color: var(--red);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--red), var(--shadow-sm);
}

.status-card.selected::before {
  position: absolute;
  top: 0;
  right: 13px;
  left: 13px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--red);
  content: "";
}

.table-card {
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.beta-admin-card {
  margin-top: 24px;
}

.invite-form {
  display: flex;
  gap: 8px;
}

.invite-form input {
  min-width: 190px;
}

.beta-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 0 22px 22px;
}

.beta-admin-grid h3 {
  margin: 0 0 10px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.beta-access-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.beta-access-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.beta-access-list span,
.beta-access-list small {
  display: block;
}

.beta-access-list small {
  margin-top: 2px;
  color: var(--muted);
}

.beta-access-list .beta-empty {
  color: var(--muted);
}

.small-button {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface);
  font: inherit;
  font-size: .75rem;
  font-weight: 750;
  cursor: pointer;
}

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

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

  .invite-form {
    width: 100%;
    flex-direction: column;
  }
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.table-toolbar h2 {
  margin: 3px 0 0;
  font: 700 1.28rem/1.2 Georgia, serif;
}

.clear-filter {
  color: var(--red-dark);
  font-size: .78rem;
  font-weight: 750;
  text-decoration: none;
}

.clear-filter span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
}

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

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

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: rgba(248, 244, 237, .45);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

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

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover {
  background: #fdfaf5;
}

.case-id-cell {
  white-space: nowrap;
}

.case-id-cell > a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.case-id-cell > a:hover {
  color: var(--red);
}

.priority-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #76540f;
  background: var(--gold-soft);
  font-size: .61rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.priority-flag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.target-cell {
  max-width: 330px;
}

.target-cell a {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .82rem;
  text-decoration-color: var(--line-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-cell {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}

.actions {
  min-width: 285px;
}

.inline-form {
  display: inline;
}

.action-button {
  min-height: 32px;
  margin: 2px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink-soft);
  background: white;
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.action-button:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-soft);
}

.action-primary {
  border-color: var(--red);
  color: white;
  background: var(--red);
}

.action-primary:hover {
  border-color: var(--red-dark);
  color: white;
  background: var(--red-dark);
}

.action-reject:hover,
.action-cancel:hover,
.action-archive:hover {
  border-color: #d5aaa6;
  color: var(--red-dark);
  background: var(--red-soft);
}

.empty-state {
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state > span,
.empty-state > strong,
.empty-state > small {
  display: block;
}

.empty-state > span {
  margin-bottom: 8px;
  color: var(--line-strong);
  font-size: 2rem;
}

.empty-state > strong {
  color: var(--ink-soft);
}

.empty-state > small {
  margin-top: 3px;
}

/* Acceso y errores */

.login-layout {
  display: grid;
  grid-template-columns: 1fr minmax(350px, 460px);
  gap: clamp(45px, 9vw, 130px);
  align-items: center;
  min-height: min(630px, calc(100vh - 200px));
}

.login-intro {
  max-width: 620px;
}

.login-intro h1 {
  margin-top: 14px;
}

.login-intro p {
  max-width: 480px;
  color: var(--muted);
  font-size: 1.05rem;
}

.login-card,
.narrow-card {
  width: 100%;
  max-width: 480px;
  padding: clamp(28px, 5vw, 42px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-card {
  justify-self: end;
}

.narrow-card {
  margin: 40px auto;
  text-align: center;
}

.narrow-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 0 23px;
  place-items: center;
  border-radius: 14px 14px 14px 4px;
  color: white;
  background: var(--ink);
  font: 800 1.2rem Georgia, serif;
}

.narrow-card .narrow-icon {
  margin-right: auto;
  margin-left: auto;
}

.login-card h2 {
  margin: 5px 0 25px;
  font: 700 2rem/1.1 Georgia, serif;
  letter-spacing: -.035em;
}

.narrow-card h1 {
  margin: 8px 0 16px;
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.narrow-card > p {
  margin: 0 auto 8px;
  color: var(--muted);
}

.error-box {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-soft);
}

@media (max-width: 1050px) {
  .status-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .actions {
    min-width: 240px;
  }
}

@media (max-width: 860px) {
  .landing-grid,
  .login-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .landing-grid {
    gap: 46px;
  }

  .hero {
    max-width: 740px;
  }

  .proposal-card,
  .login-card {
    width: min(100%, 620px);
    justify-self: stretch;
  }

  .login-layout {
    gap: 30px;
  }

  .login-intro h1 {
    font-size: clamp(3.3rem, 11vw, 5rem);
  }

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

  .admin-heading .secondary-button {
    width: 100%;
  }

  .table-wrap {
    padding: 12px;
    overflow: visible;
    background: var(--surface-soft);
  }

  table,
  tbody {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(48, 36, 25, .045);
  }

  tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  tbody td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    content: attr(data-label);
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .case-id-cell,
  .target-cell,
  .actions,
  .empty-state {
    grid-column: 1 / -1;
  }

  .case-id-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .case-id-cell::before {
    display: none;
  }

  .target-cell {
    max-width: none;
  }

  .target-cell a {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .actions {
    min-width: 0;
    padding-top: 11px;
    border-top: 1px solid var(--line);
  }

  .action-button {
    min-height: 38px;
    margin: 3px 2px 3px 0;
    padding: 7px 11px;
  }

  .empty-state::before {
    display: none;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 68px;
    padding: 0 14px;
  }

  .brand-name {
    font-size: .94rem;
  }

  .site-header nav {
    gap: 0;
  }

  .site-header nav a,
  .link-button {
    padding-right: 9px;
    padding-left: 9px;
    font-size: .84rem;
  }

  .page-shell {
    width: min(100% - 28px, var(--content));
    padding-top: 36px;
  }

  .hero h1,
  .case-heading h1,
  .admin-heading h1 {
    font-size: clamp(2.7rem, 13vw, 4.5rem);
  }

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

  .proposal-guide ol {
    grid-template-columns: 1fr;
  }

  .three-steps {
    grid-template-columns: 1fr;
  }

  .three-steps li {
    min-height: auto;
  }

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

  .case-progress {
    grid-template-columns: 1fr 1fr;
    gap: 22px 12px;
  }

  .case-progress li::after {
    display: none;
  }

  .case-progress li > div {
    padding-right: 0;
  }

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

  .smoke-badge {
    min-width: 0;
    text-align: left;
  }

  .waiting-card {
    align-items: flex-start;
  }

  .live-label {
    display: none;
  }

  .status-grid {
    display: flex;
    margin-right: -14px;
    padding-right: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .status-card {
    min-width: 122px;
    scroll-snap-align: start;
  }

  .table-toolbar {
    align-items: flex-start;
  }
}

@media (max-width: 470px) {
  .brand-name {
    display: none;
  }

  .site-header nav a,
  .link-button {
    font-size: .8rem;
  }

  .field-hint {
    float: none;
    margin: -3px 0 7px;
  }

  .case-progress {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .case-progress li:not(:last-child)::after {
    display: block;
    top: 35px;
    bottom: -22px;
    left: 16px;
    width: 1px;
    height: auto;
  }

  .case-target {
    flex-direction: column;
  }

  .case-meta {
    flex-direction: column;
    gap: 9px;
  }

  .section-heading-inline {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-toolbar {
    flex-direction: column;
  }

  tbody tr {
    grid-template-columns: 1fr;
  }

  tbody td,
  .case-id-cell,
  .target-cell,
  .actions,
  .empty-state {
    grid-column: 1;
  }

  .actions .inline-form {
    display: inline-block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
