.ledger-wrap {
    position: relative;
    z-index: 10;
    max-width: 44rem;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}
.ledger-book {
    background: #fdf6e3;
    color: #2c1a12;
    border: 2px solid #c4a35a;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
}
.ledger-banner {
    position: relative;
    min-height: 11.5rem;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(196, 163, 90, 0.28), transparent 55%),
        linear-gradient(180deg, #3d2418 0%, #2c1a12 100%);
    background-size: cover;
    background-position: center;
    border-bottom: 2px solid #c4a35a;
}
.ledger-banner.has-photo {
    background-color: #2c1a12;
}
.ledger-face {
    position: absolute;
    left: 1.5rem;
    bottom: -2.4rem;
    width: 6.4rem;
    height: 6.4rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #c4a35a;
    background: #ead6ad;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    z-index: 2;
}
.ledger-face-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, monospace;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: #7a4e18;
}
.ledger-identity {
    padding: 3.1rem 1.5rem 1.35rem 8.4rem;
}
.ledger-name {
    margin: 0;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 2.05rem;
    color: #2c1a12;
    font-weight: 400;
}
.ledger-badge {
    margin: 0.35rem 0 0;
}
.ledger-bio {
    margin: 0.45rem 0 0;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.45;
    color: #5c3310;
    font-style: italic;
}
.ledger-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(196, 163, 90, 0.55);
}
.ledger-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: #7a4e18;
    font-family: ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.7rem 0.55rem 0.55rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.ledger-tab.is-active {
    color: #2c1a12;
    border-bottom-color: #c4a35a;
}
.ledger-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    padding: 0.75rem 1.25rem 0;
}
.ledger-write {
    appearance: none;
    border: 1px solid #8a6420;
    background: linear-gradient(180deg, #f3e4c4, #c4a35a);
    color: #3d2418;
    font-family: ui-monospace, monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.75);
}
.ledger-write:hover,
.ledger-write:focus-visible {
    background: linear-gradient(180deg, #f7e7b8, #d4b36a);
    outline: none;
}
.ledger-list {
    padding: 0.5rem 1.35rem 1.75rem;
    min-height: 12rem;
}
.ledger-compose {
    margin: 0.35rem 1.35rem 0.85rem;
    padding: 1rem 1rem 1.05rem;
    border: 1px solid #d4b872;
    background: #faf3df;
    box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.8);
}
.ledger-compose-kicker {
    margin: 0 0 0.7rem;
    font-family: ui-monospace, monospace;
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8a6420;
}
.ledger-work {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.55rem;
    padding: 0.65rem 0.55rem;
    border: 1px solid #d4b872;
    background: #faf3df;
    cursor: grab;
}
.ledger-work:active {
    cursor: grabbing;
}
.work-heart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.2rem;
}
.work-heart-row .ledger-entry-date {
    margin-bottom: 0;
}
.ledger-work .pin-like {
    flex-shrink: 0;
}
.ledger-work-main {
    flex: 1;
    min-width: 0;
    appearance: none;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    padding: 0;
}
.ledger-work-title {
    margin: 0;
    font-family: Georgia, 'Instrument Serif', serif;
    font-size: 1.2rem;
    color: #2c1a12;
}
.ledger-work-meta {
    margin: 0.15rem 0 0;
    font-family: Georgia, 'Instrument Serif', serif;
    font-size: 0.78rem;
    font-style: italic;
    color: #7a4e18;
}
.ledger-order {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.ledger-order button {
    appearance: none;
    width: 1.55rem;
    height: 1.35rem;
    border: 1px solid #c4a35a;
    background: #ead6ad;
    color: #2c1a12;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
}
.ledger-order button:disabled {
    opacity: 0.35;
    cursor: default;
}
.work-comments {
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed rgba(138, 98, 56, 0.45);
}
.work-comment-list {
    list-style: none;
    margin: 0 0 0.7rem;
    padding: 0;
    max-height: 9rem;
    overflow-y: auto;
}
.work-comment-item {
    margin: 0 0 0.4rem;
    padding: 0.4rem 0.5rem;
    background: rgba(250, 244, 228, 0.7);
    border: 1px solid rgba(212, 184, 114, 0.7);
}
.work-comment-author {
    display: block;
    font-family: ui-monospace, monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a4e18;
    margin-bottom: 0.15rem;
}
.work-comment-text {
    margin: 0;
    font-family: Georgia, 'Instrument Serif', serif;
    font-size: 1rem;
    line-height: 1.35;
    white-space: pre-wrap;
    color: #2c1a12;
}
.work-comment-empty {
    font-family: Georgia, 'Instrument Serif', serif;
    font-style: italic;
    color: #7a4e18;
    font-size: 0.92rem;
    margin: 0 0 0.55rem;
}
.work-comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: stretch;
}
.ledger-work[draggable="false"] {
    cursor: default;
}
.ledger-entry {
    margin: 0 0 1.35rem;
    padding: 1rem 0 1.15rem;
    border-bottom: 1px dashed rgba(138, 98, 56, 0.4);
}
.ledger-entry-title {
    margin: 0 0 0.35rem;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.45rem;
    color: #2c1a12;
    font-weight: 400;
}
.ledger-entry-date {
    display: block;
    margin-bottom: 0.55rem;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 0.82rem;
    font-style: italic;
    color: #7a4e18;
}
.ledger-inline-link,
.work-body-read a,
.work-comment-text a {
    color: #8a6420;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    word-break: break-word;
}
.ledger-inline-link:hover,
.work-body-read a:hover,
.work-comment-text a:hover {
    color: #c4a35a;
}
.ledger-entry-body,
.work-body-read {
    margin: 0 0 0.85rem;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.55;
    white-space: pre-wrap;
    color: #2c1a12;
}
.work-body-read {
    min-height: 4rem;
}
.ledger-entry.is-poetry .ledger-entry-body {
    font-style: italic;
    line-height: 1.7;
}
.ledger-error {
    margin: 0 1.35rem 1rem;
    color: #7f1d1d;
    font-size: 0.9rem;
    min-height: 1.1rem;
}
.ledger-modal[hidden] {
    display: none !important;
}
.ledger-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(44, 26, 18, 0.72);
}
.ledger-modal-card [hidden] {
    display: none !important;
}
.work-edit-block {
    display: block;
    margin-bottom: 0.75rem;
    text-align: left;
}
.ledger-modal-card {
    width: min(32rem, 100%);
    max-height: min(92vh, 44rem);
    overflow: auto;
    background: #fdf6e3;
    color: #2c1a12;
    border: 2px solid #c4a35a;
    padding: 1.35rem 1.4rem 1.2rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.ledger-work-card.is-reading {
    width: min(1080px, 96vw);
    max-height: min(96vh, 58rem);
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0.25rem 0.15rem 0.4rem;
    overflow-x: hidden;
}
.ledger-work-card.is-reading #work-mode {
    color: #fbbf24;
    text-align: center;
    margin-bottom: 0.65rem;
}
.ledger-work-card.is-reading .work-form-chrome,
.ledger-work-card.is-reading .work-comments {
    background: #fdf6e3;
    border: 2px solid #c4a35a;
    padding: 0.85rem 1.1rem 0.95rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.ledger-work-card.is-reading .work-form-chrome {
    margin-top: 0.85rem;
}
.ledger-work-card.is-reading .work-comments {
    margin-top: 0.7rem;
}
.work-reader {
    width: 100%;
    overflow: hidden;
    padding-bottom: 0.35rem;
}
.folio {
    position: relative;
    display: flex;
    width: 100%;
    height: min(52vh, 520px);
    transform-style: preserve-3d;
    transform: rotateX(3deg);
    filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.72));
}
.folio-cover-edge {
    position: absolute;
    inset: -10px -14px -14px -14px;
    background: linear-gradient(90deg, #2a160e, #3d2418 8%, #3d2418 92%, #2a160e);
    border-radius: 4px 12px 12px 4px;
    z-index: -1;
    box-shadow: inset 0 0 0 2px #573723;
}
.folio-page {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background-color: #f0e2c4;
    background-image:
        radial-gradient(rgba(90, 50, 20, 0.05) 0.8px, transparent 0.8px),
        linear-gradient(90deg, rgba(80, 40, 10, 0.08), transparent 8%, transparent 92%, rgba(80, 40, 10, 0.1));
    background-size: 18px 18px, 100% 100%;
    color: #2a1c12;
    display: flex;
    flex-direction: column;
}
.folio-page.left {
    box-shadow: inset -18px 0 28px rgba(80, 40, 10, 0.12);
    cursor: w-resize;
}
.folio-page.right {
    box-shadow: inset 18px 0 28px rgba(80, 40, 10, 0.12);
    cursor: e-resize;
}
.folio-gutter {
    width: 18px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.08) 40%, rgba(0, 0, 0, 0.08) 60%, rgba(0, 0, 0, 0.28));
    flex: 0 0 18px;
}
.page-inner {
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    padding: 1.6rem 1.5rem 0.4rem 1.6rem;
}
#work-page-measure {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    box-sizing: border-box;
    padding: 1.6rem 1.5rem 0.4rem 1.6rem;
    background: #f0e2c4;
    color: #2a1c12;
}
.page-num {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    font-size: 12px;
    color: #7a5a3a;
    text-align: center;
    padding: 0.4rem 0 0.65rem;
    letter-spacing: 0.14em;
}
.page-kicker {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #8a6238;
    margin-bottom: 0.4rem;
}
.page-title {
    font-family: 'EB Garamond', 'Instrument Serif', Georgia, serif;
    font-size: 1.4rem;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    color: #4a2c14;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
.print-prose .print-p {
    font-family: 'EB Garamond', 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.68;
    text-align: justify;
    hyphens: auto;
    text-indent: 1.65em;
    margin: 0 0 0.7em;
    color: #2a1c12;
}
.print-prose .print-p.is-lead {
    text-indent: 0;
}
.print-prose .print-p.is-lead::first-letter {
    float: left;
    font-family: 'EB Garamond', 'Instrument Serif', Georgia, serif;
    font-style: normal;
    font-weight: 600;
    font-size: 3.35em;
    line-height: 0.78;
    padding: 0.06em 0.08em 0 0;
    color: #5a3418;
}
.print-verse {
    font-family: 'EB Garamond', 'Instrument Serif', Georgia, serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.62;
    text-align: left;
    white-space: pre-line;
    overflow-wrap: break-word;
    color: #2a1c12;
}
.print-prose a,
.print-verse a {
    color: #8a6420;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    word-break: break-word;
}
.title-plate {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}
.title-plate h2 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    color: #78350f;
    margin: 0.4rem 0 0.85rem;
    font-weight: 400;
}
.title-rule {
    width: 4rem;
    height: 1px;
    background: rgba(146, 64, 14, 0.4);
    margin-bottom: 1rem;
}
.title-plate p {
    font-family: 'EB Garamond', Georgia, serif;
    font-style: italic;
    color: #3a2718;
    line-height: 1.55;
    margin: 0;
}
.flip-sheet {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 6;
}
.flip-sheet.next {
    right: 0;
    transform-origin: left center;
    animation: ledger-flip-next 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.flip-sheet.prev {
    left: 0;
    transform-origin: right center;
    animation: ledger-flip-prev 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes ledger-flip-next {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(-180deg); }
}
@keyframes ledger-flip-prev {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(180deg); }
}
.flip-face {
    position: absolute;
    inset: 0;
    background: #ead7ae;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
}
.work-reader-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.05rem;
}
.ctrl-btn {
    font-family: ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 0.5rem;
    padding: 0.55rem 0.95rem;
    min-height: 2.5rem;
    cursor: pointer;
}
.ctrl-btn:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.22);
    color: #fde68a;
}
.ctrl-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.work-page-indicator {
    font-family: 'Instrument Serif', Georgia, serif;
    color: rgba(251, 191, 36, 0.9);
    min-width: 9rem;
    text-align: center;
    font-size: 0.95rem;
}
@media (max-width: 768px) {
    .folio {
        flex-direction: column;
        height: min(58dvh, 520px);
        transform: none;
        filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.65));
        touch-action: pan-y;
    }
    .folio-gutter,
    .folio-page.right {
        display: none;
    }
    .folio-page.left {
        cursor: pointer;
        min-height: 0;
        flex: 1 1 auto;
        height: 100%;
    }
    .folio-cover-edge {
        inset: -6px -8px -10px -8px;
    }
    .page-inner {
        padding: 1.15rem 1.05rem 0.35rem 1.1rem;
    }
    .flip-sheet {
        width: 100%;
    }
    .flip-sheet.next,
    .flip-sheet.prev {
        left: 0;
        right: 0;
        transform-origin: center center;
        animation-duration: 0.28s;
    }
    @keyframes ledger-flip-next {
        0% { opacity: 1; transform: translateX(0); }
        100% { opacity: 0; transform: translateX(-18%); }
    }
    @keyframes ledger-flip-prev {
        0% { opacity: 1; transform: translateX(0); }
        100% { opacity: 0; transform: translateX(18%); }
    }
    #work-page-measure {
        padding: 1.15rem 1.05rem 0.35rem 1.1rem;
    }
}
.ledger-modal-card h2 {
    margin: 0 0 1rem;
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 400;
}
.profile-media-block {
    margin-bottom: 0.9rem;
    text-align: left;
}
.profile-media-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.profile-media-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.profile-avatar-preview {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c4a35a;
    background: #ead6ad;
    flex-shrink: 0;
}
.profile-avatar-preview.is-empty {
    visibility: hidden;
}
.profile-banner-preview {
    min-height: 4.5rem;
    margin-bottom: 0.45rem;
    border: 1px solid #c4a35a;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(196, 163, 90, 0.28), transparent 55%),
        linear-gradient(180deg, #3d2418 0%, #2c1a12 100%);
    background-size: cover;
    background-position: center;
}
.ledger-modal-card .ledger-error {
    margin: 0 0 0.35rem;
    min-height: 0.9rem;
}
.ledger-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.85rem;
}
.ledger-cancel {
    appearance: none;
    border: 1px solid #8a6238;
    background: #ead6ad;
    color: #5c3310;
    font-family: ui-monospace, monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
}
@media (max-width: 640px) {
    .ledger-identity {
        padding: 3.4rem 1.1rem 1.2rem 1.1rem;
    }
    .ledger-face {
        left: 50%;
        margin-left: -3.2rem;
    }
    .ledger-name,
    .ledger-bio {
        text-align: center;
    }
}
