.ss-story-fit {
    max-width: 1180px;
    margin: 24px auto;
    padding: 34px 36px 32px;
    border: 1px solid #efd8b8;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf9 0%, #fffaf1 100%);
    box-shadow: 0 18px 42px rgba(55, 35, 20, 0.08);
    color: #211d19;
    box-sizing: border-box;
}
.ss-fit-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(114, 84, 51, 0.14);
}
.ss-fit-kicker,
.ss-fit-label,
.ss-fit-box span {
    color: #9a641f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.ss-fit-top h2 {
    margin: 8px 0 8px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: 0;
}
.ss-fit-top p,
.ss-fit-tune-note {
    margin: 0;
    color: #756d64;
    font-size: 15px;
    line-height: 1.65;
}
.ss-fit-meter {
    position: relative;
    flex: 0 0 114px;
    width: 114px;
    height: 114px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(#f3a326 var(--ss-fit-score, 70%), #f8ead7 0);
    box-shadow: inset 0 0 0 1px rgba(154, 100, 31, 0.1), 0 10px 22px rgba(165, 100, 28, 0.12);
}
.ss-fit-meter:before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: #fffdf9;
}
.ss-fit-meter strong,
.ss-fit-meter span {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
}
.ss-fit-meter strong {
    color: #d68210;
    font-size: 38px;
    line-height: 1;
    font-weight: 800;
}
.ss-fit-meter span {
    margin-top: -22px;
    color: #8a7662;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.ss-fit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    padding: 18px 0;
}
.ss-fit-box {
    min-width: 0;
    padding: 18px 18px 20px;
    border: 1px solid rgba(80, 65, 45, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.68);
    box-sizing: border-box;
}
.ss-fit-box p {
    margin: 10px 0 0;
    color: #3d3832;
    font-size: 14px;
    line-height: 1.72;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}
.ss-fit-dna,
.ss-fit-tune {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px 18px;
    align-items: start;
    padding: 18px 0 0;
    border-top: 1px solid rgba(114, 84, 51, 0.14);
}
.ss-fit-tune { margin-top: 4px; }
.ss-fit-tune-body { min-width: 0; }
.ss-fit-tune-note { margin-bottom: 12px; font-size: 14px; }
.ss-fit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ss-fit-chip,
.ss-taste-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 15px;
    border: 1px solid #ddd9d3;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #27231f;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.ss-fit-chip:hover {
    border-color: #c28b46;
    background: #fff7ea;
    color: #7c4e16;
    transform: translateY(-1px);
}
.ss-taste-chip {
    cursor: pointer;
    appearance: none;
    font-family: inherit;
}
.ss-taste-chip:hover {
    border-color: #b58a55;
    background: #fff7ed;
}
.ss-taste-chip.is-active {
    border-color: #171411;
    background: #171411;
    color: #fffaf2;
    box-shadow: 0 8px 18px rgba(23, 20, 17, .12);
}
.ss-taste-chip.is-active:after {
    content: "on";
    margin-left: 8px;
    padding: 1px 6px 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #f6d9a7;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ss-fit-toast {
    min-height: 20px;
    margin-top: 12px;
    color: #8b5b1d;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: opacity .18s ease;
}
.ss-fit-toast.is-visible { opacity: 1; }
#storysphere-random-read-button {
    left: 24px !important;
  right: auto !important;
  top: auto !important;
  bottom: 96px !important;
    z-index: 9999 !important;
}
@media (max-width: 900px) {
    .ss-story-fit { margin: 18px 12px; padding: 26px 22px; }
    .ss-fit-top { align-items: flex-start; }
    .ss-fit-dna,
    .ss-fit-tune { grid-template-columns: 1fr; }
    #storysphere-random-read-button {
        left: 16px !important;
    right: auto !important;
    bottom: 92px !important;
        top: auto !important;
    }
}
@media (max-width: 560px) {
    .ss-story-fit { border-radius: 14px; padding: 22px 16px; }
    .ss-fit-top { display: block; }
    .ss-fit-meter { width: 92px; height: 92px; margin-top: 18px; }
    .ss-fit-meter strong { font-size: 30px; }
    .ss-fit-meter span { margin-top: -18px; font-size: 10px; }
    .ss-fit-grid { grid-template-columns: 1fr; }
    .ss-fit-chip,
    .ss-taste-chip { min-height: 32px; padding: 7px 12px; font-size: 12px; }
    #storysphere-random-read-button {
    left: 12px !important;
    right: auto !important;
    bottom: 86px !important;
        padding: 9px 13px !important;
        font-size: 11px !important;
    }
}


/* Compact fit signals for forum board entry cards. */
.fl_g.ss-board-fit-host {
    height: auto !important;
    min-height: 154px;
    padding-bottom: 12px;
    box-sizing: border-box;
}
.ss-board-fit {
    clear: both;
    margin: 8px 4px 0 90px;
    padding: 9px 10px 10px;
    border: 1px solid rgba(183, 142, 80, .22);
    border-radius: 10px;
    background: linear-gradient(180deg, #fffdf8 0%, #fff8ee 100%);
    box-shadow: 0 8px 20px rgba(80, 54, 20, .055);
    color: #28231f;
}
.ss-board-fit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.ss-board-fit-kicker {
    color: #9a641f;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.ss-board-fit-score {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: #171411;
    color: #fff6e8;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}
.ss-board-fit-note {
    margin: 0 0 7px;
    color: #6f685f;
    font-size: 12px;
    line-height: 1.4;
}
.ss-board-fit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ss-board-fit-chip {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 4px 8px;
    border: 1px solid #ded8cf;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #302b25;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
}
.ss-board-fit-chip:hover {
    border-color: #b98744;
    background: #fff4df;
    color: #7c4e16;
}
@media (max-width: 800px) {
    .fl_g.ss-board-fit-host {
        min-height: 0;
        padding-bottom: 16px;
    }
    .ss-board-fit {
        margin: 10px 0 0;
    }
}


/* StorySphere CN detail card alignment */
.pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl,
html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) 176px;
    gap: 18px 22px;
    align-items: start;
}
.pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl > .tsj-book-cover,
html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl > .tsj-book-cover {
    float: none !important;
    grid-column: 1;
    grid-row: 1;
    margin-right: 0 !important;
}
.pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl > .flex-col.cl,
html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl > .flex-col.cl {
    float: none !important;
    grid-column: 2;
    grid-row: 1;
    width: auto !important;
    min-width: 0;
}
.pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl > #tsj-book-star-chart,
html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl > #tsj-book-star-chart {
    float: none !important;
    grid-column: 3;
    grid-row: 1;
    width: auto !important;
    margin: 0 !important;
    padding: 4px 0 0 20px !important;
    border-left: 1px solid rgba(155, 102, 31, .18);
}
.pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl .text-color-high,
html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl .text-color-high {
    float: none !important;
    display: inline !important;
    line-height: 1.35;
}
.pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl .tsj-rate,
html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl .tsj-rate {
    float: none !important;
    display: inline-flex !important;
    vertical-align: middle;
    margin-left: 12px !important;
    letter-spacing: 6px !important;
}
@media (max-width: 900px) {
    .pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl,
    html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl {
        grid-template-columns: 90px minmax(0, 1fr);
    }
    .pg_viewthread .pcb:has(.ss-fit--cn) > .bg-white.cl > #tsj-book-star-chart,
    html[data-ss-fit-context='cn'] .pg_viewthread .pcb > .bg-white.cl > #tsj-book-star-chart {
        grid-column: 1 / -1;
        grid-row: 2;
        border-left: 0;
        padding: 8px 0 0 !important;
    }
}
