:root {
  --ink: #20352c;
  --muted: #66796e;
  --green: #17624f;
  --line: #dce6df;
  --paper: #f2f6f3;
  --amber: #8b5a15;
  --red: #963c3c;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
.toast-region {
  position: fixed;
  inset: auto 16px 16px auto;
  bottom: calc(16px + max(0px, 100dvh - var(--viewport-height, 100dvh) - var(--viewport-top, 0px)));
  margin: 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: min(440px, calc(100vw - 24px));
  max-height: min(70dvh, var(--visual-height, 70dvh));
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 10000;
  pointer-events: none;
}
.toast-region::backdrop { background: transparent; pointer-events: none; }
.toast {
  pointer-events: auto;
  position: relative;
  padding: 16px 54px 16px 16px;
  margin: 0 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  box-shadow: 0 6px 24px #20352c26;
  overflow-wrap: anywhere;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
}
.toast:last-child { margin-bottom: 0; }
.toast.error { border-left-color: var(--red); background: #fff7f6; }
.toast-confirm { border-left-color: var(--amber); padding-right: 16px; }
.toast-message { margin: 0; white-space: pre-wrap; }
.toast-confirm .toast-message { margin-top: 6px; }
.toast-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.toast-actions:empty { display: none; }
.toast-actions button { max-width: 100%; white-space: normal; }
.toast-close { position: absolute; top: 6px; right: 6px; }
button.toast-danger { background: var(--red); border-color: var(--red); color: #fff; }
button.toast-danger:hover { background: #7d3030; }
[aria-invalid="true"] { border-color: var(--red); }
@media (max-width: 700px) {
  .toast-region {
    inset: auto 8px max(8px, env(safe-area-inset-bottom)) auto;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + max(0px, 100dvh - var(--viewport-height, 100dvh) - var(--viewport-top, 0px)));
    width: calc(100vw - 16px);
    max-height: min(60dvh, var(--visual-height, 60dvh));
  }
}
@media (forced-colors: active) {
  .toast { border: 2px solid CanvasText; }
}
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.role-choices {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.role-choices label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
}
.role-choices input {
  width: 20px;
  min-height: 20px;
  flex-shrink: 0;
}
.password-result {
  display: grid;
  gap: 16px;
}
@media (max-width: 700px) {
  .user-row {
    flex-direction: column;
    align-items: stretch;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
a {
  color: var(--green);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 16px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
}
button:hover {
  background: #e8f1eb;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.primary:hover {
  background: #104c3c;
}
.quiet {
  background: transparent;
}
.danger {
  color: var(--red);
}
:focus-visible {
  outline: 3px solid #b17a24;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 650;
  letter-spacing: -1.1px;
  line-height: 1.15;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
p {
  line-height: 1.55;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-bottom: 10px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 3px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: #dcece3;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-weight: 800;
  color: var(--green);
}
.tag,
.badge {
  display: inline-block;
  border-radius: 30px;
  font-size: 11px;
  padding: 6px 10px;
  font-weight: 650;
  background: #e6f0e9;
  color: var(--green);
}
.badge.draft {
  background: #fff0d6;
  color: var(--amber);
}
.badge.running,
.badge.queued {
  background: #e7edf7;
  color: #415c8c;
}
.badge.failed,
.badge.unknown {
  background: #f9e6e2;
  color: var(--red);
}
.badge.rejected {
  background: #edf0ee;
  color: var(--muted);
}
.login-wrap {
  min-height: 100vh;
  max-width: 1120px;
  padding: 60px 32px;
  margin: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 100px;
  align-items: center;
}
.login-intro h1 {
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.1;
  margin: 24px 0;
}
.login-intro > p:not(.eyebrow) {
  max-width: 400px;
  color: var(--muted);
  margin-bottom: 28px;
}
.login-intro .eyebrow {
  margin-top: 24px;
}
.login-panel {
  box-shadow: 0 12px 50px #173a2510;
}
.login-panel > button {
  width: 100%;
  margin-top: 12px;
}
.login-panel > p {
  margin-top: 12px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 0;
  min-width: 0;
}
input,
textarea,
select {
  width: 100%;
  background: #fbfdfb;
  border: 1px solid #cbd9cf;
  border-radius: 9px;
  padding: 12px;
  color: var(--ink);
  min-height: 45px;
}
select {
  min-width: 0;
  max-width: 100%;
  cursor: pointer;
  accent-color: var(--green);
}
select:enabled:hover {
  border-color: #7fa494;
}
select:disabled {
  background: var(--paper);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}
/* Keep native form/keyboard behavior; unsupported browsers keep their OS picker. */
@supports (appearance: base-select) {
  select:not([multiple]):not([size]),
  select:not([multiple]):not([size])::picker(select) {
    appearance: base-select;
  }
  select:not([multiple]):not([size]) {
    align-items: center;
    gap: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }
  select::picker-icon {
    content: "";
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    margin-inline: auto 3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: var(--green);
    rotate: 45deg;
  }
  select:open {
    border-color: var(--green);
  }
  select:open::picker-icon {
    rotate: 225deg;
  }
  select:disabled::picker-icon {
    color: var(--muted);
  }
  select::picker(select) {
    box-sizing: border-box;
    inline-size: anchor-size(width);
    max-inline-size: calc(100vw - 24px);
    max-block-size: min(22rem, 50dvh);
    margin-block: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    color: var(--ink);
    box-shadow: 0 12px 32px #173a2526;
    font: inherit;
    font-weight: 400;
    line-height: 1.45;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #9eb4a6 var(--paper);
  }
  select option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--ink);
    cursor: pointer;
  }
  select option:checked {
    background: #e5f0e8;
    color: var(--green);
    font-weight: 600;
  }
  select option:enabled:is(:hover, :focus) {
    background: #e8f1eb;
  }
  select option:checked:enabled:is(:hover, :focus) {
    background: #dcece3;
  }
  select option:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -3px;
  }
  select option::checkmark {
    order: 1;
    flex-shrink: 0;
    margin-inline-start: auto;
    color: var(--green);
  }
  select option:disabled {
    color: var(--muted);
    background: transparent;
    cursor: not-allowed;
  }
  @media (forced-colors: active) {
    select option:checked,
    select option:checked:enabled:is(:hover, :focus) {
      background: Highlight;
      color: HighlightText;
      forced-color-adjust: none;
    }
    select option::checkmark {
      color: currentColor;
    }
    select option:focus-visible {
      outline-color: currentColor;
    }
  }
}
textarea {
  resize: vertical;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: white;
  border-right: 1px solid var(--line);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
}
.nav-label {
  margin-top: 48px;
}
nav {
  display: grid;
  gap: 8px;
}
nav a {
  text-decoration: none;
  padding: 13px 15px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
}
nav a.active {
  background: #e5f0e8;
  color: var(--green);
  font-weight: 650;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 0;
}
.sidebar-bottom p {
  margin-top: 9px;
}
.main-area {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 78px;
  border-bottom: 1px solid var(--line);
  background: #ffffffb8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.account {
  display: flex;
  align-items: center;
  gap: 20px;
}
.account > span {
  color: var(--ink);
}
main#workspace {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 36px 38px 60px;
  flex: 1;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 2px 0 28px;
}
.heading p.muted {
  margin-top: 10px;
  font-size: 14px;
}
.pilot-note {
  background: #fff8e9;
  border: 1px solid #eedfc0;
  color: #6b542d;
  border-radius: 12px;
  padding: 16px 19px;
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
  margin: 18px 0 24px;
}
.pilot-note p {
  font-size: 12px;
  margin-top: 3px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8812a;
  margin-top: 7px;
  flex-shrink: 0;
}
.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e4ece6;
  border-radius: 11px;
  flex-wrap: wrap;
}
.filters button {
  font-size: 12px;
  padding: 8px 13px;
  border: 0;
  background: transparent;
  min-height: 38px;
}
.filters [aria-pressed="true"] {
  background: white;
  box-shadow: 0 1px 3px #18342112;
}
#list-summary {
  margin: 0 0 15px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.card {
  padding: 23px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  font-size: 11px;
  color: var(--muted);
}
.card-description,
.preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-size: 14px;
}
.card-description {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #52675a;
}
.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.card-meta small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 5px;
}
.actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
}
.card .actions {
  justify-content: flex-start;
  margin: 0;
}
.card .actions button {
  font-size: 12px;
  padding: 9px 12px;
}
.result {
  background: #eef4f0;
  border-radius: 9px;
  padding: 13px;
  font-size: 12px;
  line-height: 1.6;
}
.result.unknown,
.result.failed {
  background: #fff0eb;
}
.empty {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  display: inline-block;
  font-size: 28px;
  color: var(--green);
  margin-bottom: 18px;
}
.empty p {
  margin-top: 12px;
}
.notice {
  padding: 13px 18px;
  background: #e6f0e9;
  border: 1px solid #c2d7c9;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
}
.notice.error,
.form-error {
  color: var(--red);
}
.form-error {
  font-size: 13px;
  margin-top: 15px;
  line-height: 1.5;
}
.notice.error {
  background: #ffefeb;
  border-color: #e3c2b9;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 38px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 100px #12281b40;
  padding: 28px;
  width: min(600px, calc(100% - 32px));
  max-height: 90vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #18312566;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}
.dialog-head h2 {
  font-size: 22px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-row + p {
  margin-top: 14px;
}
#confirm-details h3 {
  margin: 20px 0 12px;
}
#confirm-details dl {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  font-size: 14px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat strong {
  font-size: 30px;
  display: block;
  margin: 10px 0 4px;
}
.admin-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin-bottom: 24px;
}
.admin-columns h2,
#admin-people h2,
.audit-panel h2 {
  font-size: 19px;
  margin-bottom: 20px;
}
.service-row,
.user-row {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.service-row p,
.user-row p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.user-row > div:first-child { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.user-row .user-actions { flex-shrink: 0; max-width: 100%; }
.user-row button {
  font-size: 13px;
  padding: 10px 12px;
}
.audit-entry {
  padding: 15px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.audit-entry small {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
#admin-navigation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: sticky; top: 8px; z-index: 5; margin-bottom: 16px; }
#admin-people { margin-bottom: 24px; }
#admin-overview, #admin-people, #admin-audit { scroll-margin-top: 80px; }
#admin-create-user { margin-bottom: 16px; }
#admin-create-user > summary { cursor: pointer; min-height: 44px; padding-block: 10px; color: var(--green); }
#admin-technical { margin-top: 12px; margin-bottom: 0; }
#admin-technical .stats { margin-block: 16px; }
.skip {
  position: absolute;
  left: 10px;
  top: -80px;
  background: white;
  padding: 15px;
  z-index: 99;
}
.skip:focus {
  top: 10px;
}
.check-label {
  flex-direction: row;
  align-items: center;
}
.check-label input {
  width: auto;
  min-height: 0;
}
details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 0;
}
@media (min-width: 1500px) {
  main#workspace {
    padding-top: 50px;
  }
  .card-grid {
    gap: 24px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 215px;
    padding: 24px 15px;
  }
  .main-area {
    margin-left: 215px;
  }
  main#workspace {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .admin-columns {
    grid-template-columns: 1fr;
  }
  .login-wrap {
    gap: 50px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 18px;
  }
  .stat strong {
    font-size: 23px;
  }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .sidebar .brand small,
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  .brand {
    font-size: 12px;
    gap: 8px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  nav {
    display: flex;
    gap: 2px;
  }
  nav a {
    font-size: 11px;
    padding: 10px;
  }
  .main-area {
    margin: 0;
    min-height: calc(100vh - 65px);
  }
  .topbar {
    height: 60px;
    padding: 0 20px;
  }
  .topbar > span {
    display: none;
  }
  .account {
    width: 100%;
    justify-content: space-between;
    font-size: 12px;
  }
  main#workspace {
    padding: 26px 18px 40px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .heading > button {
    width: 100%;
  }
  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }
  .list-toolbar > #refresh {
    align-self: flex-end;
    font-size: 12px;
    min-height: 35px;
    padding: 6px;
  }
  .filters {
    justify-content: space-between;
    gap: 0;
  }
  .filters button {
    padding: 8px;
    font-size: 11px;
  }
  .card {
    padding: 21px;
  }
  .card .actions button {
    flex-grow: 1;
  }
  .pilot-note {
    padding: 14px;
  }
  .login-wrap {
    padding: 30px 22px;
    gap: 30px;
    display: block;
  }
  .login-intro h1 {
    font-size: 39px;
    margin: 20px 0;
  }
  .login-intro > p:not(.eyebrow),
  .login-intro .tag {
    display: none;
  }
  .login-panel {
    padding: 24px;
    margin-top: 28px;
  }
  .login-intro .eyebrow {
    margin-top: 15px;
  }
  .login-intro h1 br {
    display: none;
  }
  .login-intro h1 {
    max-width: 330px;
    font-size: 34px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat strong {
    font-size: 28px;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  dialog {
    padding: 22px;
  }
  .dialog-head h2 {
    font-size: 20px;
  }
  footer {
    padding: 20px;
    gap: 12px;
    font-size: 10px;
  }
  .card-meta {
    grid-template-columns: 1fr 1fr;
  }
}

/* The working screen starts with the task, with readable controls on a phone. */
.compact-note {
  display: block;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
}
.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
#draft-protection {
  margin-top: 16px;
}
#editor-conflict {
  margin-top: 16px;
}
#editor-conflict details {
  margin-top: 8px;
}
.filters button {
  font-size: 14px;
  min-height: 44px;
}
.card .actions button {
  font-size: 14px;
}
.card-meta {
  font-size: 15px;
}
.card-meta small {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.card-description,
.preserve,
.result {
  font-size: 15px;
}
.badge {
  font-size: 13px;
}
@media (max-width: 700px) {
  .sidebar {
    padding: 10px 16px;
  }
  .topbar {
    height: 46px;
    padding: 0 16px;
  }
  .account {
    font-size: 14px;
  }
  main#workspace {
    padding: 16px 16px 32px;
  }
  .heading {
    gap: 10px;
    margin: 0 0 12px;
  }
  .heading h1 {
    font-size: 28px;
  }
  .list-toolbar {
    margin-bottom: 6px;
    gap: 4px;
  }
  .filters {
    justify-content: flex-start;
    gap: 2px;
  }
  .filters button {
    font-size: 14px;
    padding: 8px 10px;
  }
  #list-summary {
    margin-bottom: 10px;
    font-size: 13px;
  }
  .card {
    padding: 18px;
    gap: 14px;
  }
  .card .actions button {
    font-size: 14px;
  }
  .compact-note {
    padding: 9px 12px;
    font-size: 14px;
  }
  .field-row input {
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  .sidebar .brand-mark {
    display: none;
  }
}

/* One primary action; secondary choices remain keyboard-accessible. */
.action-menu {
  position: relative;
}
.action-menu > summary {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  min-height: 44px;
  font-size: 14px;
  background: white;
}
.menu-items {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  min-width: 210px;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 25px #173a2520;
  display: grid;
  gap: 4px;
}
.menu-items button,
.menu-items a {
  text-align: left;
  min-height: 44px;
  font-size: 14px;
  padding: 11px 12px;
  text-decoration: none;
  border-radius: 8px;
}
#account-menu .menu-items {
  left: auto;
  right: 0;
}
#card-details {
  display: grid;
  gap: 16px;
}
#card-details .badge {
  justify-self: start;
}
.card .actions {
  margin-top: 0;
}
.card-top {
  font-size: 13px;
  flex-wrap: wrap;
}
.card .small,
.form-error,
label,
#draft-protection {
  font-size: 14px;
}
.account {
  min-width: 0;
  gap: 12px;
}
#user-name {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 54px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .account {
    width: 100%;
    justify-content: space-between;
  }
  .card .action-menu .menu-items {
    left: auto;
    right: 0;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 700px) {
  .brand {
    font-size: 14px;
  }
  nav a {
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .list-toolbar > #refresh {
    font-size: 14px;
    min-height: 44px;
  }
}

.list-search {
  max-width: 640px;
  margin: 8px 0;
}
.list-utilities {
  display: flex;
  gap: 8px;
}
.list-utilities [aria-pressed="true"] {
  background: var(--green, #155f50);
  color: white;
}
@media (max-width: 700px) {
  .list-utilities {
    justify-content: space-between;
  }
  .list-search {
    margin: 0;
    gap: 0;
  }
  main#workspace {
    padding-top: 8px;
  }
  .filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .filters button {
    padding: 8px 4px;
    white-space: normal;
  }
  .search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
.reliability-panel h2 {
  margin-bottom: 14px;
}
.reliability-panel .service-row p {
  font-size: 14px;
}
/* Required is visible before a mistake; red is reserved for attempted submission. */
label:has(> :required)::before,
label:has(> [data-required-for]):not(:has(> :required))::before,
[data-required-group] > legend::after {
  content: "Обязательно";
  align-self: flex-start;
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--amber);
  background: #fff3da;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
label:has(> [data-required-for]):not(:has(> :required))::before {
  content: "Нужно перед подтверждением";
}
[data-required-group] > legend::after { content: "Хотя бы одна роль"; }
.feed-more { display: block; margin: 16px auto; max-width: 100%; white-space: normal; }
.feed-more:disabled:not(.is-loading) { cursor: default; }
.feed-more.is-loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -2px; animation: feed-spin .8s linear infinite;
}
@keyframes feed-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .feed-more.is-loading::before { animation: none; } }
label:has(> [data-required-for=handoff])::before { content: "Имя или участник — перед передачей ЛПР"; }
label:has(> input[type=checkbox]:required) {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
}
label:has(> input[type=checkbox]:required)::before { grid-column: 2; }
:is(input, textarea, select):required:enabled:not([readonly]):not([type=checkbox]):not([type=radio]):invalid:not([aria-invalid=true]) {
  border-left: 3px solid var(--amber);
  background: #fffdf7;
}
:is(input, textarea, select)[aria-invalid=true],
[data-required-group][aria-invalid=true] {
  border: 2px solid var(--red);
  background: #fff7f6;
}
label:has(> [aria-invalid=true]) { color: var(--red); }
@media (forced-colors: active) {
  :is(input, textarea, select)[aria-invalid=true], [data-required-group][aria-invalid=true] {
    outline: 2px dashed CanvasText;
  }
}
