:root {
  color-scheme: dark;
  --wine: #382127;
  --wine-deep: #23171b;
  --wine-soft: #55363d;
  --gold: #c9a56e;
  --gold-light: #e2ca9d;
  --paper: #e6d3af;
  --paper-light: #f0e3c9;
  --paper-dark: #d5bd93;
  --ink: #30221e;
  --muted-ink: #766458;
  --green: #234238;
  --green-light: #315949;
  --line: rgba(67, 44, 32, 0.3);
  --space-page: clamp(0.75rem, 2.7vw, 2.5rem);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  font-synthesis: none;
  font-family: var(--sans);
  color: var(--paper-light);
  background: var(--wine-deep);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  line-height: 1.55;
  background-color: var(--wine);
  background-image: linear-gradient(110deg, rgba(36, 20, 25, 0.89), rgba(69, 37, 45, 0.88)), url("../img/tissu-bordeaux.0a98b4bcaffa.webp");
  background-repeat: repeat;
  background-attachment: fixed;
}
a { color: var(--gold-light); text-underline-offset: 0.2em; }
a:hover { color: #fff0d0; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #f2d18c; outline-offset: 3px; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; min-height: 5.7rem;
  padding: 0.55rem var(--space-page); border-bottom: 1px solid rgba(216, 184, 126, 0.36);
  background: rgba(32, 20, 24, 0.75); box-shadow: 0 0.4rem 1.8rem rgba(0, 0, 0, 0.16);
}
.site-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--paper-light); text-decoration: none; }
.site-brand__sprite { display: block; width: clamp(3.3rem, 5vw, 4.5rem); height: clamp(3.3rem, 5vw, 4.5rem); object-fit: contain; }
.site-brand strong { display: block; font: 600 1.12rem/1.1 var(--serif); letter-spacing: 0.015em; }
.site-brand small { display: block; margin-top: 0.22rem; color: var(--gold-light); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem 1.15rem; }
.site-nav > a:not(.profile-link), .nav-button { color: var(--paper-light); font-size: 0.88rem; text-decoration: none; }
.site-nav > a:not(.profile-link):hover, .nav-button:hover { color: var(--gold-light); }
.site-nav form { margin: 0; }
.nav-button { padding: 0.4rem 0; border: 0; background: transparent; cursor: pointer; }
.profile-link { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--paper-light); font-size: 0.88rem; text-decoration: none; }
.profile-link img { width: 2.4rem; height: 2.4rem; border: 1px solid var(--gold); border-radius: 50%; object-fit: cover; }
.page-shell { width: min(100% - 2 * var(--space-page), 88rem); min-height: calc(100vh - 9rem); margin: 0 auto; padding: clamp(1.35rem, 3.5vw, 3rem) 0 3.5rem; }
.site-footer { padding: 1.2rem var(--space-page) 1.6rem; border-top: 1px solid rgba(216, 184, 126, 0.25); color: rgba(230, 211, 175, 0.72); text-align: center; font: italic 1rem var(--serif); }
.eyebrow { margin: 0 0 0.35rem; color: var(--gold-light); font-size: 0.73rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0.2rem 0 0.75rem; font: 500 clamp(2rem, 5vw, 4.4rem)/1.03 var(--serif); }
h2 { margin: 0; font: 500 clamp(1.45rem, 3vw, 2.15rem)/1.15 var(--serif); }
h3 { margin: 0.3rem 0; }
.muted { color: var(--muted-ink); }
.back-link { margin: 0 0 1rem; }
.back-link a { color: var(--gold-light); text-decoration: none; }
.notices { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.notice { margin: 0; padding: 0.7rem 0.9rem; border: 1px solid rgba(232, 203, 153, 0.5); border-radius: 0.4rem; color: var(--paper-light); background: rgba(40, 25, 29, 0.84); }
.notice--error { border-color: #d8877f; color: #ffe7dc; }
.notice--warning { color: #fff0d0; }
.notice--success { border-color: #8db49c; }
.mode-banner, .organizer-control { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 1.3rem; padding: 0.75rem 1rem; border: 1px solid var(--gold); border-radius: 0.4rem; color: #fff2d8; background: rgba(31, 22, 25, 0.86); }
.mode-banner form, .organizer-control form { margin: 0; }

.calendar-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 15rem; margin: 0 auto 1.5rem; padding: clamp(1.35rem, 5vw, 3.4rem); border: 1px solid rgba(217, 180, 119, 0.58); border-radius: 0.7rem; background: linear-gradient(115deg, rgba(34, 20, 25, 0.97) 0%, rgba(55, 32, 38, 0.88) 74%, rgba(55, 32, 38, 0.55)); box-shadow: 0 1rem 2.7rem rgba(14, 8, 10, 0.24); }
.calendar-hero__copy { max-width: 48rem; }
.calendar-hero h1 { max-width: 24ch; color: var(--paper-light); }
.calendar-hero__copy > p:not(.eyebrow):not(.calendar-date) { max-width: 42rem; margin: 0.85rem 0; color: #e7d5b7; font-size: clamp(0.96rem, 1.5vw, 1.12rem); }
.calendar-date { margin: 1rem 0 0; color: var(--gold-light); font-size: 0.87rem; letter-spacing: 0.04em; }
.calendar-hero__seal { position: relative; display: grid; width: clamp(6rem, 11vw, 9rem); height: clamp(6rem, 11vw, 9rem); flex: 0 0 auto; place-items: center; color: #fff0d3; text-align: center; font: 600 0.75rem/1.15 var(--serif); }
.calendar-hero__seal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0.5rem 0.55rem rgba(0,0,0,.4)); }
.calendar-hero__seal span { position: relative; z-index: 1; text-shadow: 0 1px 4px rgba(35, 17, 20, .95); }
.calendar-key { display: flex; flex-wrap: wrap; gap: 0.55rem 1.4rem; margin: 0 0 1.25rem; padding: 0.75rem 1rem; border: 1px solid rgba(215, 177, 115, 0.35); border-radius: 0.45rem; background: rgba(39, 23, 28, 0.72); }
.calendar-key p { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--paper-light); font-size: 0.79rem; }
.key-swatch { width: 0.85rem; height: 0.85rem; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.key-swatch--locked { background: #83766b; }
.key-swatch--available { background: var(--paper); }
.key-swatch--opened { background: var(--green-light); }
.key-swatch--preparing { background: #a68d67; }
.calendar-progress { display: grid; grid-template-columns: auto minmax(4rem, 1fr) auto; align-items: center; gap: 0.4rem 1rem; margin: 0 0 2.2rem; padding: 0.9rem 1.05rem; border: 1px solid rgba(215, 177, 115, 0.38); border-radius: 0.45rem; background: rgba(39, 23, 28, 0.69); }
.calendar-progress .eyebrow { margin-bottom: 0.15rem; }
.calendar-progress strong { color: var(--paper-light); font: 500 1.35rem var(--serif); }
.calendar-progress strong span { color: #c8b69c; font: 400 0.82rem var(--sans); }
.calendar-progress progress { width: 100%; height: 0.45rem; accent-color: var(--gold); }
.calendar-progress .text-link { text-align: right; }
.calendar-section, .preparation-progress { margin: 0 0 2.7rem; }
.section-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.75rem 1.4rem; margin: 0 0 1rem; }
.section-heading .eyebrow { margin-bottom: 0.3rem; }
.section-heading > p, .section-heading > span { margin: 0; color: #d2c0a4; font-size: 0.85rem; }

.calendar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.5rem, 1.3vw, 1rem); margin: 0; padding: 0; list-style: none; }
.calendar-cell { min-width: 0; }
.day-envelope { position: relative; isolation: isolate; display: flex; min-width: 0; min-height: 12.8rem; flex-direction: column; overflow: hidden; padding: 0.85rem 0.75rem 0.65rem; border: 1px solid rgba(70, 45, 33, 0.45); border-radius: 0.35rem; color: var(--ink); text-decoration: none; background-color: var(--paper); background-image: linear-gradient(145deg, rgba(252, 239, 208, 0.28), rgba(156, 121, 77, 0.10)), url("../img/papier-artisanal.edc53b768861.webp"); background-size: cover, 380px auto; box-shadow: 0 0.6rem 1.15rem rgba(10, 5, 8, 0.26); transition: transform 170ms ease, box-shadow 170ms ease, filter 170ms ease; }
.day-envelope[href]:hover { transform: translateY(-3px); box-shadow: 0 0.8rem 1.45rem rgba(10, 5, 8, 0.34); }
.day-envelope:focus-visible { outline-offset: 4px; }
.day-envelope::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(145deg, transparent 48%, rgba(120, 78, 52, 0.16) 49%, transparent 50%), linear-gradient(35deg, transparent 48%, rgba(120, 78, 52, 0.14) 49%, transparent 50%); pointer-events: none; }
.day-envelope::after { position: absolute; z-index: -1; inset: 0 0 auto; height: 47%; content: ""; clip-path: polygon(0 0, 100% 0, 50% 80%); background: rgba(255, 245, 219, 0.31); pointer-events: none; }
.day-envelope--locked { color: #35251e; filter: saturate(0.55); background-color: #c3b8aa; }
.day-envelope--locked .day-envelope__state { color: #3f3127; }
.day-envelope--locked::after { background: rgba(119, 111, 99, 0.19); }
.day-envelope--preparing { background-color: #d2bd97; }
.day-envelope--draft { background-color: #d8c59f; }
.day-envelope--opened { color: #f3e6cf; border-color: #b09362; background-color: var(--green); background-image: linear-gradient(145deg, rgba(33, 68, 54, .93), rgba(22, 50, 41, .96)), url("../img/papier-artisanal.edc53b768861.webp"); }
.day-envelope--opened::before { background: linear-gradient(145deg, transparent 48%, rgba(224, 197, 151, 0.12) 49%, transparent 50%), linear-gradient(35deg, transparent 48%, rgba(224, 197, 151, 0.11) 49%, transparent 50%); }
.day-envelope--opened::after { background: rgba(213, 198, 163, 0.08); }
.day-envelope__number { position: relative; z-index: 2; align-self: flex-start; min-width: 2rem; padding: 0.05rem 0.4rem; border: 1px solid currentColor; border-radius: 99px; font: 600 1.05rem var(--serif); text-align: center; }
.day-envelope__author { position: absolute; z-index: 2; top: 0.55rem; right: 0.55rem; width: 2.7rem; height: 2.7rem; overflow: hidden; border: 2px solid rgba(95, 64, 40, .55); border-radius: 50%; background: var(--paper-light); }
.day-envelope__author img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--ink); font: 700 0.8rem var(--sans); }
.day-envelope__seal { position: relative; z-index: 1; display: grid; width: 3.55rem; height: 3.55rem; flex: 0 0 auto; align-self: center; place-items: center; margin: 0.4rem 0 0.35rem; filter: drop-shadow(0 0.25rem 0.25rem rgba(41, 20, 18, .35)); }
.day-envelope__seal img { width: 100%; height: 100%; object-fit: contain; }
.day-envelope__state { position: relative; z-index: 2; align-self: center; margin-top: auto; color: var(--muted-ink); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.04em; text-align: center; text-transform: uppercase; }
.day-envelope--opened .day-envelope__state { color: #e4d2ad; }
.day-envelope__lock { position: relative; z-index: 2; display: grid; width: 3.1rem; height: 3.1rem; align-self: center; place-items: center; margin: 0.7rem 0 0.45rem; border: 1px solid rgba(70, 52, 38, .35); border-radius: 50%; color: #685e51; font-size: 1.8rem; }
.day-envelope__revealed { position: relative; z-index: 2; display: grid; gap: 0.28rem; margin: 0.5rem 0 0.2rem; text-align: center; }
.day-envelope__revealed strong { display: -webkit-box; overflow: hidden; color: #fff0d3; font: 500 1.05rem/1.08 var(--serif); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.day-envelope__category { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; color: #cfb98e; font-size: 0.68rem; }
.day-envelope__category > span { color: #ddbd79; }
.day-envelope__count { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 0.28rem; margin-top: 0.3rem; color: rgba(65, 46, 34, .82); font-size: 0.7rem; }
.day-envelope--opened .day-envelope__count { color: #e4d5b5; }
.opened-avatars { position: absolute; z-index: 2; top: 3.45rem; right: 0.45rem; display: flex; flex-direction: row-reverse; padding-left: 0.4rem; }
.opened-avatars img { width: 1.45rem; height: 1.45rem; margin-left: -0.35rem; border: 1px solid var(--paper); border-radius: 50%; object-fit: cover; }
.progress-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.progress-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; padding: 0.65rem 0.8rem; border: 1px solid rgba(218, 183, 125, 0.32); border-radius: 0.4rem; background: rgba(39, 23, 28, 0.7); }
.progress-person { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; color: #f0dfc2; font-size: 0.88rem; }
.progress-person img { width: 2.3rem; height: 2.3rem; flex: 0 0 auto; border: 1px solid var(--gold); border-radius: 50%; object-fit: cover; }
.progress-list strong { color: var(--gold-light); font: 500 1.15rem var(--serif); white-space: nowrap; }

.button { display: inline-flex; min-height: 2.8rem; align-items: center; justify-content: center; padding: 0.55rem 0.95rem; border: 1px solid transparent; border-radius: 0.35rem; font-weight: 650; text-align: center; text-decoration: none; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.button--primary { color: #f8ead0; border-color: #c5a36e; background: #6c4630; }
.button--primary:hover { color: #fff6e5; background: #815638; }
.button--secondary { color: #f2e1c2; border-color: rgba(216, 184, 126, 0.58); background: rgba(50, 31, 35, 0.93); }
.button--secondary:hover { color: #fff1d5; border-color: var(--gold-light); background: #483036; }
.link-button, .text-link { color: #745439; text-decoration: underline; text-underline-offset: 0.16em; }
.link-button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.text-link { font-size: 0.87rem; }
.empty-state { grid-column: 1 / -1; padding: 1rem; border: 1px dashed rgba(224, 198, 156, .5); border-radius: 0.4rem; color: #e4d2b4; }

.reader-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.8fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0; width: min(100%, 74rem); max-height: calc(100dvh - 2rem); margin: 0 auto; }
.reader-close { position: absolute; z-index: 5; top: 0.65rem; right: 0.65rem; display: grid; width: 2.6rem; height: 2.6rem; place-items: center; border: 1px solid rgba(69, 47, 32, .38); border-radius: 50%; color: #463027; background: rgba(242, 228, 201, .92); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.letter-sheet, .discussion { min-width: 0; max-height: calc(100dvh - 5rem); overflow: auto; overscroll-behavior: contain; }
.letter-sheet { padding: clamp(1.15rem, 3.3vw, 2.8rem); border: 1px solid rgba(91, 65, 43, 0.45); color: var(--ink); background-color: var(--paper-light); background-image: linear-gradient(rgba(247, 235, 209, .85), rgba(235, 218, 184, .9)), url("../img/papier-artisanal.edc53b768861.webp"); background-size: cover, 520px auto; box-shadow: inset 0 0 0 0.45rem rgba(177, 142, 88, 0.12), 0 0.7rem 2rem rgba(0,0,0,.23); }
.letter-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.1rem 2.4rem 1rem 0; border-bottom: 1px solid var(--line); }
.letter-heading__author { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; }
.letter-heading__author img { width: 3.65rem; height: 3.65rem; border: 2px solid #9a7951; border-radius: 50%; object-fit: cover; }
.letter-date { margin: 0; color: var(--muted-ink); font: italic 0.95rem var(--serif); text-align: right; }
.letter-title { margin: 1.25rem 0 0.4rem; color: #38231f; font: 500 clamp(2rem, 4vw, 3.5rem)/1.04 var(--serif); }
.letter-category { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0 0.5rem; padding: 0.25rem 0.6rem; border: 1px solid rgba(93, 68, 43, .32); border-radius: 99px; color: #64503f; font-size: 0.82rem; }
.contribution-body { margin: 1.2rem 0 1.8rem; overflow-wrap: anywhere; font: 400 clamp(1.13rem, 1.6vw, 1.35rem)/1.68 var(--serif); }
.contribution-body > :first-child { margin-top: 0; }
.contribution-body a { color: #426c78; }
.contribution-body blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid #a78053; color: #625046; font-style: italic; }
.contribution-body pre, .contribution-body code { overflow-x: auto; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.contribution-body figure, .private-image { margin: 1rem 0; }
.contribution-body img, .private-image img { display: block; max-width: 100%; max-height: 58vh; margin: 0 auto; object-fit: contain; }
.letter-gate { max-width: 39rem; margin: 3rem auto; padding: clamp(1rem, 4vw, 2rem); border: 1px solid rgba(98, 70, 43, .25); background: rgba(247, 236, 211, .45); text-align: center; }
.letter-gate p:not(.eyebrow) { color: #5d493a; }
.preview-notice { margin: 0.9rem 0; padding: 0.65rem 0.8rem; border-left: 3px solid #876943; color: #5d493a; background: rgba(191, 158, 106, .18); font-size: 0.86rem; }
.letter-edit { margin: 1.3rem 0 0; }
.discussion { padding: 1.4rem 1rem 1.1rem; border: 1px solid rgba(221, 188, 132, 0.52); color: #ead8b9; background: #322127; }
.discussion__head { padding: 0.25rem 2.45rem 1rem 0; border-bottom: 1px solid rgba(217, 187, 139, .3); }
.discussion__head h2 { color: #f1e3ca; font-size: 1.55rem; }
.discussion__head h2 span { color: #c7b28e; font: 400 0.92rem var(--sans); }
.comment-list { display: grid; gap: 0.9rem; margin: 0; padding: 1rem 0; list-style: none; }
.comment { display: grid; grid-template-columns: 2.15rem minmax(0, 1fr); align-items: start; gap: 0.55rem; }
.comment > img { width: 2.1rem; height: 2.1rem; border: 1px solid var(--gold); border-radius: 50%; object-fit: cover; }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.15rem 0.5rem; margin: 0; color: #f1e2c7; font-size: 0.78rem; }
.comment__meta time { color: #bca98b; font-size: 0.68rem; }
.comment__text { margin: 0.18rem 0 0; color: #ebdec9; font: italic 1.03rem/1.42 var(--serif); overflow-wrap: anywhere; }
.comment-empty { color: #c9b89c; font: italic 1rem var(--serif); }
.comment-form { display: grid; gap: 0.55rem; padding-top: 0.85rem; border-top: 1px solid rgba(217, 187, 139, .3); }
.comment-form label { font-size: 0.85rem; font-weight: 650; }
.comment-form textarea { width: 100%; min-height: 5.2rem; padding: 0.65rem; border: 1px solid rgba(229, 203, 158, .53); border-radius: 0.3rem; color: #32251f; background: #f0e2c3; resize: vertical; }
.comment-form .button { justify-self: start; }
.reader-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; min-height: 3.6rem; padding: 0.55rem 1rem; border: 1px solid rgba(221, 188, 132, 0.52); border-top: 0; border-radius: 0 0 0.35rem 0.35rem; color: #e5d3b4; background: #281b20; }
.reader-actions .reader-count { margin: 0; color: #d0bea0; font-size: 0.83rem; }
.reader-actions .link-button { color: #efd8a9; font-size: 0.85rem; }
.reader-actions form { margin: 0; }
.form-error { color: #ffe1d2; font-size: 0.83rem; }
.reader-dialog { width: min(76rem, calc(100vw - 1.5rem)); max-width: none; max-height: calc(100dvh - 1.5rem); padding: 0; overflow: hidden; border: 1px solid var(--gold); border-radius: 0.5rem; color: var(--paper-light); background: var(--wine-deep); box-shadow: 0 1.4rem 5rem rgba(0,0,0,.55); }
.reader-dialog::backdrop { background: rgba(13, 8, 10, .78); backdrop-filter: blur(3px); }
.reader-dialog[open] { display: block; animation: reader-in 150ms ease-out; }
.reader-dialog__content { max-height: calc(100dvh - 1.5rem); overflow: auto; }
@keyframes reader-in { from { opacity: 0; transform: translateY(0.45rem) scale(.99); } to { opacity: 1; transform: none; } }

.studio-intro { max-width: 50rem; margin: 0 0 1.6rem; }
.studio-intro h1 { color: var(--paper-light); }
.studio-intro > p:not(.eyebrow):not(.preview-notice) { color: #dfceb1; }
.entry-list { display: grid; gap: 0.8rem; }
.entry-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; align-items: center; gap: 0.9rem; padding: 0.85rem 1rem; border: 1px solid rgba(220, 185, 127, .42); border-radius: 0.45rem; color: var(--ink); background-color: var(--paper); background-image: linear-gradient(rgba(238, 223, 193, .86), rgba(221, 203, 166, .92)), url("../img/papier-artisanal.edc53b768861.webp"); background-size: cover, 400px auto; }
.entry-row__number { color: #826647; font: 500 2.3rem/1 var(--serif); text-align: center; }
.entry-row__content { min-width: 0; }
.entry-row__content h2 { margin-top: 0.2rem; color: #32231e; font-size: clamp(1.2rem, 2vw, 1.7rem); }
.entry-row__content .muted { margin: 0.15rem 0 0; font-size: 0.83rem; }
.entry-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: #6f5a45; font-size: 0.77rem; }
.status-badge { padding: 0.15rem 0.45rem; border: 1px solid rgba(89, 70, 48, .4); border-radius: 99px; color: #695744; font-size: 0.72rem; }
.status-badge--ready { color: #234238; border-color: #607c65; background: #ced8bd; }
.entry-row__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.55rem; }
.entry-row__actions > .button { white-space: nowrap; }

.profile-page { width: min(100%, 65rem); margin: 0 auto; }
.profile-heading { max-width: 44rem; margin: 0 auto 1.4rem; text-align: center; }
.profile-heading h1 { color: var(--paper-light); }
.profile-heading > p:last-child { color: #decdb0; }
.profile-card { display: grid; grid-template-columns: minmax(10rem, 0.75fr) minmax(0, 1.4fr); gap: clamp(1rem, 4vw, 3rem); align-items: center; padding: clamp(1.1rem, 4vw, 2.4rem); border: 1px solid rgba(220, 185, 127, .56); border-radius: 0.5rem; color: var(--ink); background: linear-gradient(rgba(238, 223, 193, .87), rgba(221, 203, 166, .94)), url("../img/papier-artisanal.edc53b768861.webp"); background-size: cover, 500px auto; box-shadow: 0 1rem 2rem rgba(10,5,8,.25); }
.profile-portrait { display: grid; place-items: center; }
.profile-portrait img { width: min(100%, 11rem); height: 11rem; aspect-ratio: 1 / 1; border: 4px solid #b18b57; border-radius: 50%; object-fit: cover; box-shadow: 0 0.55rem 1.2rem rgba(51, 32, 22, .25); }
.profile-details h2 { color: #392720; }
.profile-details .eyebrow { color: #765b3f; }
.profile-username { margin: 0.35rem 0 1.2rem; color: #776351; font-size: 0.88rem; }
.profile-form { display: grid; gap: 0.9rem; }
.profile-form .field { display: grid; gap: 0.4rem; }
.profile-form label { font-weight: 650; }
.profile-upload__button { width: fit-content; min-height: 2.75rem; cursor: pointer; }
.profile-upload__filename { color: #62503e; font-size: 0.9rem; overflow-wrap: anywhere; }
.profile-upload__preview { width: 5.5rem; height: 5.5rem; border: 2px solid #b18b57; border-radius: 50%; object-fit: cover; }
.profile-form small { color: #766354; }
.profile-form .form-error { color: #8a3226; }
.profile-form .button { justify-self: start; }
.profile-password { margin-top: 1rem; }

.panel, .form-panel { color: var(--ink); }
.form-panel { width: min(100%, 58rem); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem); border: 1px solid rgba(220, 185, 127, .56); border-radius: 0.5rem; background: linear-gradient(rgba(238, 223, 193, .88), rgba(221, 203, 166, .94)), url("../img/papier-artisanal.edc53b768861.webp"); background-size: cover, 500px auto; box-shadow: 0 1rem 2rem rgba(10,5,8,.25); }
.form-panel h1 { color: #38251e; font-size: clamp(1.9rem, 3.8vw, 3.4rem); }
.form-panel .eyebrow, .form-panel .muted { color: #765f49; }
.form-stack { display: grid; gap: 1rem; }
.form-stack p { margin: 0; }
.field { display: grid; gap: 0.35rem; }
.field label, .field-label { font-weight: 650; }
.field input:not([type="file"]), .field select, .field textarea { width: 100%; min-height: 2.7rem; padding: 0.55rem; border: 1px solid #98846a; border-radius: 0.3rem; color: #30241f; background: rgba(255, 250, 237, .88); }
.field textarea { min-height: 12rem; resize: vertical; }
.field small, .helptext { color: #766354; }
.errorlist { margin: 0; padding-left: 1.2rem; color: #8a3226; }
.form-panel .form-error { color: #8a3226; }
.login-panel { width: min(100%, 30rem); margin: 1rem auto; }
.rich-editor-field { gap: 0.55rem; }
.editor-workbench { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(14rem, 0.85fr); align-items: start; gap: clamp(1rem, 2.4vw, 1.65rem); }
.editor-workbench__main { display: grid; min-width: 0; gap: 1rem; }
.editor-workbench__settings { display: grid; min-width: 0; align-content: start; gap: 0.9rem; padding: 0.35rem 0 0.5rem 1.2rem; border-left: 1px solid #cbb897; }
.editor-workbench__settings h2 { margin: 0; color: #49362a; font: 500 1.3rem/1.2 var(--serif); }
.editor-workbench__settings > .muted { margin: -0.45rem 0 0; font-size: 0.9rem; }
.editor-form > .button { justify-self: start; min-height: 2.75rem; }
.rich-editor { display: grid; gap: 0.65rem; padding: 0.75rem; border: 1px solid #9b8466; border-radius: 0.4rem; background: rgba(244, 232, 207, .8); }
.rich-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding-bottom: 0.6rem; border-bottom: 1px solid #cbb897; }
.rich-toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.28rem; padding-right: 0.45rem; border-right: 1px solid #cbb897; }
.rich-toolbar__group:last-of-type { padding-right: 0; border-right: 0; }
.rich-toolbar button { min-width: 2.75rem; min-height: 2.75rem; padding: 0.4rem 0.55rem; border: 1px solid #9b8466; border-radius: 0.3rem; color: #35261f; background: #f2e5ca; cursor: pointer; }
.rich-toolbar .rich-toolbar__preview { min-height: 2.75rem; border: 1px solid #9b8466; color: #35261f; background: #f2e5ca; }
.rich-toolbar button[aria-pressed="true"] { border-color: var(--green); color: #173d31; background: #d2ddcb; }
.rich-editor__surface { min-height: 15rem; padding: clamp(0.75rem, 3vw, 1.2rem); border: 1px solid #b5a181; border-radius: 0.3rem; color: #30241f; background: #f5ead0; }
.rich-editor__surface .tiptap { min-height: 12rem; outline: none; }
.rich-editor__surface .tiptap a, .rich-preview__content a { color: #654323; text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
.rich-editor__surface .tiptap > :first-child, .rich-preview__content > :first-child { margin-top: 0; }
.rich-editor__surface .tiptap > :last-child, .rich-preview__content > :last-child { margin-bottom: 0; }
.rich-editor__media { display: grid; gap: 0.45rem; padding-top: 0.5rem; border-top: 1px solid #cbb897; }
.rich-editor__media label { font-size: 0.9rem; font-weight: 650; }
.rich-editor__media input { width: 100%; min-height: 2.5rem; padding: 0.45rem 0.6rem; border: 1px solid #98846a; border-radius: 0.3rem; color: #30241f; background: #fff9e9; }
.rich-editor__media .button { width: fit-content; }
.rich-editor__media p, .rich-editor__message { margin: 0; font-size: 0.9rem; }
.rich-editor__message { min-height: 1.35em; color: #315949; }
.rich-preview { padding: 1rem; border: 1px dashed #9b8466; border-radius: 0.35rem; background: #f8efd9; }
.rich-preview h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.rich-preview__content { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .editor-workbench { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .editor-workbench__settings { gap: 0.75rem; padding: 1rem 0 0; border-top: 1px solid #cbb897; border-left: 0; }
}
.provider-embed { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin: 1rem 0; padding: 1rem; border: 1px solid #b9a27c; border-radius: 0.4rem; background: #f4e8cc; }
.provider-embed iframe { width: 100%; min-height: 19rem; border: 0; border-radius: 0.3rem; }
.provider-embed[data-provider="spotify"] iframe { min-height: 9.5rem; }
.provider-embed__load { min-height: 2.5rem; padding: 0.4rem 0.7rem; border: 1px solid #9b8466; border-radius: 0.3rem; color: #30241f; background: #fff9e9; cursor: pointer; }

@media (min-width: 660px) {
  .calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .day-envelope { min-height: 14.2rem; padding: 0.9rem; }
  .day-envelope__seal { width: 4rem; height: 4rem; margin-top: 0.65rem; }
  .progress-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1120px) {
  .calendar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .day-envelope { min-height: 15.3rem; }
  .day-envelope__revealed strong { font-size: 1.15rem; }
}
@media (max-width: 760px) {
  .reader-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .reader-dialog__content { max-height: 100dvh; height: 100dvh; overflow: auto; }
  .reader-layout { display: flex; width: 100%; max-height: none; flex-direction: column; gap: 0; }
  .letter-sheet, .discussion { max-height: none; overflow: visible; overscroll-behavior: auto; }
  .letter-sheet { min-height: 58vh; padding: 1.1rem 1rem 1.5rem; }
  .discussion { padding: 1.1rem 1rem; }
  .reader-actions { min-height: 3.7rem; border-radius: 0; }
}
@media (max-width: 620px) {
  .site-header { align-items: flex-start; gap: 0.4rem; padding-top: 0.45rem; padding-bottom: 0.5rem; }
  .site-brand { gap: 0.15rem; }
  .site-brand__sprite { width: 2.9rem; height: 2.9rem; }
  .site-brand strong { max-width: 11rem; font-size: 0.95rem; }
  .site-brand small { font-size: 0.58rem; }
  .site-nav { gap: 0.25rem 0.55rem; font-size: 0.78rem; }
  .site-nav > a:not(.profile-link), .nav-button, .profile-link { font-size: 0.76rem; }
  .profile-link span { display: none; }
  .profile-link img { width: 2rem; height: 2rem; }
  .calendar-hero { align-items: flex-start; gap: 0.4rem; min-height: 0; padding: 1.25rem 1rem; }
  .calendar-hero h1 { max-width: 11ch; font-size: clamp(2rem, 8vw, 2.8rem); }
  .calendar-hero__copy > p:not(.eyebrow):not(.calendar-date) { max-width: 26rem; font-size: 0.9rem; }
  .calendar-hero__seal { width: 4.4rem; height: 4.4rem; margin-top: 1rem; font-size: 0.55rem; }
  .calendar-key { gap: 0.5rem 0.8rem; padding: 0.7rem; }
  .calendar-key p { font-size: 0.7rem; }
  .calendar-progress { grid-template-columns: auto 1fr; gap: 0.25rem 0.7rem; }
  .calendar-progress progress { grid-column: 1 / -1; grid-row: 2; }
  .calendar-progress .text-link { grid-column: 2; grid-row: 1; font-size: 0.78rem; }
  .day-envelope { min-height: 12.1rem; padding: 0.65rem 0.55rem 0.5rem; }
  .day-envelope__number { min-width: 1.75rem; font-size: 0.95rem; }
  .day-envelope__author { top: 0.42rem; right: 0.4rem; width: 2.25rem; height: 2.25rem; }
  .day-envelope__seal { width: 3rem; height: 3rem; margin: 0.45rem 0 0.25rem; }
  .day-envelope__state { font-size: 0.62rem; }
  .day-envelope__revealed strong { font-size: 0.95rem; }
  .day-envelope__category { font-size: 0.63rem; }
  .day-envelope__count { font-size: 0.65rem; }
  .opened-avatars { top: 2.75rem; right: 0.25rem; }
  .opened-avatars img { width: 1.25rem; height: 1.25rem; }
  .progress-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-row { grid-template-columns: 2.7rem minmax(0, 1fr); gap: 0.5rem; padding: 0.75rem; }
  .entry-row__number { font-size: 1.8rem; }
  .entry-row__actions { grid-column: 2; justify-content: flex-start; }
  .profile-card { grid-template-columns: 1fr; gap: 1rem; }
  .profile-portrait img { width: 8.5rem; height: 8.5rem; }
  .letter-heading { align-items: flex-start; }
  .letter-date { max-width: 8rem; padding-top: 0.4rem; font-size: 0.85rem; }
  .letter-heading__author img { width: 3.2rem; height: 3.2rem; }
  .letter-title { font-size: clamp(2rem, 9vw, 2.75rem); }
  .contribution-body img, .private-image img { max-height: 55vh; }
  .letter-gate { margin: 2rem auto; }
}
@media (max-width: 360px) {
  .site-nav { max-width: 8.75rem; }
  .site-brand strong { max-width: 8.5rem; font-size: 0.85rem; }
  .calendar-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-envelope { min-height: 11.3rem; }
  .day-envelope__seal { width: 2.65rem; height: 2.65rem; }
  .day-envelope__revealed strong { font-size: 0.85rem; }
  .calendar-hero__seal { width: 3.6rem; height: 3.6rem; }
}
@media (max-width: 420px) {
  .progress-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
