@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1c1c1e;
  --paper: #ffffff;
  --chrome: #f2f2f7;
  --muted: #636366;
  --line: #e5e5ea;
  --ring: #d1d1d6;
  --soft: #ececf1;
  --alert: #fff4e0;
  --alert-ink: #6a3b00;
  --shell: var(--ink);
  --shell-ink: #ffffff;
  --line-fitness: #c8102e;
  --line-growth: #0077c8;
  --line-finance: #0e8a4b;
  --line-relationships: #c43b7a;
  --line-adventure: #d07000;
  --line-work: #5c4b8a;
  --line-none: #8e8e93;
  --pad: 1.25rem;
  --tap: 2.75rem;
  --radius: 12px;
  --rail-w: 15rem;
  --bar-h: 3.5rem;
  --valley-d: 1.25rem;
  --valley-f: 0.5rem;
}

body.habitos-app {
  background: var(--paper);
  color-scheme: light;
  height: 100%;
  overflow: hidden;
}

html:has(body.habitos-app) {
  margin-top: 0 !important;
  height: 100%;
  overflow: hidden;
}

body.habitos-app[data-theme="dark"] {
  --ink: #f5f5f7;
  --paper: #1c1c1e;
  --chrome: #2c2c2e;
  --muted: #c7c7cc;
  --line: #3a3a3c;
  --ring: #636366;
  --soft: #3a3a3c;
  --alert: #3d2e14;
  --alert-ink: #ffd7a8;
  --shell: #f5f5f7;
  --shell-ink: #1c1c1e;
  color-scheme: dark;
  background: var(--paper);
}

body.habitos-app .wp-site-blocks > header,
body.habitos-app .wp-site-blocks > footer,
body.habitos-app header.wp-block-template-part,
body.habitos-app footer.wp-block-template-part {
  display: none;
}

body.habitos-app .wp-site-blocks,
body.habitos-app main,
body.habitos-app .entry-content,
body.habitos-app .wp-block-post-content {
  margin: 0;
  padding: 0;
  max-width: none;
}

body.habitos-app .wp-block-post-title {
  display: none;
}

body.habitos-app #wpadminbar {
  display: none !important;
}

body.admin-bar.habitos-app {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.habitos,
.habitos-gate {
  font-family: "Barlow", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.45;
}

body.habitos-app .habitos,
body.habitos-app .habitos-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
}

.habitos,
.habitos *,
.habitos-gate,
.habitos-gate * {
  box-sizing: border-box;
}

.habitos ::selection {
  background: var(--ink);
  color: var(--paper);
}

.habitos {
  display: flex;
  flex-direction: column;
}

body.admin-bar.habitos-app {
  margin-top: 0;
}

.habitos ::selection {
  background: var(--ink);
  color: var(--paper);
}

.habitos :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.habitos-main {
  scrollbar-color: var(--ring) transparent;
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  background: var(--paper);
}

.stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  flex: 1;
  position: relative;
}

.pull-note {
  position: absolute;
  top: 3.15rem;
  left: 0;
  right: 0;
  z-index: 3;
  margin: 0;
  text-align: center;
  pointer-events: none;
}

.to-top {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  background: var(--paper);
  border: 1px solid var(--line);
}

.icon-btn[hidden] {
  display: none;
}

@media (min-width: 801px) {
  .pull-note {
    top: 0.35rem;
  }
}

.rail {
  display: flex;
  flex-shrink: 0;
  order: 2;
  min-width: 0;
  max-width: 100%;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--chrome) linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat;
  color: var(--ink);
  padding: 0.55rem 0.5rem calc(0.2rem + env(safe-area-inset-bottom));
  gap: 0.15rem;
}

/* Valle del riel: la forma de hoja que abraza a la sección activa y la une con la hoja de contenido. La coloca app.js (placeValley) y se mueve con transform. */
.rail-valley {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: var(--valley-d);
  background:
    radial-gradient(circle at 0 100%, transparent calc(var(--valley-f) - 0.5px), var(--paper) var(--valley-f)) left top / var(--valley-f) var(--valley-f) no-repeat,
    radial-gradient(circle at 100% 100%, transparent calc(var(--valley-f) - 0.5px), var(--paper) var(--valley-f)) right top / var(--valley-f) var(--valley-f) no-repeat,
    linear-gradient(var(--paper), var(--paper)) center top / calc(100% - 2 * var(--valley-f) + 0.5px) 100% no-repeat;
  transform-origin: 50% 0;
  pointer-events: none;
}

.tool-cluster {
  display: flex;
  align-items: flex-end;
  align-self: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  padding: 0.1rem 0.15rem 0;
  gap: 0.1rem;
}

.lang-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lang-caption {
  display: none;
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
}

.lang-slot .icon-btn {
  width: auto;
  min-width: var(--tap);
  padding: 0 0.45rem 0 0.35rem;
  gap: 0.15rem;
}

.lang-code {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand {
  display: none;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.logo-slot {
  display: flex;
  flex: 0 0 auto;
}

.logo-mark {
  display: block;
  flex: 0 0 auto;
  color: var(--ink);
}

.nav-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: clamp(0.6875rem, 2.9vw, 0.8125rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  padding: 0.15rem 0.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  text-align: center;
}

.nav-label {
  display: none;
}

.nav-btn.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

/* El riel recorta lo que sale de él: el anillo de foco va por dentro del botón. */
.nav-btn:focus-visible {
  outline-offset: -4px;
}

/* Desde 30rem la barra inferior se reúne bajo la columna de 36rem y cada sección lleva su etiqueta bajo el icono. */
@media (min-width: 30rem) and (max-width: 800px) {
  :root {
    --bar-h: 4.25rem;
  }

  .rail {
    justify-content: center;
  }

  .nav-btn {
    flex: 1 1 0;
    flex-direction: column;
    gap: 0.1rem;
    min-height: 3.5rem;
    max-width: 6.5rem;
  }

  .nav-label {
    display: block;
  }
}

.habitos-main {
  order: 1;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  padding: 1.25rem var(--pad) calc(var(--tap) + 1.1rem);
}

.habitos-main > * {
  max-width: 36rem;
  margin-inline: auto;
}

.pane {
  max-width: none;
}

.boot {
  margin: 2rem 0;
  color: var(--muted);
}

h1,
h2 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.day-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "title title title"
    "prev . next";
  align-items: center;
  gap: 0.15rem 0.5rem;
}

.day-head h1 {
  grid-area: title;
  margin: 0;
  text-align: left;
}

.day-head .step:first-of-type {
  grid-area: prev;
  justify-self: start;
}

.day-head .step:last-of-type {
  grid-area: next;
  justify-self: end;
}

/* Desde 30rem la fecha cabe entre los dos chevrones, como el mes del calendario. */
@media (min-width: 30rem) {
  .day-head {
    grid-template-areas: "prev title next";
  }

  .day-head h1 {
    text-align: center;
  }
}

.switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.switcher h1,
.pick-label {
  margin: 0;
  min-width: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.pick-chosen {
  margin: 0.15rem 0 0.35rem;
  color: var(--ink);
  font-weight: 600;
}

.stack .name {
  margin: 0;
}

.step {
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0 0.15rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.ghost,
.solid,
.step,
.row,
.stop,
.chip,
.checkline,
.quiet,
.tabs button {
  font: inherit;
  cursor: pointer;
}

/* .solid y .ghost: catálogo en DESIGN.md, sección Components. */
.ghost,
.solid {
  min-height: var(--tap);
  padding: 0 1rem;
  border-radius: var(--radius);
}

.ghost {
  border: 0;
  background: var(--chrome);
  color: var(--ink);
  font-weight: 600;
}

.solid {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.pro-pill {
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0 0.9rem;
}

.solid:disabled,
.ghost:disabled,
.chip:disabled,
.stop:disabled,
.row:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.banner {
  margin: 0 0 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius);
  background: var(--alert);
  color: var(--alert-ink);
}

.banner button {
  margin-left: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.here-stop {
  margin: 0.85rem 0 0.25rem;
}

.here-copy {
  margin: 0;
  color: var(--muted);
}

.list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-height: 4rem;
  padding: 0.55rem 0.15rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  color: inherit;
}

.copy {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.streak {
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

.invite {
  margin: 1.25rem 0 0.35rem;
  max-width: 24ch;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.close {
  margin-top: 2.25rem;
  padding-top: 0.25rem;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line-none);
  flex: 0 0 auto;
}

.dot[data-area="fitness"] { background: var(--line-fitness); }
.dot[data-area="growth"] { background: var(--line-growth); }
.dot[data-area="finance"] { background: var(--line-finance); }
.dot[data-area="relationships"] { background: var(--line-relationships); }
.dot[data-area="adventure"] { background: var(--line-adventure); }
.dot[data-area="work"] { background: var(--line-work); }

.row .station {
  --mark: var(--line-none);
  position: relative;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--mark);
  background: transparent;
  color: var(--paper);
}

.row .station[data-area="fitness"] { --mark: var(--line-fitness); }
.row .station[data-area="growth"] { --mark: var(--line-growth); }
.row .station[data-area="finance"] { --mark: var(--line-finance); }
.row .station[data-area="relationships"] { --mark: var(--line-relationships); }
.row .station[data-area="adventure"] { --mark: var(--line-adventure); }
.row .station[data-area="work"] { --mark: var(--line-work); }

.row .station[data-state="full"] {
  background: var(--mark);
  box-shadow: none;
}

.row .station[data-area="adventure"][data-state="full"] {
  color: #1c1c1e;
}

.row .station[data-state="full"]::after {
  content: "";
  position: absolute;
  left: 0.64rem;
  top: 0.36rem;
  width: 0.32rem;
  height: 0.58rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 1.15rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

.route {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem 0;
  padding: 0.2rem 0 0.35rem;
}

.stop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.due-dot {
  position: absolute;
  bottom: 0.08rem;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
}

.stop .station {
  position: relative;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}

.station-num {
  position: relative;
  z-index: 1;
}

.stop .station[data-state="empty"] {
  box-shadow: inset 0 0 0 1.5px var(--ring);
}

.stop .station[data-state="partial"] {
  background: var(--soft);
}

.stop .station[data-state="full"] {
  background: var(--ink);
  color: var(--paper);
}

.stop .station[data-state="off"] {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.stop .station[data-state="future"] {
  color: var(--muted);
}

.stop.is-today .station {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.stop.is-today .station[data-state="full"] {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}

.stop[data-open="1"] .station {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.stop[data-open="1"] .station[data-state="full"] {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0.85rem 0 0.15rem;
}

.week-strip .stop {
  min-height: 3.35rem;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  align-content: center;
  gap: 0.12rem;
}

.strip-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.habit-open,
.mark-hit {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}

.habit-open {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0;
  text-align: left;
}

.mark-hit {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  flex: 0 0 auto;
  touch-action: manipulation;
}

.objective-row .station {
  --mark: var(--ink);
}

.objective-row.is-done .name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.day-sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.day-sheet h2 {
  margin: 0;
}

.journal {
  margin-top: 2.25rem;
}

.journal .tabs button {
  min-height: 2.75rem;
  line-height: 1.15;
  white-space: normal;
}

.terminus {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hint,
.lead,
.checkline,
label,
.quiet {
  color: var(--muted);
}

.hint,
.lead {
  margin: 0.35rem 0 0;
  max-width: 62ch;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.35rem;
  min-height: var(--tap);
  color: var(--ink);
}

.checkline input,
.stack input,
.stack select,
.stack textarea,
.item input {
  accent-color: var(--ink);
  caret-color: var(--ink);
}

.stack {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.stack label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.stack input,
.stack select,
.stack textarea,
.stack .brief {
  width: 100%;
  min-height: var(--tap);
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}

.stack textarea,
.stack .brief {
  min-height: 5.5rem;
  resize: vertical;
}

.stack .brief {
  max-height: 9rem;
  overflow: auto;
  line-height: 1.45;
  white-space: normal;
}

.stack input::placeholder,
.stack textarea::placeholder {
  color: var(--muted);
}

.account-block {
  margin-top: 2rem;
}

.account-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
  margin: 0 0 1rem;
}

.account-nav button {
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.account-nav button.is-on {
  color: var(--ink);
  font-weight: 600;
}

.account-shop {
  min-width: 0;
  overflow-x: auto;
}

.account-shop table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
}

.account-shop th,
.account-shop td {
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}

.account-shop th {
  color: var(--muted);
  font-weight: 600;
}

.account-shop a {
  color: var(--ink);
}

/* El área de toque de un enlace de tabla llega a --tap sin hacer más alta la fila. */
.account-shop td a,
.account-shop th a {
  position: relative;
}

.account-shop td a::after,
.account-shop th a::after {
  content: "";
  position: absolute;
  inset: -0.8rem;
}

.account-shop .wps_sfw_sub_detail_back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--tap);
  margin: 0 0 1rem;
  color: var(--muted);
  text-decoration: none;
}

.account-shop .wps_sfw_sub_detail_back svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.account-shop .wps_sfw_sub_detail_back svg path {
  fill: currentColor;
}

.account-shop .button,
.account-shop button,
.account-shop input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  margin: 0.15rem 0.15rem 0.15rem 0;
  padding: 0 0.9rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.account-shop .woocommerce-message,
.account-shop .woocommerce-error,
.account-shop .woocommerce-info {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: var(--chrome);
  color: var(--ink);
  list-style: none;
}

.account-shop input[type="text"],
.account-shop input[type="email"],
.account-shop input[type="password"],
.account-shop input[type="tel"],
.account-shop input[type="number"],
.account-shop select,
.account-shop textarea {
  width: 100%;
  min-height: var(--tap);
  margin: 0.25rem 0 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.account-shop h2,
.account-shop h3 {
  font-size: 1.25rem;
}

.account-logout {
  margin: 2rem 0 0;
}

.account-logout a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 12px;
  background: var(--chrome);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.tabs {
  display: flex;
  gap: 0.15rem;
  margin: 0.25rem 0 1.25rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: var(--chrome);
}

.tabs button {
  flex: 1;
  min-height: var(--tap);
  min-width: 0;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.tabs button.is-on {
  background: var(--paper);
  color: var(--ink);
}

.week-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.week-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.chips {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.chip {
  width: 100%;
  aspect-ratio: 1;
  max-width: 2.75rem;
  justify-self: center;
  border-radius: 50%;
  border: 1.5px solid var(--ring);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  padding: 0;
}

.chip[data-area="fitness"] { border-color: var(--line-fitness); color: var(--line-fitness); }
.chip[data-area="growth"] { border-color: var(--line-growth); color: var(--line-growth); }
.chip[data-area="finance"] { border-color: var(--line-finance); color: var(--line-finance); }
.chip[data-area="relationships"] { border-color: var(--line-relationships); color: var(--line-relationships); }
.chip[data-area="adventure"] { border-color: var(--line-adventure); color: var(--line-adventure); }
.chip[data-area="work"] { border-color: var(--line-work); color: var(--line-work); }

.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip.is-on[data-area="fitness"] { background: var(--line-fitness); border-color: var(--line-fitness); }
.chip.is-on[data-area="growth"] { background: var(--line-growth); border-color: var(--line-growth); }
.chip.is-on[data-area="finance"] { background: var(--line-finance); border-color: var(--line-finance); }
.chip.is-on[data-area="relationships"] { background: var(--line-relationships); border-color: var(--line-relationships); }
.chip.is-on[data-area="adventure"] { background: var(--line-adventure); border-color: var(--line-adventure); color: var(--ink); }
.chip.is-on[data-area="work"] { background: var(--line-work); border-color: var(--line-work); }

.row:active .station,
.stop:active .station,
.mark-hit:active .station,
.chip:active {
  transform: scale(0.94);
}

.count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}

.item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  border-bottom: 1px solid var(--line);
}

.item.is-follow {
  padding-left: 1.1rem;
}

.item input:checked + p .name {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.item p {
  margin: 0;
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.when {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.money,
.total {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.total {
  display: flex;
  justify-content: space-between;
  margin: 0.85rem 0 0;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}

.range {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.range input[type="range"] {
  flex: 1;
  accent-color: var(--ink);
  min-height: var(--tap);
}

.range-val {
  font-variant-numeric: tabular-nums;
  min-width: 3rem;
  text-align: right;
  font-weight: 600;
}

.quiet {
  border: 0;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  padding: 0.4rem 0;
  color: var(--muted);
}

/* Dentro de la app el terciario llega a --tap; el login y las páginas legales llevan su propia medida. */
.habitos-main .quiet {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.area-block {
  padding-top: 0.15rem;
}

.area-block h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.area-block h2::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--mark, var(--line-none));
  flex: 0 0 auto;
}

.area-block[data-area="fitness"] { --mark: var(--line-fitness); }
.area-block[data-area="growth"] { --mark: var(--line-growth); }
.area-block[data-area="finance"] { --mark: var(--line-finance); }
.area-block[data-area="relationships"] { --mark: var(--line-relationships); }
.area-block[data-area="adventure"] { --mark: var(--line-adventure); }
.area-block[data-area="work"] { --mark: var(--line-work); }

.area-counts {
  margin: 0;
  color: var(--muted);
}

.habitos-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--paper);
}

.habitos-gate a {
  color: var(--ink);
  font-weight: 600;
}

body.habitos-app .habitos.habitos-login {
  display: grid;
  place-items: safe center;
  overflow: auto;
  padding: 1.5rem var(--pad) calc(1.5rem + env(safe-area-inset-bottom));
}

.login-sheet {
  position: relative;
  width: min(100%, 22rem);
}

.login-mark {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 0 1.15rem;
  color: var(--ink);
}

.price {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.upgrade {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow: auto;
  background: rgba(28, 28, 30, 0.28);
}

.upgrade-card {
  width: min(100%, 24rem);
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.upgrade-card .logo-mark {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.8rem;
}

.upgrade-card h2 {
  margin-top: 0;
}

.upgrade-card .ghost {
  width: 100%;
  margin-top: 0.5rem;
}

/* El botón de pago y «Ahora no» van antes de las listas: las listas arrancan con aire. */
.upgrade-card .ghost + div > h2 {
  margin-top: 1.75rem;
}

.seal-unveil {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow: auto;
  background: rgba(28, 28, 30, 0.28);
}

.seal-unveil-card {
  width: min(100%, 22rem);
  padding: 1.35rem 1.25rem 1.25rem;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.seal-unveil-card h2 {
  margin: 1.15rem 0 0.35rem;
  overflow-wrap: anywhere;
}

.seal-unveil-card .hint {
  margin: 0;
}

.seal-unveil-card .solid {
  width: 100%;
  margin-top: 1.25rem;
}

.seal-unveil .badge-svg svg {
  width: 7.5rem;
  height: 7.5rem;
}

.habitos-login h1 {
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
}

.habitos-login .lead {
  margin: 0 0 1.15rem;
}

.habitos-login .banner,
.habitos-login .login-note {
  margin: 0 0 1rem;
}

.login-note {
  margin: 0;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius);
  background: var(--chrome);
  color: var(--ink);
}

.habitos-login .stack {
  margin: 0;
}

.habitos-login .solid {
  width: 100%;
  margin-top: 0.35rem;
}

.habitos-login a.ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.75rem;
  text-decoration: none;
}

/* .google-enter: catálogo en DESIGN.md, sección Components. Solo Entrar y Crear cuenta. */
.habitos-login button.google-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--tap);
  margin-top: 0.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.habitos-login button.google-enter .google-enter-mark {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  flex: 0 0 1.125rem;
}

@media (hover: hover) {
  .habitos-login button.google-enter:hover {
    background: var(--chrome);
    border-color: var(--ring);
  }
}

@media (prefers-reduced-motion: reduce) {
  .habitos-login button.google-enter {
    transition: none;
  }
}

.habitos-login .checkline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
  color: var(--ink);
}

.habitos-login .checkline input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  border: 0;
  flex: 0 0 auto;
}

.login-alt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 1rem 0 0;
}

.login-alt a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.login-legal {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.login-legal a {
  color: inherit;
}

.legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 1.75rem 0 0;
}

.legal-row a,
.legal-row .legal-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a.quiet {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.habitos-login input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--paper) inset;
}

@media (min-width: 801px) {
  body.habitos-app .habitos.habitos-login {
    justify-items: center;
    align-items: stretch;
    padding: 0;
    background: var(--chrome);
  }

  .login-sheet {
    width: min(100%, 36rem);
    min-height: 100%;
    background: var(--paper);
    padding: 2.5rem 2.5rem 3rem;
    display: grid;
    align-content: center;
  }
}

@media (min-width: 801px) {
  :root {
    --valley-d: 1.5rem;
  }

  .shell {
    position: relative;
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    height: 100%;
    background: var(--chrome);
  }

  .rail {
    order: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 0;
    background: var(--chrome);
    padding: 1.5rem 0.85rem 5.75rem;
    gap: 0.2rem;
  }

  .rail-valley {
    width: var(--valley-d);
    height: 0;
    background:
      radial-gradient(circle at 0 0, transparent calc(var(--valley-f) - 0.5px), var(--paper) var(--valley-f)) right top / var(--valley-f) var(--valley-f) no-repeat,
      radial-gradient(circle at 0 100%, transparent calc(var(--valley-f) - 0.5px), var(--paper) var(--valley-f)) right bottom / var(--valley-f) var(--valley-f) no-repeat,
      linear-gradient(var(--paper), var(--paper)) left center / 100% calc(100% - 2 * var(--valley-f) + 0.5px) no-repeat;
    transform-origin: 100% 50%;
  }

  .brand {
    display: flex;
    padding: 0.15rem 0.85rem 1.15rem;
  }

  .nav-btn {
    flex: 0 0 auto;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
    padding: 0 0.85rem;
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--muted);
  }

  .nav-label {
    display: inline;
  }

  .nav-btn.is-on {
    background: var(--paper);
    color: var(--ink);
    box-shadow: none;
  }

  .tool-cluster {
    position: absolute;
    left: 0.85rem;
    bottom: 0.7rem;
    z-index: 6;
    align-self: auto;
    padding: 0;
  }

  .lang-caption {
    display: block;
  }

  .lang-code {
    display: none;
  }

  .lang-slot .icon-btn {
    width: var(--tap);
    min-width: 0;
    padding: 0;
  }

  .habitos-main {
    order: 0;
    align-self: stretch;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    background: var(--paper);
    padding: 2rem 2.5rem calc(var(--tap) + 1.1rem);
  }
}

/* De 801 a 1100px el riel mide 12.5rem: la marca (192px) y la etiqueta más larga caben sin partirse y la columna llega a 540px a 820px. */
@media (min-width: 801px) and (max-width: 1100px) {
  :root {
    --rail-w: 12.5rem;
  }

  .habitos-main {
    padding-inline: 2rem;
  }
}

/* Hoja ancha (.pane.is-wide): las mallas, Calendario, Premios y la galería de un perfil, crecen desde 1280px. El texto corrido y las listas siguen en 36rem: Barlow mide unos 6,5px por carácter a 16px, o sea unos 88 caracteres por línea a 36rem, ya por encima del tope de lectura. */
@media (min-width: 1280px) {
  .habitos-main > :has(> .pane.is-wide) {
    max-width: 44rem;
  }

  .pane.is-wide .badge-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1440px) {
  .habitos-main > :has(> .pane.is-wide) {
    max-width: 48rem;
  }
}

@media (min-width: 1920px) {
  .habitos-main > :has(> .pane.is-wide) {
    max-width: 56rem;
  }

  .pane.is-wide .badge-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.quote {
  margin: 1.25rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--chrome);
}

.quote-kicker {
  display: flex;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.quote blockquote {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: 0.875rem;
}

.quote-by {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.ad {
  margin: 1.5rem 0 0;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--paper);
}

.ad.is-third {
  background: var(--chrome);
  color: var(--ink);
}

.ad-note {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.35;
}

.ad.is-third .lead,
.ad.is-third .ad-note,
.ad-third .ad-note {
  color: var(--ink);
}

.ad.is-third .ad-note {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.ad .solid {
  margin-top: 0.75rem;
}

.ad img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.ad-link {
  display: block;
}

.ad-units {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.75rem;
  container-type: inline-size;
}

.ad-unit {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper);
  line-height: 0;
}

.ad-unit[data-size="468x60"] {
  display: none;
}

@container (min-width: 468px) {
  .ad-unit[data-size="468x60"] {
    display: block;
  }
}

.ad-frame {
  display: block;
  width: 100%;
  max-width: 300px;
  height: 250px;
  border: 0;
  background: var(--paper);
}

.ad-unit[data-size="160x300"] .ad-frame {
  max-width: 160px;
  height: 300px;
}

.ad-unit[data-size="468x60"] .ad-frame {
  max-width: 468px;
  height: 60px;
}

.ad .ad-unit[data-size="300x250"] img {
  width: 300px;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.ad .ad-unit[data-size="160x300"] img {
  width: 160px;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.ad .ad-unit[data-size="468x60"] img {
  width: 468px;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.habitos.is-held .habitos-main {
  overflow: hidden;
}

.free-gate {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}

.free-gate-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: calc(0.85rem + env(safe-area-inset-top)) 1rem 0.85rem;
}

.free-gate-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.free-gate-actions .hint {
  margin: 0;
  max-width: 24rem;
  color: var(--ink);
}

.free-gate-actions .solid,
.free-gate-actions .ghost {
  width: min(100%, 24rem);
  max-width: 100%;
  min-height: var(--tap);
  flex-shrink: 0;
  white-space: normal;
  text-align: center;
}

.free-gate h1 {
  font-size: 1.25rem;
  max-width: min(22rem, 100%);
  text-wrap: balance;
}

.free-gate h1,
.free-gate .lead {
  max-width: min(22rem, 100%);
  overflow-wrap: break-word;
}

.ad-third {
  width: min(300px, 100%);
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--chrome);
  color: var(--ink);
}

.ad-third.ad-consent {
  width: min(24rem, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.ad-consent .solid {
  width: 100%;
  height: auto;
  white-space: normal;
  padding: 0.65rem 1rem;
}

.free-gate .ad-third {
  padding: 1.25rem 1rem;
  border-width: 3px;
  border-color: var(--ink);
}

.free-gate .ad-third:not(.ad-consent) {
  width: min(22rem, 100%);
}

.free-gate .ad-third .ad-note {
  width: 100%;
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.ad-remove {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.free-gate-unit {
  width: 100%;
  max-width: 300px;
  overflow: hidden;
}

.free-gate-unit .ad-frame,
.ad-third .ad-frame {
  width: 100%;
  max-width: 300px;
  height: 250px;
}

.free-gate-unit + .free-gate-unit {
  margin-top: 0.75rem;
}

.free-gate-unit img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
}

.free-spin {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  animation: habitos-spin 0.8s linear infinite;
}

@keyframes habitos-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .free-spin {
    animation: none;
  }
}

a.pay,
button.pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.habitos-main.is-checkout {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.habitos-main.is-checkout > * {
  max-width: none;
  flex: 1;
  min-height: 0;
  margin: 0;
}

.checkout-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.checkout-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.75rem var(--pad) 0.35rem;
}

.checkout-bar .ghost,
.checkout-bar .quiet {
  width: auto;
}

.checkout-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--paper);
}

.reflect {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.praise {
  margin: 0.45rem 0 0;
  color: var(--ink);
  font-weight: 600;
  animation: habitos-praise 2.6s ease both;
}

.mark-hit.just-done .station,
.row.just-done .station,
.stop.just-done .station {
  animation: habitos-check 480ms ease;
}

@keyframes habitos-check {
  0% { transform: scale(0.86); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes habitos-praise {
  0% { opacity: 0; transform: translateY(4px); }
  14% { opacity: 1; transform: none; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}

@media (hover: hover) {
  .row:hover {
    background: color-mix(in srgb, var(--ink) 4%, var(--paper));
  }

  .step:hover,
  .ghost:hover,
  .quiet:hover {
    color: var(--ink);
    background: var(--chrome);
  }

  .solid:hover {
    background: color-mix(in srgb, var(--ink) 82%, white);
  }

  .nav-btn:hover:not(.is-on) {
    background: color-mix(in srgb, var(--ink) 6%, transparent);
    color: var(--ink);
  }

  button.badge:hover .badge-name {
    text-decoration: underline;
    text-underline-offset: 0.14em;
  }

  .chip:hover:not(:disabled):not(.is-on) {
    background: var(--chrome);
  }
}

@media (prefers-reduced-motion: reduce) {
  .habitos *,
  .habitos-gate * {
    transition: none !important;
    animation: none !important;
  }
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.field-head span:not(.hint) {
  font-weight: 600;
}

.brief:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + 1.3rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  max-width: min(22rem, calc(100% - 2rem));
  padding: 0.7rem 0.95rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  text-align: center;
}

button.toast.is-link {
  width: auto;
  appearance: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.reflect.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reflect.rich h2,
.focus-sheet .writer h2,
.brief h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.8rem 0 0.35rem;
}

.reflect.rich h3,
.focus-sheet .writer h3,
.brief h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.65rem 0 0.3rem;
}

.reflect.rich p,
.focus-sheet .writer p,
.brief p,
.brief div,
.focus-sheet .writer div {
  margin: 0 0 0.65rem;
}

.reflect.rich ul,
.reflect.rich ol,
.focus-sheet .writer ul,
.focus-sheet .writer ol,
.brief ul,
.brief ol {
  margin: 0.35rem 0 0.8rem;
  padding-left: 1.25rem;
}

.brief :first-child,
.focus-sheet .writer :first-child {
  margin-top: 0;
}

.brief strong,
.brief b,
.writer strong,
.writer b,
.rich strong,
.rich b {
  font-weight: 600;
}

.brief em,
.brief i,
.writer em,
.writer i,
.rich em,
.rich i {
  font-style: italic;
}

.brief u,
.writer u,
.rich u {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.focus-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem var(--pad) calc(1rem + env(safe-area-inset-bottom));
  background: var(--paper);
  color: var(--ink);
}

.focus-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.focus-top h1 {
  margin: 0;
  font-size: 1.25rem;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tools button.is-on {
  background: transparent;
  color: var(--ink);
}

.ico {
  display: flex;
  pointer-events: none;
}

@media (hover: hover) {
  .icon-btn:hover,
  .tools button:hover,
  .account-nav button:hover {
    color: var(--ink);
    background: transparent;
  }
}

.nav-btn,
.tabs button,
.account-nav button,
.icon-btn,
.tools button {
  transition: none;
}

.writer {
  flex: 1;
  min-height: 12rem;
  overflow: auto;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  caret-color: var(--ink);
}

.writer:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.writer[contenteditable="false"] {
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}

@media (min-width: 801px) {
  .toast {
    bottom: 1.5rem;
  }

  .focus-sheet {
    left: var(--rail-w);
    padding: 2rem 2.5rem 2rem;
  }

  .focus-sheet .writer,
  .focus-top,
  .tools,
  .focus-sheet .actions {
    width: min(100%, 36rem);
    margin-inline: auto;
  }
}

.streak-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.35rem 0 1rem;
}

.streak-with-uniform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  width: 100%;
}

.uniform {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.4rem;
  min-width: 0;
}

.uniform.is-mini {
  width: auto;
  margin: 0;
  gap: 0.3rem;
}

.uniform .logo-mark {
  width: 2.25rem;
  height: 2.25rem;
}

.uniform.is-mini .logo-mark {
  width: 1.05rem;
  height: 1.05rem;
}

.uniform-seals {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.uniform-seal {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  color: var(--ink);
}

.uniform-seal .badge-svg svg {
  width: 2.5rem;
  height: 2.5rem;
}

.uniform.is-mini .uniform-seal,
.uniform.is-mini .uniform-seal .badge-svg svg {
  width: 1.2rem;
  height: 1.2rem;
}

.uniform-seal.is-empty {
  border: 1px solid var(--line);
  border-radius: 50%;
}

.uniform-note {
  margin-top: 0.2rem;
}

.avatar-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto 1fr auto auto auto;
  column-gap: 1rem;
  margin: 0.85rem 0 1.25rem;
}

.avatar-stage > .avatar {
  grid-column: 1;
  grid-row: 1 / span 5;
}

.avatar-stage > h2,
.membership .avatar-stage > h2 {
  grid-column: 2;
  grid-row: 2;
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
}

.avatar-stage > h2 .pro-mark {
  margin-left: 0.4rem;
  vertical-align: -0.2rem;
}

.avatar-stage > p:nth-of-type(1) {
  grid-column: 2;
  grid-row: 3;
  margin-top: 0.15rem;
}

.avatar-stage > p:nth-of-type(2) {
  grid-column: 2;
  grid-row: 4;
}

.avatar-stage > .avatar-grid {
  grid-column: 1 / -1;
  grid-row: 6;
  margin: 0.9rem 0 0;
}

.avatar-stage > .avatar-detail {
  grid-column: 1 / -1;
  grid-row: 7;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.avatar-detail > h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.avatar-detail > p {
  margin: 0.35rem 0 0;
}

.avatar-detail > .actions {
  margin-top: 0.75rem;
}

.avatar-stage > p:nth-of-type(3) {
  grid-column: 1 / -1;
  grid-row: 8;
}

.avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.avatar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 4.75rem;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.avatar-btn > svg {
  width: 2.6rem;
  height: 3.64rem;
}

.avatar-btn:hover {
  border-color: var(--ring);
}

.avatar-btn.is-on,
.avatar-btn.is-on:hover {
  border-color: var(--ink);
}

.avatar-btn.is-worn::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink);
}

.avatar-btn.is-locked > svg {
  opacity: 0.45;
}

.avatar-btn .pro-tag {
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.avatar-btn .lock-mark {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  display: flex;
  color: var(--ink);
}

.avatar {
  display: flex;
}

.avatar.is-portrait > svg {
  width: 7.5rem;
  height: 10.5rem;
}

.medal-row,
.board-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--tap);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

button.medal-row {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.board-rank,
.board-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.board-rank {
  min-width: 1.5rem;
}

.board-name {
  font-weight: 600;
}

.board-row.is-mine {
  background: var(--chrome);
  border-radius: 12px;
  padding-inline: 0.45rem;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 0.45rem;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.lock-mark {
  display: flex;
  flex: 0 0 auto;
}

.badge-count {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.badge-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.15rem 0 1.35rem;
}

.badge-filters button {
  min-height: var(--tap);
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.badge-filters button.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.badge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge-grid li {
  min-width: 0;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

div.badge {
  cursor: default;
}

.badge-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  color: var(--ink);
}

.badge-mark.is-dim {
  color: var(--muted);
}

.badge-mark.is-shown {
  border: 2px solid var(--ink);
  border-radius: 12px;
}

.badge-svg {
  display: flex;
}

.badge-svg svg {
  width: 4.5rem;
  height: 4.5rem;
}

.badge-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.badge-lock svg {
  width: 1.15rem;
  height: 1.15rem;
}

.badge-name,
.badge-line {
  overflow-wrap: anywhere;
}

.badge-name {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.badge-line {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

.badge-svg.is-draw circle,
.badge-svg.is-draw path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: seal-draw 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes seal-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge-svg.is-draw circle,
  .badge-svg.is-draw path {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}

.login-sheet.contact-sheet {
  position: relative;
  width: min(100%, 28rem);
}

.contact-sheet textarea {
  min-height: 9rem;
}

.contact-sheet input,
.contact-sheet textarea,
.contact-sheet select {
  caret-color: var(--ink);
}

.contact-sheet input::placeholder,
.contact-sheet textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

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

@media (min-width: 801px) {
  .badge-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.post,
.post.is-reply {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

/* El hilo es una línea de 1px en --line bajo la publicación, no una caja. */
.post > [role="group"] {
  margin: 0.15rem 0 0 0.875rem;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

/*
 * Los comentarios fuera de pantalla no se maquetan (content-visibility), y eso recorta lo que
 * sobresale de su caja: el aro de foco del icono de Traducir (que entra -0.75rem a la izquierda),
 * el de Quitar y el de abajo. La caja se agranda por esos tres lados y se resta con el margen,
 * así el texto no se mueve y no hace falta overflow-clip-margin, que Safari no tiene.
 */
.post.is-reply {
  margin: 0 -0.25rem -0.25rem -1rem;
  padding: 0.7rem 0.25rem 0.35rem 1rem;
  border-bottom: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 7rem;
}

.post.is-reply > p:not(.hint) {
  margin-top: 0.4rem;
}

.post.is-reply .actions {
  margin-top: 0;
}

.post > [role="group"] > .quiet {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.post > [role="group"] > .hint,
.post > [role="group"] > .banner {
  margin: 0.35rem 0;
}

.post > header,
.profile > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  row-gap: 0.05rem;
}

.post > header > div {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0.4rem;
  min-width: 0;
}

.post > header button {
  position: relative;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

/* El área de toque llega a --tap sin hacer más alta la cabecera. */
.post > header button::after {
  content: "";
  position: absolute;
  inset: -0.7rem -0.4rem;
}

.post > header time {
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post > header > span:not(.pro-mark),
.profile > header > span:not(.pro-mark) {
  grid-row: 1 / span 2;
  display: flex;
  flex: 0 0 auto;
  margin-right: 0.65rem;
  color: var(--ink);
}

.post > header > span:not(.pro-mark) > svg,
.profile > header > span:not(.pro-mark) > svg {
  width: 1.75rem;
  height: 1.75rem;
}

.post > header > span.avatar > svg {
  width: 1.75rem;
  height: 2.45rem;
}

.profile > header > span.avatar > svg {
  width: 3.5rem;
  height: 4.9rem;
}

.post.is-reply > header > span:not(.pro-mark) > svg,
.post.is-reply > header > span.avatar > svg {
  width: 1.5rem;
  height: 2.1rem;
}

.profile > header h1 {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 30rem) {
  .post > header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .post > header > span:not(.pro-mark) {
    grid-row: 1;
  }

  .post > header time {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0.65rem;
  }
}

.post > p:not(.hint) {
  margin: 0.65rem 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Comentar y Traducir son iconos de --tap; Quitar va solo, al otro extremo. */
.post .actions {
  gap: 0;
  margin-top: 0.35rem;
  align-items: center;
}

.post .actions > .icon-btn:first-child {
  margin-left: -0.75rem;
}

.post .actions[data-reactions] {
  gap: 0 0.15rem;
}

.post .icon-btn[data-plaza="react"][data-count] {
  width: auto;
  min-width: var(--tap);
  padding: 0 0.7rem 0 0.45rem;
  gap: 0.2rem;
}

.post [data-keep] {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.post [data-keep] .actions {
  gap: 0.5rem;
}

.post .icon-btn[data-plaza="react"] > .hint {
  margin: 0;
  max-width: none;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.post .actions > .quiet {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-left: auto;
  padding: 0 0.25rem;
}

.profile {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

.profile .uniform,
.profile .stack {
  margin-top: 0;
  margin-bottom: 0;
}

/* A 320px el logo y las seis insignias no caben en una línea: se encogen en vez de partirse. */
@media (max-width: 22.5rem) {
  .profile .uniform {
    gap: 0.5rem;
  }

  .profile .uniform-seals {
    gap: 0.2rem;
  }

  .profile .uniform-seal,
  .profile .uniform-seal .badge-svg svg {
    width: 2.1rem;
    height: 2.1rem;
  }
}

.profile h1,
.membership h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.membership h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.35rem;
}

.profile a {
  color: var(--ink);
}

.profile button.hint {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 400;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

/* Sello Pro: rosetón de borde festoneado, relleno de tinta, con la palomita recortada. */
.pro-mark {
  display: inline-flex;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.pro-mark .ico,
.pro-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.post.is-reply .pro-mark {
  width: 1rem;
  height: 1rem;
}

.profile h1 .pro-mark,
.membership h1 .pro-mark {
  width: 1.5rem;
  height: 1.5rem;
}

/* Icono con estados: traducido o desplegado en tinta, ocupado y sin versión atenuados. */
.icon-btn[aria-pressed="true"],
.icon-btn[aria-expanded="true"] {
  color: var(--ink);
}

.icon-btn[aria-busy="true"] {
  opacity: 0.5;
  cursor: progress;
}

.icon-btn[aria-disabled="true"] {
  opacity: 0.4;
}

/* La galería de 150 medallas pinta solo lo que se ve. */
.profile ~ .badge-grid li {
  content-visibility: auto;
  contain-intrinsic-size: auto 8rem;
}

.pane:has(> form[data-plaza-form="post"]) > h1 {
  margin-bottom: 0;
}

.pane:has(> form[data-plaza-form="post"]) > h1 + .lead {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.pane > [data-plaza="back"] {
  margin-bottom: 1rem;
}

.profile > .lead {
  margin: 0;
}

.profile > p:not(.lead) {
  margin: 0;
  max-width: 62ch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.profile > .ghost {
  justify-self: start;
}

form[data-plaza-form="post"] {
  margin: 1.15rem 0 0;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--line);
}

form[data-plaza-form="post"] textarea {
  min-height: 7.25rem;
}

form[data-plaza-form="post"] ~ .lead {
  margin-top: 1.25rem;
}

form[data-plaza-form="post"] textarea::placeholder,
form[data-plaza-form="comment"] textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.post [data-plaza-form="comment"] {
  margin: 0.6rem 0 0.25rem;
}

.post [data-plaza-form="comment"] textarea {
  min-height: 4.75rem;
}

form[data-plaza-form="profile"] .checkline,
form[data-form="profile"] .checkline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 400;
}

form[data-plaza-form="profile"] .checkline input,
form[data-form="profile"] .checkline input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  padding: 0;
  border: 0;
  flex: 0 0 auto;
}
