:root {
  --rr-ink: #0c0b0a;
  --rr-panel: #171513;
  --rr-line: #332d28;
  --rr-muted: #bfb6ae;
  --rr-amber: #ffbe80;
  --rr-orange: #ff7819;
  --rr-orange-light: #ff9b54;
  --rr-orange-ink: #160c06;
  --rr-field: #12100e;
  --rr-raised: #211c18;
  --rr-input: #100e0c;
  --rr-text: #faf7f4;
  --rr-line-bright: #5e5044;
  --rr-positive: #b4e39a;
  --rr-negative: #ffb7aa;
  --rr-radius: 17px;
  --rr-gutter: clamp(15px,3vw,28px);
}

body.reentra-app {
  background: var(--rr-ink);
  color: #faf7f4;
}

.rr-home {
  display: grid;
  gap: 18px;
}

.rr-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  min-height: 370px;
  border: 1px solid var(--rr-line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 85% 10%, #392319 0, transparent 56%),
    linear-gradient(124deg, #1a1511, #100e0d 64%, #211810);
}

.rr-hero-copy {
  position: relative;
  z-index: 2;
  padding: clamp(22px, 4vw, 48px);
}

.rr-kicker {
  margin: 0 0 14px;
  color: var(--rr-orange-light);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rr-hero .rr-title {
  margin: 0;
  max-width: 14ch;
  color: #faf7f4;
  font-size: clamp(2.55rem, 5.6vw, 5rem);
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.rr-title strong { color: var(--rr-orange-light); font-weight: inherit; }
.rr-hero .rr-lead {
  margin: 14px 0 22px;
  color: var(--rr-muted);
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.5;
}

.rr-hero .rr-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65em;
  min-height: 46px;
  padding: 10px 19px;
  border: 1px solid var(--rr-orange);
  border-radius: 11px;
  background: var(--rr-orange);
  color: #160c06;
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.rr-primary:hover { filter: brightness(1.1); }
.rr-hero-state {
  margin: 12px 0 0;
  color: var(--rr-muted);
  font-size: .79rem;
}

.rr-avatar {
  position: relative;
  align-self: stretch;
  display: grid;
  place-items: end center;
  min-width: 0;
  min-height: 330px;
  overflow: hidden;
  isolation: isolate;
}
.rr-avatar::before {
  content: "";
  position: absolute;
  inset: 5% 1% 0;
  z-index: -2;
  background: radial-gradient(ellipse at 55% 60%, #fc791747 0, #c2783a30 24%, transparent 68%),
    radial-gradient(ellipse at 75% 25%, #ffd28d33 0, transparent 56%);
  mask-image: radial-gradient(ellipse at 54% 52%, #000 25%, #000b 52%, transparent 75%);
  animation: rr-avatar-light 8s ease-in-out infinite alternate;
}
.rr-avatar::after {
  content: "";
  position: absolute;
  inset: auto 6% 6% 6%;
  z-index: -1;
  height: 15%;
  background: radial-gradient(ellipse, #080605 0, #1e1610 34%, transparent 70%);
}
.rr-avatar-ring {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(88%, 390px);
  aspect-ratio: 1;
  border: 1px solid #f98d4855;
  border-radius: 50%;
  transform: translate(-50%, -48%);
  box-shadow: inset 0 0 24px #f18b351a, 0 0 26px #f18b351a;
}
.rr-avatar-ring::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid transparent;
  border-right-color: #ffd39f;
  border-top-color: #f5a45460;
  border-radius: inherit;
  filter: drop-shadow(0 0 8px #ff9b54);
  animation: rr-avatar-orbit 12s linear infinite;
}
.rr-avatar img {
  position: absolute;
  inset: auto auto 4%;
  z-index: 1;
  height: 92%;
  max-width: 96%;
  width: auto;
  object-fit: contain;
  transform-origin: 64% 96%;
  animation: rr-avatar-stance 5.8s ease-in-out infinite alternate;
  filter: drop-shadow(-6px 6px 18px #02060095);
}
@keyframes rr-avatar-stance {
  from { transform: translateX(-1.5%) rotate(-1.3deg) scale(.99); }
  to { transform: translateX(2%) rotate(1.1deg) scale(1.018); }
}
@keyframes rr-avatar-light {
  from { opacity: .58; transform: translateX(-6%) scale(.94); }
  to { opacity: .97; transform: translateX(5%) scale(1.15); }
}
@keyframes rr-avatar-orbit { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .rr-avatar img, .rr-avatar::before, .rr-avatar-ring::before { animation: none; }
}

.rr-week {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 3vw, 25px);
  border: 1px solid var(--rr-line);
  border-radius: 18px;
  background: var(--rr-panel);
}
.rr-week-header { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.rr-week h2 { margin: 0; color: #faf7f4; font-size: 1.2rem; }
.rr-week .rr-week-date, .rr-week .rr-week-note { margin: 0; font-size: .77rem; color: var(--rr-muted); }
.rr-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rr-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 12px;
  border: 1px solid #332d28;
  border-radius: 12px;
  background: #100e0c;
  font-size: .78rem;
  line-height: 1.25;
  color: var(--rr-muted);
}
.rr-stat strong { color: var(--rr-orange-light); font-size: clamp(1.35rem, 3vw, 2rem); font-variant-numeric: tabular-nums; line-height: 1; }
.rr-stat:last-child strong { color: var(--rr-amber); }
.rr-week-days { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; list-style: none; }
.rr-week-days li { min-width: 0; padding: 6px 2px; border: 1px solid #332d28; border-radius: 8px; text-align: center; color: var(--rr-muted); font-size: .73rem; line-height: 1.2; }
.rr-week-days li.is-current { border-color: #82614a; }
.rr-week-days li.is-done { background: #3d2416; border-color: #94532a; color: #ffe0c8; }
.rr-week-days li span { display: block; min-height: 14px; margin-top: 3px; font-size: .7rem; }
.rr-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rr-next .rr-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--rr-line);
  border-radius: 12px;
  background: var(--rr-panel);
  color: #faf7f4;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rr-tile:hover { border-color: #896247; background: #211c18; }
.rr-tile-mark {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border-radius: 9px;
  background: #382719;
  color: var(--rr-orange-light);
  font-size: .85rem;
}
.rr-tile strong, .rr-tile small { display: block; }
.rr-tile strong { font-size: .9rem; }
.rr-tile small { margin-top: 3px; color: var(--rr-muted); font-size: .75rem; line-height: 1.32; }
.rr-tile-arrow {
  width: 7px;
  height: 7px;
  border: solid var(--rr-orange-light);
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.rr-control-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; list-style: none; }
.rr-control-list li { padding: 12px; border: 1px solid var(--rr-line); border-radius: 10px; background: var(--rr-panel); }
.rr-control-list strong { display: block; margin-bottom: 4px; color: var(--rr-orange-light); }
.rr-control-list span { color: var(--rr-muted); font-size: .85rem; }
.rr-bottom-nav { display: none; }
.rr-nav-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rr-bottom-nav [aria-current="page"] { color: var(--rr-orange-light); background: #352116; }
.rr-hero .rr-primary:focus-visible, .rr-next .rr-tile:focus-visible { outline: 2px solid var(--rr-orange-light); outline-offset: 3px; }

@media (max-width: 700px) {
  .rr-home { gap: 12px; padding-inline: 9px; }
  .rr-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .85fr); min-height: 243px; border-radius: 17px; }
  .rr-hero-copy { padding: 17px 0 17px 14px; }
  .rr-hero .rr-title { font-size: clamp(1.83rem, 7.3vw, 3.05rem); line-height: 1; }
  .rr-hero .rr-lead { font-size: .79rem; margin: 9px 0 14px; }
  .rr-kicker { font-size: .61rem; letter-spacing: .09em; margin-bottom: 9px; }
  .rr-hero .rr-primary { font-size: .76rem; padding: 8px 10px; min-height: 43px; gap: .4em; }
  .rr-hero-state { font-size: .68rem; }
  .rr-avatar { min-height: 0; }
  .rr-avatar img { height: 89%; max-width: 114%; }
  .rr-avatar-ring { width: 108%; }
  .rr-week { gap: 12px; }
  .rr-stat { padding: 10px 7px; font-size: .67rem; }
  .rr-next { gap: 8px; }
  .rr-next .rr-tile { gap: 7px; padding: 10px; }
  .rr-tile-mark { display: none; }
  .rr-tile strong { font-size: .81rem; }
  .rr-tile small { font-size: .69rem; }
  body.reentra-app { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .rr-bottom-nav:not([hidden]) {
    position: fixed;
    z-index: 40;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 9px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #332d28;
    background: #171513;
    box-shadow: 0 -8px 24px #0005;
  }

}

/* Keep the visual controls and system pages aligned with the REENTRA shell. */
body.reentra-app .status-nav a[aria-current="page"] {
  color: var(--rr-orange-light);
  border-color: var(--rr-orange-light);
}
body.reentra-app .monogram {
  display: grid;
  place-items: center;
  position: relative;
  color: var(--rr-text);
}
body.reentra-app .monogram span {
  position: absolute;
  inset: auto 4px 4px auto;
  width: 4px;
  height: 4px;
  overflow: hidden;
  background: var(--rr-orange);
  color: transparent;
}
.rr-bottom-nav a {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 47px;
  padding: 4px 2px;
  border-radius: 9px;
  color: #bfb6ae;
  font-size: .7rem;
  font-weight: 750;
  text-decoration: none;
}
.rr-bottom-nav a[aria-current="page"] { color: var(--rr-orange-light); }
.rr-bottom-nav a:focus-visible { outline: 2px solid var(--rr-orange-light); outline-offset: 2px; }
:is(.neural-static, .neural-hidden) .rr-avatar img,
:is(.neural-static, .neural-hidden) .rr-avatar::before,
:is(.neural-static, .neural-hidden) .rr-avatar-ring::before { animation-play-state: paused; }
.neural-heading:not(.emotion-hero) { padding-right: 0; }
@media (max-width: 700px) {
  body.reentra-app .status-nav { display: none; }
  body.reentra-app .topline { grid-template-columns: minmax(0,1fr) auto auto !important; }
  body.reentra-app .j-save-actions { bottom: calc(61px + env(safe-area-inset-bottom,0px)); }
  body.reentra-app .j-saving { bottom: calc(74px + env(safe-area-inset-bottom,0px)); }
}
