/* ================================================================
   IGEOUZ STUDY DASHBOARD — Learning Expedition visual system
   Loaded after the existing dashboard and shell styles.
   ================================================================ */

#dashboardView {
    --dash-emerald: #10b981;
    --dash-emerald-deep: #047857;
    --dash-mint: #6ee7b7;
    --dash-blue: #0ea5e9;
    --dash-amber: #f59e0b;
    --dash-purple: #8b5cf6;
    position: relative;
    isolation: isolate;
    max-width: 1540px;
    width: 100%;
    margin: 0 auto;
    padding: 30px clamp(22px, 3.2vw, 48px) 80px;
}

#dashboardView::before {
    content: '';
    position: fixed;
    inset: 64px 0 0 260px;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 10%, rgba(16, 185, 129, 0.08), transparent 27rem),
        radial-gradient(circle at 92% 35%, rgba(14, 165, 233, 0.055), transparent 30rem),
        linear-gradient(rgba(16, 185, 129, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.018) 1px, transparent 1px);
    background-size: auto, auto, 68px 68px, 68px 68px;
}

:is(body.study-sidebar-collapsed, html[data-study-sidebar-collapsed='true'] body) #dashboardView::before {
    left: 76px;
}

/* Shared section headings */
#dashboardView .dash-section {
    margin-bottom: 42px;
}

#dashboardView .dash-section__header {
    gap: 13px;
    margin-bottom: 19px;
}

#dashboardView .dash-section__header > i {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.13), rgba(14, 165, 233, 0.055));
    color: #059669;
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.08);
}

#dashboardView .dash-section__header h2 {
    color: var(--text-primary);
    font-size: clamp(1.16rem, 1.7vw, 1.42rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

#dashboardView .dash-section__header--with-copy {
    align-items: flex-start;
}

#dashboardView .dash-section__header--with-copy p {
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* Learning Expedition hero */
.dash-expedition {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    min-height: 395px;
    margin-bottom: 42px;
    padding: clamp(2.2rem, 4.3vw, 4rem);
    overflow: hidden;
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 32px;
    background: linear-gradient(120deg, #064e3b 0%, #047857 46%, #0f766e 72%, #075985 100%);
    color: #fff;
    box-shadow:
        0 28px 75px rgba(5, 90, 73, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dash-expedition::before {
    content: '';
    position: absolute;
    inset: 0 0 0 26%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.13;
    background: url('../images/world-map.svg') center / cover no-repeat;
    filter: invert(1) saturate(0) brightness(1.8);
    mask-image: linear-gradient(90deg, transparent, #000 26%, #000);
}

.dash-expedition::after {
    content: '';
    position: absolute;
    right: -120px;
    bottom: -235px;
    width: 520px;
    aspect-ratio: 1;
    border: 1px solid rgba(167, 243, 208, 0.18);
    border-radius: 46% 54% 44% 56%;
    box-shadow:
        0 0 0 34px rgba(167, 243, 208, 0.045),
        0 0 0 76px rgba(167, 243, 208, 0.03),
        0 0 0 124px rgba(125, 211, 252, 0.02);
    transform: rotate(-18deg);
    pointer-events: none;
}

.dash-expedition__content,
.dash-expedition__status {
    position: relative;
    z-index: 2;
}

.dash-expedition__content {
    max-width: 780px;
}

.dash-expedition__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #d1fae5;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}

.dash-expedition__kicker i {
    font-size: 1rem;
}

.dash-expedition h1 {
    max-width: 760px;
    margin: 0 0 0.75rem;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.65rem);
    font-weight: 800;
    letter-spacing: -0.052em;
    line-height: 1.05;
}

.dash-expedition__content > p {
    max-width: 610px;
    margin: 0;
    color: rgba(236, 253, 245, 0.82);
    font-size: 0.96rem;
    line-height: 1.65;
}

.dash-expedition__actions {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1.65rem;
}

.dash-expedition__primary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    width: min(100%, 540px);
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #fff;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.dash-expedition__primary:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.18);
}

.dash-expedition__action-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    color: #047857;
    font-size: 1.45rem;
    box-shadow: 0 10px 24px rgba(2, 44, 34, 0.22);
}

.dash-expedition__action-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dash-expedition__action-copy small {
    margin-bottom: 0.1rem;
    color: #a7f3d0;
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dash-expedition__action-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 0.91rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-expedition__action-copy > span {
    overflow: hidden;
    color: rgba(236, 253, 245, 0.7);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-expedition__action-arrow {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.dash-expedition__primary:hover .dash-expedition__action-arrow {
    transform: translateX(4px);
}

.dash-expedition__plan-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 17px;
    background: rgba(2, 44, 34, 0.18);
    color: #ecfdf5;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dash-expedition__plan-link:hover {
    transform: translateY(-2px);
    background: rgba(2, 44, 34, 0.3);
}

.dash-expedition__status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: rgba(2, 44, 34, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dash-progress-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 142px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: conic-gradient(#a7f3d0 var(--dash-progress), rgba(255, 255, 255, 0.12) 0);
    box-shadow: 0 18px 38px rgba(2, 44, 34, 0.22);
    transition: background 0.5s ease;
}

.dash-progress-ring::before {
    content: '';
    position: absolute;
    width: 118px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(4, 78, 61, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dash-progress-ring__center {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.dash-progress-ring__center strong {
    color: #fff;
    font-size: 1.62rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.dash-progress-ring__center span {
    max-width: 75px;
    margin-top: 0.35rem;
    color: rgba(209, 250, 229, 0.75);
    font-size: 0.57rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.dash-expedition__status-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.08);
}

.dash-expedition__status-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.dash-expedition__status-row > div {
    display: flex;
    flex-direction: column;
}

.dash-expedition__status-row strong {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
}

.dash-expedition__status-row div span {
    margin-top: 0.2rem;
    color: rgba(236, 253, 245, 0.7);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dash-expedition__atlas-label {
    display: flex;
    justify-content: space-between;
    width: 100%;
    color: rgba(209, 250, 229, 0.47);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.dash-expedition__decor {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.dash-expedition__route {
    position: absolute;
    width: 310px;
    height: 110px;
    border-top: 1px dashed rgba(167, 243, 208, 0.26);
    border-radius: 50%;
}

.dash-expedition__route::before,
.dash-expedition__route::after {
    content: '';
    position: absolute;
    top: 1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a7f3d0;
    box-shadow: 0 0 14px rgba(167, 243, 208, 0.8);
}

.dash-expedition__route::before { left: 9%; }
.dash-expedition__route::after { right: 9%; }
.dash-expedition__route--one { left: -110px; bottom: 8px; transform: rotate(13deg); }
.dash-expedition__route--two { right: -95px; top: 35px; transform: rotate(-13deg); }

.dash-expedition__coordinates {
    position: absolute;
    left: 2rem;
    bottom: 1rem;
    color: rgba(209, 250, 229, 0.42);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.53rem;
    font-weight: 700;
    letter-spacing: 0.13em;
}

/* Personalized route cards */
#dashboardView .dash-smart-grid {
    display: grid;
    grid-template-columns: 1.28fr repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 0;
}

#dashboardView .dash-smart-card {
    min-height: 188px;
    padding: 1.35rem;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--smart-accent, #10b981) 18%, var(--border-glass));
    border-radius: 21px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--smart-accent, #10b981) 11%, transparent) 0 4rem, transparent 4.05rem),
        linear-gradient(145deg, color-mix(in srgb, var(--smart-accent, #10b981) 7%, var(--bg-glass)), var(--bg-glass));
    box-shadow: 0 13px 32px rgba(15, 23, 42, 0.055);
}

#dashboardView .dash-smart-card::before {
    inset: 1.25rem auto 1.25rem 0;
    width: 3px;
    border-radius: 0 999px 999px 0;
}

#dashboardView .dash-smart-card::after {
    content: 'ROUTE';
    position: absolute;
    top: 0.8rem;
    right: 0.75rem;
    color: color-mix(in srgb, var(--smart-accent, #10b981) 45%, transparent);
    font: 700 0.47rem/1 ui-monospace, monospace;
    letter-spacing: 0.12em;
}

#dashboardView .dash-smart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.1);
}

#dashboardView .dash-smart-card--primary {
    min-height: 205px;
    background:
        radial-gradient(circle at 96% 2%, rgba(16, 185, 129, 0.14) 0 5rem, transparent 5.05rem),
        linear-gradient(145deg, rgba(236, 253, 245, 0.82), var(--bg-glass));
}

#dashboardView .dash-smart-card--loading {
    pointer-events: none;
}

#dashboardView .dash-smart-card--loading > span {
    display: block;
    width: 74%;
    height: 12px;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.12));
    background-size: 200% 100%;
    animation: dashSkeleton 1.4s ease-in-out infinite;
}

#dashboardView .dash-smart-card--loading > span:nth-child(2) { width: 90%; height: 18px; }
#dashboardView .dash-smart-card--loading > span:nth-child(3) { width: 58%; }

#dashboardView .dash-smart-card__eyebrow {
    margin-bottom: 0.8rem;
    font-size: 0.61rem;
    letter-spacing: 0.07em;
}

#dashboardView .dash-smart-card__title {
    font-size: 1.02rem;
    letter-spacing: -0.025em;
}

#dashboardView .dash-smart-card__desc {
    font-size: 0.79rem;
}

#dashboardView .dash-smart-card__meta {
    font-size: 0.7rem;
}

/* Academy route visualization */
.dash-route-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
    gap: 1.5rem 2rem;
    padding: 1.6rem;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 24px;
    background:
        linear-gradient(rgba(16, 185, 129, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.025) 1px, transparent 1px),
        linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(248, 250, 252, 0.78));
    background-size: 52px 52px, 52px 52px, auto;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.055);
}

.dash-route-card::after {
    content: '';
    position: absolute;
    right: -100px;
    bottom: -190px;
    width: 380px;
    aspect-ratio: 1;
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 48% 52% 45% 55%;
    box-shadow: 0 0 0 28px rgba(16, 185, 129, 0.025), 0 0 0 62px rgba(14, 165, 233, 0.016);
    pointer-events: none;
}

.dash-route-card__map,
.dash-route-summary,
.dash-route-track,
.dash-route-next {
    position: relative;
    z-index: 1;
}

.dash-route-card__map {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    color: rgba(4, 120, 87, 0.45);
    font: 700 0.53rem/1 ui-monospace, monospace;
    letter-spacing: 0.13em;
}

.dash-route-summary {
    grid-column: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.dash-route-summary > div {
    display: flex;
    flex-direction: column;
}

.dash-route-summary span {
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dash-route-summary strong {
    margin-top: 0.15rem;
    color: var(--text-primary);
    font-size: 1.6rem;
    letter-spacing: -0.04em;
}

#dashRouteCount {
    color: #059669;
    font-family: ui-monospace, monospace;
    font-size: 0.65rem;
}

.dash-route-track {
    grid-column: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 74px;
    margin: 0.25rem 0 0.2rem;
}

.dash-route-track::before,
.dash-route-track__fill {
    content: '';
    position: absolute;
    left: 24px;
    right: 24px;
    top: 21px;
    height: 3px;
    border-radius: 999px;
}

.dash-route-track::before {
    background: rgba(148, 163, 184, 0.16);
}

.dash-route-track__fill {
    right: auto;
    width: 0;
    background: linear-gradient(90deg, #047857, #34d399, #0ea5e9);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.28);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-route-node {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 48px;
    color: var(--text-muted);
}

.dash-route-node i {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 4px solid var(--bg-surface);
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16);
    font-size: 1rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.dash-route-node small {
    color: inherit;
    font-size: 0.6rem;
    font-weight: 700;
}

.dash-route-node.is-complete,
.dash-route-node.is-current {
    color: #047857;
}

.dash-route-node.is-complete i {
    background: #d1fae5;
    color: #047857;
}

.dash-route-node.is-current i {
    transform: scale(1.08);
    background: linear-gradient(145deg, #047857, #10b981);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.1), 0 10px 20px rgba(5, 150, 105, 0.17);
}

.dash-route-next {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: stretch;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 17px;
    background: rgba(16, 185, 129, 0.065);
    transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.dash-route-next:hover {
    transform: translateY(-3px);
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.1);
}

.dash-route-next__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, #047857, #10b981);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(5, 150, 105, 0.17);
}

.dash-route-next > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dash-route-next small {
    color: #059669;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dash-route-next strong {
    margin: 0.15rem 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-route-next span span {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.dash-route-next > i {
    color: #059669;
}

/* Tool library */
.dash-tools-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
}

.dash-tool-filters {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.dash-tool-filters button,
.dash-tools-toggle {
    min-height: 36px;
    padding: 0.48rem 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-secondary);
    font: 700 0.68rem/1 var(--font-body);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dash-tool-filters button:hover,
.dash-tools-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(16, 185, 129, 0.22);
    color: #047857;
}

.dash-tool-filters button.is-active {
    border-color: rgba(5, 150, 105, 0.12);
    background: linear-gradient(135deg, #047857, #10b981);
    color: #fff;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.16);
}

.dash-tools-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.dash-tools-toggle i {
    transition: transform 0.25s ease;
}

.dash-tools-toggle[aria-expanded='true'] i {
    transform: rotate(180deg);
}

.dash-tools-toggle[hidden] {
    display: none !important;
}

#dashboardView .dash-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 0;
}

#dashboardView .dash-qcard {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.15rem 0.85rem;
    min-height: 112px;
    padding: 1rem;
    overflow: hidden;
    border-color: rgba(15, 23, 42, 0.07);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, var(--card-soft, rgba(16, 185, 129, 0.1)) 0 3rem, transparent 3.05rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.72));
    box-shadow: 0 11px 26px rgba(15, 23, 42, 0.045);
}

#dashboardView .dash-qcard[hidden] {
    display: none !important;
}

#dashboardView .dash-qcard::after {
    content: '/' attr(data-tool-index);
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    color: color-mix(in srgb, var(--card-accent, #10b981) 45%, transparent);
    font: 700 0.44rem/1 ui-monospace, monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#dashboardView .dash-qcard:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--card-accent, #10b981) 35%, transparent);
    box-shadow: 0 17px 38px rgba(15, 23, 42, 0.085);
}

#dashboardView .dash-qcard__icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 14px;
}

#dashboardView .dash-qcard__icon i {
    font-size: 1.4rem;
}

#dashboardView .dash-qcard__title {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    min-width: 0;
    margin: 0;
    padding-right: 0.2rem;
    font-size: 0.86rem;
    letter-spacing: -0.015em;
}

#dashboardView .dash-qcard__desc {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.69rem;
    line-height: 1.35;
}

#dashboardView .dash-qcard__arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 31px;
    height: 31px;
    margin: 0;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Progress snapshot */
#dashboardView .dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 0;
}

#dashboardView .dash-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    padding: 1.25rem;
    overflow: hidden;
    border-color: rgba(15, 23, 42, 0.07);
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, var(--card-soft, rgba(16, 185, 129, 0.1)) 0 4rem, transparent 4.05rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.72));
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

#dashboardView .dash-stat::after {
    content: '';
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--card-accent, #10b981);
    opacity: 0.7;
}

#dashboardView .dash-stat:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--card-accent, #10b981) 30%, transparent);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.085);
}

#dashboardView .dash-stat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

#dashboardView .dash-stat__icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

#dashboardView .dash-stat__icon i {
    font-size: 1.25rem;
}

.dash-stat__context {
    color: var(--card-accent, #059669);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#dashboardView .dash-stat__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

#dashboardView .dash-stat__value {
    margin: 0.25rem 0 0;
    color: var(--text-primary);
    font-size: clamp(1.65rem, 2.5vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.dash-stat__note {
    margin-top: auto;
    padding-top: 0.8rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    line-height: 1.35;
}

.dash-stat__meter {
    height: 4px;
    margin-top: 0.7rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.13);
}

.dash-stat__meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #047857, #34d399);
    transition: width 0.5s ease;
}

/* Recommendations */
#dashboardView .dash-rec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 0;
}

#dashboardView .dash-rec-card {
    min-height: 210px;
    padding: 1.25rem;
    overflow: hidden;
    border-color: rgba(15, 23, 42, 0.07);
    border-radius: 20px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--rec-accent, #10b981) 12%, transparent) 0 4rem, transparent 4.05rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.72));
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

#dashboardView .dash-rec-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--rec-accent, #10b981) 32%, transparent);
    box-shadow: 0 19px 42px rgba(15, 23, 42, 0.09);
}

#dashboardView .dash-rec-card__emoji {
    width: 47px;
    height: 47px;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--rec-accent, #10b981) 11%, transparent);
    color: var(--rec-accent, #059669);
    font-size: 1.35rem;
}

#dashboardView .dash-rec-card__title {
    padding-right: 4rem;
    font-size: 0.96rem;
    letter-spacing: -0.02em;
}

#dashboardView .dash-rec-card__desc {
    margin: 0.35rem 0 0;
    font-size: 0.73rem;
    line-height: 1.45;
}

#dashboardView .dash-rec-card__tag {
    top: 1rem;
    right: 1rem;
    border: 1px solid color-mix(in srgb, var(--rec-accent, #10b981) 17%, transparent);
    background: color-mix(in srgb, var(--rec-accent, #10b981) 9%, transparent);
    color: var(--rec-accent, #059669) !important;
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dash-rec-card__reason {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.9rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
}

.dash-rec-card__reason i {
    color: var(--rec-accent, #059669);
}

@keyframes dashSkeleton {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Dark theme */
[data-theme='dark'] #dashboardView::before {
    background:
        radial-gradient(circle at 12% 10%, rgba(16, 185, 129, 0.07), transparent 27rem),
        radial-gradient(circle at 92% 35%, rgba(14, 165, 233, 0.045), transparent 30rem),
        linear-gradient(rgba(52, 211, 153, 0.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52, 211, 153, 0.016) 1px, transparent 1px);
    background-size: auto, auto, 68px 68px, 68px 68px;
}

[data-theme='dark'] .dash-expedition {
    border-color: rgba(52, 211, 153, 0.16);
    background: linear-gradient(120deg, #022c22, #064e3b 48%, #083344 100%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] #dashboardView .dash-smart-card,
[data-theme='dark'] #dashboardView .dash-smart-card--primary,
[data-theme='dark'] .dash-route-card,
[data-theme='dark'] #dashboardView .dash-qcard,
[data-theme='dark'] #dashboardView .dash-stat,
[data-theme='dark'] #dashboardView .dash-rec-card {
    border-color: rgba(255, 255, 255, 0.065);
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--card-accent, var(--smart-accent, var(--rec-accent, #10b981))) 10%, transparent) 0 4rem, transparent 4.05rem),
        linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(7, 20, 32, 0.86));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

[data-theme='dark'] .dash-route-card {
    background:
        linear-gradient(rgba(52, 211, 153, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52, 211, 153, 0.02) 1px, transparent 1px),
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(7, 20, 32, 0.9));
    background-size: 52px 52px, 52px 52px, auto;
}

[data-theme='dark'] .dash-route-node i {
    border-color: #0f172a;
    background: #1e293b;
}

[data-theme='dark'] .dash-route-node.is-complete i {
    background: rgba(6, 95, 70, 0.85);
    color: #a7f3d0;
}

[data-theme='dark'] .dash-tool-filters button,
[data-theme='dark'] .dash-tools-toggle {
    border-color: rgba(255, 255, 255, 0.07);
    background: rgba(15, 23, 42, 0.64);
}

[data-theme='dark'] .dash-tool-filters button.is-active {
    background: linear-gradient(135deg, #047857, #10b981);
    color: #fff;
}

/* Accessible focus */
#dashboardView :is(a, button):focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.42);
    outline-offset: 3px;
}


/* ================================================================
   v2.1 additions - resume slot, merged next-steps, real route nodes,
   honest stats, 7-day activity strip, past-paper progress
   ================================================================ */

/* Next-steps grid: 1 primary + up to 3 secondary */
#dashboardView .dash-smart-grid[data-count='4'] {
    grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
}

#dashboardView .dash-smart-grid[data-count='3'] {
    grid-template-columns: 1.2fr 1fr 1fr;
}

#dashboardView .dash-smart-grid[data-count='2'] {
    grid-template-columns: 1.2fr 1fr;
}

.dash-smart-card__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-smart-card__icon {
    font-size: 1rem;
    color: var(--smart-accent, #10b981);
}

.dash-smart-card__bar {
    display: block;
    height: 4px;
    margin: 0.7rem 0 0.2rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.dash-smart-card__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--smart-accent, #10b981);
    transition: width 0.5s ease;
}

.dash-smart-card__reason {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 600;
}

.dash-smart-card__reason i {
    color: var(--smart-accent, #059669);
}

/* Route: real unit nodes (links). Nodes are equal-width flex items, so the
   connecting line runs from the centre of the first node to the centre of the last. */
.dash-route-track {
    --route-nodes: 7;
    gap: 0.25rem;
}

.dash-route-track::before,
.dash-route-track__fill {
    left: calc(50% / var(--route-nodes));
    right: calc(50% / var(--route-nodes));
}

.dash-route-track__fill {
    right: auto;
}

a.dash-route-node {
    flex: 1 1 0;
    min-width: 0;
    text-decoration: none;
    text-align: center;
    border-radius: 12px;
    padding: 0.2rem 0.1rem 0.3rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

a.dash-route-node:hover {
    transform: translateY(-2px);
    color: #047857;
}

a.dash-route-node:hover i {
    transform: scale(1.08);
}

.dash-route-node i b {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 800;
}

.dash-route-node.is-complete i b,
.dash-route-node.is-current i b {
    display: none;
}

.dash-route-node small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    padding: 0 0.15rem;
    font-size: 0.58rem;
    line-height: 1.25;
}

.dash-route-node > span {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.dash-route-node.is-complete > span { color: #047857; }

/* Stats: skeleton + empty state + link tile */
.dash-stat__skeleton {
    display: inline-block;
    width: 3.2em;
    height: 0.85em;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.12) 25%, rgba(148, 163, 184, 0.28) 50%, rgba(148, 163, 184, 0.12) 75%);
    background-size: 200% 100%;
    animation: dashSkeleton 1.4s linear infinite;
    vertical-align: middle;
}

#dashboardView .dash-stats-grid[data-state='empty'] .dash-stat__value {
    color: var(--text-muted);
}

#dashboardView a.dash-stat {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.dash-stat__note--action {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--card-accent, #f43f5e);
    font-weight: 700;
}

.dash-stat__note--action i {
    transition: transform 0.2s ease;
}

#dashboardView a.dash-stat:hover .dash-stat__note--action i {
    transform: translateX(3px);
}

/* 7-day activity strip */
.dash-activity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 13px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.72));
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.dash-activity__head {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.dash-activity__head > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-activity__head strong {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.dash-activity__head span {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.dash-activity__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #059669;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dash-activity__strip {
    display: flex;
    gap: 0.5rem;
}

.dash-activity__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.dash-activity__dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 9px;
    background: rgba(148, 163, 184, 0.08);
    color: #fff;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.dash-activity__day.is-active .dash-activity__dot {
    border-color: transparent;
    background: linear-gradient(145deg, #047857, #10b981);
    box-shadow: 0 6px 14px rgba(5, 150, 105, 0.28);
}

.dash-activity__day.is-today .dash-activity__dot {
    outline: 2px solid rgba(14, 165, 233, 0.45);
    outline-offset: 2px;
}

.dash-activity__day small {
    color: var(--text-muted);
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dash-activity__day.is-active small { color: #047857; }

/* Past-paper cover progress */
.dash-cover-card {
    position: relative;
}

.dash-cover-card__progress {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.3);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
}

.dash-cover-card__progress[hidden] { display: none; }

.dash-cover-card__progress span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dash-cover-card__progress i { color: #059669; }
.dash-cover-card[data-paper-state='active'] .dash-cover-card__progress span:first-child { color: #047857; }
.dash-cover-card[data-paper-state='active'] .dash-cover-card__progress span:first-child i { color: #f59e0b; }

.dash-cover-card[data-paper-state='active']::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

/* Badges */
#dashboardView .dash-qcard__title--badged {
    display: flex;
    align-items: center;
    gap: 6px;
}

.study-sidebar__badge--game {
    background: rgba(6, 182, 212, 0.15);
    color: #0891b2;
}

/* Dark theme for new pieces */
[data-theme='dark'] .dash-activity {
    border-color: rgba(255, 255, 255, 0.065);
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(7, 20, 32, 0.86));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

[data-theme='dark'] .dash-activity__dot {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .dash-activity__link,
[data-theme='dark'] .dash-activity__day.is-active small,
[data-theme='dark'] .dash-route-node.is-complete > span,
[data-theme='dark'] a.dash-route-node:hover { color: #6ee7b7; }

[data-theme='dark'] .dash-route-node.is-complete,
[data-theme='dark'] .dash-route-node.is-current { color: #6ee7b7; }

[data-theme='dark'] .dash-cover-card__progress { border-top-color: rgba(255, 255, 255, 0.12); }
[data-theme='dark'] .study-sidebar__badge--game { color: #22d3ee; }

/* Responsive layout */
@media (max-width: 1220px) {
    #dashboardView .dash-smart-grid,
    #dashboardView .dash-smart-grid[data-count='4'],
    #dashboardView .dash-smart-grid[data-count='3'] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 4 cards → clean 2×2; otherwise the primary card spans the top row */
    #dashboardView .dash-smart-grid:not([data-count='4']) .dash-smart-card--primary {
        grid-column: span 2;
    }

    #dashboardView .dash-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #dashboardView .dash-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    #dashboardView::before { left: 0; }

    .dash-expedition {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .dash-expedition__status {
        display: grid;
        grid-template-columns: auto minmax(150px, 1fr);
        justify-self: stretch;
        align-items: center;
    }

    .dash-progress-ring {
        grid-row: 1 / span 2;
        width: 116px;
    }

    .dash-progress-ring::before { width: 96px; }
    .dash-expedition__atlas-label { grid-column: 2; }

    .dash-route-card {
        grid-template-columns: 1fr;
    }

    .dash-route-summary,
    .dash-route-track,
    .dash-route-next {
        grid-column: 1;
    }

    .dash-route-next {
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    #dashboardView {
        padding: 18px 14px 64px;
    }

    #dashboardView .dash-section { margin-bottom: 34px; }

    .dash-expedition {
        margin-bottom: 34px;
        padding: 1.55rem;
        border-radius: 25px;
    }

    .dash-expedition h1 { font-size: clamp(2rem, 10vw, 2.8rem); }

    .dash-expedition__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dash-expedition__primary { width: 100%; }
    .dash-expedition__plan-link { min-height: 44px; }

    .dash-expedition__status {
        grid-template-columns: 96px minmax(0, 1fr);
        padding: 1rem;
    }

    .dash-progress-ring { width: 90px; }
    .dash-progress-ring::before { width: 74px; }
    .dash-progress-ring__center strong { font-size: 1.2rem; }
    .dash-progress-ring__center span { max-width: 60px; font-size: 0.45rem; }
    .dash-expedition__coordinates { left: 1.55rem; }

    #dashboardView .dash-smart-grid,
    #dashboardView .dash-smart-grid[data-count='4'],
    #dashboardView .dash-smart-grid[data-count='3'],
    #dashboardView .dash-smart-grid[data-count='2'],
    #dashboardView .dash-quick-grid,
    #dashboardView .dash-stats-grid,
    #dashboardView .dash-rec-grid {
        grid-template-columns: 1fr;
    }

    #dashboardView .dash-smart-card--primary { grid-column: auto; }

    .dash-route-card {
        padding: 1.2rem;
        border-radius: 20px;
    }

    .dash-route-node small { display: none; }
    .dash-route-node > span { display: none; }
    .dash-route-track { min-height: 52px; }

    .dash-activity {
        align-items: stretch;
        flex-direction: column;
        gap: 0.9rem;
    }

    .dash-activity__head { justify-content: space-between; }
    .dash-activity__strip { justify-content: space-between; }

    .dash-tools-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .dash-tool-filters {
        margin-inline: -14px;
        padding: 0.1rem 14px 0.3rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .dash-tool-filters button { flex: 0 0 auto; }
    .dash-tools-toggle { align-self: flex-start; }

    #dashboardView .dash-qcard {
        min-height: 104px;
    }
}

@media (max-width: 450px) {
    .dash-expedition__primary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .dash-expedition__action-arrow { display: none; }
    .dash-expedition__status { grid-template-columns: 82px minmax(0, 1fr); }
    .dash-progress-ring { width: 78px; }
    .dash-progress-ring::before { width: 64px; }
    .dash-expedition__atlas-label { flex-direction: column; gap: 0.3rem; }
    .dash-route-card__map { display: none; }
    .dash-route-next { grid-template-columns: auto minmax(0, 1fr); }
    .dash-route-next > i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    #dashboardView *,
    #dashboardView *::before,
    #dashboardView *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
