:root {
  --bg: #fff8fb;
  --surface: rgba(255, 255, 255, 0.82);
  --ink: #17202a;
  --text: #3e4854;
  --muted: #788391;
  --line: rgba(23, 32, 42, 0.1);
  --pink: #ff4f8b;
  --coral: #ff8a5b;
  --danger: #c93636;
  --shadow: none;
  --max: 1160px;
  --tap-min: 44px;
}

/* Touch devices get the larger Android Material 48px target. */
@media (pointer: coarse) {
  :root {
    --tap-min: 48px;
  }
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #080b12;
  --surface: rgba(18, 23, 34, 0.84);
  --ink: #f7fbff;
  --text: #dce8f4;
  --muted: #a8b4c7;
  --line: rgba(142, 161, 190, 0.18);
  --pink: #f06f9f;
  --coral: #ff9b6b;
  --danger: #ff6a72;
  --shadow: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 79, 139, 0.14), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(97, 183, 255, 0.15), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #f8fbff 54%, #fffaf5 100%);
  font-family: "Nunito Sans", "Plus Jakarta Sans", "Avenir Next", "Segoe UI", "Helvetica Neue", ui-rounded, ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
}

:root[data-theme="night"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(123, 188, 255, 0.14), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(142, 240, 211, 0.1), transparent 28%),
    linear-gradient(180deg, #070a11 0%, #0d111b 54%, #090d14 100%);
}

:root[data-theme="night"] .site-header,
:root[data-theme="night"] .account-tabs,
:root[data-theme="night"] .panel,
:root[data-theme="night"] .tabs,
:root[data-theme="night"] .progress-item,
:root[data-theme="night"] .following-item,
:root[data-theme="night"] .avatar-upload,
:root[data-theme="night"] input,
:root[data-theme="night"] select,
:root[data-theme="night"] .confirm-modal-panel,
:root[data-theme="night"] .progress-menu-panel {
  border-color: var(--line);
  background: var(--surface);
}

:root[data-theme="night"] input::placeholder {
  color: rgba(220, 232, 244, 0.52);
}

:root[data-theme="night"] .progress-action-secondary,
:root[data-theme="night"] .progress-menu-button:hover,
:root[data-theme="night"] .progress-menu-button:focus-visible,
:root[data-theme="night"] .progress-menu.is-open .progress-menu-button {
  background: rgba(220, 232, 244, 0.1);
}

:root[data-theme="night"] .confirm-modal-backdrop {
  background: rgba(0, 0, 0, 0.58);
}

body.is-booting {
  cursor: progress;
}

body.is-booting .site-header,
body.is-booting .account-shell,
body.is-booting .mobile-tabbar {
  visibility: hidden;
  opacity: 0;
}

body.is-booting::after {
  content: "";
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 79, 139, 0.18);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: loading-spin 720ms linear infinite;
}

body.modal-open {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button.is-loading {
  position: relative;
  color: transparent !important;
  cursor: wait;
}

button.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  color: #ffffff;
  animation: loading-spin 760ms linear infinite;
}

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

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

.site-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(var(--max), calc(100% - 28px));
  min-height: 62px;
  margin: 14px auto 0;
  padding: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.header-account-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-avatar {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.header-avatar span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.94), rgba(255, 138, 91, 0.9)),
    var(--pink);
  background-position: center top;
  background-size: cover;
  box-shadow: none;
  font-size: 16px;
  font-weight: 650;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 620;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--coral));
  box-shadow: none;
}

.mark svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 34px);
  color: var(--text);
  font-size: 14px;
}

.nav a:hover {
  color: var(--pink);
}

.header-action,
.danger,
.primary,
.small-link,
.progress-action,
.stack button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  font-weight: 560;
  transition: transform 160ms ease;
}

.header-action,
.small-link,
.progress-action {
  min-height: var(--tap-min);
  padding: 0 18px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
}

.studio-shortcut-action {
  min-width: 76px;
  color: #fff;
  background: linear-gradient(135deg, #b51f55, #ad3e1b);
  box-shadow: none;
}

.creator-mode-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.creator-mode-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 560;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #b51f55, #ad3e1b);
}

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

.progress-action {
  min-width: 116px;
}

.progress-actions .progress-action {
  min-height: 38px;
  padding: 0 14px;
}

.progress-action-secondary {
  color: var(--ink);
  background: rgba(23, 32, 42, 0.07);
}

.header-action:hover,
.danger:hover,
.primary:hover,
.small-link:hover,
.progress-action:hover,
.stack button[type="submit"]:hover {
  transform: translateY(-1px);
}

.account-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.account-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

.site-header > *,
.account-grid > *,
.profile-layout > *,
.panel,
.panel-heading > *,
.account-identity > div,
.progress-copy {
  min-width: 0;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.account-section {
  width: min(760px, 100%);
  margin: 0 auto;
}

.account-section:not(.hidden) {
  animation: account-section-in 160ms ease-out;
}

@keyframes account-section-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-section {
  display: grid;
  gap: 16px;
}

.account-tabs {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.account-tabs button {
  min-height: var(--tap-min);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-weight: 560;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.account-tabs button.is-active {
  color: #fff;
  background: var(--ink);
  font-weight: 650;
}

.account-intro {
  padding: 10px 0 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  max-width: 460px;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.06;
  font-weight: 560;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 24px;
  line-height: 1.12;
  font-weight: 560;
  overflow-wrap: anywhere;
}

.account-intro > p:not(.eyebrow),
.muted {
  color: var(--text);
}

.account-intro > p:not(.eyebrow) {
  max-width: 440px;
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.58;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: none;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
}

.tabs button,
.text-button {
  min-height: var(--tap-min);
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 650;
}

.tabs button.is-active {
  color: #fff;
  background: var(--ink);
}

.stack {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.stack label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 500;
}

select {
  appearance: none;
  padding-right: 52px;
}

.select-field {
  position: relative;
}

.select-field::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 18px;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: var(--muted);
  pointer-events: none;
  transform: rotate(45deg);
}

input::placeholder {
  color: rgba(62, 72, 84, 0.58);
}

input:focus,
select:focus {
  outline: 3px solid rgba(255, 79, 139, 0.16);
  border-color: rgba(255, 79, 139, 0.42);
}

.check {
  grid-template-columns: 18px 1fr;
  align-items: start;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  display: grid;
  place-content: center;
  margin: 2px 0 0;
  padding: 0;
  appearance: none;
  border: 1px solid rgba(255, 79, 139, 0.38);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  cursor: pointer;
}

.check input::before {
  content: "";
  width: 10px;
  height: 7px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.82);
  transition: opacity 120ms ease, transform 120ms ease;
}

.check input:checked {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--coral));
  box-shadow: none;
}

.check input:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.check input:focus-visible {
  outline: 3px solid rgba(255, 79, 139, 0.16);
  outline-offset: 2px;
}

.preference-check {
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  font-size: 15px;
  line-height: 1.25;
}

.preference-check input {
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  border-radius: 7px;
}

.preference-check input::before {
  width: 13px;
  height: 8px;
}

.check a {
  color: var(--pink);
  font-weight: 560;
}

.primary,
.stack button[type="submit"] {
  min-height: 46px;
  color: #fff;
  background: linear-gradient(135deg, #b51f55, #ad3e1b);
  box-shadow: none;
}

.text-button {
  min-height: 40px;
  color: var(--text);
}

.account-summary {
  padding: 20px 20px 2px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.account-summary h1 {
  max-width: 100%;
  font-size: 24px;
}

.account-summary .muted {
  margin: 8px 0 0;
  font-size: 14px;
  word-break: break-word;
}

.account-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.9), rgba(255, 138, 91, 0.88)),
    var(--pink);
  background-position: center top;
  background-size: cover;
  box-shadow: none;
  font-size: 20px;
  font-weight: 650;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.avatar-upload,
.secondary-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 560;
}

.avatar-upload {
  position: relative;
  padding: 0 15px;
  border: 1px solid rgba(255, 79, 139, 0.24);
  color: var(--pink);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.avatar-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.avatar-upload:has(input:disabled) {
  cursor: default;
  opacity: 0.62;
}

.secondary-action {
  padding: 0 17px;
  border: 0;
  color: #fff;
  background: var(--ink);
}

.card-heading {
  padding: 16px 18px 0;
}

.inline-heading {
  padding: 0;
}

.danger-zone {
  background: rgba(201, 54, 54, 0.035);
}

.danger {
  color: #fff !important;
  background: var(--danger) !important;
  box-shadow: none !important;
}

.panel-heading {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.progress-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.following-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.progress-item {
  position: relative;
  min-height: 92px;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 46px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.following-item {
  min-height: 78px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.progress-item.is-loading,
.following-item.is-loading {
  pointer-events: none;
}

.loading-block,
.loading-line,
.loading-pill {
  position: relative;
  overflow: hidden;
  display: block;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.12), rgba(97, 183, 255, 0.12)),
    rgba(23, 32, 42, 0.06);
  background-size: 100% 100%, 100% 100%;
}

.loading-copy {
  display: grid;
  gap: 8px;
}

.loading-line {
  height: 12px;
  border-radius: 999px;
}

.loading-line.short {
  width: 38%;
}

.loading-line.mid {
  width: 58%;
}

.loading-line.long {
  width: 82%;
}

.loading-actions {
  min-width: 0;
}

.loading-pill {
  width: 96px;
  height: 34px;
  border-radius: 999px;
}

.loading-pill.muted {
  width: 86px;
  opacity: 0.7;
}

.following-item.is-loading .loading-block,
.following-item.is-loading .loading-line,
.following-item.is-loading .loading-pill,
.following-avatar.is-loading-avatar {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.18), rgba(97, 183, 255, 0.14)),
    rgba(23, 32, 42, 0.08);
}

.following-item.is-loading .loading-block::after,
.following-item.is-loading .loading-line::after,
.following-item.is-loading .loading-pill::after,
.following-avatar.is-loading-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-100%);
  animation: avatar-loading-sheen 1.25s ease-in-out infinite;
}

@keyframes avatar-loading-sheen {
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-booting::after,
  .account-section:not(.hidden) {
    animation: none;
  }

  .account-tabs button {
    transition: none;
  }

  .following-item.is-loading .loading-block::after,
  .following-item.is-loading .loading-line::after,
  .following-item.is-loading .loading-pill::after,
  .following-avatar.is-loading-avatar::after {
    animation: none;
    transform: none;
  }
}

.following-avatar {
  width: 54px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.9), rgba(255, 138, 91, 0.88)),
    var(--pink);
  background-position: center top;
  background-size: cover;
  font-size: 16px;
  font-weight: 650;
}

.following-copy {
  min-width: 0;
}

.following-copy a,
.following-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.following-copy a {
  font-weight: 600;
}

.following-copy small {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.progress-cover {
  width: 78px;
  aspect-ratio: 4 / 3;
  display: block;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.18), rgba(255, 138, 91, 0.16)),
    #fff;
  background-size: cover;
  background-position: center top;
}

.progress-cover-link,
.progress-creator-link {
  color: inherit;
  text-decoration: none;
}

.progress-cover-link {
  transition: transform 160ms ease;
}

.progress-cover-link:hover,
.progress-cover-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: none;
}

.progress-copy {
  min-width: 0;
}

.progress-copy strong,
.progress-copy span,
.progress-creator-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-copy strong {
  font-weight: 650;
}

.progress-creator-link {
  width: max-content;
  max-width: 100%;
  color: var(--pink);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-creator-link:hover,
.progress-creator-link:focus-visible {
  color: var(--ink);
  outline: none;
}

.progress-creator-name,
.progress-meta {
  color: var(--text);
  font-size: 13px;
}

.progress-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.progress-menu-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0 0 5px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-size: 22px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

.progress-menu-button:hover,
.progress-menu-button:focus-visible,
.progress-menu.is-open .progress-menu-button {
  color: var(--ink);
  background: rgba(23, 32, 42, 0.06);
  outline: none;
}

.progress-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 156px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.progress-menu.is-open .progress-menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.progress-menu-panel button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--danger);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
}

.progress-menu-panel button:hover,
.progress-menu-panel button:focus-visible {
  background: rgba(201, 54, 54, 0.08);
  outline: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.34);
  backdrop-filter: blur(8px);
}

.confirm-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.confirm-modal-panel h2 {
  margin: 0;
  font-size: 22px;
}

.confirm-modal-panel .muted,
.modal-warning {
  margin: 0;
}

.modal-warning {
  color: var(--danger);
  font-size: 14px;
  font-weight: 560;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirm-modal-actions button {
  min-height: 44px;
}

.confirm-modal-actions .progress-action {
  width: 100%;
  min-width: 0;
  grid-column: auto;
}

.confirm-modal-actions .danger {
  width: 100%;
  min-width: 0;
  grid-column: auto;
}

.empty-progress {
  margin: 0;
  padding: 10px 2px;
  color: var(--text);
}

.status {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--pink);
  font-weight: 650;
}

.status.error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
    top: max(8px, env(safe-area-inset-top));
    width: calc(100% - 20px);
    margin-top: max(8px, env(safe-area-inset-top));
    padding: 7px;
    gap: 8px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
  }

  .nav {
    display: none;
  }

  .brand {
    min-width: 0;
    gap: 9px;
    font-size: 16px;
  }

  .mark {
    width: 40px;
    height: 40px;
  }

  .brand > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-account-actions {
    min-width: 0;
    gap: 6px;
  }

  .studio-shortcut-action {
    max-width: 88px;
    min-width: 0;
    min-height: 40px;
    padding: 0 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-avatar,
  .header-avatar span {
    width: 40px;
    height: 40px;
  }

  .sign-out-action {
    width: 42px;
    min-height: 40px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .sign-out-action::before {
    content: "";
    width: 17px;
    height: 17px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h7v2H7v12h5v2H5V4Zm10.6 4.4L20.2 13l-4.6 4.6-1.4-1.4 2.2-2.2H10v-2h6.4l-2.2-2.2 1.4-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h7v2H7v12h5v2H5V4Zm10.6 4.4L20.2 13l-4.6 4.6-1.4-1.4 2.2-2.2H10v-2h6.4l-2.2-2.2 1.4-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  .account-shell {
    width: min(100% - 24px, 560px);
    padding-top: 24px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  h2 {
    font-size: 22px;
  }

  .account-intro > p:not(.eyebrow) {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.5;
  }

  .panel {
    border-radius: 20px;
  }

  .stack {
    gap: 12px;
    padding: 16px;
  }

  input,
  select {
    min-height: 48px;
    font-size: 16px;
  }

  .account-tabs {
    position: sticky;
    top: calc(max(8px, env(safe-area-inset-top)) + 66px);
    z-index: 10;
    width: 100%;
    backdrop-filter: blur(16px);
  }

  .account-summary {
    grid-template-columns: 1fr;
    padding: 18px 16px 2px;
  }

  .account-identity {
    align-items: flex-start;
  }

  .account-avatar {
    width: 58px;
    height: 58px;
  }

  .account-actions,
  .avatar-upload,
  .secondary-action,
  .primary,
  .stack button[type="submit"] {
    width: 100%;
  }

  .progress-item {
    min-height: 0;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 44px 12px 10px;
  }

  .following-item {
    grid-template-columns: 48px 1fr;
    gap: 11px;
  }

  .following-avatar {
    width: 48px;
  }

  .following-item .progress-action {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .progress-cover {
    grid-row: 1 / span 2;
    width: 86px;
    height: 100%;
    min-height: 118px;
    aspect-ratio: auto;
    border-radius: 16px;
  }

  .progress-action {
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 1.12;
    text-align: center;
  }

  .progress-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
    align-self: end;
  }

  .progress-action {
    width: 100%;
    min-width: 0;
    grid-column: auto;
  }

  .panel-heading {
    padding: 16px;
  }

  .progress-list {
    padding: 12px;
  }
}

@media (max-width: 380px) {
  .brand > span:last-child {
    display: none;
  }

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

  .progress-item {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 42px 8px 8px;
  }

  .progress-cover {
    width: 74px;
    min-height: 112px;
  }

  .progress-actions {
    gap: 6px;
  }

  .confirm-modal-actions {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="night"] .site-header,
:root[data-theme="night"] .account-tabs,
:root[data-theme="night"] .panel,
:root[data-theme="night"] .tabs,
:root[data-theme="night"] .progress-item,
:root[data-theme="night"] .following-item,
:root[data-theme="night"] .avatar-upload,
:root[data-theme="night"] input,
:root[data-theme="night"] select,
:root[data-theme="night"] .confirm-modal-panel,
:root[data-theme="night"] .progress-menu-panel {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

:root[data-theme="night"] .progress-cover {
  background:
    linear-gradient(135deg, rgba(240, 111, 159, 0.18), rgba(123, 188, 255, 0.14)),
    #121722;
  background-position: center top;
  background-size: cover;
}

:root[data-theme="night"] .header-action,
:root[data-theme="night"] .small-link,
:root[data-theme="night"] .progress-action,
:root[data-theme="night"] .secondary-action,
:root[data-theme="night"] .account-tabs button.is-active,
:root[data-theme="night"] .tabs button.is-active {
  color: #f7fbff;
  background: #273044;
  box-shadow: none;
}

:root[data-theme="night"] .creator-mode-action {
  color: #fff;
  background: linear-gradient(135deg, #b51f55, #ad3e1b);
  box-shadow: none;
}

:root[data-theme="night"] .studio-shortcut-action {
  color: #fff;
  background: linear-gradient(135deg, #b51f55, #ad3e1b);
  box-shadow: none;
}

:root[data-theme="night"] .progress-action-secondary {
  color: var(--ink);
  background: rgba(220, 232, 244, 0.12);
  box-shadow: none;
}

:root[data-theme="night"] .check input {
  background: rgba(18, 23, 34, 0.92);
}

:root[data-theme="night"] .check input:checked {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--coral));
}

:root[data-theme="night"] .confirm-modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="night"] .confirm-modal-panel,
:root[data-theme="night"] .progress-menu-panel {
  border-color: rgba(142, 161, 190, 0.18);
  background: #121722;
  color: var(--ink);
  box-shadow: none;
}

:root[data-theme="night"] .progress-menu-button:hover,
:root[data-theme="night"] .progress-menu-button:focus-visible,
:root[data-theme="night"] .progress-menu.is-open .progress-menu-button,
:root[data-theme="night"] .progress-menu-panel button:hover,
:root[data-theme="night"] .progress-menu-panel button:focus-visible {
  background: rgba(220, 232, 244, 0.1);
}

/* Logout feedback must remain visible even on the long profile page. */
.status.logout-error {
  position: fixed;
  z-index: 90;
  right: 16px;
  bottom: 24px;
  left: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: none;
}

@media (max-width: 760px) {
  body.has-mobile-tabbar .status.logout-error {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* A quiet achievement treatment for fully revealed drops. */
.progress-item.is-complete {
  border-color: #d8bd83;
  background: linear-gradient(115deg, #fff8e9, #fffdf8 65%);
  border-inline-start: 3px solid #bf9145;
}

.progress-copy .progress-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid #dfc796;
  border-radius: 7px;
  background: #faedcf;
  color: #705018;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  white-space: normal;
}

.progress-copy .progress-complete-check {
  flex: 0 0 auto;
  overflow: visible;
}

:root[data-theme="night"] .progress-item.is-complete {
  border-color: #79623b;
  background: linear-gradient(115deg, #302a20, var(--surface) 75%);
  border-inline-start: 3px solid #c19b59;
}

:root[data-theme="night"] .progress-complete-badge {
  border-color: #79623b;
  background: #3d3220;
  color: #f3d393;
}

/* Keep authentication focused on one task at a time. */
#authView {
  width: min(100%, 440px);
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.auth-panel {
  box-shadow: none;
}
.auth-panel .account-intro {
  padding: 24px 22px 18px;
}
.auth-panel h1 {
  max-width: none;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 650;
}
.auth-panel .account-intro p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}
.auth-panel .tabs {
  margin: 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
}
.auth-panel [hidden] { display: none; }
.auth-panel .stack { padding: 20px 22px 22px; }
.auth-panel .tabs button { border-radius: 10px; }
.auth-panel .stack button[type="submit"] { box-shadow: none; }
.auth-panel .field-help {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
}
.auth-panel .auth-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
}
.auth-panel .auth-secondary-actions button { min-height: 44px; }
.auth-panel .muted {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.auth-panel .status {
  margin: 0;
  min-height: 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}
.auth-panel .status:not(.error) { color: var(--text); }
.auth-panel .status:empty { display: none; }
.auth-panel .status.error {
  border-inline-start: 3px solid currentColor;
  padding-inline-start: 10px;
}
.auth-back-link {
  justify-self: center;
  padding: 10px;
  color: var(--text);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.is-auth-screen .mobile-tabbar { display: none; }
body.is-auth-screen.has-mobile-tabbar { padding-bottom: 0; }
@media (max-width: 480px) {
  body.is-auth-screen .account-shell { padding-top: 22px; }
  .auth-panel .account-intro { padding: 20px 18px 16px; }
  .auth-panel .stack { padding: 18px; }
}
