:root {
  color-scheme: light;
  --paper: #f5f6f3;
  --surface: #fff;
  --ink: #242b2a;
  --muted: #5e6966;
  --line: #e3e8e4;
  --line-strong: #cbd4cf;
  --green: #0f766e;
  --green-dark: #115e59;
  --green-pale: #e7f2ef;
  --amber: #8c5a1b;
  --amber-pale: #f5efe2;
  --red: #9b4138;
  --red-pale: #f6eae8;
  --signal-green: #167548;
  --signal-green-bg: #e7f4ec;
  --signal-yellow: #9a5706;
  --signal-yellow-bg: #fff2dc;
  --signal-red: #b42318;
  --signal-red-bg: #fde8e7;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .7;
}

::selection {
  background: #c9d8cc;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: .5rem;
  left: .5rem;
  padding: .6rem .9rem;
  transform: translateY(-150%);
  background: var(--surface);
  color: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  max-width: 1480px;
  min-height: 62px;
  margin: 0 auto;
  padding: .55rem 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
}

/* Also updates pages rendered by the already-running server's cached base template. */
.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 0;
  background: url("group-logo.jpg") center / contain no-repeat;
  color: transparent;
  font-size: 0;
}

.main-nav {
  display: flex;
  align-self: stretch;
  gap: 1.5rem;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a.is-current {
  color: var(--green-dark);
}

.main-nav a.is-current {
  border-color: var(--green);
}

.account-menu {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-left: auto;
  font-size: 13px;
}

.account-name {
  font-weight: 600;
}

.role-label {
  padding: .08rem .4rem;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
}

.account-menu form {
  margin: 0;
}

.page-shell {
  width: min(100% - 4rem, 1400px);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-shell .flash-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: min(400px, calc(100vw - 2rem));
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h1 {
  margin-bottom: .45rem;
  font-size: clamp(1.8rem, 3.2vw, 2.45rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: .25rem;
  font-size: 1.4rem;
  line-height: 1.3;
}

h3 {
  margin-bottom: .2rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.eyebrow,
.auth-kicker {
  margin-bottom: .35rem;
  color: var(--green);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.lead {
  max-width: 65ch;
  margin-bottom: 0;
  color: var(--muted);
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  display: inline-block;
  margin-left: .35rem;
  font-size: .82rem;
  font-weight: 400;
}

.subline {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-heading,
.dashboard-heading,
.detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.page-heading>div:first-child,
.detail-heading>div:first-child {
  min-width: 0;
}

.dashboard-heading {
  align-items: center;
  margin-bottom: .9rem;
}

.week-picker {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--muted);
  font-size: .85rem;
}

.week-picker label {
  white-space: nowrap;
}

.summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem 1.5rem;
  padding: .75rem 0 .95rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.summary-line strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.summary-line a {
  color: var(--ink);
  text-decoration: none;
}

.summary-line a:hover {
  color: var(--green);
  text-decoration: underline;
}

.summary-line .summary-admin {
  margin-left: auto;
  color: var(--green);
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .9rem 0;
}

.filter-bar .search-field {
  flex: 1 1 240px;
}

.filter-bar input[type="search"] {
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: .5rem .65rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
}

input[type="file"] {
  padding: .35rem;
}

input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  height: 17px;
  accent-color: var(--green);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #a7c5b1;
  outline-offset: 2px;
  border-color: var(--green);
}

label {
  display: grid;
  gap: .4rem;
  color: #343a35;
  font-size: .9rem;
  font-weight: 600;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem .9rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.button:hover {
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--green);
  color: #fff;
}

.button-primary:hover {
  background: var(--green-dark);
  color: #fff;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.button-small {
  min-height: 34px;
  padding: .35rem .65rem;
  font-size: .84rem;
}

.text-button {
  padding: .25rem;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: .88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--green-dark);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: .9rem;
}

.table-scroll {
  overflow: auto;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.data-table th {
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--line-strong);
  background: #f0f2ee;
  color: #535d55;
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}

.data-table td {
  padding: .75rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfcfa;
}

.dashboard-table {
  min-width: 980px;
}

.dashboard-table th:first-child {
  width: 24%;
}

.dashboard-table th:nth-child(2) {
  width: 20%;
}

.dashboard-table th:nth-child(4) {
  width: 19%;
}

.paper-title {
  color: var(--ink);
  font-weight: 650;
  line-height: 1.45;
  text-decoration: none;
}

.paper-title:hover {
  color: var(--green);
  text-decoration: underline;
}

.paper-cell .subline {
  max-width: 34ch;
}

.demo-flag {
  display: inline-block;
  margin-left: .4rem;
  color: var(--amber);
  font-size: .75rem;
}

.progress-summary {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.progress-summary:hover {
  color: var(--green);
  text-decoration: underline;
}

.status-label {
  display: inline-block;
  padding: .12rem .4rem;
  border-left: 2px solid var(--line-strong);
  color: #4e5750;
  font-size: .8rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-0 {
  border-color: var(--red);
  background: var(--red-pale);
  color: #753b35;
}

.status-1 {
  border-color: var(--amber);
  background: var(--amber-pale);
  color: #74501f;
}

.status-2 {
  border-color: #737d76;
  background: #eef0ed;
  color: #505a53;
}

.status-3 {
  border-color: var(--green);
  background: var(--green-pale);
  color: #31533f;
}

.status-small {
  font-size: .72rem;
}

.status-reason {
  max-width: 27ch;
}

.table-note {
  margin: .65rem 0 0;
  color: var(--muted);
  font-size: .81rem;
}

.empty-state {
  margin-top: .8rem;
  padding: 2.25rem;
  border-top: 2px solid var(--line-strong);
  background: var(--surface);
}

.empty-state h2 {
  margin-bottom: .4rem;
}

.empty-state p:not(.eyebrow) {
  max-width: 60ch;
  color: var(--muted);
}

.empty-inline {
  margin: 0;
  padding: 1rem 0;
  color: var(--muted);
}

.auth-panel,
.state-panel {
  width: min(100%, 470px);
  padding: 2rem;
  border-top: 3px solid var(--green);
  background: var(--surface);
}

.auth-entry {
  border: 1px solid rgb(40 54 48 / 8%);
  border-top: 0;
  border-radius: 16px;
  box-shadow: 0 5px 22px rgb(29 43 39 / 4%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1.55rem;
}

.auth-brand-logo {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

.auth-brand-copy strong,
.auth-brand-copy span {
  display: block;
}

.auth-brand-copy strong {
  color: var(--ink);
  font-size: .96rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-brand-copy span {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .8rem;
}

.auth-entry .auth-kicker {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: 0;
}

.auth-panel.auth-entry h1 {
  margin-bottom: .35rem;
  font-size: 2rem;
  font-weight: 600;
}

.auth-panel.auth-entry .lead {
  margin-bottom: 1.4rem;
}

.auth-entry input {
  min-height: 46px;
  border-radius: 10px;
  background: #fbfcfb;
}

.auth-entry input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
}

.auth-entry .button {
  min-height: 44px;
  border-radius: 10px;
}

.auth-panel h1,
.state-panel h1 {
  margin-bottom: .5rem;
}

.auth-panel .lead {
  margin-bottom: 1.5rem;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.auth-footnote {
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.state-panel {
  width: min(100%, 600px);
}

.state-panel>p {
  margin-bottom: .65rem;
}

.state-mark {
  display: inline-block;
  margin-bottom: .65rem;
  color: var(--green);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.flash-stack {
  display: grid;
  gap: .4rem;
  margin: 0 0 1rem;
}

.flash {
  margin: 0;
  padding: .65rem .85rem;
  border-left: 3px solid var(--line-strong);
  background: var(--surface);
}

.flash-toast-stack {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  left: 1rem;
  display: grid;
  justify-items: center;
  gap: .5rem;
  pointer-events: none;
}

.flash-toast {
  max-width: min(32rem, 100%);
  margin: 0;
  padding: .25rem .5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #5f6b7b;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .38s ease, transform .38s ease;
}

.flash-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

@media (prefers-reduced-motion: reduce) {
  .flash-toast {
    transition: none;
  }
}

.flash-success {
  border-color: var(--green);
}

.flash-error {
  border-color: var(--red);
  background: #fffaf9;
}

.flash-info {
  border-color: #667a89;
}

.secret-value {
  margin: 1.2rem 0 .8rem;
  padding: .8rem;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .84rem;
}

.breadcrumb a {
  color: var(--muted);
}

.detail-heading {
  align-items: flex-start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line-strong);
}

.detail-heading>div:first-child {
  flex: 1 1 auto;
}

.detail-heading h1 {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 1rem 0 1.75rem;
  border-bottom: 1px solid var(--line);
}

.detail-facts.detail-facts-single {
  max-width: 420px;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 1rem;
  border-bottom: 0;
}

.detail-facts.detail-facts-single>div {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .35rem 0;
}

.detail-facts.detail-facts-single .fact-label {
  flex: 0 0 auto;
  margin: 0;
}

.detail-facts.detail-facts-single strong {
  display: inline;
}

.detail-facts>div {
  min-width: 0;
  padding: .8rem .9rem .9rem 0;
}

.detail-facts>div+div {
  padding-left: .9rem;
  border-left: 1px solid var(--line);
}

.fact-label,
.field-label {
  display: block;
  margin-bottom: .3rem;
  color: var(--muted);
  font-size: .79rem;
}

.detail-facts strong {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.section-block {
  margin: 1.75rem 0 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .7rem;
}

.section-heading p {
  margin: .1rem 0 0;
  color: var(--muted);
  font-size: .85rem;
}

.narrow-section {
  max-width: 760px;
  padding: 1.25rem;
  border-top: 1px solid var(--line-strong);
  background: var(--surface);
}

.narrow-section+.narrow-section {
  margin-top: 1rem;
}

.narrow-section>h2 {
  margin-bottom: .4rem;
}

.narrow-section>p {
  max-width: 70ch;
  color: var(--muted);
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-weight: 500;
}

.check-label input {
  flex: 0 0 auto;
  margin-top: .2rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: .2rem;
}

.form-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.week-static {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: 1.1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
}

.week-static input {
  width: auto;
}

.week-static .button {
  flex: 0 0 auto;
}

.week-static span:first-child {
  color: var(--muted);
  font-size: .85rem;
}

.week-static strong {
  font-variant-numeric: tabular-nums;
}

.form-error {
  padding: .55rem .7rem;
  border-left: 2px solid var(--red);
  background: #fffaf9;
  color: #753b35;
}

.previous-commitment {
  padding: .8rem;
  border-left: 2px solid var(--green);
  background: #f5f7f4;
}

.previous-commitment p {
  margin: 0;
}

.milestone-list {
  border-top: 1px solid var(--line-strong);
}

.milestone-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, .8fr);
  gap: 1.25rem;
  padding: 1rem .1rem;
  border-bottom: 1px solid var(--line);
}

.milestone-main {
  min-width: 0;
}

.milestone-state {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

.is-overdue .milestone-state {
  color: var(--red);
}

.is-complete .milestone-state {
  color: var(--green);
}

.milestone-main h3 {
  margin-top: .2rem;
}

.milestone-main p {
  margin-bottom: .3rem;
}

.evidence-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.milestone-edit {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: .55rem;
}

.milestone-create {
  margin: .2rem 0 1rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.milestone-edit label {
  font-size: .8rem;
}

.milestone-edit input {
  min-height: 36px;
  font-size: .84rem;
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.activity-list li {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 1rem;
  padding: .55rem .1rem;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}

.activity-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.member-table {
  min-width: 760px;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.admin-actions select,
.member-table select {
  min-height: 34px;
  width: auto;
  max-width: 250px;
  padding: .3rem .5rem;
  font-size: .82rem;
}

.table-scroll+.empty-inline {
  border-bottom: 1px solid var(--line);
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 2rem, 1400px);
  }

  .header-inner {
    flex-wrap: wrap;
    gap: .65rem 1.25rem;
    padding: .65rem 1rem;
  }

  .main-nav {
    order: 3;
    width: 100%;
    height: 37px;
  }

  .account-menu {
    margin-left: auto;
  }

  .detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-facts>div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .detail-facts>div:nth-child(n+3) {
    border-top: 1px solid var(--line);
  }

  .milestone-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .page-shell {
    width: calc(100% - 1.25rem);
    padding-top: 1.25rem;
  }

  .header-inner {
    column-gap: .75rem;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: .45rem;
  }

  .brand-logo,
  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .account-menu {
    flex: 0 0 auto;
  }

  .auth-shell {
    width: 100%;
    padding: 1rem .65rem;
  }

  .auth-panel,
  .state-panel {
    padding: 1.4rem 1.1rem;
  }

  .account-menu {
    gap: .4rem;
    font-size: .78rem;
  }

  .account-name {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-heading,
  .dashboard-heading,
  .detail-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .week-picker {
    width: 100%;
  }

  .week-picker input {
    flex: 1;
    min-width: 0;
  }

  .summary-line {
    gap: .35rem .9rem;
    font-size: .82rem;
  }

  .summary-line .summary-admin {
    margin-left: 0;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-bar .search-field {
    flex-basis: 100%;
  }

  .filter-bar label:not(.search-field) {
    flex: 1;
  }

  .dashboard-table {
    min-width: 0;
    width: 100%;
  }

  .dashboard-table thead {
    display: none;
  }

  .dashboard-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .5rem;
    padding: .45rem .55rem;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-table tbody tr:last-child {
    border-bottom: 0;
  }

  .dashboard-table tbody tr:hover {
    background: var(--surface);
  }

  .dashboard-table tbody td {
    padding: .3rem 0;
    border: 0;
  }

  .dashboard-table td:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .dashboard-table td:nth-child(2),
  .dashboard-table td:nth-child(3),
  .dashboard-table td:nth-child(4),
  .dashboard-table td:nth-child(5) {
    display: none;
  }

  .dashboard-table td:last-child {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .status-reason {
    max-width: 18ch;
  }

  .week-static {
    flex-wrap: wrap;
    align-items: center;
  }

  .form-two-col,
  .detail-facts {
    grid-template-columns: 1fr;
  }

  .detail-facts>div,
  .detail-facts>div+div {
    padding: .65rem 0;
    border-left: 0;
  }

  .detail-facts>div+div {
    border-top: 1px solid var(--line);
  }

  .milestone-edit {
    grid-template-columns: 1fr;
  }

  .activity-list li {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .narrow-section {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* Adminator-inspired sign-in: keep the split composition, adapt it to SLS. */
.page-shell.login-page {
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  place-items: center;
  margin: 0;
  padding: clamp(1rem, 4vh, 2.5rem);
  background: linear-gradient(128deg, #cd46b8 0%, #a255ce 46%, #7664df 100%);
}

.login-page .flash-stack {
  position: fixed;
  z-index: 5;
  top: 1rem;
  right: 1rem;
  width: min(400px, calc(100vw - 2rem));
}

.login-layout {
  display: grid;
  width: min(1320px, 100%);
  min-height: min(820px, calc(100dvh - 3rem));
  grid-template-columns: minmax(330px, .83fr) minmax(0, 1.17fr);
  overflow: hidden;
  border: 0;
  border-radius: 56px;
  background: #fff;
  box-shadow: 0 30px 70px rgb(43 34 95 / 25%);
}

.auth-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  background: #fff;
}

.auth-main::before {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 -56px;
  border-radius: 56px 0 0 56px;
  background: #fff;
  content: "";
  pointer-events: none;
}

.auth-main>* {
  position: relative;
  z-index: 1;
}

.login-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: clamp(1.5rem, 3.7vw, 3rem) clamp(2rem, 5.2vw, 5.5rem);
  background: #fff;
}

.login-main-top,
.register-main-top {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: flex-end;
  color: #727d90;
  font-size: .875rem;
}

.login-main-top p,
.register-main-top p {
  margin: 0;
}

.login-main-top a,
.register-main-top a {
  margin-left: .35rem;
  color: #326be0;
  font-weight: 650;
  text-decoration: none;
}

.login-main-top a:hover,
.register-main-top a:hover {
  color: #234fba;
  text-decoration: underline;
}

.login-card {
  width: min(100%, 430px);
  margin: auto;
  padding: 2rem 0;
}

.login-intro {
  margin-bottom: 2rem;
}

.login-intro h1 {
  margin: 0 0 .5rem;
  color: #202a3b;
  font-size: clamp(1.75rem, 2.3vw, 2rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.25;
}

.login-intro p {
  margin: 0;
  color: #7a8597;
  font-size: .95rem;
}

.login-form {
  display: grid;
  gap: 1.2rem;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: -.15rem;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #657187;
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.login-remember input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #356fe5;
}

.login-page .login-remember input:focus {
  border-color: initial;
  outline: 0;
  box-shadow: none;
}

.login-page .login-remember input:focus-visible {
  outline: 2px solid #5780e8;
  outline-offset: 2px;
}

.login-forgot {
  flex: 0 0 auto;
  color: #326be0;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
}

.login-forgot:hover {
  color: #234fba;
  text-decoration: underline;
}

.login-field {
  display: grid;
  gap: .5rem;
  color: #394559;
  font-size: .875rem;
  font-weight: 600;
}

.login-field-label {
  line-height: 1.4;
}

.login-input-shell {
  position: relative;
  display: block;
}

.login-input-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: #98a3b4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  pointer-events: none;
}

.login-input-shell input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: .75rem 1rem .75rem 3rem;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  background: #fff;
  color: #202a3b;
  font-size: .93rem;
  font-weight: 400;
  transition: border-color .16s ease, background-color .16s ease;
}

.login-input-shell input::placeholder {
  color: #a0a9b7;
  opacity: 1;
}

.login-input-shell input:hover {
  border-color: #bdc9da;
}

.login-input-shell input:focus {
  outline: 0;
  border-color: #5780e8;
  box-shadow: none;
}

.login-input-shell input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #202a3b;
}

.login-submit {
  position: relative;
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  margin-top: .2rem;
  padding: .75rem 3rem;
  border: 0;
  border-radius: 8px;
  background: #91a3f2;
  box-shadow: 0 5px 12px rgb(96 119 218 / 21%);
  color: #fff;
  font-size: .95rem;
  font-weight: 650;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.login-submit:hover {
  background: #7e92eb;
  box-shadow: 0 7px 16px rgb(96 119 218 / 28%);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit svg {
  position: absolute;
  right: 1.15rem;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.forgot-password-note {
  padding: 1rem 1.1rem;
  border-left: 3px solid #5a82e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgb(31 49 86 / 4%);
}

.forgot-password-note p {
  margin: 0;
  color: #657187;
  font-size: .92rem;
  line-height: 1.8;
}

.login-page :is(a, button):focus-visible {
  outline: 3px solid #84a8ff;
  outline-offset: 3px;
}

/* Registration echoes the login palette inside a wider, editorial split panel. */
.page-shell.auth-shell.register-page {
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  align-content: center;
  justify-items: center;
  margin: 0;
  padding: clamp(1rem, 4vh, 2.5rem);
  background: linear-gradient(128deg, #cd46b8 0%, #a255ce 46%, #7664df 100%);
}

.register-page .flash-stack {
  position: fixed;
  z-index: 5;
  top: 1rem;
  right: 1rem;
  width: min(400px, calc(100vw - 2rem));
}

.register-layout {
  display: grid;
  width: min(1320px, 100%);
  min-height: min(820px, calc(100dvh - 3rem));
  grid-template-columns: minmax(330px, .83fr) minmax(0, 1.17fr);
  overflow: hidden;
  border: 0;
  border-radius: 56px;
  background: #fff;
  box-shadow: 0 30px 70px rgb(43 34 95 / 25%);
}

.register-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(2rem, 4vw, 3.5rem);
  gap: 2rem;
  background: linear-gradient(142deg, #8ea3f2 0%, #788ce9 52%, #6c72df 100%);
}

.register-brand-panel::before,
.register-brand-panel::after {
  position: absolute;
  z-index: -1;
  display: block;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.register-brand-panel::before {
  top: 21%;
  right: -20rem;
  width: 42rem;
  height: 42rem;
  box-shadow: 0 0 0 3rem rgb(255 255 255 / 3%), 0 0 0 7rem rgb(255 255 255 / 2%);
}

.register-brand-panel::after {
  bottom: -24rem;
  left: -17rem;
  width: 37rem;
  height: 37rem;
  border-color: rgb(255 255 255 / 10%);
}

.register-side-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  color: #fff;
  text-decoration: none;
}

.register-side-brand:hover {
  color: #fff;
  text-decoration: none;
}

.register-side-logo-frame {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 20px rgb(38 47 118 / 12%);
}

.register-side-logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.register-side-brand-copy {
  display: grid;
  gap: .18rem;
}

.register-side-brand-copy strong {
  color: #fff;
  font-size: .98rem;
  font-weight: 650;
  line-height: 1.3;
}

.register-side-brand-copy span {
  color: rgb(255 255 255 / 82%);
  font-size: .76rem;
}

.register-research {
  position: relative;
  z-index: 1;
  width: min(100%, 34rem);
  align-self: center;
  margin: auto 0;
}

.register-research-kicker {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 1rem;
  color: rgb(255 255 255 / 75%);
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .15em;
}

.register-research-kicker span {
  color: #fff;
  font-size: .78rem;
  letter-spacing: .04em;
}

.register-theme-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .18rem .8rem;
}

.register-theme-cloud span {
  color: #fff;
  line-height: 1.32;
  white-space: nowrap;
}

.register-theme-primary {
  width: 100%;
  margin-bottom: .28rem;
  font-size: clamp(2.8rem, 5vw, 4rem);
  font-weight: 720;
  letter-spacing: -.065em;
  line-height: 1.1 !important;
}

.register-theme-large {
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
  font-weight: 650;
  letter-spacing: -.04em;
}

.register-theme-medium {
  font-size: clamp(1.05rem, 1.65vw, 1.35rem);
  font-weight: 580;
  letter-spacing: -.025em;
}

.register-theme-small {
  color: rgb(255 255 255 / 83%) !important;
  font-size: clamp(.9rem, 1.3vw, 1.05rem);
  font-weight: 500;
}

.register-group-motto {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgb(255 255 255 / 84%);
  font-size: .65rem;
  font-weight: 550;
  letter-spacing: .12em;
}

.register-group-motto span {
  margin: 0 .16rem;
  color: rgb(255 255 255 / 68%);
}

.register-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(1.5rem, 3.7vw, 3rem) clamp(2rem, 5.2vw, 5.5rem);
  background: #fff;
}

.register-main-top {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: flex-end;
  color: #7a8597;
  font-size: .86rem;
}

.register-main-top p {
  margin: 0;
}

.register-main-top a {
  margin-left: .28rem;
  color: #326be0;
  font-weight: 650;
  text-decoration: none;
}

.register-main-top a:hover {
  color: #234fba;
  text-decoration: underline;
}

.register-form-panel {
  width: min(100%, 430px);
  margin: auto;
  padding: 2rem 0;
}

.register-intro {
  margin-bottom: 2rem;
}

.register-intro h1 {
  margin: 0 0 .5rem;
  color: #202a3b;
  font-size: clamp(1.75rem, 2.3vw, 2rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.25;
}

.register-intro p {
  margin: 0;
  color: #7a8597;
  font-size: .95rem;
  line-height: 1.55;
}

.register-form {
  display: grid;
  gap: 1.2rem;
}

.register-field {
  display: grid;
  gap: .5rem;
  min-width: 0;
}

.register-field>label,
.register-field-heading label {
  color: #394559;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}

.register-field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
}

.register-field-heading span {
  color: #69758a;
  font-size: .75rem;
  font-weight: 450;
}

.register-input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: .75rem 1rem;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  background: #fff;
  color: #202a3b;
  font-size: .93rem;
  font-weight: 400;
  transition: border-color .16s ease;
}

.register-input::placeholder {
  color: #a0a9b7;
  opacity: 1;
}

.register-input:hover {
  border-color: #bdc9da;
}

.register-input:focus {
  outline: 0;
  border-color: #5780e8;
  box-shadow: none;
}

.register-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: #202a3b;
}

.register-submit {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  margin-top: .2rem;
  padding: .75rem 3rem;
  border: 0;
  border-radius: 8px;
  background: #91a3f2;
  box-shadow: 0 5px 12px rgb(96 119 218 / 21%);
  color: #fff;
  font-size: .95rem;
  font-weight: 650;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.register-submit:hover {
  background: #7e92eb;
  box-shadow: 0 7px 16px rgb(96 119 218 / 28%);
}

.register-submit:active {
  transform: translateY(1px);
}

.register-submit svg {
  position: absolute;
  right: 1.15rem;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.register-form-panel :is(a, button):focus-visible {
  outline: 3px solid #84a8ff;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .page-shell.login-page {
    padding: 1rem;
  }

  .login-layout {
    width: min(560px, 100%);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 20px;
  }

  .login-main {
    min-height: 510px;
    padding: 1rem 2rem 1.75rem;
  }

  .login-card {
    padding: 1rem 0;
  }

  .login-options {
    gap: .65rem;
  }

  .login-remember,
  .login-forgot {
    font-size: .8rem;
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  .login-layout {
    grid-template-columns: minmax(270px, .76fr) minmax(0, 1.24fr);
    border-radius: 38px;
  }

  .auth-main::before {
    left: -38px;
    border-radius: 38px 0 0 38px;
  }

  .login-main {
    padding-right: 2.25rem;
    padding-left: 2.25rem;
  }

  .register-layout {
    grid-template-columns: minmax(270px, .76fr) minmax(0, 1.24fr);
    border-radius: 38px;
  }

  .register-brand-panel {
    padding: 2rem;
  }

  .register-main {
    padding-right: 2.25rem;
    padding-left: 2.25rem;
  }
}

@media (max-width: 760px) {
  .auth-main::before {
    display: none;
  }

  .page-shell.auth-shell.register-page {
    padding: 1rem;
  }

  .register-layout {
    width: min(560px, 100%);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 20px;
  }

  .register-brand-panel {
    min-height: 230px;
    padding: 1.4rem 1.6rem;
    gap: 1rem;
  }

  .register-research {
    width: 100%;
    margin: .5rem 0;
  }

  .register-research-kicker {
    margin-bottom: .45rem;
  }

  .register-theme-cloud {
    gap: .1rem .65rem;
  }

  .register-theme-primary {
    font-size: 2.35rem;
  }

  .register-theme-large {
    font-size: 1.2rem;
  }

  .register-theme-medium {
    font-size: .96rem;
  }

  .register-theme-small {
    font-size: .82rem;
  }

  .register-group-motto {
    font-size: .56rem;
  }

  .register-main {
    min-height: 570px;
    padding: 1rem 2rem 1.75rem;
  }

  .register-form-panel {
    padding: 1rem 0;
  }
}

@media (max-width: 520px) {
  .page-shell.login-page {
    padding: .65rem;
  }

  .login-layout {
    border-radius: 16px;
  }

  .login-main {
    min-height: 0;
    padding: .75rem 1.2rem 1.5rem;
  }

  .login-main-top {
    min-height: 2rem;
    font-size: .8rem;
  }

  .login-card {
    padding: .75rem 0 .25rem;
  }

  .page-shell.auth-shell.register-page {
    padding: .65rem;
  }

  .register-layout {
    border-radius: 16px;
  }

  .register-brand-panel {
    min-height: 214px;
    padding: 1.15rem 1.2rem;
  }

  .register-side-logo-frame {
    width: 46px;
    height: 46px;
  }

  .register-side-brand {
    gap: .65rem;
  }

  .register-side-brand-copy strong {
    font-size: .9rem;
  }

  .register-side-brand-copy span {
    font-size: .68rem;
  }

  .register-theme-primary {
    font-size: 2.1rem;
  }

  .register-theme-large {
    font-size: 1.08rem;
  }

  .register-theme-medium {
    font-size: .86rem;
  }

  .register-theme-small {
    font-size: .76rem;
  }

  .register-main {
    min-height: 0;
    padding: .75rem 1.2rem 1.5rem;
  }

  .login-main-top,
  .register-main-top {
    min-height: 2rem;
    font-size: .8rem;
  }

  .register-form-panel {
    padding: .75rem 0 .25rem;
  }

  .login-intro h1,
  .register-intro h1 {
    font-size: 1.65rem;
  }

  .login-intro p,
  .register-intro p {
    font-size: .84rem;
  }

  .login-form,
  .register-form {
    gap: .82rem;
  }

  .login-input-shell input,
  .register-input {
    min-height: 46px;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .page-shell.auth-shell.register-page {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .register-layout {
    min-height: calc(100dvh - 2rem);
  }

  .register-brand-panel {
    padding-top: 1.7rem;
    padding-bottom: 1.7rem;
  }

  .register-main {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .register-form-panel {
    padding-top: 0;
    padding-bottom: 0;
  }

  .login-intro,
  .register-intro {
    margin-bottom: .9rem;
  }

  .login-form,
  .register-form {
    gap: .68rem;
  }

  .login-input-shell input,
  .register-input,
  .login-submit,
  .register-submit {
    min-height: 46px;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .page-shell.login-page {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .login-layout {
    min-height: calc(100dvh - 2rem);
  }

  .login-main {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .login-card {
    padding-top: 0;
    padding-bottom: 0;
  }
}

@media (forced-colors: active) {

  .login-input-shell input,
  .login-submit,
  .register-side-logo-frame,
  .register-input,
  .register-submit {
    border: 1px solid ButtonText;
  }

  .login-input-icon {
    stroke: CanvasText;
  }
}

/* 4DX dashboard: quiet editorial hierarchy with soft, accessible surfaces. */
.dashboard-page {
  --card-radius: 14px;
  --card-shadow: 0 2px 12px rgb(29 43 39 / 3.5%);
  max-width: 1420px;
  margin: 0 auto;
}

.dashboard-page .dashboard-heading {
  align-items: flex-end;
  margin-bottom: 1.1rem;
}

.dashboard-page .dashboard-heading h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -.025em;
}

.dashboard-overline {
  margin: 0 0 .3rem;
  color: var(--green-dark);
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .035em;
}

.week-picker {
  align-items: center;
}

.week-picker input {
  width: 168px;
  min-height: 42px;
  border-color: transparent;
  border-radius: 10px;
  background: #ecefeb;
  font-variant-numeric: tabular-nums;
}

.week-submit {
  min-height: 42px;
  padding: .45rem .85rem;
  border: 1px solid #d8ded8;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 550;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.week-submit:hover {
  border-color: var(--green);
  background: #f7faf8;
  color: var(--green-dark);
}

.week-submit:active {
  transform: translateY(1px);
}

.status-red {
  color: var(--signal-red);
}

.status-yellow {
  color: var(--signal-yellow);
}

.status-green {
  color: var(--signal-green);
}

.dashboard-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0 0 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-filters .search-field {
  flex: 1 1 280px;
}

.dashboard-filters input,
.dashboard-filters select,
.dashboard-filters .button {
  min-height: 42px;
  border-radius: 10px;
}

.dashboard-filters input,
.dashboard-filters select {
  border-color: transparent;
  background: #ecefeb;
}

.dashboard-filters input:focus,
.dashboard-filters select:focus {
  border-color: var(--green);
  background: #fff;
}

.dashboard-filters select {
  width: auto;
  min-width: 145px;
}

.dashboard-filters .button {
  padding: .45rem .9rem;
}

.dashboard-filters .dashboard-manage {
  margin-left: auto;
}

.dashboard-tabs {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
  gap: 1.2rem;
  min-height: 45px;
  margin: 0 0 .65rem;
  padding: 0;
  overflow: visible;
  border-bottom: 1px solid #e0e5df;
  background: transparent;
}

.dashboard-tab {
  position: relative;
  min-width: 78px;
  min-height: 45px;
  padding: .55rem .2rem .7rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 450;
  white-space: nowrap;
  transition: color .18s ease;
}

.dashboard-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.dashboard-tab:hover {
  color: var(--green-dark);
}

.dashboard-tab.is-active {
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-weight: 600;
}

.dashboard-tab.is-active::after {
  background: var(--green);
}

.dashboard-tab:focus-visible {
  outline-offset: -3px;
}

.dashboard-tab-panel {
  padding: 0 0 1rem;
}

.dashboard-tab-panel[hidden] {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 0;
  padding: .3rem 0 1rem;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.panel-heading p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.panel-stats {
  display: flex;
  width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.15rem;
  color: var(--muted);
  font-size: .83rem;
}

.panel-stats>span:not(.week-chip) {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.panel-stats strong {
  color: var(--ink);
  font-size: .97rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.panel-stats .stat-total {
  color: var(--ink) !important;
  font-weight: 650 !important;
}

.panel-stats .stat-total strong {
  font-size: 1.15rem;
}

.panel-stats .status-green::before,
.panel-stats .status-yellow::before,
.panel-stats .status-red::before {
  display: inline-block;
  width: .46rem;
  height: .46rem;
  border-radius: 50%;
  content: "";
}

.panel-stats .status-green::before {
  background: var(--signal-green);
}

.panel-stats .status-yellow::before {
  background: var(--signal-yellow);
}

.panel-stats .status-red::before {
  background: var(--signal-red);
}

.panel-stats .status-green strong {
  color: var(--signal-green);
}

.panel-stats .status-yellow strong {
  color: var(--signal-yellow);
}

.panel-stats .status-red strong {
  color: var(--signal-red);
}

.week-chip {
  margin-left: auto;
  color: var(--muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.paper-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
  align-items: start;
  gap: 1.1rem;
}

.paper-focus,
.paper-queue-item {
  min-width: 0;
  border: 1px solid rgb(40 54 48 / 7%);
  border-radius: 14px;
  background: var(--surface);
}

.paper-focus {
  padding: clamp(1.25rem, 2.1vw, 1.8rem);
  box-shadow: var(--card-shadow);
}

.paper-focus-topline,
.queue-item-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.paper-code {
  color: var(--ink);
  font: 550 .8rem/1.35 var(--sans);
  font-variant-numeric: tabular-nums;
}

.paper-code-divider {
  margin: 0 .35rem;
  color: #a4ada6;
  font-weight: 400;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .15rem 0;
  border-radius: 0;
  font-size: .8rem;
  font-weight: 550;
  white-space: nowrap;
}

.status-badge.status-green {
  background: transparent;
  color: var(--signal-green);
}

.status-badge.status-yellow {
  background: transparent;
  color: var(--signal-yellow);
}

.status-badge.status-red {
  background: transparent;
  color: var(--signal-red);
}

.status-badge.status-green::before,
.status-badge.status-yellow::before,
.status-badge.status-red::before {
  display: inline-block;
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  content: "";
}

.status-badge.status-green::before {
  background: var(--signal-green);
}

.status-badge.status-yellow::before {
  background: var(--signal-yellow);
}

.status-badge.status-red::before {
  background: var(--signal-red);
}

.paper-focus-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .72fr);
  align-items: start;
  gap: clamp(1.5rem, 2.6vw, 2.35rem);
  margin-top: 1.25rem;
}

.paper-focus-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.paper-focus h2 {
  max-width: 30ch;
  margin: 0 0 .45rem;
  font-size: clamp(1.22rem, 1.45vw, 1.42rem);
  font-weight: 600;
  line-height: 1.48;
  letter-spacing: -.012em;
}

.paper-entry-link {
  color: var(--ink);
  text-decoration: none;
}

.paper-entry-link:hover,
.paper-entry-link:focus-visible {
  color: var(--green-dark);
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-underline-offset: .16em;
}

.paper-owner-line,
.queue-item-owner {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.paper-owner-line span,
.queue-item-owner span {
  margin: 0 .18rem;
  color: #a4ada5;
}

.paper-focus-milestone {
  display: grid;
  gap: .3rem;
  margin-top: 1.45rem;
}

.focus-label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
}

.paper-focus-milestone strong {
  color: #244b46;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.paper-focus-goal {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2rem .55rem;
  margin: .85rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.paper-focus-goal>span:first-child {
  color: #68736c;
}

.paper-focus-goal strong {
  color: var(--ink);
  font-size: .88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.paper-focus-score {
  display: flex;
  align-self: stretch;
  flex-direction: column;
  padding: .2rem 0;
}

.score-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 550;
}

.score-heading span {
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.focus-metrics {
  display: grid;
  align-content: start;
  gap: .55rem;
  margin-top: .6rem;
}

.focus-metric {
  display: grid;
  min-width: 0;
  gap: .35rem;
  padding: .35rem 0;
}

.focus-metric-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
}

.focus-metric-head>span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.focus-metric-head>span b {
  margin-left: .25rem;
  color: var(--ink);
  font-weight: 500;
}

.focus-metric strong {
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
}

.focus-metric small {
  margin-left: .14rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
}

.metric-met {
  color: var(--signal-green) !important;
}

.metric-under {
  color: var(--signal-red) !important;
}

.metric-warn {
  color: var(--signal-yellow) !important;
}

.paper-actions,
.queue-item-actions {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-top: auto;
  padding-top: 1.4rem;
}

.paper-detail-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: .35rem;
  padding: .3rem .15rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 500;
}

.paper-detail-chevron {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  opacity: .72;
  transition: transform .18s ease, opacity .18s ease;
}

.paper-detail-toggle[aria-expanded="true"] .paper-detail-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.paper-detail-toggle:hover,
.paper-action-link:hover {
  text-decoration: underline;
  text-underline-offset: .16em;
}

.paper-action-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 500;
  text-decoration: none;
}

.paper-detail-toggle:hover,
.paper-action-link:hover {
  color: var(--green-dark);
}

.paper-collaboration-detail {
  grid-column: 1 / -1;
  margin-top: .9rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.paper-collaboration-detail[hidden] {
  display: none;
}

.paper-queue {
  min-width: 0;
}

.paper-queue-list {
  display: grid;
  gap: .7rem;
}

.paper-queue-item {
  padding: .95rem 1.05rem .8rem;
  border-radius: 14px;
  box-shadow: none;
  transition: background-color .18s ease, border-color .18s ease;
}

.paper-queue-item:hover {
  border-color: rgb(40 54 48 / 12%);
  background: #fff;
}

.paper-queue-item h3 {
  margin: 0 0 .48rem;
  font-size: .97rem;
  font-weight: 600;
  line-height: 1.5;
  text-wrap: pretty;
}

.queue-item-people {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .18rem .42rem;
  margin: 0;
  color: #647286;
  font-size: .76rem;
  line-height: 1.5;
}

.queue-item-people>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.queue-item-person-label {
  margin-right: .25rem;
  color: #8a94a3;
  font-size: .7rem;
}

.queue-item-people-separator {
  color: #b0b8c4;
}

.queue-item-goal {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .22rem .6rem;
  margin: .65rem 0 0;
  padding-top: .58rem;
  border-top: 1px solid #edf0f5;
  font-size: .78rem;
  line-height: 1.45;
}

.queue-item-goal-label {
  flex: 0 0 auto;
  color: #748197;
  font-size: .73rem;
}

.queue-item-goal-values {
  display: flex;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2rem .42rem;
  color: #35465e;
  overflow-wrap: anywhere;
}

.queue-item-goal-values time {
  color: #34445c;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.queue-item-node {
  display: grid;
  gap: .18rem;
  margin: .7rem 0 0;
}

.queue-item-node span {
  color: var(--muted);
  font-size: .72rem;
}

.queue-item-node strong {
  color: #244b46;
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.queue-score {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin-top: .75rem;
  padding-top: .55rem;
  color: var(--muted);
  font-size: .78rem;
}

.queue-score span {
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
}

.queue-score strong {
  color: var(--ink);
  font-size: .85rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.queue-item-actions {
  gap: .45rem;
  padding-top: .65rem;
}

.queue-item-actions .paper-detail-toggle,
.queue-item-actions .paper-action-link {
  min-height: 36px;
  font-size: .8rem;
}

.paper-actions .paper-detail-toggle,
.paper-actions .paper-action-link {
  min-height: 36px;
  font-size: .8rem;
}

.queue-detail-topline,
.queue-detail-week-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}

.queue-detail-topline {
  margin-bottom: .65rem;
}

.queue-detail-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem 1rem;
  margin: 0 0 .7rem;
}

.queue-detail-overview>div {
  min-width: 0;
}

.queue-detail-overview dt {
  margin-bottom: .12rem;
  color: var(--muted);
  font-size: .75rem;
}

.queue-detail-overview dd {
  margin: 0;
  color: #34445c;
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.queue-detail-week-heading {
  margin: .2rem 0 .25rem;
  color: #66758a;
  font-size: .75rem;
}

.score-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1.2rem;
  margin: 0;
}

.score-detail-grid>div {
  min-width: 0;
}

.score-detail-grid dt,
.weekly-detail-grid dt {
  margin-bottom: .18rem;
  color: var(--muted);
  font-size: .8rem;
}

.score-detail-grid dd,
.weekly-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: .87rem;
}

.score-detail-grid .subline {
  margin-top: .12rem;
}

.dashboard-empty {
  margin-top: 0;
  border: 1px solid #e2e8e2;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.timeline-list {
  display: grid;
  gap: .8rem;
}

.timeline-paper,
.timeline-paper:last-child {
  padding: 1.1rem 1.2rem 1.15rem;
  border: 1px solid #e2e7e2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(24 43 32 / 4%);
}

.timeline-paper-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  margin-bottom: .2rem;
}

.timeline-id {
  flex: 0 0 auto;
  color: #1c2924;
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.timeline-title {
  color: #303a34;
  font-size: .84rem;
}

.timeline-meta {
  color: var(--muted);
  font-size: .8rem;
}

.status-text {
  font-weight: 650;
}

.timeline-scroll {
  overflow-x: auto;
  padding: .1rem 0 .15rem;
}

.milestone-timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  width: 100%;
  min-width: max-content;
  margin: 0;
  padding: 1.45rem 0 .1rem;
  list-style: none;
}

.timeline-node {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.timeline-node:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 1.98rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e1e4e1;
  content: "";
}

.timeline-node.is-done:not(:last-child)::after {
  background: #18814c;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #d5d9d6;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}

.timeline-node.is-done .timeline-marker {
  border-color: #18814c;
  background: #18814c;
}

.timeline-node.is-current .timeline-marker {
  border-color: var(--green);
  background: var(--green);
  font-size: .56rem;
}

.timeline-node.is-overdue .timeline-marker {
  border-color: #b42318;
  background: #b42318;
}

.timeline-node time {
  margin-top: .45rem;
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

.timeline-node-title {
  max-width: 17ch;
  margin-top: .15rem;
  color: #304039;
  font-size: .82rem;
  line-height: 1.4;
}

.timeline-node-state {
  min-height: 1.1rem;
  margin-top: .16rem;
  color: #59645d;
  font-size: .78rem;
}

.timeline-node.is-done .timeline-node-state {
  color: #18814c;
}

.timeline-node.is-current .timeline-node-state {
  color: var(--green-dark);
}

.timeline-node.is-overdue .timeline-node-state {
  color: #b42318;
}

.weekly-selector {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .1rem .1rem .85rem;
}

.weekly-selector label {
  display: inline;
  color: #5f6862;
  font-size: .82rem;
  font-weight: 600;
}

.weekly-selector select {
  width: 100%;
  max-width: 100%;
  min-width: min(100%, 360px);
  min-height: 40px;
  flex: 1 1 500px;
  border-radius: 8px;
}

.weekly-record {
  padding: 1.2rem 1.3rem;
  border: 1px solid #e2e7e2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(24 43 32 / 4%);
}

.weekly-record[hidden] {
  display: none;
}

.weekly-record-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid #e8edf3;
}

.weekly-record-title-group {
  min-width: 0;
  width: 100%;
}

.weekly-record-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.weekly-record-heading h3 {
  margin: .35rem 0 .45rem;
  overflow: hidden;
  color: #26364a;
  font-size: 1.12rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  margin: 0;
  color: #65748a;
  font-size: .82rem;
}

.weekly-record-meta span {
  display: inline-flex;
  gap: .4rem;
}

.weekly-record-meta strong {
  color: #8792a2;
  font-size: .76rem;
  font-weight: 500;
}

.weekly-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.1rem 0;
  padding: .8rem 0;
  border-top: 1px solid #e7ebe7;
  border-bottom: 1px solid #e7ebe7;
}

.weekly-score-grid>div {
  display: grid;
  gap: .22rem;
  padding: 0;
  background: transparent;
}

.weekly-score-grid>div+div {
  border-left: 0;
}

.weekly-score-grid span {
  color: var(--muted);
  font-size: .75rem;
}

.weekly-score-grid strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.weekly-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1.2rem;
  margin: .9rem 0 1rem;
}

.weekly-record>.button {
  margin-top: .1rem;
  border-radius: 8px;
}

.weekly-submission-list {
  display: grid;
  gap: .75rem;
  margin: .85rem 0 1rem;
}

.weekly-submission {
  min-width: 0;
  padding: .9rem 1rem;
  border: 1px solid #e7ebf2;
  border-radius: 11px;
  background: #f8f9fc;
}

.weekly-submission-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.weekly-submission-heading>div {
  display: flex;
  align-items: baseline;
  gap: .55rem;
}

.weekly-submission-heading>div>span {
  color: #8792a2;
  font-size: .76rem;
}

.weekly-submission-heading strong {
  color: #344257;
  font-size: .88rem;
}

.weekly-submission-heading time {
  color: #7b8798;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.weekly-submission-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: .7rem 0;
}

.weekly-submission-metrics>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .52rem .65rem;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #fff;
}

.weekly-submission-metrics span {
  color: #68768b;
  font-size: .77rem;
}

.weekly-submission-metrics strong {
  color: #344257;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weekly-submission-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin: 0;
}

.weekly-submission-details>div {
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #fff;
}

.weekly-submission-details dt {
  margin-bottom: .3rem;
  color: #68768b;
  font-size: .76rem;
  font-weight: 600;
}

.weekly-submission-details dd {
  margin: 0;
  color: #344257;
  font-size: .84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.weekly-submission-details dd small {
  display: block;
  margin-top: .3rem;
  color: #8792a2;
  font-size: .75rem;
}

.weekly-record-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #e8edf3;
}

.weekly-record-actions .button {
  border-radius: 8px;
}

@media (max-width: 1120px) {
  .dashboard-page {
    max-width: none;
  }

  .paper-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .paper-queue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-page .dashboard-heading {
    align-items: flex-start;
  }

  .dashboard-tabs {
    gap: .85rem;
  }

  .dashboard-tab {
    min-width: 72px;
  }

  .paper-focus-content {
    grid-template-columns: minmax(0, 1fr) minmax(230px, .7fr);
  }

  .paper-queue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .milestone-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .dashboard-page .dashboard-heading {
    gap: .8rem;
  }

  .week-picker {
    width: 100%;
    flex-wrap: wrap;
  }

  .week-picker label {
    flex: 0 0 auto;
  }

  .week-picker input {
    flex: 1 1 150px;
    min-width: 0;
  }

  .week-submit {
    flex: 0 0 auto;
  }

  .dashboard-tabs {
    gap: .5rem;
  }

  .dashboard-tab {
    min-width: 0;
    flex: 1 1 auto;
    padding-right: .35rem;
    padding-left: .35rem;
    font-size: .83rem;
  }

  .dashboard-filters {
    align-items: stretch;
  }

  .dashboard-filters .search-field {
    flex-basis: 100%;
  }

  .dashboard-filters select {
    width: 100%;
    flex: 1 1 100%;
  }

  .dashboard-filters .dashboard-manage {
    margin-left: 0;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
  }

  .panel-stats {
    gap: .4rem .8rem;
  }

  .week-chip {
    margin-left: 0;
  }

  .paper-focus-content {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .paper-focus-score {
    padding: .15rem 0;
  }

  .paper-queue-list {
    grid-template-columns: 1fr;
  }

  .paper-focus,
  .paper-queue-item,
  .timeline-paper,
  .weekly-record {
    padding: 1rem;
  }

  .paper-actions,
  .queue-item-actions {
    gap: .4rem;
  }

  .paper-actions .paper-action-link,
  .paper-detail-toggle {
    min-height: 44px;
  }

  .focus-metrics {
    gap: .5rem;
  }

  .focus-metric-head>span {
    font-size: .78rem;
  }

  .focus-metric strong {
    font-size: 1.08rem;
  }

  .queue-score {
    gap: .35rem .8rem;
  }

  .weekly-record-heading {
    align-items: flex-start;
  }

  .weekly-score-grid {
    gap: .6rem;
  }

  .weekly-detail-grid,
  .score-detail-grid {
    grid-template-columns: 1fr;
  }

  .weekly-selector {
    align-items: stretch;
  }

  .weekly-selector select {
    min-width: 0;
    flex-basis: 100%;
  }

  .weekly-record {
    padding: .9rem;
  }

  .weekly-submission {
    padding: .7rem;
  }

  .weekly-submission-metrics>div {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
    padding: .42rem;
  }

  .weekly-submission-metrics span {
    font-size: .68rem;
  }

  .weekly-submission-metrics strong {
    font-size: .82rem;
  }

  .weekly-submission-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .weekly-record-heading h3 {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

/* Published papers: compact, searchable data table inspired by ArchitectUI's dynamic table. */
.published-page {
  width: 100%;
  max-width: 1576px;
  margin: 0 auto;
}

.published-table-card {
  overflow: hidden;
  border: 1px solid #e1e7ef;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(31 46 67 / 4%);
}

.published-table-controls {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  flex-flow: row wrap;
  gap: .75rem 1rem;
  padding: 1rem 1.1rem .8rem;
}

.published-page-size,
.published-search,
.published-filter-select {
  display: inline-flex;
  width: max-content;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  flex-flow: row nowrap;
  gap: .5rem;
  color: #596577;
  font-size: .82rem;
  white-space: nowrap;
}

.published-page-size>span,
.published-filter-select>span,
.published-search>span {
  display: inline-block;
  flex: 0 0 auto;
  white-space: nowrap;
}

.published-page-size select,
.published-search input,
.published-filter-select select {
  min-height: 36px;
  margin: 0;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  color: #344257;
  font: inherit;
}

.published-page-size select {
  width: 80px;
  min-width: 80px;
  flex: 0 0 80px;
  padding: .3rem .55rem;
}

.published-filter-group {
  display: flex;
  width: max-content;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-flow: row nowrap;
  gap: .75rem;
}

.published-filter-select select {
  width: 118px;
  min-width: 118px;
  flex: 0 0 118px;
  padding: .3rem .55rem;
}

.published-search input {
  width: min(260px, 45vw);
  flex: 0 0 min(260px, 45vw);
  padding: .38rem .6rem;
}

.published-page-size select:focus,
.published-filter-select select:focus,
.published-search input:focus {
  border-color: #85a6ef;
  outline: 3px solid rgb(59 110 230 / 15%);
}

.published-filter-group {
  display: flex;
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  flex-flow: row wrap;
  gap: .65rem;
}

.published-table-scroll {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding: 0 1.1rem;
}

.published-data-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #293546;
  font-size: .84rem;
}

.published-data-table .published-col-year {
  width: 7%;
}

.published-data-table .published-col-title {
  width: 38%;
}

.published-data-table .published-col-authors {
  width: 19%;
}

.published-data-table .published-col-publication {
  width: 25%;
}

.published-data-table .published-col-citations {
  width: 11%;
}

.published-data-table th,
.published-data-table td {
  box-sizing: border-box;
  padding: .35rem .5rem;
  border-right: 1px solid #e6eaf0;
  text-align: left;
  vertical-align: middle;
}

.published-data-table th:last-child,
.published-data-table td:last-child {
  border-right: 0;
}

.published-data-table thead {
  border-bottom: 1px solid #dfe5ee;
}

.published-data-table th {
  padding-top: .48rem;
  padding-bottom: .48rem;
  color: #3b4657;
  font-weight: 650;
  white-space: nowrap;
}

.published-data-table th button {
  display: flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.published-data-table th button span {
  color: #98a2b1;
  font-size: .74rem;
}

.published-data-table th button:hover {
  color: var(--workspace-blue-dark);
}

.published-data-table tbody tr {
  height: 76px;
}

.published-data-table td {
  height: 76px;
  line-height: 1.4;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.published-data-table tbody tr:nth-child(odd) {
  background: #f2f3f5;
}

.published-data-table tbody tr:hover {
  background: #eaf0fb;
}

.published-data-table tbody tr[hidden] {
  display: none;
}

.published-data-table tbody tr[data-published-placeholder] {
  pointer-events: none;
}

.published-data-table td:first-child {
  color: #68768b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.published-title-cell {
  color: #2e3d54;
  font-weight: 550;
}

.published-title-cell a {
  display: block;
  height: 2.8em;
  max-height: 2.8em;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.published-title-cell a:hover {
  color: var(--workspace-blue-dark);
  text-decoration: underline;
  text-underline-offset: .14em;
}

.published-data-table td:nth-child(4) {
  color: #647286;
}

.published-data-table td:last-child {
  color: #647286;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.published-cell-clamp {
  display: -webkit-box;
  height: 2.8em;
  max-height: 2.8em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.published-data-table [data-published-empty] td {
  color: #788598;
  text-align: center;
}

.published-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.1rem 1rem;
  color: #687487;
  font-size: .8rem;
}

.published-table-footer p {
  margin: 0;
}

.published-pagination {
  display: flex;
  align-items: center;
}

.published-page-button {
  min-width: 36px;
  min-height: 35px;
  margin-left: -1px;
  padding: .3rem .55rem;
  border: 1px solid #dce3ec;
  background: #fff;
  color: #3f4e64;
  font-size: .8rem;
}

.published-page-button:first-child {
  margin-left: 0;
  border-radius: 7px 0 0 7px;
}

.published-page-button:last-child {
  border-radius: 0 7px 7px 0;
}

.published-page-button:hover:not(:disabled):not(.is-current) {
  position: relative;
  z-index: 1;
  background: #f4f7fc;
}

.published-page-button.is-current {
  position: relative;
  z-index: 1;
  border-color: var(--workspace-blue);
  background: var(--workspace-blue);
  color: #fff;
}

.published-page-button:disabled {
  background: #f4f5f7;
  color: #a0a8b4;
}

.published-page-ellipsis {
  display: grid;
  min-width: 28px;
  height: 35px;
  place-items: center;
  color: #7c8797;
}

.published-source-note {
  margin: .8rem .15rem 0;
  color: #788598;
  font-size: .76rem;
  line-height: 1.6;
}

.published-source-note a {
  color: #466bb2;
  text-decoration: none;
}

.published-source-note a:hover {
  text-decoration: underline;
  text-underline-offset: .14em;
}

@media (max-width: 700px) {
  .published-table-controls {
    align-items: center;
    justify-content: flex-start;
    padding: .8rem .75rem .65rem;
  }

  .published-filter-group {
    width: 100%;
    flex: 1 1 100%;
    align-items: center;
    justify-content: flex-start;
  }

  .published-filter-select {
    justify-content: flex-start;
  }

  .published-filter-select select {
    width: 118px;
    min-width: 118px;
    flex: 0 0 118px;
  }

  .published-search {
    width: max-content;
    min-width: max-content;
    align-items: center;
    flex-flow: row nowrap;
  }

  .published-search input {
    width: 180px;
    flex: 0 0 180px;
  }

  .published-table-scroll {
    padding: 0 .75rem;
  }

  .published-data-table {
    font-size: .78rem;
  }

  .published-data-table .published-col-year {
    width: 15%;
  }

  .published-data-table .published-col-title {
    width: 42%;
  }

  .published-data-table .published-col-authors {
    width: 21%;
  }

  .published-data-table .published-col-publication {
    width: 22%;
  }

  .published-data-table .published-col-citations {
    display: none;
  }

  .published-data-table th:last-child,
  .published-data-table td:last-child {
    display: none;
  }

  .published-data-table th,
  .published-data-table td {
    padding-right: .25rem;
    padding-left: .25rem;
  }

  .published-data-table th {
    white-space: normal;
  }

  .published-table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .published-pagination {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .published-page-button {
    min-width: 30px;
    padding-right: .35rem;
    padding-left: .35rem;
  }

  .published-page-ellipsis {
    min-width: 20px;
  }
}

@media (max-width: 420px) {
  .published-table-controls {
    gap: .65rem;
  }

  .published-page-size,
  .published-filter-select,
  .published-search {
    gap: .35rem;
    font-size: .78rem;
  }

  .published-filter-select select {
    width: 108px;
    min-width: 108px;
    flex-basis: 108px;
  }

  .published-search input {
    width: 170px;
    flex-basis: 170px;
  }

  .panel-stats {
    gap: .35rem .65rem;
    font-size: .76rem;
  }

  .panel-stats .stat-total strong {
    font-size: 1rem;
  }

  .score-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .1rem;
  }
}

/* Workspace shell: persistent navigation, quiet utility bar, and a focused first screen. */
.workspace-shell {
  --workspace-blue: #356fe4;
  --workspace-blue-dark: #2458c3;
  --workspace-blue-soft: #edf3ff;
  --workspace-canvas: #f5f7fb;
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--workspace-canvas);
}

.workspace-sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 600px;
  flex-direction: column;
  padding: 1.2rem .9rem 1rem;
  border-right: 1px solid #e8ebf1;
  background: #fff;
}

.workspace-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .68rem;
  margin: 0 0 1.65rem;
  padding: .15rem .45rem;
  color: var(--ink);
  text-decoration: none;
}

.workspace-brand img {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: contain;
}

.workspace-brand span,
.workspace-brand strong,
.workspace-brand small {
  display: block;
  min-width: 0;
}

.workspace-brand strong {
  overflow: hidden;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-brand small {
  margin-top: .08rem;
  color: #788397;
  font-size: .69rem;
}

.workspace-navigation {
  display: grid;
  align-content: start;
  gap: .22rem;
}

.sidebar-section-label {
  margin: 0;
  padding: .25rem .7rem .42rem;
  color: #929bab;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .045em;
}

.sidebar-section-spaced {
  margin-top: .72rem;
}

.sidebar-tablist,
.sidebar-link-list {
  display: grid;
  gap: .2rem;
}

.sidebar-nav-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: .72rem;
  padding: .55rem .72rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #5e6878;
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}

.sidebar-nav-item svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.sidebar-nav-item:hover {
  background: #f4f6fa;
  color: #334155;
  text-decoration: none;
}

.sidebar-nav-item.is-active,
.sidebar-nav-item[aria-selected="true"] {
  background: var(--workspace-blue-soft);
  color: var(--workspace-blue-dark);
  font-weight: 650;
}

.sidebar-nav-item:focus-visible {
  outline-color: #7ea5ff;
  outline-offset: 1px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: auto;
  padding: 1rem .55rem .2rem;
  border-top: 1px solid #edf0f4;
  color: #788397;
  font-size: .72rem;
  line-height: 1.5;
}

.sidebar-footer-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid #e4eaf6;
  border-radius: 10px;
  background: #f6f8fd;
  color: #66748a;
  font-size: .64rem;
  font-weight: 750;
  letter-spacing: .04em;
}

.workspace-main {
  min-width: 0;
}

.workspace-topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem clamp(1.25rem, 3vw, 2.35rem);
  border-bottom: 1px solid #e9edf2;
  background: rgb(255 255 255 / 96%);
}

.topbar-leading,
.topbar-utilities {
  display: flex;
  min-width: 0;
  align-items: center;
}

.topbar-leading {
  gap: .8rem;
}

.workspace-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .58rem;
  color: #8993a2;
  font-size: .82rem;
}

.workspace-breadcrumb strong {
  overflow: hidden;
  color: #273343;
  font-size: .84rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-utilities {
  gap: .62rem;
}

.topbar-user-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #e3eafb;
  border-radius: 50%;
  background: #edf3ff;
  color: #111;
  font-size: .84rem;
  font-weight: 700;
}

.topbar-user {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.topbar-user strong {
  overflow: hidden;
  color: #303b4b;
  font-size: .8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user small {
  margin-top: .12rem;
  color: #8993a2;
  font-size: .69rem;
}

.topbar-utilities form {
  margin: 0 0 0 .2rem;
  padding-left: .72rem;
  border-left: 1px solid #e6eaf0;
}

.topbar-logout {
  min-height: 34px;
  padding: .35rem .1rem .35rem .25rem;
  border: 0;
  background: transparent;
  color: #667184;
  font-size: .8rem;
}

.topbar-logout:hover {
  color: var(--workspace-blue-dark);
}

.topbar-dashboard-filters {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  align-items: center;
  flex-wrap: nowrap;
  gap: .45rem;
  margin: 0 2rem 0 .15rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-dashboard-filters .toolbar-search {
  min-width: 150px;
  flex: 1 1 180px;
}

.topbar-dashboard-filters .toolbar-control {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .35rem;
  color: #7b8696;
  font-size: .73rem;
  font-weight: 550;
  white-space: nowrap;
}

.topbar-dashboard-filters .week-control {
  flex: 0 0 auto;
}

.topbar-dashboard-filters input,
.topbar-dashboard-filters select {
  min-height: 38px;
  border: 1px solid #e6eaf0;
  border-radius: 8px;
  background: #f8f9fb;
  color: #354153;
  font-size: .8rem;
}

.topbar-dashboard-filters .toolbar-search input {
  width: 100%;
}

.topbar-dashboard-filters .week-control input {
  width: 142px;
  padding: .38rem .48rem;
  font-variant-numeric: tabular-nums;
}

.topbar-dashboard-filters .toolbar-control select {
  width: 138px;
  min-width: 122px;
  padding-right: 1.6rem;
}

.topbar-dashboard-filters input:focus,
.topbar-dashboard-filters select:focus {
  border-color: #86a9f5;
  background: #fff;
  outline-color: #c4d5ff;
}

.topbar-dashboard-filters .dashboard-filter-submit {
  min-height: 38px;
  flex: 0 0 auto;
  padding: .35rem .7rem;
  border-color: var(--workspace-blue);
  border-radius: 8px;
  background: var(--workspace-blue);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-dashboard-filters .dashboard-filter-submit:hover {
  border-color: var(--workspace-blue-dark);
  background: var(--workspace-blue-dark);
}

.topbar-dashboard-filters .dashboard-filter-clear {
  flex: 0 0 auto;
  padding: .25rem .1rem;
  color: #6f7b8e;
  font-size: .74rem;
  white-space: nowrap;
}

.workspace-page.page-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 68px);
  margin: 0;
  padding: 1.65rem clamp(1.25rem, 3vw, 2.35rem) 3rem;
  background: var(--workspace-canvas);
}

.workspace-page .flash-stack {
  max-width: 1480px;
  margin: 0 auto 1rem;
}

.dashboard-page {
  max-width: 1576px;
}

.dashboard-page .dashboard-heading {
  align-items: end;
  margin-bottom: 1rem;
}

.dashboard-overline {
  margin-bottom: .18rem;
  color: #788397;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .025em;
}

.dashboard-page .dashboard-heading h1 {
  color: #202d3d;
  font-size: clamp(1.8rem, 2.7vw, 2.2rem);
  letter-spacing: -.035em;
}

.dashboard-intro {
  margin: .22rem 0 0;
  color: #788397;
  font-size: .86rem;
}

.dashboard-panel {
  max-width: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-tab-panel {
  padding: 0;
}

.dashboard-tab-panel[hidden] {
  display: none;
}

.dashboard-tab-panel:not([hidden]) {
  animation: panel-enter .2s ease-out both;
}

@keyframes panel-enter {
  from {
    opacity: .78;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-page .panel-heading {
  align-items: center;
  gap: .9rem;
  margin: 0 0 .8rem;
  padding: 0;
}

.dashboard-page .panel-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: .7rem;
}

.dashboard-page .panel-stats>span:not(.week-chip) {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: .48rem;
  padding: .65rem .85rem;
  border: 1px solid #e8ebf1;
  border-radius: 12px;
  background: #fff;
  color: #677386;
  font-size: .8rem;
  box-shadow: 0 2px 8px rgb(31 46 67 / 2%);
}

.dashboard-page .panel-stats strong {
  font-size: 1.12rem;
  font-weight: 700;
}

.dashboard-page .panel-stats .stat-total strong {
  color: #273548;
  font-size: 1.22rem;
}

.dashboard-page .panel-stats .status-green strong {
  color: var(--signal-green);
}

.dashboard-page .panel-stats .status-yellow strong {
  color: var(--signal-yellow);
}

.dashboard-page .panel-stats .status-red strong {
  color: var(--signal-red);
}

.dashboard-page .week-chip {
  align-self: start;
  margin: .22rem 0 0;
  padding: .26rem .55rem;
  border-radius: 7px;
  background: #edf3ff;
  color: #4d68a0;
  font-size: .74rem;
}

.dashboard-page .paper-workbench {
  grid-template-columns: minmax(0, 1.14fr) minmax(310px, .86fr);
  gap: .85rem;
}

.dashboard-page .paper-focus,
.dashboard-page .paper-queue-item {
  border-color: #e7eaf0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 3px 13px rgb(31 46 67 / 3.5%);
}

.dashboard-page .paper-focus {
  padding: clamp(1.1rem, 2vw, 1.5rem);
}

.dashboard-page .paper-queue-item {
  padding: .92rem 1rem .8rem;
}

.dashboard-page .status-badge {
  padding: .2rem .52rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.dashboard-page .status-badge.status-green {
  background: var(--signal-green-bg);
}

.dashboard-page .status-badge.status-yellow {
  background: var(--signal-yellow-bg);
}

.dashboard-page .status-badge.status-red {
  background: var(--signal-red-bg);
}

.dashboard-page .paper-focus h2 {
  color: #253247;
}

.dashboard-page .paper-focus-milestone strong,
.dashboard-page .queue-item-node strong {
  color: #284d81;
}

.dashboard-page .paper-focus-score {
  padding: .35rem .25rem;
}

.dashboard-page .focus-metric {
  padding: .38rem .55rem;
  border: 1px solid #edf0f5;
  border-radius: 9px;
  background: #fafbfc;
}

.dashboard-page .focus-metric-head>span {
  color: #667286;
}

.dashboard-page .focus-metric-head>span b {
  color: #344257;
}

.dashboard-page .paper-detail-toggle {
  color: #5a667a;
}

.dashboard-page .paper-detail-toggle:hover,
.dashboard-page .paper-action-link:hover {
  color: var(--workspace-blue-dark);
}

.dashboard-page .paper-actions {
  padding-top: .65rem;
}

.dashboard-page .paper-collaboration-detail {
  border-color: #e8ebf1;
}

.dashboard-page .timeline-paper,
.dashboard-page .weekly-record {
  border-color: #e7eaf0;
  border-radius: 14px;
  box-shadow: 0 3px 13px rgb(31 46 67 / 3%);
}

.dashboard-page .weekly-selector select {
  border-radius: 9px;
}

.workspace-page .button-primary {
  background: var(--workspace-blue);
}

.workspace-page .button-primary:hover {
  background: var(--workspace-blue-dark);
}

@media (max-width: 1120px) {
  .workspace-shell {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .workspace-page.page-shell {
    padding-right: 1.35rem;
    padding-left: 1.35rem;
  }

  .dashboard-page .paper-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .paper-queue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .workspace-shell {
    display: grid;
    grid-template-columns: 252px minmax(320px, 1fr);
  }

  .workspace-sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    width: auto;
    height: 100vh;
    min-height: 600px;
    transform: none;
    transition: none;
    box-shadow: none;
  }

  .workspace-topbar {
    min-height: 64px;
  }

  .workspace-page.page-shell {
    min-height: calc(100vh - 64px);
  }
}

@media (max-width: 1550px) {
  .workspace-topbar {
    flex-wrap: wrap;
    row-gap: .45rem;
  }

  .topbar-dashboard-filters {
    order: 3;
    min-width: 0;
    flex: 1 0 100%;
    flex-wrap: wrap;
    margin: 0;
  }
}

@media (max-width: 700px) {
  .workspace-shell {
    grid-template-columns: 252px minmax(320px, 1fr);
  }

  .workspace-sidebar {
    padding: 1rem .7rem .85rem;
  }

  .workspace-topbar {
    min-height: 60px;
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .workspace-breadcrumb {
    gap: .4rem;
    font-size: .74rem;
  }

  .topbar-utilities {
    gap: .4rem;
  }

  .topbar-user {
    display: none;
  }

  .topbar-utilities form {
    margin-left: .12rem;
    padding-left: .5rem;
  }

  .workspace-page.page-shell {
    min-height: calc(100vh - 60px);
    padding: 1.25rem 1rem 2rem;
  }

  .dashboard-page .dashboard-heading {
    align-items: flex-start;
    margin-bottom: .85rem;
  }

  .dashboard-intro {
    max-width: 38ch;
    font-size: .82rem;
  }

  .topbar-dashboard-filters {
    gap: .45rem;
  }

  .topbar-dashboard-filters .toolbar-search {
    order: -1;
    flex: 1 1 100%;
  }

  .topbar-dashboard-filters .week-control {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .topbar-dashboard-filters .week-control input {
    width: min(65%, 190px);
  }

  .topbar-dashboard-filters .toolbar-control:not(.week-control) {
    flex: 1 1 calc(50% - .45rem);
  }

  .topbar-dashboard-filters .toolbar-control select {
    width: 100%;
    min-width: 0;
  }

  .topbar-dashboard-filters .dashboard-filter-submit {
    flex: 1 1 110px;
  }

  .topbar-dashboard-filters .dashboard-filter-clear {
    flex: 1 1 100px;
    text-align: center;
  }

  .dashboard-page .panel-heading {
    align-items: flex-start;
  }

  .dashboard-page .panel-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }

  .dashboard-page .panel-stats>span:not(.week-chip) {
    min-height: 58px;
    padding: .55rem .65rem;
  }

  .dashboard-page .week-chip {
    margin-top: .15rem;
  }

  .dashboard-page .paper-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .paper-queue-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .paper-focus-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-page .paper-focus,
  .dashboard-page .paper-queue-item {
    padding: 1rem;
  }

  .dashboard-page .paper-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {

  .sidebar-nav-item,
  .dashboard-tab-panel:not([hidden]) {
    scroll-behavior: auto;
    transition: none;
    animation: none;
  }
}

/* Admin member management: concise data panel and operational lists. */
.admin-users-page {
  width: min(100%, 1560px);
  margin: 0 auto;
}

.admin-performance-panel,
.admin-panel {
  border: 1px solid #e4e9f1;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(32 49 73 / 4%);
  transition: box-shadow .2s ease;
}

.admin-performance-panel:hover,
.admin-panel:hover {
  box-shadow: 0 14px 30px rgb(32 49 73 / 19%);
}

.admin-performance-panel {
  margin-bottom: 1rem;
  padding: .95rem 1.15rem .8rem;
}

.admin-performance-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 .1rem .72rem;
  border-bottom: 1px solid #edf0f5;
}

.admin-performance-heading h2,
.admin-panel-heading h2 {
  margin: 0;
  color: #273449;
  font-size: 1rem;
  font-weight: 650;
}

.admin-overview-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 7px;
  color: var(--workspace-blue-dark);
  font-size: .79rem;
  font-weight: 600;
  text-decoration: none;
}

.admin-overview-action:hover {
  background: #f4f7ff;
  text-decoration: none;
}

.admin-performance-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: .5rem;
}

.admin-performance-stat {
  display: flex;
  min-width: 0;
  min-height: 94px;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1rem;
}

.admin-stat-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
}

.admin-stat-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.admin-stat-icon.is-blue {
  background: #eaf0ff;
  color: #356fe5;
}

.admin-stat-icon.is-amber {
  background: #fff3dc;
  color: #a86400;
}

.admin-stat-icon.is-green {
  background: #e8f5ed;
  color: #168052;
}

.admin-stat-copy {
  display: grid;
  min-width: 0;
  gap: .08rem;
}

.admin-stat-label {
  color: #68758a;
  font-size: .79rem;
  font-weight: 500;
}

.admin-stat-copy strong {
  color: #354051;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.15;
}

.admin-performance-stat:nth-child(2) .admin-stat-copy strong {
  color: #a86400;
}

.admin-performance-stat:nth-child(3) .admin-stat-copy strong {
  color: #168052;
}

.admin-panel {
  margin-top: .9rem;
  padding: 1rem 1.1rem;
}

.admin-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .75rem;
}

.admin-count-badge {
  display: inline-flex;
  min-height: 25px;
  flex: 0 0 auto;
  align-items: center;
  padding: .15rem .55rem;
  border: 1px solid #e5eaf2;
  border-radius: 999px;
  background: #f7f9fc;
  color: #5f6c80;
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.admin-count-badge.is-pending {
  border-color: #f3dfbd;
  background: #fff6e7;
  color: #8f5105;
}

.admin-review-list {
  display: grid;
}

.admin-review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: .7rem .1rem;
  border-top: 1px solid #edf0f5;
}

.admin-review-identity {
  display: grid;
  min-width: 0;
  gap: .12rem;
}

.admin-review-identity strong {
  color: #263448;
  font-size: .88rem;
}

.admin-review-identity span,
.admin-review-date {
  color: #68758a;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.admin-review-row form {
  margin: 0;
}

.admin-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
}

.admin-review-row .button-primary {
  border-radius: 8px;
  background: var(--workspace-blue);
}

.admin-review-row .button-quiet-danger {
  border-color: #f0dada;
  background: #fff;
  color: #a33d3d;
}

.admin-review-row .button-quiet-danger:hover {
  border-color: #e8bbbb;
  background: #fff7f7;
}

.admin-empty-state {
  display: flex;
  min-height: 52px;
  align-items: center;
  padding: .65rem .1rem .15rem;
  border-top: 1px solid #edf0f5;
}

.admin-empty-state strong {
  color: #536176;
  font-size: .84rem;
  font-weight: 550;
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-users-page .data-table {
  font-size: .83rem;
}

.admin-users-page .data-table th {
  padding: .58rem .7rem;
  border-bottom: 1px solid #e8edf3;
  background: #f6f8fb;
  color: #657187;
  font-size: .73rem;
  font-weight: 650;
}

.admin-users-page .data-table td {
  padding: .66rem .7rem;
  border-bottom: 1px solid #edf0f5;
  vertical-align: middle;
}

.admin-users-page .data-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-users-page .data-table tbody tr:hover {
  background: #fbfcfe;
}

.admin-member-table {
  width: 100%;
  min-width: 840px;
  table-layout: fixed;
}

.admin-member-table th:first-child {
  width: 24%;
}

.admin-member-table th:nth-child(2),
.admin-member-table th:nth-child(3) {
  width: 9%;
}

.admin-member-table th:nth-child(4) {
  width: 34%;
}

.admin-member-table th:last-child {
  width: 24%;
}

.admin-member-table td:first-child strong {
  color: #2d3a4d;
  font-weight: 650;
}

.admin-role-pill,
.admin-status-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: .38rem;
  padding: .16rem .55rem;
  border: 1px solid #e7ebf1;
  border-radius: 999px;
  background: #f8f9fb;
  color: #5e6a7e;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-locked-note {
  color: #8792a4;
  font-size: .78rem;
}

.admin-status-pill>span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #8b95a3;
}

.admin-status-pill.is-active {
  border-color: #d6eadf;
  background: #f0f8f3;
  color: #176a43;
}

.admin-status-pill.is-active>span {
  background: #198754;
}

.admin-status-pill.is-pending {
  border-color: #f2e2c8;
  background: #fff8eb;
  color: #8b550d;
}

.admin-status-pill.is-pending>span {
  background: #c27812;
}

.admin-status-pill.is-disabled {
  border-color: #e7e9ed;
  background: #f5f6f8;
  color: #697386;
}

.admin-status-pill.is-disabled>span {
  background: #8a93a0;
}

.admin-status-pill.is-rejected {
  border-color: #f0dada;
  background: #fff5f5;
  color: #9f3a3a;
}

.admin-status-pill.is-rejected>span {
  background: #bd4b4b;
}

.admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}

.admin-role-form {
  gap: .35rem;
}

.admin-users-page .admin-actions select,
.admin-users-page .admin-assignment-form select {
  min-height: 36px;
  max-width: 220px;
  padding: .3rem .55rem;
  border-color: #dce3ec;
  border-radius: 7px;
  background: #fff;
  font-size: .78rem;
}

.admin-users-page .button-small {
  min-height: 36px;
  border-radius: 7px;
  font-size: .77rem;
}

.admin-users-page .button-quiet {
  border-color: #e4e8ee;
  background: #fff;
  color: #526076;
}

.admin-users-page .button-quiet:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.admin-users-page .button-quiet-danger {
  color: #a33d3d;
}

.admin-users-page .button-quiet-danger:hover {
  border-color: #f0cccc;
  background: #fff7f7;
}

.admin-users-page .text-button {
  font-size: .8rem;
}

.admin-mobile-label {
  display: none;
}

.admin-assignment-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.admin-assignment-table th:first-child {
  width: 34%;
}

.admin-assignment-table th:nth-child(2),
.admin-assignment-table th:nth-child(3) {
  width: 12%;
}

.admin-assignment-table th:nth-child(4) {
  width: 26%;
}

.admin-assignment-table th:last-child {
  width: 16%;
}

.admin-paper-link {
  color: #334e73;
  font-weight: 600;
  text-decoration: none;
}

.admin-paper-link:hover {
  color: var(--workspace-blue-dark);
  text-decoration: underline;
}

.admin-assigned-name {
  color: #3b4a5e;
  font-weight: 550;
}

.admin-unassigned {
  color: #68758a;
}

.admin-assignment-form {
  gap: .4rem;
}

.admin-assignment-form select {
  width: min(210px, calc(100% - 66px));
  min-width: 0;
}

.admin-assignment-form .button {
  min-width: 58px;
  white-space: nowrap;
}

.admin-assignment-table td:last-child .button {
  white-space: nowrap;
}

.admin-users-page :is(a, button, select):focus-visible {
  outline: 3px solid rgb(53 111 229 / 38%);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .admin-member-table {
    min-width: 840px;
  }
}

@media (max-width: 680px) {
  .admin-performance-panel {
    margin-bottom: .8rem;
    padding: .8rem .8rem .55rem;
  }

  .admin-performance-stat {
    min-height: 82px;
    gap: .55rem;
    padding: .55rem .5rem;
  }

  .admin-stat-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .admin-stat-icon svg {
    width: 19px;
    height: 19px;
  }

  .admin-stat-label {
    font-size: .72rem;
  }

  .admin-stat-copy strong {
    font-size: 1.35rem;
  }

  .admin-panel {
    margin-top: .7rem;
    padding: .85rem;
    border-radius: 12px;
  }

  .admin-panel-heading {
    gap: .55rem;
    margin-bottom: .6rem;
  }

  .admin-panel-heading h2,
  .admin-performance-heading h2 {
    font-size: .96rem;
  }

  .admin-count-badge {
    min-height: 24px;
    padding: .12rem .45rem;
    font-size: .72rem;
  }

  .admin-review-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .55rem;
  }

  .admin-review-identity {
    grid-column: 1;
  }

  .admin-review-date {
    grid-column: 1;
  }

  .admin-review-actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .admin-users-page .button-small {
    min-height: 40px;
  }

  .admin-table-scroll {
    overflow: visible;
  }

  .admin-users-page .admin-member-table,
  .admin-users-page .admin-assignment-table {
    display: block;
    min-width: 0;
  }

  .admin-users-page .admin-member-table thead,
  .admin-users-page .admin-assignment-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .admin-users-page .admin-member-table tbody,
  .admin-users-page .admin-assignment-table tbody {
    display: grid;
    gap: .55rem;
  }

  .admin-users-page .admin-member-table tr,
  .admin-users-page .admin-assignment-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .1rem .7rem;
    padding: .55rem .65rem;
    border: 1px solid #e8edf3;
    border-radius: 9px;
    background: #fff;
  }

  .admin-users-page .data-table td {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: .18rem;
    padding: .38rem .1rem;
    border: 0;
    overflow-wrap: anywhere;
  }

  .admin-users-page .admin-member-table td:first-child,
  .admin-users-page .admin-member-table td:nth-child(4),
  .admin-users-page .admin-member-table td:nth-child(5),
  .admin-users-page .admin-assignment-table td:first-child,
  .admin-users-page .admin-assignment-table td:last-child {
    grid-column: 1 / -1;
  }

  .admin-mobile-label {
    display: inline;
    color: #657287;
    font-size: .72rem;
    font-weight: 600;
  }

  .admin-users-page .admin-actions {
    width: 100%;
    gap: .35rem;
  }

  .admin-users-page .admin-role-form {
    flex-wrap: wrap;
  }

  .admin-users-page .admin-role-form select {
    flex: 1 1 130px;
    max-width: none;
  }

  .admin-users-page .admin-role-form .button {
    flex: 0 0 auto;
  }

  .admin-assignment-form {
    width: 100%;
  }

  .admin-assignment-form select {
    min-width: 0;
    flex: 1 1 160px;
  }
}

@media (max-width: 390px) {
  .admin-performance-panel {
    padding-inline: .65rem;
  }

  .admin-performance-stat {
    flex-direction: column;
    align-items: flex-start;
    gap: .38rem;
    padding: .55rem .4rem;
  }

  .admin-stat-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .admin-stat-label {
    min-height: 2em;
  }

  .admin-stat-copy strong {
    font-size: 1.2rem;
  }
}

/* Dashboard visual pass: compact data panel, restrained color, and real progress cues. */
.progress-overview {
  margin: 0 0 1rem;
  padding: .9rem 1.05rem .75rem;
  border: 1px solid #e2e7ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(32 49 73 / 4%);
}

.progress-overview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 .12rem .68rem;
  border-bottom: 1px solid #edf0f5;
}

.progress-overview-heading h2 {
  margin: 0;
  color: #344257;
  font-size: .9rem;
  font-weight: 650;
}

.progress-overview .week-chip {
  margin: 0;
  padding: .24rem .5rem;
  border: 1px solid #e7edf8;
  border-radius: 6px;
  background: #f4f7fc;
  color: #63738e;
  font-size: .72rem;
}

.progress-overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: .85rem 0 .78rem;
}

.overview-metric {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .75rem;
  padding: .15rem 1rem;
  border-right: 1px solid #edf0f5;
}

.overview-metric:first-child {
  padding-left: .12rem;
}

.overview-metric:last-child {
  padding-right: .12rem;
  border-right: 0;
}

.overview-metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: #edf3ff;
  color: #3972e8;
}

.overview-metric-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-metric-green .overview-metric-icon {
  background: #e8f5ee;
  color: #198052;
}

.overview-metric-amber .overview-metric-icon {
  background: #fff3dc;
  color: #b66b06;
}

.overview-metric-red .overview-metric-icon {
  background: #fdecea;
  color: #c43d32;
}

.overview-metric-copy {
  display: grid;
  min-width: 0;
  gap: .08rem;
}

.overview-metric-copy>span {
  overflow: hidden;
  color: #778397;
  font-size: .77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-metric-copy strong {
  color: #334155;
  font-size: 1.55rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
}

.overview-metric-green .overview-metric-copy strong {
  color: #18784f;
}

.overview-metric-amber .overview-metric-copy strong {
  color: #a96208;
}

.overview-metric-red .overview-metric-copy strong {
  color: #b93830;
}

.overview-distribution {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .6rem;
  border-top: 1px solid #edf0f5;
  color: #7b8797;
  font-size: .7rem;
}

.overview-distribution-track {
  display: flex;
  width: 100%;
  height: 4px;
  overflow: hidden;
  gap: 2px;
  border-radius: 999px;
  background: #eef1f5;
}

.overview-distribution-track span {
  min-width: 0;
  border-radius: 999px;
}

.distribution-green {
  background: #23875e;
}

.distribution-amber {
  background: #cf861e;
}

.distribution-red {
  background: #d34c42;
}

.overview-distribution>span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dashboard-page .paper-focus,
.dashboard-page .paper-queue-item {
  border-color: #e2e7ef;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgb(32 49 73 / 4%);
}

.dashboard-page .paper-focus {
  padding: clamp(1.05rem, 1.8vw, 1.4rem);
}

.dashboard-page .paper-focus-content {
  gap: clamp(1.2rem, 2vw, 1.8rem);
}

.dashboard-page .paper-focus h2 {
  line-height: 1.42;
}

.dashboard-page .paper-focus-score {
  align-self: stretch;
  padding: .72rem .8rem;
  border: 1px solid #e9edf3;
  border-radius: 10px;
  background: #f8f9fb;
}

.dashboard-page .score-heading {
  color: #59677b;
  font-weight: 650;
}

.dashboard-page .focus-metrics {
  gap: .4rem;
  margin-top: .55rem;
}

.dashboard-page .focus-metric {
  gap: .38rem;
  padding: .35rem 0 .4rem;
  border: 0;
  border-bottom: 1px solid #e9edf3;
  border-radius: 0;
  background: transparent;
}

.dashboard-page .focus-metric:last-child {
  padding-bottom: .05rem;
  border-bottom: 0;
}

.focus-progress-track {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}

.focus-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d14b40;
  transition: width .25s ease;
}

.focus-progress-fill.is-met {
  background: #24845c;
}

.focus-progress-fill.is-watch {
  background: #cf861e;
}

.focus-progress-fill.is-alert {
  background: #d14b40;
}

.dashboard-page .paper-queue-item {
  padding: .95rem 1rem .8rem;
}

.dashboard-page .paper-queue-item:hover {
  border-color: #cfd9e8;
  box-shadow: 0 8px 22px rgb(32 49 73 / 7%);
}

.dashboard-page .status-badge {
  padding: .18rem .48rem;
}

.dashboard-page .paper-focus-goal {
  padding-top: .72rem;
  border-top: 1px solid #edf0f5;
}

@media (max-width: 700px) {
  .progress-overview {
    padding: .8rem .75rem .7rem;
  }

  .progress-overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: .72rem;
    padding: .75rem 0;
  }

  .overview-metric {
    padding: .1rem .55rem;
    border-right: 0;
  }

  .overview-metric:nth-child(odd) {
    padding-left: .1rem;
    border-right: 1px solid #edf0f5;
  }

  .overview-metric:nth-child(even) {
    padding-right: .1rem;
  }

  .overview-metric-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .overview-metric-icon svg {
    width: 19px;
    height: 19px;
  }

  .overview-metric-copy strong {
    font-size: 1.35rem;
  }

  .overview-distribution {
    gap: .5rem;
  }

  .dashboard-page .paper-focus-score {
    padding: .65rem .7rem;
  }
}

/* Weekly update: two overview-matched surfaces, with the leading indicators kept in rows. */
.dashboard-page .dashboard-heading {
  margin-bottom: .8rem;
}

.dashboard-page .dashboard-heading h1 {
  margin-bottom: 0;
}

.dashboard-page .progress-overview {
  border-color: #e6ebf3;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgb(32 49 73 / 5%);
}

.dashboard-page .paper-focus,
.dashboard-page .paper-queue-item,
.dashboard-page .weekly-record,
.dashboard-page .timeline-paper {
  transition: box-shadow .18s ease, border-color .18s ease;
}

.dashboard-page .paper-focus:hover,
.dashboard-page .paper-queue-item:hover,
.dashboard-page .weekly-record:hover,
.dashboard-page .timeline-paper:hover {
  border-color: #d5deec;
  box-shadow: 0 12px 28px rgb(32 49 73 / 7%);
}

.workspace-page.weekly-update-shell.page-shell {
  padding: .9rem clamp(1rem, 2vw, 2rem) 1.2rem;
}

.weekly-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.weekly-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .65rem;
}

.weekly-paper-heading {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: .32rem;
}

.weekly-paper-title {
  min-width: 0;
  margin: 0;
  color: #26364a;
  font-size: clamp(1.12rem, 1.45vw, 1.38rem);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.weekly-paper-meta {
  display: grid;
  gap: .32rem;
  color: #66758a;
  font-size: .82rem;
  line-height: 1.4;
}

.weekly-paper-meta-line {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
}

.weekly-paper-meta strong {
  color: #58677c;
  font-weight: 650;
}

.weekly-paper-state-line {
  gap: .45rem 1.15rem;
}

.weekly-status-control,
.weekly-paper-status {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: .45rem;
}

.weekly-status-control>strong {
  margin-right: .05rem;
}

.weekly-status-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.weekly-status-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.weekly-status-option>span,
.weekly-status-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: .38rem;
  padding: .2rem .55rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #536174;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}

.weekly-status-option i,
.weekly-status-pill i {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
}

.weekly-status-option.is-green>span,
.weekly-status-pill.is-green {
  color: #20815c;
}

.weekly-status-option.is-yellow>span,
.weekly-status-pill.is-yellow {
  color: #a76d08;
}

.weekly-status-option.is-red>span,
.weekly-status-pill.is-red {
  color: #c43f48;
}

.weekly-status-option input:checked+span {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgb(53 111 228 / 8%);
}

.weekly-status-option input:focus-visible+span {
  outline: 2px solid #5780e8;
  outline-offset: 2px;
}

.weekly-page-heading .button {
  flex: 0 0 auto;
  min-height: 36px;
  border-radius: 4px;
}

.weekly-week-picker {
  display: flex;
  min-height: 38px;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 0 0 .65rem;
  color: #69778b;
  font-size: .84rem;
}

.weekly-week-picker label {
  display: block;
  color: #475569;
  font-size: .84rem;
  font-weight: 600;
}

.weekly-week-picker input {
  width: 154px;
  min-height: 36px;
  padding: .3rem .55rem;
  border-color: #dce3ec;
  border-radius: 4px;
  background: #fff;
  font-size: .88rem;
}

.weekly-week-picker>span {
  color: #718096;
  font-variant-numeric: tabular-nums;
}

.weekly-week-picker .button {
  min-height: 36px;
  border-radius: 4px;
}

.weekly-editor {
  display: grid;
  gap: .9rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.weekly-form-grid {
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  align-items: stretch;
  gap: 1rem;
}

.weekly-form-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e6ebf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(32 49 73 / 5%);
}

.weekly-card-heading {
  display: flex;
  min-height: 56px;
  align-items: center;
  padding: .65rem 1.2rem;
  border-bottom: 1px solid #e3e7ed;
}

.weekly-card-heading h2 {
  margin: 0;
  color: #6c83b5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.weekly-card-heading>span {
  margin-left: auto;
  color: #8792a2;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.weekly-card-body {
  min-width: 0;
  padding: .85rem 1.2rem 1rem;
}

.weekly-previous-summary {
  display: grid;
  gap: .55rem;
  margin: .7rem 0;
}

.weekly-previous-item {
  min-width: 0;
  padding: .68rem .75rem;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #f8f9fc;
}

.weekly-previous-item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
}

.weekly-previous-item-heading strong {
  color: #536174;
  font-size: .82rem;
  font-weight: 600;
}

.weekly-previous-item-heading span {
  flex: 0 0 auto;
  color: #66758a;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.weekly-previous-item p {
  margin: .35rem 0 0;
  color: #344054;
  font-size: .84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.weekly-previous-item small {
  display: block;
  margin-top: .35rem;
  color: #778398;
  font-size: .76rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.weekly-previous-empty {
  margin: .4rem 0 .7rem;
  padding: .75rem;
  border: 1px dashed #dce3ec;
  border-radius: 8px;
  color: #778398;
  font-size: .82rem;
  text-align: center;
}

.weekly-readonly-reports {
  margin-top: 0;
}

.weekly-readonly-report {
  display: grid;
  min-width: 0;
  gap: .5rem;
  padding: .75rem;
  border: 1px solid #e8edf5;
  border-radius: 9px;
  background: #fff;
}

.weekly-readonly-reports .weekly-readonly-report:nth-child(odd) {
  background: #f8f9fc;
}

.weekly-readonly-reports .weekly-readonly-report:nth-child(even) {
  background: #fff;
}

.weekly-readonly-report-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  color: #6b7789;
  font-size: .78rem;
}

.weekly-readonly-report-meta strong {
  color: #344054;
  font-size: .84rem;
}

.weekly-readonly-report-meta span {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.weekly-readonly-next-report {
  display: grid;
  min-width: 0;
  gap: .5rem;
  padding: .75rem;
  border: 1px solid #e8edf5;
  border-radius: 9px;
  background: #fff;
}

.weekly-readonly-next-reports .weekly-readonly-next-report:nth-child(odd) {
  background: #f8f9fc;
}

.weekly-readonly-next-reports .weekly-readonly-next-report:nth-child(even) {
  background: #fff;
}

.weekly-readonly-next-report .weekly-previous-item {
  background: #f8f9fc;
}

.weekly-readonly-report .weekly-previous-item {
  background: #f8f9fc;
}

.weekly-readonly-bottleneck {
  margin: 0;
  padding: .55rem .7rem;
  border-radius: 7px;
  background: #f8f9fc;
  color: #475569;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.weekly-readonly-bottleneck strong {
  margin-right: .5rem;
  color: #536174;
}

.weekly-readonly-next-plan {
  display: grid;
  gap: .5rem;
  margin-top: .15rem;
  padding-top: .7rem;
  border-top: 1px solid #e8edf5;
}

.weekly-readonly-next-plan-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  color: #344054;
  font-size: .84rem;
}

.weekly-readonly-next-plan-heading span {
  color: #778398;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.weekly-indicator-list {
  display: grid;
}

.weekly-indicator-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  padding: .62rem 0;
  border-top: 1px solid #edf1f5;
}

.weekly-indicator-row:first-child {
  border-top: 0;
}

.weekly-indicator-name {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: .62rem;
  color: #344054;
}

.weekly-indicator-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 50%;
}

.weekly-indicator-symbol svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.indicator-l1 {
  background: #e83e65;
  color: #fff;
}

.indicator-l2 {
  background: #fbb51f;
  color: #66541d;
}

.indicator-l3 {
  background: #45c88b;
  color: #fff;
}

.weekly-indicator-label {
  display: grid;
  min-width: 0;
}

.weekly-indicator-label strong {
  color: #344054;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.weekly-plan-field {
  min-width: 0;
  gap: .28rem;
  color: #65748a;
  font-size: .82rem;
  font-weight: 500;
}

.weekly-count-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: .5rem;
}

.weekly-count-fields-single {
  grid-template-columns: minmax(0, 1fr);
}

.weekly-count-fields label,
.weekly-custom-fields label {
  gap: .3rem;
  color: #536174;
  font-size: .82rem;
  font-weight: 500;
}

.weekly-form-card input:not([type="radio"]):not([type="checkbox"]),
.weekly-form-card select,
.weekly-form-card textarea {
  min-width: 0;
  min-height: 36px;
  padding: .35rem .55rem;
  border: 1px solid #dce3ec;
  border-radius: 4px;
  background: #fff;
  color: #29384c;
  font-size: .875rem;
  transition: border-color .16s ease;
}

.weekly-form-card input:hover,
.weekly-form-card select:hover,
.weekly-form-card textarea:hover {
  border-color: #bdc9da;
}

.weekly-indicator-row textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.weekly-right-card .weekly-indicator-row textarea {
  min-height: 112px;
}

.weekly-page input:not([type="radio"]):not([type="checkbox"]):focus,
.weekly-page select:focus,
.weekly-page textarea:focus {
  border-color: #5780e8;
  outline: 0;
  box-shadow: none;
}

.weekly-page input:not([type="radio"]):not([type="checkbox"]):focus-visible,
.weekly-page select:focus-visible,
.weekly-page textarea:focus-visible {
  outline: 0;
  box-shadow: none;
}

.weekly-page input[type="radio"]:focus,
.weekly-page input[type="checkbox"]:focus {
  outline: 0;
  box-shadow: none;
}

.weekly-page button:focus-visible {
  outline: 2px solid #5780e8;
  outline-offset: 2px;
}

.weekly-indicator-bottleneck {
  grid-template-columns: 126px minmax(0, 1fr);
}

.weekly-inline-toggle {
  justify-self: start;
  padding: .25rem .35rem;
  border: 0;
  background: transparent;
  color: #356fe4;
  font-size: .82rem;
  font-weight: 550;
  white-space: nowrap;
}

.weekly-inline-toggle:hover {
  color: #285fcf;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.weekly-custom-fields[hidden] {
  display: none;
}

.weekly-custom-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}

.weekly-bottleneck-custom {
  grid-column: 2 / -1;
}

.weekly-reflection-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .45rem;
}

.weekly-reflection-fields label {
  display: grid;
  min-width: 0;
  gap: .3rem;
  color: #536174;
  font-size: .82rem;
  font-weight: 550;
}

.weekly-reflection-fields textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  line-height: 1.5;
}

.weekly-right-card .weekly-card-body {
  display: grid;
  align-content: start;
  gap: .8rem;
}

.weekly-editor-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #e8edf3;
}

.weekly-editor-actions .button {
  min-width: 132px;
  min-height: 38px;
  border-radius: 4px;
  background: #356fe4;
  box-shadow: 0 2px 6px rgb(53 111 228 / 12%);
}

.weekly-editor-actions .button:hover {
  background: #285fcf;
}

.weekly-editor-actions .text-button {
  color: #667085;
  text-decoration: none;
}

@media (max-width: 1200px) {
  .weekly-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1040px) {
  .weekly-indicator-row {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: .65rem;
  }

  .weekly-indicator-bottleneck {
    grid-template-columns: 132px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .weekly-indicator-row {
    grid-template-columns: 126px minmax(0, 1fr);
    gap: .65rem;
  }

  .weekly-indicator-row>.weekly-plan-field,
  .weekly-count-fields {
    grid-column: 2;
  }

  .weekly-indicator-bottleneck {
    grid-template-columns: 126px minmax(0, 1fr);
  }

  .weekly-bottleneck-custom {
    grid-column: 2 / -1;
  }
}

@media (max-width: 760px) {
  .workspace-page.weekly-update-shell.page-shell {
    padding: 1rem;
  }

  .weekly-page-heading {
    align-items: flex-start;
  }

  .weekly-page-heading .button {
    min-height: 38px;
    padding: .35rem .6rem;
    font-size: .82rem;
  }

  .weekly-form-grid {
    gap: .75rem;
  }

  .weekly-card-heading {
    min-height: 50px;
    padding: .55rem .9rem;
  }

  .weekly-card-body {
    padding: .75rem .9rem .85rem;
  }
}

@media (max-width: 560px) {
  .workspace-page.weekly-update-shell.page-shell {
    padding: .75rem;
  }

  .weekly-page-heading {
    gap: .5rem;
  }

  .weekly-page-heading .button {
    min-height: 36px;
    padding: .3rem .45rem;
    font-size: .76rem;
  }

  .weekly-week-picker {
    gap: .4rem;
  }

  .weekly-week-picker>span {
    flex-basis: 100%;
  }

  .weekly-indicator-row,
  .weekly-indicator-bottleneck {
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  .weekly-indicator-row>.weekly-plan-field,
  .weekly-count-fields,
  .weekly-bottleneck-custom {
    grid-column: 1;
  }

  .weekly-count-fields {
    max-width: 220px;
  }

  .weekly-custom-fields {
    grid-template-columns: 1fr;
  }

  .weekly-reflection-fields {
    grid-template-columns: 1fr;
  }

  .weekly-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .weekly-editor-actions .button {
    width: 100%;
  }
}

/* ArchitectUI-inspired dashboard cards: Bootstrap-like type, fine borders, and compact shadows. */
.progress-overview {
  padding: 0;
  border: 1px solid #dee2e6;
  border-radius: .25rem;
  background: #fff;
  box-shadow: 0 .46875rem 2.1875rem rgb(4 9 20 / 3%), 0 .9375rem 1.40625rem rgb(4 9 20 / 3%), 0 .25rem .53125rem rgb(4 9 20 / 5%), 0 .125rem .1875rem rgb(4 9 20 / 3%);
}

.progress-overview-heading {
  min-height: 56px;
  padding: .65rem 1.4rem;
  border-bottom: 1px solid #e3e7ed;
  justify-content: flex-end;
}

.progress-overview-heading h2 {
  color: #6c83b5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0;
}

.overview-view-all {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: .25rem .7rem;
  border: 2px solid #45415a;
  border-radius: 4px;
  color: #45415a;
  font-size: .875rem;
  line-height: 1;
  text-decoration: none;
}

.overview-view-all:hover {
  background: #45415a;
  color: #fff;
}

.progress-overview-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: .95rem .85rem;
}

.overview-metric {
  gap: .95rem;
  padding: .25rem .85rem;
  border: 0;
}

.overview-metric:first-child {
  padding-left: .5rem;
}

.overview-metric:last-child {
  padding-right: .5rem;
}

.overview-metric-icon {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  background: #fbb51f;
  color: #66541d;
}

.overview-metric-icon svg {
  width: 25px;
  height: 25px;
}

.overview-metric-attention .overview-metric-icon {
  background: #e83e65;
  color: #fff;
}

.overview-metric-completion .overview-metric-icon {
  background: #45c88b;
  color: #fff;
}

.overview-metric-copy {
  gap: .12rem;
}

.overview-metric-copy>span {
  color: #969da5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: .88rem;
  font-weight: 400;
}

.overview-metric-copy strong {
  color: #4b5259;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.08;
}

.overview-metric-copy strong small {
  margin-left: .05em;
  color: #a3a8ad;
  font-size: .58em;
}

.overview-metric-copy>small {
  display: block;
  color: #77808a;
  font-size: .81rem;
  line-height: 1.4;
  white-space: nowrap;
}

.overview-metric-copy>small em,
.overview-metric-copy>small b,
.overview-metric-copy>small i {
  font-style: normal;
  font-weight: 500;
}

.overview-metric-copy>small em {
  color: #d34658;
}

.overview-metric-copy>small b {
  color: #ca4345;
}

.overview-metric-copy>small i {
  margin: 0 .25rem;
  color: #b8bec5;
}

.overview-metric-completion .overview-metric-copy strong {
  color: #31bb7a;
}

.progress-overview-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border-top: 1px solid #e3e7ed;
}

.overview-report-button {
  display: inline-flex;
  min-width: 260px;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .55rem 1.3rem;
  border-radius: 999px;
  background: #426cdd;
  box-shadow: 0 4px 9px rgb(53 88 173 / 32%);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: .91rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.overview-report-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #b9cdf8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-report-button:hover {
  transform: translateY(-1px);
  background: #345dca;
  box-shadow: 0 6px 13px rgb(53 88 173 / 35%);
  color: #fff;
}

.dashboard-page .paper-focus,
.dashboard-page .paper-queue-item,
.dashboard-page .weekly-record,
.dashboard-page .timeline-paper {
  border: 1px solid #e6ebf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(32 49 73 / 5%);
}

.dashboard-page .paper-focus {
  padding: 1.2rem 1.35rem;
}

.dashboard-page .paper-queue-item {
  padding: 1rem 1.1rem .9rem;
}

.dashboard-page .paper-focus h2 {
  color: #495057;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-weight: 600;
}

.dashboard-page .paper-focus-score {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.paper-card-icon {
  width: 18px;
  height: 18px;
  margin-right: .35rem;
  fill: none;
  stroke: #83b6ec;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -4px;
}

.dashboard-page .paper-focus:hover,
.dashboard-page .paper-queue-item:hover,
.dashboard-page .weekly-record:hover,
.dashboard-page .timeline-paper:hover {
  border-color: #d5deec;
  box-shadow: 0 13px 32px rgb(32 49 73 / 9%);
}

/* Compact, text-first weekly metrics: counts are explicit; only overdue bottlenecks use warning color. */
.dashboard-page .paper-weekly-summary {
  display: grid;
  gap: 0;
  margin: .45rem 0 0;
}

.dashboard-page .paper-weekly-summary-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid #edf0f5;
}

.dashboard-page .paper-weekly-summary-row:last-child {
  border-bottom: 0;
}

.dashboard-page .paper-weekly-summary-row dt {
  color: #667286;
  font-size: .8rem;
}

.dashboard-page .paper-weekly-summary-row dd {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  margin: 0;
  color: #344257;
  font-size: .88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-page .paper-weekly-summary-row dd small {
  color: #7b8798;
  font-size: .72rem;
  font-weight: 400;
}

.dashboard-page .paper-weekly-summary-row dd .paper-weekly-bottleneck.is-overdue,
.dashboard-page .paper-weekly-summary-row dd .paper-weekly-overdue {
  color: #c84a40;
}

.dashboard-page .paper-weekly-summary.is-compact {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: .65rem 0 .25rem;
}

.dashboard-page .paper-weekly-summary.is-compact .paper-weekly-summary-row {
  justify-content: flex-start;
  gap: .3rem;
  padding: 0;
  border: 0;
}

.dashboard-page .paper-weekly-summary.is-compact dt {
  font-size: .74rem;
}

.dashboard-page .paper-weekly-summary.is-compact dd {
  gap: .18rem;
  font-size: .8rem;
}

.dashboard-page .score-detail-grid>div {
  padding-block: .1rem;
}

.dashboard-page .score-detail-grid dt {
  color: #788394;
  font-size: .76rem;
}

.dashboard-page .score-detail-grid dd {
  color: #344257;
  font-size: .84rem;
}

.dashboard-page .paper-actions.is-actions-only,
.dashboard-page .queue-item-actions.is-actions-only {
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .progress-overview-heading {
    min-height: 52px;
    padding: .6rem .8rem;
  }

  .progress-overview-metrics {
    grid-template-columns: 1fr;
    gap: .35rem;
    padding: .55rem .65rem;
  }

  .overview-metric,
  .overview-metric:first-child,
  .overview-metric:last-child {
    min-height: 66px;
    padding: .45rem .3rem;
  }

  .overview-metric-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .overview-metric-icon svg {
    width: 22px;
    height: 22px;
  }

  .overview-metric-copy strong {
    font-size: 2rem;
  }

  .overview-report-button {
    min-width: min(260px, 100%);
  }

  .dashboard-page .paper-focus {
    padding: 1rem;
  }

  .dashboard-page .paper-weekly-summary.is-compact {
    gap: .35rem .75rem;
  }
}

/* Pair each degree thesis with the next two academic papers to keep both columns aligned. */
.dashboard-page .paper-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: .65rem;
}

.dashboard-page .paper-workbench-headings,
.dashboard-page .paper-workbench-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(310px, .86fr);
  column-gap: 1rem;
}

.dashboard-page .paper-workbench-headings {
  align-items: center;
}

.dashboard-page .paper-workbench-groups {
  display: grid;
  min-width: 0;
  gap: .85rem;
}

.dashboard-page .paper-workbench-pair {
  align-items: stretch;
  row-gap: .85rem;
}

.dashboard-page .paper-workbench-pair>.paper-focus {
  grid-column: 1;
  align-self: stretch;
}

.dashboard-page .paper-workbench-pair.has-two-academics>.paper-focus {
  grid-row: 1 / span 2;
}

.dashboard-page .paper-workbench-pair>.paper-queue-item {
  grid-column: 2;
  align-self: start;
}

.dashboard-page .paper-workbench-pair.has-two-academics>.paper-queue-item {
  align-self: stretch;
}

.dashboard-page .paper-workbench-pair>.paper-column-empty.is-degree {
  grid-column: 1;
}

.dashboard-page .paper-workbench-pair>.paper-column-empty.is-academic {
  grid-column: 2;
}

.dashboard-page .paper-type-heading {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  padding: 0 .15rem;
}

.dashboard-page .paper-type-heading h2 {
  margin: 0;
  color: #526078;
  font-size: .9rem;
  font-weight: 650;
}

.dashboard-page .paper-type-heading>span {
  color: #8490a1;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-page .paper-card-identity {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}

.dashboard-page .paper-kind-badge {
  padding: .16rem .45rem;
  border-radius: 6px;
  background: #f1f5fb;
  color: #66758d;
  font-size: .72rem;
  line-height: 1.4;
  white-space: nowrap;
}

.dashboard-page .paper-column-empty {
  margin: 0;
  padding: 1rem .9rem;
  border: 1px dashed #d9e0eb;
  border-radius: 12px;
  color: #8792a3;
  font-size: .82rem;
}

.paper-create-form [data-degree-field][hidden],
.paper-create-form [data-academic-target-field][hidden],
.paper-create-form [data-degree-target-field][hidden] {
  display: none;
}

@media (max-width: 1120px) {
  .dashboard-page .paper-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .paper-workbench-headings,
  .dashboard-page .paper-workbench-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-page .paper-workbench-pair>.paper-focus,
  .dashboard-page .paper-workbench-pair>.paper-queue-item,
  .dashboard-page .paper-workbench-pair>.paper-column-empty {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 700px) {
  .dashboard-page .paper-workbench {
    gap: 1.15rem;
  }

  .dashboard-page .paper-type-heading {
    min-height: 28px;
  }
}

/* Milestones follow the same floating card surface and use a compact step timeline. */
.dashboard-page .timeline-list {
  gap: .85rem;
}

.dashboard-page .timeline-paper {
  padding: 1.05rem 1.2rem 1.1rem;
}

.dashboard-page .timeline-paper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem 1rem;
  margin-bottom: .15rem;
  padding-bottom: .78rem;
  border-bottom: 1px solid #edf0f5;
}

.timeline-paper-primary {
  display: flex;
  min-width: 0;
  flex: 1 1 500px;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .3rem .72rem;
}

.dashboard-page .timeline-id {
  color: #5578c8;
  font-size: .78rem;
  font-weight: 650;
}

.dashboard-page .timeline-title {
  min-width: 0;
  margin: 0;
  color: #495057;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.45;
}

.timeline-paper-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .25rem .75rem;
}

.dashboard-page .timeline-meta {
  color: #8791a0;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}

.dashboard-page .timeline-paper-meta .status-badge {
  padding: .18rem .5rem;
  border-radius: 999px;
  font-size: .73rem;
}

.dashboard-page .timeline-manage-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dashboard-page .timeline-scroll {
  overflow-x: auto;
  padding: .95rem .05rem .22rem;
  scrollbar-color: #d7dee9 transparent;
  scrollbar-width: thin;
}

.dashboard-page .milestone-timeline {
  grid-auto-columns: minmax(128px, 1fr);
  padding: 0 0 .12rem;
}

.dashboard-page .timeline-node {
  padding: 0 .35rem;
}

.dashboard-page .timeline-node:not(:last-child)::after {
  top: 11px;
  height: 2px;
  background: #e4e8ee;
  transition: background-color .18s ease;
}

.dashboard-page .timeline-node.is-done:not(:last-child)::after {
  background: #37a46c;
}

.dashboard-page .timeline-marker {
  width: 24px;
  height: 24px;
  border: 2px solid #d9dee7;
  color: #fff;
  font-size: .7rem;
}

.dashboard-page .timeline-node.is-done .timeline-marker {
  border-color: #2f9b63;
  background: #2f9b63;
}

.dashboard-page .timeline-node.is-current .timeline-marker {
  border-color: #15877e;
  background: #fff;
  box-shadow: 0 0 0 4px rgb(21 135 126 / 11%);
}

.timeline-marker-core {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #15877e;
}

.dashboard-page .timeline-node.is-overdue .timeline-marker {
  border-color: #c83d35;
  background: #c83d35;
}

.dashboard-page .timeline-node time {
  margin-top: .6rem;
  color: #758198;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-page .timeline-node-title {
  width: min(18ch, 100%);
  min-height: 2.8em;
  margin-top: .28rem;
  color: #4b5668;
  font-size: .82rem;
  font-weight: 550;
  line-height: 1.45;
}

.dashboard-page .timeline-node.is-current .timeline-node-title {
  color: #263d60;
  font-weight: 650;
}

.dashboard-page .timeline-node-state {
  min-height: 1.15rem;
  margin-top: .12rem;
  color: #8992a0;
  font-size: .75rem;
}

.dashboard-page .timeline-node.is-done .timeline-node-state {
  color: #248656;
}

.dashboard-page .timeline-node.is-current .timeline-node-state {
  color: #167d76;
  font-weight: 550;
}

.dashboard-page .timeline-node.is-overdue .timeline-node-state {
  color: #bd3832;
  font-weight: 550;
}

@media (max-width: 700px) {
  .dashboard-page .timeline-paper {
    padding: .95rem .85rem 1rem;
  }

  .dashboard-page .timeline-paper-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-paper-primary {
    flex-basis: auto;
  }

  .timeline-paper-meta {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-page .milestone-timeline {
    grid-auto-columns: minmax(112px, 1fr);
  }
}

/* Paper cards get a clearly visible, still restrained edge shadow on hover. */
.dashboard-page .paper-focus,
.dashboard-page .paper-queue-item,
.dashboard-page .weekly-record,
.dashboard-page .timeline-paper {
  box-shadow: 0 3px 12px rgb(32 49 73 / 4%);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.dashboard-page .paper-focus:hover,
.dashboard-page .paper-queue-item:hover,
.dashboard-page .weekly-record:hover,
.dashboard-page .timeline-paper:hover {
  transform: none;
  border-color: #e6ebf3;
  box-shadow: 0 14px 30px rgb(32 49 73 / 19%);
}

.paper-create-page {
  width: min(100%, 1240px);
  margin: 0 auto;
}

.paper-create-heading {
  margin-bottom: 1rem;
}

.paper-create-heading .button {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 8px;
}

.paper-create-form {
  display: grid;
  gap: .8rem;
}

.paper-create-card {
  min-width: 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid #e4e9f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(32 49 73 / 4%);
}

.paper-create-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.paper-create-section-heading h2 {
  margin: 0;
  color: #29384c;
  font-size: .98rem;
  font-weight: 650;
}

.paper-create-section-heading>span {
  color: #718096;
  font-size: .82rem;
}

.paper-create-section-heading p,
.paper-create-help {
  margin: .18rem 0 0;
  color: #778397;
  font-size: .8rem;
}

.paper-create-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem 1rem;
}

.paper-create-form label {
  min-width: 0;
  color: #4b596d;
  font-size: .82rem;
  font-weight: 550;
}

.paper-create-fields .paper-title-field {
  grid-column: 1 / -1;
}

.paper-create-form input:not([type="checkbox"]),
.paper-create-form select,
.paper-create-form textarea {
  min-width: 0;
  min-height: 42px;
  padding: .5rem .65rem;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  color: #29384c;
  font-size: .875rem;
  transition: border-color .16s ease;
}

.paper-create-form input::placeholder {
  color: #9aa4b2;
}

.paper-create-form input:not([type="checkbox"]):hover,
.paper-create-form select:hover,
.paper-create-form textarea:hover {
  border-color: #bdc9da;
}

.paper-create-form input:not([type="checkbox"]):focus,
.paper-create-form select:focus,
.paper-create-form textarea:focus {
  border-color: #5278df;
  outline: 0;
  box-shadow: none;
}

.paper-create-form input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--workspace-blue);
}

.paper-create-form input[type="checkbox"]:focus-visible {
  outline: 2px solid #5278df;
  outline-offset: 2px;
}

.paper-collaborator-section {
  min-width: 0;
  margin: .4rem 0 0;
  padding: 0;
  border: 0;
}

.paper-collaborator-section legend {
  margin-bottom: .25rem;
  color: #4b596d;
  font-size: .82rem;
  font-weight: 600;
}

.paper-collaborator-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .45rem .6rem;
  margin: .65rem 0 0;
  padding: 0;
  border: 0;
}

.paper-collaborator-option {
  display: flex !important;
  min-height: 44px;
  align-items: center;
  gap: .6rem;
  padding: .45rem .6rem;
  border: 1px solid #e8edf4;
  border-radius: 7px;
  background: #fafbfd;
  cursor: pointer;
}

.paper-collaborator-option span {
  display: grid;
  min-width: 0;
  line-height: 1.35;
}

.paper-collaborator-option strong {
  overflow: hidden;
  color: #354358;
  font-size: .82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-collaborator-option small {
  overflow: hidden;
  color: #8691a2;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-create-empty {
  margin: .55rem 0 0;
  color: #788397;
  font-size: .82rem;
}

.paper-milestone-list {
  display: grid;
  gap: .45rem;
}

.paper-milestone-row {
  display: grid;
  grid-template-columns: 1.8rem minmax(200px, 1fr) minmax(160px, .42fr) auto;
  align-items: center;
  gap: .55rem;
}

.paper-milestone-row label {
  display: block;
}

.paper-milestone-row input {
  width: 100%;
}

.paper-milestone-remove {
  min-width: 52px;
  min-height: 36px;
  padding: .25rem .4rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #758195;
  font-size: .78rem;
}

.paper-milestone-remove:hover {
  background: #f4f6fa;
  color: #394a62;
}

.paper-create-form .button {
  min-height: 40px;
  border-radius: 8px;
}

.paper-create-form .button-small {
  min-height: 34px;
  border-radius: 7px;
}

.paper-create-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .2rem 0 .5rem;
}

.paper-create-form .form-actions {
  margin-top: .35rem;
}

.paper-create-page .breadcrumb {
  margin-bottom: .6rem;
}

.paper-edit-form {
  gap: .9rem;
}

.paper-edit-form .paper-collaborator-section {
  margin: .2rem 0;
}

.dashboard-page .dashboard-add-paper {
  min-height: 38px;
  border-radius: 8px;
}

@media (max-width: 700px) {
  .paper-create-card {
    padding: .9rem;
  }

  .paper-create-fields {
    grid-template-columns: 1fr;
  }

  .paper-create-fields .paper-title-field {
    grid-column: auto;
  }

  .paper-create-heading .button {
    min-height: 38px;
  }

  .paper-milestone-row {
    grid-template-columns: minmax(0, 1fr) minmax(135px, .6fr) auto;
    gap: .35rem;
  }

  .paper-milestone-remove {
    min-width: 42px;
    padding: .2rem;
  }
}

@media (max-width: 420px) {
  .paper-milestone-row {
    grid-template-columns: 1fr auto;
  }

  .paper-milestone-row label:nth-child(2) {
    grid-column: 1;
  }

  .paper-milestone-remove {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* Compare planned milestone dates with recorded completion dates. */
.milestone-schedule-summary {
  margin: 0 .85rem .2rem;
  padding: .72rem .1rem .25rem;
  border-top: 1px solid #edf0f5;
}

.milestone-schedule-summary-head,
.milestone-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .65rem 1rem;
}

.milestone-schedule-summary-head strong,
.milestone-progress-head strong {
  color: #435066;
  font-size: .82rem;
  font-weight: 650;
}

.milestone-schedule-summary-head>span,
.milestone-progress-head>span {
  color: #7d8796;
  font-size: .76rem;
}

.milestone-schedule-track {
  display: flex;
  height: 7px;
  overflow: hidden;
  gap: 2px;
  margin: .58rem 0 .5rem;
  border-radius: 999px;
  background: #edf0f5;
}

.schedule-segment {
  min-width: 0;
  border-radius: inherit;
}

.schedule-segment-on-time,
.schedule-key-on-time {
  background: #23875e;
}

.schedule-segment-late,
.schedule-key-late {
  background: #cf861e;
}

.schedule-segment-overdue,
.schedule-key-overdue {
  background: #d34c42;
}

.schedule-segment-upcoming,
.schedule-key-upcoming {
  background: #cfd6e0;
}

.milestone-schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  color: #758195;
  font-size: .72rem;
}

.milestone-schedule-legend>span {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  white-space: nowrap;
}

.milestone-schedule-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.milestone-schedule-note {
  margin: .35rem 0 0;
  color: #818b99;
  font-size: .72rem;
}

.milestone-progress-panel {
  margin: 0 0 .85rem;
  padding: .8rem .9rem .75rem;
  border: 1px solid #e7ebf1;
  border-radius: 9px;
  background: #fbfcfe;
}

.milestone-progress-head {
  flex-wrap: wrap;
}

.milestone-progress-panel .milestone-schedule-track {
  height: 8px;
  margin: .65rem 0 .55rem;
}

.milestone-row {
  align-items: start;
}

.milestone-compare-title {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.milestone-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #a8b0bd;
}

.milestone-status-on-time {
  background: #23875e;
}

.milestone-status-late {
  background: #cf861e;
}

.milestone-status-overdue {
  background: #d34c42;
}

.milestone-status-upcoming {
  background: #5977aa;
}

.milestone-status-unplanned {
  background: #a8b0bd;
}

.milestone-compare-title h3 {
  margin: 0;
  color: #344257;
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.4;
}

.milestone-compare-title .milestone-state {
  display: inline-block;
  margin-top: .12rem;
  font-size: .72rem;
  font-weight: 550;
}

.milestone-label-on-time {
  color: #23805a;
}

.milestone-label-late {
  color: #a96a13;
}

.milestone-label-overdue {
  color: #bd3832;
}

.milestone-label-upcoming {
  color: #64748b;
}

.milestone-label-unplanned {
  color: #778397;
}

.milestone-date-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: .7rem 0 .2rem;
}

.milestone-date-comparison>div {
  display: grid;
  min-width: 0;
  gap: .08rem;
}

.milestone-date-comparison>div>span {
  color: #8993a2;
  font-size: .7rem;
}

.milestone-date-comparison strong {
  color: #4d596b;
  font-size: .8rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.milestone-variance {
  grid-column: 1 / -1;
  font-size: .73rem;
}

.milestone-main .evidence-text {
  margin-top: .55rem;
  color: #687487;
  font-size: .8rem;
}

.progress-comparison {
  padding-bottom: .55rem;
}

.progress-comparison-lines {
  display: grid;
  gap: .55rem;
  margin-top: .65rem;
}

.progress-comparison-line {
  display: grid;
  grid-template-columns: 112px minmax(80px, 1fr) auto;
  align-items: center;
  gap: .6rem;
}

.progress-comparison-label {
  color: #596579;
  font-size: .78rem;
}

.progress-comparison-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.progress-comparison-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
}

.progress-comparison-fill.is-planned {
  background: #8199c7;
}

.progress-comparison-fill.is-actual {
  background: #23875e;
}

.progress-comparison-line>strong {
  min-width: 90px;
  color: #4d596b;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.progress-comparison-line>strong small {
  margin-left: .18rem;
  color: #8791a0;
  font-size: .72rem;
  font-weight: 500;
}

.progress-comparison-gap {
  margin: .55rem 0 0;
  color: #596579;
  font-size: .74rem;
}

.progress-comparison-gap.is-behind {
  color: #a45618;
}

.progress-comparison-gap.is-ahead {
  color: #287455;
}

.milestone-progress-panel .progress-comparison-lines {
  margin-top: .75rem;
}

.milestone-progress-panel .progress-comparison-gap {
  margin-top: .65rem;
}

.paper-milestone-compare {
  min-width: 0;
  margin-top: .85rem;
  padding-top: .72rem;
  border-top: 1px solid #edf0f4;
}

.paper-milestone-compare-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .4rem;
  color: #637086;
  font-size: .75rem;
  font-weight: 550;
}

.paper-milestone-compare-delta {
  overflow: hidden;
  color: #7d8795;
  font-size: .7rem;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-milestone-compare-delta.is-behind {
  color: #a56b2d;
}

.paper-milestone-compare-delta.is-ahead {
  color: #287455;
}

.paper-milestone-node-list {
  display: flex;
  align-items: center;
  margin: .72rem 0 .58rem;
  padding: 0;
  list-style: none;
}

.paper-milestone-node {
  position: relative;
  display: grid;
  min-width: 0;
  height: 14px;
  flex: 1 1 0;
  place-items: center;
}

.paper-milestone-node:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 6px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e4e9f0;
  content: "";
}

.paper-milestone-node-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 9px;
  height: 9px;
  border: 2px solid #cbd3df;
  border-radius: 50%;
  background: #fff;
}

.paper-milestone-node.is-complete .paper-milestone-node-dot {
  border-color: #318a68;
  background: #318a68;
}

.paper-milestone-node.is-due .paper-milestone-node-dot {
  border-color: #c98235;
  background: #c98235;
}

.paper-milestone-node.is-upcoming .paper-milestone-node-dot {
  border-color: #cbd3df;
  background: #fff;
}

.paper-milestone-compare-counts {
  display: flex;
  justify-content: space-between;
  gap: .65rem;
  color: #69768a;
  font-size: .72rem;
}

.paper-milestone-compare-counts strong {
  margin-left: .12rem;
  color: #3e4d64;
  font-size: .73rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.paper-milestone-compare-empty {
  margin: 0;
  color: #8791a0;
  font-size: .72rem;
}

@media (max-width: 700px) {
  .milestone-schedule-summary {
    margin-right: .7rem;
    margin-left: .7rem;
  }

  .milestone-schedule-legend {
    gap: .35rem .7rem;
  }

  .queue-detail-overview {
    grid-template-columns: minmax(0, 1fr);
    gap: .45rem;
  }

  .milestone-progress-panel {
    padding: .7rem;
  }

  .milestone-row {
    gap: .85rem;
  }

  .progress-comparison-line {
    grid-template-columns: 92px minmax(40px, 1fr) auto;
    gap: .4rem;
  }

  .progress-comparison-line>strong {
    min-width: 74px;
    font-size: .72rem;
  }
}

/* Independent node cards; editing stays a single inset within its node. */
.milestone-manager {
  margin: .35rem 0 1.5rem;
  padding: 0;
  scroll-margin-top: 5.5rem;
}

.paper-detail-page :is(input, button, summary) {
  scroll-margin-block: 5.5rem 1rem;
}

.milestone-manager-heading {
  align-items: center;
  gap: .5rem 1rem;
  margin-bottom: 1rem;
}

.milestone-manager-heading h2 {
  margin: 0;
  color: #29384c;
  font-size: 1.1rem;
}

.milestone-manager-counts {
  margin: 0;
  color: #647187;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.milestone-plan-list {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.milestone-plan-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid #dce2eb;
  border-radius: 10px;
  background: var(--surface);
}

.milestone-plan-row.is-current {
  border-color: #b5c2d5;
}

.milestone-plan-index {
  padding-top: .15rem;
  color: #66748a;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.milestone-plan-row.is-done .milestone-plan-index {
  color: #267653;
}

.milestone-plan-row.is-current .milestone-plan-index {
  color: #315fae;
  font-weight: 700;
}

.milestone-plan-row.is-overdue .milestone-plan-index {
  color: #b93e37;
}

.milestone-plan-row.is-skipped .milestone-plan-index {
  color: #6d7786;
}

.milestone-plan-main {
  min-width: 0;
  container-type: inline-size;
}

.milestone-plan-titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .65rem;
}

.milestone-plan-titleline h3 {
  min-width: 0;
  margin: 0;
  color: #2f3d52;
  font-size: .96rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.milestone-plan-state,
.milestone-terminal-label {
  color: #68768a;
  font-size: .75rem;
}

.milestone-plan-state.state-done {
  color: #267653;
}

.milestone-plan-state.state-current {
  color: #315fae;
}

.milestone-plan-state.state-overdue {
  color: #a9433c;
}

.milestone-plan-state.state-skipped {
  color: #6d7786;
}

.milestone-terminal-label {
  padding-left: .55rem;
  border-left: 1px solid #cfd6e0;
  color: #66748a;
}

.milestone-plan-dates {
  margin: .4rem 0 0;
  color: #69768a;
  font-size: .8rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.milestone-plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: .5rem;
}

.milestone-plan-actions form {
  margin: 0;
}

.milestone-order-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #5b687b;
  cursor: pointer;
  font-size: 1rem;
}

.milestone-order-button:disabled {
  color: #bbc3cf;
  cursor: default;
}

.milestone-order-button:not(:disabled):hover {
  border-color: #dce2eb;
  background: #fff;
  color: #315fae;
}

.milestone-delete-button {
  min-height: 36px;
  padding: .2rem .45rem;
  border: 0;
  background: transparent;
  color: #66748a;
  cursor: pointer;
  font-size: .8rem;
}

.milestone-delete-button:hover {
  color: #a9433c;
}

.milestone-node-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: .25rem 1.25rem;
}

.milestone-node-controls:has(> *) {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid #e5e9ef;
}

.milestone-complete-form {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem;
  margin: 0 0 .25rem;
}

.milestone-complete-form label,
.milestone-add-form label,
.milestone-edit-details label {
  display: grid;
  min-width: 0;
  gap: .4rem;
  color: #58677d;
  font-size: .8rem;
}

.milestone-complete-form label {
  width: 180px;
  max-width: 100%;
}

.milestone-complete-form input,
.milestone-add-form input,
.milestone-edit-details input {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: .4rem .6rem;
  border: 1px solid #b6c1d0;
  border-radius: 6px;
  background: var(--surface);
  color: #29384c;
  font: inherit;
}

.milestone-complete-form:has(.milestone-inline-error) {
  align-items: start;
}

.milestone-complete-form:has(.milestone-inline-error) .button {
  margin-top: 1.7rem;
}

.milestone-complete-form .button {
  min-height: 40px;
}

.milestone-edit-details {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: #58677d;
  font-size: .8rem;
}

.milestone-edit-details summary {
  width: fit-content;
  min-height: 36px;
  padding: .35rem .15rem;
  border-radius: 4px;
  color: #526b96;
  cursor: pointer;
}

.milestone-edit-details summary:hover {
  color: #315fae;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.milestone-edit-details[open] {
  flex: 1 0 100%;
}

.milestone-edit-details form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .55fr) auto;
  align-items: end;
  gap: .85rem 1rem;
  margin-top: .4rem;
  padding: 1rem;
  border-radius: 8px;
  background: #f4f6f9;
}

.milestone-edit-details form>.milestone-inline-error {
  grid-column: 1 / -1;
  margin: 0;
}

.milestone-skip-action {
  max-width: 100%;
  margin: 0;
}

.milestone-skip-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: .35rem .15rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #526b96;
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
}

.milestone-skip-button:hover {
  color: #a9433c;
}

.milestone-manager :is(input, button, summary):focus-visible,
.activity-history-details>summary:focus-visible {
  outline: 3px solid #315fae;
  outline-offset: 3px;
}

.milestone-inline-error {
  margin: .3rem 0;
  color: #a33d38;
  font-size: .78rem;
  line-height: 1.4;
}

.milestone-empty-state {
  margin: .6rem 0;
  padding: 1rem 0;
  color: #68768a;
  font-size: .86rem;
}

.milestone-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid #dce2eb;
  border-radius: 10px;
  background: var(--surface);
}

.milestone-add-form h3 {
  margin: 0;
  color: #34445b;
  font-size: .94rem;
  font-weight: 650;
}

.milestone-add-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .42fr) auto;
  align-items: end;
  gap: 1rem;
}

.milestone-add-form .button {
  min-height: 40px;
}

.activity-count {
  color: #7b8696;
  font-size: .76rem;
}

.activity-history-details {
  margin-top: .6rem;
}

.activity-history-details>summary {
  width: fit-content;
  padding: .32rem 0;
  color: #526b96;
  cursor: pointer;
  font-size: .8rem;
}

.activity-history-list {
  margin-top: .3rem;
}

@container (max-width: 540px) {
  .milestone-edit-details form {
    grid-template-columns: minmax(0, 1fr);
  }

  .milestone-edit-details form>.button {
    justify-self: start;
  }
}

.milestone-order {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  color: #798599;
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}

.milestone-row-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
}

@media (max-width: 700px) {

  /* Keep this shell adjustment local to paper details. All navigation stays available. */
  .workspace-shell:has(.paper-detail-page) {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-shell:has(.paper-detail-page) .workspace-sidebar {
    position: static;
    height: auto;
    min-height: 0;
    gap: .65rem;
    padding: .75rem 1rem;
    border-right: 0;
    border-bottom: 1px solid #e8ebf1;
  }

  .workspace-shell:has(.paper-detail-page) .workspace-brand {
    margin: 0;
  }

  .workspace-shell:has(.paper-detail-page) .workspace-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }

  .workspace-shell:has(.paper-detail-page) .sidebar-link-list {
    display: contents;
  }

  .workspace-shell:has(.paper-detail-page) :is(.sidebar-section-label, .sidebar-footer) {
    display: none;
  }

  .workspace-shell:has(.paper-detail-page) .sidebar-nav-item {
    width: auto;
    min-height: 44px;
    gap: .4rem;
    padding: .5rem .65rem;
  }

  .milestone-manager-heading {
    align-items: start;
    flex-direction: column;
  }

  .milestone-plan-row {
    grid-template-columns: 1.6rem minmax(0, 1fr);
    gap: .65rem;
    padding: 1rem;
  }

  .milestone-plan-actions {
    grid-column: 2;
  }

  .milestone-complete-form {
    align-items: stretch;
    flex-direction: column;
  }

  .milestone-complete-form label,
  .milestone-complete-form .button {
    width: 100%;
  }

  .milestone-complete-form input {
    width: 100%;
  }

  .milestone-manager input:not([type="hidden"]) {
    font-size: 1rem;
  }

  .milestone-complete-form:has(.milestone-inline-error) .button {
    margin-top: 0;
  }

  .milestone-skip-button,
  .milestone-edit-details summary,
  .milestone-manager .button {
    min-height: 44px;
  }

  .milestone-edit-details form,
  .milestone-add-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .milestone-order-button,
  .milestone-delete-button {
    min-width: 44px;
    min-height: 44px;
  }

  .milestone-add-form {
    padding: 1rem;
  }

  .paper-milestone-row {
    grid-template-columns: 1.8rem minmax(0, 1fr) minmax(135px, .6fr) auto;
  }
}

@media (max-width: 480px) {
  .paper-milestone-row {
    grid-template-columns: 1.8rem minmax(0, 1fr) auto;
  }

  .paper-milestone-row label:nth-child(3) {
    grid-column: 2;
  }

  .paper-milestone-row .milestone-row-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    flex-direction: column;
  }
}

.workspace-page.weekly-update-shell.page-shell {
  padding-top: 1.55rem;
}

.weekly-page-heading {
  display: block;
  margin-bottom: 1.25rem;
}

.weekly-paper-heading {
  gap: 1rem;
}

.weekly-title-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 1rem 1.5rem;
}

.weekly-paper-title {
  flex: 1;
  color: #253246;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.01em;
  text-wrap: pretty;
}

.weekly-paper-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  margin: 0;
  color: #536174;
  font-size: .875rem;
  line-height: 1.6;
}

.weekly-paper-meta-line {
  gap: .5rem 1.5rem;
}

.weekly-paper-goal {
  flex: 1 1 26rem;
}

.weekly-paper-goal>span {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: .5rem;
}

.weekly-paper-goal>span:last-child {
  flex: 1 1 16rem;
}

.weekly-paper-goal>span>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.weekly-paper-meta strong {
  flex: 0 0 auto;
  margin: 0;
  color: #536174;
  font-weight: 600;
}

.weekly-paper-state-line {
  flex: 0 0 auto;
}

.weekly-paper-heading .weekly-paper-status,
.weekly-status-select {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.weekly-status-select {
  cursor: pointer;
}

.weekly-status-select>span {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .5rem;
  padding: 0 .65rem;
  border: 1px solid #cbd4df;
  border-radius: 6px;
  background: #fff;
}

.weekly-status-select i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #27835f;
}

.weekly-status-select.is-yellow i {
  background: #bd821b;
}

.weekly-status-select.is-red i {
  background: #c44850;
}

.weekly-status-select select {
  min-height: 42px;
  padding: 0 .25rem 0 0;
  border: 0;
  background: transparent;
  color: #236c50;
  font-size: .875rem;
  font-weight: 600;
}

.weekly-status-select.is-yellow select {
  color: #80560e;
}

.weekly-status-select.is-red select {
  color: #b63e48;
}

.weekly-status-select select:focus {
  outline: 0;
  box-shadow: none;
}

.weekly-status-select>span:focus-within {
  border-color: var(--workspace-blue-dark);
  outline: 2px solid var(--workspace-blue-dark);
  outline-offset: 2px;
}

.weekly-page-heading .button {
  margin: 0;
  min-height: 44px;
  padding: .5rem .8rem;
  border-radius: 6px;
  white-space: nowrap;
}

.weekly-week-picker {
  gap: .75rem 1.5rem;
  margin-bottom: 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid #e3e8ef;
}

.weekly-week-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.weekly-week-picker label {
  color: #536174;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}

.weekly-week-picker input {
  width: 156px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border-color: #aebccc;
  border-radius: 6px;
  color: #253246;
  font-size: 1rem;
}

.weekly-week-picker>span {
  flex: 0 1 auto;
  margin-left: auto;
  color: #536174;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.weekly-week-picker .button {
  min-height: 44px;
  padding: .5rem .8rem;
  border-radius: 6px;
  white-space: nowrap;
}

.weekly-title-row .button:focus-visible,
.weekly-week-controls :is(input, button):focus-visible {
  outline: 2px solid var(--workspace-blue-dark);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .weekly-week-picker>span {
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .workspace-page.weekly-update-shell.page-shell {
    padding-top: 1rem;
  }

  .weekly-paper-title {
    font-size: 1.15rem;
  }

  .weekly-week-picker>span {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .weekly-title-row {
    flex-direction: column;
    gap: .75rem;
  }

  .weekly-paper-title {
    flex: auto;
    font-size: 1.12rem;
  }

  .weekly-paper-heading {
    gap: .75rem;
  }

  .weekly-paper-meta {
    gap: .75rem;
  }

  .weekly-paper-goal {
    flex-basis: 100%;
    gap: .5rem;
  }

  .weekly-paper-goal>span:last-child {
    flex-basis: 100%;
  }

  .weekly-status-select select {
    font-size: 1rem;
  }

  .weekly-week-controls {
    width: 100%;
  }

  .weekly-week-picker input {
    flex: 1 1 140px;
    width: 140px;
  }
}

/* 周度更新：论文标题字号 */
.weekly-update-shell h1.weekly-paper-title {
  font-size: clamp(1.12rem, 1.35vw, 1.25rem) !important;
}

/* Account settings: keep the workspace utility bar quiet and make password changes
   feel like the same deliberate, centered entry flow as login and registration. */
.topbar-account-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin-left: .2rem;
  padding: .35rem .72rem;
  border-left: 1px solid #e6eaf0;
  color: #667184;
  font-size: .8rem;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-account-link:hover {
  color: var(--workspace-blue-dark);
  text-decoration: none;
}

.page-shell.auth-shell.password-page {
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  place-items: center;
  margin: 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: #fff;
}

.password-card {
  width: min(100%, 460px);
  padding: clamp(1.7rem, 4vw, 2.6rem);
  border: 1px solid #e2e7ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgb(31 46 67 / 8%);
}

.password-card-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 2rem;
  color: #202a3b;
  font-size: .92rem;
  font-weight: 650;
}

.password-card-brand img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
}

.password-card-kicker {
  margin-bottom: .4rem;
  color: #356fe4;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.password-card h1 {
  margin: 0 0 .5rem;
  color: #202a3b;
  font-size: clamp(1.7rem, 3vw, 2.05rem);
  line-height: 1.25;
}

.password-card-lead {
  margin: 0 0 1.8rem;
  color: #7a8597;
  font-size: .92rem;
  line-height: 1.6;
}

.password-card-note {
  padding: .95rem 1rem;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #657187;
  font-size: .88rem;
  line-height: 1.75;
}

.account-settings-list {
  display: grid;
  gap: .75rem;
}

.account-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  color: #202a3b;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.account-settings-item:hover {
  border-color: #b8c8ea;
  background: #fbfcff;
  box-shadow: 0 5px 14px rgb(31 46 67 / 5%);
  text-decoration: none;
}

.account-settings-item span:first-child {
  display: grid;
  gap: .25rem;
}

.account-settings-item strong {
  color: #202a3b;
  font-size: .92rem;
}

.account-settings-item small {
  color: #7a8597;
  font-size: .82rem;
}

.account-settings-arrow {
  color: #7d8da8;
  font-size: 1.55rem;
  line-height: 1;
}

.password-form {
  display: grid;
  gap: 1.1rem;
}

.password-field {
  display: grid;
  gap: .5rem;
}

.password-form label {
  display: block;
  color: #394559;
  font-size: .875rem;
  font-weight: 600;
}

.password-form input {
  width: 100%;
  min-height: 52px;
  padding: .75rem 1rem;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  background: #fff;
  color: #202a3b;
  font-size: .93rem;
}

.password-input-shell {
  position: relative;
  display: block;
}

.password-input-shell input {
  padding-right: 3.25rem;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: .45rem;
  display: grid;
  width: 2.75rem;
  min-width: 44px;
  height: 2.75rem;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8290a7;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .16s ease;
}

.password-visibility-toggle:hover {
  color: #356fe4;
}

.password-visibility-toggle:active {
  color: #234fba;
}

.password-visibility-toggle:focus-visible {
  outline: 2px solid #84a8ff;
  outline-offset: 2px;
}

.password-visibility-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: filter .16s ease;
}

.password-visibility-toggle:hover svg {
  filter: drop-shadow(0 0 3px rgb(53 111 228 / 48%));
}

.password-visibility-toggle:active svg {
  filter: drop-shadow(0 0 4px rgb(53 111 228 / 58%));
}

.password-visibility-toggle svg[hidden] {
  display: none !important;
}

.password-form input:hover {
  border-color: #bdc9da;
}

.password-form input:focus {
  outline: 0;
  border-color: #5780e8;
  box-shadow: none;
}

.password-form input:focus-visible {
  outline: 3px solid #84a8ff;
  outline-offset: 3px;
  box-shadow: none;
}

.password-submit {
  width: 100%;
  min-height: 52px;
  margin-top: .25rem;
  padding: .75rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #91a3f2;
  box-shadow: 0 5px 12px rgb(96 119 218 / 21%);
  color: #fff;
  font-size: .95rem;
  font-weight: 650;
}

.password-submit:hover {
  background: #7e92eb;
}

.password-back-link {
  display: block;
  margin-top: 1.25rem;
  color: #326be0;
  font-size: .84rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.password-back-link:hover {
  color: #234fba;
  text-decoration: underline;
}

.password-card :is(a, button):focus-visible,
.password-form input:focus-visible {
  outline: 3px solid #84a8ff;
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .topbar-account-link {
    padding-left: .5rem;
  }
}

@media (max-width: 560px) {
  .page-shell.auth-shell.password-page {
    padding: 1rem;
  }

  .password-card {
    padding: 1.4rem 1.1rem;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgb(31 46 67 / 7%);
  }

  .password-card-brand {
    margin-bottom: 1.5rem;
  }
}

/* Keep the editor action row in the first viewport on wide screens. The form
   still grows naturally when a smaller viewport or longer text requires scroll. */
@media (min-width: 1201px) {
  .workspace-page.weekly-update-shell.page-shell {
    display: flex;
    min-height: calc(100dvh - 68px);
    flex-direction: column;
  }

  .weekly-page {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .weekly-editor {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .weekly-editor .weekly-form-grid {
    min-height: 0;
    flex: 1 1 auto;
  }

  .weekly-editor-actions {
    margin-top: auto;
  }
}

/* The weekly form no longer exposes numeric target/completion controls. Keep
   the rule defensive for records rendered by an older cached template. */
.weekly-count-fields {
  display: none !important;
}
