/* Personal Space, Rooms, Media Collections, Footprint Corridor, Journal, and Recovery UI. */

.brand-dot {
    color: #a48366;
}

.room-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    padding: 10px 0 14px;
}

.room-subnav a,
.back-link {
    color: var(--secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.back-link:hover {
    color: var(--foreground);
}

.room-subnav a {
    padding: 7px 13px;
    border-radius: 9px;
}

.room-subnav a:hover {
    background: var(--surface-soft);
    color: var(--foreground);
}

.room-subnav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* === Room Accent Themes === */
.library-room {
    --room-accent: #967252;
    --room-tint: #f0e7dc;
    --room-tint-deep: #e6d8c7;
}

.cinema-room {
    --room-accent: #7e6e97;
    --room-tint: #ece6f2;
    --room-tint-deep: #dfd5ea;
}

.games-room {
    --room-accent: #4e7a6f;
    --room-tint: #e1ede7;
    --room-tint-deep: #d0e3da;
}

:root[data-theme="dark"] .library-room {
    --room-accent: #cda982;
    --room-tint: #332b22;
    --room-tint-deep: #29221a;
}

:root[data-theme="dark"] .cinema-room {
    --room-accent: #b9a4d6;
    --room-tint: #2c2638;
    --room-tint-deep: #231e2e;
}

:root[data-theme="dark"] .games-room {
    --room-accent: #86baa8;
    --room-tint: #1e332c;
    --room-tint-deep: #172923;
}

/* === Personal Space Home Hero & Rooms === */
.ari-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 54px 0 46px;
    gap: 32px;
}

.ari-hero h1 {
    font-size: clamp(36px, 4.8vw, 58px);
    line-height: 1.18;
    letter-spacing: -0.04em;
    font-weight: 650;
    margin: 14px 0 14px;
}

.ari-hero p:not(.eyebrow) {
    color: var(--secondary);
    line-height: 1.8;
    font-size: 15px;
    margin: 0;
}

.hero-sign {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 120px;
    line-height: 0.95;
    letter-spacing: -8px;
    padding-right: 40px;
    color: var(--foreground);
    user-select: none;
}

.hero-sign span {
    color: #a48366;
}

.hero-sign small {
    display: block;
    font: 500 10px -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 3.4px;
    text-align: center;
    color: var(--tertiary);
    margin-top: 4px;
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.room-tile {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 26px 28px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    text-decoration: none;
    color: var(--foreground);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.room-tile::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--room-accent);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.room-tile:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    color: var(--foreground);
}

.room-tile:hover::after {
    opacity: 0.78;
}

.room-number {
    letter-spacing: 2px;
    color: var(--tertiary);
    font-size: 10px;
    font-weight: 600;
}

.room-symbol {
    margin: 22px 0 28px;
    color: var(--room-accent);
    font-family: Georgia, serif;
    font-size: 62px;
    line-height: 1;
}

.room-tile h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.room-tile h2 span {
    color: var(--room-accent);
    font-size: 19px;
    transition: transform 0.2s ease;
}

.room-tile:hover h2 span {
    transform: translate(3px, -3px);
}

.room-tile p {
    color: var(--secondary);
    font-size: 13.5px;
    line-height: 1.6;
    margin: 10px 0 24px;
}

.room-tile small {
    margin-top: auto;
    color: var(--room-accent);
    font-size: 12.5px;
    font-weight: 550;
}

/* === Space Sections & Active Cards === */
.space-section {
    margin-top: 48px;
}

.space-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.space-heading h2 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--foreground);
}

.space-heading > span,
.space-heading > a:not(.btn) {
    color: var(--secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s ease;
}

.space-heading > a:not(.btn):hover {
    color: var(--accent);
}

.section-caption {
    color: var(--secondary);
    font-size: 12.5px;
    margin: 8px 0 0;
    line-height: 1.65;
}

.active-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.active-card {
    display: flex;
    flex-direction: column;
    color: var(--foreground);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 22px;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.active-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    color: var(--foreground);
}

.active-card small {
    font-size: 11.5px;
    font-weight: 550;
    color: var(--room-accent);
}

.active-card h3 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin: 14px 0 6px;
    overflow-wrap: anywhere;
}

.active-card p {
    color: var(--secondary);
    font-size: 12.5px;
    margin: 0 0 18px;
}

.active-card > span {
    margin-top: auto;
    font-size: 12px;
    font-weight: 550;
    color: var(--room-accent);
    transition: transform 0.18s ease;
}

.active-card:hover > span {
    transform: translateX(2px);
}

/* === Monthly Journey Overview & List === */
.journey-overview {
    --reading-color: #967252;
    --cinema-color: #7e6e97;
    --game-color: #4e7a6f;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 26px 30px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

:root[data-theme="dark"] .journey-overview {
    --reading-color: #cda982;
    --cinema-color: #b9a4d6;
    --game-color: #86baa8;
}

.journey-chart h3 {
    font-size: 13px;
    margin: 0 0 20px;
    color: var(--secondary);
    font-weight: 550;
}

.journey-chart + .journey-chart {
    padding-left: 32px;
    border-left: 1px solid var(--border);
}

.composition-chart {
    display: flex;
    align-items: center;
    gap: 28px;
}

.journey-donut {
    width: 136px;
    height: 136px;
    flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(
        var(--reading-color) 0 var(--reading-end),
        var(--cinema-color) var(--reading-end) var(--cinema-end),
        var(--game-color) var(--cinema-end) 100%
    );
    display: grid;
    place-items: center;
}

.journey-donut > div {
    border-radius: 50%;
    background: var(--surface);
    width: 108px;
    height: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.journey-donut strong {
    font-size: 30px;
    font-weight: 650;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.journey-donut span {
    font-size: 11px;
    color: var(--secondary);
    margin-top: 2px;
}

.composition-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.composition-legend li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    margin: 14px 0;
}

.composition-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--room-accent);
    flex-shrink: 0;
}

.composition-legend strong {
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.composition-legend small {
    min-width: 36px;
    text-align: right;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.rating-bars {
    display: grid;
    gap: 10px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.rating-bar > span {
    width: 30px;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.rating-bar small {
    width: 24px;
    text-align: right;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}

.rating-track {
    flex: 1;
    height: 6px;
    background: var(--surface-soft);
    border-radius: 99px;
    overflow: hidden;
}

.rating-track i {
    display: block;
    height: 100%;
    background: var(--gold);
    border-radius: 99px;
}

.rating-caption {
    font-size: 11.5px;
    color: var(--tertiary);
    margin: 15px 0 0;
}

.journey-list,
.footprints,
.backup-list {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.journey-row {
    display: grid;
    grid-template-columns: 54px 42px minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding: 20px 24px;
    color: var(--foreground);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
}

.journey-row:last-child {
    border-bottom: 0;
}

.journey-row:hover {
    background: var(--surface-soft);
    color: var(--foreground);
}

.journey-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -3px;
}

.journey-row time {
    color: var(--secondary);
    font-size: 13px;
    padding-top: 11px;
    font-variant-numeric: tabular-nums;
}

.journey-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--room-tint);
    color: var(--room-accent);
}

.journey-icon svg {
    width: 21px;
    height: 21px;
}

.journey-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--secondary);
    font-size: 11.5px;
}

.journey-type {
    color: var(--room-accent);
    font-weight: 600;
}

.journey-content h3 {
    font-size: 16.5px;
    font-weight: 550;
    line-height: 1.45;
    margin: 4px 0 4px;
    overflow-wrap: anywhere;
}

.journey-content p {
    font-size: 13px;
    color: var(--secondary);
    margin: 7px 0 0;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.journey-rating {
    color: var(--gold);
    font-size: 12.5px;
    padding-top: 10px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.journey-rating.unrated {
    color: var(--tertiary);
    font-size: 11.5px;
    letter-spacing: 0;
}

.journey-more {
    font-size: 12px;
    text-align: center;
    color: var(--tertiary);
    margin: 14px 0 0;
}

.journey-more a {
    color: var(--secondary);
    text-decoration: none;
}

/* === Footprint Rows, Rediscover & Year Note === */
.footprint {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 20px 24px;
    color: var(--foreground);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
}

.footprint:last-child {
    border-bottom: 0;
}

a.footprint:hover {
    background: var(--surface-soft);
    color: var(--foreground);
}

.footprint time {
    color: var(--secondary);
    font-size: 14px;
    min-width: 92px;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
}

.footprint time small {
    display: block;
    margin-top: 5px;
}

.footprint > div {
    flex: 1;
    min-width: 0;
}

.footprint small {
    font-size: 12px;
    color: var(--secondary);
    margin-right: 10px;
}

.footprint h3 {
    font-size: 16.5px;
    font-weight: 550;
    margin: 5px 0;
}

.footprint p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--secondary);
    font-size: 13.5px;
    margin: 7px 0 6px;
    line-height: 1.75;
}

.footprint > span {
    color: var(--secondary);
    font-size: 12.5px;
    white-space: nowrap;
    transition: color 0.15s ease;
}

a.footprint:hover > span {
    color: var(--accent);
}

.stars {
    color: var(--gold);
    font-size: 12.5px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.rediscover {
    margin-top: 48px;
    padding: 32px 34px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--room-tint), var(--room-tint-deep));
    border: 1px solid var(--border);
}

.rediscover .eyebrow {
    color: var(--room-accent);
}

.rediscover h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.rediscover p {
    line-height: 1.85;
    white-space: pre-wrap;
    color: var(--foreground);
    opacity: 0.88;
    font-size: 14px;
}

.rediscover a {
    display: inline-block;
    margin-top: 6px;
    color: var(--room-accent);
    font-size: 12.5px;
    font-weight: 550;
    text-decoration: none;
}

.rediscover a:hover {
    text-decoration: underline;
}

.year-note {
    text-align: center;
    color: var(--tertiary);
    margin-top: 40px;
    font-size: 12.5px;
}

/* === Footprint Corridor === */
.footprint-corridor {
    position: relative;
    padding-left: 28px;
    margin-top: 32px;
}

.footprint-corridor::before {
    content: '';
    position: absolute;
    top: 22px;
    bottom: 24px;
    left: 7px;
    width: 1px;
    background: var(--border);
}

.corridor-year {
    margin: 0 0 28px;
}

.year-milestone,
.month-milestone {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    cursor: pointer;
    position: relative;
    list-style: none;
    border-radius: 10px;
}

.year-milestone::-webkit-details-marker,
.month-milestone::-webkit-details-marker {
    display: none;
}

.year-milestone {
    padding: 12px 6px 18px 0;
}

.year-milestone::before {
    content: '';
    position: absolute;
    width: 13px;
    height: 13px;
    border: 3px solid var(--page);
    border-radius: 50%;
    background: var(--foreground);
    left: -27px;
    top: 24px;
    box-shadow: 0 0 0 1px var(--border-strong);
}

.milestone-name {
    font-size: 26px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.milestone-name small {
    font-size: 13px;
    font-weight: 450;
    color: var(--secondary);
    margin-left: 3px;
}

.milestone-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.milestone-counts > span {
    font-size: 12.5px;
    color: var(--secondary);
    white-space: nowrap;
}

.milestone-counts i {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--room-accent);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.milestone-counts strong {
    font-weight: 600;
    color: var(--foreground);
    margin-left: 3px;
    font-variant-numeric: tabular-nums;
}

.milestone-chevron {
    color: var(--tertiary);
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    transition: transform 0.18s ease, background-color 0.15s ease, color 0.15s ease;
}

.year-milestone:hover .milestone-chevron,
.month-milestone:hover .milestone-chevron {
    background: var(--surface-soft);
    color: var(--foreground);
}

.milestone-chevron svg {
    width: 15px;
    height: 15px;
}

details[open] > .year-milestone > .milestone-chevron,
details[open] > .month-milestone > .milestone-chevron {
    transform: rotate(180deg);
}

.corridor-months {
    padding-left: 18px;
}

.corridor-month {
    margin: 4px 0 16px;
}

.month-milestone {
    padding: 14px 6px 14px 0;
}

.month-milestone::before {
    content: '';
    position: absolute;
    left: -43px;
    top: 23px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--page);
    border: 2px solid var(--secondary);
}

.month-milestone .milestone-name {
    font-size: 18px;
    min-width: 62px;
}

.month-content {
    padding: 0 0 8px;
}

.month-entries:empty {
    display: none;
}

.month-feedback {
    color: var(--secondary);
    font-size: 12.5px;
    margin: 12px 0;
}

.month-feedback:empty {
    display: none;
}

.month-load {
    display: block;
    margin: 16px auto 0;
    font-size: 12.5px;
}

.month-load[hidden] {
    display: none;
}

/* === Toolbars & Filter Tabs (Cinema, Games, Footprints) === */
.space-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 8px 0 26px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-tabs a {
    padding: 7px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary);
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.filter-tabs a:hover {
    color: var(--foreground);
}

.filter-tabs a.selected {
    background: var(--surface);
    color: var(--room-accent, var(--foreground));
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.filter-tabs a small {
    opacity: 0.72;
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
}

.timeline-toolbar .filter-tabs a.selected {
    color: var(--foreground);
}

.space-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.space-search input {
    min-width: 170px;
}

.space-search button {
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-toolbar .space-search select {
    width: auto;
    min-width: 118px;
    flex-shrink: 0;
    white-space: nowrap;
}

.timeline-toolbar .space-search input {
    width: 190px;
    min-width: 140px;
}

/* === Cinema & Games Media Cards === */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.media-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--foreground);
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.media-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    color: var(--foreground);
}

.text-cover {
    position: relative;
    background: linear-gradient(155deg, var(--room-tint) 0%, var(--room-tint-deep) 100%);
    color: var(--room-accent);
    min-height: 224px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.text-cover::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid currentColor;
    border-radius: 10px;
    opacity: 0.14;
    pointer-events: none;
}

.text-cover > span,
.text-cover > small {
    font-size: 10.5px;
    letter-spacing: 0.9px;
    font-weight: 550;
    opacity: 0.85;
}

.text-cover strong {
    font-size: 25px;
    line-height: 1.4;
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.media-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.media-card-body h2 {
    font-size: 15.5px;
    font-weight: 600;
    margin: 12px 0 6px;
    line-height: 1.4;
    color: var(--foreground);
}

.media-card-body p,
.media-card-body > small {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 6px;
    line-height: 1.55;
}

.media-card-body > small {
    margin-top: auto;
    margin-bottom: 0;
    color: var(--tertiary);
}

.completion-summary {
    font-size: 12px;
    color: var(--secondary);
    margin-top: 6px;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 4px 9px;
    background: var(--room-tint);
    color: var(--room-accent);
    font-size: 11px;
    font-weight: 550;
    border-radius: 6px;
    line-height: 1.25;
}

.status-pill[data-state="计划"],
.status-pill[data-state="搁置"],
.status-pill[data-state="弃坑"] {
    background: var(--surface-soft);
    color: var(--secondary);
}

.status-pill[data-state="完成"] {
    background: var(--positive-soft);
    color: var(--positive);
}

.status-pill.platinum {
    background: linear-gradient(125deg, #fbf3d6, #efe2be);
    color: #7b581b;
    border: 1px solid #d9bf82;
    font-weight: 600;
    letter-spacing: 0.25px;
}

.status-pill.platinum::before {
    content: '✦ ';
}

:root[data-theme="dark"] .status-pill.platinum {
    background: linear-gradient(125deg, #433720, #2e291f);
    color: #e9ce8e;
    border-color: #756138;
}

.space-empty {
    grid-column: 1 / -1;
    padding: 44px 24px;
    text-align: center;
    color: var(--secondary);
    font-size: 14px;
}

.space-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
    font-size: 13px;
    color: var(--secondary);
}

.space-pagination a {
    color: var(--foreground);
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.space-pagination a:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

/* === Forms, Detail Pages & Platforms === */
.space-form-shell {
    max-width: 760px;
    margin: 16px auto 32px;
}

.space-form {
    background: var(--surface);
    padding: 28px 30px;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-xs);
}

.field-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.completion-fields {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.completion-fields legend {
    font-size: 15px;
    font-weight: 600;
    color: var(--foreground);
}

.channel-picker legend,
.platform-picker legend {
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 10px;
}

.channel-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.channel-options label {
    cursor: pointer;
    position: relative;
}

.channel-options input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.channel-options span {
    display: block;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--secondary);
    background: var(--field);
    font-size: 13px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.channel-options input:checked + span {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    font-weight: 550;
}

.channel-options input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.platform-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.platform-option {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.platform-option.chosen {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.platform-check {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.platform-check input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.edition-choice {
    margin-top: 12px;
}

.reading-summary {
    display: block;
    font-size: 11.5px;
    color: var(--secondary);
    margin-top: 6px;
    text-decoration: none;
    line-height: 1.45;
}

.reading-summary:hover {
    color: var(--accent);
}

.detail-hero {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: center;
    padding: 28px 0 24px;
}

.detail-hero .text-cover {
    min-height: 300px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 22px;
}

.detail-danger-link {
    margin-left: auto;
}

/* === Data Management, Journal & Recovery === */
.data-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.data-counts > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
}

.data-counts strong,
.data-counts span {
    display: block;
}

.data-counts strong {
    font-size: 26px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.data-counts span {
    font-size: 12.5px;
    color: var(--secondary);
    margin-top: 4px;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.data-grid h2 {
    font-size: 19px;
    font-weight: 600;
}

.backup-row,
.journal-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: var(--foreground);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.14s ease, color 0.14s ease;
}

.journal-result {
    padding: 14px 10px;
    border-radius: 10px;
}

.backup-row:last-child,
.journal-result:last-child {
    border-bottom: 0;
}

.backup-row small,
.journal-result small {
    display: block;
    color: var(--secondary);
    font-size: 12px;
    overflow-wrap: anywhere;
    margin-top: 2px;
}

.backup-row span,
.journal-result span {
    color: var(--secondary);
    font-size: 12px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.backup-row:hover,
.journal-result:hover {
    background: var(--surface-soft);
    color: var(--accent);
}

.journal-content fieldset {
    min-width: 0;
}

.journal-feedback:empty {
    display: none;
}

#journalModal .modal-body {
    padding: 22px 24px;
}

#journalModal .modal-content {
    border-radius: 20px;
}

.removal-counts {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
    padding: 16px 18px;
    background: var(--surface-soft);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 16px 0;
}

.removal-counts dt {
    font-weight: 500;
    color: var(--secondary);
    font-size: 13.5px;
}

.removal-counts dd {
    margin: 0;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.recycle-row {
    align-items: center;
}

.recycle-row h3,
.page-intro h1,
.detail-hero h1,
.text-cover strong {
    overflow-wrap: anywhere;
}

.mobile-break {
    display: none;
}

/* === Responsive === */
@media (max-width: 960px) {
    .media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .hero-sign {
        padding: 0;
        font-size: 92px;
    }
    .room-tile {
        padding: 22px;
    }
}

@media (max-width: 767.98px) {
    .data-grid {
        grid-template-columns: 1fr;
    }
    .data-counts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .data-counts > div {
        padding: 14px;
    }
    .backup-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .journey-overview {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 22px;
    }
    .journey-chart + .journey-chart {
        padding: 22px 0 0;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
    .composition-chart {
        gap: 22px;
    }
    .journey-row {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 18px 16px;
    }
    .journey-row time {
        grid-column: 2;
        grid-row: 2;
        padding: 0;
        font-size: 11px;
    }
    .journey-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        grid-column: 1;
        grid-row: 1;
    }
    .journey-icon svg {
        width: 19px;
        height: 19px;
    }
    .journey-content {
        grid-column: 2;
        grid-row: 1;
    }
    .journey-rating {
        grid-column: 3;
        grid-row: 1;
        padding-top: 0;
        font-size: 10.5px;
    }
    .journey-content h3 {
        font-size: 15.5px;
    }
    .timeline-toolbar .space-search {
        flex-wrap: wrap;
        width: 100%;
    }
    .timeline-toolbar .space-search select,
    .timeline-toolbar .space-search input {
        flex: 1 1 130px;
        min-width: 110px;
    }
    .detail-danger-link {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    html[lang="en"] .journey-overview {
        padding: 20px;
    }
    html[lang="en"] .composition-chart {
        gap: 16px;
    }
    html[lang="en"] .journey-donut {
        width: 104px;
        height: 104px;
    }
    html[lang="en"] .journey-donut > div {
        width: 84px;
        height: 84px;
    }
    html[lang="en"] .composition-legend {
        min-width: 0;
    }
    html[lang="en"] .composition-legend li {
        font-size: 12px;
        gap: 6px;
    }
    html[lang="en"] .composition-legend small {
        min-width: 28px;
    }
    .ari-hero {
        padding: 28px 0;
    }
    .hero-sign {
        display: none;
    }
    .mobile-break {
        display: block;
    }
    .room-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .room-tile {
        padding: 22px;
    }
    .room-symbol {
        position: absolute;
        right: 24px;
        top: 28px;
        font-size: 46px;
        margin: 0;
    }
    .room-tile h2 {
        margin-top: 22px;
    }
    .room-tile h2 span {
        display: none;
    }
    .room-tile p {
        margin: 8px 0 16px;
    }
    .active-grid,
    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .active-card {
        padding: 16px;
    }
    .space-heading {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }
    .text-cover {
        min-height: 185px;
        padding: 16px;
    }
    .text-cover strong {
        font-size: 21px;
    }
    .media-card-body {
        padding: 14px;
    }
    .footprint {
        padding: 18px 16px;
        gap: 14px;
    }
    .footprint > .stars {
        display: none;
    }
    .space-form {
        padding: 20px;
    }
    .field-pair {
        gap: 12px;
    }
    .detail-hero {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .detail-hero .text-cover {
        min-height: 220px;
    }
    .space-toolbar,
    .space-search {
        width: 100%;
    }
    .space-section {
        margin-top: 34px;
    }
    .platform-options {
        grid-template-columns: 1fr;
    }
    .footprint-corridor {
        padding-left: 21px;
    }
    .year-milestone::before {
        left: -20px;
    }
    .corridor-months {
        padding-left: 8px;
    }
    .month-milestone::before {
        left: -24px;
    }
    .milestone-counts {
        gap: 10px;
    }
    .milestone-counts > span {
        font-size: 11px;
    }
    .year-milestone,
    .month-milestone {
        gap: 10px;
    }
    .year-milestone .milestone-name {
        font-size: 22px;
    }
    .month-milestone .milestone-name {
        min-width: 46px;
    }
    /* Mobile touch target & input legibility guarantees */
    .space-form input,
    .space-form select,
    .space-form textarea,
    .journal-content input,
    .journal-content select {
        font-size: 16px;
        min-width: 0;
        max-width: 100%;
    }
    .space-form .btn,
    .detail-actions .btn,
    .recycle-row .btn {
        min-height: 44px;
        white-space: normal;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .space-form .field-pair > div {
        min-width: 0;
    }
    .footprint > span {
        flex-shrink: 0;
        max-width: 25%;
        overflow-wrap: anywhere;
    }
    .journey-row {
        column-gap: 10px;
    }
    .journey-rating {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}
