/* =========================================================================
   Mistletoe · 槲寄生
   A private Christmas tree for two.
   ========================================================================= */

:root {
  --bg: #071b15;
  --bg-2: #0a221a;
  --bg-3: #103027;
  --bg-4: #163b2f;
  --pine: #2f6b5e;
  --pine-light: #4d8b78;
  --cream: #f7f0df;
  --cream-2: #efe4cc;
  --paper: #fbf4e3;
  --ink: #15251f;
  --ink-soft: #43534b;
  --muted: #87968d;
  --muted-dark: #6f7368;
  --gold: #d8b26a;
  --gold-bright: #eed69c;
  --gold-deep: #a77c3b;
  --red: #b23a48;
  --red-deep: #8c2835;
  --rose: #e0a5a4;
  --line: rgba(235, 216, 175, 0.15);
  --line-strong: rgba(235, 216, 175, 0.3);
  --line-dark: rgba(25, 43, 35, 0.12);
  --success: #77b798;
  --danger: #d96b70;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-ui: "Avenir Next", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-hand: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif CJK SC", serif;
  --shadow-lg: 0 36px 80px -34px rgba(0, 8, 5, 0.8);
  --shadow-md: 0 20px 44px -24px rgba(0, 8, 5, 0.75);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --ease: cubic-bezier(0.22, 0.76, 0.24, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--cream);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.has-open-dialog {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

code {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

::selection {
  background: rgba(216, 178, 106, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(216, 178, 106, 0.25);
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 178, 106, 0.42);
  background-clip: padding-box;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  display: inline-block;
  vertical-align: -0.18em;
  overflow: visible;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 18px;
  z-index: 3000;
  background: var(--cream);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 10px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 14px;
}

.muted {
  color: var(--muted);
}
.muted-dark {
  color: var(--muted-dark);
}
.small {
  font-size: 12.5px;
}
.centered {
  text-align: center;
}
.right {
  text-align: right;
}
.mono-number {
  font-family: "Cascadia Mono", Consolas, monospace;
  color: var(--gold-bright);
  font-size: 14px;
}
.success-text {
  color: var(--success) !important;
}
.amp {
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  padding: 0 0.15em;
}
.accent {
  color: var(--gold);
}

/* -------------------------------------------------------------------------
   Ambient background
   ------------------------------------------------------------------------- */
.app-body {
  background:
    radial-gradient(circle at 10% -8%, rgba(61, 121, 100, 0.38), transparent 38%),
    radial-gradient(circle at 92% 6%, rgba(178, 58, 72, 0.13), transparent 34%),
    radial-gradient(circle at 50% 110%, rgba(24, 72, 55, 0.55), transparent 52%),
    linear-gradient(158deg, #061913 0%, #0a211a 48%, #061712 100%);
}

.ambient-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1.2px 1.2px at 18% 22%, rgba(255, 243, 208, 0.5), transparent 100%),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 243, 208, 0.35), transparent 100%),
    radial-gradient(1.4px 1.4px at 42% 68%, rgba(255, 243, 208, 0.3), transparent 100%),
    radial-gradient(1px 1px at 88% 74%, rgba(255, 243, 208, 0.35), transparent 100%),
    radial-gradient(1px 1px at 8% 84%, rgba(255, 243, 208, 0.28), transparent 100%);
  background-size: 420px 380px, 560px 520px, 480px 460px, 620px 600px, 380px 420px;
}

.snowfall {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.snowflake {
  position: absolute;
  top: -8vh;
  left: var(--left);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 249, 234, 0.9);
  opacity: var(--opacity);
  filter: blur(0.15px);
  animation: snow-fall var(--duration) linear var(--delay) infinite;
}
@keyframes snow-fall {
  0% {
    transform: translate3d(0, -10vh, 0);
  }
  50% {
    transform: translate3d(var(--drift), 52vh, 0);
  }
  100% {
    transform: translate3d(calc(var(--drift) * -0.5), 110vh, 0);
  }
}

/* -------------------------------------------------------------------------
   Typography helpers
   ------------------------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.eyebrow > span:empty {
  display: inline-block;
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.light {
  color: var(--gold-bright);
}
.eyebrow.small {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}
.eyebrow.tiny {
  font-size: 8px;
  letter-spacing: 0.2em;
  margin-bottom: 2px;
}
.eyebrow.danger {
  color: var(--rose);
}
.eyebrow.centered {
  justify-content: center;
}
.lede {
  color: rgba(247, 240, 223, 0.66);
  font-size: 16px;
  line-height: 1.8;
  max-width: 660px;
}
.page-heading h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  color: var(--cream);
  margin-bottom: 14px;
}
.page-heading.centered {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 40px;
}
.page-heading.centered .eyebrow {
  justify-content: center;
}
.page-heading.centered .lede {
  margin: 0 auto;
}
.page-heading.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}
.page-heading.split > div {
  max-width: 760px;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  --btn-y: 11px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: var(--btn-y) 23px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform 0.24s var(--ease),
    box-shadow 0.24s var(--ease),
    background 0.24s,
    border-color 0.24s,
    color 0.24s;
}
.btn .icon {
  width: 17px;
  height: 17px;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  transform: none !important;
}
.btn-primary {
  color: #fff8e9;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 38%),
    linear-gradient(135deg, #bc4350 0%, #a63342 48%, #812432 100%);
  border-color: rgba(244, 211, 161, 0.32);
  box-shadow:
    0 16px 32px -18px rgba(178, 58, 72, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  box-shadow:
    0 20px 38px -16px rgba(178, 58, 72, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  filter: brightness(1.05);
}
.btn-secondary {
  color: var(--cream);
  border-color: rgba(216, 178, 106, 0.34);
  background: rgba(247, 240, 223, 0.055);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(247, 240, 223, 0.1);
  border-color: rgba(216, 178, 106, 0.58);
}
.btn-ghost {
  color: rgba(247, 240, 223, 0.78);
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--cream);
  background: rgba(247, 240, 223, 0.07);
}
.btn-quiet {
  color: rgba(247, 240, 223, 0.74);
  border-color: var(--line);
  background: rgba(7, 27, 21, 0.34);
}
.btn-quiet:hover {
  color: var(--cream);
  border-color: var(--line-strong);
  background: rgba(247, 240, 223, 0.06);
}
.btn-danger {
  color: #fff6ee;
  background: linear-gradient(135deg, #c04a54, #8d2633);
  border-color: rgba(255, 210, 205, 0.2);
  box-shadow: 0 14px 30px -18px rgba(178, 58, 72, 0.9);
}
.btn-danger-outline {
  color: #f0b4b6;
  border-color: rgba(217, 107, 112, 0.4);
  background: rgba(178, 58, 72, 0.06);
}
.btn-danger-outline:hover {
  background: rgba(178, 58, 72, 0.14);
  border-color: rgba(217, 107, 112, 0.7);
}
.btn-danger-text {
  color: #e59a9d;
  border-color: transparent;
  background: transparent;
}
.btn-danger-text:hover {
  color: #ffc0c2;
  background: rgba(178, 58, 72, 0.12);
}
.btn-ghost-light {
  color: var(--cream);
  border-color: rgba(247, 240, 223, 0.22);
  background: rgba(247, 240, 223, 0.04);
}
.btn-block {
  width: 100%;
}
.btn-lg {
  --btn-y: 15px;
  font-size: 14.5px;
  padding-left: 30px;
  padding-right: 30px;
}
.btn-small {
  --btn-y: 8px;
  padding-left: 16px;
  padding-right: 16px;
  font-size: 12px;
}
.btn-tiny {
  --btn-y: 5px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 11.5px;
  border-radius: 8px;
}
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading > * {
  opacity: 0;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.65s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px 0;
  transition: color 0.2s;
}
.text-btn:hover {
  color: var(--gold-bright);
}
.text-btn .icon {
  width: 14px;
  height: 14px;
}
.danger-text {
  color: #db8b8e;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(247, 240, 223, 0.7);
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
  position: relative;
  flex: none;
}
.icon-btn:hover {
  color: var(--cream);
  background: rgba(247, 240, 223, 0.08);
  border-color: var(--line);
}
.icon-btn .icon {
  width: 19px;
  height: 19px;
}
.icon-btn.admin-entry {
  color: var(--gold);
}

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label,
.field-label,
fieldset legend {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.035em;
  color: rgba(247, 240, 223, 0.82);
}
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.field-hint {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.field-hint.centered {
  text-align: center;
}
.field-hint code {
  color: var(--gold-bright);
}
.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 10px;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input-icon {
  position: absolute;
  left: 15px;
  width: 17px;
  height: 17px;
  color: rgba(247, 240, 223, 0.4);
  pointer-events: none;
  z-index: 1;
}
.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: 13px;
  border: 1px solid rgba(235, 216, 175, 0.18);
  background: rgba(5, 22, 17, 0.46);
  color: var(--cream);
  font-size: 14px;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}
.input-wrap input::placeholder {
  color: rgba(247, 240, 223, 0.32);
}
.input-wrap input:hover {
  border-color: rgba(235, 216, 175, 0.3);
}
.input-wrap input:focus {
  outline: none;
  border-color: rgba(216, 178, 106, 0.65);
  background: rgba(5, 22, 17, 0.68);
  box-shadow: 0 0 0 4px rgba(216, 178, 106, 0.09);
}
.input-action {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(247, 240, 223, 0.38);
  display: grid;
  place-items: center;
}
.input-action:hover,
.input-action.is-on {
  color: var(--gold);
  background: rgba(216, 178, 106, 0.1);
}
.input-action .icon {
  width: 16px;
  height: 16px;
}
.input-wrap:has(.input-action) input {
  padding-right: 46px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  font-family: var(--font-ui);
}
textarea {
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid rgba(235, 216, 175, 0.18);
  background: rgba(5, 22, 17, 0.46);
  color: var(--cream);
  resize: vertical;
  line-height: 1.7;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
textarea:focus {
  outline: none;
  border-color: rgba(216, 178, 106, 0.65);
  box-shadow: 0 0 0 4px rgba(216, 178, 106, 0.09);
}
textarea::placeholder {
  color: rgba(247, 240, 223, 0.3);
}
.select-input {
  height: 46px;
  padding: 0 40px 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(235, 216, 175, 0.18);
  background-color: rgba(5, 22, 17, 0.5);
  color: var(--cream);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(247, 240, 223, 0.55) 50%),
    linear-gradient(135deg, rgba(247, 240, 223, 0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.select-input:focus {
  outline: none;
  border-color: rgba(216, 178, 106, 0.65);
}
select option {
  background: #0c241d;
  color: var(--cream);
}
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid.two {
  grid-template-columns: 1fr 1fr;
}
.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}
.settings-form .field {
  width: 100%;
}
.settings-form .form-grid {
  width: 100%;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-size: 12.5px;
  color: rgba(247, 240, 223, 0.78);
}
.switch-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: rgba(247, 240, 223, 0.15);
  border: 1px solid rgba(247, 240, 223, 0.18);
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch-track > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream);
  transition: transform 0.24s var(--ease);
}
.switch-field input:checked + .switch-track {
  background: var(--red);
  border-color: rgba(255, 220, 200, 0.3);
}
.switch-field input:checked + .switch-track > span {
  transform: translateX(18px);
}
.switch-field input:focus-visible + .switch-track {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------
   Panels, badges, avatars
   ------------------------------------------------------------------------- */
.panel {
  position: relative;
  background:
    linear-gradient(155deg, rgba(30, 69, 55, 0.48), rgba(11, 32, 25, 0.72)),
    rgba(10, 30, 23, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow:
    0 30px 70px -45px rgba(0, 7, 4, 0.9),
    inset 0 1px 0 rgba(255, 245, 216, 0.05);
  backdrop-filter: blur(14px);
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}
.panel-head.compact {
  margin-bottom: 16px;
  align-items: center;
}
.panel-head h2 {
  font-size: 25px;
}
.panel-head h3 {
  font-size: 20px;
}
.panel-head p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 5px;
}
.panel-head .icon.decorative {
  width: 26px;
  height: 26px;
  color: rgba(216, 178, 106, 0.5);
}
.panel-head.separated {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-pill .icon {
  width: 12px;
  height: 12px;
}
.status-pill.success {
  color: #a9d8be;
  background: rgba(80, 149, 117, 0.14);
  border: 1px solid rgba(119, 183, 152, 0.22);
}
.status-pill.neutral {
  color: var(--muted);
  background: rgba(247, 240, 223, 0.05);
  border: 1px solid var(--line);
}
.status-pill.danger {
  color: #f0b0b2;
  background: rgba(178, 58, 72, 0.14);
  border: 1px solid rgba(217, 107, 112, 0.25);
}
.status-pill.admin {
  color: var(--gold-bright);
  background: rgba(216, 178, 106, 0.11);
  border: 1px solid rgba(216, 178, 106, 0.24);
}
.tiny-tag,
.you-tag {
  display: inline-block;
  font-size: 9px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--gold-bright);
  border: 1px solid rgba(216, 178, 106, 0.3);
  margin-left: 7px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--gold-bright);
  background: rgba(216, 178, 106, 0.1);
  border: 1px solid rgba(216, 178, 106, 0.24);
}
.role-badge.soft {
  color: rgba(247, 240, 223, 0.62);
  background: rgba(247, 240, 223, 0.05);
  border-color: var(--line);
}
.role-badge .icon {
  width: 12px;
  height: 12px;
}
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
  border: 1px solid rgba(235, 216, 175, 0.28);
  flex: none;
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold-bright);
  background:
    radial-gradient(circle at 32% 24%, rgba(119, 183, 152, 0.5), transparent 60%),
    linear-gradient(140deg, #265b49, #112f26);
  font-size: 16px;
}
.avatar-xs {
  width: 30px;
  height: 30px;
}
.avatar-sm {
  width: 38px;
  height: 38px;
}
.avatar-md {
  width: 52px;
  height: 52px;
}
.avatar-lg {
  width: 84px;
  height: 84px;
}
.avatar-join,
.pair-link {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--line);
}
.avatar-join .icon,
.pair-link .icon {
  width: 11px;
  height: 11px;
}

.inline-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.65;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: rgba(247, 240, 223, 0.045);
  color: rgba(247, 240, 223, 0.72);
}
.inline-note .icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex: none;
  margin-top: 2px;
}
.inline-note strong {
  color: var(--cream);
}
.inline-note.calm {
  background: rgba(56, 112, 90, 0.12);
  border-color: rgba(119, 183, 152, 0.2);
}
.inline-note.calm .icon {
  color: var(--success);
}
.inline-note.warm {
  background: rgba(178, 58, 72, 0.08);
  border-color: rgba(217, 107, 112, 0.2);
}
.inline-note.warm .icon {
  color: var(--rose);
}
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 20px;
  border-radius: 18px;
  margin-bottom: 22px;
  border: 1px solid rgba(217, 107, 112, 0.28);
  background: rgba(139, 38, 50, 0.15);
}
.alert-banner .alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(217, 107, 112, 0.14);
  color: #f0b0b2;
  display: grid;
  place-items: center;
  flex: none;
}
.alert-banner strong {
  color: #ffd8d7;
  font-size: 13.5px;
}
.alert-banner p {
  color: rgba(255, 226, 220, 0.65);
  font-size: 12px;
  margin-top: 4px;
}

/* -------------------------------------------------------------------------
   App header
   ------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 72px;
  padding: 0 clamp(18px, 3vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(6, 24, 18, 0.76);
  border-bottom: 1px solid rgba(235, 216, 175, 0.1);
  backdrop-filter: blur(22px) saturate(1.15);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  background:
    radial-gradient(circle at 35% 25%, rgba(216, 178, 106, 0.22), transparent 60%),
    rgba(20, 57, 45, 0.9);
  border: 1px solid rgba(216, 178, 106, 0.36);
  box-shadow: inset 0 0 18px rgba(216, 178, 106, 0.08);
}
.brand-mark .icon {
  width: 21px;
  height: 21px;
}
.brand-type {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-type strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: var(--cream);
}
.brand-type small {
  font-size: 8.5px;
  letter-spacing: 0.34em;
  color: rgba(216, 178, 106, 0.75);
  margin-top: 4px;
}
.brand-light .brand-type strong {
  color: #fff8e8;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(247, 240, 223, 0.035);
  border: 1px solid rgba(235, 216, 175, 0.08);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  color: rgba(247, 240, 223, 0.58);
  transition:
    color 0.2s,
    background 0.2s;
}
.nav-link .icon {
  width: 15px;
  height: 15px;
}
.nav-link:hover {
  color: var(--cream);
}
.nav-link.is-active {
  color: var(--cream);
  background: rgba(216, 178, 106, 0.12);
  box-shadow: inset 0 0 0 1px rgba(216, 178, 106, 0.16);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}
.avatar-link {
  display: inline-flex;
  margin-left: 3px;
  border-radius: 50%;
}
.avatar-link .avatar {
  transition: box-shadow 0.2s;
}
.avatar-link:hover .avatar {
  box-shadow: 0 0 0 3px rgba(216, 178, 106, 0.22);
}
.notif-dot {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #081e17;
}
.logout-form {
  display: flex;
}
.mobile-nav {
  display: none;
}
.app-main {
  position: relative;
  z-index: 3;
}

/* -------------------------------------------------------------------------
   Toasts
   ------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: 86px;
  right: 22px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px 13px 14px;
  border-radius: 14px;
  pointer-events: auto;
  color: var(--ink);
  background: linear-gradient(145deg, #fbf4e3, #f1e6ce);
  border: 1px solid rgba(120, 90, 45, 0.18);
  box-shadow: 0 24px 50px -22px rgba(0, 8, 5, 0.8);
  animation: toast-in 0.34s var(--ease) both;
}
.toast.is-leaving {
  animation: toast-out 0.22s ease both;
}
.toast-mark {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(47, 107, 94, 0.12);
  color: var(--pine);
  flex: none;
  margin-top: 1px;
}
.toast-mark .icon {
  width: 13px;
  height: 13px;
}
.toast-error .toast-mark {
  color: var(--red);
  background: rgba(178, 58, 72, 0.1);
}
.toast-success .toast-mark {
  color: #2e7358;
  background: rgba(46, 115, 88, 0.12);
}
.toast-info .toast-mark {
  color: var(--gold-deep);
  background: rgba(167, 124, 59, 0.12);
}
.toast-text {
  font-size: 12.5px;
  line-height: 1.55;
  padding-top: 2px;
  flex: 1;
}
.toast-close {
  border: 0;
  background: transparent;
  color: rgba(21, 37, 31, 0.35);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex: none;
}
.toast-close:hover {
  color: var(--ink);
  background: rgba(21, 37, 31, 0.06);
}
.toast-close .icon {
  width: 12px;
  height: 12px;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(20px, -8px, 0) scale(0.97);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translate3d(14px, -4px, 0);
  }
}

/* -------------------------------------------------------------------------
   Dialogs and modals
   ------------------------------------------------------------------------- */
dialog.modal {
  border: 0;
  padding: 18px;
  background: transparent;
  color: var(--cream);
  width: min(100%, 720px);
  max-width: 100%;
  max-height: calc(100dvh - 20px);
  margin: auto;
  overflow: visible;
}
dialog.modal::backdrop {
  background: rgba(2, 11, 8, 0.74);
  backdrop-filter: blur(12px) saturate(0.9);
}
dialog.modal-small {
  width: min(100%, 500px);
}
.modal-card {
  position: relative;
  background:
    radial-gradient(circle at 80% -20%, rgba(216, 178, 106, 0.12), transparent 40%),
    linear-gradient(158deg, rgba(25, 61, 48, 0.98), rgba(8, 28, 21, 0.99));
  border: 1px solid rgba(216, 178, 106, 0.22);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 245, 216, 0.08);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal-close {
  position: absolute;
  top: 17px;
  right: 17px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(235, 216, 175, 0.14);
  background: rgba(7, 27, 21, 0.58);
  color: rgba(247, 240, 223, 0.6);
  backdrop-filter: blur(8px);
  transition:
    color 0.2s,
    background 0.2s,
    transform 0.2s;
}
.modal-close:hover {
  color: var(--cream);
  background: rgba(247, 240, 223, 0.08);
  transform: rotate(90deg);
}
.modal-close .icon {
  width: 15px;
  height: 15px;
}
.modal-lede {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(247, 240, 223, 0.6);
  margin-bottom: 22px;
}
.modal-lede strong {
  color: var(--cream);
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.modal-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.modal-heading h2 {
  font-size: 28px;
}
.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(216, 178, 106, 0.1);
  color: var(--gold);
  border: 1px solid rgba(216, 178, 106, 0.22);
  flex: none;
}
.modal-heading.danger .modal-icon {
  color: #f0b0b2;
  background: rgba(178, 58, 72, 0.12);
  border-color: rgba(217, 107, 112, 0.24);
}

/* Confirm dialog */
.confirm-card {
  text-align: center;
  padding: 38px 32px 30px;
}
.confirm-card .modal-actions {
  justify-content: center;
}
.confirm-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(216, 178, 106, 0.1);
  border: 1px solid rgba(216, 178, 106, 0.2);
}
.confirm-icon.danger {
  color: #f0b0b2;
  background: rgba(178, 58, 72, 0.12);
  border-color: rgba(217, 107, 112, 0.24);
}
.confirm-icon .icon {
  width: 24px;
  height: 24px;
}
.confirm-title {
  font-size: 27px;
  margin-bottom: 10px;
}
.confirm-message {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(247, 240, 223, 0.62);
}
.confirm-field {
  text-align: left;
  margin-top: 20px;
}
.confirm-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(235, 216, 175, 0.22);
  background: rgba(5, 22, 17, 0.55);
  color: var(--cream);
}
.confirm-field input:focus {
  outline: none;
  border-color: var(--gold);
}
.confirm-card .confirm-message + .field-hint {
  margin-top: 6px;
}
.is-shaking {
  animation: shake 0.4s ease;
  border-color: var(--danger) !important;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
.temp-password {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 17px;
  border-radius: 12px;
  background: rgba(4, 19, 14, 0.6);
  border: 1px solid var(--line-strong);
}
.temp-password code {
  flex: 1;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  word-break: break-all;
}

/* -------------------------------------------------------------------------
   Pagination / empty state
   ------------------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px 4px;
  border-top: 1px solid rgba(235, 216, 175, 0.08);
  margin-top: 22px;
  flex-wrap: wrap;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: rgba(247, 240, 223, 0.7);
  transition: background 0.2s;
}
.pager-btn:hover {
  background: rgba(247, 240, 223, 0.06);
  color: var(--cream);
}
.pager-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.pager-btn .icon {
  width: 13px;
  height: 13px;
}
.pager-info {
  font-size: 11px;
  color: var(--muted);
}
.pager-info strong {
  color: var(--gold);
}
.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 54px 24px;
  color: var(--muted);
}
.empty-panel > .icon {
  width: 34px;
  height: 34px;
  color: rgba(216, 178, 106, 0.45);
  margin-bottom: 14px;
}
.empty-panel h2 {
  font-size: 23px;
  color: var(--cream);
  margin-bottom: 8px;
}
.empty-panel p {
  font-size: 12.5px;
  max-width: 380px;
}

/* -------------------------------------------------------------------------
   Auth shell
   ------------------------------------------------------------------------- */
.auth-body {
  background: #071a14;
  overflow-x: hidden;
}
.auth-shell {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr);
  min-height: 100dvh;
}
.auth-scene {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 12%, rgba(61, 121, 100, 0.35), transparent 45%),
    radial-gradient(circle at 85% 78%, rgba(178, 58, 72, 0.12), transparent 40%),
    linear-gradient(150deg, #061a14 0%, #0b251d 56%, #081d16 100%);
}
.auth-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(235, 216, 175, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 216, 175, 0.025) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(circle at 42% 48%, #000 0%, transparent 72%);
  pointer-events: none;
}
.auth-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 80%, rgba(0, 0, 0, 0.14) 100%);
  pointer-events: none;
}
.auth-scene-glow {
  position: absolute;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  left: 10%;
  top: 10%;
  background: radial-gradient(circle, rgba(216, 178, 106, 0.13), transparent 62%);
  filter: blur(10px);
  pointer-events: none;
}
.auth-brand {
  position: relative;
  z-index: 4;
  align-self: flex-start;
}
.auth-copy {
  position: relative;
  z-index: 4;
  margin-top: clamp(70px, 13vh, 150px);
  max-width: 620px;
}
.auth-copy h1 {
  font-size: clamp(42px, 4.7vw, 70px);
  line-height: 1.18;
  letter-spacing: 0.015em;
  color: #fff8e8;
  text-wrap: balance;
}
.auth-copy h1 em {
  font-style: normal;
  color: var(--gold-bright);
  position: relative;
  display: inline-block;
}
.auth-copy h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0.06em;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 178, 106, 0.6), transparent);
}
.auth-lede {
  margin-top: 26px;
  color: rgba(247, 240, 223, 0.6);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.03em;
}
.auth-tree-figure {
  position: absolute;
  right: -9%;
  bottom: -9%;
  width: min(67%, 700px);
  z-index: 2;
  pointer-events: none;
  opacity: 0.94;
  filter: drop-shadow(0 40px 80px rgba(0, 0, 0, 0.45));
  animation: tree-sway 12s ease-in-out infinite;
}
.auth-tree-figure img {
  width: 100%;
}
@keyframes tree-sway {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(0.35deg);
  }
}
.auth-notes {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.floating-note {
  position: absolute;
  background-color: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 18px 34px -16px rgba(0, 0, 0, 0.55);
  background-image:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1), transparent 55%),
    repeating-linear-gradient(
      to bottom,
      transparent 0 21px,
      var(--paper-line) 21px 22px
    );
  padding: 18px;
  font-family: var(--font-hand);
  animation: note-float 9s ease-in-out infinite;
}
.floating-note .fn-hand {
  display: block;
  font-size: 17px;
  line-height: 1.55;
  color: var(--paper-ink);
  transform: rotate(-2deg);
}
.floating-note .fn-sign {
  display: block;
  text-align: right;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 9px;
}
.floating-note .fn-tape {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 48px;
  height: 16px;
  background: rgba(242, 224, 184, 0.58);
  transform: translateX(-50%) rotate(-2deg);
  border-left: 1px dashed rgba(255, 255, 255, 0.2);
  border-right: 1px dashed rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(2px);
}
.floating-note .fn-lines {
  display: block;
  width: 82px;
  height: 2px;
  background: currentColor;
  opacity: 0.2;
  margin: 9px 0;
}
.floating-note .fn-lines.short {
  width: 54px;
}
.fn-1 {
  width: 158px;
  left: 1.8%;
  top: 60%;
  transform: rotate(-6deg);
  z-index: 6;
}
.fn-2 {
  width: 104px;
  height: 104px;
  right: 19%;
  top: 30%;
  transform: rotate(8deg);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 15px;
  z-index: 7;
  animation-delay: -2s;
}
.fn-2 .fn-hand {
  font-size: 13px;
}
.fn-3 {
  width: 92px;
  height: 92px;
  right: 8%;
  top: 58%;
  transform: rotate(-7deg);
  display: grid;
  place-items: center;
  text-align: center;
  z-index: 7;
  animation-delay: -4s;
}
.fn-3 .fn-hand {
  font-size: 13px;
}
.fn-4 {
  width: 118px;
  left: 12%;
  bottom: 14%;
  transform: rotate(5deg);
  z-index: 6;
  animation-delay: -6s;
}
@keyframes note-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -9px;
  }
}
.auth-scene-footer {
  position: relative;
  z-index: 6;
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(247, 240, 223, 0.42);
}
.auth-scene-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-scene-footer .icon {
  width: 13px;
  height: 13px;
  color: rgba(216, 178, 106, 0.55);
}

.auth-panel {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(34px, 5vw, 68px);
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 6%, rgba(216, 178, 106, 0.2), transparent 32%),
    radial-gradient(circle at 10% 90%, rgba(178, 58, 72, 0.05), transparent 40%),
    linear-gradient(155deg, #fbf5e7, #f1e5cd);
  box-shadow: -40px 0 90px -50px rgba(0, 0, 0, 0.65);
}
.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(72, 52, 31, 0.055) 0.7px, transparent 0.7px);
  background-size: 4px 4px;
  opacity: 0.5;
  pointer-events: none;
}
.auth-panel-inner {
  position: relative;
  width: min(100%, 420px);
}
.auth-mobile-brand {
  display: none;
}
.auth-card-head {
  margin-bottom: 32px;
}
.auth-card-head .eyebrow {
  color: var(--gold-deep);
  margin-bottom: 12px;
}
.auth-card-head .eyebrow > span:empty {
  background: var(--gold-deep);
}
.auth-card-head h2 {
  font-size: clamp(34px, 3.5vw, 44px);
  color: var(--ink);
  margin-bottom: 12px;
}
.auth-card-head p {
  font-size: 13px;
  color: var(--muted-dark);
  line-height: 1.7;
}
.auth-panel .field label {
  color: var(--ink-soft);
}
.auth-panel .field-hint {
  color: var(--muted-dark);
}
.auth-panel .label-row {
  align-items: center;
}
.auth-panel .input-wrap input {
  height: 52px;
  border-color: rgba(28, 49, 39, 0.14);
  background: rgba(255, 252, 244, 0.76);
  color: var(--ink);
  border-radius: 12px;
}
.auth-panel .input-wrap input::placeholder {
  color: rgba(21, 37, 31, 0.3);
}
.auth-panel .input-wrap .input-icon {
  color: rgba(21, 37, 31, 0.34);
}
.auth-panel .input-wrap input:focus {
  border-color: rgba(47, 107, 94, 0.55);
  background: #fffdf7;
  box-shadow: 0 0 0 4px rgba(47, 107, 94, 0.08);
}
.auth-panel .input-action {
  color: rgba(21, 37, 31, 0.35);
}
.auth-panel .input-action:hover,
.auth-panel .input-action.is-on {
  color: var(--pine);
  background: rgba(47, 107, 94, 0.08);
}
.auth-panel .btn-primary {
  color: #fff8e9;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent 38%),
    linear-gradient(135deg, #b33d4b 0%, #992e3c 50%, #7c2230 100%);
  border-color: rgba(125, 33, 45, 0.35);
  box-shadow: 0 18px 34px -18px rgba(140, 40, 53, 0.7);
}
.auth-panel .btn-primary:hover {
  filter: brightness(1.04);
}
.auth-panel .btn-secondary {
  color: var(--ink);
  border-color: rgba(21, 37, 31, 0.18);
  background: rgba(255, 252, 244, 0.5);
}
.auth-panel .btn-secondary:hover {
  background: rgba(255, 252, 244, 0.9);
}
.auth-switch {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(21, 37, 31, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted-dark);
}
.auth-switch a {
  color: var(--red-deep);
  font-weight: 600;
  border-bottom: 1px solid rgba(140, 40, 53, 0.25);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.auth-switch a:hover {
  border-color: var(--red-deep);
}
.auth-privacy {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.6;
  color: rgba(21, 37, 31, 0.42);
}
.auth-privacy .icon {
  width: 12px;
  height: 12px;
}
.auth-panel .inline-note {
  color: var(--ink-soft);
  background: rgba(47, 107, 94, 0.06);
  border-color: rgba(47, 107, 94, 0.15);
}
.auth-panel .inline-note strong {
  color: var(--ink);
}
.auth-panel .inline-note.warm {
  background: rgba(178, 58, 72, 0.05);
  border-color: rgba(178, 58, 72, 0.15);
}

/* -------------------------------------------------------------------------
   Page shell
   ------------------------------------------------------------------------- */
.page-main {
  padding: 40px 0 90px;
}
.page-shell {
  width: min(100% - 56px, 1240px);
  margin: 0 auto;
}
.page-heading {
  margin-bottom: 34px;
}
.page-heading .eyebrow {
  margin-bottom: 12px;
}
.page-heading h1 {
  font-size: clamp(34px, 4vw, 52px);
  text-wrap: balance;
}
.page-heading .lede {
  margin-top: 12px;
}
.page-heading.split {
  align-items: flex-end;
}
.page-heading.split .btn {
  margin-bottom: 5px;
}

/* -------------------------------------------------------------------------
   Paper palettes and shapes
   ------------------------------------------------------------------------- */
.c-berry {
  --paper: #b23a48;
  --paper-deep: #8c2936;
  --paper-ink: #fff5e4;
  --paper-line: rgba(255, 245, 228, 0.19);
  --paper-tape: rgba(244, 223, 181, 0.55);
  --paper-shadow: rgba(116, 26, 39, 0.55);
}
.c-pine {
  --paper: #2f6b5e;
  --paper-deep: #1f4d42;
  --paper-ink: #fff7e7;
  --paper-line: rgba(255, 247, 231, 0.16);
  --paper-tape: rgba(239, 218, 174, 0.5);
  --paper-shadow: rgba(15, 55, 44, 0.55);
}
.c-gold {
  --paper: #d9b264;
  --paper-deep: #b38b3e;
  --paper-ink: #412f15;
  --paper-line: rgba(77, 57, 24, 0.18);
  --paper-tape: rgba(255, 249, 230, 0.52);
  --paper-shadow: rgba(86, 61, 20, 0.45);
}
.c-cream {
  --paper: #f2e4c6;
  --paper-deep: #dfcca7;
  --paper-ink: #463626;
  --paper-line: rgba(78, 59, 39, 0.16);
  --paper-tape: rgba(255, 253, 245, 0.65);
  --paper-shadow: rgba(58, 43, 26, 0.35);
}
.c-rose {
  --paper: #e6b6b6;
  --paper-deep: #d39799;
  --paper-ink: #542d35;
  --paper-line: rgba(86, 44, 53, 0.16);
  --paper-tape: rgba(255, 249, 241, 0.55);
  --paper-shadow: rgba(92, 45, 52, 0.35);
}
.c-frost {
  --paper: #bdd7d4;
  --paper-deep: #99beba;
  --paper-ink: #1e3c41;
  --paper-line: rgba(30, 60, 65, 0.16);
  --paper-tape: rgba(250, 255, 252, 0.5);
  --paper-shadow: rgba(25, 68, 67, 0.35);
}
.c-plum {
  --paper: #6d4c70;
  --paper-deep: #543757;
  --paper-ink: #fff3e9;
  --paper-line: rgba(255, 243, 233, 0.17);
  --paper-tape: rgba(239, 218, 174, 0.46);
  --paper-shadow: rgba(51, 30, 55, 0.55);
}
.c-cocoa {
  --paper: #8b5a45;
  --paper-deep: #6d422f;
  --paper-ink: #fff4e5;
  --paper-line: rgba(255, 244, 229, 0.16);
  --paper-tape: rgba(239, 218, 174, 0.45);
  --paper-shadow: rgba(57, 33, 22, 0.5);
}
.c-berry,
.c-pine,
.c-gold,
.c-cream,
.c-rose,
.c-frost,
.c-plum,
.c-cocoa {
  background-color: var(--paper);
  color: var(--paper-ink);
}
.shape-classic {
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 100%, 0 100%);
}
.shape-round {
  border-radius: 50%;
}
.shape-heart {
  clip-path: polygon(50% 100%, 7% 58%, 2% 39%, 8% 20%, 23% 8%, 38% 10%, 50% 23%, 62% 10%, 77% 8%, 92% 20%, 98% 39%, 93% 58%);
}
.shape-star {
  clip-path: polygon(50% 0%, 61% 34%, 97% 35%, 68% 57%, 79% 92%, 50% 71%, 21% 92%, 32% 57%, 3% 35%, 39% 34%);
}
.shape-tag {
  border-radius: 4px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 60% 100%, 57% 90%, 43% 90%, 40% 100%, 0 100%);
}
.note-paper {
  position: relative;
  background-color: var(--paper);
  color: var(--paper-ink);
  background-image:
    linear-gradient(155deg, rgba(255, 255, 255, 0.09), transparent 48%),
    repeating-linear-gradient(
      to bottom,
      transparent 0 calc(var(--line-height, 28px) - 1px),
      var(--paper-line) calc(var(--line-height, 28px) - 1px) var(--line-height, 28px)
    );
  box-shadow:
    0 24px 42px -24px var(--paper-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.paper-tape,
.note-tape {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 36%;
  height: 15px;
  transform: translateX(-50%) rotate(-1.6deg);
  background: var(--paper-tape);
  border-left: 1px dashed rgba(255, 255, 255, 0.3);
  border-right: 1px dashed rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(40, 24, 10, 0.1);
  z-index: 2;
  backdrop-filter: blur(1px);
}
.paper-content {
  position: relative;
  z-index: 1;
  font-family: var(--note-font, var(--font-hand));
  font-size: var(--note-size, 18px);
  font-weight: var(--note-weight, 400);
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.paper-signature {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  font-family: var(--font-hand);
  font-size: 12px;
  opacity: 0.72;
}

/* -------------------------------------------------------------------------
   Pair page
   ------------------------------------------------------------------------- */
.pair-page .page-heading.centered {
  margin-bottom: 38px;
}
.couple-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 42px 40px 30px;
  overflow: hidden;
  margin-bottom: 26px;
}
.couple-hero::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  left: 50%;
  top: -360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(216, 178, 106, 0.16), transparent 65%);
  pointer-events: none;
}
.couple-orbit {
  position: absolute;
  width: 460px;
  height: 230px;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(216, 178, 106, 0.1);
  border-radius: 50%;
  pointer-events: none;
}
.couple-orbit::before,
.couple-orbit::after {
  content: "";
  position: absolute;
  inset: 28px -46px;
  border: 1px solid rgba(216, 178, 106, 0.06);
  border-radius: 50%;
}
.couple-orbit::after {
  inset: -28px -88px;
  border-style: dashed;
  border-color: rgba(216, 178, 106, 0.05);
}
.couple-portrait {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.portrait-ring {
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  padding: 7px;
  border: 1px solid rgba(216, 178, 106, 0.32);
  background: rgba(7, 27, 21, 0.55);
  box-shadow:
    0 0 0 8px rgba(216, 178, 106, 0.035),
    0 24px 44px -24px rgba(0, 0, 0, 0.8);
}
.portrait-ring::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(216, 178, 106, 0.16);
}
.portrait-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.couple-portrait h2 {
  font-size: 23px;
  margin-top: 17px;
  color: var(--cream);
}
.couple-heart {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}
.couple-heart .icon {
  width: 30px;
  height: 30px;
  color: var(--rose);
  filter: drop-shadow(0 5px 12px rgba(178, 58, 72, 0.25));
}
.couple-heart span {
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: rgba(247, 240, 223, 0.42);
  white-space: nowrap;
}
.couple-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
  position: relative;
  z-index: 2;
}
.pair-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 24px;
}
.dashboard-grid {
  display: grid;
  gap: 24px;
}
.certificate-preview-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.certificate-thumb {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(216, 178, 106, 0.3);
  background: #0a211a;
  box-shadow: 0 22px 40px -28px #000;
  transition: transform 0.3s var(--ease);
}
.certificate-thumb:hover {
  transform: translateY(-2px);
}
.certificate-thumb img {
  width: 100%;
  aspect-ratio: 1200 / 760;
  object-fit: cover;
}
.certificate-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  flex-wrap: wrap;
}
.certificate-meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-size: 11.5px;
  letter-spacing: 0;
}
.certificate-meta a .icon {
  width: 13px;
  height: 13px;
}
.pair-side-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mini-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  overflow: hidden;
}
.mini-stat {
  padding: 26px 26px 24px;
  position: relative;
}
.mini-stat + .mini-stat {
  border-left: 1px solid rgba(235, 216, 175, 0.1);
}
.mini-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold-bright);
  margin: 6px 0 10px;
}
.mini-label {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.mini-stat > span:last-child {
  font-size: 11px;
  color: rgba(247, 240, 223, 0.42);
}
.invite-mini-card {
  padding: 24px 26px;
}
.qr-inline {
  display: flex;
  align-items: center;
  gap: 18px;
}
.qr-image {
  width: 148px;
  height: 148px;
  border-radius: 13px;
  background: var(--paper);
  padding: 8px;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.62);
}
.qr-image.small {
  width: 92px;
  height: 92px;
  padding: 6px;
  border-radius: 10px;
}
.qr-username {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--cream);
  margin: 5px 0 9px;
  word-break: break-all;
}
.qr-inline > div {
  min-width: 0;
}
.quiet-card {
  display: flex;
  gap: 15px;
  padding: 23px 25px;
  align-items: flex-start;
}
.quiet-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(216, 178, 106, 0.08);
  border: 1px solid rgba(216, 178, 106, 0.16);
  color: var(--gold);
  display: grid;
  place-items: center;
  flex: none;
}
.quiet-icon .icon {
  width: 17px;
  height: 17px;
}
.quiet-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.quiet-card p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.pairing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 24px;
  align-items: start;
}
.pairing-form-card {
  padding: 32px;
}
.step-badge {
  font-family: var(--font-display);
  font-size: 26px;
  color: rgba(216, 178, 106, 0.32);
  line-height: 1;
}
.pair-form {
  padding: 22px;
  border-radius: 18px;
  background: rgba(5, 22, 17, 0.3);
  border: 1px solid rgba(235, 216, 175, 0.1);
}
.input-with-button {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.input-with-button .input-wrap {
  flex: 1;
}
.input-with-button .btn {
  flex: none;
}
.request-block {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
}
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.count-dot {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.request-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.request-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(247, 240, 223, 0.035);
  transition: border-color 0.2s;
}
.request-card:hover {
  border-color: rgba(216, 178, 106, 0.28);
}
.request-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.request-copy strong {
  font-size: 13px;
  color: var(--cream);
}
.request-copy span {
  font-size: 11px;
  color: var(--muted);
}
.request-actions {
  display: flex;
  gap: 5px;
  flex: none;
}
.request-card.compact {
  padding: 10px 13px;
}
.muted-block .request-card {
  opacity: 0.75;
}
.pairing-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.qr-card {
  padding: 30px;
  text-align: center;
}
.qr-card-head {
  margin-bottom: 21px;
}
.qr-card-head .eyebrow {
  justify-content: center;
}
.qr-card-head h2 {
  font-size: 28px;
  margin-bottom: 8px;
}
.qr-card-head h3 {
  font-size: 22px;
}
.qr-card-head p {
  font-size: 11.5px;
  color: var(--muted);
}
.qr-frame {
  position: relative;
  width: 214px;
  height: 214px;
  margin: 0 auto 16px;
  padding: 15px;
  border-radius: 17px;
  background: #f8f0dd;
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.8);
}
.qr-frame.compact {
  width: 148px;
  height: 148px;
  padding: 9px;
  margin-bottom: 12px;
}
.qr-frame .qr-image {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 5px;
  box-shadow: none;
  background: transparent;
}
.qr-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.65;
}
.qr-corner.tl {
  top: -6px;
  left: -6px;
  border-width: 1px 0 0 1px;
}
.qr-corner.tr {
  top: -6px;
  right: -6px;
  border-width: 1px 1px 0 0;
}
.qr-corner.bl {
  bottom: -6px;
  left: -6px;
  border-width: 0 0 1px 1px;
}
.qr-corner.br {
  bottom: -6px;
  right: -6px;
  border-width: 0 1px 1px 0;
}
.qr-card .qr-username {
  font-size: 18px;
  margin: 0 0 14px;
}
.qr-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Profile
   ------------------------------------------------------------------------- */
.profile-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.profile-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 96px;
}
.identity-card {
  padding: 32px 26px 26px;
  text-align: center;
}
.profile-avatar-wrap {
  position: relative;
  width: 154px;
  height: 154px;
  margin: 0 auto 18px;
}
.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(216, 178, 106, 0.35);
  padding: 5px;
  background: rgba(7, 27, 21, 0.6);
  box-shadow: 0 24px 44px -26px rgba(0, 0, 0, 0.8);
}
.profile-avatar.is-uploading {
  opacity: 0.6;
}
.avatar-edit-btn {
  position: absolute;
  right: 3px;
  bottom: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(216, 178, 106, 0.35);
  background: var(--red);
  color: #fff7e8;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px -7px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s;
}
.avatar-edit-btn:hover {
  transform: scale(1.06);
}
.avatar-edit-btn .icon {
  width: 16px;
  height: 16px;
}
.profile-name {
  font-size: 30px;
  word-break: break-all;
}
.identity-card .role-badge {
  margin-top: 8px;
}
.identity-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
  font-size: 10.5px;
  color: var(--muted);
}
.avatar-actions {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}
.identity-card .field-hint {
  margin-top: 12px;
}
.profile-stat-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
}
.profile-stat-card > div {
  padding: 22px;
  text-align: center;
}
.profile-stat-card > div + div {
  border-left: 1px solid rgba(235, 216, 175, 0.1);
}
.profile-stat-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  color: var(--gold-bright);
  line-height: 1.1;
}
.profile-stat-card span {
  font-size: 10px;
  color: var(--muted);
}
.compact-qr {
  padding: 22px;
  text-align: center;
}
.compact-qr .qr-card-head {
  margin-bottom: 12px;
}
.compact-qr .qr-card-head h3 {
  font-size: 18px;
}
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-card,
.relationship-card,
.danger-zone {
  padding: 30px 32px;
}
.settings-form .btn {
  align-self: flex-start;
}
.relationship-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(5, 22, 17, 0.28);
  border: 1px solid var(--line);
}
.relationship-row > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.relationship-row strong {
  font-size: 13.5px;
  color: var(--cream);
}
.relationship-row span {
  font-size: 11px;
  color: var(--muted);
}
.relationship-row.empty {
  border-style: dashed;
}
.danger-zone {
  border-color: rgba(217, 107, 112, 0.2);
  background:
    linear-gradient(155deg, rgba(86, 34, 41, 0.2), rgba(11, 32, 25, 0.62)),
    rgba(10, 30, 23, 0.4);
}
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.danger-row strong {
  font-size: 14px;
}
.danger-row p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 660px;
  margin-top: 4px;
}

/* -------------------------------------------------------------------------
   Invite page
   ------------------------------------------------------------------------- */
.invite-shell {
  display: flex;
  justify-content: center;
}
.invite-stage {
  width: 100%;
  max-width: 640px;
  position: relative;
  padding: 20px 0 30px;
}
.invite-aurora {
  position: absolute;
  width: 700px;
  height: 480px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(216, 178, 106, 0.12), transparent 65%);
  pointer-events: none;
}
.invite-card {
  position: relative;
  padding: 38px 44px 42px;
  text-align: center;
}
.back-link {
  position: absolute;
  top: 24px;
  left: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.back-link:hover {
  color: var(--cream);
}
.back-link .icon {
  width: 14px;
  height: 14px;
}
.invite-card > .eyebrow {
  justify-content: center;
  margin-top: 16px;
}
.invite-avatar-ring {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 12px auto 20px;
  padding: 6px;
  border-radius: 50%;
  border: 1px solid rgba(216, 178, 106, 0.3);
  box-shadow: 0 0 0 9px rgba(216, 178, 106, 0.035);
}
.invite-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.invite-spark {
  position: absolute;
  right: 0;
  top: 0;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 13px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
}
.invite-card h1 {
  font-size: 42px;
  margin-bottom: 10px;
  word-break: break-all;
}
.invite-lede {
  font-size: 12px;
  color: var(--muted);
}
.invite-question {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-bright);
  margin: 30px 0 18px;
}
.invite-form {
  margin-bottom: 14px;
}
.invite-card .inline-note {
  text-align: left;
  margin-top: 28px;
}
.invite-card .btn-block + .btn-block {
  margin-top: 10px;
}
.invite-aside {
  text-align: center;
  margin-top: 30px;
}
.quiet-rule {
  width: 46px;
  height: 1px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.invite-aside p {
  font-family: var(--font-hand);
  font-size: 15px;
  color: rgba(247, 240, 223, 0.52);
  line-height: 1.8;
}
.invite-aside span {
  display: block;
  margin-top: 10px;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: rgba(216, 178, 106, 0.45);
}

/* -------------------------------------------------------------------------
   Certificate page
   ------------------------------------------------------------------------- */
.welcome-ribbon {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: 15px;
  color: #33240f;
  background: linear-gradient(120deg, #f1ddad, #d6b268 60%, #f3e2b7);
  box-shadow: 0 18px 38px -24px rgba(216, 178, 106, 0.7);
}
.welcome-spark {
  font-size: 20px;
  color: #7a5220;
}
.welcome-ribbon div {
  display: flex;
  flex-direction: column;
}
.welcome-ribbon strong {
  font-size: 13px;
}
.welcome-ribbon span {
  font-size: 10.5px;
  color: rgba(51, 36, 15, 0.65);
}
.certificate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 28px;
  align-items: start;
}
.certificate-frame {
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(140deg, rgba(216, 178, 106, 0.28), rgba(216, 178, 106, 0.08));
  border: 1px solid rgba(216, 178, 106, 0.28);
  box-shadow: var(--shadow-lg);
}
.certificate-frame-inner {
  border-radius: 16px;
  overflow: hidden;
  background: #0a211a;
}
.certificate-frame-inner img {
  width: 100%;
  display: block;
}
.certificate-frame-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 5px 2px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: rgba(216, 178, 106, 0.6);
}
.certificate-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.certificate-actions-card {
  padding: 28px;
}
.certificate-actions-card h2 {
  font-size: 26px;
  margin-bottom: 10px;
}
.certificate-actions-card > p.muted {
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.stacked-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.certificate-facts {
  padding: 12px 24px;
}
.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(235, 216, 175, 0.08);
  font-size: 11.5px;
}
.fact-row:last-child {
  border-bottom: 0;
}
.fact-row > span:first-child {
  color: var(--muted);
  flex: none;
}
.fact-row code,
.fact-row strong {
  font-size: 11px;
  color: var(--gold-bright);
  text-align: right;
  word-break: break-all;
}

/* -------------------------------------------------------------------------
   The tree
   ------------------------------------------------------------------------- */
.tree-main {
  padding: 0 28px 18px;
  min-height: calc(100dvh - 72px);
}
.tree-page {
  width: min(100%, 1560px);
  min-height: calc(100dvh - 90px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.admin-view-banner {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(216, 178, 106, 0.22);
  background: rgba(216, 178, 106, 0.08);
  font-size: 11.5px;
  color: rgba(247, 240, 223, 0.68);
}
.admin-view-banner > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-view-banner .icon {
  width: 15px;
  height: 15px;
  color: var(--gold);
}
.admin-view-banner strong {
  color: var(--cream);
}
.admin-view-banner a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  flex: none;
}
.admin-view-banner a .icon {
  width: 12px;
  height: 12px;
}
.tree-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 13px 18px;
  margin-top: 13px;
  border-radius: 20px;
  border: 1px solid rgba(235, 216, 175, 0.11);
  background: linear-gradient(100deg, rgba(16, 44, 35, 0.62), rgba(8, 27, 21, 0.45));
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -34px rgba(0, 0, 0, 0.8);
}
.tree-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tree-avatars {
  display: flex;
  align-items: center;
  flex: none;
}
.tree-avatars .avatar {
  border: 1px solid rgba(216, 178, 106, 0.35);
}
.tree-avatars .avatar + .avatar-join {
  margin-left: -5px;
}
.tree-avatars .avatar-join {
  width: 18px;
  height: 18px;
  margin-left: -4px;
  margin-right: -4px;
  z-index: 2;
}
.tree-avatars .avatar-join .icon {
  width: 9px;
  height: 9px;
}
.tree-identity-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tree-identity-copy strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-identity-copy strong span {
  color: var(--gold);
  font-style: italic;
  padding: 0 2px;
}
.tree-identity-copy > span {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.month-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 14px;
  border: 1px solid rgba(235, 216, 175, 0.12);
  background: rgba(5, 21, 16, 0.45);
}
.month-arrow {
  width: 34px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(247, 240, 223, 0.55);
  display: grid;
  place-items: center;
  transition:
    color 0.2s,
    background 0.2s;
}
.month-arrow:hover:not(:disabled) {
  color: var(--cream);
  background: rgba(247, 240, 223, 0.07);
}
.month-arrow:disabled {
  opacity: 0.22;
}
.month-arrow .icon {
  width: 15px;
  height: 15px;
}
.month-display {
  min-width: 152px;
  border: 0;
  background: transparent;
  padding: 3px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: var(--cream);
  border-radius: 10px;
  transition: background 0.2s;
}
.month-display:hover {
  background: rgba(216, 178, 106, 0.08);
}
.month-main {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.month-sub {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(216, 178, 106, 0.62);
}
.tree-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tree-actions .toolbar-btn {
  --btn-y: 9px;
  padding-left: 16px;
  padding-right: 17px;
  font-size: 12px;
}
.tree-actions .toolbar-btn .icon {
  width: 15px;
  height: 15px;
}

.tree-scene {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 540px;
  padding: 0 0 2px;
}
.scene-aura {
  position: absolute;
  width: min(680px, 76vw);
  aspect-ratio: 1;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 178, 106, 0.13) 0%, rgba(47, 107, 94, 0.08) 38%, transparent 68%);
  filter: blur(15px);
  pointer-events: none;
}
.tree-stage {
  position: relative;
  width: min(560px, 47vw, calc((100dvh - 250px) * 0.826));
  aspect-ratio: 760 / 920;
  margin: 0;
  flex: none;
  transition: opacity 0.25s;
}
.tree-stage.is-loading {
  opacity: 0.65;
}
.tree-illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 34px 60px rgba(0, 0, 0, 0.38));
}
.tree-string-lights {
  display: none;
}
.tree-notes-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.tree-note {
  position: absolute;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  background-color: var(--paper);
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 50%),
    repeating-linear-gradient(to bottom, transparent 0 5px, var(--paper-line) 5px 6px);
  color: var(--paper-ink);
  filter: drop-shadow(0 6px 5px rgba(2, 12, 8, 0.45));
  transition:
    transform 0.24s var(--ease),
    filter 0.24s,
    z-index 0s;
  animation: note-pop 0.5s var(--ease) var(--note-delay, 0s) both;
  cursor: pointer;
  overflow: hidden;
}
.tree-note:hover,
.tree-note:focus-visible {
  transform: translate(-50%, -50%) rotate(0deg) scale(1.22);
  filter: drop-shadow(0 10px 9px rgba(2, 12, 8, 0.55)) brightness(1.06);
  z-index: 30;
}
.tree-note:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.tree-note .note-tape {
  top: -3px;
  width: 46%;
  height: 18%;
  border: 0;
  opacity: 0.8;
}
.tree-note .note-mini {
  position: relative;
  z-index: 1;
  font-family: var(--font-kai, var(--font-hand));
  line-height: 1;
  opacity: 0.82;
  transform: translateY(3%);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tree-note .note-pin {
  position: absolute;
  top: 10%;
  right: 12%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.47);
}
.shape-heart.tree-note .note-mini,
.shape-star.tree-note .note-mini {
  transform: translateY(7%);
}
@keyframes note-pop {
  from {
    opacity: 0;
    scale: 0.55;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
.tree-empty {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  width: min(300px, 68%);
  text-align: center;
  padding: 26px 24px 22px;
  border-radius: 20px;
  border: 1px solid rgba(216, 178, 106, 0.2);
  background: rgba(7, 27, 21, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 25px 50px -24px rgba(0, 0, 0, 0.75);
}
.tree-empty[hidden] {
  display: none;
}
.tree-empty .empty-spark {
  color: var(--gold);
  font-size: 17px;
}
.tree-empty h2 {
  font-size: 23px;
  margin: 6px 0 6px;
}
.tree-empty p {
  font-size: 11px;
  line-height: 1.65;
  color: rgba(247, 240, 223, 0.55);
  margin-bottom: 14px;
}
.tree-empty .btn {
  margin: 3px;
}
.tree-loading {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 5px;
  padding: 10px 14px;
  border-radius: 99px;
  background: rgba(7, 27, 21, 0.8);
  border: 1px solid var(--line);
}
.tree-loading[hidden] {
  display: none;
}
.tree-loading span,
.stats-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: loading-dot 1s ease-in-out infinite;
}
.tree-loading span:nth-child(2),
.stats-loading span:nth-child(2) {
  animation-delay: 0.15s;
}
.tree-loading span:nth-child(3),
.stats-loading span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes loading-dot {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
.tree-sidecopy {
  position: absolute;
  right: max(1%, calc((100vw - 1320px) / 2));
  top: 26%;
  width: 205px;
  pointer-events: none;
}
.tree-quote {
  font-family: var(--font-hand);
  font-size: 18px;
  line-height: 1.8;
  color: rgba(247, 240, 223, 0.42);
  text-align: right;
}
.tree-month-stamp {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(216, 178, 106, 0.18);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.tree-month-stamp span {
  font-size: 8px;
  letter-spacing: 0.22em;
  color: rgba(216, 178, 106, 0.55);
}
.tree-month-stamp strong {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 400;
  color: rgba(216, 178, 106, 0.32);
  margin: 6px 0 3px;
}
.tree-month-stamp small {
  font-size: 9px;
  letter-spacing: 0.34em;
  color: rgba(247, 240, 223, 0.32);
}
.tree-count-chip {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-end;
  color: rgba(247, 240, 223, 0.42);
}
.tree-count-chip strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--gold-bright);
}
.tree-count-chip span {
  font-size: 9px;
  letter-spacing: 0.08em;
}
.tree-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 9px 6px 2px;
  border-top: 1px solid rgba(235, 216, 175, 0.08);
  font-size: 10.5px;
  color: rgba(247, 240, 223, 0.38);
}
.tree-footer-left,
.tree-footer-right {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 178, 106, 0.1);
  flex: none;
}
.tree-footer-right {
  justify-content: flex-end;
  text-align: right;
}
.tree-footer-right span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tree-footer-right .icon {
  width: 12px;
  height: 12px;
  color: rgba(216, 178, 106, 0.65);
}
.footer-divider {
  width: 1px;
  height: 11px;
  background: rgba(235, 216, 175, 0.16);
}

/* -------------------------------------------------------------------------
   Month picker
   ------------------------------------------------------------------------- */
.modal-month {
  width: min(100%, 540px);
}
.month-card {
  padding: 34px;
}
.month-card h2 {
  font-size: 30px;
  margin-bottom: 8px;
}
.month-card .modal-lede {
  margin-bottom: 22px;
}
.year-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.year-switch strong {
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 500;
  color: var(--gold-bright);
  min-width: 92px;
  text-align: center;
}
.year-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.year-arrow:hover:not(:disabled) {
  color: var(--cream);
  border-color: var(--line-strong);
  background: rgba(247, 240, 223, 0.05);
}
.year-arrow:disabled {
  opacity: 0.25;
}
.year-arrow .icon {
  width: 14px;
  height: 14px;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.month-cell {
  position: relative;
  height: 52px;
  border-radius: 11px;
  border: 1px solid rgba(235, 216, 175, 0.1);
  background: rgba(5, 22, 17, 0.32);
  color: rgba(247, 240, 223, 0.6);
  font-family: var(--font-display);
  font-size: 17px;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}
.month-cell:hover:not(:disabled) {
  border-color: rgba(216, 178, 106, 0.35);
  color: var(--cream);
  background: rgba(216, 178, 106, 0.06);
}
.month-cell.is-active {
  color: #2d1f0e;
  background: linear-gradient(135deg, #f1ddad, #d5af63);
  border-color: rgba(246, 226, 178, 0.8);
  font-weight: 600;
}
.month-cell.is-current::after {
  content: "";
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%);
}
.month-cell.is-active::after {
  background: #7c2230;
}
.month-cell:disabled {
  opacity: 0.18;
}
.month-today {
  display: flex;
  margin: 18px auto 0;
}

/* -------------------------------------------------------------------------
   Composer
   ------------------------------------------------------------------------- */
dialog.modal-composer {
  width: min(100%, 1160px);
}
.composer-card {
  padding: 30px 34px 26px;
}
.composer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 40px;
  margin-bottom: 24px;
}
.composer-head h2 {
  font-size: 35px;
}
.composer-month {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 10px;
  color: var(--gold-bright);
  background: rgba(216, 178, 106, 0.08);
  border: 1px solid rgba(216, 178, 106, 0.18);
  white-space: nowrap;
  margin-top: 7px;
}
.composer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: 34px;
  align-items: start;
}
.composer-fields {
  display: flex;
  flex-direction: column;
  gap: 21px;
}
.char-count {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.textarea-paper {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  background-color: #f7ecd3;
  background-image:
    linear-gradient(155deg, rgba(255, 255, 255, 0.25), transparent 55%),
    repeating-linear-gradient(to bottom, transparent 0 27px, rgba(92, 68, 39, 0.16) 27px 28px);
  border: 1px solid rgba(216, 178, 106, 0.28);
  box-shadow: inset 0 2px 8px rgba(73, 48, 20, 0.08);
}
.textarea-paper .paper-margin {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px;
  width: 1px;
  background: rgba(178, 58, 72, 0.26);
  pointer-events: none;
}
.textarea-paper textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 206px;
  padding: 11px 19px 12px 44px;
  border: 0;
  background: transparent;
  color: #3e3021;
  font-family: var(--font-hand);
  font-size: 18px;
  line-height: 28px;
  resize: vertical;
  box-shadow: none;
}
.textarea-paper textarea:focus {
  outline: none;
  box-shadow: none;
}
.textarea-paper textarea::placeholder {
  color: rgba(62, 48, 33, 0.35);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.choice-group legend {
  margin-bottom: 10px;
}
.shape-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.shape-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.shape-option input,
.color-option input,
.font-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.shape-swatch {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.08);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.25));
  transition:
    transform 0.2s,
    outline-color 0.2s;
  outline: 2px solid transparent;
  outline-offset: 3px;
}
.shape-swatch i {
  width: 35%;
  height: 2px;
  background: currentColor;
  opacity: 0.2;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}
.shape-option:hover .shape-swatch {
  transform: translateY(-2px);
}
.shape-option input:checked + .shape-swatch {
  outline-color: var(--gold);
}
.choice-label {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.shape-option input:checked ~ .choice-label {
  color: var(--gold-bright);
}
.color-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.color-option {
  cursor: pointer;
  padding: 3px;
  border-radius: 50%;
}
.color-dot {
  display: block;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.2);
  transition: transform 0.2s;
}
.color-option:hover .color-dot {
  transform: scale(1.1);
}
.color-option input:checked + .color-dot {
  box-shadow:
    0 0 0 2px var(--bg-3),
    0 0 0 4px var(--gold);
}
.font-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(235, 216, 175, 0.11);
  background: rgba(5, 22, 17, 0.32);
}
.font-option {
  cursor: pointer;
  text-align: center;
}
.font-option > span {
  display: block;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 14px;
  color: rgba(247, 240, 223, 0.55);
  transition:
    background 0.2s,
    color 0.2s;
}
.font-option:hover > span {
  color: var(--cream);
}
.font-option input:checked + span {
  background: rgba(216, 178, 106, 0.14);
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(216, 178, 106, 0.2);
}
.type-controls {
  display: flex;
  align-items: flex-end;
  gap: 32px;
}
.range-field {
  flex: 1;
}
.range-field label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(247, 240, 223, 0.7);
  margin-bottom: 9px;
}
.range-field output {
  color: var(--gold-bright);
  font-family: "Cascadia Mono", monospace;
}
input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(235, 216, 175, 0.18);
  appearance: none;
  accent-color: var(--gold);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid var(--bg-2);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid var(--bg-2);
  cursor: pointer;
}
.type-controls .switch-field {
  padding-bottom: 1px;
  flex: none;
}
.composer-preview {
  position: sticky;
  top: 0;
  padding-top: 4px;
}
.preview-caption {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.17em;
  color: rgba(216, 178, 106, 0.52);
  margin-bottom: 14px;
}
.note-paper.preview {
  width: 100%;
  min-height: 380px;
  padding: 44px 38px 32px;
  transform: rotate(-1.15deg);
  display: flex;
  flex-direction: column;
  --line-height: 30px;
  transition:
    background-color 0.25s,
    clip-path 0.25s;
}
.note-paper.preview.shape-classic {
  border-radius: 6px;
}
.note-paper.preview.shape-heart,
.note-paper.preview.shape-star {
  padding: 68px 58px 54px;
  min-height: 420px;
}
.note-paper.preview.shape-star {
  padding: 85px 62px 65px;
}
.note-paper.preview.shape-round {
  padding: 58px 56px 48px;
  min-height: 420px;
}
.note-paper.preview .paper-content {
  flex: 1;
  font-family: var(--note-font, var(--font-hand));
  font-size: var(--note-size, 18px);
  font-weight: var(--note-weight, 400);
  line-height: 1.65;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.note-paper.preview .placeholder {
  opacity: 0.36;
  font-family: var(--font-hand);
}
.note-paper.preview .paper-signature {
  color: var(--paper-ink);
  opacity: 0.58;
  font-size: 11px;
  margin-top: 16px;
}
.preview-tip {
  display: flex;
  gap: 6px;
  margin-top: 15px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
.preview-tip .icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
  flex: none;
  margin-top: 1px;
}
.composer-actions {
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
}
.composer-actions > div {
  display: flex;
  gap: 8px;
}
.composer-status {
  font-size: 10.5px;
  color: var(--muted);
}

/* -------------------------------------------------------------------------
   Note detail
   ------------------------------------------------------------------------- */
dialog.modal-note {
  width: min(100%, 820px);
}
.note-detail-card {
  padding: 28px 30px 24px;
}
.note-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-right: 36px;
  margin-bottom: 22px;
}
.note-author-block {
  display: flex;
  align-items: center;
  gap: 12px;
}
.note-author-block strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--cream);
}
.note-detail-date {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.note-paper.detail-paper {
  --line-height: calc(var(--note-size) * 1.72);
  min-height: 320px;
  padding: 46px 56px 32px;
  display: flex;
  flex-direction: column;
}
/* A note unfolds into readable letter paper.  The chosen silhouette becomes
   a watermark instead of clipping the writing. */
.detail-paper.shape-heart,
.detail-paper.shape-star,
.detail-paper.shape-round {
  clip-path: none;
  border-radius: 13px;
  min-height: 360px;
  padding: 46px 56px 32px;
}
.detail-paper.shape-heart::before,
.detail-paper.shape-star::before,
.detail-paper.shape-round::before {
  content: "";
  position: absolute;
  right: 26px;
  bottom: 20px;
  width: 168px;
  height: 168px;
  background: var(--paper-deep);
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
}
.detail-paper.shape-heart::before {
  clip-path: polygon(50% 100%, 7% 58%, 2% 39%, 8% 20%, 23% 8%, 38% 10%, 50% 23%, 62% 10%, 77% 8%, 92% 20%, 98% 39%, 93% 58%);
}
.detail-paper.shape-star::before {
  width: 190px;
  height: 190px;
  clip-path: polygon(50% 0%, 61% 34%, 97% 35%, 68% 57%, 79% 92%, 50% 71%, 21% 92%, 32% 57%, 3% 35%, 39% 34%);
}
.detail-paper.shape-round::before {
  border-radius: 50%;
}
.detail-paper .paper-content {
  flex: 1;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}
.detail-paper .paper-content::-webkit-scrollbar-thumb {
  background: var(--paper-deep);
  background-clip: padding-box;
}
.note-detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.note-detail-meta > div {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
}
.note-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.note-detail-meta .icon {
  width: 12px;
  height: 12px;
  color: rgba(216, 178, 106, 0.65);
}
.note-location {
  color: rgba(216, 178, 106, 0.7);
}
.note-mine-tag,
.note-shape-tag {
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1;
  border: 1px solid var(--line);
  color: var(--muted);
}
.note-mine-tag {
  color: var(--gold-bright);
  border-color: rgba(216, 178, 106, 0.25);
  background: rgba(216, 178, 106, 0.08);
}
.note-mine-tag.admin {
  color: #e8b2b4;
  border-color: rgba(217, 107, 112, 0.25);
  background: rgba(178, 58, 72, 0.08);
}
.note-edited {
  color: rgba(247, 240, 223, 0.4);
}
.note-edited .icon {
  width: 10px;
  height: 10px;
}
.permission-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 10.5px;
  color: var(--muted);
}
.permission-note .icon {
  width: 12px;
  height: 12px;
}
.permission-note.admin {
  color: rgba(216, 178, 106, 0.65);
}
.note-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
}
.note-detail-actions > div {
  display: flex;
  gap: 7px;
}
.note-detail-actions > div:empty {
  display: none;
}
.note-detail-actions:has(> div:empty) {
  justify-content: center;
}

/* -------------------------------------------------------------------------
   Statistics
   ------------------------------------------------------------------------- */
dialog.modal-stats {
  width: min(100%, 980px);
}
.stats-card {
  padding: 36px 38px;
}
.stats-loading {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.stats-head {
  margin-bottom: 24px;
  padding-right: 42px;
}
.stats-head h2 {
  font-size: 36px;
  margin-bottom: 6px;
}
.stats-head > p:last-child {
  font-size: 12px;
  color: var(--muted);
}
.stats-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 140px;
  gap: 20px;
  align-items: stretch;
  padding: 23px;
  border-radius: 18px;
  border: 1px solid rgba(216, 178, 106, 0.15);
  background:
    radial-gradient(circle at 5% 10%, rgba(216, 178, 106, 0.12), transparent 35%),
    rgba(5, 22, 17, 0.32);
}
.stats-total {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 20px;
  border-right: 1px solid rgba(235, 216, 175, 0.1);
}
.stats-total > span {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stats-total strong {
  font-family: var(--font-display);
  font-size: 68px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold-bright);
  margin: 5px 0 2px;
}
.stats-total small {
  font-size: 10px;
  color: var(--muted);
}
.stats-total-foot {
  margin-top: 9px;
  font-size: 9.5px;
  color: rgba(216, 178, 106, 0.65);
}
.stats-authors {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
}
.author-stat {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 11px;
}
.author-stat .avatar {
  width: 36px;
  height: 36px;
}
.author-stat-copy {
  display: flex;
  flex-direction: column;
}
.author-stat-copy strong {
  font-size: 12.5px;
  color: var(--cream);
}
.author-stat-copy span {
  font-size: 9.5px;
  color: var(--muted);
}
.author-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(247, 240, 223, 0.08);
  overflow: hidden;
}
.author-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--rose));
}
.author-stat:nth-child(2) .author-bar span {
  background: linear-gradient(90deg, var(--pine), var(--pine-light));
}
.stats-days {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-left: 1px solid rgba(235, 216, 175, 0.1);
  padding-left: 14px;
  text-align: center;
}
.stats-days > span {
  font-size: 9.5px;
  color: var(--muted);
}
.stats-days strong {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--cream);
  margin-top: 5px;
}
.stats-days small {
  font-size: 9px;
  color: var(--muted);
}
.stats-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(210px, 0.6fr);
  gap: 18px;
  margin-top: 18px;
}
.stats-chart-card {
  padding: 19px 20px 12px;
  border-radius: 16px;
  border: 1px solid rgba(235, 216, 175, 0.1);
  background: rgba(5, 22, 17, 0.22);
}
.stats-section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.stats-section-title h3 {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(247, 240, 223, 0.76);
}
.stats-section-title span {
  font-size: 9px;
  color: var(--muted);
}
.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 112px;
  padding-top: 6px;
  border-bottom: 1px solid rgba(235, 216, 175, 0.1);
}
.day-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  position: relative;
}
.day-bar > span {
  width: 100%;
  max-width: 16px;
  border-radius: 3px 3px 0 0;
  background: rgba(247, 240, 223, 0.07);
  transition: height 0.4s var(--ease);
}
.day-bar > span.has-notes {
  background: linear-gradient(180deg, var(--gold-bright), rgba(216, 178, 106, 0.35));
}
.day-bar small {
  height: 13px;
  font-size: 7.5px;
  color: rgba(247, 240, 223, 0.32);
}
.stats-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(235, 216, 175, 0.09);
  border: 1px solid rgba(235, 216, 175, 0.09);
}
.stats-facts > div {
  padding: 16px;
  background: rgba(8, 28, 21, 0.9);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stats-facts span {
  font-size: 9px;
  color: var(--muted);
}
.stats-facts strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--cream);
}
.stats-tags-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.stats-tags-grid h3 {
  font-family: var(--font-ui);
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.stat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.stat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 9.5px;
  color: rgba(247, 240, 223, 0.62);
  border: 1px solid rgba(235, 216, 175, 0.12);
  background: rgba(247, 240, 223, 0.03);
}
.stat-tag strong {
  color: var(--gold-bright);
  font-size: 10px;
}
.stats-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
  font-size: 9.5px;
  color: var(--muted);
}
.stats-empty {
  min-height: 330px;
}

/* -------------------------------------------------------------------------
   Admin
   ------------------------------------------------------------------------- */
.admin-main-wrap {
  padding: 18px 0 60px;
}
.admin-shell {
  width: min(100% - 44px, 1560px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 90px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(24, 60, 47, 0.62), rgba(7, 26, 20, 0.72)),
    rgba(8, 27, 21, 0.5);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  backdrop-filter: blur(14px);
}
.admin-sidebar-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(235, 216, 175, 0.09);
}
.admin-seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  background: rgba(216, 178, 106, 0.1);
  border: 1px solid rgba(216, 178, 106, 0.24);
  flex: none;
}
.admin-seal .icon {
  width: 17px;
  height: 17px;
}
.admin-sidebar-head > div {
  display: flex;
  flex-direction: column;
}
.admin-sidebar-head strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}
.admin-sidebar-head span {
  font-size: 7.5px;
  letter-spacing: 0.18em;
  color: rgba(216, 178, 106, 0.55);
}
.admin-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  color: rgba(247, 240, 223, 0.55);
  transition:
    color 0.2s,
    background 0.2s;
  position: relative;
}
.admin-nav a:hover {
  color: var(--cream);
  background: rgba(247, 240, 223, 0.045);
}
.admin-nav a.is-active {
  color: var(--cream);
  background: linear-gradient(90deg, rgba(216, 178, 106, 0.14), rgba(216, 178, 106, 0.03));
  box-shadow: inset 2px 0 0 var(--gold);
}
.admin-nav .icon {
  width: 16px;
  height: 16px;
  color: rgba(216, 178, 106, 0.65);
}
.admin-nav a.is-active .icon {
  color: var(--gold-bright);
}
.admin-sidebar-foot {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(235, 216, 175, 0.09);
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.admin-user > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-user strong {
  font-size: 11.5px;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-user span:not(.avatar) {
  font-size: 8.5px;
  color: var(--muted);
}
.admin-back-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  padding: 4px 0;
}
.admin-back-link:hover {
  color: var(--gold);
}
.admin-back-link .icon {
  width: 13px;
  height: 13px;
}
.admin-content {
  min-width: 0;
}
.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.admin-page-head h1 {
  font-size: clamp(30px, 3vw, 42px);
  margin-bottom: 6px;
}
.admin-page-head p:not(.eyebrow) {
  font-size: 12px;
  color: var(--muted);
}
.admin-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.admin-stat-card {
  position: relative;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(29, 67, 53, 0.42), rgba(9, 29, 22, 0.58)),
    rgba(8, 27, 21, 0.4);
  box-shadow: 0 24px 44px -38px #000;
  overflow: hidden;
}
.admin-stat-card.accent {
  background:
    radial-gradient(circle at 100% 0, rgba(216, 178, 106, 0.16), transparent 48%),
    linear-gradient(155deg, rgba(40, 80, 63, 0.5), rgba(9, 29, 22, 0.58));
  border-color: rgba(216, 178, 106, 0.22);
}
.stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  color: rgba(216, 178, 106, 0.38);
}
.stat-icon .icon {
  width: 20px;
  height: 20px;
}
.stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.admin-stat-card > strong {
  display: block;
  font-family: var(--font-display);
  font-size: 43px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--cream);
  margin: 7px 0 2px;
  word-break: break-all;
}
.admin-stat-card.accent > strong {
  color: var(--gold-bright);
}
.stat-foot {
  display: block;
  font-size: 9.5px;
  color: rgba(247, 240, 223, 0.36);
}
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-dashboard-grid.lower {
  margin-top: 0;
}
.admin-panel {
  padding: 24px;
}
.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-panel-head h2 {
  font-size: 23px;
  margin-bottom: 3px;
}
.admin-panel-head p {
  font-size: 10.5px;
  color: var(--muted);
}
.admin-list {
  display: flex;
  flex-direction: column;
}
.admin-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(235, 216, 175, 0.07);
}
.admin-list-row:last-child {
  border-bottom: 0;
}
.pair-mini-avatars {
  display: flex;
  flex: none;
}
.pair-mini-avatars .avatar + .avatar {
  margin-left: -7px;
}
.admin-row-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.admin-row-main strong {
  font-size: 12px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row-main span {
  font-size: 9.5px;
  color: var(--muted);
}
.recent-note-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border-radius: 11px;
  transition: background 0.2s;
}
.recent-note:hover {
  background: rgba(247, 240, 223, 0.04);
}
.mini-paper {
  width: 32px;
  height: 32px;
  flex: none;
  background-color: var(--paper);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
}
.mini-paper.c-berry {
  background-color: var(--paper);
}
.recent-note > div {
  min-width: 0;
}
.recent-note strong {
  display: block;
  font-size: 10.5px;
  color: var(--gold-bright);
}
.recent-note p {
  font-size: 11.5px;
  color: rgba(247, 240, 223, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-note span {
  display: block;
  font-size: 8.5px;
  color: var(--muted);
}
.admin-quick-settings {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 16px;
}
.admin-quick-settings > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(235, 216, 175, 0.07);
}
.admin-quick-settings span {
  color: var(--muted);
}
.admin-quick-settings strong {
  color: var(--cream);
  font-weight: 500;
  text-align: right;
}

/* admin tables */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-toolbar.wrap {
  align-items: flex-start;
}
.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 13px;
  border-radius: 12px;
  border: 1px solid rgba(235, 216, 175, 0.13);
  background: rgba(5, 22, 17, 0.32);
  min-width: 270px;
  flex: 1;
  max-width: 520px;
}
.admin-search > .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex: none;
}
.admin-search input[type="search"],
.admin-search input[type="number"] {
  border: 0;
  background: transparent;
  color: var(--cream);
  height: 34px;
  min-width: 0;
  flex: 1;
  outline: none;
}
.admin-search input::placeholder {
  color: rgba(247, 240, 223, 0.32);
}
.admin-search .compact-input {
  width: 58px;
  flex: none;
  border-left: 1px solid rgba(235, 216, 175, 0.1);
  padding-left: 9px;
  text-align: center;
}
.admin-search .btn {
  flex: none;
}
.filter-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid transparent;
  font-size: 10.5px;
  color: var(--muted);
}
.filter-pill:hover {
  color: var(--cream);
  background: rgba(247, 240, 223, 0.05);
}
.filter-pill.is-active {
  color: var(--gold-bright);
  background: rgba(216, 178, 106, 0.1);
  border-color: rgba(216, 178, 106, 0.2);
}
.admin-toolbar-note {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.data-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(247, 240, 223, 0.36);
  border-bottom: 1px solid rgba(235, 216, 175, 0.1);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(235, 216, 175, 0.065);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: rgba(247, 240, 223, 0.025);
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table .right {
  text-align: right;
}
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}
.user-cell > div {
  display: flex;
  flex-direction: column;
}
.user-cell strong {
  color: var(--cream);
  font-size: 12px;
}
.user-cell span {
  font-size: 9px;
  color: var(--muted);
}
.partner-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(247, 240, 223, 0.68);
  font-size: 11px;
}
.partner-name .icon {
  width: 11px;
  height: 11px;
  color: var(--rose);
}
.cell-muted {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  flex-wrap: wrap;
}
.you-tag {
  margin-left: 6px;
  font-size: 8px;
}

/* admin couples */
.couple-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.couple-admin-card {
  padding: 20px;
  border-radius: 17px;
  border: 1px solid rgba(235, 216, 175, 0.11);
  background: rgba(5, 22, 17, 0.24);
}
.couple-admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.pair-portraits {
  display: flex;
  align-items: center;
}
.pair-portraits .avatar + .pair-link {
  margin-left: -7px;
  margin-right: -7px;
  z-index: 2;
}
.couple-admin-card h2 {
  font-size: 21px;
  margin-bottom: 4px;
  word-break: break-word;
}
.couple-since {
  font-size: 9.5px;
  color: var(--muted);
}
.mini-alert {
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 9.5px;
  color: #f0b0b2;
  background: rgba(178, 58, 72, 0.1);
  border: 1px solid rgba(217, 107, 112, 0.2);
}
.couple-admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 1px;
  margin: 15px 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(235, 216, 175, 0.08);
}
.couple-admin-stats > div {
  background: rgba(8, 28, 21, 0.9);
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.couple-admin-stats strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--cream);
}
.couple-admin-stats span {
  font-size: 8.5px;
  color: var(--muted);
}
.couple-admin-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.couple-admin-actions .btn {
  flex: 1;
}

/* admin notes */
.admin-note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.admin-note-card {
  border-radius: 15px;
  border: 1px solid rgba(235, 216, 175, 0.1);
  background: rgba(5, 22, 17, 0.22);
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-note-paper {
  position: relative;
  border-radius: 8px;
  padding: 15px 14px;
  min-height: 155px;
  background-color: var(--paper);
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 48%),
    repeating-linear-gradient(to bottom, transparent 0 19px, var(--paper-line) 19px 20px);
  color: var(--paper-ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  clip-path: none !important;
}
.admin-note-shape {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 8px;
  letter-spacing: 0.06em;
  opacity: 0.5;
}
.admin-note-date {
  font-family: var(--font-display);
  font-size: 18px;
  opacity: 0.44;
  line-height: 1;
}
.admin-note-date span {
  font-size: 10px;
  margin-left: 2px;
}
.admin-note-paper p {
  margin-top: 12px;
  font-family: var(--font-hand);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.edited-mark {
  margin-top: auto;
  font-size: 8px;
  opacity: 0.48;
  padding-top: 8px;
}
.admin-note-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 3px 8px;
  font-size: 8.5px;
  color: var(--muted);
}
.note-author {
  display: flex;
  align-items: center;
  gap: 6px;
}
.note-author strong {
  font-size: 10px;
  color: var(--cream);
}
.admin-note-actions {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(235, 216, 175, 0.08);
  padding-top: 4px;
}

/* admin settings */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.settings-main {
  padding: 28px;
}
.settings-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mode-card {
  position: relative;
  padding: 17px;
  border-radius: 14px;
  border: 1px solid rgba(235, 216, 175, 0.13);
  background: rgba(5, 22, 17, 0.24);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.mode-card:hover {
  border-color: rgba(216, 178, 106, 0.32);
}
.mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(216, 178, 106, 0.08);
  color: var(--gold);
  display: grid;
  place-items: center;
  flex: none;
}
.mode-icon .icon {
  width: 16px;
  height: 16px;
}
.mode-card > span:nth-of-type(2) {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.mode-card strong {
  font-size: 12px;
  color: var(--cream);
}
.mode-card small {
  font-size: 9.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 3px;
}
.radio-mark {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(235, 216, 175, 0.25);
  flex: none;
  margin-top: 3px;
}
.mode-card:has(input:checked) {
  border-color: rgba(216, 178, 106, 0.45);
  background: rgba(216, 178, 106, 0.06);
}
.mode-card:has(input:checked) .radio-mark {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 3px var(--bg-3);
  background: var(--gold);
}
.window-editor {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(235, 216, 175, 0.09);
  background: rgba(5, 22, 17, 0.2);
  transition: opacity 0.2s;
}
.window-editor.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.time-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.time-number {
  width: 96px;
  height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(235, 216, 175, 0.18);
  background: rgba(5, 22, 17, 0.5);
  color: var(--cream);
  font-size: 15px;
  text-align: center;
}
.time-number:focus {
  outline: none;
  border-color: var(--gold);
}
.window-editor .select-input {
  flex: 1;
  height: 46px;
}
.window-preview {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(216, 178, 106, 0.06);
  border: 1px solid rgba(216, 178, 106, 0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.window-preview > span {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.window-preview strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--gold-bright);
}
.window-preview small {
  font-size: 9px;
  line-height: 1.55;
  color: var(--muted);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 18px;
  border-bottom: 1px solid rgba(235, 216, 175, 0.08);
  margin-bottom: 18px;
}
.settings-row strong {
  font-size: 12.5px;
  color: var(--cream);
}
.settings-row p {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.admin-form-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}
.setting-summary {
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.setting-summary strong {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  color: var(--gold-bright);
}
.setting-summary > span {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* backup */
.backup-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(235, 216, 175, 0.09);
  border: 1px solid rgba(235, 216, 175, 0.09);
  margin-bottom: 20px;
}
.backup-stat {
  background: rgba(8, 28, 21, 0.9);
  padding: 17px 19px;
  display: flex;
  flex-direction: column;
}
.backup-stat > span {
  font-size: 9px;
  color: var(--muted);
}
.backup-stat strong {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
  color: var(--cream);
  line-height: 1.2;
}
.backup-stat small {
  font-size: 8.5px;
  color: rgba(247, 240, 223, 0.32);
}
.backup-grid,
.import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.backup-card {
  padding: 26px;
}
.backup-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(216, 178, 106, 0.08);
  border: 1px solid rgba(216, 178, 106, 0.18);
  margin-bottom: 18px;
}
.backup-card-icon.red {
  color: var(--rose);
  background: rgba(178, 58, 72, 0.08);
  border-color: rgba(217, 107, 112, 0.18);
}
.backup-card-icon .icon {
  width: 21px;
  height: 21px;
}
.backup-card h2 {
  font-size: 26px;
  margin-bottom: 8px;
}
.backup-card > p:not(.eyebrow) {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  min-height: 58px;
}
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 20px;
}
.check-list li {
  position: relative;
  padding-left: 18px;
  font-size: 10.5px;
  color: rgba(247, 240, 223, 0.58);
}
.check-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 8px;
}
.backup-filename {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-family: "Cascadia Mono", monospace;
}
.import-card {
  padding: 26px;
}
.import-head {
  display: flex;
  gap: 13px;
  margin-bottom: 18px;
}
.import-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(216, 178, 106, 0.07);
  border: 1px solid rgba(216, 178, 106, 0.16);
  flex: none;
}
.import-icon.red {
  color: var(--rose);
  background: rgba(178, 58, 72, 0.07);
  border-color: rgba(217, 107, 112, 0.16);
}
.import-icon .icon {
  width: 18px;
  height: 18px;
}
.import-head h2 {
  font-size: 20px;
  margin-bottom: 4px;
}
.import-head p {
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--muted);
}
.import-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  padding: 22px 16px;
  border-radius: 13px;
  border: 1px dashed rgba(216, 178, 106, 0.28);
  background: rgba(5, 22, 17, 0.24);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.file-drop:hover {
  border-color: var(--gold);
  background: rgba(216, 178, 106, 0.04);
}
.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.file-drop .icon {
  width: 24px;
  height: 24px;
  color: var(--gold);
  margin-bottom: 3px;
}
.file-drop > span {
  font-size: 11px;
  color: var(--cream);
  word-break: break-all;
}
.file-drop small {
  font-size: 8.5px;
  color: var(--muted);
}
.import-warning {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  font-size: 9px;
  line-height: 1.55;
  color: var(--muted);
}
.import-warning .icon {
  width: 11px;
  height: 11px;
  flex: none;
  margin-top: 1px;
  color: rgba(216, 178, 106, 0.55);
}
.backup-notes {
  margin-top: 4px;
}
.backup-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.backup-notes-grid > div {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(5, 22, 17, 0.2);
}
.backup-notes-grid > div > span {
  font-family: var(--font-display);
  font-size: 18px;
  color: rgba(216, 178, 106, 0.35);
  line-height: 1;
}
.backup-notes-grid p {
  font-size: 10px;
  line-height: 1.65;
  color: var(--muted);
}
.backup-notes-grid strong {
  color: var(--cream);
}

/* -------------------------------------------------------------------------
   Public certificate
   ------------------------------------------------------------------------- */
.public-certificate-body {
  background:
    radial-gradient(circle at 50% 0, rgba(47, 107, 94, 0.3), transparent 46%),
    linear-gradient(160deg, #061913, #0a211a 50%, #061611);
  min-height: 100vh;
  overflow-x: hidden;
}
.public-certificate-shell {
  position: relative;
  z-index: 3;
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  padding: 30px 0 50px;
}
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 52px;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 10.5px;
  color: #b6ddc6;
  border: 1px solid rgba(119, 183, 152, 0.28);
  background: rgba(47, 107, 94, 0.15);
}
.verified-badge .icon {
  width: 12px;
  height: 12px;
}
.public-certificate-copy {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px;
}
.public-certificate-copy .eyebrow {
  justify-content: center;
}
.public-certificate-copy h1 {
  font-size: clamp(36px, 5vw, 58px);
  margin-bottom: 12px;
}
.public-certificate-copy h1 span {
  color: var(--gold);
  font-style: italic;
  font-weight: 400;
  padding: 0 0.15em;
}
.public-certificate-copy p {
  font-size: 12.5px;
  color: rgba(247, 240, 223, 0.52);
}
.public-certificate-copy code {
  color: var(--gold-bright);
}
.public-certificate-frame {
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(140deg, rgba(216, 178, 106, 0.26), rgba(216, 178, 106, 0.06));
  border: 1px solid rgba(216, 178, 106, 0.26);
  box-shadow: var(--shadow-lg);
}
.public-certificate-frame img {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}
.public-certificate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid rgba(235, 216, 175, 0.1);
  font-size: 10px;
  color: var(--muted);
}
.public-footer span,
.public-footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.public-footer .icon {
  width: 12px;
  height: 12px;
}
.public-footer a {
  color: var(--gold);
}
.public-certificate-body .snowfall {
  opacity: 0.6;
}

/* -------------------------------------------------------------------------
   Error page
   ------------------------------------------------------------------------- */
.error-body {
  background:
    radial-gradient(circle at 50% 30%, rgba(47, 107, 94, 0.3), transparent 50%),
    linear-gradient(160deg, #061913, #081f18);
  min-height: 100vh;
}
.error-shell {
  position: relative;
  z-index: 3;
  width: min(100% - 40px, 700px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 32px 0 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.error-shell .brand {
  position: absolute;
  top: 32px;
  left: 0;
}
.error-ornament {
  position: relative;
  margin: 46px 0 16px;
  min-height: 120px;
  display: flex;
  align-items: center;
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(110px, 20vw, 190px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(216, 178, 106, 0.35);
  letter-spacing: -0.02em;
}
.error-star {
  position: absolute;
  right: 14%;
  top: 20%;
  color: var(--gold);
  font-size: 32px;
  filter: drop-shadow(0 0 18px rgba(216, 178, 106, 0.5));
}
.error-shell h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 12px;
}
.error-shell > p {
  font-size: 13px;
  color: var(--muted);
  max-width: 480px;
}
.error-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1320px) {
  .tree-sidecopy {
    display: none;
  }
}

@media (max-width: 1120px) {
  .main-nav {
    display: none;
  }
  .mobile-nav {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(7, 27, 21, 0.86);
    border: 1px solid rgba(235, 216, 175, 0.15);
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 66px;
    height: 49px;
    border-radius: 12px;
    font-size: 8.5px;
    letter-spacing: 0.04em;
    color: rgba(247, 240, 223, 0.44);
  }
  .mobile-nav a .icon {
    width: 19px;
    height: 19px;
  }
  .mobile-nav a.is-active {
    color: var(--gold-bright);
    background: rgba(216, 178, 106, 0.1);
  }
  body.app-body {
    padding-bottom: 82px;
  }
  .admin-body .mobile-nav {
    display: none;
  }
  .admin-body {
    padding-bottom: 0;
  }
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-sidebar {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    min-width: 0;
  }
  .admin-sidebar-head {
    padding: 11px 14px;
    border-bottom: 0;
    flex: none;
  }
  .admin-sidebar-head > div {
    display: none;
  }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 7px;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar {
    display: none;
  }
  .admin-nav a {
    white-space: nowrap;
    padding: 8px 11px;
    flex: none;
  }
  .admin-nav a.is-active {
    box-shadow: inset 0 0 0 1px rgba(216, 178, 106, 0.15);
  }
  .admin-sidebar-foot {
    display: none;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .setting-summary {
    grid-column: 1 / -1;
  }
  .backup-grid,
  .import-grid {
    grid-template-columns: 1fr;
  }
  .admin-note-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .certificate-layout {
    grid-template-columns: 1fr;
  }
  .certificate-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .certificate-actions-card {
    grid-row: span 2;
  }
  .tree-main {
    padding-bottom: 92px;
  }
  .tree-page {
    min-height: calc(100dvh - 170px);
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 0.85fr);
  }
  .auth-tree-figure {
    width: 74%;
    right: -14%;
  }
  .auth-copy h1 {
    font-size: clamp(40px, 5.2vw, 58px);
  }
  .fn-2,
  .fn-3 {
    display: none;
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-side {
    position: static;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
  .identity-card {
    grid-row: span 2;
  }
  .profile-side .compact-qr {
    grid-column: 2;
  }
  .pair-dashboard {
    grid-template-columns: 1fr;
  }
  .pair-side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .pair-side-stack .quiet-card {
    grid-column: 1 / -1;
  }
  .pairing-layout {
    grid-template-columns: 1fr;
  }
  .pairing-aside {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
  }
  .tree-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
  }
  .month-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }
  .month-display {
    flex: 1;
  }
  .tree-actions {
    justify-self: end;
  }
  .tree-scene {
    min-height: 0;
    padding-top: 8px;
  }
  .tree-stage {
    width: min(100%, 500px);
    max-height: none;
  }
  .tree-page {
    min-height: auto;
  }
  .tree-footer {
    margin-top: 8px;
  }
  .tree-footer-right {
    display: none;
  }
  .tree-footer {
    justify-content: center;
    font-size: 9.5px;
  }
  .admin-shell {
    width: min(100% - 28px, 1560px);
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-scene {
    min-height: 320px;
    padding: 26px 28px;
    justify-content: flex-start;
  }
  .auth-copy {
    margin-top: 55px;
    max-width: 500px;
  }
  .auth-copy h1 {
    font-size: 42px;
  }
  .auth-lede {
    display: none;
  }
  .auth-notes {
    display: none;
  }
  .auth-tree-figure {
    width: 310px;
    right: -60px;
    bottom: -140px;
    opacity: 0.55;
  }
  .auth-scene-footer {
    display: none;
  }
  .auth-panel {
    margin-top: -24px;
    z-index: 7;
    border-radius: 28px 28px 0 0;
    padding: 36px 28px 52px;
    align-items: flex-start;
  }
  .auth-panel-inner {
    width: min(100%, 480px);
    margin: 0 auto;
  }
  .auth-privacy {
    margin-top: 30px;
  }
  .page-main {
    padding-top: 30px;
  }
  .page-heading.split {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .page-heading.split .btn {
    margin-bottom: 0;
  }
  .certificate-aside {
    grid-template-columns: 1fr;
  }
  .certificate-actions-card {
    grid-row: auto;
  }
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .couple-admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-page-head {
    flex-wrap: wrap;
  }
  .backup-notes-grid {
    grid-template-columns: 1fr;
  }
  .profile-side {
    grid-template-columns: 1fr;
  }
  .identity-card {
    grid-row: auto;
  }
  .profile-side .compact-qr {
    grid-column: auto;
  }
  .profile-stat-card {
    grid-column: auto;
  }
  .pair-side-stack {
    grid-template-columns: 1fr;
  }
  .pairing-aside {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    height: 62px;
    padding: 0 14px;
    gap: 10px;
  }
  .brand-mark {
    width: 33px;
    height: 33px;
  }
  .brand-mark .icon {
    width: 19px;
    height: 19px;
  }
  .brand-type strong {
    font-size: 15px;
  }
  .brand-type small {
    font-size: 7px;
    letter-spacing: 0.25em;
  }
  .header-actions {
    gap: 1px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .avatar-link .avatar {
    width: 33px;
    height: 33px;
  }
  .toast-stack {
    top: 72px;
    left: 14px;
    right: 14px;
    max-width: none;
  }
  .toast {
    width: 100%;
  }
  .page-main {
    padding: 24px 0 90px;
  }
  .page-shell {
    width: calc(100% - 28px);
  }
  .page-heading h1 {
    font-size: 34px;
  }
  .lede {
    font-size: 13.5px;
    line-height: 1.75;
  }
  .page-heading.centered {
    margin-bottom: 26px;
    text-align: left;
  }
  .page-heading.centered .eyebrow,
  .page-heading.centered .lede {
    justify-content: flex-start;
    margin-left: 0;
  }
  .panel-head {
    margin-bottom: 18px;
  }
  .panel-head h2 {
    font-size: 22px;
  }
  .btn {
    --btn-y: 10px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .btn-lg {
    --btn-y: 13px;
    padding-left: 22px;
    padding-right: 22px;
  }
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .auth-copy {
    margin-top: 40px;
  }
  .auth-copy h1 {
    font-size: 34px;
  }
  .auth-scene {
    min-height: 265px;
    padding: 22px 22px;
  }
  .auth-panel {
    padding: 30px 20px 44px;
    border-radius: 24px 24px 0 0;
  }
  .auth-card-head {
    margin-bottom: 24px;
  }
  .auth-card-head h2 {
    font-size: 34px;
  }
  .auth-tree-figure {
    width: 240px;
    right: -50px;
    bottom: -110px;
    opacity: 0.42;
  }
  .auth-switch {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .auth-privacy {
    display: none;
  }
  .tree-main {
    padding: 0 11px 88px;
  }
  .tree-toolbar {
    padding: 10px 11px;
    margin-top: 8px;
    border-radius: 16px;
    gap: 8px;
  }
  .tree-identity {
    gap: 8px;
  }
  .tree-identity-copy strong {
    font-size: 13px;
  }
  .tree-identity-copy > span {
    font-size: 8.5px;
  }
  .tree-avatars .avatar {
    width: 27px;
    height: 27px;
  }
  .tree-actions {
    gap: 4px;
  }
  .tree-actions .toolbar-btn {
    --btn-y: 7px;
    padding: 7px 11px;
    font-size: 10.5px;
  }
  .tree-actions .toolbar-btn .icon {
    width: 13px;
    height: 13px;
  }
  .month-display {
    min-width: 0;
    padding: 3px 8px;
  }
  .month-main {
    font-size: 14px;
  }
  .month-sub {
    font-size: 7px;
  }
  .month-arrow {
    width: 31px;
    height: 34px;
  }
  .tree-scene {
    padding-top: 5px;
  }
  .tree-stage {
    width: min(100%, 430px);
  }
  .tree-sidecopy {
    display: none;
  }
  .tree-footer {
    padding-top: 7px;
    font-size: 8.5px;
  }
  .tree-empty {
    width: min(260px, 76%);
    padding: 19px 17px 17px;
  }
  .tree-empty h2 {
    font-size: 19px;
  }
  .tree-empty p {
    font-size: 10px;
  }
  .admin-view-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    font-size: 10px;
  }
  .couple-hero {
    padding: 31px 18px 22px;
    gap: 8px;
  }
  .portrait-ring {
    width: 94px;
    height: 94px;
    padding: 5px;
  }
  .couple-portrait h2 {
    font-size: 18px;
    margin-top: 13px;
  }
  .couple-heart {
    padding: 0 4px;
  }
  .couple-heart .icon {
    width: 22px;
    height: 22px;
  }
  .couple-heart span {
    display: none;
  }
  .couple-actions {
    flex-direction: column;
    padding-top: 18px;
  }
  .couple-actions .btn {
    width: 100%;
  }
  .couple-orbit {
    width: 300px;
    height: 170px;
  }
  .mini-stat {
    padding: 20px;
  }
  .mini-stat strong {
    font-size: 42px;
  }
  .pairing-form-card,
  .qr-card,
  .settings-card,
  .relationship-card,
  .danger-zone {
    padding: 22px 18px;
  }
  .pair-form {
    padding: 16px;
  }
  .input-with-button {
    flex-direction: column;
  }
  .input-with-button .btn {
    width: 100%;
  }
  .request-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .request-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .qr-frame {
    width: 190px;
    height: 190px;
  }
  .profile-name {
    font-size: 26px;
  }
  .profile-avatar-wrap {
    width: 128px;
    height: 128px;
  }
  .identity-card {
    padding: 26px 18px 22px;
  }
  .danger-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .invite-card {
    padding: 32px 20px 30px;
  }
  .invite-card h1 {
    font-size: 33px;
  }
  .back-link {
    position: static;
    display: inline-flex;
    margin-bottom: 15px;
  }
  .invite-card > .eyebrow {
    margin-top: 4px;
  }
  .invite-avatar-ring {
    width: 108px;
    height: 108px;
  }
  .invite-question {
    font-size: 17px;
  }
  .certificate-frame {
    padding: 7px;
    border-radius: 16px;
  }
  .certificate-frame-caption {
    font-size: 8px;
  }
  .certificate-actions-card {
    padding: 22px 18px;
  }
  .welcome-ribbon {
    align-items: flex-start;
  }
  .admin-shell {
    width: calc(100% - 20px);
    gap: 12px;
  }
  .admin-sidebar {
    border-radius: 14px;
  }
  .admin-page-head h1 {
    font-size: 30px;
  }
  .admin-page-head {
    margin-bottom: 16px;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .admin-stat-card {
    padding: 15px;
  }
  .admin-stat-card > strong {
    font-size: 32px;
  }
  .stat-icon {
    display: none;
  }
  .admin-panel {
    padding: 17px;
  }
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-search {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex-wrap: wrap;
  }
  .admin-search input[type="search"] {
    min-width: 130px;
  }
  .admin-note-grid {
    grid-template-columns: 1fr;
  }
  .settings-main {
    padding: 19px;
  }
  .mode-picker {
    grid-template-columns: 1fr;
  }
  .window-editor {
    grid-template-columns: 1fr;
  }
  .settings-aside {
    grid-template-columns: 1fr;
  }
  .backup-grid,
  .import-grid {
    gap: 10px;
  }
  .backup-card,
  .import-card {
    padding: 19px;
  }
  .backup-card > p:not(.eyebrow) {
    min-height: 0;
  }
  .backup-overview {
    grid-template-columns: 1fr 1fr;
  }
  .public-certificate-shell {
    width: calc(100% - 24px);
    padding-top: 18px;
  }
  .public-header {
    margin-bottom: 28px;
  }
  .public-certificate-copy h1 {
    font-size: 31px;
  }
  .public-certificate-copy p {
    font-size: 11px;
  }
  .public-certificate-frame {
    padding: 6px;
    border-radius: 14px;
  }
  .public-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 26px;
  }
  .error-shell {
    width: calc(100% - 40px);
    padding-top: 24px;
  }
  .error-shell .brand {
    top: 22px;
  }
  .error-ornament {
    margin-top: 80px;
  }
  .certificate-thumb img {
    aspect-ratio: 1200 / 760;
  }
  dialog.modal {
    padding: 8px;
    max-height: calc(100dvh - 4px);
  }
  .modal-card {
    padding: 25px 18px 20px;
    border-radius: 22px;
    max-height: calc(100dvh - 16px);
  }
  .modal-close {
    top: 12px;
    right: 12px;
    width: 33px;
    height: 33px;
  }
  .composer-head {
    padding-right: 32px;
    flex-direction: column;
    margin-bottom: 18px;
    gap: 8px;
  }
  .composer-head h2 {
    font-size: 27px;
  }
  .composer-month {
    margin-top: 0;
  }
  .composer-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .composer-preview {
    position: static;
  }
  .note-paper.preview {
    min-height: 310px;
    padding: 38px 28px 26px;
    max-width: 340px;
    margin: 0 auto;
  }
  .note-paper.preview.shape-heart,
  .note-paper.preview.shape-star,
  .note-paper.preview.shape-round {
    min-height: 350px;
    padding: 60px 45px 45px;
  }
  .textarea-paper textarea {
    min-height: 176px;
    font-size: 17px;
    padding-left: 35px;
    padding-right: 12px;
  }
  .textarea-paper .paper-margin {
    left: 22px;
  }
  .shape-picker {
    gap: 5px;
  }
  .shape-swatch {
    width: 33px;
    height: 33px;
  }
  .type-controls {
    gap: 18px;
  }
  .composer-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
  }
  .composer-actions > div {
    width: 100%;
  }
  .composer-actions > div .btn {
    flex: 1;
  }
  .note-detail-card {
    padding: 22px 14px 18px;
  }
  .note-detail-head {
    padding-right: 34px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .note-paper.detail-paper {
    padding: 36px 24px 26px;
    min-height: 280px;
  }
  .detail-paper.shape-heart,
  .detail-paper.shape-star,
  .detail-paper.shape-round {
    padding: 36px 24px 26px;
    min-height: 320px;
  }
  .detail-paper.shape-heart::before,
  .detail-paper.shape-star::before,
  .detail-paper.shape-round::before {
    width: 112px;
    height: 112px;
    right: 12px;
    bottom: 12px;
    opacity: 0.14;
  }
  .detail-paper .paper-content {
    max-height: 48vh;
  }
  .note-detail-meta {
    flex-direction: column;
    gap: 8px;
  }
  .note-detail-actions {
    flex-wrap: wrap;
  }
  .stats-card {
    padding: 26px 16px 20px;
  }
  .stats-head {
    padding-right: 32px;
  }
  .stats-head h2 {
    font-size: 27px;
  }
  .stats-hero {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 18px;
  }
  .stats-total {
    border-right: 0;
    border-bottom: 1px solid rgba(235, 216, 175, 0.1);
    padding: 0 0 14px;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }
  .stats-total strong {
    font-size: 48px;
  }
  .stats-total-foot {
    width: 100%;
    margin-top: 0;
  }
  .stats-days {
    border-left: 0;
    border-top: 1px solid rgba(235, 216, 175, 0.1);
    padding: 12px 0 0;
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
  }
  .stats-days strong {
    font-size: 32px;
    margin: 0;
  }
  .stats-lower {
    grid-template-columns: 1fr;
  }
  .stats-tags-grid {
    grid-template-columns: 1fr 1fr;
  }
  .daily-chart {
    height: 96px;
  }
  .month-card {
    padding: 27px 18px 20px;
  }
  .month-card h2 {
    font-size: 25px;
  }
  .month-cell {
    height: 46px;
  }
  .confirm-card {
    padding: 30px 18px 22px;
  }
  .confirm-title {
    font-size: 23px;
  }
  .modal-actions {
    gap: 7px;
  }
  .public-certificate-copy {
    margin-bottom: 22px;
  }
  .tree-note {
    filter: drop-shadow(0 4px 3px rgba(2, 12, 8, 0.4));
  }
  .tree-note:hover {
    transform: translate(-50%, -50%) rotate(0deg) scale(1.35);
  }
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td {
    display: block;
    width: 100%;
  }
  .users-table thead {
    display: none;
  }
  .users-table tr {
    margin-bottom: 10px;
    padding: 13px;
    border: 1px solid rgba(235, 216, 175, 0.1);
    border-radius: 13px;
    background: rgba(5, 22, 17, 0.2);
  }
  .users-table td {
    border: 0;
    padding: 5px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: right;
  }
  .users-table td::before {
    content: attr(data-label);
    font-size: 8.5px;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-align: left;
    flex: none;
  }
  .users-table td:first-child {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(235, 216, 175, 0.07);
    margin-bottom: 4px;
  }
  .users-table td:first-child::before {
    display: none;
  }
  .users-table .user-cell {
    width: 100%;
    text-align: left;
  }
  .users-table .row-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .auth-copy h1 {
    font-size: 30px;
  }
  .auth-scene {
    min-height: 235px;
  }
  .auth-tree-figure {
    width: 200px;
    opacity: 0.34;
  }
  .auth-card-head h2 {
    font-size: 30px;
  }
  .tree-identity-copy > span {
    display: none;
  }
  .tree-identity-copy strong {
    font-size: 12px;
    max-width: 150px;
  }
  .tree-actions #statsButton {
    width: 34px;
    height: 34px;
    padding: 0;
  }
  .tree-actions #statsButton span {
    display: none;
  }
  .tree-actions .toolbar-btn {
    font-size: 10px;
    padding: 7px 10px;
  }
  .month-main {
    font-size: 13px;
  }
  .tree-empty {
    top: 44%;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  .backup-overview {
    grid-template-columns: 1fr;
  }
  .stats-tags-grid {
    grid-template-columns: 1fr;
  }
  .stats-facts {
    grid-template-columns: 1fr;
  }
  .certificate-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .public-header .brand-type {
    display: none;
  }
  .public-certificate-copy h1 {
    font-size: 26px;
  }
  .note-detail-date {
    display: none;
  }
  .day-bar small {
    font-size: 6.5px;
  }
}

@media (max-width: 390px) {
  .brand-type small {
    display: none;
  }
  .tree-actions .toolbar-btn span {
    display: none;
  }
  .tree-actions .toolbar-btn {
    width: 34px;
    height: 34px;
    padding: 0;
  }
  .composer-head h2 {
    font-size: 24px;
  }
  .shape-swatch {
    width: 29px;
    height: 29px;
  }
  .choice-label {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .snowfall {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   Print
   ------------------------------------------------------------------------- */
@media print {
  @page {
    size: landscape;
    margin: 10mm;
  }
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .app-header,
  .mobile-nav,
  .snowfall,
  .ambient-stars,
  .toast-stack,
  .certificate-heading,
  .certificate-aside,
  .certificate-frame-caption,
  .public-header,
  .public-certificate-copy,
  .public-certificate-actions,
  .public-footer,
  .page-heading {
    display: none !important;
  }
  .app-main,
  .page-main,
  .certificate-page,
  .public-certificate-shell {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
  }
  .certificate-layout {
    display: block;
  }
  .certificate-frame,
  .public-certificate-frame {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .certificate-frame-inner {
    border-radius: 0;
  }
  .certificate-frame img,
  .public-certificate-frame img {
    width: 100%;
    max-height: 180mm;
    object-fit: contain;
    page-break-inside: avoid;
  }
  body.public-certificate-body {
    background: #fff !important;
  }
}




