.skip-link {
  position: fixed;
  z-index: 10000;
  top: .75rem;
  left: .75rem;
  padding: .65rem .9rem;
  color: #fff;
  background: #173e32;
  border-radius: .45rem;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.sidebar nav a {
  border-left: 3px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}

.sidebar nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-left-color: #b8d483;
  font-weight: 700;
}

.page-intro {
  max-width: 48rem;
  margin: .45rem 0 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  gap: .7rem;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-metrics,
.project-metrics { margin-bottom: 1.25rem; }

.metric-card {
  border-top: 3px solid #9bb8aa;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

a.metric-card:hover,
a.metric-card:focus-visible {
  border-top-color: #245846;
  box-shadow: 0 10px 26px rgba(19, 52, 42, .1);
  transform: translateY(-1px);
}

.project-card-list { display: grid; }

.project-summary {
  display: grid;
  grid-template-columns: 8rem minmax(12rem, 1fr) auto 6rem;
  gap: 1rem;
  align-items: center;
  padding: .95rem 0;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--callout-border);
}

.project-summary:hover strong,
.project-summary:focus-visible strong { color: var(--link); }
.project-summary small { display: block; margin-top: .2rem; color: var(--muted); }
.project-reference { color: var(--link); font-weight: 750; }
.project-updated { color: var(--muted); text-align: right; }

.empty-state {
  padding: 2.5rem 1.25rem;
  text-align: center;
  border: 1px dashed #b9c6bf;
  border-radius: .65rem;
  background: var(--surface-subtle);
}

.empty-state > strong { font-size: 1.05rem; }
.empty-state .button { margin-top: .4rem; }

.filter-panel { padding-bottom: 1rem; }
.filter-panel h2,
.table-panel h2 { margin: 0; }
.filter-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto auto;
  gap: .8rem;
  align-items: end;
}
.filter-grid > div { min-width: 0; }
.filter-grid label:not(.filter-checkbox) { display: block; margin-bottom: .35rem; font-weight: 650; }
.filter-grid input:not([type="checkbox"]),
.filter-grid select { width: 100%; }
.filter-checkbox { display: flex; gap: .45rem; align-items: center; min-height: 2.7rem; white-space: nowrap; }
.filter-checkbox input { width: auto; }
.table-scroll { overflow-x: auto; }
.table-primary { display: grid; gap: .18rem; min-width: 12rem; text-decoration: none; }
.table-primary span { color: var(--muted); }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.detail-card { margin: 0; }
.detail-list { margin: 0; }
.detail-list > div {
  display: grid;
  grid-template-columns: minmax(8rem, .8fr) minmax(10rem, 1.2fr);
  gap: 1rem;
  padding: .65rem 0;
  border-top: 1px solid var(--callout-border);
}
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-note { margin-top: 1rem; padding: 1rem; border-radius: .55rem; background: var(--surface-subtle); }
.detail-note p { margin-bottom: 0; }
.edit-disclosure { margin-top: 1rem; border-top: 1px solid var(--callout-border); padding-top: 1rem; }
.edit-disclosure summary { color: var(--link); font-weight: 700; cursor: pointer; }
.edit-disclosure form { margin-top: 1rem; }
.project-secondary-actions { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; }
.project-secondary-actions h2,
.project-secondary-actions p { margin: 0; }
.project-secondary-actions p { margin-top: .3rem; color: var(--muted); }

.workspace-status {
  min-height: 1.4rem;
  margin: 0 0 .5rem;
  color: var(--muted);
  font-size: .85rem;
  text-align: right;
}
.workspace-status.is-error { color: var(--error-fg); font-weight: 650; }
.workspace-status.is-success { color: var(--success-fg); }

@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .page-header,
  .project-secondary-actions { align-items: stretch; flex-direction: column; }
  .page-actions .button { width: 100%; text-align: center; }
  .project-summary { grid-template-columns: 1fr auto; gap: .4rem 1rem; }
  .project-summary > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .project-updated { grid-column: 2; grid-row: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-search { grid-column: auto; }
  .filter-checkbox { white-space: normal; }
  .detail-list > div { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar nav a,
  .metric-card { transition: none; }
}

/* Professional application shell */
body { line-height: 1.5; }
.app-shell { min-height: 100dvh; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar { gap: 1.25rem; padding: 1.5rem 1rem; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.development-banner + .app-shell .sidebar { top: 34px; height: calc(100dvh - 34px); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1.18rem; }
.brand small { margin-top: .25rem; color: #d7e1da; font-size: .67rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.organization-chip { border-radius: .65rem; }
.sidebar-menu { min-height: 0; }
.sidebar-menu > summary { display: none; }
.sidebar-navigation { padding-bottom: 1rem; }
.sidebar-navigation .nav-label { margin-top: 1.2rem; }
.sidebar-navigation .nav-label:first-child { margin-top: .15rem; }
.sidebar nav a { min-height: 2.4rem; display: flex; align-items: center; padding: .55rem .7rem; }
.sidebar nav a.is-active { border-left-color: var(--lime); }

.topbar { min-height: 72px; height: auto; padding: .85rem 2rem; }
.topbar-context { display: flex; flex-direction: column; gap: .15rem; }
.topbar-account { display: flex; align-items: center; gap: 1.5rem; }
.topbar-account > span { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.topbar-account small { margin-top: .15rem; color: var(--muted); font-size: .72rem; }
.topbar-actions { padding-left: 1.25rem; border-left: 1px solid var(--line); }
main#main-content { padding: 2rem clamp(1.25rem, 3vw, 3rem); }
.page-header { gap: 1.5rem; }
.page-header h1 { line-height: 1.05; }

/* Persistent project context */
.project-context { padding: .9rem clamp(1.25rem, 3vw, 3rem) 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.project-context__identity { display: flex; gap: .8rem; align-items: center; max-width: 1440px; margin: 0 auto .75rem; }
.project-context__identity > div { display: flex; align-items: baseline; gap: .55rem; min-width: 0; }
.project-context__identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-context__reference { color: var(--link); font-weight: 800; }
.project-context__back { display: inline-flex; align-items: center; color: var(--muted); font-size: .8rem; font-weight: 700; }
.project-context__back::after { content: "/"; margin-left: .75rem; color: var(--line); }
.project-context__identity .badge { margin-left: auto; }
.project-navigation { display: flex; gap: .25rem; max-width: 1440px; margin: 0 auto; overflow-x: auto; scrollbar-width: thin; }
.project-navigation a { min-width: 9rem; padding: .65rem .9rem .75rem; border-bottom: 3px solid transparent; color: var(--muted); }
.project-navigation a span,
.project-navigation a small { display: block; }
.project-navigation a span { color: var(--ink); font-size: .86rem; font-weight: 750; }
.project-navigation a small { margin-top: .1rem; font-size: .68rem; white-space: nowrap; }
.project-navigation a:hover,
.project-navigation a:focus-visible { background: var(--surface-subtle); }
.project-navigation a.is-active { border-bottom-color: var(--forest-2); background: var(--surface-subtle); }
.project-navigation a.is-active span { color: var(--link); }

/* Project and dashboard tools */
.project-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.project-tool-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem 1rem; min-height: 12rem; padding: 1.35rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.project-tool-card:hover,
.project-tool-card:focus-visible { transform: translateY(-2px); border-color: #8eaa9c; box-shadow: 0 14px 32px rgba(19, 52, 42, .1); }
.project-tool-card__index { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--forest); background: var(--lime); font-size: .72rem; font-weight: 850; }
.project-tool-card h2 { margin: .15rem 0 .35rem; font: 500 1.55rem Georgia, serif; }
.project-tool-card p { margin: 0; color: var(--muted); }
.project-tool-card > strong { grid-column: 2; align-self: end; color: var(--link); font-size: .84rem; }
.recent-project-list { display: grid; }
.recent-project { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--callout-border); }
.recent-project h3 { margin: .1rem 0; font-size: 1rem; }
.recent-project p { margin: 0; color: var(--muted); font-size: .8rem; }
.recent-project__actions { display: flex; gap: .35rem; }
.recent-project__actions a { padding: .42rem .6rem; color: var(--link); background: var(--surface-subtle); border-radius: .4rem; font-size: .78rem; font-weight: 750; }
.recent-project__actions a:hover,
.recent-project__actions a:focus-visible { background: var(--surface-hover); }
.shortcut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.shortcut-grid a { display: flex; flex-direction: column; gap: .25rem; min-height: 6rem; padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-subtle); }
.shortcut-grid a:hover,
.shortcut-grid a:focus-visible { border-color: #8eaa9c; background: var(--surface-hover); }
.shortcut-grid span { color: var(--muted); font-size: .78rem; }

/* Forms and reusable content */
textarea { width: 100%; min-height: 7rem; resize: vertical; border: 1px solid #c9cdc8; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: var(--field-bg); font: inherit; }
textarea:focus { outline: 3px solid var(--focus-ring); outline-offset: 1px; border-color: var(--focus-ring); }
input[type="checkbox"], input[type="radio"] { width: auto; }
.professional-form { max-width: 70rem; margin-inline: auto; }
.professional-form--embedded { max-width: none; margin: 1rem 0 0; padding: 0; border: 0; box-shadow: none; }
.form-section-heading { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.form-section-heading h2,
.form-section-heading p { margin: 0; }
.form-section-heading p { margin-top: .2rem; color: var(--muted); }
.form-section-number { display: grid; place-items: center; flex: 0 0 2.2rem; height: 2.2rem; border-radius: 50%; color: var(--forest); background: var(--lime); font-weight: 850; font-size: .75rem; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label { font-size: .8rem; font-weight: 750; }
.form-field[hidden] { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.form-inline-card { display: grid; grid-template-columns: minmax(12rem, 1fr) auto; gap: 1rem; align-items: end; }
.danger-button { color: #fff; background: #8a2e27; }
.danger-button:hover,
.danger-button:focus-visible { color: #fff; background: #68201b; }
.inline-empty { display: flex; flex-direction: column; gap: .2rem; margin: 1rem 0; padding: 1rem; color: var(--muted); background: var(--surface-subtle); border-radius: .6rem; }
.inline-empty strong { color: var(--ink); }
.empty-state--compact { padding: 1.5rem; }
.page-actions--center { justify-content: center; }

/* Clients, documents and releases */
.filter-grid--clients { grid-template-columns: minmax(15rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto; }
.project-summary--compact { grid-template-columns: 7rem minmax(0, 1fr) auto; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.contact-card { padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-subtle); }
.contact-card > div:first-child { display: flex; flex-direction: column; }
.contact-card > div:first-child span,
.contact-card p { color: var(--muted); font-size: .8rem; }
.contact-card p { margin: .75rem 0; }
.contact-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .65rem; }
.contact-disclosure { margin-top: 1.5rem; }
.release-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.release-card { display: flex; flex-direction: column; margin: 0; }
.release-card > .button { align-self: flex-start; margin-top: auto; }
.document-list,
.notice-block-list { display: grid; gap: .75rem; }
.document-card { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-subtle); }
.document-card:hover,
.document-card:focus-visible { border-color: #8eaa9c; background: var(--surface-hover); }
.document-card > div { display: flex; flex-direction: column; }
.document-card small { color: var(--muted); }
.notice-block { padding: 1.15rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--panel); }
.notice-block__heading { display: flex; justify-content: space-between; gap: 1rem; }
.notice-block h3 { margin: .15rem 0 .7rem; }
.notice-block__content { color: var(--ink); }
.notice-checks { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0; }
.notice-checks > span { padding: .65rem .8rem; border-radius: .5rem; color: var(--muted); background: var(--surface-subtle); font-size: .8rem; }
.notice-checks strong { color: var(--ink); }
.progress-track { height: .55rem; overflow: hidden; background: var(--surface-hover); border-radius: 999px; }
.progress-track span { display: block; height: 100%; background: var(--forest-2); border-radius: inherit; }
.technical-disclosure { margin-top: 1rem; }
.technical-disclosure summary { display: flex; flex-direction: column; gap: .15rem; padding: .75rem 0; color: var(--link); cursor: pointer; }
.technical-disclosure summary span { color: var(--muted); font-size: .78rem; font-weight: 400; }
.technical-disclosure--compact { padding-top: .5rem; border-top: 1px solid var(--line); }
.technical-disclosure pre,
.technical-disclosure code { max-width: 100%; overflow: auto; overflow-wrap: anywhere; }
.pairing-panel { border-left: 4px solid var(--forest-2); }
.level-tabs { display:flex; gap:.4rem; margin:0 0 1rem; overflow-x:auto; }
.level-tabs a { padding:.5rem .75rem; border:1px solid var(--line); border-radius:.45rem; background:var(--panel); white-space:nowrap; }
.level-tabs a.is-active { color:var(--button-primary-fg); background:var(--button-primary-bg); border-color:var(--button-primary-bg); }
.copy-field strong { display: inline-block; padding: .65rem .9rem; background: var(--surface-subtle); border-radius: .45rem; font-size: 1.4rem; letter-spacing: .12em; }
.messages { position: relative; z-index: 2; }
.message { box-shadow: 0 8px 24px rgba(19, 52, 42, .08); }
.error-state { max-width: 42rem; margin: 2rem auto; }

@media (max-width: 1100px) {
  .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-grid { grid-template-columns: 1fr; }
}

@media (max-width: 950px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar,
  .development-banner + .app-shell .sidebar { position: static; width: auto; height: auto; padding: 1rem; overflow: visible; }
  .sidebar-menu > summary { display: flex; justify-content: space-between; padding: .65rem .75rem; border: 1px solid rgba(255, 255, 255, .18); border-radius: .5rem; cursor: pointer; font-weight: 750; }
  .sidebar-menu > summary::after { content: "▾"; }
  .sidebar-menu:not([open]) > summary::after { content: "▸"; }
  .sidebar-navigation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; padding: .6rem 0 0; }
  .sidebar-navigation .nav-label { grid-column: 1 / -1; margin: .75rem .7rem .15rem; }
  .topbar { align-items: center; }
  .project-context { padding-top: .75rem; }
}

@media (max-width: 760px) {
  .project-tool-grid,
  .contact-grid,
  .form-fields { grid-template-columns: 1fr; }
  .form-field--wide { grid-column: auto; }
  .recent-project { grid-template-columns: minmax(0, 1fr) auto; }
  .recent-project__actions { grid-column: 1 / -1; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .project-context__identity { align-items: flex-start; flex-wrap: wrap; }
  .project-context__identity > div { flex-direction: column; gap: 0; }
  .project-context__identity .badge { margin-left: 0; }
  .project-navigation a { min-width: 8.5rem; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .form-inline-card { grid-template-columns: 1fr; }
  .document-card { align-items: flex-start; }
}

@media (max-width: 600px) {
  .sidebar-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding: .8rem 1rem; }
  .topbar-context { display: none; }
  .topbar-account { width: 100%; justify-content: space-between; gap: .75rem; }
  .topbar-account > span { align-items: flex-start; min-width: 0; }
  .topbar-account > span strong { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: .75rem; padding-left: .75rem; }
  .project-context { padding-inline: 1rem; }
  .project-context__back::after { display: none; }
  .project-context__back { width: 100%; }
  main#main-content { padding: 1.5rem 1rem; }
  .page-header h1 { font-size: 2rem; }
  .project-tool-card { min-height: 10rem; }
  .project-secondary-actions form,
  .project-secondary-actions .button { width: 100%; }
  .recent-project__actions a { flex: 1; text-align: center; }
}

@media (prefers-color-scheme: dark) {
  .project-tool-card:hover,
  .project-tool-card:focus-visible { box-shadow: none; border-color: var(--forest-2); }
  .project-tool-card__index,
  .form-section-number { color: #173e32; }
  .danger-button { background: #8a3933; }
  textarea { border-color: #445149; }
}
