/* Focused workspace: one action, a source-linked history, account controls at the foot. */
@media (min-width: 701px) {
  .app-shell { grid-template-columns: 276px minmax(0, 1fr); }
  .workspace-sidebar {
    position: sticky; top: 0; align-self: start; display: flex; flex-direction: column;
    height: 100dvh; min-height: 0; padding: 23px 13px 14px; overflow: visible;
    background: #102b47;
  }
  .development-banner + .app-shell .workspace-sidebar { height: calc(100dvh - 31px); }
}
.workspace-sidebar .sidebar-top { padding: 0 7px; }
.workspace-sidebar .brand { display: inline-flex; align-items: center; margin: 0 0 26px; font-size: 24px; }
.workspace-sidebar .sidebar-new {
  display: flex; align-items: center; gap: 12px; min-height: 47px; padding: 10px 14px;
  border: 1px solid #6a9bff; border-radius: 10px; background: #245edb; color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1.3; text-decoration: none;
  box-shadow: 0 8px 18px -13px #91b6ff;
}
.workspace-sidebar .sidebar-new:hover, .workspace-sidebar .sidebar-new.active { background: #3b74eb; border-color: #a3c0ff; }
.workspace-sidebar .sidebar-new span { font-size: 23px; font-weight: 400; line-height: .7; }
.workspace-sidebar .sidebar-history-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 25px 15px 10px; color: #94aac4; font-size: 11px; font-weight: 750;
  letter-spacing: .09em; text-transform: uppercase;
}
.workspace-sidebar .sidebar-history { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1px 4px 8px; scrollbar-color: #456384 transparent; scrollbar-width: thin; }
.workspace-sidebar .sidebar-history-empty { padding: 9px 11px; color: #9bb1c8; font-size: 12px; line-height: 1.55; }
.workspace-sidebar .history-link {
  display: flex; align-items: flex-start; gap: 9px; min-height: 59px; padding: 9px 10px;
  border: 1px solid transparent; border-radius: 9px; color: #c6d4e3; text-decoration: none;
}
.workspace-sidebar .history-link:hover { background: #1d3c5d; color: #fff; }
.workspace-sidebar .history-link.active { background: #254d78; border-color: #3d6998; color: #fff; }
.workspace-sidebar .history-link-icon { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #496888; border-radius: 6px; color: #aac2df; font: 700 13px/1 var(--mono); }
.workspace-sidebar .history-link.active .history-link-icon { border-color: #93b7e7; color: #e6f2ff; }
.workspace-sidebar .history-link-content { min-width: 0; display: grid; gap: 2px; }
.workspace-sidebar .history-link-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 192px; font-size: 13px; font-weight: 650; }
.workspace-sidebar .history-link-date { color: #91abc4; font-size: 11px; font-variant-numeric: tabular-nums; }
.workspace-sidebar .sidebar-all { display: flex; align-items: center; justify-content: space-between; min-height: 41px; margin: 4px 5px 12px; padding: 7px 12px; border-radius: 8px; color: #b6cbe0; font-size: 12px; font-weight: 650; text-decoration: none; }
.workspace-sidebar .sidebar-all:hover, .workspace-sidebar .sidebar-all.active { background: #1d3c5d; color: #fff; }
.workspace-sidebar .sidebar-bottom { position: relative; z-index: 4; margin: 0; padding: 13px 4px 0; border-top: 1px solid #33506c; }
.workspace-sidebar .account-menu { position: relative; }
.workspace-sidebar .account-menu > summary { display: flex; align-items: center; gap: 10px; min-height: 53px; padding: 6px 9px; border-radius: 9px; color: #e3edf8; list-style: none; cursor: pointer; }
.workspace-sidebar .account-menu > summary::-webkit-details-marker { display: none; }
.workspace-sidebar .account-menu > summary:hover, .workspace-sidebar .account-menu[open] > summary { background: #214260; }
.workspace-sidebar .account-menu .avatar { width: 32px; height: 32px; background: #3a6590; color: #fff; font-size: 13px; }
.workspace-sidebar .account-label { min-width: 0; display: grid; line-height: 1.3; }
.workspace-sidebar .account-label strong { font-size: 13px; }
.workspace-sidebar .account-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; color: #a7bed4; font-size: 11px; }
.workspace-sidebar .account-chevron { margin-left: auto; color: #a7bed4; font-size: 17px; transition: transform .16s ease; }
.workspace-sidebar .account-menu[open] .account-chevron { transform: rotate(180deg); }
.workspace-sidebar .account-menu-panel {
  position: absolute; right: 0; bottom: calc(100% + 9px); width: 100%; padding: 6px;
  border: 1px solid #cadae9; border-radius: 12px; background: #fff; color: #163b5c;
  box-shadow: 0 22px 44px -20px #071c34;
}
.workspace-sidebar .account-menu-panel a, .workspace-sidebar .account-menu-panel button { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 9px 11px; border: 0; border-radius: 7px; background: transparent; color: #244664; font: 600 13px/1.35 var(--body); text-align: left; text-decoration: none; }
.workspace-sidebar .account-menu-panel a:hover, .workspace-sidebar .account-menu-panel button:hover, .workspace-sidebar .account-menu-panel [aria-current="page"] { background: #ecf3ff; color: #174dc2; }
.workspace-sidebar .account-menu-panel form { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid #e3ebf3; }
.workspace-sidebar :is(a, button, summary):focus-visible { outline-color: #b0d0ff; }
.workspace-sidebar .account-menu-panel :is(a, button):focus-visible { outline-color: #245edb; }

.app-main { min-height: 100dvh; }
.workspace-kicker { display: inline-block; margin-bottom: 8px; color: #567a9d; font-size: 11px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.workspace-heading { max-width: 980px; margin-bottom: 26px; }
.workspace-heading h1 { font-size: clamp(30px, 3vw, 39px); }
.workspace-heading p { max-width: 760px; }
.dashboard-heading { justify-content: flex-start; }
.app-main .dashboard-heading + .notice { max-width: 980px; }
.app-main .dashboard-heading + .notice + .notice { max-width: 980px; }
.app-main .upload-panel { display: block; max-width: 980px; padding: clamp(22px, 3vw, 35px); }
.app-main .upload-intro { margin-bottom: 22px; }
.app-main .upload-intro h2 { max-width: none; font-size: 22px; }
.app-main .upload-intro > p:not(.eyebrow) { max-width: none; margin-top: 5px; font-size: 14px; }
.app-main .upload-panel .file-picker { padding: clamp(19px, 2.4vw, 28px); background: #f7faff; border-color: #9dbadd; transition: background-color .16s, border-color .16s, box-shadow .16s; }
.app-main .upload-panel .file-picker.is-dragging { background: #e8f1ff; border-color: #245edb; box-shadow: 0 0 0 3px #d8e6ff; }
.app-main .upload-panel .file-picker label strong { font-size: 17px; }
.app-main .upload-panel .file-picker label > span:not(.upload-symbol) { max-width: 75ch; }
.app-main .upload-panel .upload-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-top: 22px; gap: 14px; }
.app-main .upload-panel .upload-controls > div { min-width: 0; }
.app-main .upload-panel .upload-controls > .button { min-width: 195px; }
.app-main .upload-panel .sample-links { display: flex; align-items: center; gap: 8px 18px; margin-top: 23px; padding-top: 16px; border-top: 1px solid #e0eaf4; }
.app-main .upload-panel .sample-links .text-link { justify-self: auto; }
.app-main .upload-panel .upload-help { margin-top: 9px; }
.app-main .upload-panel .microcopy { color: #657b91; }

.history-archive { max-width: 1100px; overflow: hidden; border: 1px solid #d8e4ef; border-radius: 13px; background: #fff; box-shadow: 0 12px 28px -27px #183d68; }
.history-archive-item { display: flex; align-items: center; gap: 20px; min-height: 80px; padding: 15px 23px; color: #193b5a; text-decoration: none; }
.history-archive-item + .history-archive-item { border-top: 1px solid #e6edf5; }
.history-archive-item:hover { background: #f6faff; text-decoration: none; }
.history-archive-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.history-archive-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.history-archive-main small { color: #697f95; font-size: 12px; }
.history-archive-status { display: flex; flex-wrap: wrap; gap: 5px; }
.history-archive-status .status { font-size: 10px; }
.history-archive-arrow { color: #7b99b6; font-size: 20px; }
.history-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1100px; margin-top: 18px; color: #587189; font-size: 13px; }
.history-pagination a { font-weight: 650; }

@media (max-width: 900px) and (min-width: 701px) {
  .app-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .workspace-sidebar .history-link-name { max-width: 155px; }
  .workspace-sidebar .account-label small { max-width: 130px; }
}
@media (max-width: 700px) {
  .workspace-sidebar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 10px; height: auto; min-height: 0; overflow: visible; padding: 14px 18px 12px; background: #102b47; }
  .workspace-sidebar .sidebar-top { grid-column: 1; grid-row: 1; padding: 0; }
  .workspace-sidebar .brand { margin: 0 0 12px; font-size: 21px; }
  .workspace-sidebar .sidebar-new { min-height: 42px; max-width: 250px; font-size: 13px; }
  .workspace-sidebar .sidebar-history-header { grid-column: 1; grid-row: 2; justify-content: flex-start; padding: 7px 1px 0; }
  .workspace-sidebar .sidebar-history-toggle { display: inline-flex; min-height: 36px; padding: 5px 8px; border: 0; background: transparent; color: #d2e5f9; font-size: 12px; font-weight: 650; text-transform: none; letter-spacing: 0; }
  .workspace-sidebar .sidebar-history { display: none; grid-column: 1 / -1; grid-row: 3; max-height: 250px; padding: 0; }
  .workspace-sidebar.history-open .sidebar-history { display: block; }
  .workspace-sidebar .sidebar-all { grid-column: 2; grid-row: 2; margin: 0; min-height: 37px; padding: 5px 8px; }
  .workspace-sidebar .sidebar-bottom { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; margin: 0; padding: 0; border: 0; }
  .workspace-sidebar .account-menu > summary { padding: 0; min-height: 39px; }
  .workspace-sidebar .account-label, .workspace-sidebar .account-chevron { display: none; }
  .workspace-sidebar .account-menu-panel { top: calc(100% + 8px); bottom: auto; width: 240px; }
  .app-main { min-height: calc(100dvh - 140px); }
  .app-main .upload-panel .upload-controls { grid-template-columns: 1fr; }
  .app-main .upload-panel .upload-controls > .button { width: 100%; }
  .history-archive-item { flex-wrap: wrap; gap: 10px; padding: 14px 18px; }
  .history-archive-main { flex-basis: calc(100% - 30px); }
  .history-archive-status { order: 3; width: 100%; }
  .history-archive-arrow { margin-left: auto; }
}
@media (max-width: 480px) {
  .workspace-sidebar { padding-inline: 16px; }
  .workspace-sidebar .sidebar-history-header { font-size: 10px; }
  .workspace-sidebar .sidebar-all { font-size: 11px; }
  .app-main .upload-panel .sample-links { display: grid; align-items: start; }
  .history-pagination { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-sidebar .account-chevron, .app-main .upload-panel .file-picker { transition: none; }
}
