/* TOKENS PAGE LAYOUT */
.tokens-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 12px;
    padding: 12px;
}

@media (max-width: 820px) {
    .tokens-layout {
        grid-template-columns: 1fr;
    }
}

.token-reader-box {
    position: relative;
}
.token-header {
    position: relative;
}

.token-back-link {
    color: rgba(255, 214, 102, 0.58);
    text-decoration: none;
    
}

.token-back-link:hover {
    color: rgba(255, 214, 102, 0.9);
}

.token-reader-column,
.token-sidebar-column {
    min-width: 0;
}

/* READER BOX */
.token-reader-box {
    min-height: 540px;
}

.token-loading,
.token-error,
.token-empty {
    padding: 18px 14px;
    font-size: 14px;
    opacity: 0.88;
}

/* TOKEN HEADER */
.token-header {
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(245, 241, 230, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 214, 102, 0.08), rgba(0, 0, 0, 0.08));
}

.token-kicker {
    margin: 0 0 10px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 214, 102, 0.9);
    opacity: 0.9;  
}

.token-title {
    margin: 0 0 14px;
    color: #ffd666;
    font-size: 28px;
    line-height: 1.15;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);  
    
}

.token-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.token-author-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.token-author-text {
    min-width: 0;
    flex: 0 0 auto;
}

.token-author-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.token-meta-pipe,
.token-meta-detail {
    flex: 0 0 auto;
    white-space: nowrap;
}

.token-author-image {
    width: 34px;
    height: 34px;
    border: 1.5px solid var(--author-color, #ffd666);
    border-radius: 5px;
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.06);
}

.token-author-text {
    min-width: 0;
}

.token-author-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.token-author-name {
    color: var(--author-color, #ffd666);
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
}

.token-author-tilde {
    color: #9fc3d9;
    font-size: 13px;
    line-height: 1;
}
.token-meta-pipe {
    opacity: 0.4;
}

.token-meta-detail {
    font-size: 12px;
    color: rgba(245, 241, 230, 0.82);
}

.token-tag-row {
    margin-top: 14px;
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.token-type-tag,
.token-tag {
    display: inline-block;
    padding: 3px 7px;
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border: 1px solid rgba(255, 214, 102, 0.25);
    background: rgba(255, 214, 102, 0.06);
    color: #ffd666;
}

.token-type-tag {
    border-color: rgba(255, 214, 102, 0.55);
    background: rgba(255, 214, 102, 0.12);
}

/* TOKEN BODY */
.token-body {
    padding: 20px 22px 26px;
    font-family: "Atkinson Hyperlegible", Georgia, serif;
    font-size: 18px;
    line-height: 1.75;
    color: #f3ecdf;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.token-body > *:first-child {
    margin-top: 0;
}

.token-body p {
    margin: 0 0 1.15em;
}

.token-body a {
    color: #b7e4ff;
}

.token-body strong,
.token-body b {
    font-weight: 700;
}

.token-body i,
.token-body em {
    font-style: italic;
}

.token-body u {
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

/* HEADINGS INSIDE TOKEN */
.token-body h2,
.token-body h3,
.token-body h4 {
    font-family: DejaVuSansMono, monospace;
    color: #ffd666;
    line-height: 1.3;
    margin: 1.6em 0 0.6em;
}

.token-body h2 {
    font-size: 20px;
}

.token-body h3 {
    font-size: 17px;
}

.token-body h4 {
    font-size: 15px;
}

/* BLOCKQUOTE */
.token-body blockquote {
    margin: 1.4em 0 0.45em;
    padding: 0.4em 0 0.4em 1em;
    white-space: pre-line;
    border-left: 2px solid rgba(255, 214, 102, 0.55);
    color: rgba(245, 241, 230, 0.93);
    font-style: italic;
    background: rgba(255, 214, 102, 0.04);
}

.token-body blockquote p:last-child {
    margin-bottom: 0;
}

.token-body .quote-source {
    margin: 0 0 1.4em 1.25em;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(245, 241, 230, 0.7);
}

/* SCENE BREAK */
.token-break {
    margin: 1.8em auto 1.9em;
    text-align: center;
    color: rgba(255, 214, 102, 0.78);
    letter-spacing: 6px;;
    font-size: 12px;
    opacity: 0.82;
}

/* INLINE FIGURES */
.token-figure {
    margin: 1.5em auto 1.6em;
    text-align: center;
}

.token-figure img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(245, 241, 230, 0.25);
    box-shadow: 0 0 0 1px rgba(255, 214, 102, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.token-figure figcaption {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(245, 241, 230, 0.68);
    font-style: italic;
}

/* COMMENTS */

.token-comments::before {
    content: "✶ ✶ ✶";
    display: block;
    text-align: center;

    margin: -20px 0 40px;

    color: rgba(255, 214, 102, 0.7);
    font-size: 13px;
    letter-spacing: 6px;
    position: relative;

}
    
}

.token-comments::after {
    content: "";
    display: block;
    margin-top: 18px;

    border-top: 1px dashed rgba(245, 241, 230, 0.25);
}

.token-comments {
    padding: 0 22px 25px;
}

.token-comments-frame {
    display: block;
    width: 100%;
    height: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.token-comments-placeholder {
    border-top: 1px dashed rgba(245, 241, 230, 0.2);
    padding-top: 16px;
    margin: 15px 0 122px;
    font-size: 13px;
    color: rgba(245, 241, 230, 0.68);
    font-family: DejaVuSansMono, monospace;
}

/* SIDEBAR */
.token-sidebar-content {
    font-size: 13px;
}

.token-sidebar-block + .token-sidebar-block {
    margin-top: 16px;
}

.token-sidebar-label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #ffd666;
    opacity: 0.88;
}

.token-sort {
    width: 100%;
    padding: 6px 7px;
    background: rgba(0, 0, 0, 0.25);
    color: #f5f1e6;
    border: 1px solid rgba(245, 241, 230, 0.2);
    font-family: DejaVuSansMono, monospace;
    font-size: 12px;
}

.tag-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-filter-btn {
    appearance: none;
    border: 1px solid rgba(245, 241, 230, 0.22);
    background: rgba(0, 0, 0, 0.18);
    color: #f5f1e6;
    font-family: DejaVuSansMono, monospace;
    font-size: 11px;
    padding: 4px 7px;
    cursor: pointer;
}

.tag-filter-btn.is-active,
.tag-filter-btn:hover {
    border-color: rgba(255, 214, 102, 0.52);
    background: rgba(255, 214, 102, 0.11);
    color: #ffd666;
}

.token-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.token-list-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(245, 241, 230, 0.16);
    background: rgba(0, 0, 0, 0.15);
    padding: 8px;
}

.token-list-item:hover {
    border-color: rgba(255, 214, 102, 0.38);
    background: rgba(255, 214, 102, 0.06);
}

.token-list-item.is-active {
    border-color: rgba(255, 214, 102, 0.62);
    background: rgba(255, 214, 102, 0.1);
    box-shadow: inset 2px 0 0 rgba(255, 214, 102, 0.8);
}

.token-list-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.token-list-thumb {
    width: 24px;
    height: 24px;
    border: 1px solid var(--author-color, #ffd666);
    border-radius: 4px;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.05);
}

.token-list-text {
    min-width: 0;
}

.token-list-title {
    display: block;
    color: #f5f1e6;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;

    line-height: 1.35;
    max-height: calc(1.35em * 2);

    color: #f5f1e6;
    font-size: 12px;
    word-break: break-word;


}

.token-list-date {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: rgba(245, 241, 230, 0.6);
}

.token-duration {
    cursor: default;
}

.token-duration:hover {
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

/* SMALLER SCREENS */
@media (max-width: 820px) {
    .token-body {
        padding: 18px 16px 22px;
        font-size: 17px;
    }

    .token-header {
        padding: 16px 16px 12px;
    }

    .token-title {
        font-size: 24px;
    }

    .token-comments {
        padding: 0 16px 20px;
    }

    .token-comments-frame {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}
    
    .token-meta {
    flex-wrap: wrap;
}


.token-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

.token-filter-header .token-sidebar-label {
    margin-bottom: 0;
}

.token-filter-toggle {
    appearance: none;
    border: 1px solid rgba(245, 241, 230, 0.18);
    background: rgba(0, 0, 0, 0.18);
    color: #ffd666;
    font-family: DejaVuSansMono, monospace;
    font-size: 11px;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 0.85;
}

.token-filter-toggle:hover {
    border-color: rgba(255, 214, 102, 0.45);
    background: rgba(255, 214, 102, 0.08);
}

.tag-filter-list.is-collapsed {
    display: none;
}

.token-filter-toggle.is-collapsed {
    opacity: 0.7;
}

.token-new-mark {
    display: inline-block;
    margin-right: -1px;

    color: #ffd666;
    font-weight: bold;
    font-size: 13px;
    line-height: 1;

    transform: translateY(-0.5px) rotate(-8deg);

    text-shadow:
        0 0 4px rgba(255, 214, 102, 0.35),
        0 0 1px rgba(0, 0, 0, 0.8);

    letter-spacing: -0.5px;
}

.token-new-mark-small {
    font-size: 10px;
    margin-left: 3px;
    margin-right: -1px;
    transform: translateY(-0.3px) rotate(-8deg);

    text-shadow:
        0 0 3px rgba(255, 214, 102, 0.28),
        0 0 1px rgba(0, 0, 0, 0.8);
}

.token-mark-all-btn {
    appearance: none;
    border: none;
    background: transparent;

    font-family: DejaVuSansMono, monospace;
    font-size: 10px;

    color: rgba(245, 241, 230, 0.42);
    cursor: pointer;

    padding: 0;
}

.token-mark-all-btn:hover {
    color: rgba(255, 214, 102, 0.7);
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}