:root {
    --bg: #f2ede5;
    --bg-strong: #e8dfd0;
    --surface: rgba(255, 252, 247, 0.82);
    --surface-strong: rgba(255, 252, 247, 0.96);
    --surface-panel: rgba(255, 251, 246, 0.94);
    --line: rgba(29, 35, 43, 0.1);
    --text: #18202b;
    --text-muted: #64707f;
    --accent: #234f75;
    --accent-soft: #dce8f1;
    --success: #2e6b4f;
    --danger: #8f443a;
    --shadow: 0 18px 50px rgba(24, 30, 39, 0.1);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --content-width: 1280px;
    --page-blur: 8px;
    --board-accent: #234f75;
    --board-tint: rgba(35, 79, 117, 0.12);
    --board-tint-strong: rgba(35, 79, 117, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Plus Jakarta Sans", sans-serif;
    background:
        radial-gradient(circle at 10% 15%, rgba(35, 79, 117, 0.14), transparent 26%),
        radial-gradient(circle at 85% 18%, rgba(155, 125, 84, 0.1), transparent 24%),
        radial-gradient(circle at 85% 82%, rgba(35, 79, 117, 0.08), transparent 28%),
        linear-gradient(180deg, #f8f4ed 0%, #efe6d9 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)),
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.35), transparent 22%);
    opacity: 0.55;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.is-hidden {
    display: none !important;
}

.auth-shell,
.app-shell {
    position: relative;
    z-index: 1;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.auth-card,
.panel,
.modal-card,
.edit-dock {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card,
.modal-card,
.edit-dock {
    backdrop-filter: blur(var(--page-blur));
    -webkit-backdrop-filter: blur(var(--page-blur));
}

.panel {
    background: var(--surface-panel);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-card,
    .modal-card,
    .edit-dock,
    .panel {
        background: var(--surface-strong);
    }
}

.auth-card {
    width: min(100%, 540px);
    padding: 38px;
}

.auth-kicker,
.topbar-kicker,
.hero-kicker,
.section-eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-brand h1,
.topbar h1,
.hero h2,
.panel-head h3,
.section-head h3,
.modal-head h3 {
    margin: 10px 0 0;
    font-family: "Noto Serif SC", serif;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.auth-brand p,
.topbar-note,
.profile-bio,
.profile-motto,
.hero p,
.storage-note,
.quote-text,
.clock-subtle,
.panel-note,
#modal-subtitle,
.section-summary {
    color: var(--text-muted);
    line-height: 1.72;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin: 28px 0 20px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(24, 32, 43, 0.06);
}

.auth-tab {
    flex: 1;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    padding: 12px 16px;
    cursor: pointer;
}

.auth-tab.is-active {
    background: rgba(255, 252, 247, 0.96);
    color: var(--text);
    box-shadow: 0 8px 20px rgba(22, 30, 38, 0.08);
}

.auth-form,
.quick-add-grid {
    display: grid;
    gap: 14px;
}

.auth-error {
    min-height: 24px;
    margin: 16px 0 0;
    color: var(--danger);
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 14px;
    font-weight: 600;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.78);
    padding: 14px 16px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field-static-body {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.62);
}

.field-static-empty {
    display: grid;
    gap: 6px;
    color: var(--text-muted);
}

.field-static-empty strong {
    color: var(--text);
}

.field-static-empty p {
    margin: 0;
    line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: rgba(35, 79, 117, 0.4);
    box-shadow: 0 0 0 4px rgba(35, 79, 117, 0.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #234f75, #355f84);
    color: #fff;
    box-shadow: 0 14px 30px rgba(35, 79, 117, 0.24);
}

.btn-secondary {
    background: rgba(24, 32, 43, 0.06);
    color: var(--text);
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 10px 14px;
    font-size: 14px;
}

.app-shell {
    padding: 24px;
}

.topbar,
.layout,
.edit-dock,
.board-tabs {
    width: min(100%, var(--content-width));
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    position: relative;
}

.topbar-main {
    max-width: 760px;
    display: grid;
    gap: 10px;
}

.topbar-note {
    margin: 0;
}

.topbar::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(24, 32, 43, 0.14), transparent);
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(24, 32, 43, 0.08);
    background: rgba(255, 255, 255, 0.74);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.meta-pill-accent {
    border-color: transparent;
    background: var(--board-tint);
    color: var(--board-accent);
}

.meta-pill-muted {
    color: var(--text-muted);
}

.board-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 10px;
    border: 1px solid rgba(24, 32, 43, 0.08);
    border-radius: 999px;
    background: rgba(255, 252, 247, 0.76);
}

.board-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-muted);
    cursor: pointer;
}

.board-tab-label {
    line-height: 1;
}

.board-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(24, 32, 43, 0.06);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.board-tab.is-active {
    border-color: rgba(255, 255, 255, 0.7);
    background: linear-gradient(135deg, var(--board-tint), rgba(255, 255, 255, 0.86));
    color: var(--board-accent);
    font-weight: 700;
}

.board-tab.is-active .board-tab-count {
    background: rgba(255, 255, 255, 0.88);
    color: var(--board-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.board-tab.is-empty .board-tab-count {
    opacity: 0.82;
}

.topbar-actions,
.hero-actions,
.profile-actions,
.storage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.sidebar,
.content,
.section-grid,
.custom-sections {
    display: grid;
    gap: 24px;
}

.content,
.hero,
.sidebar > .panel {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

body[data-board-transition="switching"] .content,
body[data-board-transition="switching"] .hero {
    opacity: 0.96;
    transform: translateY(2px);
}

.sidebar {
    position: sticky;
    top: 24px;
}

.panel {
    padding: 24px;
}

.sidebar > .panel,
.content > .panel,
.section-card {
    content-visibility: auto;
    contain-intrinsic-size: 320px;
}

.section-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.section-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--board-accent), rgba(155, 125, 84, 0.75));
    opacity: 0.9;
}

.section-card::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -40px;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--board-tint), transparent 70%);
    opacity: 0.75;
    pointer-events: none;
}

.profile-avatar-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.avatar-frame {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(135deg, #234f75, #9b7d54);
    border: 1px solid rgba(255, 255, 255, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 30px;
    font-weight: 700;
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.avatar-frame.has-image img {
    display: block;
}

.avatar-frame.has-image span {
    display: none;
}

.profile-heading h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.profile-heading p {
    margin: 0;
    color: var(--text-muted);
}

.profile-bio {
    margin: 0 0 12px;
}

.profile-motto {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.panel-head,
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-head h3 {
    margin-top: 8px;
    font-size: 24px;
}

.section-copy {
    display: grid;
    gap: 8px;
}

.section-summary {
    margin: 0;
}

.section-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--board-tint);
    color: var(--board-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.stack-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
    line-height: 1.55;
}

.stack-dot {
    width: 8px;
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--board-accent);
    box-shadow: 0 0 0 4px var(--board-tint);
    flex: 0 0 auto;
}

.panel-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.info-card {
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.72));
}

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

.mini-stat-card {
    min-height: 112px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 251, 246, 0.72));
    display: grid;
    align-content: space-between;
    gap: 8px;
}

.mini-stat-label,
.mini-stat-note {
    color: var(--text-muted);
    font-size: 12px;
}

.mini-stat-value {
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.clock-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.meta-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.meta-list dt {
    color: var(--text-muted);
}

.meta-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 24px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 252, 247, 0.94)),
        radial-gradient(circle at top right, var(--board-tint), transparent 42%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 18%, var(--board-tint), transparent 26%),
        linear-gradient(115deg, transparent 0 58%, rgba(255, 255, 255, 0.46) 58% 100%);
    pointer-events: none;
}

.hero-copy,
.hero-side {
    position: relative;
    z-index: 1;
}

.hero-copy {
    display: grid;
    align-content: start;
    gap: 14px;
}

.hero h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
}

.hero p {
    margin: 0;
    max-width: 62ch;
}

.hero-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(24, 32, 43, 0.08);
    color: var(--board-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-badge-soft {
    color: var(--text-muted);
}

.hero-side {
    display: grid;
    gap: 16px;
    align-content: space-between;
}

.hero-actions {
    align-items: flex-start;
}

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

.metric-card {
    min-height: 112px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.72));
    box-shadow: 0 10px 24px rgba(24, 30, 39, 0.05);
    display: grid;
    align-content: space-between;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--board-accent);
    opacity: 0.78;
}

.metric-card:nth-child(2)::before {
    background: #9b7d54;
}

.metric-card:nth-child(3)::before {
    background: #2e6b4f;
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
}

.metric-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.metric-value-small {
    font-size: 18px;
    line-height: 1.4;
}

.section-grid,
.custom-sections {
    grid-template-columns: 1fr;
}

.item-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.file-grid,
.snippet-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.vault-overview-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.board-summary-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.board-detail-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.research-board-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ai-news-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.discovery-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.item-grid-compact {
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.feature-section .section-head {
    margin-bottom: 18px;
}

.feature-section {
    scroll-margin-top: 24px;
}

.feature-section[data-feature-section="research-overview"] {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(237, 245, 255, 0.92));
}

.feature-section[data-feature-section="research-overview"] .section-copy h3 {
    font-size: 28px;
}

.feature-section[data-feature-section="research-overview"] .section-summary {
    font-size: 15px;
    color: #314256;
}

.feature-section[data-feature-section="research-overview"] .section-count {
    background: rgba(35, 79, 117, 0.18);
    color: #1d3d5c;
}

.insight-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.insight-grid .item-card {
    min-height: 214px;
    aspect-ratio: auto;
    align-content: start;
    padding: 14px;
}

.insight-grid .item-card-content {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 0;
}

.insight-grid .item-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.insight-grid .item-title,
.insight-grid .item-desc,
.insight-grid .item-note {
    text-align: left;
}

.item-card {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 10px;
    aspect-ratio: 1 / 1;
    align-content: center;
    border: 1px solid rgba(39, 44, 52, 0.08);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 251, 246, 0.74));
    box-shadow: 0 10px 24px rgba(24, 30, 39, 0.04);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.item-card.is-link-card {
    cursor: pointer;
}

.item-link-cover {
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
}

.item-card.is-dragging,
.section-card.is-dragging {
    opacity: 0.5;
}

.item-card.drop-target,
.section-card.drop-target {
    border-color: var(--board-tint-strong);
    box-shadow: 0 0 0 3px var(--board-tint);
}

.item-card-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.item-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
}

.item-utility-actions {
    position: relative;
    z-index: 6;
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.item-utility-actions .btn {
    min-width: 92px;
}

body.is-editing .item-card-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

body.is-editing .item-card-content .item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 16px;
}

body.is-editing .item-card-content .item-title {
    font-size: 12px;
    font-weight: 600;
    -webkit-line-clamp: 2;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
    max-width: 100%;
}

body.is-editing .item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 16px;
}

body.is-editing .item-title {
    font-size: 12px;
    font-weight: 600;
    -webkit-line-clamp: 2;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.item-head-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.item-cover {
    aspect-ratio: 16 / 10;
    width: 100%;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(39, 44, 52, 0.08);
    position: relative;
    z-index: 2;
}

.item-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    text-align: center;
}

.drag-handle {
    display: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(24, 32, 43, 0.08);
    color: var(--text-muted);
    font-size: 12px;
    align-items: center;
    justify-content: center;
    cursor: grab;
    flex: 0 0 auto;
}

body.is-editing .drag-handle {
    display: inline-flex;
}

.item-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(220, 232, 241, 0.95), rgba(255, 255, 255, 0.84));
    border: 1px solid rgba(35, 79, 117, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.item-desc,
.item-meta,
.item-note {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
    word-break: break-word;
}

.item-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.item-note,
.item-pinned-badge {
    position: relative;
    z-index: 2;
}

.item-tag {
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(35, 79, 117, 0.08);
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
}

.item-actions {
    display: grid;
    grid-template-columns: repeat(2, 20px);
    gap: 4px;
    justify-content: end;
    position: relative;
    z-index: 3;
}

.item-select {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 12px;
    height: 12px;
    accent-color: var(--accent);
    z-index: 4;
}

.item-card.is-selected {
    border-color: var(--board-tint-strong);
    box-shadow: 0 0 0 3px var(--board-tint);
}

.item-pinned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(155, 125, 84, 0.12);
    color: #8a673b;
    font-size: 10px;
    font-weight: 700;
}

.icon-btn {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(24, 32, 43, 0.06);
    color: var(--text);
    cursor: pointer;
    font-size: 9px;
    padding: 0;
}

.section-head .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.section-head .item-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.section-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

body.is-editing .section-head .item-actions,
body.is-editing .section-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

body:not(.is-editing) .item-desc,
body:not(.is-editing) .item-meta,
body:not(.is-editing) .item-note,
body:not(.is-editing) .item-pinned-badge,
body:not(.is-editing) .drag-handle {
    display: none !important;
}

body:not(.is-editing) .insight-grid .item-desc,
body:not(.is-editing) .insight-grid .item-note {
    display: block !important;
}

body:not(.is-editing) .insight-grid .item-meta {
    display: flex !important;
}

body:not(.is-editing) .insight-grid .item-note-secondary {
    display: block !important;
}

body:not(.is-editing) .vault-card .item-meta,
body:not(.is-editing) .snippet-card .item-meta,
body:not(.is-editing) .research-board-card .item-meta,
body:not(.is-editing) .ai-news-card .item-meta {
    display: flex !important;
}

body:not(.is-editing) .item-card > *:not(.item-link-cover) {
    pointer-events: none;
}

body.is-editing .item-card {
    align-content: center;
}

body.is-editing .item-card-head {
    grid-template-columns: 1fr;
    align-items: center;
}

body.is-editing .item-head-main {
    align-items: center;
    justify-content: center;
}

body.is-editing .item-main {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}

body.is-editing .item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
    gap: 4px;
}

body.is-editing .item-actions .icon-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

body.is-editing .item-select {
    top: 10px;
    left: 10px;
    width: 14px;
    height: 14px;
}

.empty-state {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 12px;
    padding: 28px;
    min-height: 180px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(39, 44, 52, 0.14);
    color: var(--text-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.3);
}

.empty-state-illustration {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 30% 30%, rgba(35, 79, 117, 0.22), transparent 44%),
        linear-gradient(135deg, rgba(35, 79, 117, 0.12), rgba(155, 125, 84, 0.12));
    border: 1px solid rgba(35, 79, 117, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.empty-state-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.empty-state-text {
    max-width: 280px;
}

.vault-card,
.snippet-card {
    display: grid;
    gap: 14px;
    min-height: 220px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 251, 246, 0.78));
    box-shadow: 0 12px 28px rgba(24, 30, 39, 0.05);
}

.research-board-card {
    display: grid;
    gap: 14px;
    min-height: 240px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(249, 255, 251, 0.74));
    box-shadow: 0 12px 28px rgba(24, 30, 39, 0.05);
}

.research-board-card.is-current {
    border-color: rgba(35, 79, 117, 0.26);
    box-shadow: 0 0 0 3px rgba(35, 79, 117, 0.1), 0 18px 34px rgba(24, 30, 39, 0.06);
}

.ai-news-card {
    display: grid;
    gap: 14px;
    min-height: 220px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 252, 255, 0.78));
    box-shadow: 0 12px 28px rgba(24, 30, 39, 0.05);
}

.vault-card-head,
.snippet-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.vault-card-badges {
    display: grid;
    gap: 8px;
}

.vault-card-copy,
.snippet-card-head > div:first-child {
    min-width: 0;
}

.vault-card-copy h4,
.snippet-card-head h4 {
    margin: 0;
    font-size: 18px;
}

.vault-card-copy p,
.snippet-card-head p,
.vault-card-desc,
.vault-card-meta {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.vault-card-project {
    margin-top: 8px;
    font-size: 12px;
    color: var(--board-accent);
    font-weight: 700;
}

.research-board-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.research-board-head > div:first-child {
    display: grid;
    gap: 8px;
}

.ai-news-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.research-board-head h4 {
    margin: 8px 0 0;
    font-size: 20px;
}

.ai-news-head h4 {
    margin: 8px 0 0;
    font-size: 20px;
}

.research-board-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(46, 107, 79, 0.1);
    color: #2e6b4f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.research-board-status.is-collecting {
    background: rgba(35, 79, 117, 0.1);
    color: #234f75;
}

.research-board-status.is-evaluating {
    background: rgba(155, 125, 84, 0.14);
    color: #8a673b;
}

.research-board-status.is-building {
    background: rgba(46, 107, 79, 0.12);
    color: #2e6b4f;
}

.research-board-status.is-archived {
    background: rgba(24, 32, 43, 0.08);
    color: var(--text-muted);
}

.research-current-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    width: fit-content;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(35, 79, 117, 0.12);
    color: #234f75;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.research-board-summary {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.research-board-steps {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(46, 107, 79, 0.05);
}

.research-link-preview {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(24, 32, 43, 0.04);
}

.research-link-preview-detailed {
    gap: 12px;
    padding: 0;
    background: transparent;
}

.research-reference-manager {
    display: grid;
    gap: 14px;
}

.research-reference-toolbar {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(252, 248, 242, 0.78));
}

.research-reference-count {
    display: grid;
    gap: 4px;
}

.research-reference-count strong {
    font-size: 15px;
}

.research-reference-count span {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.research-reference-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.research-reference-manager .research-link-preview-detailed {
    max-height: min(46vh, 460px);
    overflow: auto;
    padding-right: 4px;
}

.research-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.research-link-row-detailed {
    padding: 14px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    border-radius: 16px;
    background: rgba(255, 252, 247, 0.72);
}

.research-link-check {
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
}

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

.research-link-main {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
}

.research-link-copy {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.research-link-copy-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
}

.research-link-kind {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(35, 79, 117, 0.09);
    color: #234f75;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.research-link-title {
    min-width: 0;
    color: var(--text);
    line-height: 1.5;
}

.research-link-note {
    color: var(--text-muted);
    line-height: 1.6;
}

.research-link-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 12px;
}

.research-link-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.research-link-actions .btn {
    min-width: 72px;
}

.research-link-more {
    color: var(--text-muted);
    font-size: 12px;
}

.signal-impact {
    padding: 14px;
    border-radius: 16px;
    background: rgba(35, 79, 117, 0.06);
    color: var(--text);
    line-height: 1.6;
}

.github-discovery-card .signal-impact {
    background: rgba(155, 125, 84, 0.1);
}

.item-note-secondary {
    padding-top: 6px;
    border-top: 1px dashed rgba(29, 35, 43, 0.1);
    font-size: 11px;
}

.vault-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    background: var(--board-tint);
    color: var(--board-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vault-cabinet-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(35, 79, 117, 0.09);
    color: #234f75;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vault-overview-card {
    display: grid;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 252, 255, 0.72));
    box-shadow: 0 12px 28px rgba(24, 30, 39, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.board-summary-card,
.board-detail-card {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    box-shadow: 0 12px 28px rgba(24, 30, 39, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.board-summary-card {
    min-height: 132px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(251, 249, 243, 0.72));
}

.board-detail-card {
    min-height: 220px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 252, 255, 0.74));
}

.vault-overview-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vault-overview-value {
    font-size: clamp(24px, 3.5vw, 34px);
    line-height: 1;
}

.vault-overview-note {
    color: var(--text-muted);
    font-size: 12px;
}

.board-summary-label,
.board-detail-eyebrow {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.board-summary-value {
    font-size: clamp(24px, 3.5vw, 34px);
    line-height: 1;
}

.board-summary-note,
.board-detail-note,
.board-detail-meta,
.board-detail-empty,
.board-detail-list-item {
    color: var(--text-muted);
    line-height: 1.6;
}

.board-summary-note,
.board-detail-meta,
.board-detail-empty,
.board-detail-list-item {
    font-size: 12px;
}

.board-detail-card h4 {
    margin: 0;
    font-size: 18px;
}

.board-detail-note {
    margin: 0;
    font-size: 14px;
}

.board-detail-list {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.board-detail-list-item {
    padding-top: 10px;
    border-top: 1px dashed rgba(29, 35, 43, 0.1);
    word-break: break-word;
}

.board-detail-card.is-clickable,
.board-detail-list-item.is-clickable {
    cursor: pointer;
}

.board-detail-list-item.is-clickable:hover {
    color: var(--text);
    border-top-color: rgba(35, 79, 117, 0.26);
}

.current-topic-spotlight {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) auto;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(35, 79, 117, 0.12);
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 252, 255, 0.76)),
        radial-gradient(circle at top right, rgba(35, 79, 117, 0.1), transparent 48%);
}

.current-topic-spotlight.is-empty {
    align-items: center;
}

.current-topic-copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.current-topic-kicker {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.current-topic-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.current-topic-copy h4 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.current-topic-copy p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.68;
}

.current-topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--text-muted);
    font-size: 12px;
}

.current-topic-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
}

.priority-intro {
    margin: 2px 0 10px;
    color: var(--text-muted);
    font-size: 13px;
}

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

.priority-card {
    border: 1px solid rgba(29, 35, 43, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 252, 255, 0.78));
    padding: 12px;
    display: grid;
    gap: 10px;
    align-content: start;
}

.priority-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.priority-head h4 {
    margin: 0;
    font-size: 15px;
}

.priority-head span {
    color: var(--text-muted);
    font-size: 12px;
}

.priority-empty {
    padding: 10px;
    border: 1px dashed rgba(29, 35, 43, 0.14);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.priority-row {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.64);
}

.priority-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.priority-title {
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.priority-title:hover {
    color: var(--accent);
}

.priority-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.priority-flag {
    color: #895c16;
    background: rgba(239, 214, 159, 0.35);
    border-radius: 999px;
    padding: 0 8px;
}

.priority-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.priority-btn {
    border: 1px solid rgba(29, 35, 43, 0.18);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
}

.priority-btn:hover {
    color: var(--text);
    border-color: rgba(29, 35, 43, 0.32);
}

.priority-btn.is-danger {
    color: #8f443a;
    border-color: rgba(143, 68, 58, 0.38);
}

@media (hover: hover) and (pointer: fine) {
    .section-card:hover,
    .board-summary-card:hover,
    .board-detail-card:hover,
    .vault-overview-card:hover,
    .research-board-card:hover,
    .ai-news-card:hover,
    .vault-card:hover,
    .snippet-card:hover,
    .command-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 32px rgba(24, 30, 39, 0.06);
    }
}

.vault-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 12px;
}

.vault-card-meta span,
.board-detail-meta {
    word-break: break-word;
}

.snippet-content {
    min-height: 92px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(24, 32, 43, 0.04);
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.file-actions .btn {
    min-width: 88px;
}

.command-palette {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.command-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 23, 31, 0.42);
}

.command-card {
    position: relative;
    z-index: 1;
    width: min(100% - 24px, 760px);
    margin: 60px auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 252, 247, 0.96);
    box-shadow: 0 24px 54px rgba(17, 23, 31, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: grid;
    gap: 16px;
}

.command-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.command-head strong {
    display: block;
    font-size: 18px;
}

.command-head p {
    margin: 6px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.command-close {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(24, 32, 43, 0.06);
    cursor: pointer;
}

.command-field {
    gap: 10px;
}

.command-list {
    display: grid;
    gap: 8px;
    max-height: min(62vh, 640px);
    overflow: auto;
}

.command-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(29, 35, 43, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    text-align: left;
    cursor: pointer;
}

.command-item-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.command-item-main strong {
    font-size: 15px;
}

.command-item-main span {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.command-item-type {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--board-tint);
    color: var(--board-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.command-item.is-selected {
    border-color: var(--board-tint-strong);
    box-shadow: 0 0 0 3px var(--board-tint);
}

.command-empty {
    display: grid;
    gap: 8px;
    padding: 20px;
    border-radius: 20px;
    border: 1px dashed rgba(29, 35, 43, 0.14);
    background: rgba(255, 255, 255, 0.56);
}

.command-empty p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.editing-only {
    display: none;
}

body.is-editing .editing-only {
    display: flex;
}

body.is-editing [draggable="true"] {
    cursor: move;
}

.section-card.is-collapsed .item-grid,
.section-card.is-collapsed .section-summary {
    display: none;
}

.modal-root {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 23, 31, 0.38);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100% - 24px, 640px);
    margin: min(48px, 8vh) auto;
    padding: 24px;
    max-height: min(88vh, 920px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.modal-head,
.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.modal-body {
    display: grid;
    gap: 14px;
    margin: 20px 0;
    overflow: auto;
    padding-right: 4px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(24, 32, 43, 0.06);
    cursor: pointer;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(24, 32, 43, 0.92);
    color: #fff;
}

.toast.success {
    background: rgba(46, 107, 79, 0.92);
}

.toast.error {
    background: rgba(143, 68, 58, 0.94);
}

.edit-dock {
    position: sticky;
    bottom: 20px;
    margin-top: 20px;
    padding: 14px;
    display: none;
    gap: 10px;
    justify-content: center;
    background: rgba(255, 252, 247, 0.9);
    z-index: 20;
}

.dock-select {
    min-width: 180px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    padding: 10px 14px;
}

.dock-status {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(35, 79, 117, 0.08);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.btn:disabled,
.dock-select:disabled,
.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

body.is-editing .edit-dock {
    display: flex;
}

body[data-density="compact"] .panel,
body[data-density="compact"] .item-card,
body[data-density="compact"] .metric-card {
    padding: 18px;
}

body[data-width="compact"] {
    --content-width: 1080px;
}

body[data-width="wide"] {
    --content-width: 1280px;
}

body[data-width="full"] {
    --content-width: 1440px;
}

body[data-background="none"] {
    background: #f6f2eb;
}

body[data-background="rich"] {
    background:
        radial-gradient(circle at 10% 15%, rgba(35, 79, 117, 0.18), transparent 24%),
        radial-gradient(circle at 85% 18%, rgba(155, 125, 84, 0.14), transparent 22%),
        radial-gradient(circle at 85% 82%, rgba(35, 79, 117, 0.12), transparent 24%),
        linear-gradient(180deg, #faf6ef 0%, #efe4d5 100%);
}

body[data-board="home"] {
    --board-accent: #234f75;
    --board-tint: rgba(35, 79, 117, 0.12);
    --board-tint-strong: rgba(35, 79, 117, 0.2);
}

body[data-board="research"] {
    --board-accent: #2e6b4f;
    --board-tint: rgba(46, 107, 79, 0.12);
    --board-tint-strong: rgba(46, 107, 79, 0.2);
}

body[data-board="development"] {
    --board-accent: #234f75;
    --board-tint: rgba(35, 79, 117, 0.15);
    --board-tint-strong: rgba(35, 79, 117, 0.24);
}

body[data-board="media"] {
    --board-accent: #8f443a;
    --board-tint: rgba(143, 68, 58, 0.12);
    --board-tint-strong: rgba(143, 68, 58, 0.2);
}

@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        transform: translateY(-1px);
    }

    .item-card:hover {
        transform: translateY(-2px);
        border-color: var(--board-tint-strong);
        box-shadow: 0 18px 40px rgba(33, 42, 52, 0.08);
    }
}

@media (prefers-reduced-motion: reduce), (pointer: coarse) {
    :root {
        --page-blur: 0px;
        --shadow: 0 12px 32px rgba(24, 30, 39, 0.08);
    }

    body::before {
        opacity: 0.34;
    }

    .auth-tab,
    .field input,
    .field textarea,
    .field select,
    .btn,
    .item-card,
    .content,
    .hero,
    .sidebar > .panel,
    .section-card,
    .board-summary-card,
    .board-detail-card,
    .research-board-card,
    .ai-news-card,
    .vault-card,
    .snippet-card,
    .command-item {
        transition: none;
    }
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .priority-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .item-grid,
    .item-grid-compact,
    .hero-metrics {
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    }

    .file-grid,
    .snippet-grid,
    .vault-overview-grid,
    .board-summary-grid,
    .board-detail-grid,
    .insight-grid,
    .research-board-grid,
    .ai-news-grid,
    .discovery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .topbar,
    .section-head,
    .panel-head {
        flex-direction: column;
    }

    .current-topic-spotlight {
        grid-template-columns: 1fr;
    }

    .research-board-card,
    .ai-news-card,
    .vault-card,
    .snippet-card,
    .board-detail-card {
        min-height: auto;
        padding: 16px;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px;
    }

    .auth-card,
    .panel,
    .modal-card {
        padding: 20px;
    }

    .edit-dock {
        width: calc(100% - 32px);
        flex-wrap: wrap;
    }

    .modal-card {
        width: calc(100% - 16px);
        margin: 8px auto;
        padding: 16px;
        max-height: calc(100vh - 16px);
    }

    .modal-foot {
        position: sticky;
        bottom: 0;
        background: rgba(255, 252, 247, 0.96);
        padding-top: 12px;
    }

    .mini-stat-grid {
        grid-template-columns: 1fr;
    }

    .file-grid,
    .snippet-grid,
    .vault-overview-grid,
    .board-summary-grid,
    .board-detail-grid,
    .insight-grid,
    .research-board-grid,
    .ai-news-grid,
    .discovery-grid {
        grid-template-columns: 1fr;
    }

    .command-card {
        width: calc(100% - 16px);
        margin: 8px auto;
        padding: 16px;
        max-height: calc(100vh - 16px);
    }

    .hero {
        padding: 20px;
        gap: 18px;
    }

    .feature-section .section-head {
        margin-bottom: 14px;
    }

    .board-summary-card,
    .board-detail-card {
        padding: 16px;
    }

    .current-topic-copy h4 {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    .item-grid,
    .item-grid-compact,
    .hero-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-actions-row,
    .file-actions {
        flex-direction: column;
    }

    .panel-actions-row .btn,
    .file-actions .btn {
        width: 100%;
    }

    .research-link-row,
    .research-link-main,
    .research-link-copy-head {
        grid-template-columns: 1fr;
    }

    .research-link-actions {
        justify-content: stretch;
    }

    .research-link-actions .btn {
        width: 100%;
    }

    .research-reference-toolbar-actions,
    .current-topic-actions {
        flex-direction: column;
    }

    .research-reference-toolbar-actions .btn,
    .current-topic-actions .btn {
        width: 100%;
    }

    .current-topic-copy h4 {
        font-size: 20px;
    }

    .command-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.ro-dashboard {
    display: grid;
    gap: 14px;
}

.ro-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.stat-box {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(11, 17, 34, 0.5);
    padding: 12px;
    display: grid;
    gap: 6px;
}

.ro-stat-label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.ro-stat-value {
    font-size: 24px;
    line-height: 1;
}

.ro-content-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
}

.ro-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(11, 17, 34, 0.42);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.ro-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ro-panel-head h4 {
    margin: 0;
    font-size: 15px;
}

.ro-panel-head span {
    color: var(--muted);
    font-size: 12px;
}

.ro-panel-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

#ro-trans-all,
#ro-show-more {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
}

#ro-trans-all:hover,
#ro-show-more:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.34);
}

.ro-news-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ro-ftab {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    color: var(--muted);
    user-select: none;
}

.ro-ftab.active {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

#ro-news-list,
.ro-boards-list {
    display: grid;
    gap: 8px;
}

.board-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(12, 19, 38, 0.55);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.board-item.is-clickable {
    cursor: pointer;
}

.board-item.is-clickable:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.board-info {
    min-width: 0;
}

.board-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.ro-news-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
    cursor: pointer;
}

.ro-news-row:last-child {
    border-bottom: none;
}

.ro-news-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ro-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4d8dff;
    flex-shrink: 0;
    margin-top: 5px;
}

.ro-news-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ro-news-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.ro-news-title-en,
.ro-news-title-cn {
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ro-news-title-en {
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.ro-news-title-cn {
    color: var(--muted);
}

.ro-news-bottom {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
}

.ro-meta {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ro-tbtn {
    font-size: 10px;
    padding: 1px 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
}

.ro-tbtn:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.34);
}

.ro-tbtn.busy {
    opacity: 0.4;
    pointer-events: none;
}

.ro-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ro-boards-empty {
    display: grid;
    gap: 10px;
    justify-items: start;
}

#ro-footer-meta {
    font-size: 11px;
    color: var(--muted);
}

.ro-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.status-pill {
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.ro-badge-openai {
    border-color: rgba(60, 189, 130, 0.55);
    color: #93f3cf;
}

.ro-badge-huggingface {
    border-color: rgba(254, 198, 74, 0.55);
    color: #ffd98a;
}

.ro-badge-google {
    border-color: rgba(95, 154, 255, 0.55);
    color: #9ec3ff;
}

.ro-badge-other {
    border-color: rgba(196, 206, 231, 0.4);
    color: #cfd8ee;
}

.ro-badge-model {
    border-color: rgba(197, 141, 255, 0.55);
    color: #ddbbff;
}

.ro-badge-tool {
    border-color: rgba(110, 216, 255, 0.55);
    color: #ade8ff;
}

.status-pill.sp-collecting {
    border-color: rgba(255, 208, 104, 0.6);
    color: #ffd886;
}

.status-pill.sp-evaluating {
    border-color: rgba(102, 182, 255, 0.6);
    color: #a5d0ff;
}

.status-pill.sp-building {
    border-color: rgba(133, 238, 177, 0.6);
    color: #b6f8d1;
}

.status-pill.sp-archived {
    border-color: rgba(194, 203, 227, 0.5);
    color: #d5dced;
}

@media (max-width: 960px) {
    .ro-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ro-content-grid {
        grid-template-columns: 1fr;
    }
}
