/* Dashboard stays inside the existing app shell and theme tokens. */
#view-dashboard {
    overflow-y: auto;
    background: var(--psx-main-bg, #f4f4f5);
    container: dashboard / inline-size;
}
.psx-dashboard {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 40px 56px;
    color: var(--psx-card-foreground);
    font-variant-numeric: tabular-nums;
}
.psx-dashboard h1,
.psx-dashboard h2,
.psx-dashboard h3,
.psx-dashboard p { margin: 0; color: inherit; }
.psx-dashboard h1 { font-size: 24px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.psx-dashboard h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.psx-dashboard h3 { font-size: 13px; font-weight: 500; line-height: 1.5; }
.psx-dashboard button { font-family: inherit; letter-spacing: 0; text-transform: none; cursor: pointer; }
.psx-dashboard-welcome,
.psx-dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.psx-dashboard-welcome { margin-bottom: 32px; flex-wrap: wrap; }
.psx-dashboard-section-heading { min-height: 36px; margin-bottom: 12px; }
.psx-dashboard-link,
.psx-dashboard-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--psx-muted-foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
}
.psx-dashboard-header-actions { display: flex; align-items: center; flex: 0 0 auto; margin-inline-start: auto; }
.plagscanx-app-header .psx-dashboard-header-actions { margin-inline-start: 0; }
.psx-dashboard-header-actions[hidden] { display: none !important; }
.plagscanx-app-header:is(.is-dashboard, .is-reports) { height: auto; min-height: 48px; flex: 0 0 auto; gap: 12px; padding-block: 6px; }
.plagscanx-app-header:is(.is-dashboard, .is-reports) .header-left { min-width: 0; }
.plagscanx-app-header:is(.is-dashboard, .is-reports) .header-left h2 { overflow-wrap: anywhere; }
.psx-dashboard-new-analysis { max-width: 100%; height: 28px; min-height: 28px; gap: 4px; padding: 0 14px; font-size: 12px; line-height: 1; white-space: normal; text-align: start; }
.psx-dashboard-new-analysis .psx-icon { width: 14px; height: 14px; }
.psx-dashboard-new-analysis:focus-visible { outline: 2px solid var(--psx-primary); outline-offset: 3px; }
.psx-dashboard-new-analysis span { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 901px) {
    .plagscanx-app-header,
    .plagscanx-app-header:is(.is-dashboard, .is-reports) { height: 48px; min-height: 48px; flex: 0 0 48px; padding-block: 0; }
    .plagscanx-app-header .header-left { flex: 0 1 auto; }
    .plagscanx-app-header .header-left h2 { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .plagscanx-app-header .header-info-icon { flex-shrink: 0; }
    .plagscanx-app-header .header-right { flex: 0 0 auto; }
    .plagscanx-app-header .psx-dashboard-new-analysis { white-space: nowrap; }
}
.psx-dashboard-link { color: var(--psx-link); flex-shrink: 0; }
.psx-dashboard .psx-icon { width: 18px; height: 18px; flex-shrink: 0; }
.psx-dashboard-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.psx-dashboard-start > .psx-dashboard-analysis-start { grid-column: 1; }
.psx-dashboard-start > .psx-dashboard-tools { grid-column: 2; }
.psx-dashboard-start > .psx-dashboard-account { grid-column: 3; }
.psx-dashboard-start > .psx-dashboard-state { grid-column: 1 / -1; }
.psx-dashboard-analysis { min-width: 0; }
.psx-dashboard-analysis-start { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; width: 100%; min-height: 214px; padding: 24px; text-align: start; background: var(--psx-card, #fff); color: var(--psx-text); border: 1px solid var(--psx-border); border-radius: 20px; box-shadow: none; transition: border-color 140ms ease, transform 140ms ease; }
.psx-dashboard-analysis-start strong { font-size: 18px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.psx-dashboard-analysis-description { margin-top: 6px; font-size: 16px; line-height: 1.45; color: var(--psx-muted-foreground); overflow-wrap: anywhere; }
.psx-dashboard-analysis-icon, .psx-dashboard-tool-icon-wrap { display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: color-mix(in srgb, var(--psx-primary) 9%, var(--psx-card, #fff)); color: var(--psx-primary); transition: background-color 140ms ease, color 140ms ease; }
.psx-dashboard-analysis-icon { width: 48px; height: 48px; margin-bottom: 14px; }
.psx-dashboard-analysis-icon .psx-icon { width: 24px; height: 24px; }
.psx-dashboard-tools { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; min-height: 214px; padding: 10px; border: 1px solid var(--psx-border); border-radius: 20px; background: var(--psx-card, #fff); }
.psx-dashboard-tools:empty { display: none; }
.psx-dashboard-tool {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-height: 56px;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--psx-card-foreground);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    text-align: start;
    box-shadow: none;
    transition: background-color 150ms ease, border-color 150ms ease;
}
.psx-dashboard-tool > span:not(.screen-reader-text):not(.psx-dashboard-tool-icon-wrap) { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.psx-dashboard-tool-icon-wrap { width: 36px; height: 36px; }
.psx-dashboard-tool .psx-dashboard-tool-icon { width: 18px; height: 18px; color: inherit; }
.psx-dashboard-tool .psx-dashboard-tool-arrow { margin-inline-start: auto; width: 16px; height: 16px; color: var(--psx-muted-foreground); }
.psx-dashboard-tool .psx-dashboard-tool-arrow.psx-crown-icon { color: #eab308; fill: rgba(234, 179, 8, 0.2); }
.psx-dashboard-tool:hover { background: var(--psx-muted); border-color: var(--psx-border-strong); color: var(--psx-card-foreground); }
.psx-dashboard-analysis-start:hover { border-color: var(--psx-border-strong); transform: translateY(-2px); }
.psx-dashboard-analysis-start:is(:hover, :focus-visible) .psx-dashboard-analysis-icon,
.psx-dashboard-tool:is(:hover, :focus-visible) .psx-dashboard-tool-icon-wrap { background: var(--psx-primary); color: var(--psx-primary-foreground, #fff); }
.psx-dashboard-link:hover,
.psx-dashboard-home:hover { color: var(--psx-link); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.psx-dashboard button:focus-visible,
.psx-dashboard-home:focus-visible { outline: 2px solid var(--psx-link); outline-offset: 3px; }
.psx-dashboard-columns { margin-top: 40px; }
.psx-dashboard-reports { min-width: 0; }
#psx-dashboard-reports-title { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--psx-muted-foreground); }
.psx-dashboard-reports .psx-dashboard-link .psx-icon { width: 14px; height: 14px; }
#psx-dashboard-reports { background: var(--psx-card, #fff); border: 1px solid var(--psx-border); border-radius: 20px; overflow: hidden; }
.psx-dashboard-report {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 20px;
    align-items: center;
    width: 100%;
    gap: 16px;
    min-height: 80px;
    padding: 16px 20px;
    background: transparent;
    color: var(--psx-card-foreground);
    border: 0;
    border-bottom: 1px solid var(--psx-border);
    border-radius: 0;
    box-shadow: none;
    text-align: start;
    font-size: 13px;
    line-height: 1.5;
}
.psx-dashboard-report:hover { background: var(--psx-muted); color: var(--psx-card-foreground); }
.psx-dashboard-report:last-child { border-bottom: 0; }
.psx-dashboard .psx-dashboard-report:focus-visible { outline-offset: -3px; }
.psx-dashboard-report:disabled { opacity: .7; cursor: wait; }
.psx-dashboard-report > .psx-icon { color: var(--psx-muted-foreground); }
.psx-dashboard-report-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--psx-muted-foreground); }
.psx-dashboard-report-icon .psx-icon { width: 22px; height: 22px; }
.psx-dashboard-report-copy { min-width: 0; display: grid; gap: 3px; }
.psx-dashboard-report-heading { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; }
.psx-dashboard-report-heading strong { font-size: 13px; font-weight: 600; }
.psx-dashboard-report-preview { color: var(--psx-card-foreground); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; }
.psx-dashboard-report-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; color: var(--psx-muted-foreground); font-size: 13px; }
.psx-dashboard-report-date { min-width: 0; overflow-wrap: anywhere; }
.psx-dashboard-report-words { display: inline-flex; align-items: center; gap: 12px; }
.psx-dashboard-report-words::before { content: '\00b7'; }
.psx-dashboard-report-meta .psx-report-scores { min-width: 0; gap: 6px; }
.psx-dashboard-report-meta .psx-report-badge { min-width: 0; max-width: 100%; padding: 3px 8px; gap: 4px; }
.psx-dashboard-report-meta .psx-report-badge > span { min-width: 0; overflow-wrap: anywhere; }
.psx-dashboard-report-meta .psx-report-badge strong { white-space: nowrap; font-size: inherit; }
#psx-dashboard-reports .psx-dashboard-state { padding: 24px 20px; }
#psx-dashboard-reports > .psx-dashboard-link { margin: 0 20px 20px; }
.psx-dashboard-report-score { color: var(--psx-muted-foreground); font-size: 12px; }
.psx-dashboard .psx-dashboard-state { padding: 32px 0; color: var(--psx-muted-foreground); font-size: 14px; }
.psx-dashboard .psx-dashboard-state .psx-icon { display: block; width: 28px; height: 28px; margin-bottom: 12px; }
.psx-dashboard-account { position: relative; isolation: isolate; display: flex; min-width: 0; min-height: 214px; overflow: hidden; border-radius: 20px; background: #222226; transition: transform 140ms ease; }
.psx-dashboard-account-image { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: left 12%; }
.psx-dashboard-account::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(14, 14, 16, .92), rgba(14, 14, 16, .74) 30%, rgba(14, 14, 16, .3) 56%, rgba(14, 14, 16, .08) 78%, transparent); pointer-events: none; }
.psx-dashboard-account > .psx-dashboard-account-gem { position: absolute; z-index: 2; right: -34px; top: -46px; width: 180px; height: 180px; color: var(--psx-promo-icon-color, var(--psx-primary)); opacity: .9; pointer-events: none; }
.psx-dashboard-offer { position: relative; z-index: 3; display: flex; flex: 1; flex-direction: column; align-items: flex-start; justify-content: flex-end; width: 100%; min-width: 0; min-height: 214px; padding: 24px; border: 0; border-radius: inherit; background: transparent; color: #fff; text-align: start; text-decoration: none; box-shadow: none; }
.psx-dashboard-offer:hover { background: transparent; color: #fff; }
.psx-dashboard-offer-title { font-size: 22px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.psx-dashboard-offer-description { max-width: 24ch; margin-top: 6px; font-size: 13px; font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.psx-dashboard-account:hover { transform: translateY(-2px); }
.psx-dashboard-account:focus-within { outline: 2px solid var(--psx-primary); outline-offset: 3px; }
.psx-dashboard .psx-dashboard-offer:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }
.psx-dashboard-offer:disabled { cursor: wait; }
.psx-dashboard-resources { margin-top: 48px; }
.psx-resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.psx-resource { display: block; min-width: 0; color: var(--psx-text); text-decoration: none; border: 1px solid var(--psx-border); border-radius: 8px; overflow: hidden; }
.psx-resource:hover { color: var(--psx-link); border-color: var(--psx-border-strong); }
.psx-resource:focus-visible { outline: 2px solid var(--psx-link); outline-offset: 3px; }
.psx-resource-image { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--psx-muted); color: var(--psx-muted-foreground); overflow: hidden; }
.psx-resource-image img { width: 100%; height: 100%; object-fit: cover; }
.psx-resource-image .psx-icon { width: 32px; height: 32px; }
.psx-resource h3 { padding: 16px; font-size: 15px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.psx-dashboard [hidden] { display: none !important; }
.psx-dashboard .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.psx-dashboard-home { display: none; flex-shrink: 0; width: 32px; height: 32px; }
.psx-dashboard-home .psx-icon { width: 18px; height: 18px; }
@container dashboard (max-width: 850px) {
    .psx-dashboard { padding: 24px; }
    .psx-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .psx-dashboard-start { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .psx-dashboard-start > :is(.psx-dashboard-analysis-start, .psx-dashboard-tools, .psx-dashboard-account) { grid-column: auto; }
}
@container dashboard (max-width: 600px) { .psx-dashboard-start { grid-template-columns: minmax(0, 1fr); } }
@container dashboard (max-width: 480px) {
    .psx-dashboard { padding: 20px 16px; }
    .psx-dashboard h1 { font-size: 20px; }
    .psx-dashboard-welcome { gap: 8px; margin-bottom: 24px; }
    .psx-resource-grid { grid-template-columns: minmax(0, 1fr); }
    .psx-dashboard-columns { margin-top: 24px; }
    .psx-dashboard-report { grid-template-columns: minmax(0, 1fr) 18px; padding: 16px; gap: 12px; }
    .psx-dashboard-report-icon { display: none; }
    .psx-dashboard-report-words::before { display: none; }
}
@media (max-width: 768px) {
    .psx-dashboard-home { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
    .psx-dashboard-tool, .psx-dashboard-analysis-start, .psx-dashboard-account, .psx-dashboard-analysis-icon, .psx-dashboard-tool-icon-wrap { transition: none; }
    .psx-dashboard-analysis-start:hover, .psx-dashboard-account:hover { transform: none; }
}
