/*
  KRAVOR / FIELD ATLAS
  Foundation stylesheet · kravor-parity-3

  The product pages use this file. REST is intentionally scoped to .rest-page
  at the end of the file so its independent visual identity remains untouched.
*/

:root {
  /* Core surfaces — near-black, neutral with a faint cool cast */
  --paper: #060607;
  --paper-strong: #0d0e10;
  --paper-muted: #16181b;
  --paper-raised: #1d2024;
  --ink: #f4f4f2;
  --ink-soft: #a9adb2;
  --ink-faint: #71767c;
  --line: #23262a;
  --line-strong: #3a3f45;
  /* Accents — kept, but desaturated so black stays the lead */
  --map: #9fd6e0;
  --map-dark: #74b4c0;
  --coral: #e0806c;
  --mustard: #dcb562;
  --sage: #9db694;
  --sage-soft: #1a221c;
  --blue-soft: #101a1d;
  --coral-soft: #221614;
  --mustard-soft: #221c11;
  --surface-dark: #000000;
  --on-accent: #08090a;
  /* Depth */
  --shadow: 0 24px 60px -18px rgba(0, 0, 0, .78);
  --shadow-small: 0 6px 20px -6px rgba(0, 0, 0, .6);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .04);
  --ring: 0 0 0 2px var(--paper), 0 0 0 4px var(--map-dark);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 12px;
  --radius-small: 8px;
  --content: 1220px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

body:not(.rest-page)::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(135deg, rgba(159, 214, 224, .05), transparent 44%);
  content: "";
  pointer-events: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

button {
  cursor: pointer;
}

a {
  color: var(--map-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--coral);
}

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

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -.045em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  line-height: .98;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.05;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.15;
}

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

.muted,
.heading-note,
.form-note,
.rail-note,
.marketplace-note {
  color: var(--ink-soft);
}

.eyebrow,
.field-label,
.nav-group-label,
.section-heading > p,
.post-kind,
.media-label,
.feature-line,
.context-index,
.feature-meta,
.product-label,
.ticket-status,
.scam-severity,
.status-badge,
.status-dot,
.status-badge--dark {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: .8rem;
  color: var(--map-dark);
  font-weight: 500;
}

.eyebrow::before {
  display: inline-block;
  width: 18px;
  height: 1px;
  margin: 0 8px 3px 0;
  background: currentColor;
  content: "";
}

.ui-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: currentColor;
  vertical-align: -.12em;
}

/* ── Shared shell ────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 270px;
  gap: 24px;
  width: min(100% - 48px, 1512px);
  min-height: 100vh;
  margin: 0 auto;
}

#sidebar-root,
#rail-root {
  min-width: 0;
}

.main-column {
  min-width: 0;
  padding-bottom: 56px;
}

.section-nav {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 27px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 0 44px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.06em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--on-accent);
  background: var(--map);
  border-radius: 8px 8px 8px 2px;
  font-size: .8rem;
  font-weight: 600;
}

.brand-word {
  line-height: 1;
}

.section-nav-main,
.section-nav-links,
.section-nav-account {
  display: grid;
  gap: 4px;
}

.section-nav-main {
  margin-bottom: 28px;
}

.section-nav-links {
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.section-nav-account {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-link > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.account-link small {
  color: var(--ink-faint);
  font-size: .7rem;
}

.section-nav-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group + .nav-group {
  margin-top: 15px;
}

.nav-group-label {
  margin: 0 0 5px 12px;
  color: var(--ink-faint);
  font-size: .6rem;
}

.nav-link,
.account-link,
.menu-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  padding: 8px 11px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: .85rem;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.nav-link:hover,
.account-link:hover,
.menu-action:hover {
  color: var(--ink);
  background: var(--paper-strong);
  border-color: var(--line);
  transform: translateX(2px);
}

.nav-link.is-active,
.nav-link-index.is-active {
  color: var(--map-dark);
  background: var(--blue-soft);
  border-color: #cfd6d8;
  font-weight: 600;
}

.nav-link-index {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: var(--ink-faint);
  background: var(--paper-muted);
  border-radius: 50%;
  font: .62rem var(--font-mono);
}

.nav-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  margin-left: auto;
  place-items: center;
  color: var(--ink);
  background: var(--mustard);
  border-radius: 999px;
  font: .62rem var(--font-mono);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.topbar-location,
.topbar-text-link {
  color: var(--ink-soft);
  font: .68rem var(--font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.topbar-location {
  color: var(--map-dark);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(340px, 100%);
  margin-left: auto;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.search-box:focus-within {
  background: var(--paper-strong);
  border-color: var(--map);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
}

.search-box input,
.search-box input:focus {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: var(--ink-faint);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-button,
.icon-button,
.mobile-menu-toggle,
.modal-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.notification-button:hover,
.icon-button:hover,
.mobile-menu-toggle:hover,
.modal-close:hover {
  color: var(--map-dark);
  border-color: var(--map);
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 6px;
  height: 6px;
  background: var(--coral);
  border: 1px solid var(--paper);
  border-radius: 50%;
}

.mobile-menu-toggle,
.mobile-brand,
.mobile-drawer {
  display: none;
}

.page,
.view {
  min-width: 0;
}

#page-content {
  padding-top: 30px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 52px;
  padding-top: 18px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font-size: .78rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--ink-soft);
}

.footer-build {
  font: .65rem var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Buttons and shared primitives ───────────────────────── */

.button,
.compose-button,
.filter-button,
.text-button,
.text-link-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  color: var(--on-accent);
  background: var(--map);
  border: 1px solid var(--map);
  border-radius: var(--radius-small);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.button:hover,
.compose-button:hover,
.filter-button:hover,
.text-button:hover,
.text-link-arrow:hover {
  color: var(--on-accent);
  background: var(--map-dark);
  border-color: var(--map-dark);
  box-shadow: var(--shadow-small);
  transform: translateY(-1px);
}

.button--lime,
.compose-button {
  color: var(--on-accent);
  background: var(--mustard);
  border-color: var(--mustard);
}

.button--lime:hover,
.compose-button:hover {
  color: var(--on-accent);
  background: #e0b65a;
  border-color: #e0b65a;
}

.button--outline,
.filter-button,
.text-button {
  color: var(--map-dark);
  background: transparent;
  border-color: var(--line-strong);
}

.button--outline:hover,
.filter-button:hover,
.text-button:hover {
  color: var(--map-dark);
  background: var(--blue-soft);
  border-color: var(--map);
}

.button--ghost {
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.button--ghost:hover {
  color: var(--ink);
  background: var(--paper-muted);
  border-color: var(--line);
}

.button--dark {
  color: var(--ink);
  background: var(--surface-dark);
  border-color: var(--line-strong);
}

.button--dark:hover {
  background: #22262a;
  border-color: #22262a;
}

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

.actions {
  margin-top: 24px;
}

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

.grid {
  display: grid;
  gap: 18px;
}

.card,
.notice,
.state,
.inline-state {
  padding: 22px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.notice {
  color: var(--ink-soft);
  border-left: 4px solid var(--mustard);
}

.state,
.inline-state {
  color: var(--ink-soft);
}

.state.error,
.inline-state.error {
  color: #873b31;
  background: var(--coral-soft);
  border-color: #dfaa9d;
}

.form-note {
  margin: 12px 0 0;
  font-size: .82rem;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink-soft);
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  outline: 0;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--map);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .05);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--map);
}

/* ── Page headers and legacy pages ───────────────────────── */

.page-heading,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 27px;
}

.page-heading h1,
.section-heading h2 {
  margin-bottom: 8px;
}

.page-heading--wide {
  align-items: start;
}

.heading-note {
  max-width: 610px;
  margin-bottom: 0;
}

.section-heading--small {
  align-items: center;
  margin-bottom: 14px;
}

.section-heading--small h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.page-narrow {
  width: min(100%, 760px);
}

.page-narrow--compact {
  width: min(100%, 580px);
}

.page-spaced {
  padding-block: 18px;
}

.page-spaced-lg {
  padding-block: 32px;
}

.page-spaced-xl {
  padding-block: 54px;
}

.legacy-content {
  min-width: 0;
}

.legacy-content .main,
.legacy-content .shell {
  width: 100%;
}

.legacy-content .brand {
  margin-bottom: 24px;
}

.legal-page {
  width: min(100%, 820px);
  padding: 32px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal-page h1 {
  max-width: 680px;
}

.legal-page h2 {
  margin-top: 34px;
  font-size: 1.35rem;
}

.legal-page p,
.legal-page li {
  max-width: 72ch;
  color: var(--ink-soft);
}

.text-link {
  color: var(--map-dark);
  font-weight: 600;
}

.text-link-arrow {
  width: fit-content;
  margin-top: 10px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  color: var(--on-accent);
  background: var(--map);
  border: 1px solid var(--map);
  border-radius: var(--radius-small);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}

.primary:hover {
  color: var(--on-accent);
  background: var(--map-dark);
  border-color: var(--map-dark);
}

.form-spaced {
  display: grid;
  gap: 15px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search input {
  min-width: 0;
}

.danger-zone {
  border-color: #7c4035;
  background: #321d1a;
}

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 8px;
  color: var(--map-dark);
  background: var(--blue-soft);
  border: 1px solid #cfd6d8;
  border-radius: 999px;
}

.status-badge--lime {
  color: #52683e;
  background: var(--sage-soft);
  border-color: #b8c9ae;
}

.status-badge--dark {
  color: var(--ink);
  background: var(--surface-dark);
  border-color: var(--line-strong);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  padding: 0;
  background: var(--sage);
  border-radius: 50%;
}

/* ── Empty, loading and simple feature pages ─────────────── */

.empty-state {
  position: relative;
  display: grid;
  min-height: 420px;
  padding: 64px 48px;
  place-items: center;
  align-content: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(16, 26, 29, .9), rgba(13, 14, 16, .96) 64%),
    var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 3px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.empty-state::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 100%;
  background: repeating-linear-gradient(-35deg, transparent 0 15px, rgba(255, 255, 255, .035) 15px 16px);
  content: "";
  pointer-events: none;
}

.empty-state > * {
  position: relative;
  z-index: 1;
}

.empty-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 21px;
  place-items: center;
  color: var(--on-accent);
  background: var(--map);
  border-radius: 50% 50% 50% 5px;
  box-shadow: 8px 8px 0 rgba(255, 255, 255, .06);
  font-size: 1.65rem;
}

.empty-state h1,
.empty-state h2 {
  max-width: 620px;
  margin-bottom: 12px;
}

.empty-state p:not(.eyebrow) {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.empty-state .actions {
  justify-content: center;
}

/* ── Home ────────────────────────────────────────────────── */

.home-view {
  display: grid;
  gap: 30px;
}

.app-shell--wide {
  width: min(100% - 48px, 1512px);
}

.is-visible {
  display: block;
}

.load-more {
  display: flex;
  width: fit-content;
  margin: 8px auto 0;
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, .8fr);
  gap: 34px;
  align-items: end;
  padding: 24px 0 15px;
}

.home-intro-copy {
  max-width: 690px;
}

.home-intro h1 {
  max-width: 720px;
  margin-bottom: 16px;
}

.home-lead {
  max-width: 590px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1.04rem;
}

.home-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.home-intro-mark {
  position: relative;
  width: 170px;
  height: 170px;
  justify-self: end;
  background: var(--mustard);
  border-radius: 48% 52% 44% 6%;
  transform: rotate(8deg);
}

.home-intro-mark::before,
.home-intro-mark::after {
  position: absolute;
  border: 1px solid rgba(0, 0, 0, .34);
  border-radius: 50%;
  content: "";
}

.home-intro-mark::before {
  inset: 22px 10px;
  transform: rotate(-32deg);
}

.home-intro-mark::after {
  inset: 10px 33px;
  transform: rotate(32deg);
}

.home-intro-mark span {
  position: absolute;
  right: 23px;
  bottom: 27px;
  z-index: 1;
  width: 65px;
  font: .72rem/1.1 var(--font-mono);
  text-transform: uppercase;
  transform: rotate(-8deg);
}

.home-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, .75fr);
  gap: 20px;
}

.home-feature,
.home-prompt,
.home-activity,
.home-people,
.home-invite {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.home-feature {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  min-height: 340px;
  overflow: hidden;
}

.feature-art {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background:
    linear-gradient(148deg, transparent 0 30%, rgba(211, 168, 76, .85) 30% 31%, transparent 31% 52%, rgba(20, 22, 24, .85) 52% 53%, transparent 53%),
    var(--sage);
}

.feature-art::before,
.feature-art::after {
  position: absolute;
  border: 1px solid rgba(255, 253, 247, .58);
  border-radius: 50%;
  content: "";
}

.feature-art::before {
  width: 180px;
  height: 180px;
  top: 28%;
  left: 28%;
}

.feature-art::after {
  width: 30px;
  height: 30px;
  right: 26%;
  bottom: 25%;
  background: var(--mustard);
  border: 0;
}

.feature-sun {
  position: absolute;
  top: 24%;
  right: 22%;
  width: 62px;
  height: 62px;
  background: rgba(211, 168, 76, .78);
  border-radius: 50%;
}

.feature-line--one,
.feature-line--two {
  position: absolute;
  z-index: 1;
  width: 58%;
  height: 1px;
  background: rgba(255, 253, 247, .72);
  transform-origin: left center;
}

.feature-line--one {
  top: 49%;
  left: 15%;
  transform: rotate(-28deg);
}

.feature-line--two {
  top: 59%;
  left: 23%;
  transform: rotate(-35deg);
}

.feature-stamp {
  position: absolute;
  top: 17px;
  left: 17px;
  z-index: 1;
  padding: 6px 8px;
  color: var(--ink);
  border: 1px solid rgba(255, 253, 247, .62);
  font: .62rem var(--font-mono);
}

.feature-copy {
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.feature-meta,
.feature-byline {
  color: var(--ink-faint);
}

.feature-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sage);
  font: .67rem var(--font-mono);
  text-transform: uppercase;
}

.feature-status::before {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.feature-copy h2 {
  margin: auto 0 13px;
  font-size: clamp(1.8rem, 3.5vw, 3.6rem);
}

.feature-copy p {
  max-width: 440px;
  color: var(--ink-soft);
}

.feature-byline {
  margin-top: auto;
  font-size: .8rem;
}

.feature-line {
  display: block;
  width: 100%;
  height: 1px;
  margin: 9px 0;
  background: var(--line);
}

.home-prompt {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  color: var(--ink);
  background: var(--coral);
  border-color: var(--coral);
}

.home-prompt .eyebrow,
.home-prompt h2,
.home-prompt p {
  color: var(--ink);
}

.home-prompt h2 {
  margin: 46px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.home-prompt p {
  margin-top: auto;
  opacity: .82;
}

.prompt-link {
  width: fit-content;
  margin-top: 15px;
  color: var(--ink);
  font-weight: 600;
}

.prompt-link:hover {
  color: var(--ink);
}

.prompt-number {
  align-self: end;
  font: .68rem var(--font-mono);
}

.home-lower {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 20px;
}

.home-activity,
.home-people {
  padding: 24px;
}

.home-activity h2,
.home-people h2 {
  margin-bottom: 20px;
}

.home-activity {
  background: var(--surface-dark);
}

.home-activity h2,
.home-activity .eyebrow {
  color: var(--ink);
}

.home-activity .eyebrow {
  color: var(--mustard);
}

.activity-board {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 247, .18);
  border-radius: var(--radius-small);
}

.context-item,
.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.context-item > div,
.person-row > span:not(.avatar) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.context-item strong,
.context-item small,
.person-row strong,
.person-row small {
  display: block;
  line-height: 1.25;
}

.context-item small,
.person-row small {
  color: var(--ink-soft);
  font-size: .72rem;
}

.activity-board .context-item {
  color: #d8dfd8;
  border-color: rgba(255, 253, 247, .13);
}

.context-item:first-child,
.person-row:first-child {
  border-top: 0;
}

.context-index {
  min-width: 30px;
  color: var(--mustard);
}

.home-people .person-row {
  color: var(--ink-soft);
}

.person-row::before {
  width: 9px;
  height: 9px;
  background: var(--sage);
  border-radius: 50%;
  content: "";
}

.home-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: var(--blue-soft);
  border-color: #cfd6d8;
}

.home-invite h2 {
  max-width: 620px;
  margin-bottom: 0;
}

/* ── Feed, posts and comments ───────────────────────────── */

.feed-tabs,
.market-tabs {
  display: flex;
  gap: 7px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.feed-tab,
.market-tab {
  padding: 8px 11px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: .8rem;
}

.feed-tab:hover,
.feed-tab.is-active,
.market-tab:hover,
.market-tab.is-active {
  color: var(--map-dark);
  border-color: var(--map);
}

.feed-list {
  display: grid;
  gap: 14px;
}

.post {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.post-body {
  min-width: 0;
}

.post-head,
.post-meta,
.product-maker,
.product-footer,
.post-actions {
  display: flex;
  align-items: center;
}

.post-head,
.product-footer {
  justify-content: space-between;
  gap: 12px;
}

.post-meta {
  flex-wrap: wrap;
  gap: 6px;
  color: var(--ink-faint);
  font-size: .78rem;
}

.post-meta strong {
  color: var(--ink);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  background: var(--mustard);
  border-radius: 50% 50% 50% 8px;
  font: .75rem var(--font-mono);
}

.avatar--tiny {
  width: 26px;
  height: 26px;
  font-size: .58rem;
}

.avatar--lime {
  background: var(--sage-soft);
}

.avatar--blue {
  color: var(--ink);
  background: var(--map);
}

.avatar--orange,
.avatar--purple {
  background: var(--coral);
}

.avatar--purple {
  color: var(--ink);
  background: #746b8b;
}

.post-kind {
  color: var(--map-dark);
}

.post-text {
  margin: 14px 0;
  color: var(--ink-soft);
}

.post-media {
  min-height: 130px;
  margin: 16px 0;
  padding: 17px;
  color: var(--ink);
  background: var(--map-dark);
  border-radius: var(--radius-small);
}

.post-media--citadel {
  background:
    linear-gradient(140deg, transparent 0 40%, rgba(211, 168, 76, .78) 40% 42%, transparent 42%),
    var(--sage);
}

.post-media--redstone {
  background:
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(255, 253, 247, .16) 16px 17px),
    var(--map-dark);
}

.media-label {
  color: rgba(255, 253, 247, .85);
}

.post-actions {
  justify-content: flex-end;
  gap: 5px;
}

.post-action,
.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: .75rem;
  text-decoration: none;
}

.post-action:hover,
.post-action.is-saved,
.comment-action:hover {
  color: var(--map-dark);
  background: var(--blue-soft);
  border-color: #cfd6d8;
}

.post-action--more {
  margin-left: auto;
}

.post-menu {
  position: absolute;
  z-index: 2;
  min-width: 160px;
  padding: 6px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow);
}

.menu-action {
  width: 100%;
  border: 0;
  text-align: left;
}

.menu-action--danger {
  color: var(--coral);
}

.comment-list,
.comments-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.comment-meta {
  display: flex;
  gap: 7px;
  color: var(--ink-faint);
  font-size: .75rem;
}

.comment-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.comments-loading,
.comments-empty {
  padding: 18px;
  color: var(--ink-soft);
  text-align: center;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

/* ── Marketplace ─────────────────────────────────────────── */

.marketplace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 23px;
}

.market-tabs {
  flex-wrap: wrap;
  border-bottom: 0;
}

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

.product-card {
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
  transition: transform .18s ease, box-shadow .18s ease;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.product-art {
  position: relative;
  min-height: 165px;
  padding: 14px;
  background: var(--map-dark);
}

.product-art--sable {
  background:
    radial-gradient(circle at 70% 30%, var(--mustard) 0 13%, transparent 14%),
    linear-gradient(135deg, var(--surface-dark), var(--map-dark));
}

.product-art--terrain {
  background:
    linear-gradient(145deg, transparent 0 40%, rgba(255, 253, 247, .35) 40% 42%, transparent 42%),
    var(--sage);
}

.product-art--service {
  background:
    repeating-linear-gradient(-45deg, transparent 0 15px, rgba(255, 253, 247, .15) 15px 16px),
    var(--coral);
}

.product-label,
.product-price {
  color: var(--ink);
}

.product-price {
  position: absolute;
  right: 15px;
  bottom: 15px;
  font-weight: 600;
}

.product-info {
  padding: 18px;
}

.product-maker {
  gap: 8px;
  color: var(--ink-soft);
  font-size: .8rem;
}

.verified-check {
  color: var(--map);
}

.product-info h3 {
  margin: 15px 0 8px;
}

.product-info p {
  min-height: 47px;
  color: var(--ink-soft);
  font-size: .84rem;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  font: .66rem var(--font-mono);
}

.product-footer {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ── Safety, profile, jobs and data screens ───────────────── */

.safety-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 25px;
  color: var(--ink);
  background: var(--surface-dark);
  border-radius: var(--radius);
}

.safety-hero h1,
.safety-hero .heading-note {
  color: var(--ink);
}

.safety-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--on-accent);
  background: var(--mustard);
  border-radius: 50% 50% 50% 4px;
  font-size: 1.35rem;
}

.safety-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.safety-panel {
  padding: 22px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.safety-panel--primary {
  border-top: 4px solid var(--sage);
}

.security-check,
.scam-item,
.ticket-status-item,
.review-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.security-check:first-child,
.scam-item:first-child,
.ticket-status-item:first-child,
.review-item:first-child {
  border-top: 0;
}

.security-check--pending {
  color: var(--ink-soft);
}

.scam-list,
.ticket-status-list {
  display: grid;
}

.scam-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
}

.scam-severity--critical {
  color: #873b31;
}

.scam-severity--warning {
  color: #876522;
}

.ticket-status-panel {
  padding: 18px;
  background: var(--blue-soft);
  border: 1px solid #cfd6d8;
  border-radius: var(--radius);
}

.public-profile-page {
  display: grid;
  gap: 18px;
}

.public-profile-card {
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-cover {
  min-height: 170px;
  background:
    linear-gradient(135deg, transparent 0 44%, rgba(211, 168, 76, .8) 44% 46%, transparent 46%),
    var(--map-dark);
}

.profile-info {
  display: flex;
  align-items: end;
  gap: 16px;
  padding: 0 24px 24px;
}

.profile-info .avatar {
  width: 74px;
  height: 74px;
  margin-top: -28px;
  border: 5px solid var(--paper-strong);
}

.profile-info h1 {
  margin: 0;
  font-size: 2rem;
}

.profile-info p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.public-profile-copy,
.public-profile-handle,
.public-profile-meta {
  color: var(--ink-soft);
}

.public-profile-meta,
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.mini-stats {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.mini-stats strong {
  display: block;
  color: var(--ink);
}

.progress-ring {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  color: var(--map-dark);
  border: 8px solid var(--blue-soft);
  border-top-color: var(--map);
  border-radius: 50%;
  font: .7rem var(--font-mono);
}

.job-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--on-accent);
  background: var(--map);
  border-radius: var(--radius-small);
}

.job-icon--lime {
  color: var(--on-accent);
  background: var(--mustard);
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Auth ────────────────────────────────────────────────── */

.auth-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  padding: 10px 14px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}

.auth-tab.is-active {
  color: var(--map-dark);
  border-color: var(--map);
  font-weight: 600;
}

.language-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

/* ── Rail and contextual navigation ─────────────────────── */

.right-rail {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100vh;
  padding-top: 108px;
}

.rail-card {
  padding: 18px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rail-card--profile {
  background: var(--blue-soft);
  border-color: #cfd6d8;
}

.rail-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font: .68rem var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.week-progress {
  display: flex;
  align-items: center;
  gap: 15px;
}

.week-progress > div:last-child {
  min-width: 0;
}

.week-progress strong {
  display: block;
}

.week-progress p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: .82rem;
}

.rail-code {
  color: var(--coral);
  font: .65rem var(--font-mono);
}

.rail-note {
  margin-bottom: 0;
  font-size: .84rem;
}

.context-item {
  font-size: .82rem;
}

/* ── Modals and toasts ──────────────────────────────────── */

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

.modal {
  width: min(100%, 560px);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

.modal-form {
  display: grid;
  gap: 15px;
  padding: 22px;
}

.modal-actions {
  justify-content: flex-end;
  padding-top: 6px;
}

.toast-root {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.toast-root > * {
  pointer-events: auto;
}

.toast {
  padding: 13px 15px;
  color: var(--ink);
  background: var(--surface-dark);
  border-left: 4px solid var(--mustard);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow);
}

/* ── Responsive shell ───────────────────────────────────── */

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  #rail-root {
    display: none;
  }

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

@media (max-width: 880px) {
  .app-shell {
    display: block;
    width: min(100% - 32px, 760px);
  }

  #sidebar-root {
    display: none;
  }

  .main-column {
    padding-bottom: 35px;
  }

  .topbar {
    gap: 10px;
  }

  .mobile-menu-toggle,
  .mobile-brand {
    display: inline-grid;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-brand .brand-mark {
    width: 27px;
    height: 27px;
  }

  .topbar-location {
    display: none;
  }

  .search-box {
    width: min(290px, 50vw);
    margin-left: 0;
  }

  .mobile-drawer {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    display: flex;
    width: min(310px, 88vw);
    flex-direction: column;
    padding: 24px;
    background: var(--paper-strong);
    border-right: 1px solid var(--line);
    box-shadow: 14px 0 34px rgba(0, 0, 0, .14);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  body.nav-open .mobile-drawer {
    transform: translateX(0);
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
  }

  .mobile-drawer-account {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .home-stage,
  .home-lower,
  .safety-grid {
    grid-template-columns: 1fr;
  }

  .home-feature {
    grid-template-columns: 1fr;
  }

  .feature-art {
    min-height: 230px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
    background-size: 22px 22px;
  }

  .app-shell {
    width: min(100% - 24px, 560px);
  }

  #page-content {
    padding-top: 22px;
  }

  .topbar {
    min-height: 68px;
    padding: 14px 0;
  }

  .search-box {
    width: 38px;
    padding: 9px;
  }

  .search-box input {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .page-heading,
  .section-heading,
  .marketplace-toolbar,
  .home-invite {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 2.55rem;
  }

  .button,
  .compose-button {
    width: fit-content;
  }

  .home-intro {
    display: block;
    padding-top: 8px;
  }

  .home-intro-mark {
    width: 110px;
    height: 110px;
    margin: 30px 10px 0 auto;
  }

  .home-feature {
    display: block;
  }

  .feature-copy {
    min-height: 300px;
  }

  .home-prompt {
    min-height: 300px;
  }

  .home-invite {
    gap: 17px;
  }

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

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

  .post > .avatar {
    width: 34px;
    height: 34px;
  }

  .post-actions {
    justify-content: flex-start;
  }

  .empty-state {
    min-height: 350px;
    padding: 42px 21px;
  }

  .empty-state h1,
  .empty-state h2 {
    font-size: 2rem;
  }

  .empty-state .actions,
  .empty-state .actions .button {
    width: 100%;
  }

  .empty-state .actions .button {
    justify-content: center;
  }

  .legal-page,
  .card,
  .safety-panel {
    padding: 20px;
  }

  .safety-hero {
    grid-template-columns: 1fr;
  }

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

  .site-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }
}

/* ── REST only: preserved as an independent visual world ─── */

/* ==========================================================================
   Refinamiento visual · black edition
   ========================================================================== */

body:not(.rest-page) {
  background-size: 32px 32px;
}

/* Halo sutil superior en lugar del degradado plano */
body:not(.rest-page)::before {
  background:
    radial-gradient(900px 520px at 18% -10%, rgba(159, 214, 224, .07), transparent 70%),
    radial-gradient(700px 420px at 100% 0%, rgba(224, 128, 108, .05), transparent 70%);
}

::selection {
  background: var(--map-dark);
  color: var(--on-accent);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-small);
}

:where(.card, .panel, .surface, .tile, .box) {
  box-shadow: var(--shadow-small), var(--shadow-inset);
}

:where(a, button, .nav-link, .account-link, .menu-action, .button,
  .compose-button, .filter-button, .text-button, .text-link-arrow) {
  transition:
    color .18s var(--ease),
    background-color .18s var(--ease),
    border-color .18s var(--ease),
    box-shadow .22s var(--ease),
    transform .18s var(--ease);
}

.button:active,
.compose-button:active,
.filter-button:active {
  transform: translateY(1px);
}

/* Barra lateral y topbar con separación por luz, no por color */
.section-nav,
.topbar {
  background: color-mix(in srgb, var(--paper-strong) 92%, transparent);
  backdrop-filter: blur(10px);
}

.nav-link.is-active {
  box-shadow: inset 2px 0 0 var(--map-dark);
}

/* Scrollbars discretas */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
  border: 3px solid transparent;
  background-clip: padding-box;
}

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   Refinamiento visual II · bordes, fondos, botones, modales, formularios
   ========================================================================== */

/* Fondos: superficies por capas de luz, no por tinte */
.card,
.notice,
.state,
.inline-state,
.page-heading,
.section-heading,
.rail-card,
.safety-panel,
.product-card,
.public-profile-card,
.ticket-status-panel,
.post-menu {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, 0) 42%),
    var(--paper-strong);
  border-color: var(--line);
  box-shadow: var(--shadow-small), var(--shadow-inset);
}

.card:hover,
.rail-card:hover,
.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow), var(--shadow-inset);
}

.product-card {
  overflow: hidden;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}

.product-card:hover {
  transform: translateY(-2px);
}

/* Bordes: hairlines más finas y consistentes */
.section-nav,
.topbar,
.site-footer,
.modal-header,
.modal,
.search-box,
.badge,
.status-badge {
  border-color: var(--line);
}

.notice {
  border-left-width: 3px;
}

.section-nav-divider {
  background: var(--line);
  opacity: .8;
}

/* Botones: superficie con relieve, hover por luz, estado activo y disabled */
.button,
.compose-button,
.filter-button,
.text-button,
.text-link-arrow {
  position: relative;
  padding: 10px 16px;
  letter-spacing: -.01em;
  box-shadow: var(--shadow-small), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.button:hover,
.compose-button:hover,
.filter-button:hover,
.text-button:hover,
.text-link-arrow:hover {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.button--outline,
.filter-button,
.text-button,
.button--ghost {
  box-shadow: none;
}

.button--outline:hover,
.filter-button:hover,
.text-button:hover {
  background: color-mix(in srgb, var(--map) 10%, transparent);
  border-color: var(--map-dark);
  box-shadow: none;
}

.button--ghost:hover {
  box-shadow: none;
}

.button--dark {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0)),
    var(--surface-dark);
  box-shadow: var(--shadow-small), var(--shadow-inset);
}

.button--dark:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0)),
    var(--paper-raised);
  border-color: var(--line-strong);
}

.button:disabled,
.compose-button:disabled,
.filter-button:disabled,
.text-button:disabled,
.button[aria-disabled="true"] {
  color: var(--ink-faint);
  background: var(--paper-muted);
  border-color: var(--line);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.icon-button,
.notification-button,
.modal-close,
.mobile-menu-toggle {
  border-radius: var(--radius-small);
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}

.icon-button:hover,
.notification-button:hover,
.modal-close:hover,
.mobile-menu-toggle:hover {
  background: var(--paper-raised);
  border-color: var(--line-strong);
}

/* Formularios: campos hundidos, foco claro, estados de error */
input,
select,
textarea {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 60%),
    var(--paper-strong);
  border-color: var(--line);
  transition: border-color .18s var(--ease), box-shadow .2s var(--ease), background-color .18s var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--map-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--map) 22%, transparent);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 20%, transparent);
}

.search-box {
  background: var(--paper-strong);
  transition: border-color .18s var(--ease), box-shadow .2s var(--ease);
}

.search-box:focus-within {
  border-color: var(--map-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--map) 18%, transparent);
}

.field-label {
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Modales: fondo con desenfoque, entrada suave, cabecera fijada */
.modal-backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(6px);
  animation: kv-fade .18s var(--ease) both;
}

.modal {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 38%),
    var(--paper-strong);
  border-color: var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 40px 100px -24px rgba(0, 0, 0, .9), var(--shadow-inset);
  animation: kv-rise .24s var(--ease) both;
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--paper-strong) 94%, transparent);
  backdrop-filter: blur(8px);
}

.modal-actions {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

@keyframes kv-fade {
  from {
    opacity: 0;
  }
}

@keyframes kv-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
}

/* Insignias, avatares y menús */
.badge,
.status-badge {
  padding: 4px 10px;
  border-color: color-mix(in srgb, var(--map) 30%, transparent);
  font-size: .72rem;
  letter-spacing: .04em;
}

.status-badge--lime {
  border-color: color-mix(in srgb, var(--sage) 34%, transparent);
}

.status-badge--dark {
  border-color: var(--line-strong);
}

.status-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 20%, transparent);
}

.avatar {
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-inset);
}

.post-menu {
  border-color: var(--line-strong);
  box-shadow: var(--shadow), var(--shadow-inset);
}

.menu-action:hover {
  background: var(--paper-raised);
}

.menu-action--danger:hover {
  color: var(--coral);
  background: var(--coral-soft);
}

.danger-zone {
  background:
    linear-gradient(180deg, rgba(224, 128, 108, .06), rgba(0, 0, 0, 0) 50%),
    var(--paper-strong);
  border-color: color-mix(in srgb, var(--coral) 34%, transparent);
}

/* Tipografía y separadores del contenido */
hr {
  height: 1px;
  border: 0;
  background: var(--line);
}

code,
pre,
kbd {
  color: var(--ink);
  background: var(--surface-dark);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  font-family: var(--font-mono);
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--ink-soft);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, .022);
}

.rest-page {
  --rest-ink: #0d0d0c;
  --rest-paper: #f1eee6;
  --rest-paper-dim: #c4c0b7;
  --rest-acid: #e4f27b;
  --rest-orange: #ff9b72;
  --rest-violet: #a99cff;
  --rest-rule: rgba(241, 238, 230, .18);
  min-height: 100vh;
  overflow: hidden;
  color: var(--rest-paper);
  background: var(--rest-ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.rest-page *,
.rest-page *::before,
.rest-page *::after {
  box-sizing: border-box;
}

.rest-page a {
  color: inherit;
}

.rest-header,
.rest-main,
.rest-footer {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
}

.rest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  border-bottom: 1px solid var(--rest-rule);
}

.rest-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--rest-paper);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.1em;
}

.rest-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--rest-ink);
  background: var(--rest-acid);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.08em;
}

.rest-nav {
  display: flex;
  align-items: center;
  gap: 25px;
  color: var(--rest-paper-dim);
  font-size: 12px;
}

.rest-nav a {
  text-decoration: none;
}

.rest-nav a:hover,
.rest-nav a:focus-visible {
  color: var(--rest-acid);
}

.rest-nav .rest-nav-kravor {
  padding: 9px 13px;
  color: var(--rest-ink);
  background: var(--rest-paper);
  border-radius: 999px;
}

.rest-main {
  padding: 86px 0 120px;
}

.rest-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--rest-acid);
  font: 11px "DM Mono", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.rest-kicker::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

.rest-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 8vw;
  align-items: end;
  padding: 31px 0 94px;
}

.rest-hero h1 {
  max-width: 780px;
  margin: 0;
  color: var(--rest-paper);
  font-size: clamp(61px, 10.4vw, 148px);
  line-height: .84;
  letter-spacing: -.11em;
}

.rest-hero h1 em {
  color: var(--rest-acid);
  font-style: normal;
}

.rest-hero-copy {
  max-width: 340px;
  padding-bottom: 8px;
  color: var(--rest-paper-dim);
  font-size: 17px;
  line-height: 1.45;
}

.rest-hero-copy strong {
  display: block;
  margin-bottom: 12px;
  color: var(--rest-paper);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.06em;
}

.rest-signal {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 285px;
  margin-bottom: 93px;
  border-top: 1px solid var(--rest-rule);
  border-bottom: 1px solid var(--rest-rule);
}

.rest-signal::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--rest-rule);
  content: "";
}

.rest-signal-block {
  position: relative;
  display: flex;
  min-height: 285px;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px 27px 24px 0;
}

.rest-signal-block + .rest-signal-block {
  padding-right: 0;
  padding-left: 27px;
}

.rest-signal-label {
  color: var(--rest-paper-dim);
  font: 11px "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rest-signal-number {
  color: var(--rest-orange);
  font-size: clamp(78px, 13vw, 176px);
  font-weight: 700;
  line-height: .7;
  letter-spacing: -.14em;
}

.rest-signal-block:last-child .rest-signal-number {
  color: var(--rest-violet);
}

.rest-signal-note {
  max-width: 230px;
  margin: 0;
  color: var(--rest-paper-dim);
  font-size: 13px;
  line-height: 1.35;
}

.rest-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 28px;
}

.rest-section-heading h2 {
  max-width: 460px;
  margin: 0;
  color: var(--rest-paper);
  font-size: clamp(31px, 4vw, 52px);
  line-height: .96;
  letter-spacing: -.09em;
}

.rest-section-heading p {
  max-width: 280px;
  margin: 0;
  color: var(--rest-paper-dim);
  font-size: 13px;
  line-height: 1.45;
}

.rest-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rest-rule);
}

.rest-principle {
  min-height: 245px;
  padding: 25px 24px 20px 0;
  border-right: 1px solid var(--rest-rule);
}

.rest-principle + .rest-principle {
  padding-left: 24px;
}

.rest-principle:last-child {
  border-right: 0;
}

.rest-principle-index {
  color: var(--rest-acid);
  font: 11px "DM Mono", monospace;
}

.rest-principle h3 {
  margin: 66px 0 10px;
  color: var(--rest-paper);
  font-size: 24px;
  letter-spacing: -.07em;
}

.rest-principle p {
  max-width: 230px;
  margin: 0;
  color: var(--rest-paper-dim);
  font-size: 13px;
  line-height: 1.45;
}

.rest-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1fr;
  gap: 6vw;
  align-items: center;
  padding: 100px 0 30px;
}

.rest-product-mark {
  position: relative;
  display: grid;
  min-height: 350px;
  place-items: center;
  overflow: hidden;
  color: var(--rest-ink);
  background: var(--rest-acid);
}

.rest-product-mark::before,
.rest-product-mark::after {
  position: absolute;
  border: 1px solid rgba(13, 13, 12, .26);
  border-radius: 50%;
  content: "";
}

.rest-product-mark::before {
  width: 92%;
  height: 52%;
  transform: rotate(-18deg);
}

.rest-product-mark::after {
  width: 65%;
  height: 92%;
  transform: rotate(18deg);
}

.rest-product-mark span {
  position: relative;
  z-index: 1;
  font-size: clamp(50px, 9vw, 115px);
  font-weight: 700;
  letter-spacing: -.15em;
}

.rest-product-copy .rest-kicker {
  color: var(--rest-orange);
}

.rest-product-copy h2 {
  max-width: 430px;
  margin: 23px 0 18px;
  color: var(--rest-paper);
  font-size: clamp(34px, 4.7vw, 64px);
  line-height: .91;
  letter-spacing: -.1em;
}

.rest-product-copy p {
  max-width: 390px;
  color: var(--rest-paper-dim);
  font-size: 15px;
  line-height: 1.5;
}

.rest-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  color: var(--rest-ink);
  background: var(--rest-paper);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.rest-cta:hover,
.rest-cta:focus-visible {
  color: var(--rest-ink);
  background: var(--rest-acid);
}

.rest-cta span {
  font-size: 17px;
  line-height: .7;
}

.rest-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 32px;
  border-top: 1px solid var(--rest-rule);
  color: var(--rest-paper-dim);
  font: 10px "DM Mono", monospace;
}

.rest-footer a {
  color: var(--rest-paper);
  text-decoration: none;
}

.rest-footer a:hover,
.rest-footer a:focus-visible {
  color: var(--rest-acid);
}

@media (max-width: 720px) {
  .rest-header,
  .rest-main,
  .rest-footer {
    width: min(100% - 32px, 560px);
  }

  .rest-header {
    padding: 19px 0;
  }

  .rest-nav {
    gap: 13px;
    font-size: 10px;
  }

  .rest-nav a:not(.rest-nav-kravor) {
    display: none;
  }

  .rest-main {
    padding: 62px 0 80px;
  }

  .rest-hero {
    display: block;
    padding: 26px 0 72px;
  }

  .rest-hero h1 {
    font-size: clamp(62px, 22vw, 120px);
  }

  .rest-hero-copy {
    margin-top: 35px;
    font-size: 15px;
  }

  .rest-signal {
    margin-bottom: 70px;
  }

  .rest-signal-block,
  .rest-signal-block + .rest-signal-block {
    min-height: 220px;
    padding: 21px 15px 18px 0;
  }

  .rest-signal-block + .rest-signal-block {
    padding-right: 0;
    padding-left: 15px;
  }

  .rest-signal-number {
    font-size: 78px;
  }

  .rest-section-heading {
    display: block;
  }

  .rest-section-heading p {
    margin-top: 18px;
  }

  .rest-principles {
    display: block;
  }

  .rest-principle,
  .rest-principle + .rest-principle {
    min-height: auto;
    padding: 21px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rest-rule);
  }

  .rest-principle h3 {
    margin-top: 29px;
  }

  .rest-principle:last-child {
    border-bottom: 0;
  }

  .rest-product {
    display: flex;
    flex-direction: column;
    gap: 37px;
    padding-top: 72px;
  }

  .rest-product-mark {
    width: 100%;
    min-height: 240px;
  }

  .rest-product-copy {
    width: 100%;
  }

  .rest-footer {
    display: grid;
    gap: 9px;
  }
}

/* ==========================================================================
   Kravor — Capa de adaptabilidad universal
   Se carga DESPUÉS de global.css / styles.css.
   Objetivo: que la página funcione en cualquier pantalla (móvil, tablet,
   portátil, monitor grande, TV) y con cualquier nivel de zoom del navegador.
   ========================================================================== */

/* --- 1. Base fluida ------------------------------------------------------ */
:root {
  /* Escala tipográfica fluida: crece/decrece con el ancho real de la ventana.
     Al hacer zoom el navegador reduce el ancho CSS, así que todo se recompone
     igual que en una pantalla más pequeña: nunca se corta el contenido. */
  --kv-fluid-base: clamp(14px, 0.55rem + 0.55vw, 18px);
  --kv-gutter: clamp(12px, 3vw, 32px);
  --kv-radius-fluid: clamp(10px, 1.2vw, 20px);
}

html {
  font-size: var(--kv-fluid-base);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

*,
*::before,
*::after {
  min-width: 0; /* evita que hijos de flex/grid desborden */
}

/* --- 2. Medios y contenido incrustado ------------------------------------ */
img,
svg,
video,
canvas,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

iframe,
video {
  aspect-ratio: 16 / 9;
  width: 100%;
}

pre,
code,
kbd,
samp {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

/* --- 3. Textos largos sin desbordes -------------------------------------- */
h1, h2, h3, h4, h5, h6, p, li, a, span, small, label, blockquote, td, th {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

h1 { font-size: clamp(1.6rem, 1.05rem + 1.7vw, 2.6rem); line-height: 1.12; }
h2 { font-size: clamp(1.35rem, 1rem + 1.6vw, 2.2rem); line-height: 1.15; }
h3 { font-size: clamp(1.1rem, 0.95rem + 0.9vw, 1.6rem); line-height: 1.2; }

/* --- 4. Alto de pantalla real en móviles (barra de direcciones) ---------- */
.app-shell,
.main-column,
.auth-shell,
[class*="full-height"],
[class*="min-vh"] {
  min-height: 100svh;
  min-height: 100dvh;
}

/* --- 5. Contenedores principales ----------------------------------------- */
.app-shell,
.main-column,
#page-content,
.view,
main,
section,
footer,
header {
  max-width: 100%;
  box-sizing: border-box;
}

#page-content,
.main-column {
  padding-inline: var(--kv-gutter);
}

/* --- 6. Rejillas que se recomponen solas --------------------------------- */
/* Cualquier rejilla de tarjetas se adapta al espacio disponible sin
   media queries: nunca deja columnas más estrechas que 240px. */
[class*="-grid"]:not(.home-stage):not(.app-shell),
.cards,
.card-list,
.tiles {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
  gap: var(--kv-gutter);
}

/* --- 7. Estructura de tres columnas -> dos -> una ------------------------ */
@media (max-width: 1280px) {
  .app-shell,
  .app-shell--wide {
    grid-template-columns: 200px minmax(0, 1fr) !important;
  }
  .app-shell > aside:last-of-type,
  .right-rail,
  .aside-right,
  #rightrail-root {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .app-shell,
  .app-shell--wide {
    display: block !important;
  }
  #sidebar-root,
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
  }
  .main-column {
    width: 100%;
  }
  /* Cualquier rejilla de dos columnas pasa a una sola */
  [style*="grid-template-columns"],
  .split,
  .two-col,
  .home-intro,
  .home-stage,
  .detail-layout {
    grid-template-columns: 1fr !important;
  }
}

/* --- 8. Filas con texto + controles -------------------------------------- */
.topbar,
.page-head,
.section-head,
.toolbar,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1.5vw, 16px);
}

.topbar > *,
.page-head > *,
.section-head > * {
  min-width: 0;
}

/* --- 9. Objetivos táctiles y formularios --------------------------------- */
button,
.button,
[role="button"],
a.button,
input[type="submit"] {
  min-height: 40px;
  max-width: 100%;
}

input,
select,
textarea {
  max-width: 100%;
  font-size: max(16px, 1rem); /* evita el zoom automático en iOS */
}

/* --- 10. Modales, menús y capas flotantes -------------------------------- */
.modal,
.dialog,
.sheet,
.popover,
.dropdown,
[role="dialog"] {
  max-width: min(96vw, 640px);
  max-height: 90svh;
  overflow: auto;
}

/* --- 11. Barras horizontales desplazables -------------------------------- */
.chips,
.tabs,
.filters,
.scroller {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.chips > *,
.tabs > *,
.filters > * {
  flex: 0 0 auto;
}

/* --- 12. Pantallas muy pequeñas (o zoom muy alto) ------------------------ */
@media (max-width: 420px) {
  :root { --kv-gutter: 12px; }
  .hide-xs { display: none !important; }
  .home-intro-mark { display: none !important; }
}

/* --- 13. Pantallas muy grandes ------------------------------------------- */
@media (min-width: 1800px) {
  .main-column,
  #page-content {
    margin-inline: auto;
  }
}

/* --- 14. Orientación horizontal en móvil --------------------------------- */
@media (max-height: 480px) and (orientation: landscape) {
  .app-shell,
  .main-column {
    min-height: auto;
  }
}

/* --- 15. Impresión y accesibilidad --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  #sidebar-root,
  .topbar,
  .right-rail {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
