:root {
  --profile-line: rgba(255, 255, 255, 0.12);
  --profile-line-strong: rgba(255, 255, 255, 0.18);
  --profile-surface:
    linear-gradient(180deg, rgba(205, 211, 217, 0.1), rgba(17, 20, 24, 0.92)),
    rgba(10, 11, 14, 0.8);
  --profile-muted: rgba(247, 245, 240, 0.68);
  --profile-ink: rgba(247, 245, 240, 0.96);
  --profile-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.public-shell {
  width: min(100%, 1440px);
}

.public-surface {
  padding: 0;
}

.profile-shell {
  display: grid;
  grid-template-columns: minmax(124px, 33vw) minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100dvh - var(--public-header-height) - 52px);
}

.profile-shell--auth .profile-nav__button {
  display: block;
  text-decoration: none;
}

.profile-panel {
  border: 1px solid var(--profile-line);
  border-radius: 28px;
  background: var(--profile-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    var(--profile-shadow);
  backdrop-filter: blur(16px);
}

.profile-sections__inner {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  height: 100%;
  padding: 1rem 0.9rem;
}

.profile-panel__eyebrow,
.profile-card__eyebrow,
.profile-book__collection {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.62;
}

.profile-sections__title,
.profile-section__header h2,
.profile-detail-section h2 {
  margin: 0;
  line-height: 1;
}

.profile-sections__title {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.profile-sections__intro,
.profile-section__lede,
.profile-card__text,
.profile-empty,
.profile-tip p,
.profile-note__meta,
.profile-book__summary,
.profile-book__author,
.profile-form__help {
  margin: 0;
  color: var(--profile-muted);
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.profile-nav__button {
  display: block;
  width: 100%;
  padding: 0.9rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  color: var(--profile-muted);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.profile-nav__button:hover,
.profile-nav__button:focus-visible,
.profile-nav__button.is-active {
  border-color: var(--profile-line-strong);
  background: rgba(255, 255, 255, 0.08);
  color: var(--profile-ink);
  transform: translateY(-1px);
}

.profile-nav__label,
.profile-nav__meta {
  display: block;
}

.profile-nav__label {
  font-size: 1rem;
  line-height: 1.2;
  text-transform: lowercase;
}

.profile-nav__meta {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  opacity: 0.74;
}

.profile-main,
.profile-detail,
.profile-panel--main,
.profile-panel--detail {
  min-width: 0;
}

.profile-panel--main,
.profile-panel--detail {
  height: 100%;
  padding: 1rem;
  overflow: auto;
  scrollbar-width: none;
}

.profile-panel--main::-webkit-scrollbar,
.profile-panel--detail::-webkit-scrollbar {
  display: none;
}

.profile-section,
.profile-detail-section {
  display: none;
}

.profile-section.is-active,
.profile-detail-section.is-active {
  display: block;
}

.profile-section__header,
.profile-detail-section {
  margin-bottom: 1rem;
}

.profile-section__header h2,
.profile-detail-section h2 {
  font-size: clamp(1.55rem, 3vw, 2.4rem);
}

.profile-section__lede,
.profile-detail-section > p:not(.profile-panel__eyebrow) {
  margin-top: 0.55rem;
  max-width: 46rem;
}

.profile-help-inline {
  display: block;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--profile-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-help-inline h3,
.profile-card h3,
.profile-tip h3,
.profile-book h4 {
  margin: 0;
  line-height: 1.1;
}

.profile-help-inline p {
  margin: 0.45rem 0 0;
  color: var(--profile-muted);
}

.profile-stack,
.profile-tip-list,
.profile-book-list,
.profile-note-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.profile-card,
.profile-tip,
.profile-book,
.profile-note {
  border: 1px solid var(--profile-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
}

.profile-card,
.profile-tip {
  padding: 1rem;
}

.profile-panel--main .profile-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.profile-panel--main .profile-card + .profile-card {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-card__header,
.profile-book {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.profile-card__header {
  margin-bottom: 0.7rem;
}

.profile-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.profile-legal-content {
  color: var(--profile-ink);
  line-height: 1.68;
}

.profile-legal-content > *:first-child {
  margin-top: 0;
}

.profile-legal-content > *:last-child {
  margin-bottom: 0;
}

.profile-legal-content h2,
.profile-legal-content h3 {
  line-height: 1.12;
  margin: 1.5rem 0 0.7rem;
}

.profile-legal-content p,
.profile-legal-content li {
  color: var(--profile-muted);
}

.profile-book {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  padding: 0.95rem 1rem;
}

.profile-book__cover {
  width: 52px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(216, 221, 226, 0.16), rgba(102, 108, 116, 0.12)),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.profile-book__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-book__meta {
  min-width: 0;
}

.profile-book h4,
.profile-card h3,
.profile-tip h3 {
  font-size: 1.05rem;
}

.profile-book h4 a,
.profile-card h3 a {
  color: inherit;
  text-decoration: none;
}

.profile-book h4 a:hover,
.profile-card h3 a:hover {
  text-decoration: underline;
}

.profile-book__author,
.profile-book__summary {
  margin-top: 0.3rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--profile-line-strong);
  color: var(--profile-ink);
  font-size: 0.82rem;
  line-height: 1;
}

.profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.72rem 1rem;
  border: 1px solid var(--profile-line-strong);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(216, 221, 226, 0.18), rgba(102, 108, 116, 0.14)),
    rgba(12, 14, 17, 0.42);
  color: var(--profile-ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 24px rgba(0, 0, 0, 0.14);
}

.profile-action--secondary {
  background: rgba(255, 255, 255, 0.06);
}

.profile-action--danger {
  background:
    linear-gradient(180deg, rgba(214, 115, 126, 0.26), rgba(109, 36, 46, 0.2)),
    rgba(12, 14, 17, 0.42);
}

.profile-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.profile-auth-form {
  margin-top: 0;
}

.profile-auth-form__field {
  display: grid;
  gap: 0.45rem;
}

.profile-auth-form__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.profile-form input[type="email"] {
  margin-bottom: 0;
}

.profile-auth-form input {
  margin-bottom: 0;
}

.profile-form__help {
  font-size: 0.9rem;
  line-height: 1.45;
}

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

.profile-auth-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.profile-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.profile-theme-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 46px;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--profile-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--profile-ink);
  font: inherit;
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.profile-theme-option:hover,
.profile-theme-option:focus-visible,
.profile-theme-option.is-active {
  border-color: var(--profile-line-strong);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.profile-theme-option.is-active {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.profile-theme-option__swatch {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.profile-theme-option__swatch--wood {
  background: linear-gradient(135deg, #8c5f38, #2b1b12 62%, #6f8b55);
}

.profile-theme-option__swatch--light {
  background: linear-gradient(135deg, #fff9ec, #c7b28f);
}

.profile-theme-option__swatch--amber {
  background: linear-gradient(135deg, #ffe7a6, #b8792b);
}

.profile-theme-option__swatch--dark {
  background: linear-gradient(135deg, #9aa2ad, #101215);
}

.profile-note {
  padding: 0.9rem 1rem;
}

.profile-note__quote {
  margin: 0;
  color: var(--profile-ink);
  font-size: 1rem;
  line-height: 1.5;
}

.profile-note__meta {
  margin-top: 0.45rem;
  font-size: 0.84rem;
}

.profile-tip-list {
  margin-top: 1rem;
}

.profile-tip h3 {
  margin-bottom: 0.4rem;
}

@media (max-width: 979px) {
  .profile-shell {
    align-items: start;
  }

  .profile-detail {
    display: none;
  }

  .profile-main {
    min-width: 0;
  }
}

@media (min-width: 980px) {
  .public-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .profile-shell {
    grid-template-columns: minmax(220px, 0.82fr) minmax(380px, 1.08fr) minmax(320px, 0.92fr);
    gap: 18px;
  }

  .profile-sections,
  .profile-detail {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .profile-panel--detail {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .profile-panel--detail .profile-tip {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
  }

  .profile-help-inline {
    display: none;
  }
}

@media (max-width: 700px) {
  .profile-shell {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: auto;
  }

  .profile-sections__inner,
  .profile-panel--main {
    padding: 0.9rem;
  }

  .profile-sections {
    order: 0;
  }

  .profile-main {
    order: 1;
  }

  .profile-sections__inner {
    gap: 0.7rem;
  }

  .profile-sections__title {
    font-size: 1.2rem;
  }

  .profile-sections__intro {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .profile-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .profile-nav__button {
    min-height: 76px;
    padding: 0.85rem 0.8rem;
    border-radius: 18px;
  }

  .profile-nav__label {
    font-size: 0.92rem;
  }

  .profile-nav__meta {
    font-size: 0.73rem;
    line-height: 1.25;
  }

  .profile-card,
  .profile-tip,
  .profile-help-inline,
  .profile-note,
  .profile-book {
    border-radius: 20px;
  }

  .profile-card__header {
    flex-direction: column;
  }

  .profile-section__header {
    margin-bottom: 0.7rem;
  }

  .profile-section__header h2 {
    font-size: 1.45rem;
  }

  .profile-section__lede {
    max-width: none;
    font-size: 0.95rem;
  }

  .profile-help-inline {
    display: none;
  }

  .profile-card__text {
    font-size: 0.93rem;
    line-height: 1.45;
  }

  .profile-book {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .profile-book__cover {
    width: 44px;
    height: 62px;
  }

  .profile-book .profile-action {
    grid-column: 1 / -1;
  }

  .profile-auth-form__actions {
    flex-direction: column;
  }

  .profile-action {
    width: 100%;
  }

  .profile-theme-grid {
    grid-template-columns: 1fr;
  }
}
