/* Dashboard stays inside the existing app shell and theme tokens. */
#view-dashboard {
    overflow-y: auto;
    background: var(--psx-background, #fff);
    container: dashboard / inline-size;
}
.psx-dashboard {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px;
    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-new-analysis { max-width: 100%; min-height: 40px; gap: 8px; white-space: normal; text-align: start; }
.psx-dashboard-new-analysis span { min-width: 0; overflow-wrap: anywhere; }
.psx-dashboard-link { color: var(--psx-link); flex-shrink: 0; }
.psx-dashboard .psx-icon { width: 18px; height: 18px; flex-shrink: 0; }
.psx-dashboard-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.psx-dashboard-tool {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    min-height: 112px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-lg, 7.2px);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    box-shadow: none;
    transition: background-color 150ms ease, border-color 150ms ease;
}
.psx-dashboard-tool > span:not(.screen-reader-text) { overflow-wrap: anywhere; }
.psx-dashboard-tool .psx-dashboard-tool-icon { width: 22px; height: 22px; color: var(--psx-link); }
.psx-dashboard-tool .psx-dashboard-tool-arrow { position: absolute; top: 17px; right: 14px; width: 15px; height: 15px; color: var(--psx-muted-foreground); }
.psx-dashboard-tool:hover { background: var(--psx-muted); border-color: var(--psx-border-strong); color: var(--psx-card-foreground); }
.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 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; margin-top: 32px; }
.psx-dashboard-reports,
.psx-dashboard-usage { min-width: 0; }
.psx-dashboard-usage { border-left: 1px solid var(--psx-border); padding-left: 28px; }
.psx-dashboard-report {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    align-items: center;
    width: 100%;
    gap: 12px;
    min-height: 100px;
    padding: 18px 8px;
    background: transparent;
    color: var(--psx-card-foreground);
    border: 0;
    border-bottom: 1px solid var(--psx-border);
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
}
.psx-dashboard-report:hover { background: var(--psx-muted); color: var(--psx-card-foreground); }
.psx-dashboard-report:disabled { opacity: .7; cursor: wait; }
.psx-dashboard-report > .psx-icon { color: var(--psx-muted-foreground); }
.psx-dashboard-report-copy { min-width: 0; display: grid; gap: 6px; }
.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; }
.psx-dashboard-report-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--psx-muted-foreground); font-size: 12px; }
.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-usage-row { padding: 16px 0; border-bottom: 1px solid var(--psx-border); }
.psx-dashboard-remaining { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.psx-dashboard-track { height: 5px; margin: 10px 0 6px; overflow: hidden; border-radius: 3px; background: var(--psx-border); }
.psx-dashboard-track span { display: block; height: 100%; width: 0; background: var(--psx-link); }
.psx-dashboard-track span.usage-medium { background: var(--psx-risk-medium); }
.psx-dashboard-track span.usage-high { background: var(--psx-risk-high); }
.psx-dashboard-used,
.psx-dashboard .psx-dashboard-reset,
.psx-dashboard .psx-dashboard-extra { color: var(--psx-muted-foreground); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.psx-dashboard .psx-dashboard-reset,
.psx-dashboard .psx-dashboard-extra { margin-top: 4px; }
.psx-dashboard-account { margin-top: 20px; }
.psx-dashboard-account .plagscanx-btn-primary { width: 100%; justify-content: center; gap: 8px; white-space: normal; }
.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; }
#plagscanx-new-analysis-modal { z-index: 100001; }
.psx-tool-picker .psx-modal-title { margin: 0 36px 20px 0; font-size: 20px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.psx-tool-picker-list { list-style: none; padding: 0; margin: 0; }
.psx-tool-picker-list li { list-style: none; padding: 0; margin: 0; }
.psx-tool-picker-list li + li { border-top: 1px solid var(--psx-border); }
.plagscanx-app-overlay .psx-tool-picker-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 60px;
    padding: 14px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--psx-popover-foreground);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0;
    text-align: start;
    cursor: pointer;
    box-shadow: none;
}
.psx-tool-picker-option > span { min-width: 0; overflow-wrap: anywhere; }
.psx-tool-picker-option .psx-icon { width: 20px; height: 20px; }
.psx-tool-picker-option .psx-tool-picker-icon { color: var(--psx-link); }
.psx-tool-picker-option .psx-tool-picker-arrow { width: 16px; height: 16px; color: var(--psx-muted-foreground); }
.plagscanx-app-overlay .psx-tool-picker-option:hover { background: var(--psx-muted); color: var(--psx-popover-foreground); }
.psx-tool-picker-option:focus-visible { outline: 2px solid var(--psx-link); outline-offset: 2px; }
.psx-tool-picker .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.psx-tool-picker-empty { margin: 0; font-size: 14px; line-height: 1.6; color: var(--psx-muted-foreground); }
@container dashboard (max-width: 850px) {
    .psx-dashboard { padding: 24px; }
    .psx-dashboard-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .psx-dashboard-columns { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .psx-dashboard-usage { padding-left: 0; border-left: 0; }
}
@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-dashboard-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .psx-dashboard-tool { min-height: 106px; padding: 14px; }
    .psx-dashboard-tool:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 80px; }
    .psx-dashboard-columns { margin-top: 24px; }
    .psx-dashboard-report { grid-template-columns: minmax(0, 1fr) 18px; padding: 16px 0; }
    .psx-dashboard-report > .psx-icon:first-child { display: none; }
}
@media (max-width: 768px) {
    .psx-dashboard-home { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
    .psx-dashboard-tool { transition: none; }
}
