:root {
  color-scheme: light;
  --ink: #25201d;
  --muted: #766d67;
  --paper: #f8f5ef;
  --card: rgba(255, 255, 255, 0.92);
  --line: #e6ddd3;
  --accent: #9d6754;
  --accent-dark: #754738;
  --accent-soft: #f1dfd5;
  --sage: #dce6dc;
  --shadow: 0 18px 50px rgba(69, 52, 43, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(241, 223, 213, 0.8), transparent 26rem),
    radial-gradient(circle at 92% 28%, rgba(220, 230, 220, 0.75), transparent 28rem),
    var(--paper);
  transition: color .25s ease, background-color .25s ease;
}

body.safe-mode-active {
  --muted: #68677c;
  --paper: #f1f1f8;
  --line: #d8d6e8;
  --accent: #69639d;
  --accent-dark: #46416f;
  --accent-soft: #e5e3f3;
  --sage: #dfe6ef;
  background:
    radial-gradient(circle at 12% 5%, rgba(220, 217, 239, .9), transparent 28rem),
    radial-gradient(circle at 92% 28%, rgba(215, 229, 237, .85), transparent 30rem),
    var(--paper);
}

body.safe-mode-active .app-header {
  border-bottom-color: rgba(195, 191, 220, .9);
  background: rgba(241, 241, 248, .9);
}

body.safe-mode-active .quick-checkin {
  border-color: rgba(105, 99, 157, .32);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(225,222,242,.82));
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 78px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(230, 221, 211, 0.9);
  background: rgba(248, 245, 239, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--ink);
  font: 700 14px/1 Georgia, serif;
  letter-spacing: .08em;
}

.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font: 600 16px/1.1 Georgia, serif; }
.brand small { color: var(--muted); font-size: 11px; }

.view-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.view-tab, .auth-button, .write-button, .filter-chip, .secondary-button, .primary-link, .card-button {
  border: 0;
  cursor: pointer;
}

.view-tab {
  padding: 9px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}
.view-tab.is-active { color: var(--ink); background: white; box-shadow: 0 3px 12px rgba(69, 52, 43, .08); }

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

.search-control {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(240px, 22vw);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .75);
}
.search-control span { color: var(--muted); font-size: 20px; line-height: 1; }
.search-control input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157, 103, 84, .12); }

.auth-button {
  max-width: 190px;
  overflow: hidden;
  padding: 10px 14px;
  border-radius: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: white;
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.write-button {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}

.app-shell { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 158px); margin: 0 auto; padding: 48px 0 72px; }
.content-view[hidden] { display: none; }

.quick-checkin {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.2fr);
  gap: 24px 36px;
  margin-bottom: 42px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(157, 103, 84, .2);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(241,223,213,.72));
  box-shadow: var(--shadow);
}
.quick-checkin-copy h1 { margin: 8px 0 10px; font: 600 clamp(28px, 4vw, 43px)/1.08 Georgia, serif; letter-spacing: -.025em; }
.quick-checkin-copy p { margin: 0; color: var(--muted); line-height: 1.55; }
.quick-checkin-actions { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.quick-moods { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(6, minmax(58px, 1fr)); gap: 7px; }
.quick-moods button { display: grid; min-height: 66px; place-items: center; gap: 2px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: rgba(255,255,255,.78); font-size: 23px; }
.quick-moods small { color: var(--muted); font-size: 9px; font-weight: 750; }
.quick-moods button.is-selected { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(157,103,84,.13); }
.quick-save { min-height: 48px; }
.quick-safe-mode { display: grid; gap: 2px; padding: 9px 13px; text-align: left; }
.quick-safe-mode strong { font-size: 12px; }
.quick-safe-mode span { font-size: 10px; font-weight: 600; opacity: .82; }
.quick-checkin-status { grid-column: 1 / -1; margin: -11px 0 0; color: var(--muted); font-size: 11px; }

.reader-intro {
  display: grid;
  grid-template-columns: minmax(0, 760px) auto;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 38px;
}
.reader-intro.compact { margin-bottom: 30px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.reader-intro h1 { max-width: 740px; margin: 12px 0 14px; font: 500 clamp(34px, 5vw, 61px)/1.03 Georgia, serif; letter-spacing: -.035em; }
.reader-intro.compact h1 { font-size: clamp(34px, 4vw, 52px); }
.reader-intro p { max-width: 670px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 13px 17px;
  border-radius: 13px;
  color: white;
  background: var(--accent);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(117, 71, 56, .18);
}

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.mood-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  font-size: 13px;
}
.filter-chip.is-active { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); font-weight: 700; }
.result-count { flex: 0 0 auto; color: var(--muted); font-size: 13px; }

.status-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255,255,255,.45);
}
.status-panel[hidden] { display: none; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card, .circle-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 12px 34px rgba(69, 52, 43, .055);
}
.post-card { display: flex; flex-direction: column; min-height: 280px; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card.has-image .card-body { min-height: 230px; }
.card-image-wrap { display: grid; grid-template-columns: 1fr; height: 210px; overflow: hidden; background: #eee8e1; }
.card-image-wrap.multi { grid-template-columns: 2fr 1fr; gap: 2px; }
.card-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-image-wrap .image-stack { display: grid; gap: 2px; grid-template-rows: repeat(2, 1fr); min-height: 0; }
.card-image-wrap .more-images { position: relative; }
.card-image-wrap .more-images::after { content: attr(data-more); position: absolute; inset: 0; display: grid; place-items: center; color: white; background: rgba(37,32,29,.56); font-weight: 800; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 19px; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 12px; }
.mood-pill, .shared-pill, .sensitive-pill { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 750; }
.shared-pill { background: var(--sage); color: #405443; }
.sensitive-pill { background: #f3e5bd; color: #6c5520; }
.meta-separator { opacity: .45; }
.card-title { margin: 0 0 10px; font: 600 23px/1.17 Georgia, serif; }
.card-excerpt { display: -webkit-box; overflow: hidden; margin: 0; color: #5f5752; font-size: 15px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.post-card.is-sensitive .card-excerpt { filter: blur(6px); user-select: none; }
.sensitive-reveal { margin-top: 12px; padding: 8px 10px; border: 1px solid #e4d3a5; border-radius: 10px; background: #fff9e9; cursor: pointer; font-size: 12px; font-weight: 700; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.card-tag { color: var(--muted); font-size: 12px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.support-count { color: var(--muted); font-size: 12px; }
.card-button { padding: 8px 11px; border-radius: 10px; color: var(--accent-dark); background: var(--accent-soft); font-weight: 750; }
.card-button { text-decoration: none; }

.load-more-wrap { display: flex; justify-content: center; padding-top: 30px; }
.secondary-button { padding: 12px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; font-weight: 750; }
.secondary-button:disabled { cursor: wait; opacity: .6; }

.circle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.circle-card { padding: 22px; }
.my-circle-grid { margin-bottom: 42px; }
.circle-discovery-heading { margin-top: 12px; }
.circle-card.is-disabled { opacity: .72; }
.circle-icon { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 20px; border-radius: 15px; background: var(--sage); font-size: 22px; }
.circle-card h2 { margin: 0 0 9px; font: 600 23px/1.2 Georgia, serif; }
.circle-card p { min-height: 70px; margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.circle-stats { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.circle-category { display: inline-block; margin-bottom: 11px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.circle-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.membership-label { color: #405443; font-size: 12px; font-weight: 750; }
.circle-action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.circle-action-buttons .secondary-button { padding: 8px 11px; font-size: 12px; }
.circle-checkbox { display: flex; align-items: flex-start; gap: 11px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: #fbfaf8; }
.circle-checkbox input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.circle-checkbox span { display: grid; gap: 4px; }
.circle-checkbox strong { font-size: 13px; }
.circle-checkbox small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.circle-form-actions { align-items: center; }
.form-action-spacer { flex: 1; }

.profile-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.profile-avatar { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 20px; color: white; font-size: 27px; }
.profile-copy { display: grid; gap: 5px; min-width: 0; }
.profile-copy strong { font: 600 24px/1.15 Georgia, serif; }
.profile-copy span { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; }
.plan-pill { padding: 7px 10px; border-radius: 999px; color: var(--accent-dark); background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin: 7px 0 0; font: 600 31px/1.15 Georgia, serif; }
.own-post-grid .post-card { min-height: 245px; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #4f4844; background: #eee9e3; font-size: 11px; font-weight: 800; }
.status-pill.public { color: #405443; background: var(--sage); }
.status-pill.private { color: #594a71; background: #e8e0f1; }
.own-card-actions { display: flex; gap: 7px; }
.danger-button { padding: 8px 11px; border: 0; border-radius: 10px; cursor: pointer; color: #8a342f; background: #f8e1de; font-weight: 750; }

.post-dialog { width: min(760px, calc(100% - 28px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(37, 32, 29, .25); }
.post-dialog::backdrop { background: rgba(37, 32, 29, .55); backdrop-filter: blur(4px); }
.dialog-frame { position: relative; overflow-y: auto; max-height: 88vh; padding: clamp(25px, 5vw, 48px); }
.dialog-close { position: sticky; z-index: 2; top: 0; float: right; display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; cursor: pointer; background: #f3efeb; font-size: 25px; line-height: 1; }
.dialog-title { margin: 16px 45px 12px 0; font: 600 clamp(29px, 5vw, 43px)/1.08 Georgia, serif; }
.dialog-text { clear: both; margin: 25px 0; color: #4f4844; white-space: pre-wrap; font-size: 17px; line-height: 1.75; }
.dialog-gallery { display: grid; gap: 10px; margin: 25px 0; }
.dialog-gallery img { width: 100%; max-height: 580px; border-radius: 16px; object-fit: cover; }
.reaction-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0; border-top: 1px solid var(--line); }
.reaction { padding: 7px 10px; border-radius: 999px; color: var(--muted); background: #f6f2ed; font-size: 12px; }
.reaction-picker { margin-top: 6px; padding: 20px 0; border-top: 1px solid var(--line); }
.reaction-picker h3 { margin: 0 0 5px; font: 600 19px/1.2 Georgia, serif; }
.reaction-picker p { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.reaction-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.reaction-button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: white; font-size: 12px; }
.reaction-button.is-selected { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); font-weight: 800; }
.reaction-button:disabled { cursor: wait; opacity: .55; }
.dialog-actions { display: flex; gap: 8px; margin-top: 12px; }

.form-field { display: grid; gap: 8px; margin: 19px 0; color: var(--ink); font-size: 13px; font-weight: 750; }
.form-field > span { display: flex; justify-content: space-between; }
.form-field small { color: var(--muted); font-weight: 500; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fbfaf8;
  font: 400 15px/1.5 Inter, ui-sans-serif, sans-serif;
}
.form-field textarea { resize: vertical; min-height: 190px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(157, 103, 84, .12); }
.form-field > small { justify-self: end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.privacy-reminder { padding: 12px 14px; border-radius: 12px; color: var(--muted); background: #f5f1ec; font-size: 12px; line-height: 1.55; }
.form-error { padding: 11px 13px; border-radius: 11px; color: #873c37; background: #f9e6e3; font-size: 13px; }
.form-actions { justify-content: flex-end; margin-top: 22px; }
.compose-modes { margin: 22px 0 6px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.compose-modes[hidden] { display: none; }
.compose-modes h3 { margin: 6px 0 13px; font: 600 21px/1.2 Georgia, serif; }
.writing-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.writing-mode { display: grid; gap: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left; background: #fbfaf8; }
.writing-mode strong { font-size: 12px; }
.writing-mode small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.writing-mode.is-selected { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(157,103,84,.1); }
.writing-mode-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.account-profile { display: grid; grid-template-columns: auto 1fr; gap: 15px; align-items: center; margin: 22px 0; padding: 18px; border-radius: 17px; background: #f7f3ee; }
.account-profile strong, .account-profile span { display: block; }
.account-profile span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.verified-label { display: block; margin-top: 5px; color: #55725b; font-size: 11px; font-weight: 750; }
.account-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.account-dialog { width: min(880px, calc(100% - 28px)); }
.account-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 150px; color: var(--muted); }
.account-error { display: grid; justify-items: start; gap: 12px; padding: 20px; border-radius: 15px; color: #873c37; background: #f9e6e3; }
.account-error p { margin: 0; }
.account-section { margin: 26px 0; padding-top: 24px; border-top: 1px solid var(--line); }
.account-section-heading { margin-bottom: 15px; }
.account-section-heading h3 { margin: 0 0 5px; font: 600 24px/1.2 Georgia, serif; }
.account-section-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.subscription-card { padding: 19px; border: 1px solid var(--line); border-radius: 17px; background: #fbfaf8; }
.subscription-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.subscription-head h4 { margin: 6px 0; font: 600 25px/1.2 Georgia, serif; }
.subscription-head p { max-width: 540px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.subscription-metadata { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 17px; }
.account-meta { display: grid; gap: 4px; padding: 10px 12px; border-radius: 11px; background: white; }
.account-meta span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.account-meta strong { font-size: 13px; }
.account-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.account-link { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; font-size: 13px; }
.subscription-offers { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.subscription-offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.subscription-offer strong { font-size: 13px; }
.subscription-offer small { color: var(--muted); font-size: 11px; }
.subscription-offer button { grid-column: 2; grid-row: 1 / 3; white-space: nowrap; }
.subscription-unavailable { display: grid; gap: 4px; width: 100%; padding: 13px; border: 1px dashed var(--line); border-radius: 13px; background: var(--surface-soft, #f7f5f2); }
.subscription-unavailable small { color: var(--muted); line-height: 1.45; }
.subscription-access-wrapper { display: grid; gap: 13px; margin-top: 15px; }
.subscription-access-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.subscription-access-title strong { font: 600 18px/1.2 Georgia, serif; }
.subscription-access-title .secondary-button { padding: 8px 11px; font-size: 11px; text-decoration: none; }
.subscription-access-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.subscription-access-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
.subscription-access-card.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.subscription-access-heading { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.subscription-access-heading h4 { margin: 0; font: 600 17px/1.2 Georgia, serif; }
.access-state { padding: 4px 6px; border-radius: 999px; color: var(--accent-dark); background: white; font-size: 9px; font-weight: 800; }
.subscription-feature-list { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 11px; line-height: 1.35; }

/* Page publique des abonnements */
.pricing-main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 62px 0 76px; }
.pricing-hero { max-width: 780px; margin: 0 auto 42px; text-align: center; }
.pricing-hero h1 { margin: 12px 0 15px; font: 600 clamp(38px, 6vw, 64px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.pricing-hero p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.pricing-card { position: relative; display: flex; flex-direction: column; padding: 27px; border: 1px solid var(--line); border-radius: 23px; background: var(--card); box-shadow: var(--shadow); }
.pricing-card.is-highlighted { border-color: var(--accent); box-shadow: 0 20px 55px rgba(105, 99, 157, .16); }
.pricing-card .plan-pill { align-self: flex-start; }
.pricing-card h2 { margin: 18px 0 8px; font: 600 30px/1.1 Georgia, serif; }
.pricing-card > p { min-height: 46px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.pricing-price { display: grid; gap: 4px; margin: 21px 0; }
.pricing-price strong { font: 700 30px/1 Georgia, serif; }
.pricing-price small { color: var(--muted); font-size: 11px; }
.pricing-features { display: grid; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; color: var(--muted); font-size: 13px; line-height: 1.4; }
.pricing-card .primary-link, .pricing-card .secondary-button { margin-top: auto; text-decoration: none; }
.pricing-note { max-width: 820px; margin: 30px auto 0; padding: 17px 20px; border: 1px solid var(--line); border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.62); font-size: 12px; line-height: 1.55; text-align: center; }
.payment-dialog { width: min(620px, calc(100% - 28px)); }
.payment-summary { margin: 0 0 14px; color: var(--ink); font-size: 16px; font-weight: 750; }
.payment-notice { margin-bottom: 14px; padding: 13px 14px; border-radius: 12px; color: #554942; background: var(--accent-soft); font-size: 12px; line-height: 1.55; }
.sumup-card-host { min-height: 180px; margin: 14px 0; }
.payment-legal { color: var(--muted); font-size: 11px; line-height: 1.55; }
.account-settings-form { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fbfaf8; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-copy { display: grid; gap: 4px; }
.setting-copy strong { font-size: 14px; }
.setting-copy small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.setting-toggle { width: 21px; height: 21px; flex: 0 0 auto; accent-color: var(--accent); }
.account-select { min-width: 140px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.account-save-button { justify-self: end; margin: 14px 16px; }
.data-action-list { display: grid; gap: 10px; }
.data-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 17px; border: 1px solid var(--line); border-radius: 15px; background: #fbfaf8; }
.data-action strong { font-size: 14px; }
.data-action p { max-width: 560px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.data-action button { flex: 0 0 auto; }
.export-ready { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px; color: #405443; background: var(--sage); font-size: 13px; font-weight: 700; }

/* Espace bien-être privé */
.safe-mode-button { align-self: center; padding: 14px 19px; border: 1px solid #d99a91; border-radius: 14px; color: #7b302d; background: #f9e5e2; cursor: pointer; font-weight: 800; }
.safe-mode-panel { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 22px; padding: 18px 20px; border: 1px solid #d99a91; border-radius: 17px; background: #f9e5e2; }
.safe-mode-panel strong { font: 600 21px/1.2 Georgia, serif; }
.safe-mode-panel p { margin: 5px 0 0; color: #704c49; font-size: 13px; line-height: 1.5; }
body.safe-mode-active .safe-mode-button { border-color: #69639d; color: white; background: #69639d; }
body.safe-mode-active .safe-mode-panel { border-color: #8d87b9; color: #3e3965; background: #e5e3f3; }
body.safe-mode-active .safe-mode-panel p { color: #5b5779; }
.wellbeing-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 18px; }
.wellbeing-card, .calm-card, .crisis-card { padding: clamp(20px, 4vw, 30px); border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 12px 34px rgba(69, 52, 43, .055); }
.wellbeing-card h2, .calm-card h2, .crisis-card h2 { margin: 8px 0 10px; font: 600 28px/1.15 Georgia, serif; }
.checkin-moods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.checkin-moods button { display: grid; min-height: 74px; place-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: #fbfaf8; font-size: 25px; }
.checkin-moods button small { color: var(--muted); font-size: 10px; font-weight: 700; }
.checkin-moods button.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(157,103,84,.12); }
.wellbeing-range { display: grid; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.wellbeing-range span { display: flex; justify-content: space-between; }
.wellbeing-range input { width: 100%; accent-color: var(--accent); }
.compact-field textarea { min-height: 84px; }
.non-clinical-note { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.emotion-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.emotion-stat { padding: 13px; border-radius: 13px; background: #f7f3ee; }
.emotion-stat strong, .emotion-stat span { display: block; }
.emotion-stat strong { color: var(--accent-dark); font: 700 25px/1 Georgia, serif; }
.emotion-stat span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.emotion-distribution { display: grid; gap: 9px; margin-top: 18px; }
.distribution-row { display: grid; grid-template-columns: 105px 1fr 25px; align-items: center; gap: 8px; font-size: 12px; }
.distribution-track { height: 9px; overflow: hidden; border-radius: 999px; background: #eee8e1; }
.distribution-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.calm-card { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; gap: 28px; margin-top: 18px; background: linear-gradient(135deg, var(--card), var(--sage)); }
.calm-card p, .crisis-card p { color: var(--muted); line-height: 1.65; }
.calm-actions, .crisis-actions, .auth-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.breathing-stage { display: grid; min-height: 230px; place-items: center; }
.breathing-circle { display: grid; width: 175px; height: 175px; place-items: center; align-content: center; gap: 8px; border: 3px solid var(--accent); border-radius: 50%; background: rgba(255,255,255,.68); transition: transform 1s ease; }
.breathing-circle strong { max-width: 135px; text-align: center; }
.breathing-circle span { color: var(--accent-dark); font-size: 24px; font-weight: 800; }
.crisis-card { margin-top: 18px; border-color: #d99a91; background: #fff8f6; }
.crisis-actions a { text-decoration: none; }
.wellbeing-section, .profiles-manager { margin-top: 42px; }
.profiles-hint { max-width: 720px; margin: -8px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.profile-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.anonymous-profile-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.anonymous-profile-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; }
.anonymous-profile-avatar { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 15px; color: white; font-size: 22px; }
.anonymous-profile-card h3 { margin: 0; font: 600 18px/1.2 Georgia, serif; }
.anonymous-profile-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.anonymous-profile-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.anonymous-profile-actions button { padding: 8px 10px; font-size: 11px; }
.profile-name-input { width: 100%; margin-top: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfaf8; }
.emotion-history { display: grid; gap: 10px; }
.history-day { display: grid; grid-template-columns: minmax(150px, .5fr) 1.5fr; gap: 18px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.history-day time { font-weight: 750; }
.history-entries { display: flex; flex-wrap: wrap; gap: 7px; }
.history-entry { padding: 7px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; }
.history-note { grid-column: 2; margin: 0; color: var(--muted); font-size: 12px; }

/* Authentification email ou Google */
.auth-dialog { width: min(560px, calc(100% - 28px)); }
.auth-intro { color: var(--muted); font-size: 14px; line-height: 1.6; }
.google-auth-button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: white; font-weight: 750; }
.google-auth-button span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #4285f4; background: #f4f7ff; font-weight: 900; }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 22px 0 4px; color: var(--muted); font-size: 11px; }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.text-button { margin-top: 16px; padding: 0; border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f1ebe5;
  --muted: #b9aea6;
  --paper: #1d1a18;
  --card: rgba(43, 38, 35, .94);
  --line: #493f39;
  --accent: #d49a83;
  --accent-dark: #f0c0ad;
  --accent-soft: #4b332a;
  --sage: #334438;
}
html[data-theme="dark"] body { background: radial-gradient(circle at 12% 5%, rgba(75,51,42,.7), transparent 26rem), radial-gradient(circle at 92% 28%, rgba(51,68,56,.62), transparent 28rem), var(--paper); }
html[data-theme="dark"] .app-header { background: rgba(29,26,24,.9); }
html[data-theme="dark"] .view-tabs,
html[data-theme="dark"] .search-control,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .account-meta,
html[data-theme="dark"] .account-select { background: #2b2623; }
html[data-theme="dark"] .view-tab.is-active,
html[data-theme="dark"] .post-dialog,
html[data-theme="dark"] .subscription-card,
html[data-theme="dark"] .account-settings-form,
html[data-theme="dark"] .data-action { background: #2b2623; }
html[data-theme="dark"] .account-profile,
html[data-theme="dark"] .dialog-close,
html[data-theme="dark"] .privacy-reminder,
html[data-theme="dark"] .circle-checkbox { background: #352f2b; }
html[data-theme="dark"] .wellbeing-card,
html[data-theme="dark"] .anonymous-profile-card,
html[data-theme="dark"] .history-day,
html[data-theme="dark"] .checkin-moods button,
html[data-theme="dark"] .profile-name-input,
html[data-theme="dark"] .google-auth-button { background: #2b2623; }
html[data-theme="dark"] .quick-checkin { background: linear-gradient(135deg, #2b2623, #4b332a); }
html[data-theme="dark"] .quick-moods button,
html[data-theme="dark"] .writing-mode,
html[data-theme="dark"] .article-detail { background: #2b2623; }
html[data-theme="dark"] .emotion-stat { background: #352f2b; }
html[data-theme="dark"] .crisis-card { background: #3a2927; }
html[data-theme="dark"] .card-excerpt,
html[data-theme="dark"] .dialog-text,
html[data-theme="dark"] .article-body { color: #d0c6bf; }

.toast { position: fixed; z-index: 50; right: 20px; bottom: 20px; max-width: 340px; padding: 12px 15px; border-radius: 12px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Lecture d'une publication dans une page dédiée */
.post-page-header { display: flex; justify-content: space-between; }
.post-back-link { text-decoration: none; }
.article-shell { width: min(820px, calc(100% - 32px)); min-height: calc(100vh - 160px); margin: 0 auto; padding: clamp(38px, 7vw, 82px) 0; }
.inline-article-view { width: min(820px, 100%); margin: 0 auto; }
.inline-article-back { margin-bottom: 18px; }
.article-detail { padding: clamp(25px, 6vw, 58px); border: 1px solid var(--line); border-radius: 28px; background: var(--card); box-shadow: var(--shadow); }
.article-detail[hidden] { display: none; }
.article-detail h1 { max-width: 17ch; margin: 15px 0 28px; font: 600 clamp(38px, 7vw, 66px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.article-body { color: #4f4844; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 18px/1.85 Georgia, serif; }
.article-gallery { display: grid; gap: 14px; margin: 30px 0; }
.article-gallery img { width: 100%; max-height: 680px; border-radius: 18px; object-fit: cover; }
.article-sensitive { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; margin: 0 0 22px; padding: 16px; border: 1px solid #e4d3a5; border-radius: 14px; background: #fff9e9; }
.article-sensitive span { flex: 1; color: #6c5520; font-size: 12px; }
.is-hidden-sensitive { filter: blur(8px); pointer-events: none; user-select: none; }
.article-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.article-kindness { margin-top: 34px; padding: 19px; border-radius: 16px; background: var(--sage); }
.article-kindness strong { font: 600 19px/1.2 Georgia, serif; }
.article-kindness p { margin: 7px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.article-kindness a { text-decoration: none; }

.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 4vw, 64px); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.app-footer a:hover { color: var(--accent-dark); }

@media (max-width: 980px) {
  .app-header { grid-template-columns: 1fr auto; gap: 12px; }
  .view-tabs { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  .post-grid, .circle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reader-intro { grid-template-columns: 1fr; align-items: start; }
  .quick-checkin { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .app-header { gap: 8px; padding: 10px 12px; }
  .brand small { display: none; }
  .brand { gap: 8px; min-width: 0; }
  .brand strong { display: block; overflow: hidden; max-width: 110px; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
  .brand-mark { width: 37px; height: 37px; border-radius: 12px; }
  .header-actions { gap: 6px; min-width: 0; }
  .search-control { width: 44px; padding: 9px 11px; }
  .search-control:focus-within { position: absolute; z-index: 3; right: 14px; width: calc(100% - 28px); background: white; }
  .search-control input { width: 0; }
  .search-control:focus-within input { width: 100%; }
  .write-button { display: none; }
  .auth-button { max-width: 88px; padding: 10px 8px; font-size: 11px; }
  .app-shell { width: min(100% - 28px, 580px); padding-top: 34px; }
  .reader-intro { gap: 24px; margin-bottom: 28px; }
  .reader-intro h1 { font-size: 38px; }
  .reader-intro p { font-size: 15px; }
  .toolbar { display: block; }
  .mood-filters { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
  .mood-filters::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; }
  .result-count { display: block; margin-top: 7px; text-align: right; }
  .post-grid, .circle-grid { grid-template-columns: 1fr; }
  .quick-checkin { gap: 18px; margin-bottom: 30px; padding: 20px; }
  .quick-checkin-actions { grid-template-columns: 1fr; }
  .quick-moods { grid-template-columns: repeat(3, 1fr); }
  .quick-save, .quick-safe-mode { width: 100%; }
  .writing-mode-grid { grid-template-columns: repeat(2, 1fr); }
  .post-page-header { align-items: center; }
  .post-back-link { padding: 9px 11px; font-size: 11px; }
  .article-detail { border-radius: 21px; }
  .article-footer { align-items: stretch; flex-direction: column; }
  .wellbeing-grid, .calm-card, .profile-card-grid { grid-template-columns: 1fr; }
  .checkin-moods { grid-template-columns: repeat(4, minmax(62px, 1fr)); overflow-x: auto; }
  .safe-mode-panel, .history-day { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .history-note { grid-column: 1; }
  .profile-summary { grid-template-columns: auto 1fr; padding: 18px; }
  .plan-pill { grid-column: 1 / -1; justify-self: start; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .subscription-head, .data-action, .export-ready { align-items: stretch; flex-direction: column; }
  .subscription-metadata { grid-template-columns: 1fr; }
  .subscription-offers { grid-template-columns: 1fr; }
  .subscription-access-grid, .pricing-grid { grid-template-columns: 1fr; }
  .subscription-access-title { align-items: flex-start; flex-direction: column; }
  .data-action button, .export-ready .primary-link { width: 100%; }
  .setting-row { align-items: flex-start; }
  .circle-actions { align-items: flex-start; flex-direction: column; }
  .circle-action-buttons { width: 100%; justify-content: flex-start; }
  .circle-action-buttons button { flex: 1; }
  .circle-form-actions { align-items: stretch; flex-direction: column; }
  .form-action-spacer { display: none; }
  .card-image-wrap { height: 230px; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .app-footer p { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
