/* ===== THE LEDGER — accounts, wax seals and achievements (every page) ===== */
:root {
    --lg-gold: #c9a961;
    --lg-gold-hi: #e3cb92;
    --lg-ink: #d9cdb3;
    --lg-dim: #9a9282;
    --lg-faint: #645d50;
    --lg-line: rgba(201, 169, 97, 0.22);
}

/* ---------- nav entry ---------- */
.lg-nav {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 4px 2px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--lg-ink);
    font-family: 'Cormorant Garamond', serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
}
html.ledger-on .lg-nav { display: inline-flex; }
.lg-nav:hover { color: var(--lg-gold-hi); }
.lg-nav .seal { --s: 30px; flex: 0 0 auto; }
.lg-nav .lg-nav-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.lg-nav-ic { width: 22px; height: 22px; color: var(--lg-gold); flex: 0 0 auto; }
@media (max-width: 1279px) { .lg-nav .lg-nav-text, .lg-nav .lg-nav-name { display: none; } }

/* ---------- modal shell ---------- */
.lg-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: rgba(5, 4, 3, 0.64);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.lg-modal.open { opacity: 1; visibility: visible; }
.lg-panel {
    position: relative;
    width: min(460px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
    padding: 42px 38px 32px;
    background:
        radial-gradient(120% 70% at 50% 0%, rgba(201, 169, 97, 0.07), transparent 60%),
        linear-gradient(180deg, #17120d, #0e0b08);
    border: 1px solid var(--lg-line);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
    transform: translateY(16px) scale(0.985);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    scrollbar-width: thin;
}
.lg-modal.open .lg-panel { transform: none; }
.lg-panel::before, .lg-panel::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid var(--lg-gold);
    opacity: 0.7;
    pointer-events: none;
}
.lg-panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.lg-panel::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.lg-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: none;
    border: 0;
    color: var(--lg-dim);
    font-size: 17px;
    cursor: pointer;
    transition: color 0.25s ease;
}
.lg-close:hover { color: var(--lg-gold-hi); }

.lg-over {
    font-family: 'Cormorant Garamond', serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(201, 169, 97, 0.85);
    text-align: center;
}
.lg-title {
    margin: 10px 0 10px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 30px;
    line-height: 1.12;
    color: var(--lg-ink);
    text-align: center;
    text-wrap: balance;
}
.lg-sub {
    margin: 0 0 24px;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--lg-dim);
    text-align: center;
}

.lg-tabs { display: flex; justify-content: center; gap: 28px; margin: 0 0 26px; border-bottom: 1px solid var(--lg-line); }
.lg-tab {
    position: relative;
    padding: 0 2px 12px;
    background: none;
    border: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--lg-faint);
    cursor: pointer;
    transition: color 0.25s ease;
}
.lg-tab:hover { color: var(--lg-dim); }
.lg-tab.active { color: var(--lg-gold-hi); }
.lg-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--lg-gold); }

.lg-field { display: block; margin: 0 0 16px; }
.lg-label {
    display: block;
    margin: 0 0 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--lg-dim);
}
.lg-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(201, 169, 97, 0.25);
    border-radius: 0;
    color: var(--lg-ink);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.06rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.lg-input:focus { border-color: var(--lg-gold); box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.12); }
.lg-input::placeholder { color: #5f584b; font-style: italic; }
.lg-note { min-height: 1.3em; margin-top: 6px; font-family: 'EB Garamond', Georgia, serif; font-size: 0.9rem; color: var(--lg-faint); }
.lg-note.ok { color: #a9c49a; }
.lg-note.bad { color: #e38d76; }
.lg-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 20px;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 0.96rem;
    line-height: 1.5;
    color: var(--lg-dim);
    cursor: pointer;
}
.lg-check input {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 4px 0 0;
    border: 1px solid rgba(201, 169, 97, 0.5);
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.lg-check input:hover { border-color: var(--lg-gold); }
.lg-check input:focus-visible { outline: 1px solid var(--lg-gold); outline-offset: 3px; }
.lg-check input:checked { background: var(--lg-gold); border-color: var(--lg-gold); }
.lg-check input:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #140f09;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.lg-check input:disabled { opacity: 0.5; cursor: default; }

.lg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 18px;
    border: 1px solid var(--lg-gold);
    background: linear-gradient(180deg, #d6b66d, #ad8c46);
    color: #140f09;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.25s ease, transform 0.15s ease, background 0.3s ease;
}
.lg-btn:hover { filter: brightness(1.08); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn[disabled] { opacity: 0.55; cursor: default; filter: none; }
.lg-btn.ghost { background: transparent; color: var(--lg-gold-hi); border-color: rgba(201, 169, 97, 0.45); }
.lg-btn.ghost:hover { background: rgba(201, 169, 97, 0.08); }
.lg-btn.small { width: auto; padding: 10px 16px; font-size: 11.5px; letter-spacing: 0.22em; }
.lg-btn.danger { background: transparent; color: #e38d76; border-color: rgba(227, 141, 118, 0.45); }
.lg-btn.danger:hover { background: rgba(227, 141, 118, 0.08); }
.lg-or {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 12px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--lg-faint);
}
.lg-or::before, .lg-or::after { content: ''; flex: 1; height: 1px; background: var(--lg-line); }
.lg-legal { margin-top: 18px; font-family: 'EB Garamond', Georgia, serif; font-size: 0.84rem; line-height: 1.5; color: var(--lg-faint); text-align: center; }
.lg-legal a { color: var(--lg-dim); text-decoration: underline; text-decoration-color: rgba(201, 169, 97, 0.35); text-underline-offset: 3px; }
.lg-form-err { min-height: 1.3em; margin: 10px 0 0; font-family: 'EB Garamond', Georgia, serif; font-size: 0.92rem; color: #e38d76; text-align: center; }

/* ---------- "check your inbox" ---------- */
.lg-inbox { text-align: center; }
.lg-env {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 2px auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201, 169, 97, 0.5);
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(201, 169, 97, 0.05), 0 0 40px rgba(201, 169, 97, 0.12);
    animation: lgEnv 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.2) both;
}
.lg-env svg { width: 40px; height: 40px; color: var(--lg-gold-hi); }
.lg-env-check {
    position: absolute;
    right: -2px;
    bottom: 2px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--lg-gold);
    color: #120d08;
    box-shadow: 0 0 0 4px #15110c;
    animation: lgPop 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.4) 0.45s both;
}
.lg-env-check svg { width: 14px; height: 14px; color: #120d08; }
@keyframes lgEnv { from { opacity: 0; transform: translateY(10px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes lgPop { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: none; } }
.lg-plaque {
    margin: 18px 0 22px;
    padding: 14px 16px;
    border: 1px solid var(--lg-line);
    background: rgba(201, 169, 97, 0.05);
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--lg-dim);
    overflow-wrap: anywhere;
}
.lg-plaque b { color: var(--lg-ink); font-weight: 500; }
.lg-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--lg-dim);
}
.lg-ring { width: 34px; height: 34px; flex: 0 0 auto; }
.lg-ring circle { fill: none; stroke-width: 2; }
.lg-ring .bg { stroke: rgba(201, 169, 97, 0.16); }
.lg-ring .fg { stroke: var(--lg-gold); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1s linear; }
.lg-ring text { fill: var(--lg-ink); font-family: 'Cormorant Garamond', serif; font-size: 11px; font-weight: 600; }
.lg-spam { margin: 16px 0 0; font-family: 'EB Garamond', Georgia, serif; font-style: italic; font-size: 0.92rem; color: var(--lg-faint); }

/* ---------- wax seals ---------- */
.seal {
    --s: 96px;
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: var(--s);
    height: var(--s);
    vertical-align: middle;
}
.seal > svg { position: relative; z-index: 1; width: 100%; height: 100%; display: block; overflow: visible; }
.seal-fx, .seal-sheen { position: absolute; pointer-events: none; }
.seal-sheen { inset: 12%; z-index: 2; border-radius: 50%; overflow: hidden; }
.seal-sheen::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -130%;
    width: 55%;
    height: 180%;
    background: linear-gradient(90deg, transparent, rgba(255, 248, 225, 0.32), transparent);
    transform: rotate(18deg);
}
/* rarity tiers — wax colour, metal of the emblem, and how the seal comes alive */
.seal.tier-ash       { --wax1: #77706a; --wax2: #46413b; --wax3: #2c2925; --metal: #d3cbbb; --metal2: #8f877a; }
.seal.tier-verdigris { --wax1: #4b7c69; --wax2: #26493d; --wax3: #142a23; --metal: #e8bd85; --metal2: #9a6f3e; }
.seal.tier-lapis     { --wax1: #4562a6; --wax2: #1d2d5e; --wax3: #0f1736; --metal: #eef2fb; --metal2: #9aa7c2; }
.seal.tier-purple    { --wax1: #833774; --wax2: #45163d; --wax3: #240a20; --metal: #f0cf86; --metal2: #a37e3c; }
.seal.tier-gilt      { --wax1: #2c2219; --wax2: #120d09; --wax3: #050403; --metal: #fbe3a0; --metal2: #b8892f; }
.seal.personal       { --metal: #e7cb8a; --metal2: #9b7a39; }

.seal.tier-verdigris:hover .seal-sheen::before { animation: sealSheen 1.2s ease; }
.seal.tier-lapis .seal-sheen::before { animation: sealSheenLoop 7s ease-in-out infinite; animation-delay: var(--d, 0s); }
.seal.tier-purple .seal-sheen::before { animation: sealSheenLoop 5.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.seal.tier-gilt .seal-sheen::before { animation: sealSheenLoop 4.2s ease-in-out infinite; animation-delay: var(--d, 0s); background: linear-gradient(90deg, transparent, rgba(255, 236, 170, 0.5), transparent); }
@keyframes sealSheen { from { left: -130%; } to { left: 170%; } }
@keyframes sealSheenLoop { 0%, 62% { left: -130%; } 100% { left: 170%; } }

/* purple: a breathing aura */
.seal.tier-purple .seal-fx { inset: -8%; z-index: 0; border-radius: 50%; background: radial-gradient(circle, rgba(196, 92, 176, 0.32), transparent 66%); animation: sealAura 3.6s ease-in-out infinite; }
@keyframes sealAura { 0%, 100% { opacity: 0.45; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
/* gilt: slow rays behind the seal and embers rising from it */
.seal.tier-gilt .seal-fx {
    inset: -30%;
    z-index: 0;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(251, 227, 160, 0.16) 0deg 5deg, transparent 5deg 22deg);
    -webkit-mask-image: radial-gradient(circle, #000 32%, transparent 70%);
    mask-image: radial-gradient(circle, #000 32%, transparent 70%);
    animation: sealRays 26s linear infinite;
}
@keyframes sealRays { to { transform: rotate(360deg); } }
.seal-embers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.seal-embers i {
    position: absolute;
    bottom: 30%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffdf9c;
    box-shadow: 0 0 6px 2px rgba(255, 190, 90, 0.55);
    opacity: 0;
    animation: sealEmber 3.4s ease-out infinite;
}
.seal-embers i:nth-child(1) { left: 28%; animation-delay: 0.2s; }
.seal-embers i:nth-child(2) { left: 52%; animation-delay: 1.4s; }
.seal-embers i:nth-child(3) { left: 70%; animation-delay: 2.3s; }
.seal-embers i:nth-child(4) { left: 40%; animation-delay: 2.9s; }
@keyframes sealEmber {
    0% { opacity: 0; transform: translate(0, 0) scale(1); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(6px, -64px) scale(0.4); }
}
/* purple sparkles */
.seal.tier-purple .seal-embers i { background: #ffe9c4; box-shadow: 0 0 6px 2px rgba(240, 150, 220, 0.5); animation: sealTwinkle 2.6s ease-in-out infinite; }
.seal.tier-purple .seal-embers i:nth-child(1) { left: 16%; bottom: 66%; }
.seal.tier-purple .seal-embers i:nth-child(2) { left: 80%; bottom: 58%; }
.seal.tier-purple .seal-embers i:nth-child(3) { left: 66%; bottom: 14%; }
.seal.tier-purple .seal-embers i:nth-child(4) { left: 24%; bottom: 20%; }
@keyframes sealTwinkle { 0%, 100% { opacity: 0; transform: scale(0.4); } 50% { opacity: 1; transform: scale(1.2); } }

/* locked: a blind impression in cold wax */
.seal.locked { filter: grayscale(1) brightness(0.5) contrast(0.95); opacity: 0.8; }
.seal.locked .seal-fx, .seal.locked .seal-sheen, .seal.locked .seal-embers { display: none; }

/* the stamp: a seal pressed into the page; grander for rarer seals */
.seal.stamp { animation: sealStamp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.seal.stamp.tier-verdigris { animation-duration: 0.85s; }
.seal.stamp.tier-lapis { animation-duration: 1s; }
.seal.stamp.tier-purple { animation-duration: 1.25s; }
.seal.stamp.tier-gilt { animation: sealStampGilt 1.9s cubic-bezier(0.2, 0.8, 0.25, 1.1) both; }
@keyframes sealStamp {
    0% { opacity: 0; transform: translateY(-14px) scale(1.7) rotate(-8deg); }
    55% { opacity: 1; transform: scale(0.94) rotate(2deg); }
    100% { opacity: 1; transform: none; }
}
@keyframes sealStampGilt {
    0% { opacity: 0; transform: translateY(-26px) scale(2.1) rotate(-14deg); filter: brightness(2.2); }
    45% { opacity: 1; transform: translateY(0) scale(1.06) rotate(2deg); filter: brightness(1.6); }
    60% { transform: scale(0.95) rotate(-1deg); filter: brightness(1.15); }
    100% { opacity: 1; transform: none; filter: none; }
}
.seal-burst { position: absolute; inset: 0; z-index: 4; border-radius: 50%; pointer-events: none; border: 2px solid var(--metal, #c9a961); opacity: 0; animation: sealBurst 0.9s ease-out 0.35s both; }
.seal.tier-gilt .seal-burst { animation-duration: 1.4s; animation-delay: 0.75s; border-width: 3px; box-shadow: 0 0 30px 8px rgba(251, 227, 160, 0.35); }
@keyframes sealBurst { 0% { opacity: 0.9; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.9); } }

/* ---------- toasts ---------- */
.lg-toasts {
    position: fixed;
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    z-index: 880;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    pointer-events: none;
}
.lg-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(380px, calc(100vw - 36px));
    padding: 14px 18px 14px 14px;
    background: linear-gradient(180deg, rgba(24, 19, 14, 0.97), rgba(13, 10, 8, 0.97));
    border: 1px solid var(--lg-line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
    transform: translateY(24px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.25, 1.15), opacity 0.4s ease;
}
.lg-toast.in { transform: none; opacity: 1; }
.lg-toast.out { transform: translateY(12px); opacity: 0; }
.lg-toast .seal { --s: 62px; }
.lg-toast-over { font-family: 'Cormorant Garamond', serif; font-size: 11px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(201, 169, 97, 0.85); }
.lg-toast-name { margin-top: 3px; font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 600; line-height: 1.15; color: var(--lg-ink); }
.lg-toast-sub { margin-top: 4px; font-family: 'EB Garamond', Georgia, serif; font-size: 0.9rem; color: var(--lg-dim); }
.lg-toast-sub a { color: var(--lg-gold-hi); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(201, 169, 97, 0.45); cursor: pointer; }
.lg-toast.tier-gilt { border-color: rgba(251, 227, 160, 0.45); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 34px rgba(251, 227, 160, 0.12); }
.lg-toast.tier-purple { border-color: rgba(196, 92, 176, 0.4); }
.lg-toast.tier-lapis { border-color: rgba(120, 150, 220, 0.35); }

/* ---------- tier label with pips ---------- */
.lg-tier { display: inline-flex; align-items: center; gap: 8px; font-family: 'Cormorant Garamond', serif; font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; }
.lg-pips { display: inline-flex; gap: 3px; }
.lg-pips i { width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid currentColor; opacity: 0.35; }
.lg-pips i.on { background: currentColor; opacity: 1; }
.lg-tier.tier-ash { color: #b9b1a3; }
.lg-tier.tier-verdigris { color: #7fb39c; }
.lg-tier.tier-lapis { color: #8fa8e6; }
.lg-tier.tier-purple { color: #d58cc6; }
.lg-tier.tier-gilt { color: #f3d58a; }

/* ---------- the Vigil block on the home page, when the Ledger is open ---------- */
.lg-vigil { max-width: 560px; margin: 26px auto 0; text-align: center; }
.lg-vigil[hidden], .newsletter [hidden] { display: none !important; }
.lg-vigil-me { display: flex; flex-direction: column; align-items: center; margin: 4px 0 26px; }
.lg-vigil-seal { min-height: 132px; }
.lg-vigil-me .lg-over { margin-top: 18px; }
.lg-vigil-name { margin-top: 8px; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(32px, 3.6vw, 44px); line-height: 1.08; color: var(--lg-ink); overflow-wrap: anywhere; }
.lg-vigil-me .lgp-num { margin-top: 8px; }
.lg-boons { list-style: none; margin: 0 auto 28px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; text-align: left; max-width: 520px; }
.lg-boons li { display: flex; gap: 12px; align-items: flex-start; font-family: 'EB Garamond', Georgia, serif; font-size: 1rem; line-height: 1.5; color: var(--lg-dim); }
.lg-boons li b { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.12rem; font-weight: 600; color: var(--lg-ink); }
.lg-boons li::before { content: '\2720'; color: var(--lg-gold); font-family: 'Cormorant Garamond', serif; line-height: 1.6; }
.lg-vigil-actions { display: flex; flex-direction: column; gap: 12px; max-width: 360px; margin: 0 auto; }
@media (max-width: 560px) { .lg-boons { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the Ledger page ---------- */
.lgp { max-width: 1040px; margin: 0 auto; }
.lgp-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    padding: 10px 0 46px;
    border-bottom: 1px solid var(--lg-line);
}
.lgp-head .seal { --s: clamp(150px, 20vw, 210px); }
.lgp-name { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(36px, 5vw, 58px); line-height: 1.05; color: var(--lg-ink); overflow-wrap: anywhere; }
.lgp-num { margin-top: 10px; font-family: 'Cormorant Garamond', serif; font-size: 13px; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--lg-gold); }
.lgp-num small { display: block; margin-top: 6px; font-family: 'EB Garamond', Georgia, serif; font-size: 0.95rem; font-style: italic; letter-spacing: 0; text-transform: none; color: var(--lg-dim); font-weight: 400; }
.lgp-meta { display: grid; gap: 12px; margin-top: 22px; }
.lgp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-family: 'EB Garamond', Georgia, serif; font-size: 1rem; color: var(--lg-dim); }
.lgp-row .lg-label { margin: 0; min-width: 110px; }
.lgp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 24px; }
.lgp-quiet { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.lg-quiet {
    padding: 4px 0;
    background: none;
    border: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--lg-dim);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.25s ease;
}
.lg-quiet:hover { color: var(--lg-gold-hi); }
.lg-quiet.danger:hover { color: #e38d76; }
.lg-quiet + .lg-quiet::before { content: '\00B7'; display: inline-block; margin: 0 12px; color: var(--lg-faint); }
.lgp-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid rgba(251, 227, 160, 0.45); color: #f3d58a; font-family: 'Cormorant Garamond', serif; font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; }
.lgp-confirm { margin-top: 14px; padding: 14px 16px; border: 1px solid rgba(227, 141, 118, 0.4); background: rgba(227, 141, 118, 0.05); font-family: 'EB Garamond', Georgia, serif; color: var(--lg-dim); }
.lgp-confirm[hidden] { display: none; }
.lgp-confirm .lgp-actions { margin-top: 12px; }
.lgp-guest { padding: 10px 0 40px; border-bottom: 1px solid var(--lg-line); }
.lgp-guest .lg-panel { margin: 0 auto; transform: none; box-shadow: none; }

.lgp-seals { padding-top: 46px; }
.lgp-seals-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.lgp-seals-title { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(28px, 3vw, 38px); color: var(--lg-ink); }
.lgp-seals-count { font-family: 'Cormorant Garamond', serif; font-size: 13px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--lg-gold); }
.lgp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.lgp-chip {
    padding: 7px 14px;
    background: none;
    border: 1px solid rgba(201, 169, 97, 0.22);
    color: var(--lg-dim);
    font-family: 'Cormorant Garamond', serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.lgp-chip:hover { color: var(--lg-ink); border-color: rgba(201, 169, 97, 0.45); }
.lgp-chip.active { color: #140f09; background: var(--lg-gold); border-color: var(--lg-gold); }
.lgp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 30px 18px; }
.lgp-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 6px 4px;
    background: none;
    border: 0;
    color: inherit;
    text-align: center;
    cursor: pointer;
}
.lgp-cell .seal { --s: 104px; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lgp-cell:hover .seal, .lgp-cell:focus-visible .seal { transform: translateY(-4px) scale(1.04); }
.lgp-cell-name { font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 600; line-height: 1.2; color: var(--lg-ink); }
.lgp-cell.is-locked .lgp-cell-name { color: var(--lg-faint); }
.lgp-cell .lg-tier { font-size: 10.5px; letter-spacing: 0.2em; }
.lgp-cell.is-guest .lgp-cell-name::after { content: ' \00B7'; color: var(--lg-gold); }
.lgp-note { margin-top: 26px; font-family: 'EB Garamond', Georgia, serif; font-style: italic; color: var(--lg-faint); text-align: center; }
.lgp-empty { padding: 40px 0; text-align: center; font-family: 'EB Garamond', Georgia, serif; font-style: italic; color: var(--lg-dim); }

.lgp-guest .lg-panel { max-height: none; overflow: visible; }

/* seal card */
.lg-card { text-align: center; perspective: 900px; }
.lg-card .seal { --s: 200px; display: block; }
.lg-tilt {
    position: relative;
    width: max-content;
    max-width: 100%;
    margin: 6px auto 18px;
    transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lg-tilt.tilting { transition: transform 0.12s linear; }
.lg-tilt::after {
    content: '';
    position: absolute;
    inset: 10%;
    z-index: 6;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 244, 214, 0.24), transparent 46%);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.lg-tilt.tilting::after { opacity: 1; }
.lg-card-inner { animation: lgFlip 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes lgFlip { from { opacity: 0; transform: rotateY(70deg) scale(0.9); } to { opacity: 1; transform: none; } }
.lg-card-name { font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--lg-ink); margin: 10px 0 8px; }
.lg-card-desc { margin: 14px 0 18px; font-family: 'EB Garamond', Georgia, serif; font-size: 1.05rem; line-height: 1.6; color: var(--lg-dim); }
.lg-card-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 18px; }
.lg-card-tags span { padding: 4px 10px; border: 1px solid rgba(201, 169, 97, 0.25); font-family: 'Cormorant Garamond', serif; font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--lg-dim); }
.lg-card-foot { display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--lg-line); font-family: 'EB Garamond', Georgia, serif; font-size: 0.95rem; color: var(--lg-faint); }
.lg-card-foot b { color: var(--lg-gold-hi); font-weight: 500; }

@media (max-width: 720px) {
    .lg-panel { padding: 38px 22px 26px; }
    .lg-title { font-size: 26px; }
    .lgp-head { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .lgp-row { justify-content: center; }
    .lgp-row .lg-label { min-width: 0; }
    .lgp-actions { justify-content: center; }
    .lgp-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 24px 10px; }
    .lgp-cell .seal { --s: 88px; }
    .lg-toasts { left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
    .seal *, .seal .seal-sheen::before, .seal .seal-fx, .seal.stamp, .seal-burst, .lg-card-inner, .lg-env, .lg-env-check { animation: none !important; }
    .lg-toast { transition: opacity 0.2s ease; transform: none; }
}

/* a quiet text button inside a note ("if it is yours — sign in") */
.lg-inline {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    color: var(--lg-gold-hi);
    text-decoration: underline;
    text-decoration-color: rgba(201, 169, 97, 0.45);
    text-underline-offset: 3px;
    cursor: pointer;
}
.lg-inline:hover { color: #f0dcaa; }
.lg-over.lg-bad { color: #e38d76; }
.lg-url { max-width: 320px; padding: 9px 12px; font-size: 0.95rem; }
