:root {
    color-scheme: dark;
    --bg: #080b0a;
    --bg-soft: #0d1210;
    --surface: #121815;
    --surface-2: #171d1a;
    --surface-3: #1d2320;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(242, 198, 109, 0.34);
    --text: #f7faf8;
    --muted: #a8b2ac;
    --subtle: #78847d;
    --gold: #f2c66d;
    --green: #4ccc91;
    --blue: #78aee8;
    --red: #ee7770;
    --purple: #b99cff;
    --radius: 6px;
    --sidebar: 286px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    padding: 10px;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: calc(100vh - 20px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    overflow: hidden;
    background: #080d0b;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 26px 20px;
    border-right: 1px solid var(--line);
    background: #0a0f0d;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(242, 198, 109, 0.58);
    background: #13241e;
    color: var(--gold);
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
}

.brand small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
}

.side-nav {
    display: grid;
    gap: 6px;
}

.side-nav a {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-left: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.94rem;
}

.side-nav a:hover,
.side-nav a.active {
    border-color: var(--gold);
    background: rgba(242, 198, 109, 0.08);
    color: var(--text);
}

.sidebar-note {
    margin-top: auto;
    padding: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-note strong,
.sidebar-note span {
    display: block;
}

.sidebar-note span {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.workspace {
    width: min(100%, 1480px);
    padding: 24px 28px 44px;
}

.view-page {
    display: none;
}

.view-page.active {
    display: block;
}

.view-page > .content-grid,
.view-page > .support-grid,
.view-page > .deploy-panel {
    margin-top: 22px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.section-label {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    line-height: 1.04;
}

h2 {
    font-size: 1.36rem;
    line-height: 1.2;
}

h3 {
    font-size: 1rem;
    line-height: 1.25;
}

.page-copy {
    max-width: 780px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.65;
}

.panel-copy {
    max-width: 640px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.header-actions,
.table-tools {
    display: flex;
    gap: 10px;
    align-items: center;
}

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}

.button.primary {
    border-color: rgba(242, 198, 109, 0.72);
    background: rgba(242, 198, 109, 0.12);
    color: var(--gold);
}

.button.ghost {
    color: var(--muted);
}

.button.danger {
    border-color: rgba(238, 119, 112, 0.72);
    color: var(--red);
}

.button:disabled,
.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.rounds-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.metric {
    min-height: 108px;
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.metric span {
    color: var(--muted);
    font-size: 0.86rem;
}

.metric strong {
    display: block;
    margin-top: 10px;
    color: var(--gold);
    font-size: 1.95rem;
    line-height: 1;
}

.metric small {
    display: block;
    margin-top: 10px;
    color: var(--subtle);
    font-size: 0.78rem;
    line-height: 1.4;
}

.panel {
    margin-top: 22px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.view-page > .panel:first-child,
.view-page > .support-grid:first-child .panel {
    margin-top: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.panel-head.compact {
    align-items: center;
}

.panel-head p:not(.section-label) {
    max-width: 560px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.category-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 20px 20px;
}

.category-tab {
    min-height: 112px;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.category-tab:hover,
.category-tab.active {
    border-color: var(--line-strong);
    background: #1a211c;
}

.category-tab strong,
.category-tab span {
    display: block;
}

.category-tab span {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.8fr);
    gap: 22px;
    align-items: start;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
    margin-top: 14px;
}

.rounds-grid {
    display: block;
    margin-top: 14px;
}

.dashboard-table-panel,
.dashboard-detail {
    min-height: 620px;
}

.rounds-table-panel {
    min-height: 680px;
}

.dashboard-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.round-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-tools input[type="search"] {
    width: 260px;
}

.round-tools input[type="search"] {
    width: 280px;
}

.round-tools select {
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
}

.refresh-button {
    min-height: 38px;
    min-width: 72px;
    justify-content: center;
    font-weight: 800;
}

.refresh-button.is-refreshing {
    opacity: 0.82;
    cursor: progress;
}

.refresh-button.is-cooling-down {
    opacity: 0.72;
    cursor: wait;
}

.table-wrap {
    overflow-x: auto;
}

.ops-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.88rem;
}

.ops-table th,
.ops-table td {
    height: 58px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    text-align: left;
    vertical-align: middle;
}

.ops-table th:nth-child(1),
.ops-table td:nth-child(1) {
    width: 17%;
}

.ops-table th:nth-child(2),
.ops-table td:nth-child(2) {
    width: 17%;
}

.ops-table th:nth-child(3),
.ops-table td:nth-child(3) {
    width: 10%;
}

.ops-table th:nth-child(4),
.ops-table td:nth-child(4) {
    width: 12%;
}

.ops-table th:nth-child(5),
.ops-table td:nth-child(5) {
    width: 10%;
}

.ops-table th:nth-child(6),
.ops-table td:nth-child(6) {
    width: 13%;
}

.ops-table th:nth-child(7),
.ops-table td:nth-child(7) {
    width: 13%;
}

.ops-table th:nth-child(8),
.ops-table td:nth-child(8) {
    width: 8%;
}

.rounds-table th:nth-child(1),
.rounds-table td:nth-child(1) {
    width: 19%;
}

.rounds-table th:nth-child(2),
.rounds-table td:nth-child(2) {
    width: 11%;
}

.rounds-table th:nth-child(3),
.rounds-table td:nth-child(3) {
    width: 10%;
}

.rounds-table th:nth-child(4),
.rounds-table td:nth-child(4) {
    width: 11%;
}

.rounds-table th:nth-child(5),
.rounds-table td:nth-child(5) {
    width: 8%;
}

.rounds-table th:nth-child(6),
.rounds-table td:nth-child(6) {
    width: 10%;
}

.rounds-table th:nth-child(7),
.rounds-table td:nth-child(7) {
    width: 10%;
}

.rounds-table th:nth-child(8),
.rounds-table td:nth-child(8) {
    width: 8%;
}

.rounds-table th:nth-child(9),
.rounds-table td:nth-child(9) {
    width: 6%;
}

.rounds-table th:nth-child(10),
.rounds-table td:nth-child(10) {
    width: 7%;
}

.ops-table th {
    height: 44px;
    background: rgba(255, 255, 255, 0.035);
    color: #d5ded8;
    font-weight: 700;
}

.ops-table td strong {
    color: var(--text);
    font-weight: 700;
}

.ops-table td small {
    display: block;
    margin-top: 4px;
    color: var(--subtle);
    font-size: 0.74rem;
}

.ops-table tr {
    cursor: default;
}

.ops-table tr:hover,
.ops-table tr.active {
    background: rgba(76, 204, 145, 0.10);
}

.ops-table tr.active td:first-child {
    border-left: 3px solid var(--green);
}

.dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--subtle);
}

.dot.green {
    background: var(--green);
}

.dot.gold {
    background: var(--gold);
}

.dot.red {
    background: var(--red);
}

.icon-button {
    width: 28px;
    height: 28px;
    margin-right: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.table-footer {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

.pager {
    display: flex;
    gap: 8px;
}

.pager button {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

.pager button.active {
    border-color: rgba(76, 204, 145, 0.7);
    background: rgba(76, 204, 145, 0.18);
    color: var(--green);
}

.dashboard-detail {
    padding: 14px;
}

.round-detail-panel {
    padding: 16px;
}

.table-action {
    min-height: 30px;
    width: auto;
    padding: 0 10px;
    border-color: rgba(242, 198, 109, 0.45);
    color: var(--gold);
    font-size: 0.78rem;
}

.table-action:hover {
    border-color: var(--gold);
    background: rgba(242, 198, 109, 0.12);
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.68);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    position: relative;
    width: min(920px, 100%);
    max-height: min(88vh, 900px);
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 1;
    width: 38px;
    height: 38px;
    margin: 0 0 10px 12px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.dashboard-table-panel .panel-head h2 {
    white-space: nowrap;
}

.status-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.status-cards div {
    min-height: 104px;
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.status-cards span,
.status-cards small {
    display: block;
    color: var(--muted);
}

.status-cards strong {
    display: block;
    margin-top: 8px;
    color: var(--green);
    font-size: 1.24rem;
}

.status-cards small {
    margin-top: 8px;
    overflow-wrap: anywhere;
    font-size: 0.76rem;
    line-height: 1.35;
}

.checklist.two-col {
    grid-template-columns: 1fr 1fr;
}

.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding-top: 16px;
}

.project-list {
    display: grid;
}

.project-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(130px, 0.7fr) minmax(220px, 1.2fr);
    gap: 16px;
    align-items: center;
    min-height: 104px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

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

.project-row:hover,
.project-row.active {
    background: rgba(242, 198, 109, 0.06);
}

.project-title strong,
.project-title span {
    display: block;
}

.project-title span,
.project-summary,
.muted {
    color: var(--muted);
}

.project-title span {
    margin-top: 6px;
    font-size: 0.82rem;
}

.project-summary {
    font-size: 0.88rem;
    line-height: 1.5;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.76rem;
    white-space: nowrap;
}

.tag.green {
    color: var(--green);
}

.tag.blue {
    color: var(--blue);
}

.tag.gold {
    color: var(--gold);
}

.tag.red {
    color: var(--red);
}

.tag.purple {
    color: var(--purple);
}

.info-list.compact {
    gap: 8px;
}

.info-list.compact div {
    padding: 8px 10px;
}

.detail-panel {
    position: sticky;
    top: 22px;
    min-height: 560px;
    padding: 20px;
}

.empty-state {
    min-height: 500px;
    display: grid;
    place-content: center;
    text-align: center;
}

.empty-state.compact {
    min-height: 360px;
}

.empty-state p {
    max-width: 320px;
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.55;
}

.detail-head {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.detail-head p {
    margin-top: 10px;
    color: var(--muted);
    line-height: 1.6;
}

.detail-section {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-section h3 {
    margin-bottom: 12px;
}

.detail-note {
    margin: -4px 0 14px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

.link-list,
.info-list,
.checklist,
.command-list {
    display: grid;
    gap: 10px;
}

.link-list a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
    font-size: 0.88rem;
}

.link-list a:hover {
    border-color: var(--line-strong);
    color: var(--gold);
}

.info-list div,
.checklist li,
.command-list code {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.info-list span,
.checklist span {
    color: var(--muted);
}

.info-list strong {
    max-width: 58%;
    overflow-wrap: anywhere;
    text-align: right;
    font-size: 0.84rem;
    font-weight: 600;
}

.checklist {
    padding: 0;
    list-style: none;
}

.checklist li {
    justify-content: flex-start;
    align-items: flex-start;
    line-height: 1.45;
}

.check-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    margin-top: 5px;
    border: 1px solid var(--muted);
    background: transparent;
}

.check-dot.done {
    border-color: var(--green);
    background: var(--green);
}

.check-dot.watch {
    border-color: var(--gold);
    background: var(--gold);
}

.check-dot.todo {
    border-color: var(--red);
    background: var(--red);
}

.command-list code {
    display: block;
    color: var(--blue);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.compact-table {
    border: 1px solid var(--line);
}

.compact-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.compact-table th,
.compact-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    text-align: left;
}

.compact-table tr:last-child td {
    border-bottom: 0;
}

.win-text {
    color: var(--green) !important;
    font-weight: 800;
}

.lose-text {
    color: var(--red) !important;
    font-weight: 800;
}

.event-timeline {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-timeline li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.event-timeline li > span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(242, 198, 109, 0.44);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
}

.event-timeline strong,
.event-timeline small,
.event-timeline code {
    display: block;
}

.event-timeline small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.76rem;
}

.event-timeline code {
    margin-top: 8px;
    color: var(--blue);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

input[type="search"] {
    width: min(320px, 34vw);
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    outline: none;
}

input[type="search"]:focus {
    border-color: var(--line-strong);
}

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

.template-card,
.roadmap-card {
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.template-card ul,
.roadmap-card ul {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.roadmap-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
}

.roadmap-list.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 20px 0;
}

.report-summary-card {
    min-height: 108px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.report-summary-card span,
.report-summary-card small {
    display: block;
    color: var(--muted);
}

.report-summary-card strong {
    display: block;
    margin-top: 10px;
    color: var(--gold);
    font-size: 1.8rem;
    line-height: 1;
}

.report-summary-card small {
    margin-top: 10px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.report-layout,
.math-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
}

.math-layout {
    padding-top: 0;
}

.subsection-head {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.subsection-head span {
    color: var(--muted);
    font-size: 0.82rem;
}

.roadmap-head {
    margin: 0;
    padding: 0 20px 12px;
}

.report-list,
.gap-list,
.math-profile-grid,
.simulation-list {
    display: grid;
    gap: 12px;
}

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

.report-card,
.gap-card,
.math-profile-card,
.simulation-card {
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.report-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.8rem;
}

.report-card h3,
.gap-card h3,
.math-profile-card h3,
.simulation-card h3 {
    margin-bottom: 10px;
}

.report-card p,
.gap-card p,
.math-profile-card p,
.simulation-card p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.report-card .button {
    width: 100%;
    margin-top: 12px;
}

.field-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.field-chips span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 0.76rem;
}

.roadmap-card small {
    display: block;
    margin-top: 8px;
    color: var(--gold);
    overflow-wrap: anywhere;
}

.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.support-grid .panel {
    padding: 20px;
}

.support-grid .link-list,
.support-grid .info-list {
    margin-top: 16px;
}

.deploy-panel {
    max-width: 760px;
    padding: 20px;
}

.deploy-panel .info-list {
    margin-top: 16px;
}

.load-error {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(238, 119, 112, 0.45);
    background: rgba(238, 119, 112, 0.08);
    color: var(--red);
}

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

    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }

    .side-nav {
        display: flex;
        min-width: max-content;
    }

    .sidebar-note {
        display: none;
    }

    .content-grid,
    .dashboard-grid,
    .rounds-grid,
    .support-grid {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        position: static;
    }

    .category-tabs,
    .template-grid,
    .roadmap-list,
    .report-summary-grid,
    .report-layout,
    .math-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-layout,
    .math-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    body {
        padding: 0;
    }

    .app-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .workspace {
        padding: 20px 14px 52px;
    }

    .sidebar {
        display: grid;
        gap: 18px;
        padding: 22px 14px;
        overflow-x: hidden;
    }

    .brand {
        align-items: flex-start;
    }

    .side-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
        gap: 6px;
    }

    .side-nav a {
        justify-content: center;
        min-height: 38px;
        padding: 0 6px;
        border-left: 0;
        border-bottom: 2px solid transparent;
        text-align: center;
        font-size: 0.86rem;
    }

    .page-header,
    .panel-head {
        display: grid;
    }

    .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .button {
        width: 100%;
    }

    .metrics-grid,
    .rounds-summary-grid,
    .category-tabs,
    .template-grid,
    .roadmap-list,
    .report-summary-grid,
    .math-profile-grid {
        grid-template-columns: 1fr;
    }

    .project-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-tools,
    .round-tools,
    .table-footer,
    .detail-actions,
    .status-cards,
    .checklist.two-col {
        grid-template-columns: 1fr;
    }

    .dashboard-tools {
        display: grid;
    }

    .round-tools {
        display: grid;
    }

    .dashboard-tools input[type="search"] {
        width: 100%;
    }

    .round-tools input[type="search"],
    .round-tools select {
        width: 100%;
    }

    input[type="search"] {
        width: 100%;
    }

    .panel-head.compact {
        align-items: stretch;
    }
}
