:root {
  --bg: #08111f;
  --card: rgba(12, 19, 35, 0.88);
  --card-soft: rgba(15, 24, 43, 0.72);
  --text: #f3f6fb;
  --muted: #98a6bf;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #ff7b2c;
  --accent-strong: #ff5e1f;
  --accent-soft: rgba(255, 123, 44, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 123, 44, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 30%),
    linear-gradient(180deg, #08111f 0%, #0b1528 48%, #060d18 100%);
  min-height: 100vh;
}

body.has-video-backdrop,
body:has(.video-backdrop) {
  background: #04070d;
}

.video-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.video-backdrop__media {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-width: 100%;
  min-height: 100%;
  object-fit: contain;
  object-position: center center;
  transform: none;
}

.video-backdrop__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 7, 13, 0.34) 0%, rgba(4, 7, 13, 0.68) 100%),
    radial-gradient(circle at top left, rgba(255, 123, 44, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 32%);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-wrap {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 80px;
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-block h1,
.brand-block p {
  margin: 0;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--accent), #f4b061);
  color: white;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.topnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav a,
.topnav span,
.nav-chip,
.date-jump button,
.secondary-button {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 19, 35, 0.72);
  backdrop-filter: blur(8px);
}

.topnav a.active {
  background: var(--accent);
  border-color: transparent;
  color: white;
}

.topnav span {
  color: var(--muted);
}

.nav-chip--disabled {
  opacity: 0.45;
  cursor: default;
}

.nav-chip--arrow,
.nav-chip--date {
  text-align: center;
}

.nav-chip--arrow {
  font-size: 1.15rem;
  font-weight: 800;
  padding-inline: 0;
}

.nav-chip--date {
  font-weight: 700;
  white-space: nowrap;
}

.hero-card,
.panel,
.stat-card,
.auth-card,
.slider-card,
.history-row,
.flash {
  background: rgba(12, 19, 35, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-card,
.panel,
.auth-card {
  border-radius: var(--radius);
}

.hero-card {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.hero-card h2,
.panel h3,
.auth-card h2 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2vw, 2.3rem);
}

.hero-card h2 {
  margin-bottom: 0;
}

.hero-card .lede {
  margin-top: 10px;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-pill,
.status-stack span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 24, 43, 0.84);
  border: 1px solid var(--line);
  font-weight: 700;
}

.guest-notice {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 196, 92, 0.24);
  background: linear-gradient(180deg, rgba(78, 54, 16, 0.42), rgba(25, 18, 8, 0.78));
  box-shadow: var(--shadow);
}

.guest-notice strong,
.guest-notice p {
  margin: 0;
}

.guest-notice strong {
  display: block;
  margin-bottom: 6px;
}

.guest-notice--tight {
  width: min(720px, 100%);
  margin-bottom: 0;
}

.motigoji-info-panel,
.focus-info-panel {
  width: min(760px, 100%);
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(12, 19, 35, 0.72);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.motigoji-info-panel strong,
.focus-info-panel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.motigoji-info-panel p,
.focus-info-panel p {
  margin: 0;
  color: rgba(243, 246, 251, 0.82);
  line-height: 1.6;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-toolbar,
.grid-two,
.stats-grid,
.slider-section,
.table-list,
.timeline,
.stack,
.field-grid {
  display: grid;
  gap: 16px;
}

.editor-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  margin-bottom: 18px;
}

.date-jump {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.day-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.day-nav > * {
  width: 100%;
}

.date-jump input,
.date-jump button,
input,
textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: rgba(8, 17, 31, 0.9);
  color: var(--text);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: rgba(152, 166, 191, 0.72);
}

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

.panel-notes-editor .panel-header {
  margin-bottom: 10px;
}

.panel-notes-editor textarea {
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 16px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

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

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

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

.stat-card {
  padding: 18px;
  border-radius: 24px;
}

.stat-card-primary,
.panel-kcal,
.panel-hero-chart {
  background:
    radial-gradient(circle at top left, rgba(255, 123, 44, 0.24), transparent 42%),
    linear-gradient(180deg, rgba(18, 28, 48, 0.96), rgba(10, 16, 29, 0.96));
  border-color: rgba(255, 123, 44, 0.18);
}

.panel-kcal {
  padding-top: 18px;
}

.stat-card--kcal {
  background:
    radial-gradient(circle at top left, hsla(var(--kcal-hue, 95), 88%, 58%, var(--kcal-glow, 0.18)), transparent 46%),
    linear-gradient(180deg, hsla(var(--kcal-hue, 95), 42%, 24%, 0.96), rgba(10, 16, 29, 0.96));
  border-color: hsla(var(--kcal-hue, 95), 74%, 62%, 0.34);
}

.stat-card--alert {
  background:
    radial-gradient(circle at top left, rgba(248, 113, 113, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(45, 20, 24, 0.96), rgba(19, 12, 18, 0.96));
  border-color: rgba(248, 113, 113, 0.28);
}

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

.stat-card strong {
  font-size: 2rem;
}

.stat-card__meta {
  display: block;
  margin-top: 8px;
  color: rgba(243, 246, 251, 0.68);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.slider-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 84px;
}

.slider-card {
  padding: 22px 18px 18px;
  border-radius: 24px;
  display: grid;
  gap: 12px;
  background: var(--card-soft);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.slider-card strong {
  font-size: 1.2rem;
}

input[type="range"] {
  appearance: none;
  height: 14px;
  border-radius: 999px;
  padding: 0;
  background: linear-gradient(90deg, rgba(255, 123, 44, 0.38), rgba(56, 189, 248, 0.52));
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #f9b64f);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(255, 94, 31, 0.28);
}

.floating-save {
  position: sticky;
  bottom: 18px;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.floating-save.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.floating-save .primary-button {
  min-width: 220px;
}

.primary-button,
.secondary-button {
  cursor: pointer;
  font-weight: 700;
}

.secondary-button:disabled,
.primary-button:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.primary-button {
  border: none;
  color: white;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  padding: 14px 18px;
  border-radius: 999px;
  box-shadow: 0 16px 34px rgba(216, 78, 27, 0.28);
}

.primary-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.insight-card,
.day-card,
.timeline-item {
  padding: 16px;
  border-radius: 22px;
  background: rgba(15, 24, 43, 0.8);
  border: 1px solid var(--line);
}

.day-card-soft {
  background: rgba(24, 31, 47, 0.88);
}

.sparkline {
  width: 100%;
  height: auto;
  display: block;
}

.sparkline-kcal {
  margin-top: 8px;
  overflow: visible;
}

.history-row {
  padding: 18px;
  border-radius: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.history-row p,
.history-row strong,
.timeline-item p,
.timeline-item strong {
  margin: 0;
}

.timeline--compact {
  gap: 10px;
}

.timeline--compact .timeline-item {
  padding: 12px 14px;
  border-radius: 16px;
}

.timeline--compact .timeline-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.timeline--compact .timeline-item p {
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(243, 246, 251, 0.84);
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.note-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 123, 44, 0.22);
  background: rgba(255, 123, 44, 0.12);
  color: rgba(255, 239, 216, 0.9);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-notes-compact {
  padding-top: 18px;
}

.ai-coach-shell {
  display: grid;
  gap: 14px;
}

.ai-coach-button {
  width: min(420px, 58%);
  justify-content: center;
}

.ai-coach-loading {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.ai-coach-loading__bar {
  width: 36%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 123, 44, 0.3), rgba(255, 123, 44, 0.95), rgba(255, 214, 164, 0.9));
  animation: ai-coach-loading 1.2s ease-in-out infinite;
}

.ai-coach-response {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 123, 44, 0.18);
  background: rgba(15, 24, 43, 0.72);
  color: rgba(255, 245, 233, 0.95);
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-coach-status {
  margin: 0;
}

@keyframes ai-coach-loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

.ai-coach-placeholder {
  min-height: 120px;
  border-radius: 22px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(8, 17, 31, 0.34);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px;
}

.ai-coach-placeholder p,
.ai-coach-placeholder span {
  margin: 0;
}

.ai-coach-placeholder p {
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.1rem;
  color: rgba(255, 243, 224, 0.9);
}

.ai-coach-placeholder span {
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-mini-charts {
  padding-top: 18px;
}

.mini-alert {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 113, 113, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.34);
  color: #fecaca;
  font-weight: 800;
  font-size: 0.95rem;
}

.mini-alert--inline {
  width: 18px;
  height: 18px;
  margin-left: 6px;
  vertical-align: middle;
  font-size: 0.72rem;
}

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

.mini-chart-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(15, 24, 43, 0.72);
  border: 1px solid var(--line);
}

.mini-chart-card__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.mini-chart-card__header strong,
.mini-chart-card__header span {
  margin: 0;
}

.mini-chart-card__header strong {
  font-size: 0.9rem;
}

.mini-chart-card__header span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.mini-bars {
  width: 100%;
  height: auto;
  display: block;
}

.panel-heatmap {
  padding-top: 20px;
}

.heatmap-list {
  display: grid;
  gap: 16px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(8, 17, 31, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.heatmap-row__meta {
  display: grid;
  gap: 6px;
}

.heatmap-row__meta strong {
  font-size: 1.02rem;
}

.heatmap-row__meta span,
.heatmap-row__meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.heatmap-row__weeks {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.heatmap-week {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 5px;
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.heatmap-cell.level-1 {
  background: rgba(125, 211, 252, 0.32);
  border-color: rgba(125, 211, 252, 0.3);
}

.heatmap-cell.level-2 {
  background: rgba(251, 191, 36, 0.46);
  border-color: rgba(251, 191, 36, 0.32);
}

.heatmap-cell.level-3 {
  background: rgba(248, 113, 113, 0.62);
  border-color: rgba(248, 113, 113, 0.42);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.08);
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  justify-content: flex-end;
}

.history-transfer {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: center;
}

.history-import-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-left: 10px;
}

.history-import-form input[type="file"] {
  width: auto;
  max-width: min(100%, 280px);
  padding: 10px 12px;
  border-radius: 999px;
}

.flash {
  padding: 14px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.kcal-field strong {
  display: block;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 10px 0 8px;
}

.kcal-slider-track {
  --kcal-progress: 0%;
  position: relative;
  height: 24px;
}

.kcal-slider-bubble {
  position: absolute;
  left: var(--kcal-progress);
  transform: translateX(-50%);
  top: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 123, 44, 0.16);
  border: 1px solid rgba(255, 123, 44, 0.24);
  color: #ffd4bf;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.kcal-field input[type="range"] {
  width: 100%;
  margin: 4px 0 10px;
  height: 18px;
  background: linear-gradient(90deg, rgba(255, 123, 44, 0.72), rgba(255, 196, 92, 0.95));
}

.kcal-field input[type="range"]::-webkit-slider-thumb {
  width: 34px;
  height: 34px;
  box-shadow: 0 14px 30px rgba(255, 94, 31, 0.35);
}

.kcal-field small {
  color: var(--muted);
}

.mini-weight-field {
  margin-top: 20px;
}

.mini-weight-field label {
  display: grid;
  gap: 6px;
  max-width: 150px;
}

.mini-weight-field span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mini-weight-field input {
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 14px;
  font-size: 0.92rem;
}

.tag-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tag-selection {
  min-height: 18px;
  margin-bottom: 12px;
}

.tag-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip-grid--selected {
  min-height: 34px;
}

.tag-chip-grid--selected.is-empty {
  display: none;
}

.tag-chip-grid--selected + textarea {
  margin-top: 2px;
}

.tag-chip-grid--pool {
  padding-top: 4px;
}

.tag-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(8, 17, 31, 0.7);
  color: rgba(243, 246, 251, 0.78);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.tag-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.tag-chip span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tag-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 123, 44, 0.38);
}

.tag-chip.is-active {
  color: #fff7ef;
  border-color: rgba(255, 123, 44, 0.65);
  background: linear-gradient(135deg, rgba(255, 123, 44, 0.22), rgba(255, 94, 31, 0.18));
  box-shadow: 0 14px 30px rgba(255, 123, 44, 0.16);
}

.tag-chip--selected {
  border-color: rgba(255, 196, 92, 0.58);
  background: linear-gradient(135deg, rgba(255, 196, 92, 0.22), rgba(255, 123, 44, 0.18));
}

.tag-chip--add {
  border-style: dashed;
  color: rgba(255, 233, 205, 0.92);
  background: rgba(255, 123, 44, 0.1);
  padding-inline: 14px;
  font-weight: 800;
}

.panel-goals {
  display: grid;
  gap: 14px;
  margin-top: 2px;
}

.goal-review {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 123, 44, 0.16);
  background: rgba(12, 19, 35, 0.52);
  cursor: pointer;
}

.goal-review input[type="checkbox"] {
  width: 22px;
  min-width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 6px;
  accent-color: var(--accent);
  padding: 0;
}

.goal-review__copy {
  display: grid;
  gap: 4px;
}

.goal-review__copy strong {
  font-size: 1rem;
  line-height: 1.35;
}

.goal-next {
  display: grid;
  gap: 8px;
}

.goal-next input[type="text"] {
  min-height: 48px;
}

.auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.auth-shell--compact {
  min-height: 100vh;
  min-height: 100dvh;
  align-content: start;
  justify-items: center;
  gap: 14px;
  padding-top: 24px;
}

.auth-card {
  width: min(560px, 100%);
  padding: 28px;
}

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

.auth-card--mini {
  width: min(300px, calc(100vw - 36px));
  padding: 16px 16px 14px;
  border-radius: 20px;
}

.auth-card--mini h2 {
  font-size: 1.35rem;
  margin-bottom: 2px;
}

.auth-card--mini .flash {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 16px;
}

.auth-card--mini input {
  padding: 12px 14px;
  border-radius: 14px;
}

.auth-card--mini .auth-form {
  margin-top: 0;
  gap: 8px;
}

.auth-card--mini .auth-form label {
  gap: 6px;
}

.auth-card--mini .checkline {
  margin-top: 2px;
}

.auth-card--mini .primary-button {
  width: 100%;
  padding: 12px 16px;
}

.auth-brand-lockup {
  position: relative;
  z-index: 1;
  text-align: center;
}

.auth-brand-lockup--hero {
  margin-top: 6px;
}

.auth-brand-title {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-style: italic;
  letter-spacing: 0.08em;
  color: rgba(255, 244, 228, 0.96);
  text-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.auth-brand-title--hero {
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(4.8rem, 18vw, 12rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 0.88;
  color: rgba(255, 239, 216, 0.88);
  text-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(255, 182, 116, 0.18);
}

.auth-form,
.auth-form label {
  display: grid;
  gap: 10px;
}

.auth-form {
  margin-top: 18px;
}

.auth-form--guest {
  margin-top: 12px;
}

.auth-guest-button {
  width: 100%;
}

.entry-form__fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.guest-readonly-note {
  margin-top: 12px;
  color: rgba(255, 244, 228, 0.88);
  text-align: center;
}

.auth-form small {
  color: var(--muted);
  line-height: 1.5;
}

.quote-card {
  margin-top: 28px;
  padding: 24px 12px 8px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.quote-card__text,
.quote-card__author {
  margin: 0;
}

.quote-card__text {
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-style: italic;
  line-height: 1.2;
  color: rgba(255, 243, 224, 0.94);
  text-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.quote-card__author {
  margin-top: 10px;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: rgba(255, 243, 224, 0.7);
}

.checkline {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkline input {
  width: 18px;
  height: 18px;
}

.motigoji-shell .page-wrap,
.focus-shell .page-wrap,
body:has(.motigoji-page) .page-wrap,
body:has(.focus-page) .page-wrap {
  width: min(1180px, calc(100% - 24px));
}

.motigoji-page {
  display: grid;
  gap: 22px;
}

.motigoji-stage-head {
  text-align: center;
  display: grid;
  gap: 14px;
  padding-top: 4px;
  justify-items: center;
}

.motigoji-stage-head h2 {
  margin: 0;
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 242, 224, 0.96);
}

.motigoji-frame,
.motigoji-devbar,
.motigoji-insight-card,
.focus-page {
  background: rgba(12, 19, 35, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.motigoji-frame {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  min-height: 720px;
  padding: 34px 0 28px;
  display: grid;
  align-items: end;
  justify-items: center;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 217, 145, 0.18), transparent 28%),
    radial-gradient(circle at 20% 22%, rgba(118, 199, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(10, 16, 28, 0.95), rgba(6, 11, 20, 0.96));
}

.motigoji-orbit {
  position: absolute;
  inset: auto 50% 112px auto;
  width: min(82vw, 720px);
  height: min(82vw, 720px);
  transform: translateX(50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 227, 183, 0.08) 0%, rgba(255, 227, 183, 0.04) 32%, rgba(255, 227, 183, 0) 68%);
  filter: blur(2px);
  pointer-events: none;
}

.motigoji-tree-wrap {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 100%;
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.motigoji-sprite {
  position: relative;
  width: auto;
  max-width: min(88vw, 760px);
  min-height: 0;
  display: grid;
  place-items: end center;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.motigoji-sprite__image {
  width: auto;
  max-width: min(88vw, 760px);
  height: auto;
  display: block;
}

.motigoji-tree,
.focus-tree-wrap .motigoji-tree {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 34px 54px rgba(0, 0, 0, 0.42));
}

.motigoji-progress {
  width: min(640px, 92%);
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 223, 184, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.motigoji-progress__bar {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(130, 219, 171, 0.88), rgba(228, 221, 143, 0.94), rgba(255, 200, 130, 0.96));
  box-shadow: 0 0 22px rgba(255, 209, 145, 0.24);
}

.motigoji-progress-meta {
  width: min(640px, 92%);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(243, 246, 251, 0.72);
  font-size: 0.9rem;
}

.motigoji-focus-button {
  min-width: clamp(220px, 34vw, 360px);
}

.motigoji-focus-button--hero {
  min-width: min(520px, 82vw);
  padding: 16px 28px;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.focus-shell,
body:has(.focus-page) {
  background:
    radial-gradient(circle at top, rgba(255, 203, 117, 0.12), transparent 26%),
    radial-gradient(circle at bottom, rgba(92, 169, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #050910 0%, #07111d 50%, #04080f 100%);
}

.focus-page {
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  border-radius: 34px;
  padding: 24px 24px 36px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 224, 163, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(10, 16, 28, 0.95), rgba(5, 9, 17, 0.98));
}

.focus-backlink {
  justify-self: start;
  align-self: start;
  width: min(520px, 100%);
  text-align: center;
  color: #fff;
  letter-spacing: 0.03em;
  font-weight: 800;
  border-width: 1px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-inline: 24px;
  background: linear-gradient(145deg, rgba(255, 123, 44, 0.98), rgba(255, 94, 31, 0.98));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.focus-tree-stage {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.focus-tree-stage span {
  color: rgba(255, 242, 224, 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.focus-tree-stage strong {
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: rgba(255, 245, 233, 0.96);
}

.focus-tree-wrap {
  width: min(92vw, 640px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.focus-timer {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.focus-timer__value {
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(3.6rem, 12vw, 7rem);
  line-height: 0.94;
  letter-spacing: 0.08em;
  color: rgba(255, 245, 233, 0.98);
}

.focus-timer[data-running="1"] .focus-timer__value {
  text-shadow: 0 0 28px rgba(255, 220, 171, 0.24);
}

.focus-timer__hint {
  margin: 0;
  max-width: 540px;
  text-align: center;
  color: rgba(243, 246, 251, 0.72);
}

.focus-actions,
.focus-save {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.focus-page .focus-backlink {
  margin-bottom: 8px;
}

.focus-page .focus-info-panel {
  margin-top: 2px;
}

.focus-save__button {
  min-width: 260px;
}

.muted {
  color: var(--muted);
}

code {
  background: rgba(8, 17, 31, 0.9);
  padding: 2px 8px;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .grid-two,
  .slider-section,
  .stats-grid,
  .mini-chart-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .day-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .topbar,
  .hero-card,
  .history-row {
    align-items: flex-start;
  }

  .history-row {
    flex-direction: column;
  }

  .heatmap-row {
    grid-template-columns: 1fr;
  }

  .date-jump {
    flex-direction: column;
  }

  .motigoji-frame {
    min-height: 560px;
    padding-inline: 16px;
  }

  .motigoji-progress-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .focus-page {
    padding-inline: 14px;
  }

  .focus-actions,
  .focus-save {
    width: 100%;
    flex-direction: column;
  }

  .slider-section {
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 140px;
    width: calc(100% - 64px);
    max-width: calc(100% - 64px);
    justify-self: start;
    margin-left: 0;
    margin-right: auto;
  }

  .slider-card {
    padding: 12px 12px 10px;
    border-radius: 16px;
    gap: 6px;
  }

  .slider-header {
    gap: 8px;
    align-items: flex-start;
  }

  .slider-card strong {
    font-size: 0.95rem;
  }

  .slider-card small {
    font-size: 0.78rem;
  }

  .slider-section input[type="range"] {
    margin: 0;
  }

  .tag-chip-grid {
    gap: 10px;
  }

  .history-transfer {
    gap: 26px;
    align-items: flex-start;
  }

  .history-import-form {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
}
