:root {
  color-scheme: light;
  --bg: #f6f5f4;
  --surface: #ffffff;
  --soft: #f2ecef;
  --soft-warm: #f8eee8;
  --text: #1f1d21;
  --muted: #6f6970;
  --line: #dfdcda;
  --brand: #b84f63;
  --brand-dark: #6f3040;
  --accent: #c97c4e;
  --violet: #4e7d8c;
  --danger: #b94d5a;
  --shadow: 0 12px 36px rgba(31, 29, 33, 0.08);
  --radius: 10px;
  --control-radius: 10px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
}

.auth-hero {
  min-height: auto;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 0;
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: var(--control-radius);
  background: var(--brand);
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 14px;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(56px, 9vw, 118px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.35;
}

.hero-strip,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-pill {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-pill strong {
  font-size: 24px;
}

.hero-pill span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.auth-card,
.card,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 22px;
  padding: 28px;
  backdrop-filter: blur(18px);
}

.auth-card h2,
.card h2,
.modal-card h2,
.section-title h2 {
  margin: 0;
}

.auth-card p,
.card p,
.section-title p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.tabs,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: var(--control-radius);
  background: #edf1f7;
}

.tab,
.filter {
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  border: 0;
  border-radius: var(--control-radius);
  background: transparent;
  font-weight: 900;
}

.tab.active,
.filter.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 36, 48, 0.08);
}

.form,
.stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  outline: 0;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(185, 77, 90, 0.12);
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(183, 93, 112, 0.14);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(22px);
}

.brand-button {
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  border: 0;
  background: transparent;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  text-align: left;
  border: 0;
  border-radius: var(--control-radius);
  background: transparent;
  font-weight: 900;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--control-radius);
  color: var(--muted);
  background: #edf1f7;
  font-size: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 29, 33, 0.08);
}

.nav-button.active .nav-icon {
  color: #fff;
  background: var(--brand);
}

.side-card {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--control-radius);
  background: var(--soft);
}

.side-card strong {
  font-size: 28px;
}

.side-card span {
  color: var(--muted);
  line-height: 1.42;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px 8px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-mini,
.author,
.artist-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-mini {
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--violet);
  font-weight: 900;
}

.user-mini span,
.author span,
.artist-line span,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.content {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 8px 28px 40px;
}

.screen {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: stretch;
}

.today-side {
  display: grid;
  gap: 14px;
}

.practice-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.primary-stat {
  min-height: 84px;
  background: var(--soft);
}

.quiet-stat {
  min-height: 84px;
  align-content: center;
}

.quiet-stat strong {
  font-size: 24px;
  line-height: 1;
}

.quiet-stat span {
  color: var(--muted);
}

.practice-stats .card {
  padding: 12px;
}

.practice-stats .stat-card strong,
.practice-stats .quiet-stat strong {
  font-size: 25px;
}

.practice-stats .stat-card span,
.practice-stats .quiet-stat span {
  font-size: 12px;
  line-height: 1.25;
}

.gallery-card {
  align-content: start;
  min-height: 300px;
}

.gallery-head {
  align-items: center;
}

.gallery-head h2 {
  font-size: 24px;
}

.gallery-strip {
  display: grid;
  gap: 10px;
}

.gallery-tile {
  min-height: 70px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0;
  color: inherit;
  text-align: left;
  border: 0;
  background: transparent;
}

.gallery-tile img,
.gallery-seed {
  width: 74px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  object-fit: cover;
  color: #fff;
  border-radius: 8px;
  background: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.gallery-seed.orange {
  background: var(--accent);
}

.gallery-seed.indigo {
  background: var(--violet);
}

.gallery-tile strong,
.gallery-tile span span {
  display: block;
}

.gallery-tile strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-tile span span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.gallery-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.daily-card {
  min-height: 360px;
  position: relative;
  overflow: hidden;
  align-content: space-between;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(37, 34, 42, 0.96), rgba(116, 54, 71, 0.9)),
    linear-gradient(45deg, #743647, #b75d70);
}

.daily-card::after {
  display: none;
}

.daily-card > * {
  position: relative;
  z-index: 1;
}

.daily-card .eyebrow,
.daily-card p {
  color: rgba(255, 255, 255, 0.78);
}

.daily-card h2 {
  max-width: 720px;
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.daily-card p {
  max-width: 660px;
  font-size: 16px;
}

.today-daily {
  min-height: 398px;
}

.daily-copy {
  display: grid;
  gap: 4px;
}

.prompt-details {
  display: grid;
  gap: 10px;
}

.reference-row .chip {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.1);
}

.daily-actions {
  margin-top: 4px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.between {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text);
  background: #edf1f7;
  font-size: 13px;
  font-weight: 900;
}

.daily-card .chip {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.small-button,
.reaction-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--control-radius);
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

.secondary-button {
  color: #fff;
  background: var(--accent);
}

.ghost-button,
.small-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: #fff;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--control-radius);
}

.stat-card {
  min-height: 112px;
  align-content: center;
}

.stat-card strong {
  font-size: 32px;
  line-height: 1;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.section-title.compact {
  align-items: center;
}

.section-title.compact h2 {
  font-size: 24px;
}

.feed-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(37, 34, 42, 0.06);
}

.feed-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.post-image {
  width: 100%;
  height: clamp(210px, 18vw, 240px);
  object-fit: cover;
  background: #eef2f7;
}

.seed-image {
  display: grid;
  place-items: center;
  padding: 20px;
  color: #fff;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    var(--brand);
}

.seed-image.orange {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
    var(--accent);
}

.seed-image.indigo {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
    var(--violet);
}

.post-body {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.post-caption {
  margin: 0;
  line-height: 1.42;
}

.reaction-button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  background: #f3f5fa;
  border-radius: var(--control-radius);
  font-size: 13px;
}

.reaction-button.active {
  color: #fff;
  background: var(--violet);
}

.comments {
  display: grid;
  gap: 6px;
}

.comment {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f7fb;
}

.comment p {
  margin: 2px 0 0;
  line-height: 1.35;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comment-form input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  outline: 0;
}

.artist-card {
  display: grid;
  gap: 16px;
  min-height: 220px;
}

.artist-card p {
  min-height: 48px;
}

.challenge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 14px;
}

.challenge-focus {
  align-content: space-between;
  min-height: 218px;
  border-color: rgba(183, 93, 112, 0.32);
  background:
    linear-gradient(135deg, rgba(183, 93, 112, 0.12), rgba(255, 255, 255, 0.92) 44%),
    #fff;
}

.challenge-focus h2 {
  font-size: clamp(28px, 4.6vw, 42px);
  line-height: 1.05;
}

.challenge-focus p {
  max-width: 760px;
  font-size: 16px;
}

.challenge-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.challenge-progress {
  align-content: center;
  min-height: 218px;
  background: var(--soft-warm);
}

.challenge-progress strong {
  font-size: 44px;
  line-height: 1;
}

.challenge-board {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: start;
}

.challenge-days-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.challenge-list {
  display: grid;
  gap: 8px;
}

.challenge-item {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}

.challenge-item strong,
.challenge-item .meta {
  display: block;
}

.challenge-item strong {
  line-height: 1.25;
}

.challenge-item.active {
  border-color: rgba(183, 93, 112, 0.48);
  box-shadow: 0 0 0 4px rgba(183, 93, 112, 0.1);
}

.challenge-item.today .day-number {
  background: var(--brand);
}

.challenge-item.done {
  background: #f2faf7;
}

.day-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--violet);
  font-weight: 900;
}

.day-status {
  min-width: 70px;
  justify-self: end;
  padding: 6px 9px;
  color: var(--muted);
  text-align: center;
  border-radius: 999px;
  background: #f3f0f3;
  font-size: 12px;
  font-weight: 900;
}

.challenge-item.done .day-status {
  color: #2f6d58;
  background: #dff3ea;
}

.challenge-posts {
  min-width: 0;
}

.lesson-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.lesson-list {
  display: grid;
  gap: 10px;
}

.lesson-button {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: #fff;
}

.lesson-button.active {
  border-color: rgba(183, 93, 112, 0.45);
  box-shadow: 0 0 0 4px rgba(183, 93, 112, 0.11);
}

.steps {
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #f5f7fb;
}

.step-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 15px;
  background: var(--violet);
  font-weight: 900;
}

.profile-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.profile-hero > p {
  grid-column: 1 / -1;
  max-width: 760px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.profile-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(18, 24, 38, 0.42);
}

.modal-card {
  width: min(700px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.modal-card h2 {
  font-size: 24px;
}

.modal-card .field textarea {
  min-height: 88px;
}

.upload-zone {
  min-height: 190px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  border: 2px dashed #cfd6e4;
  border-radius: var(--control-radius);
  background: #f5f7fb;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
}

.empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #cfd6e4;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  color: #fff;
  border-radius: 18px;
  background: #1f2430;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .auth-page {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .auth-hero {
    min-height: auto;
  }

  .app-shell {
    display: block;
  }

  .side-nav {
    display: none;
  }

  .topbar {
    padding: 22px 20px 10px;
  }

  .content {
    padding: 12px 20px 112px;
  }

  .bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(227, 231, 239, 0.9);
    border-radius: var(--control-radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .bottom-nav .nav-button {
    min-height: 58px;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 6px;
    font-size: 11px;
    text-align: center;
  }

  .bottom-nav .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--control-radius);
    font-size: 12px;
  }

  .grid.two,
  .today-layout,
  .challenge-layout,
  .challenge-board,
  .lesson-layout,
  .feed {
    grid-template-columns: 1fr;
  }

  .challenge-days-panel {
    position: static;
    max-height: none;
  }

}

@media (max-width: 720px) {
  .auth-page {
    padding: 12px;
  }

  .auth-hero {
    min-height: auto;
    padding: 0;
  }

  .hero-strip,
  .stats-grid,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .user-mini {
    display: none;
  }

  .daily-card {
    min-height: 420px;
  }

  .section-title,
  .feed-toolbar,
  .between {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-toolbar .primary-button,
  .profile-actions,
  .profile-actions button {
    width: 100%;
  }

  .profile-hero,
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .challenge-focus,
  .challenge-progress {
    min-height: auto;
    gap: 12px;
    padding: 18px;
  }

  .challenge-focus h2 {
    font-size: 28px;
  }

  .challenge-focus p {
    font-size: 16px;
  }

  .challenge-progress strong {
    font-size: 40px;
  }

  .challenge-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .day-status {
    grid-column: 2;
    justify-self: start;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .bottom-nav {
    left: 14px;
    right: 14px;
    grid-template-columns: repeat(6, 1fr);
  }

  .bottom-nav .nav-button {
    min-height: 48px;
  }

  .bottom-nav .nav-button > span:last-child {
    display: none;
  }

  .bottom-nav .nav-icon {
    width: 34px;
    height: 34px;
  }
}
