:root {
  color-scheme: light;
  --ink: #20242c;
  --ink-strong: #11151b;
  --muted: #68707d;
  --muted-2: #8a929f;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #eef1f4;
  --line: #dde1e7;
  --line-strong: #c8ced7;
  --sidebar: #17191c;
  --sidebar-hover: #25282d;
  --blue: #276ef1;
  --blue-soft: #edf3ff;
  --green: #1b7f4b;
  --green-soft: #eaf6ef;
  --amber: #a35d00;
  --amber-soft: #fff4df;
  --red: #c53a32;
  --red-soft: #fdeeed;
  --cyan: #087e8b;
  --cyan-soft: #e8f5f6;
  --violet: #7557a5;
  --violet-soft: #f3eff8;
  --sidebar-width: 240px;
  --topbar-height: 68px;
  --radius: 6px;
  --focus: 0 0 0 3px rgba(39, 110, 241, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select,
input,
textarea {
  outline: none;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  box-shadow: var(--focus);
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.loading-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.loading-screen .brand-mark {
  border-color: rgba(35, 99, 76, 0.2);
  background: #f5faf7;
}

.auth-screen {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background: #e8edf1;
}

.auth-panel {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid rgba(105, 121, 135, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 54px rgba(34, 49, 62, 0.16), inset 0 1px rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-brand .brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.auth-brand .brand-mark img {
  width: 31px;
  height: 31px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 18px;
}

.auth-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.auth-heading {
  margin-top: 30px;
}

.auth-heading > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.auth-heading h1 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 32px;
}

.auth-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 19px;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.auth-form > label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.auth-input {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}

.auth-input:focus-within {
  border-color: var(--blue);
  box-shadow: var(--focus);
}

.auth-input > svg {
  width: 16px;
  margin-left: 13px;
  color: var(--muted);
}

.auth-input input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
}

.auth-input input:focus-visible {
  outline: none;
  box-shadow: none;
}

.auth-password-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.auth-password-toggle svg {
  width: 16px;
}

.auth-message {
  min-height: 17px;
  color: var(--red);
  font-size: 11px;
}

.auth-submit,
.auth-guest {
  justify-content: center;
  min-height: 46px;
}

.auth-safety {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
}

.auth-safety svg {
  width: 15px;
  flex: 0 0 15px;
  color: var(--green);
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  background: var(--sidebar);
  color: #f6f7f9;
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid #2a2d32;
}

.brand .brand-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.brand .brand-mark img {
  width: 34px;
  height: 34px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgba(35, 99, 76, 0.2);
  border-radius: 6px;
  background: #f5faf7;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-mark img {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  font-weight: 680;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  display: block;
  color: #8f969f;
  font-size: 11px;
  line-height: 16px;
}

.primary-nav {
  display: grid;
  gap: 3px;
  padding: 12px 8px;
}

.primary-nav a {
  position: relative;
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 5px;
  color: #aeb4bd;
  font-size: 13px;
  transition: color 140ms ease, background-color 140ms ease;
}

.primary-nav a:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.primary-nav a.active {
  background: #30383d;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(99, 185, 140, 0.42);
  font-weight: 650;
}

.primary-nav a.active::before {
  position: absolute;
  inset: 8px auto 8px -8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #63b98c;
  content: "";
}

.primary-nav a svg {
  flex: 0 0 18px;
}

.primary-nav a span {
  flex: 1;
}

.nav-count {
  display: inline-grid;
  min-width: 21px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 10px;
  background: #34383f;
  color: #dce0e5;
  font-size: 11px;
  font-weight: 600;
}

.nav-count:empty,
.nav-count[data-value="0"] {
  display: none;
}

.nav-count.warning {
  background: #4a3925;
  color: #ffdca0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 15px;
  border-top: 1px solid #2a2d32;
  color: #8f969f;
  font-size: 11px;
}

.sidebar-toggle {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 0 10px;
  border: 1px solid #30343a;
  border-radius: 5px;
  background: #202328;
  color: #c9ced5;
  font-size: 12px;
}

.sidebar-toggle:hover {
  border-color: #444a52;
  background: #292d33;
  color: #ffffff;
}

.sidebar-toggle svg {
  flex: 0 0 18px;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.topbar-context {
  min-width: 170px;
}

.topbar-context strong {
  display: block;
  font-size: 16px;
  font-weight: 680;
}

@media (min-width: 768px) {
  .app-shell.sidebar-collapsed {
    --sidebar-width: 64px;
  }

  .app-shell.sidebar-collapsed .brand {
    justify-content: center;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .brand-copy,
  .app-shell.sidebar-collapsed .primary-nav a span,
  .app-shell.sidebar-collapsed .nav-count,
  .app-shell.sidebar-collapsed .sidebar-toggle span {
    display: none;
  }

  .app-shell.sidebar-collapsed .brand .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .app-shell.sidebar-collapsed .brand .brand-mark img {
    width: 31px;
    height: 31px;
  }

  .app-shell.sidebar-collapsed .primary-nav a {
    justify-content: center;
    padding: 0;
  }

  .app-shell.sidebar-collapsed .primary-nav a.active::before {
    left: -8px;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    display: grid;
    place-items: center;
    padding: 15px 8px;
  }

  .app-shell.sidebar-collapsed .sidebar-toggle {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

}

.topbar-actions {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-notifications {
  position: relative;
  flex: 0 0 auto;
}

.notification-toggle {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #f7f9fb;
  color: #526174;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.notification-toggle:hover,
.notification-toggle[aria-expanded="true"] {
  border-color: #82add9;
  background: #eaf3ff;
  color: #145fae;
  box-shadow: 0 0 0 3px rgba(20, 95, 174, 0.1);
}

.notification-toggle:focus-visible {
  outline: 3px solid rgba(22, 119, 216, 0.22);
  outline-offset: 2px;
}

.notification-toggle > svg {
  width: 18px;
  height: 18px;
}

.notification-toggle.has-unread > svg {
  animation: notification-bell-attention 4.8s ease-in-out infinite;
  transform-origin: 50% 12%;
}

.notification-toggle > b {
  position: absolute;
  top: -6px;
  right: -7px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 9px;
  background: #d33b34;
  color: #fff;
  font-size: 9px;
  font-weight: 760;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.notification-toggle > b[hidden],
.notification-popover[hidden] {
  display: none;
}

.notification-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  right: 0;
  display: flex;
  width: min(430px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - var(--topbar-height) - 24px));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(25, 44, 67, 0.2), 0 3px 10px rgba(25, 44, 67, 0.09);
  animation: notification-popover-in 150ms ease-out;
}

.notification-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid #e1e7ee;
  background: #f8fafc;
}

.notification-head > div {
  display: grid;
  gap: 2px;
}

.notification-head strong {
  color: #243248;
  font-size: 14px;
}

.notification-head span {
  color: #718096;
  font-size: 10px;
}

.notification-head button {
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #176bc1;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.notification-head button:hover:not(:disabled) {
  background: #e7f2ff;
}

.notification-head button:disabled {
  color: #9aa6b3;
  cursor: default;
}

.notification-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #e1e7ee;
  background: #fff;
}

.notification-overview > span {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 9px 8px;
  border-right: 1px solid #edf1f5;
}

.notification-overview > span:last-child { border-right: 0; }
.notification-overview b { font-size: 15px; font-variant-numeric: tabular-nums; }
.notification-overview small { color: #748396; font-size: 10px; }
.notification-overview .urgent b { color: #b4322d; }
.notification-overview .routine b { color: #93600e; }

.notification-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.notification-section-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 13px;
  border-bottom: 1px solid #edf1f5;
  background: rgba(248, 250, 252, 0.97);
  color: #65758a;
  font-size: 10px;
  font-weight: 680;
}

.notification-section-head b {
  color: #8290a0;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.notification-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 108px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
  color: #27364a;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}

.notification-item.unread {
  background: #f5f9ff;
}

.notification-item.unread::before {
  position: absolute;
  top: 15px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1677d8;
  content: "";
}

.notification-item:hover,
.notification-item:focus-visible {
  background: #eaf3ff;
}

.notification-item:focus-visible {
  z-index: 2;
  outline: 2px solid #438bd5;
  outline-offset: -2px;
}

.notification-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: #edf2f7;
  color: #536579;
}

.notification-icon.red { background: #fdecea; color: #b4322d; }
.notification-icon.amber { background: #fff1d8; color: #9a6108; }
.notification-icon.blue { background: #e5f1ff; color: #176bc1; }
.notification-icon.green { background: #e6f5ec; color: #237748; }

.notification-icon svg {
  width: 17px;
  height: 17px;
}

.notification-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.notification-copy strong {
  color: #28374c;
  font-size: 12px;
  font-weight: 680;
  line-height: 18px;
}

.notification-detail {
  display: -webkit-box;
  overflow: hidden;
  color: #65758a;
  font-size: 10px;
  line-height: 15px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-copy small {
  color: #8a97a5;
  font-size: 9px;
  line-height: 13px;
}

.notification-item-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.notification-category {
  color: #536579;
  font-size: 10px;
  font-weight: 700;
}

.notification-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #66778b;
  font-size: 9px;
  font-weight: 650;
}

.notification-level::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8291a2;
  content: "";
}

.notification-level.red { color: #a93631; }
.notification-level.red::before { background: #cf3e38; }
.notification-level.amber { color: #8a5b0e; }
.notification-level.amber::before { background: #d18a16; }
.notification-level.blue { color: #1764ae; }
.notification-level.blue::before { background: #2b7dcc; }
.notification-level.green { color: #27734a; }
.notification-level.green::before { background: #35905f; }

.notification-item-meta small {
  margin-left: auto;
  white-space: nowrap;
}

.notification-action {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
  margin-top: 2px;
  color: #176bc1;
  font-size: 10px;
  font-weight: 680;
}

.notification-action svg {
  width: 12px;
  height: 12px;
}

.notification-foot {
  min-height: 31px;
  padding: 8px 12px;
  border-top: 1px solid #e1e7ee;
  background: #f8fafc;
  color: #83909e;
  font-size: 9px;
  text-align: center;
}

.notification-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  color: #83909e;
  text-align: center;
}

.notification-empty svg { width: 28px; height: 28px; }
.notification-empty strong { color: #46566a; font-size: 13px; }
.notification-empty span { font-size: 10px; line-height: 16px; }

@keyframes notification-popover-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes notification-bell-attention {
  0%, 86%, 100% { transform: rotate(0); }
  89% { transform: rotate(9deg); }
  92% { transform: rotate(-7deg); }
  95% { transform: rotate(4deg); }
}

.account-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #b9dbc8;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.account-status.guest {
  border-color: #d5c49e;
  background: #fff9ee;
  color: #8a5b13;
}

.account-status svg {
  width: 15px;
  height: 15px;
}

.business-date {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.business-date svg {
  width: 15px;
  height: 15px;
}

.business-date-compact {
  display: none;
}

.data-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.data-status svg {
  width: 15px;
  height: 15px;
}

.data-status strong {
  font-size: 12px;
  font-weight: 680;
}

.data-status small {
  padding-left: 6px;
  border-left: 1px solid currentColor;
  font-size: 10px;
  font-weight: 600;
  opacity: 0.72;
}

.data-status.ready {
  border-color: #b9dbc8;
  background: var(--green-soft);
  color: var(--green);
}

.data-status.awaiting {
  border-color: #ead2aa;
  background: var(--amber-soft);
  color: var(--amber);
}

.data-status.processing {
  border-color: #bfd0f4;
  background: var(--blue-soft);
  color: var(--blue);
}

.data-status.processing svg,
[data-audit-state="processing"] .audit-rail-placeholder .empty-icon svg,
[data-audit-state="processing"] .audit-gate-symbol svg,
.drop-zone.uploading .drop-symbol svg,
.pipeline-step.processing .pipeline-icon svg {
  animation: loading-spin 800ms linear infinite;
}

.data-status.processing {
  box-shadow: 0 0 0 3px rgba(46, 99, 191, 0.1);
}

.data-status.blocked {
  border-color: #e6bab6;
  background: var(--red-soft);
  color: var(--red);
}

.data-status.warning {
  border-color: #ead2aa;
  background: var(--amber-soft);
  color: var(--amber);
}

#app {
  height: calc(100vh - var(--topbar-height));
  overflow: auto;
}

.page {
  min-height: 100%;
  padding: 22px 24px 40px;
}

.page.flush {
  padding: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head h1,
.workspace-head h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: 680;
  line-height: 29px;
}

.page-head p,
.workspace-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 20px;
}

.head-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.button,
.icon-button,
.action-icon {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 560;
  transition: background-color 130ms ease, border-color 130ms ease, color 130ms ease, transform 100ms ease;
}

.button {
  padding: 0 12px;
}

.button:hover,
.icon-button:hover,
.action-icon:hover {
  border-color: #aeb5bf;
  background: var(--surface-2);
}

.button:active,
.icon-button:active,
.action-icon:active {
  transform: translateY(1px);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.primary:hover {
  border-color: #165bd9;
  background: #165bd9;
}

.button.danger {
  border-color: #e5b7b3;
  color: var(--red);
}

.button.success {
  border-color: #a9d6bf;
  color: var(--green);
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.button.small {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.button svg,
.icon-button svg,
.action-icon svg {
  width: 16px;
  height: 16px;
}

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

.icon-button {
  width: 36px;
  padding: 0;
}

.mobile-menu {
  display: none;
}

.segmented {
  display: inline-flex;
  min-height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-3);
}

.segmented button {
  min-width: 54px;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.segmented button.active {
  background: var(--blue-soft);
  color: #165bd9;
  box-shadow: inset 0 0 0 1px rgba(39, 110, 241, 0.52), 0 2px 6px rgba(35, 74, 139, 0.1);
  font-weight: 700;
}

.badge,
.status-badge,
.eyebrow-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.badge.neutral,
.status-badge.neutral {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.badge.blue,
.status-badge.blue {
  border-color: #ccdcfb;
  background: var(--blue-soft);
  color: #255bbf;
}

.badge.green,
.status-badge.green {
  border-color: #b8ddc8;
  background: var(--green-soft);
  color: var(--green);
}

.badge.amber,
.status-badge.amber {
  border-color: #efd19a;
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.red,
.status-badge.red {
  border-color: #edc0bd;
  background: var(--red-soft);
  color: var(--red);
}

.badge.cyan,
.status-badge.cyan {
  border-color: #b8dadd;
  background: var(--cyan-soft);
  color: var(--cyan);
}

.badge.violet,
.status-badge.violet {
  border-color: #d8cce6;
  background: var(--violet-soft);
  color: var(--violet);
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2,
.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 660;
}

.section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th {
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  min-height: 46px;
  padding: 9px 12px;
  border-bottom: 1px solid #e9ecf0;
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table tbody tr.is-focus {
  background: var(--surface-2);
  box-shadow: inset 3px 0 var(--blue);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.data-table .row-critical {
  box-shadow: inset 3px 0 0 var(--red);
}

.data-table .row-attention {
  box-shadow: inset 3px 0 0 var(--amber);
}

.cell-main {
  min-width: 150px;
  max-width: 340px;
}

.cell-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  line-height: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-main span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fact-cell {
  min-width: 280px;
  max-width: 520px;
}

.fact-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 580;
  line-height: 20px;
  white-space: pre-line;
}

.fact-cell span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
  white-space: pre-line;
}

.followup-risk-overview {
  margin-bottom: 12px;
  padding: 16px 18px 14px;
  overflow: hidden;
}

.followup-risk-head,
.followup-risk-head > div,
.followup-risk-legend,
.followup-risk-values {
  display: flex;
  align-items: center;
}

.followup-risk-head {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.followup-risk-head > div:first-child {
  gap: 9px;
}

.followup-risk-head > div:first-child span {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 680;
}

.followup-risk-head > div:first-child strong {
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.followup-risk-legend {
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.followup-risk-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.followup-risk-legend i {
  width: 16px;
  height: 5px;
  border-radius: 2px;
}

.followup-risk-legend .photos i,
.followup-risk-track .photos {
  background: #e39a28;
}

.followup-risk-legend .materials i,
.followup-risk-track .materials {
  background: #c94a42;
}

.followup-risk-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--line);
}

.followup-risk-summary > div {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
}

.followup-risk-summary span {
  color: var(--muted);
  font-size: 11px;
}

.followup-risk-summary strong {
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: 720;
}

.followup-risk-summary strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.followup-risk-summary .photos strong,
.followup-risk-values .photos {
  color: #aa6500;
}

.followup-risk-summary .materials strong,
.followup-risk-values .materials {
  color: var(--red);
}

.followup-risk-rows {
  max-height: 330px;
  overflow: auto;
}

.followup-risk-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(300px, 2fr) 86px;
  min-height: 54px;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.followup-risk-row:first-child {
  border-top: 0;
}

.followup-risk-project {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.followup-risk-project > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.followup-risk-project strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-risk-plot {
  min-width: 0;
}

.followup-risk-track {
  display: flex;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.followup-risk-track i {
  min-width: 0;
  height: 100%;
}

.followup-risk-values {
  gap: 14px;
  margin-top: 5px;
  font-size: 10px;
}

.followup-risk-values b {
  font-size: 11px;
}

.followup-risk-silence {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.followup-risk-silence b {
  color: var(--ink-strong);
  font-size: 17px;
  font-weight: 720;
}

.followup-risk-silence span {
  color: var(--muted);
  font-size: 9px;
}

.followup-risk-empty {
  display: grid;
  min-height: 76px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.followup-risk-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.followup-risk-details > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.followup-risk-details > header strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 680;
}

.followup-risk-details > header span {
  color: var(--muted);
  font-size: 10px;
}

.followup-risk-detail-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.followup-risk-details table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.followup-risk-details th,
.followup-risk-details td {
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.followup-risk-details th:first-child,
.followup-risk-details td:first-child {
  border-left: 0;
}

.followup-risk-details tbody tr:last-child td {
  border-bottom: 0;
}

.followup-risk-details th {
  padding: 7px 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.followup-risk-details td {
  padding: 9px;
  color: var(--ink);
  font-size: 10px;
  line-height: 16px;
}

.followup-risk-details th:nth-child(1) {
  width: 22%;
}

.followup-risk-details th:nth-child(2) {
  width: 31%;
}

.followup-risk-details th:nth-child(3) {
  width: 39%;
}

.followup-risk-details th:nth-child(4) {
  width: 8%;
}

.followup-risk-detail-project {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.followup-risk-detail-project > span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.followup-risk-detail-project strong {
  overflow-wrap: anywhere;
  color: var(--ink-strong);
  font-size: 11px;
  line-height: 17px;
}

.followup-risk-detail-list,
.followup-risk-material-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.followup-risk-detail-list b {
  color: #aa6500;
  font-size: 10px;
  white-space: nowrap;
}

.followup-risk-detail-list p,
.followup-risk-material-group p {
  margin: 0;
  overflow-wrap: anywhere;
}

.followup-risk-materials {
  display: grid;
  gap: 6px;
}

.followup-risk-material-group > span {
  min-width: 43px;
  padding: 0 4px;
  border-radius: 3px;
  text-align: center;
  font-size: 9px;
  font-weight: 650;
  line-height: 16px;
  white-space: nowrap;
}

.followup-risk-material-group.overdue > span {
  background: var(--red-soft);
  color: var(--red);
}

.followup-risk-material-group.in_progress > span {
  background: var(--blue-soft);
  color: var(--blue);
}

.followup-risk-material-group.due > span {
  background: var(--amber-soft);
  color: var(--amber);
}

.followup-risk-none {
  color: var(--muted-2);
}

.followup-risk-detail-days {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}

.followup-risk-detail-days b {
  color: var(--ink-strong);
  font-size: 13px;
}

.followup-risk-detail-days span {
  color: var(--muted);
  font-size: 9px;
}

.followup-risk-capture {
  padding: 24px 28px 22px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.followup-risk-capture .followup-risk-row {
  grid-template-columns: 270px minmax(420px, 1fr) 100px;
}

.followup-risk-capture .followup-risk-details table {
  min-width: 0;
}

.followup-evidence-cell {
  display: grid;
  min-width: 150px;
  gap: 6px;
}

.followup-evidence-cell > span {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 1px 6px;
}

.followup-evidence-cell svg {
  width: 14px;
  height: 14px;
  grid-row: 1 / 3;
  color: var(--muted);
}

.followup-evidence-cell b {
  font-size: 11px;
  font-weight: 620;
}

.followup-evidence-cell small {
  grid-column: 2;
  color: var(--muted);
  font-size: 9px;
}

.followup-evidence-summary {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.followup-evidence-summary .followup-evidence-cell {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.progress-inline {
  display: grid;
  min-width: 150px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.progress-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7eaee;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--green);
}

.progress-track.amber span {
  background: var(--amber);
}

.progress-track.red span {
  background: var(--red);
}

.progress-inline b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 580;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-state h3 {
  margin: 0;
  font-size: 15px;
}

.empty-state p {
  max-width: 390px;
  margin: 6px auto 0;
  color: var(--muted);
  line-height: 20px;
}

/* Audit workspace */
.audit-project-page {
  display: flex;
  height: 100%;
  min-height: 630px;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

.audit-project-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 252px minmax(0, 1fr);
}

.audit-project-rail {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.audit-project-search {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 10px 4px;
}

.audit-project-search > svg {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.audit-project-search input {
  width: 100%;
  height: 34px;
  padding: 0 38px 0 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 12px;
}

.audit-project-search .icon-button {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.audit-project-search .icon-button svg {
  width: 14px;
  height: 14px;
}

.audit-project-tabs {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 6px 10px 10px;
}

.audit-project-empty,
.audit-project-search-empty {
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.audit-project-empty {
  min-height: 150px;
}

.audit-project-search-empty {
  min-height: 100%;
  padding: 32px;
}

.audit-project-empty svg,
.audit-project-search-empty svg {
  width: 24px;
  height: 24px;
  margin-bottom: 9px;
}

.audit-project-empty strong,
.audit-project-empty span,
.audit-project-search-empty strong,
.audit-project-search-empty span {
  display: block;
}

.audit-project-empty strong,
.audit-project-search-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.audit-project-empty span,
.audit-project-search-empty span {
  margin-top: 4px;
  font-size: 10px;
}

.audit-project-panel {
  min-width: 0;
  min-height: 0;
}

.audit-project-tab {
  width: 100%;
  min-height: 66px;
  flex: 0 0 auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.audit-project-tab.active {
  border-color: var(--blue);
  background: #e2ecff;
  box-shadow: inset 4px 0 0 var(--blue), 0 0 0 2px rgba(39, 110, 241, 0.24), 0 5px 14px rgba(35, 74, 139, 0.14);
  color: var(--ink);
}

.audit-project-tab.review-pending:not(.active) {
  border-left: 3px solid var(--amber);
}

.audit-project-tab.review-suspect:not(.active) {
  border-left: 3px solid #d7a72f;
}

.audit-project-tab.review-done:not(.active) {
  border-left: 3px solid var(--green);
}

.audit-project-tab.readonly.active {
  border-color: var(--blue);
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green), 0 0 0 2px rgba(39, 110, 241, 0.24), 0 5px 14px rgba(35, 74, 139, 0.14);
}

.audit-project-tab > strong,
.audit-project-tab-head > strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-project-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audit-project-tab-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.audit-project-tab b {
  font-size: 9px;
  font-weight: 550;
  white-space: nowrap;
}

.audit-project-tab b.pending {
  color: var(--amber);
}

.audit-project-tab b.done {
  color: var(--green);
}

.audit-review-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 3px 5px;
  border-radius: 4px;
  font-weight: 700 !important;
}

.audit-review-state svg {
  width: 11px;
  height: 11px;
}

.audit-review-state.pending {
  background: #fff1da;
  color: #9a6108;
}

.audit-review-state.suspect {
  background: #fff7d7;
  color: #8b6811;
}

.audit-review-state.done {
  background: var(--green-soft);
  color: var(--green);
}

@media (min-width: 768px) and (max-width: 1199px) {
  .audit-project-layout {
    display: flex;
    flex-direction: column;
  }

  .audit-project-rail {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .audit-project-search {
    padding-bottom: 3px;
  }

  .audit-project-tabs {
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
  }

  .audit-project-empty {
    width: 100%;
    min-height: 80px;
  }

  .audit-project-tab {
    width: 238px;
    min-width: 238px;
  }

  .audit-project-tab.active {
    box-shadow: inset 0 -4px 0 var(--blue), inset 0 0 0 2px rgba(39, 110, 241, 0.68), 0 5px 14px rgba(35, 74, 139, 0.14);
  }

  .audit-project-tab.readonly.active {
    box-shadow: inset 0 -4px 0 var(--green), inset 0 0 0 2px rgba(39, 110, 241, 0.68), 0 5px 14px rgba(35, 74, 139, 0.14);
  }
}

.audit-project-workspace {
  display: flex;
  height: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: auto;
}

.audit-project-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.audit-project-summary {
  display: grid;
  grid-template-columns: minmax(360px, 1.75fr) minmax(210px, 0.72fr) repeat(2, minmax(132px, 0.62fr));
  border-top: 1px solid var(--line);
}

.audit-project-summary > div {
  min-width: 0;
  min-height: 88px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.audit-project-summary > div:last-child {
  border-right: 0;
}

.audit-project-summary.readonly {
  grid-template-columns: minmax(280px, 1fr) 140px 140px;
}

.audit-readonly-summary {
  display: grid;
  align-content: center;
}

.audit-readonly-summary strong {
  display: block;
}

.audit-readonly-summary strong {
  font-size: 16px;
}

.audit-readonly-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.readonly-label {
  color: var(--green);
  font-size: 17px !important;
}

.audit-project-summary > div > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.audit-project-summary > div > strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.audit-progress-head {
  display: grid;
  min-height: 28px;
  grid-template-columns: auto minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.audit-progress-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.audit-progress-title span {
  color: var(--muted);
  font-size: 9px;
}

.audit-progress-value {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audit-overall-progress {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 27px;
  align-items: center;
  gap: 5px;
}

.audit-progress-meter {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 7px;
  justify-items: stretch;
  row-gap: 2px;
}

.audit-overall-progress .audit-progress-value {
  justify-self: center;
  text-align: center;
}

.audit-progress-meter > span {
  height: 7px;
  overflow: hidden;
  border: 1px solid #dce2e7;
  border-radius: 4px;
  background: #edf1f4;
}

.audit-overall-progress i {
  display: block;
  width: var(--overall-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b47a27, #e1ad51);
}

.audit-overall-progress.complete i {
  background: linear-gradient(90deg, #287d55, #68b386);
}

.audit-overall-progress b {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.audit-overall-progress.partial b {
  color: var(--amber);
}

.audit-overall-progress.complete b {
  color: var(--green);
}

.audit-progress-head .button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 9px;
}

.audit-progress-head .button svg {
  width: 13px;
  height: 13px;
}

.audit-rule-summary .project-rule-mini {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 5px;
}

.audit-rule-summary .project-rule-mini.named-rules > span {
  --rule-fill-start: rgba(86, 104, 119, 0.14);
  --rule-fill-end: rgba(86, 104, 119, 0.04);
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 36px;
  overflow: hidden;
  place-items: initial;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
}

.audit-rule-summary .project-rule-mini.named-rules > span[role="button"] {
  cursor: pointer;
}

.audit-rule-summary .project-rule-mini.named-rules > span[role="button"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.audit-rule-summary .project-rule-mini.named-rules > span::before {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rule-progress, 0%);
  background: linear-gradient(90deg, var(--rule-fill-start), var(--rule-fill-end));
  box-shadow: inset -1px 0 rgba(86, 104, 119, 0.12);
  content: "";
}

.audit-rule-summary .project-rule-mini.named-rules > span.partial {
  --rule-fill-start: rgba(191, 135, 50, 0.28);
  --rule-fill-end: rgba(232, 179, 83, 0.12);
}

.audit-rule-summary .project-rule-mini.named-rules > span.complete {
  --rule-fill-start: rgba(48, 133, 87, 0.28);
  --rule-fill-end: rgba(104, 179, 134, 0.14);
}

.audit-rule-summary .named-rules b,
.audit-rule-summary .named-rules small {
  position: relative;
  z-index: 1;
}

.audit-rule-summary .named-rules b {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 10px;
  font-weight: 620;
  line-height: 13px;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.audit-rule-summary .named-rules small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.audit-rule-summary .named-rules .partial small {
  color: #8a5b13;
}

.audit-rule-summary .named-rules .complete small {
  color: #236a48;
}

.audit-material-summary {
  display: grid;
  min-width: 0;
  grid-template-rows: 32px minmax(0, 1fr);
  align-content: stretch;
}

.audit-material-head {
  display: flex;
  min-height: 28px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.audit-material-head > span {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 15px;
  white-space: nowrap;
}

.audit-material-data {
  display: grid;
  min-height: 0;
  grid-template-rows: 28px 14px;
  align-content: center;
  row-gap: 3px;
}

.audit-material-metric {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.audit-material-metric > strong {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 2px;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audit-material-metric > strong > b {
  font: inherit;
}

.audit-material-metric > strong small,
.audit-material-drawer-summary > strong small,
.archive-material-large > strong small,
.archive-tab-summary > div strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.audit-material-progress {
  width: min(100%, 184px);
  min-width: 0;
  place-self: center;
}

.audit-material-progress[role="button"] {
  cursor: pointer;
}

.audit-material-progress[role="button"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.audit-material-progress .progress-inline {
  width: 100%;
  margin: 0;
}

.audit-material-summary .audit-material-bell {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
}

.audit-material-summary .audit-material-bell svg {
  width: 16px;
  height: 16px;
}

.audit-material-summary .audit-material-bell.complete svg {
  stroke-width: 3;
}

.audit-material-head .button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 9px;
}

.audit-material-head .button svg {
  width: 13px;
  height: 13px;
}

.audit-count-summary {
  display: grid;
  align-content: center;
}

.audit-photo-summary-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.audit-photo-summary-head > span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.audit-image-mode-toggle {
  display: inline-flex;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  gap: 3px;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

.audit-image-mode-toggle > span {
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
}

.audit-image-mode-toggle > span.selected {
  color: var(--blue);
  font-weight: 800;
}

.audit-image-mode-toggle > i {
  position: relative;
  display: block;
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
  border-radius: 999px;
  background: #9aa9b8;
  box-shadow: inset 0 1px 2px rgba(31, 49, 69, 0.22);
  transition: background 160ms ease;
}

.audit-image-mode-toggle > i > b {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 49, 69, 0.3);
  transition: transform 160ms ease;
}

.audit-image-mode-toggle.active > i {
  background: var(--green);
}

.audit-image-mode-toggle.active > i > b {
  transform: translateX(12px);
}

.audit-image-mode-toggle.active > span.selected {
  color: var(--green);
}

.audit-image-mode-toggle:hover,
.audit-image-mode-toggle:focus-visible {
  border-color: var(--blue);
}

.audit-project-summary .audit-count-summary {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}

.audit-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.audit-pending-head > span {
  min-width: 0;
  line-height: 12px;
  overflow-wrap: normal;
  word-break: keep-all;
}

.audit-quick-review {
  min-height: 32px !important;
  min-width: 92px !important;
  width: 92px;
  padding: 0 8px !important;
  gap: 6px !important;
  border-color: rgba(39, 110, 241, 0.32) !important;
  background: var(--blue-soft) !important;
  color: var(--blue) !important;
  font-size: 10px !important;
  white-space: nowrap;
}

.audit-quick-review svg {
  width: 13px;
  height: 13px;
}

.audit-quick-review:hover,
.audit-quick-review:focus-visible {
  border-color: var(--blue) !important;
  background: var(--blue) !important;
  color: #fff !important;
}

.audit-count-summary strong {
  font-size: 24px !important;
}

.audit-project-summary .audit-count-summary > strong {
  align-self: center;
  margin-top: 0;
  text-align: center;
}

.audit-count-summary strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.audit-count-summary > b {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.audit-review-summary {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.audit-review-summary-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 0 !important;
  font-weight: 700 !important;
}

.audit-review-summary-state svg {
  width: 12px;
  height: 12px;
}

.audit-review-summary.pending > strong,
.audit-review-summary.pending .audit-review-summary-state {
  color: var(--amber);
}

.audit-review-summary.suspect > strong,
.audit-review-summary.suspect .audit-review-summary-state {
  color: #9b7315;
}

.audit-review-summary.done > strong,
.audit-review-summary.done .audit-review-summary-state {
  color: var(--green);
}

.audit-count-summary.pending strong,
.audit-count-summary.pending > b {
  color: var(--amber);
}

.audit-photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
}

.photo-list-toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
  margin: 0 -14px 9px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(205, 211, 219, 0.78);
  background: rgba(246, 248, 250, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  backdrop-filter: blur(16px) saturate(125%);
}

.photo-filter-strip {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.photo-status-filter {
  flex: 0 0 auto;
  gap: 4px;
}

.photo-status-filter button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.photo-status-filter button svg {
  width: 16px;
  height: 16px;
}

.photo-status-filter button b {
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(114, 122, 134, 0.1);
  color: inherit;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.photo-status-filter button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px currentColor, 0 2px 6px rgba(34, 47, 62, 0.12);
  font-weight: 700;
}

.photo-status-filter button[data-photo-filter-value="approved"] {
  color: var(--green);
}

.photo-status-filter button[data-photo-filter-value="pending"] {
  color: var(--blue);
}

.photo-status-filter button[data-photo-filter-value="rejected"] {
  color: var(--red);
}

.photo-status-filter button[data-photo-filter-value="suspect"] {
  color: var(--amber);
}

.photo-status-filter button[data-photo-filter-value="corrected"] {
  color: var(--violet);
}

.photo-status-filter button[data-photo-filter-value="approved"].active {
  background: var(--green-soft);
  color: var(--green);
}

.photo-status-filter button[data-photo-filter-value="pending"].active {
  background: var(--blue-soft);
  color: var(--blue);
}

.photo-status-filter button[data-photo-filter-value="rejected"].active {
  background: var(--red-soft);
  color: var(--red);
}

.photo-status-filter button[data-photo-filter-value="suspect"].active {
  background: var(--amber-soft);
  color: var(--amber);
}

.photo-status-filter button[data-photo-filter-value="corrected"].active {
  background: var(--violet-soft);
  color: var(--violet);
}

.photo-condition-filters {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.photo-filter-strip > .photo-condition-filters:first-child {
  padding-left: 0;
  border-left: 0;
}

.photo-filter-search {
  position: relative;
  display: flex;
  width: 145px;
  height: 28px;
  flex: 0 0 145px;
  align-items: center;
  gap: 5px;
  padding: 0 5px 0 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.photo-filter-search:focus-within {
  border-color: #8cacdf;
  box-shadow: 0 0 0 2px rgba(64, 116, 207, 0.12);
}

.photo-filter-search > svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.photo-filter-search input {
  width: 100%;
  min-width: 0;
  height: 26px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 10px;
}

.photo-filter-search input::placeholder {
  color: var(--muted);
}

.photo-filter-search button {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
}

.photo-filter-search button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.photo-filter-search button[hidden] {
  display: none;
}

.photo-filter-search button svg {
  width: 12px;
  height: 12px;
}

.photo-filter-control {
  position: relative;
  display: inline-flex;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding-left: 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.photo-filter-control:focus-within {
  border-color: #8cacdf;
  box-shadow: 0 0 0 2px rgba(64, 116, 207, 0.12);
}

.photo-filter-control > svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  pointer-events: none;
}

.photo-filter-control > svg:last-child {
  width: 11px;
  margin-right: 6px;
}

.photo-filter-control select {
  max-width: 168px;
  height: 26px;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.photo-filter-control select[data-photo-filter-key="photographer"] {
  max-width: 116px;
}

.photo-filter-reset {
  position: sticky;
  right: 0;
  z-index: 2;
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  box-shadow: -8px 0 10px rgba(246, 248, 250, 0.88);
}

.photo-filter-reset:hover {
  border-color: #aeb5bf;
  color: var(--ink);
}

.photo-filter-reset svg {
  width: 13px;
  height: 13px;
}

.photo-filter-reset[hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.photo-filter-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.photo-filter-empty[hidden] {
  display: none;
}

.photo-filter-empty svg {
  width: 22px;
  height: 22px;
}

.photo-filter-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.photo-filter-empty span {
  font-size: 10px;
}

.audit-photo-meta {
  min-height: 0;
  padding: 6px 8px;
}

.audit-photo-byline {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.audit-photo-meta .audit-photo-byline strong,
.audit-photo-meta .audit-photo-byline span,
.audit-photo-meta .audit-photo-byline time,
.audit-photo-work,
.audit-photo-note {
  min-width: 0;
  margin: 0;
  font-size: 10px;
  line-height: 16px;
}

.audit-photo-meta .audit-photo-byline strong {
  min-width: 0;
  max-width: 54px;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--ink);
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-photo-meta .audit-photo-byline span,
.audit-photo-meta .audit-photo-byline time {
  display: inline;
  flex: 0 0 auto;
  overflow: visible;
  color: var(--muted);
  text-overflow: clip;
  white-space: nowrap;
}

.audit-photo-meta .audit-photo-byline .photo-rule-tag {
  display: inline-flex;
  min-width: 0;
  min-height: 16px;
  flex: 0 1 auto;
  align-items: center;
  overflow: hidden;
  padding: 0 5px;
  border: 1px solid rgba(41, 119, 82, 0.24);
  border-radius: 3px;
  background: rgba(50, 130, 91, 0.1);
  color: #297752;
  font-size: 9px;
  font-weight: 680;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-photo-meta .audit-photo-byline .photo-rule-tag.unmatched {
  flex: 0 0 auto;
  border-color: rgba(173, 113, 20, 0.28);
  background: rgba(189, 132, 40, 0.12);
  color: #986312;
}

.audit-photo-work,
.audit-photo-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-photo-work {
  color: var(--ink);
}

.audit-photo-note {
  color: var(--muted);
}

.photo-review-reason-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
}

.photo-review-reason-chip {
  display: inline-flex !important;
  min-width: 0;
  max-width: 68%;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  border: 1px solid #e7b3ae;
  border-radius: 3px;
  background: var(--red-soft);
  color: var(--red);
  line-height: 14px;
}

.photo-review-reason-chip span,
.photo-original-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-photo-meta .photo-review-reason-chip span {
  color: var(--red);
}

.photo-original-note {
  display: block !important;
  flex: 1;
  color: var(--muted);
}

.audit-photo-grid .photo-actions {
  height: 38px;
}

.audit-photo-grid .photo-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
}

.audit-material-drawer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.audit-material-drawer-summary span {
  color: var(--muted);
  font-size: 10px;
}

.audit-material-drawer-summary strong {
  font-size: 17px;
}

.audit-material-drawer-summary .progress-inline {
  grid-column: 1 / -1;
}

.audit-material-checklist {
  display: grid;
  gap: 7px;
}

.audit-material-item {
  display: grid;
  min-height: 58px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.audit-material-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.audit-material-item strong,
.audit-material-item small {
  display: block;
}

.audit-material-item strong {
  font-size: 12px;
}

.audit-material-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.audit-page {
  display: grid;
  height: 100%;
  min-height: 630px;
  grid-template-columns: 268px minmax(0, 1fr);
  background: var(--surface);
}

.task-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.task-rail-head {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.task-rail-head h2 {
  margin: 0;
  font-size: 14px;
}

.task-rail-head p {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 11px;
}

.task-filter {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.task-filter button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.task-filter button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.task-list {
  flex: 1;
  overflow: auto;
  padding: 7px;
}

.task-item {
  position: relative;
  width: 100%;
  margin: 0 0 5px;
  padding: 10px 10px 10px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}

.task-item:hover {
  background: #ffffff;
}

.task-item.active {
  border-color: var(--line-strong);
  background: #ffffff;
}

.task-item.active::before {
  position: absolute;
  inset: 9px auto 9px -1px;
  width: 3px;
  border-radius: 2px;
  background: var(--blue);
  content: "";
}

.task-item-top,
.task-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-item-top span:first-child {
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item h3 {
  margin: 7px 0 4px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item-meta {
  color: var(--muted);
  font-size: 11px;
}

.task-rail-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
}

.audit-empty-rail .task-rail-head p {
  margin-bottom: 0;
}

.audit-unavailable-page .audit-empty-rail {
  position: sticky;
  top: 0;
  height: calc(100dvh - var(--topbar-height));
  align-self: start;
}

.audit-rail-placeholder {
  display: grid;
  flex: 1;
  align-content: center;
  justify-items: center;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.audit-rail-placeholder .empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.audit-rail-placeholder .empty-icon svg {
  width: 19px;
  height: 19px;
}

.audit-rail-placeholder strong {
  color: var(--ink);
  font-size: 13px;
}

.audit-rail-placeholder span {
  margin-top: 5px;
  font-size: 11px;
}

.audit-workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--surface);
}

.audit-mobile-switch {
  display: none;
}

.audit-gate-empty {
  display: grid;
  min-height: 100%;
  align-content: center;
  justify-items: center;
  padding: 40px 24px;
  text-align: center;
}

.audit-gate-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.audit-gate-symbol.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

[data-audit-state="processing"] .audit-gate-symbol {
  width: 68px;
  height: 68px;
  border-color: #aebfeb;
  box-shadow: 0 0 0 8px rgba(46, 99, 191, 0.08);
}

[data-audit-state="processing"] .audit-gate-symbol svg {
  width: 30px;
  height: 30px;
}

.audit-gate-symbol.red {
  background: var(--red-soft);
  color: var(--red);
}

.audit-gate-symbol.green {
  background: var(--green-soft);
  color: var(--green);
}

.audit-gate-symbol svg {
  width: 27px;
  height: 27px;
}

.audit-gate-empty h1 {
  max-width: 520px;
  margin: 12px 0 0;
  font-size: 20px;
  line-height: 28px;
}

.audit-gate-empty > p {
  max-width: 520px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 21px;
}

.audit-gate-dates {
  display: grid;
  width: min(100%, 360px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.audit-gate-dates div {
  padding: 12px;
}

.audit-gate-dates div + div {
  border-left: 1px solid var(--line);
}

.audit-gate-dates dt {
  color: var(--muted);
  font-size: 11px;
}

.audit-gate-dates dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.audit-live-progress {
  width: min(100%, 420px);
  margin-top: 2px;
  text-align: left;
}

.audit-live-progress-head,
.audit-live-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audit-live-progress-head strong,
.audit-live-progress-head span {
  font-size: 12px;
}

.audit-live-progress-head span {
  color: var(--blue);
  font-weight: 680;
}

.audit-live-progress-track {
  height: 8px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-3);
}

.audit-live-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #276ef1, #38a98d);
  transition: width 240ms ease;
}

.audit-live-progress-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.audit-live-progress-meta span {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: center;
}

.audit-live-progress-meta b {
  color: var(--ink);
  font-size: 11px;
}

.audit-live-progress-meta .active,
.audit-live-progress-meta .active b {
  color: var(--blue);
}

.audit-live-progress-meta .failed,
.audit-live-progress-meta .failed b {
  color: var(--red);
}

.audit-context {
  flex: 0 0 auto;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.audit-context-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.audit-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.audit-title-line h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  line-height: 24px;
}

.audit-subline {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.audit-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.path-summary {
  display: grid;
  min-height: 49px;
  grid-template-columns: minmax(170px, 0.7fr) minmax(280px, 1.3fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #ecd09b;
  border-radius: 5px;
  background: #fffaf0;
}

.reference-path-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: #b9d8ca;
  background: #f4faf7;
}

.reference-path-summary .missing-steps {
  color: var(--muted);
}

.reference-path-summary .missing-steps b {
  color: var(--green);
}

.path-progress {
  min-width: 0;
}

.path-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
}

.path-progress-top strong {
  color: var(--ink);
  font-weight: 650;
}

.missing-steps {
  min-width: 0;
  color: var(--amber);
  font-size: 12px;
  line-height: 18px;
}

.missing-steps b {
  color: var(--ink);
  font-weight: 650;
}

.engine-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.engine-note svg {
  width: 14px;
  height: 14px;
  color: var(--violet);
}

.photo-work-area {
  position: relative;
  min-height: 0;
  flex: 0 0 auto;
  overflow: visible;
  padding: 12px 14px 24px;
  background: var(--canvas);
}

.photo-back-to-top {
  position: sticky;
  bottom: 14px;
  z-index: 7;
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0 10px 10px auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 4px 14px rgba(34, 47, 62, 0.16);
}

.photo-back-to-top:hover,
.photo-back-to-top:focus-visible {
  background: var(--blue-soft);
  color: var(--blue);
}

.photo-back-to-top svg {
  width: 19px;
  height: 19px;
}

.photo-work-area[data-photo-filter-surface="audit"] {
  padding-top: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 9px;
  align-items: start;
}

.photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  transition: border-color 130ms ease, transform 130ms ease;
}

.photo-card:hover {
  border-color: #aeb5bf;
  transform: translateY(-1px);
}

.photo-card.approved {
  border-color: #a8d3bb;
}

.photo-card.rejected {
  border-color: #e2aaa6;
}

.photo-card.suspect {
  border-color: #e2c178;
}

.photo-card.is-current {
  z-index: 1;
  border-color: var(--blue);
  background: #edf3ff;
  box-shadow: 0 0 0 3px rgba(39, 110, 241, 0.42), 0 10px 24px rgba(35, 74, 139, 0.2);
  transform: translateY(-1px);
}

.photo-readiness {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.photo-readiness span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-readiness > b {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 720;
}

.photo-readiness svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.photo-readiness.ready { color: #32825b; }
.photo-readiness.needs-attention { color: #a36a11; }
.photo-readiness.unmatched { color: #7a8290; }

.photo-evidence-overlay {
  position: absolute;
  inset: auto 38px 6px 6px;
  z-index: 3;
  display: grid;
  width: fit-content;
  max-width: calc(100% - 50px);
  gap: 3px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(15, 19, 23, 0.84);
  color: #edf2f5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.photo-evidence-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  height: 14px;
}

.evidence-kind {
  display: inline-flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  color: #dce3e8;
}

.evidence-kind svg { width: 11px; height: 11px; }

.evidence-status {
  color: #d8dee4;
  font-size: 9px;
  font-weight: 700;
  line-height: 11px;
  white-space: nowrap;
}

.evidence-status.complete { color: #8de1a8; }
.evidence-status.incomplete { color: #8fbcff; }
.evidence-status.progressing { color: #f2c46c; }

.evidence-nodes {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  gap: 2px;
}

.evidence-node {
  display: block;
  width: 5px;
  min-width: 3px;
  height: 10px;
  flex: 0 1 5px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 2px;
  background: #68717c;
}

.evidence-node.complete { border-color: #8de1a8; background: #47b874; }
.evidence-node.current { border-color: #9dc4ff; background: #4d91f7; box-shadow: 0 0 0 1px rgba(157, 196, 255, 0.35); }
.evidence-node.overdue { border-color: #f2a29a; background: #d9554d; }
.evidence-node.pending { border-color: #f2cc7a; background: #bd8428; }
.evidence-node.not_due { border-color: rgba(255, 255, 255, 0.28); background: #5f6873; }
.evidence-nodes em { color: #b3bbc4; font-size: 8px; font-style: normal; white-space: nowrap; }

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #202327;
  padding: 0;
}

.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-index {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(20, 23, 27, 0.83);
  color: #f6f7f8;
  font-size: 10px;
}

.photo-index {
  top: 6px;
  left: 6px;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.photo-edited-icon {
  display: inline-flex;
  align-items: center;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: #f3c777;
}

.photo-edited-icon svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}

.photo-result {
  position: absolute;
  inset: auto 7px 6px auto;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

.photo-result.approved {
  background: var(--green);
}

.photo-result.rejected {
  background: var(--red);
}

.photo-result.suspect {
  background: var(--amber);
}

.photo-result svg {
  width: 17px;
  height: 17px;
}

.photo-meta {
  min-height: 54px;
  padding: 7px 8px 6px;
}

.photo-meta strong,
.photo-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-meta strong {
  font-size: 11px;
  font-weight: 620;
  line-height: 18px;
}

.photo-meta span {
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
}

.photo-actions {
  display: grid;
  height: 34px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.photo-actions button {
  display: grid;
  min-width: 0;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.photo-actions button:last-child {
  border-right: 0;
}

.photo-actions button:hover[data-status="approved"] {
  background: var(--green-soft);
  color: var(--green);
}

.photo-actions button:hover[data-status="rejected"] {
  background: var(--red-soft);
  color: var(--red);
}

.photo-actions button:hover[data-status="suspect"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.photo-actions button.selected[data-status="approved"] {
  background: var(--green-soft);
  color: var(--green);
}

.photo-actions button.selected[data-status="rejected"] {
  background: var(--red-soft);
  color: var(--red);
}

.photo-actions button.selected[data-status="suspect"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.photo-actions button.selected {
  box-shadow: inset 0 -3px 0 currentColor;
  font-weight: 750;
}

.photo-actions button.requires-rule-mapping {
  background: var(--red-soft);
  color: var(--red);
  box-shadow: inset 0 -2px 0 currentColor;
}

.photo-actions svg {
  width: 15px;
  height: 15px;
}

.photo-readonly {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-top: 1px solid var(--line);
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 620;
}

.photo-readonly svg {
  width: 15px;
  height: 15px;
}

.audit-complete {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.audit-complete .complete-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.audit-complete .complete-symbol svg {
  width: 28px;
  height: 28px;
}

.audit-complete h2 {
  margin: 0;
  font-size: 20px;
}

.audit-complete p {
  margin: 6px 0 18px;
  color: var(--muted);
}

/* Dashboard */
.dashboard-command {
  position: relative;
  display: grid;
  min-height: 118px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  overflow: hidden;
}

.dashboard-command::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
  content: "";
}

.dashboard-command.attention::before {
  background: var(--amber);
}

.dashboard-command.critical::before {
  background: var(--red);
}

.dashboard-command-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.dashboard-command.attention .dashboard-command-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.dashboard-command.critical .dashboard-command-icon {
  background: var(--red-soft);
  color: var(--red);
}

.dashboard-command-icon svg {
  width: 21px;
  height: 21px;
}

.dashboard-command-copy {
  min-width: 0;
}

.dashboard-command-copy > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}

.dashboard-command-copy h2 {
  margin: 3px 0 4px;
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 700;
  line-height: 27px;
}

.dashboard-command-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 19px;
}

.dashboard-command-copy p strong {
  color: var(--ink);
}

.dashboard-command-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.dashboard-command-stats > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.dashboard-command-stats > div:last-child {
  border-right: 0;
}

.dashboard-command-stats span,
.dashboard-command-stats small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.dashboard-command-stats strong {
  display: inline-block;
  margin: 3px 4px 0 0;
  color: var(--ink-strong);
  font-size: 21px;
  line-height: 24px;
}

.dashboard-command-stats small {
  display: inline;
}

.dashboard-dimensions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-dimension {
  min-width: 0;
  padding: 14px;
}

.dashboard-dimension-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-dimension-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
}

.dashboard-dimension-head svg {
  width: 15px;
  height: 15px;
}

.dashboard-dimension-head strong {
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 24px;
}

.dashboard-dimension-track {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.dashboard-dimension-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--muted-2);
}

.dashboard-dimension.green .dashboard-dimension-track span { background: var(--green); }
.dashboard-dimension.blue .dashboard-dimension-track span { background: var(--blue); }
.dashboard-dimension.cyan .dashboard-dimension-track span { background: var(--cyan); }
.dashboard-dimension.amber .dashboard-dimension-track span { background: var(--amber); }
.dashboard-dimension.red .dashboard-dimension-track span { background: var(--red); }

.dashboard-dimension p {
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-priority-layout {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.dashboard-risk-panel,
.dashboard-health-panel,
.dashboard-chart-panel,
.dashboard-review-panel,
.dashboard-photographer-panel,
.dashboard-aging-panel {
  min-width: 0;
  overflow: hidden;
}

.dashboard-health-panel {
  margin-bottom: 16px;
}

.dashboard-risk-list {
  display: grid;
}

.dashboard-risk-row {
  display: grid;
  min-height: 64px;
  grid-template-columns: 28px minmax(170px, 0.9fr) minmax(240px, 1.35fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.dashboard-risk-row:first-child {
  border-top: 0;
}

.dashboard-risk-row.critical {
  box-shadow: inset 3px 0 0 var(--red);
}

.dashboard-risk-row.attention {
  box-shadow: inset 3px 0 0 var(--amber);
}

.dashboard-risk-row.stable {
  box-shadow: inset 3px 0 0 var(--green);
}

.dashboard-risk-rank {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 720;
  text-align: center;
}

.dashboard-risk-project,
.dashboard-risk-project strong,
.dashboard-risk-project span {
  display: block;
  min-width: 0;
}

.dashboard-risk-project strong,
.dashboard-risk-project span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-risk-project strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.dashboard-risk-project span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-risk-reasons {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
}

.dashboard-risk-reasons .badge {
  font-size: 9px;
}

.dashboard-priority-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 680;
  white-space: nowrap;
}

.dashboard-priority-badge.critical { background: var(--red-soft); color: var(--red); }
.dashboard-priority-badge.attention { background: var(--amber-soft); color: var(--amber); }
.dashboard-priority-badge.stable { background: var(--green-soft); color: var(--green); }

.dashboard-risk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.dashboard-risk-actions .button {
  white-space: nowrap;
}

.dashboard-list-foot {
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.dashboard-health-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 16px 6px;
}

.dashboard-health-item {
  display: grid;
  min-height: 76px;
  grid-template-columns: 34px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  text-align: left;
}

.dashboard-health-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.dashboard-health-item.amber .dashboard-health-icon { background: var(--amber-soft); color: var(--amber); }
.dashboard-health-item.red .dashboard-health-icon { background: var(--red-soft); color: var(--red); }

.dashboard-health-icon svg {
  width: 15px;
  height: 15px;
}

.dashboard-health-item > span:nth-child(2),
.dashboard-health-item strong,
.dashboard-health-item small {
  display: block;
  min-width: 0;
}

.dashboard-health-item strong {
  font-size: 11px;
}

.dashboard-health-item small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-health-item > b {
  color: var(--ink-strong);
  font-size: 18px;
}

.dashboard-health-item > svg {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.dashboard-health-note {
  margin: 0 16px 14px;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  line-height: 15px;
}

.dashboard-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.dashboard-analysis-grid.secondary {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: start;
}

.dashboard-activity-panel {
  min-width: 0;
  margin-bottom: 16px;
  overflow: hidden;
}

.dashboard-activity-actions,
.dashboard-activity-year {
  display: flex;
  align-items: center;
}

.dashboard-activity-actions {
  gap: 8px;
}

.dashboard-activity-year {
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.dashboard-activity-year select {
  width: 88px;
  height: 30px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background-color: var(--surface);
  color: var(--ink-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-activity-scroll {
  overflow-x: auto;
  padding: 4px 16px 8px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.dashboard-activity-chart {
  width: 822px;
  min-width: 822px;
  margin: 0 auto;
}

.dashboard-activity-months {
  display: grid;
  width: 792px;
  grid-template-columns: repeat(53, 12px);
  gap: 3px;
  margin-left: 30px;
  color: var(--muted);
  font-size: 9px;
  line-height: 16px;
}

.dashboard-activity-months span {
  white-space: nowrap;
}

.dashboard-activity-body {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.dashboard-activity-weekdays {
  display: grid;
  width: 24px;
  flex: 0 0 24px;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 12px;
  text-align: right;
}

.dashboard-activity-cells {
  display: grid;
  grid-auto-columns: 12px;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
}

.dashboard-activity-cell,
.dashboard-activity-legend i {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(31, 42, 55, 0.05);
  border-radius: 2px;
  background: #edf1f4;
}

button.dashboard-activity-cell {
  appearance: none;
  padding: 0;
  cursor: pointer;
}

.dashboard-activity-cell:not(.future) {
  transition: border-color 120ms ease, transform 120ms ease;
}

.dashboard-activity-cell:not(.future):hover {
  z-index: 1;
  border-color: #4e6478;
  transform: scale(1.28);
}

.dashboard-activity-cell.is-selected {
  z-index: 2;
  border-color: #175cd3;
  box-shadow: 0 0 0 2px rgba(23, 92, 211, 0.2);
  transform: scale(1.16);
}

.dashboard-activity-cell.future {
  border-color: transparent;
  background: transparent;
}

.dashboard-activity-cell.level-1,
.dashboard-activity-legend .level-1 { background: #ccebd8; }
.dashboard-activity-cell.level-2,
.dashboard-activity-legend .level-2 { background: #88d3a4; }
.dashboard-activity-cell.level-3,
.dashboard-activity-legend .level-3 { background: #42a96d; }
.dashboard-activity-cell.level-4,
.dashboard-activity-legend .level-4 { background: #18794e; }

.dashboard-activity-meta {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 16px;
  padding: 6px 16px 10px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-activity-selection {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  background: #e9f2ff;
  color: #175cd3;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-activity-selection[hidden] {
  display: none;
}

.dashboard-activity-legend {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 4px;
}

.dashboard-activity-legend i {
  display: block;
  flex: 0 0 12px;
}

@media (max-width: 767px) {
  .dashboard-activity-panel .section-head {
    align-items: flex-start;
  }

  .dashboard-activity-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .dashboard-activity-year > span {
    display: none;
  }

  .dashboard-activity-scroll {
    padding-right: 12px;
    padding-left: 12px;
  }

  .dashboard-activity-chart {
    margin: 0;
  }

  .dashboard-activity-meta {
    flex-wrap: wrap;
    gap: 5px 12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .dashboard-activity-legend {
    width: 100%;
    margin-left: 0;
  }
}

.dashboard-chart-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.dashboard-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cyan);
}

.dashboard-chart-legend i.closed {
  background: var(--blue);
}

.trend-grid {
  display: grid;
  height: 210px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 28px 18px 13px;
}

.trend-column {
  display: grid;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) 20px;
  gap: 7px;
  text-align: center;
}

.trend-bar-area {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.trend-bar {
  position: relative;
  width: min(22px, 34%);
  min-height: 0;
  border-radius: 3px 3px 0 0;
  background: var(--cyan);
}

.trend-bar.secondary {
  width: min(14px, 26%);
  background: var(--blue);
}

.trend-bar b {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 3px);
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  transform: translateX(50%);
}

.trend-column label {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-review-summary,
.dashboard-aging-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 15px 14px 4px;
}

.dashboard-review-summary strong,
.dashboard-aging-total strong {
  color: var(--ink-strong);
  font-size: 24px;
  line-height: 28px;
}

.dashboard-review-summary span,
.dashboard-aging-total span {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-distribution,
.dashboard-aging-list {
  display: grid;
  gap: 12px;
  padding: 10px 14px 15px;
}

.dashboard-distribution-row > div:first-child,
.dashboard-aging-row > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 10px;
}

.dashboard-distribution-row b,
.dashboard-aging-row b {
  font-size: 10px;
}

.dashboard-distribution-row small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.dashboard-distribution-row > div:last-child,
.dashboard-aging-row > div:last-child {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.dashboard-distribution-row > div:last-child span,
.dashboard-aging-row > div:last-child span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.dashboard-distribution-row.green > div:last-child span,
.dashboard-aging-row.green > div:last-child span { background: var(--green); }
.dashboard-distribution-row.red > div:last-child span,
.dashboard-aging-row.red > div:last-child span { background: var(--red); }
.dashboard-distribution-row.amber > div:last-child span,
.dashboard-aging-row.amber > div:last-child span { background: var(--amber); }

.dashboard-photographer-table {
  min-width: 640px;
}

.dashboard-photographer-table th,
.dashboard-photographer-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.dashboard-table-risk {
  color: var(--green);
  font-weight: 650;
}

.dashboard-table-risk.has-risk {
  color: var(--red);
}

.dashboard-footnote {
  padding: 2px 2px 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 15px;
}

/* Dashboard analytical sections */
.dashboard-section-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.dashboard-section-grid.portfolio {
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.7fr);
}

.dashboard-section-grid.execution {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
}

.dashboard-section-grid.quality {
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
}

.dashboard-section-grid.closure {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.dashboard-type-panel,
.dashboard-lifecycle-panel,
.dashboard-stage-panel,
.dashboard-material-panel,
.dashboard-relevance-panel,
.dashboard-reason-panel,
.dashboard-problem-panel,
.dashboard-learning-panel {
  min-width: 0;
  overflow: hidden;
}

.dashboard-type-list,
.dashboard-lifecycle-list,
.dashboard-stage-list,
.dashboard-material-list,
.dashboard-relevance-list,
.dashboard-reason-list {
  display: grid;
  gap: 12px;
}

.dashboard-type-row,
.dashboard-stage-row,
.dashboard-material-row,
.dashboard-relevance-row,
.dashboard-reason-row {
  display: grid;
  gap: 7px;
}

.dashboard-type-head,
.dashboard-stage-head,
.dashboard-material-head,
.dashboard-relevance-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.dashboard-type-head strong,
.dashboard-stage-head strong,
.dashboard-material-head strong,
.dashboard-relevance-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-type-head > span,
.dashboard-stage-head > span,
.dashboard-material-head > span,
.dashboard-relevance-head > span {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-type-head > span {
  margin-left: auto;
}

.dashboard-type-head b,
.dashboard-stage-head b,
.dashboard-relevance-head b {
  color: var(--ink-strong);
  font-size: 11px;
  white-space: nowrap;
}

.dashboard-material-head b {
  margin-left: auto;
  font-size: 10px;
  white-space: nowrap;
}

.dashboard-material-head b.overdue {
  color: var(--red);
}

.dashboard-material-head b.pending {
  color: var(--amber);
}

.dashboard-type-track,
.dashboard-stage-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-3);
}

.dashboard-type-track span,
.dashboard-stage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ed0a3, var(--green));
}

.dashboard-type-meta,
.dashboard-stage-meta,
.dashboard-relevance-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-type-meta .has-risk,
.dashboard-stage-meta .attention,
.dashboard-relevance-meta .mismatch {
  color: var(--red);
}

.dashboard-relevance-note {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-stage-meta .done,
.dashboard-relevance-meta .valid {
  color: var(--green);
}

.dashboard-lifecycle-list {
  gap: 8px;
}

.dashboard-lifecycle-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.dashboard-lifecycle-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.dashboard-lifecycle-row.amber .dashboard-lifecycle-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.dashboard-lifecycle-row.green .dashboard-lifecycle-icon {
  background: var(--green-soft);
  color: var(--green);
}

.dashboard-lifecycle-row strong,
.dashboard-lifecycle-row small {
  display: block;
}

.dashboard-lifecycle-row strong {
  font-size: 12px;
}

.dashboard-lifecycle-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-lifecycle-row > b {
  color: var(--ink-strong);
  font-size: 17px;
}

.dashboard-material-kpis,
.dashboard-learning-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-material-kpi,
.dashboard-learning-kpis > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.dashboard-material-kpi strong,
.dashboard-material-kpi span,
.dashboard-learning-kpis strong,
.dashboard-learning-kpis span {
  display: block;
}

.dashboard-material-kpi strong,
.dashboard-learning-kpis strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.dashboard-material-kpi span,
.dashboard-learning-kpis span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-material-kpi.red strong {
  color: var(--red);
}

.dashboard-material-kpi.amber strong {
  color: var(--amber);
}

.dashboard-material-kpi.green strong {
  color: var(--green);
}

.dashboard-material-row {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.dashboard-material-track {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-3);
}

.dashboard-material-track span.complete {
  background: var(--green);
}

.dashboard-material-track span.risk {
  background: var(--amber);
}

.dashboard-material-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dashboard-subhead strong {
  font-size: 11px;
}

.dashboard-subhead span {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-material-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.dashboard-material-item strong,
.dashboard-material-item span {
  display: block;
}

.dashboard-material-item strong {
  max-width: 260px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-material-item div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-relevance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.dashboard-relevance-summary span {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-relevance-summary b {
  margin-left: 4px;
  color: var(--ink-strong);
  font-size: 14px;
}

.dashboard-relevance-summary b.red {
  color: var(--red);
}

.dashboard-relevance-summary b.amber {
  color: var(--amber);
}

.dashboard-relevance-track {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-3);
}

.dashboard-relevance-track span.valid {
  background: var(--green);
}

.dashboard-relevance-track span.mismatch {
  background: var(--red);
}

.dashboard-reason-row {
  grid-template-columns: 26px minmax(0, 1fr) minmax(90px, 0.8fr);
  align-items: center;
  gap: 10px;
}

.dashboard-reason-rank {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.dashboard-reason-copy strong,
.dashboard-reason-copy small {
  display: block;
}

.dashboard-reason-copy strong {
  font-size: 11px;
}

.dashboard-reason-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-reason-track {
  height: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.dashboard-reason-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.dashboard-review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-review-meta strong {
  margin-left: 3px;
  color: var(--ink-strong);
  font-size: 12px;
}

.dashboard-engine-agreement {
  margin: 0 14px 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.dashboard-agreement-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dashboard-agreement-head span {
  color: var(--muted);
  font-size: 10px;
}

.dashboard-agreement-head strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.dashboard-agreement-head b {
  margin-left: auto;
  color: var(--green);
  font-size: 11px;
}

.dashboard-agreement-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-3);
}

.dashboard-agreement-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.dashboard-engine-agreement p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.dashboard-problem-sources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.dashboard-problem-source {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.dashboard-problem-source span,
.dashboard-problem-source b {
  display: block;
}

.dashboard-problem-source span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-problem-source b {
  margin-top: 3px;
  color: var(--ink-strong);
  font-size: 16px;
}

.dashboard-problem-source.red b {
  color: var(--red);
}

.dashboard-problem-source.amber b {
  color: var(--amber);
}

.dashboard-problem-source.blue b {
  color: var(--blue);
}

.dashboard-learning-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-import-summary {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.dashboard-import-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-import-latest {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dashboard-import-latest span,
.dashboard-import-latest strong,
.dashboard-import-latest small {
  display: block;
}

.dashboard-import-latest span {
  color: var(--muted);
  font-size: 9px;
}

.dashboard-import-latest strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-import-latest small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

/* Project path comparison */
.gantt-panel {
  margin-bottom: 16px;
  overflow: hidden;
}

.gantt-section-head {
  align-items: flex-start;
}

.gantt-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.gantt-swatch {
  display: inline-block;
  width: 17px;
  height: 8px;
  border-radius: 3px;
}

.gantt-swatch.plan {
  border: 1px dashed var(--muted-2);
  background: var(--surface-2);
}

.gantt-swatch.actual {
  background: linear-gradient(90deg, var(--blue) 0 25%, var(--cyan) 25% 50%, var(--amber) 50% 75%, var(--violet) 75%);
}

.gantt-swatch.today {
  width: 2px;
  height: 14px;
  margin: 0 7px;
  border-radius: 0;
  background: var(--red);
}

.gantt-scope-note {
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 10px;
}

.gantt-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.gantt-scroll:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.gantt-board {
  --gantt-label-width: 272px;
  display: block;
  width: max(100%, calc(var(--gantt-label-width) + var(--gantt-timeline-width)));
  min-width: calc(var(--gantt-label-width) + var(--gantt-timeline-width));
  color: var(--ink);
}

.gantt-axis,
.gantt-project-row,
.gantt-path-row {
  display: grid;
  grid-template-columns: var(--gantt-label-width) var(--gantt-timeline-width);
}

.gantt-axis {
  min-height: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.gantt-axis-label,
.gantt-project-label,
.gantt-path-label {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.gantt-axis-label {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #f4f7f9;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.gantt-axis-track,
.gantt-project-track,
.gantt-track {
  position: relative;
  width: var(--gantt-timeline-width);
  min-width: var(--gantt-timeline-width);
}

.gantt-grid {
  background-image: linear-gradient(to right, rgba(111, 128, 145, 0.13) 1px, transparent 1px);
  background-size: var(--gantt-day-width) 100%;
}

.gantt-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1px solid rgba(91, 111, 130, 0.2);
  pointer-events: none;
}

.gantt-tick b {
  position: absolute;
  top: 8px;
  left: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 1px;
  background: rgba(197, 58, 50, 0.58);
  pointer-events: none;
}

.gantt-today-line.labeled {
  z-index: 4;
}

.gantt-today-line.labeled b {
  position: absolute;
  top: 26px;
  left: 4px;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.gantt-project-row {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  background: #f0f4f7;
}

.gantt-project-label {
  display: flex;
  min-height: 44px;
  flex-direction: column;
  justify-content: center;
  padding: 6px 14px;
  background: #f0f4f7;
}

.gantt-project-label strong,
.gantt-project-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-project-label strong {
  font-size: 12px;
}

.gantt-project-label span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.gantt-project-window {
  position: absolute;
  top: 19px;
  height: 6px;
  border: 1px solid rgba(95, 112, 130, 0.35);
  border-radius: 4px;
  background: rgba(95, 112, 130, 0.16);
}

.gantt-path-row {
  min-height: 46px;
  border-bottom: 1px solid #edf0f2;
  --path-color: var(--blue);
  --path-soft: var(--blue-soft);
}

.gantt-path-row.path-b {
  --path-color: var(--cyan);
  --path-soft: var(--cyan-soft);
}

.gantt-path-row.path-c {
  --path-color: var(--amber);
  --path-soft: var(--amber-soft);
}

.gantt-path-row.path-d {
  --path-color: var(--violet);
  --path-soft: var(--violet-soft);
}

.gantt-path-label {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 14px;
  background: #ffffff;
}

.gantt-path-code {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 4px;
  background: var(--path-soft);
  color: var(--path-color);
  font-size: 10px;
  font-weight: 750;
}

.gantt-path-label strong,
.gantt-path-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-path-label strong {
  font-size: 11px;
}

.gantt-path-label small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.gantt-status {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}

.gantt-track {
  min-height: 46px;
}

.gantt-plan-bar,
.gantt-actual-bar {
  position: absolute;
  z-index: 1;
  display: block;
  min-width: 3px;
  border-radius: 4px;
}

.gantt-plan-bar {
  top: 9px;
  height: 10px;
  border: 1px dashed rgba(91, 111, 130, 0.55);
  background: rgba(226, 233, 239, 0.72);
}

.gantt-actual-bar {
  top: 25px;
  height: 10px;
  border: 1px solid var(--path-color);
  background: var(--path-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.gantt-path-row.delayed .gantt-actual-bar {
  border-color: var(--red);
  background: var(--red);
}

.gantt-path-row.completed .gantt-actual-bar {
  opacity: 0.82;
}

/* Forms and lists */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
}

.input,
.select {
  min-height: 36px;
  padding: 0 10px;
}

.textarea {
  min-height: 86px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 20px;
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa1ab;
}

.search-input {
  position: relative;
  width: min(320px, 100%);
}

.search-input svg {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-input input {
  padding-left: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-field {
  min-width: 0;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.form-field label small {
  color: var(--muted);
  font-weight: 400;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.check-option {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 12px;
}

.form-field .check-option {
  justify-content: flex-start;
  margin-bottom: 0;
  font-weight: 500;
}

.check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.form-message {
  display: none;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.form-message.visible {
  display: block;
}

.operation-status {
  display: none;
  min-height: 58px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(46, 99, 191, 0.24);
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--ink);
}

.operation-status.visible {
  display: grid;
}

.operation-status > svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  animation: loading-spin 800ms linear infinite;
}

.operation-status strong,
.operation-status small {
  display: block;
}

.operation-status strong {
  font-size: 12px;
}

.operation-status small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
}

/* Sites */
.project-archive-list {
  overflow: hidden;
}

.project-archive-columns,
.project-archive-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(300px, 1.35fr) minmax(135px, 0.65fr) minmax(155px, 0.7fr) minmax(112px, 0.5fr) 26px;
  gap: 16px;
  align-items: center;
}

.project-archive-columns {
  min-height: 38px;
  padding: 0 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.project-archive-row {
  width: 100%;
  min-height: 86px;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: background 130ms ease;
}

.project-archive-row:hover {
  background: #f7f9fb;
}

.project-archive-row.is-current,
.project-archive-row.is-current:hover {
  position: relative;
  z-index: 1;
  background: #e7efff;
  box-shadow: inset 5px 0 0 var(--blue), inset 0 0 0 2px rgba(39, 110, 241, 0.72), 0 5px 14px rgba(35, 74, 139, 0.12);
}

.project-archive-row.lifecycle-archived,
.project-archive-row.lifecycle-archived:hover,
.project-archive-row.lifecycle-archived.is-current,
.project-archive-row.lifecycle-archived.is-current:hover {
  box-shadow: inset 5px 0 0 var(--green), inset 0 0 0 2px rgba(39, 110, 241, 0.72), 0 5px 14px rgba(35, 74, 139, 0.12);
}

.project-archive-row:focus-visible {
  position: relative;
  z-index: 1;
}

.archive-list-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.archive-list-empty strong {
  color: var(--ink);
}

.archive-list-empty span {
  font-size: 11px;
}

.project-archive-identity,
.project-latest,
.project-material-progress > span:first-child {
  min-width: 0;
}

.project-archive-identity strong,
.project-archive-identity small,
.project-latest b,
.project-latest small,
.project-material-progress b,
.project-material-progress small {
  display: block;
}

.project-archive-identity strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.project-title-line > strong {
  min-width: 0;
}

.project-lifecycle-badge {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
}

.project-lifecycle-badge.blue {
  border-color: #bdd1f2;
  background: var(--blue-soft);
  color: var(--blue);
}

.project-lifecycle-badge.amber {
  border-color: #ead09b;
  background: var(--amber-soft);
  color: var(--amber);
}

.project-lifecycle-badge.green {
  border-color: #b9dcc6;
  background: var(--green-soft);
  color: var(--green);
}

.project-archive-filters .filter-group {
  justify-content: flex-end;
}

.lifecycle-filter button {
  white-space: nowrap;
}

.project-archive-identity small,
.project-latest small,
.project-material-progress small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.project-rule-mini {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 4px;
}

.project-rule-mini > span {
  display: grid;
  min-height: 44px;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}

.project-rule-mini b,
.project-rule-mini small {
  display: block;
  font-size: 9px;
  line-height: 14px;
}

.project-rule-mini small {
  color: var(--muted);
}

.project-rule-mini .complete {
  border-color: #b9dcc6;
  background: var(--green-soft);
  color: var(--green);
}

.project-rule-mini .partial {
  border-color: #ead09b;
  background: var(--amber-soft);
  color: var(--amber);
}

.project-rule-mini .dormant {
  color: var(--muted-2);
}

.project-material-progress {
  display: grid;
  gap: 8px;
}

.project-material-progress b,
.project-latest b {
  color: var(--ink);
  font-size: 12px;
}

.archive-progress {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-3);
}

.archive-progress i {
  display: block;
  height: 100%;
  background: var(--blue);
}

.project-history-counts {
  display: flex;
  align-items: center;
  gap: 16px;
}

.project-history-counts > span {
  display: grid;
  grid-template-columns: 15px auto;
  align-items: center;
  gap: 2px 5px;
}

.project-history-counts svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.project-history-counts b {
  font-size: 13px;
}

.project-history-counts small {
  grid-column: 2;
  color: var(--muted);
  font-size: 9px;
}

.project-enter {
  color: var(--muted-2);
}

.project-archive-row.photo-only {
  min-height: 72px;
}

.project-photo-only-summary {
  display: flex;
  grid-column: 2 / 5;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.project-photo-only-summary > svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.project-photo-only-summary > span {
  display: grid;
  gap: 3px;
}

.project-photo-only-summary b {
  font-size: 13px;
}

.project-photo-only-summary small {
  color: var(--muted);
  font-size: 10px;
}

.readonly-archive-head {
  align-items: center;
}

.readonly-archive-body {
  padding-top: 14px;
}

.archive-summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.archive-summary-band > div {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.archive-summary-band > div:last-child {
  border-right: 0;
}

.archive-summary-band span {
  color: var(--muted);
  font-size: 11px;
}

.archive-summary-band strong {
  font-size: 22px;
}

.archive-summary-band strong small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.archive-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 0.7fr);
  gap: 14px;
}

.archive-section {
  min-width: 0;
  padding: 0 14px 14px;
}

.archive-section .section-head {
  padding-right: 0;
  padding-left: 0;
}

.archive-rule-matrix {
  display: grid;
  grid-template-columns: repeat(7, minmax(76px, 1fr));
  gap: 7px;
}

.archive-rule-matrix > div {
  min-height: 80px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}

.archive-rule-matrix span,
.archive-rule-matrix strong,
.archive-rule-matrix small {
  display: block;
}

.archive-rule-matrix span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.archive-rule-matrix strong {
  margin-top: 7px;
  font-size: 14px;
}

.archive-rule-matrix small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 13px;
}

.archive-rule-matrix .complete {
  border-color: #b9dcc6;
  background: var(--green-soft);
}

.archive-rule-matrix .complete strong {
  color: var(--green);
}

.archive-rule-matrix .partial {
  border-color: #ead09b;
  background: var(--amber-soft);
}

.archive-rule-matrix .partial strong {
  color: var(--amber);
}

.archive-material-large {
  display: grid;
  min-height: 80px;
  align-content: center;
  gap: 10px;
}

.archive-material-large > strong {
  color: var(--blue);
  font-size: 28px;
}

.archive-material-large > span {
  color: var(--muted);
  font-size: 10px;
}

.project-rules-detail {
  overflow: hidden;
}

.project-rule-row {
  display: grid;
  min-height: 72px;
  grid-template-columns: 42px minmax(150px, 0.8fr) minmax(140px, 0.75fr) minmax(210px, 1.2fr) 82px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

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

.project-rule-row.is-focus {
  background: var(--surface-2);
  box-shadow: inset 3px 0 var(--blue);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.project-rule-code {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 4px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 700;
}

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

.project-rule-name strong {
  font-size: 12px;
}

.project-rule-name span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.project-rule-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
}

.project-rule-sites > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 3px;
  background: var(--surface-2);
}

.project-rule-sites b,
.project-rule-sites small {
  font-size: 9px;
}

.project-rule-sites small {
  color: var(--muted);
}

.archive-photo-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0 -20px 10px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(205, 211, 219, 0.78);
  background: rgba(246, 248, 250, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  backdrop-filter: blur(16px) saturate(125%);
}

.archive-photo-head .photo-filter-strip {
  flex: 1 1 auto;
}

.archive-tab-summary {
  display: grid;
  width: min(360px, 100%);
  gap: 8px;
  margin-bottom: 10px;
}

.archive-tab-summary span {
  color: var(--muted);
  font-size: 10px;
}

.archive-tab-summary > div strong,
.archive-tab-summary > div span {
  display: block;
}

.archive-tab-summary > div strong {
  margin-top: 4px;
  font-size: 17px;
}

.archive-tab-summary .progress-inline {
  width: 100%;
}

.site-name-button {
  display: block;
  max-width: 260px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 620;
  text-align: left;
}

.site-name-button:hover {
  text-decoration: underline;
}

.site-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumb button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.site-detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.site-detail-title h1 {
  margin: 0;
  font-size: 21px;
}

.project-status-action {
  min-height: 32px;
  padding: 0 10px;
  border-color: #a9c3ef;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.project-status-action:hover {
  border-color: #7da5e8;
  background: #dfeaff;
  color: #165bd9;
}

.site-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 18px;
  min-height: 44px;
  align-items: flex-end;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tabs button {
  position: relative;
  min-height: 43px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.tabs button.active {
  color: var(--blue);
  font-weight: 750;
}

.tabs button.active::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--blue);
  content: "";
}

.site-detail-body {
  padding: 18px 20px 34px;
}

.site-detail-body.photo-archive-body {
  padding-top: 0;
}

.problem-record-list {
  display: grid;
  gap: 10px;
}

.problem-record-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.problem-record-toolbar > div {
  display: grid;
  gap: 3px;
}

.problem-record-toolbar strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.problem-record-toolbar span {
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.problem-record {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(320px, 1.2fr) 150px;
  gap: 18px;
  align-items: stretch;
  padding: 15px 16px;
}

.problem-record-main,
.problem-reply-history,
.problem-record-action {
  min-width: 0;
}

.problem-record-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.problem-record-main > strong {
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 19px;
}

.problem-record-main > span:last-child {
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.problem-record-labels,
.problem-reply-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.problem-reply-history {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.problem-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.problem-reply-head b {
  color: var(--ink);
  font-size: 11px;
}

.problem-reply-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.problem-reply-item > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.problem-reply-item strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 550;
  line-height: 18px;
  text-overflow: ellipsis;
}

.problem-reply-item span {
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.problem-reply-evidence {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-reply-evidence:hover {
  text-decoration: underline;
}

.problem-reply-evidence svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.problem-reply-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 11px;
}

.problem-record-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.problem-record-action .button {
  white-space: nowrap;
}

.problem-record-action .inline-actions {
  flex-wrap: nowrap;
}

.problem-record-action .icon-button.danger {
  color: var(--red);
}

.problem-readonly {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.problem-readonly svg {
  width: 12px;
  height: 12px;
}

.problem-reply-context {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.problem-reply-context strong {
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 19px;
}

.problem-reply-context > span,
.problem-reply-context > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.problem-reply-context > small {
  padding-top: 5px;
  border-top: 1px solid var(--line);
}

.problem-reply-context.is-ai-screening > span {
  white-space: pre-line;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.manual-issue-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 11px;
  border: 1px solid #cbd8ea;
  border-radius: 5px;
  background: #f3f7fc;
  color: #405672;
  font-size: 11px;
  line-height: 17px;
}

.manual-issue-notice svg {
  width: 15px;
  min-width: 15px;
  height: 15px;
  margin-top: 1px;
}

.chain-lanes {
  display: grid;
  gap: 10px;
}

.chain-lane {
  display: grid;
  min-height: 94px;
  grid-template-columns: 150px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.chain-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.chain-label strong {
  font-size: 13px;
}

.chain-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.chain-nodes {
  display: flex;
  overflow-x: auto;
  align-items: center;
  padding: 12px 14px;
}

.chain-node {
  position: relative;
  min-width: 108px;
  padding: 0 18px 0 0;
}

.chain-node::after {
  position: absolute;
  top: 9px;
  right: 4px;
  left: 24px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.chain-node:last-child::after {
  display: none;
}

.node-dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.chain-node.done .node-dot {
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.chain-node.current .node-dot {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.chain-node b,
.chain-node span {
  display: block;
  max-width: 100px;
}

.chain-node b {
  margin-top: 7px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-node span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

/* Materials and settings */
.summary-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.summary-band-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.summary-band-item strong {
  font-size: 17px;
}

.summary-band-item span {
  color: var(--muted);
  font-size: 11px;
}

.rule-governance-warning {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #efc6c2;
  border-left: 4px solid var(--red);
  border-radius: 5px;
  background: #fff7f6;
  color: #73312d;
}

.rule-governance-warning svg,
.rule-edit-danger svg {
  width: 19px;
  height: 19px;
}

.rule-governance-warning strong,
.rule-governance-warning span,
.rule-edit-danger strong,
.rule-edit-danger span {
  display: block;
}

.rule-governance-warning strong,
.rule-edit-danger strong {
  font-size: 12px;
}

.rule-governance-warning span,
.rule-edit-danger span {
  margin-top: 3px;
  font-size: 10px;
  line-height: 17px;
}

.rule-project-scope {
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(260px, 0.8fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.rule-project-scope label,
.rule-profile-summary span,
.rule-profile-summary small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.rule-project-scope label {
  margin-bottom: 5px;
}

.rule-profile-summary strong {
  display: block;
  margin: 4px 0;
  font-size: 13px;
}

.rule-library,
.legacy-gates {
  margin-bottom: 14px;
}

.process-rule-list {
  display: grid;
}

.process-rule-row {
  display: grid;
  min-height: 132px;
  grid-template-columns: 56px minmax(0, 1fr) 150px;
  gap: 12px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.process-rule-row.disabled {
  background: #fafbfc;
}

.process-rule-code strong,
.process-rule-code span {
  display: block;
}

.process-rule-code strong {
  color: var(--violet);
  font-size: 13px;
}

.process-rule-code span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.process-rule-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.process-rule-title strong {
  font-size: 13px;
}

.process-rule-title span,
.process-rule-content > p,
.process-rule-content li small,
.process-rule-meta > span:not(.badge) {
  color: var(--muted);
  font-size: 9px;
}

.process-rule-content > p {
  margin: 4px 0 9px;
}

.process-rule-content ol {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin: 0;
  padding-left: 19px;
}

.process-rule-content li {
  min-width: 190px;
  max-width: 360px;
  color: var(--ink);
  font-size: 10px;
  line-height: 16px;
}

.process-rule-content li small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-rule-meta {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
}

.danger-quiet {
  border-color: #e6b9b5;
  color: var(--red);
}

.rule-edit-danger {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #efc6c2;
  border-radius: 4px;
  background: #fff7f6;
  color: #73312d;
}

.rule-lines {
  min-height: 112px;
  font: 11px/18px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rule-confirm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  font-size: 11px;
}

.rule-confirm-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
}

.rule-admin-auth {
  min-width: 0;
  margin: 0 0 14px;
  padding: 10px 12px 12px;
  border: 1px solid #d5b46f;
  border-radius: 5px;
  background: #fffbf2;
}

.rule-admin-auth.full {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.rule-admin-auth legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 5px;
  color: #765019;
  font-size: 11px;
  font-weight: 700;
}

.rule-admin-auth legend svg {
  width: 14px;
  height: 14px;
}

.rule-admin-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rule-admin-auth > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.rule-admin-auth[hidden] {
  display: none;
}

.project-type-pending-notice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e1b96c;
  background: #fffaf0;
  color: #66430f;
}

.project-type-pending-notice > svg {
  width: 20px;
  height: 20px;
  color: #b56c00;
}

.project-type-pending-notice div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-type-pending-notice strong {
  font-size: 13px;
}

.project-type-pending-notice span {
  color: #765827;
  font-size: 11px;
  line-height: 1.5;
}

.project-type-pending-notice {
  padding: 9px 12px;
  border-width: 0 0 1px;
}

.audit-project-tab.type-pending {
  box-shadow: inset 3px 0 #d48400;
}

.audit-project-tab .project-type-pending-label {
  color: #9a5700;
  font-weight: 750;
}

@media (max-width: 720px) {
  .project-type-pending-notice {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .project-type-pending-notice .button {
    grid-column: 2;
    justify-self: start;
  }
}

.after-sales-insights {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 14px 16px 18px;
}
.after-sales-insight-page {
  min-width: 0;
}
.after-sales-insight-page-head {
  align-items: center;
}
.after-sales-insight-page-head .head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.after-sales-insight-filterbar {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(220px, 1.1fr) minmax(240px, 1.2fr) minmax(150px, auto);
  align-items: end;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
}
.after-sales-insight-filter {
  display: grid;
  min-width: 0;
  gap: 5px;
}
.after-sales-insight-filter > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.after-sales-insight-filter .select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  font-size: 11px;
}
.after-sales-insight-filter-hint {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}
.after-sales-insight-detail-card {
  margin-top: 0;
}
.after-sales-insight-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.after-sales-insight-summary > div {
  display: grid;
  min-width: 0;
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 3px 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.after-sales-insight-summary span,
.after-sales-insight-summary small { color: var(--muted); font-size: 10px; }
.after-sales-insight-summary strong { grid-column: 2; grid-row: 1 / 3; font-size: 22px; font-variant-numeric: tabular-nums; }
.after-sales-insight-summary .warning strong { color: var(--orange); }
.after-sales-insight-summary .danger strong { color: var(--red); }
.after-sales-insight-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(250px, .8fr) minmax(250px, .9fr); gap: 12px; }
.after-sales-insight-card,
.after-sales-insight-table-card { min-width: 0; overflow: hidden; }
.after-sales-insight-card > header,
.after-sales-insight-table-card > header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.after-sales-insight-card > header > div:first-child,
.after-sales-insight-table-card > header > div:first-child { min-width: 0; display: grid; gap: 2px; }
.after-sales-insight-card h2,
.after-sales-insight-table-card h2 { margin: 0; font-size: 13px; }
.after-sales-insight-card p,
.after-sales-insight-table-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 15px; }
.after-sales-insight-rank-list { display: grid; gap: 9px; padding: 4px 16px 16px; }
.after-sales-insight-rank-row { display: grid; grid-template-columns: 148px minmax(0, 1fr) 34px; align-items: center; gap: 9px; }
.after-sales-insight-rank-row > div:first-child { min-width: 0; display: grid; gap: 2px; }
.after-sales-insight-rank-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.after-sales-insight-rank-row span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-insight-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--soft); }
.after-sales-insight-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3578c7, #41b8a2); }
.after-sales-insight-rank-row > b { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.after-sales-insight-service-list { display: grid; gap: 1px; padding: 2px 16px 14px; }
.after-sales-insight-service-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px 72px; align-items: center; gap: 8px; min-height: 31px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.after-sales-insight-service-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.after-sales-insight-service-row b { text-align: right; font-size: 12px; }
.after-sales-insight-service-row small { color: var(--muted); text-align: right; font-size: 9px; }
.after-sales-insight-trend-list { display: grid; gap: 7px; padding: 4px 16px 16px; }
.after-sales-insight-trend-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 28px 28px; align-items: center; gap: 7px; }
.after-sales-insight-trend-row span { color: var(--muted); font-size: 10px; }
.after-sales-insight-trend-row i { display: block; height: 8px; border-radius: 99px; background: #3b82c4; }
.after-sales-insight-trend-row b,
.after-sales-insight-trend-row em { font-size: 10px; font-style: normal; text-align: right; }
.after-sales-insight-trend-row em { color: var(--green); }
.after-sales-insight-legend { display: flex; gap: 8px; color: var(--muted); font-size: 9px; }
.after-sales-insight-legend span::before { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 2px; background: #3b82c4; content: ""; }
.after-sales-insight-legend span:last-child::before { background: var(--green); }
.after-sales-insight-table-wrap { overflow: auto; }
.after-sales-insight-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.after-sales-insight-table th,
.after-sales-insight-table td { padding: 9px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.after-sales-insight-table th { color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.after-sales-insight-table td:first-child { min-width: 150px; }
.after-sales-insight-table td strong,
.after-sales-insight-table td small { display: block; }
.after-sales-insight-table td small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.after-sales-insight-table td.attention { color: var(--orange); font-weight: 700; }
.after-sales-insight-table td[title] { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-insight-project-link { display: grid; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.after-sales-insight-project-link:hover strong { color: var(--blue); text-decoration: underline; }
.after-sales-insight-taxonomy { display: grid; gap: 8px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.after-sales-insight-taxonomy strong { font-size: 11px; }
.after-sales-insight-taxonomy > div { display: flex; flex-wrap: wrap; gap: 5px; }
.after-sales-insight-taxonomy span { padding: 4px 7px; border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line)); border-radius: 99px; color: var(--blue); font-size: 10px; }
.after-sales-insight-taxonomy small { color: var(--muted); font-size: 10px; }
.after-sales-insight-empty { margin: 14px 16px; min-height: 320px; }

.after-sales-rules-page {
  min-width: 0;
}
.after-sales-rules-head .page-head-copy p {
  max-width: 780px;
}
.after-sales-rule-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.after-sales-rule-summary > div {
  display: grid;
  min-height: 62px;
  align-content: center;
  gap: 3px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.after-sales-rule-summary span { color: var(--muted); font-size: 11px; line-height: 16px; }
.after-sales-rule-summary strong { font-size: 19px; line-height: 23px; font-variant-numeric: tabular-nums; }
.after-sales-rule-order-card,
.after-sales-rule-group,
.after-sales-rule-filterbar,
.after-sales-rule-notes { min-width: 0; overflow: hidden; }
.after-sales-rule-order-card { margin-bottom: 12px; }
.after-sales-rule-order-card > header,
.after-sales-rule-group > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px 10px;
}
.after-sales-rule-order-card h2,
.after-sales-rule-group h2 { margin: 0; font-size: 14px; line-height: 20px; }
.after-sales-rule-order-card header p,
.after-sales-rule-group header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 17px; }
.after-sales-rule-order-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 8px;
  padding: 0 15px 14px;
}
.after-sales-rule-order {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}
.after-sales-rule-order > b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  color: var(--blue);
  font-size: 10px;
}
.after-sales-rule-order div { display: grid; min-width: 0; gap: 2px; }
.after-sales-rule-order strong { font-size: 11px; line-height: 16px; }
.after-sales-rule-order span { color: var(--muted); font-size: 10px; line-height: 16px; overflow-wrap: anywhere; }
.after-sales-rule-filterbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px minmax(160px, .8fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.after-sales-rule-search {
  display: flex;
  min-width: 0;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}
.after-sales-rule-search:focus-within { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent); }
.after-sales-rule-search svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--muted); }
.after-sales-rule-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.after-sales-rule-filter { display: grid; min-width: 0; gap: 4px; }
.after-sales-rule-filter > span { color: var(--muted); font-size: 10px; }
.after-sales-rule-filter .select { width: 100%; height: 34px; font-size: 11px; }
.after-sales-rule-filter-hint { color: var(--muted); font-size: 11px; line-height: 17px; }
.after-sales-rule-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.after-sales-rule-group > header { border-bottom: 1px solid var(--line); }
.after-sales-rule-list { max-height: 430px; overflow: auto; }
.after-sales-rule-item { border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); }
.after-sales-rule-item:last-child { border-bottom: 0; }
.after-sales-rule-item > summary {
  display: grid;
  min-height: 56px;
  grid-template-columns: minmax(76px, max-content) minmax(0, 1fr) 42px 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  cursor: pointer;
  list-style: none;
}
.after-sales-rule-item > summary::-webkit-details-marker { display: none; }
.after-sales-rule-item > summary > svg { width: 15px; height: 15px; color: var(--muted); transition: transform 160ms ease; }
.after-sales-rule-item[open] > summary > svg { transform: rotate(180deg); }
.after-sales-rule-index {
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  overflow-wrap: anywhere;
}
.after-sales-rule-title { display: grid; min-width: 0; gap: 2px; }
.after-sales-rule-title strong { color: var(--ink); font-size: 12px; line-height: 17px; overflow-wrap: anywhere; }
.after-sales-rule-title small { color: var(--muted); font-size: 10px; line-height: 16px; overflow-wrap: anywhere; }
.after-sales-rule-meta { color: var(--blue); font-size: 10px; font-style: normal; line-height: 15px; overflow-wrap: anywhere; }
.after-sales-rule-count { color: var(--muted); font-size: 10px; font-weight: 650; text-align: right; white-space: nowrap; }
.after-sales-rule-body { display: grid; gap: 9px; padding: 10px 13px 13px; background: color-mix(in srgb, var(--blue) 2%, var(--surface)); }
.after-sales-rule-sub { min-width: 0; color: var(--muted); font-size: 10px; line-height: 16px; }
.after-sales-rule-sub > b { color: var(--ink); font-size: 10px; font-weight: 650; line-height: 16px; white-space: nowrap; }
.after-sales-rule-terms { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: start; gap: 7px; }
.after-sales-rule-terms > div { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.after-sales-rule-terms span { padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line)); border-radius: 3px; background: var(--surface); color: var(--blue); overflow-wrap: anywhere; }
.after-sales-rule-detail { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: start; gap: 7px; }
.after-sales-rule-detail > div { display: grid; min-width: 0; gap: 4px; }
.after-sales-rule-detail span { display: block; padding-left: 9px; color: var(--ink); line-height: 17px; overflow-wrap: anywhere; }
.after-sales-rule-detail span::before { float: left; margin-left: -9px; color: var(--muted); content: "·"; }
.after-sales-rule-sub.muted { display: block; padding-left: 59px; line-height: 17px; }
.after-sales-rule-empty { min-height: 260px; place-items: center; align-content: center; display: grid; }
.after-sales-rule-notes { display: grid; gap: 6px; margin-top: 12px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line)); border-radius: 7px; background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.after-sales-rule-notes strong { font-size: 12px; line-height: 18px; }
.after-sales-rule-notes span { display: flex; align-items: flex-start; gap: 7px; color: var(--muted); font-size: 11px; line-height: 17px; }
.after-sales-rule-notes svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--green); }

@media (max-width: 1100px) {
  .after-sales-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-insight-domain { grid-column: 1 / -1; }
  .after-sales-insight-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .after-sales-rule-order-list { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .after-sales-rule-groups { grid-template-columns: 1fr; }
}

@media (max-width: 1280px) {
  .after-sales-rule-item > summary {
    grid-template-columns: minmax(68px, 84px) minmax(0, 1fr) 40px 15px;
    gap: 8px;
  }
}

@media (max-width: 720px) {
  .after-sales-insight-page-head {
    align-items: flex-start;
  }
  .after-sales-insight-page-head .head-actions {
    justify-content: flex-start;
  }
  .after-sales-insight-filterbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .after-sales-insight-filter-hint {
    grid-column: 1 / -1;
  }
  .after-sales-insights { padding: 10px; }
  .after-sales-insight-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-insight-grid { grid-template-columns: 1fr; }
  .after-sales-insight-domain { grid-column: auto; }
  .after-sales-rule-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-rule-order-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-rule-filterbar { grid-template-columns: 1fr 150px; }
  .after-sales-rule-filter-hint { grid-column: 1 / -1; }
  .after-sales-insight-rank-row { grid-template-columns: 122px minmax(0, 1fr) 28px; }
  .after-sales-insight-table th,
  .after-sales-insight-table td { padding-inline: 9px; }
}

@media (max-width: 480px) {
  .after-sales-insight-filterbar {
    grid-template-columns: 1fr;
  }
  .after-sales-insight-filter-hint {
    grid-column: auto;
  }
  .after-sales-rule-summary { grid-template-columns: 1fr 1fr; }
  .after-sales-rule-order-list,
  .after-sales-rule-filterbar { grid-template-columns: 1fr; }
  .after-sales-rule-filter-hint { grid-column: auto; }
  .after-sales-rule-item > summary {
    grid-template-columns: minmax(60px, 76px) minmax(0, 1fr) 38px 15px;
    padding-inline: 10px;
  }
  .after-sales-rule-title small,
  .after-sales-rule-meta { white-space: normal; }
  .after-sales-rule-terms,
  .after-sales-rule-detail { grid-template-columns: 1fr; gap: 3px; }
  .after-sales-rule-sub.muted { padding-left: 0; }
}

@media (max-width: 767px) {
  .followup-risk-overview {
    padding: 14px 12px 12px;
  }

  .followup-risk-head {
    align-items: flex-start;
  }

  .followup-risk-legend {
    gap: 9px;
  }

  .followup-risk-summary > div {
    display: grid;
    min-height: 58px;
    gap: 2px;
    padding: 8px 9px;
  }

  .followup-risk-summary strong {
    font-size: 19px;
  }

  .followup-risk-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 10px 0;
  }

  .followup-risk-project {
    grid-column: 1;
  }

  .followup-risk-silence {
    grid-column: 2;
    grid-row: 1;
  }

  .followup-risk-plot {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .followup-risk-project strong {
    white-space: normal;
  }
}

.rule-backup-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--line);
}

.rule-backup-summary > div {
  min-width: 0;
  padding: 10px 11px;
  background: var(--surface-2);
}

.rule-backup-summary span,
.rule-backup-summary strong {
  display: block;
}

.rule-backup-summary span {
  color: var(--muted);
  font-size: 10px;
}

.rule-backup-summary strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-config-notice {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
}

.rule-config-notice.warning {
  align-items: flex-start;
  border-color: #efc6c2;
  border-left: 4px solid var(--red);
  background: #fff7f6;
  color: #73312d;
}

.rule-config-notice.warning svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.rule-config-notice.warning strong,
.rule-config-notice.warning small {
  display: block;
}

.rule-config-notice.warning small {
  margin-top: 2px;
  font-size: 9px;
  line-height: 15px;
}

.project-rule-reason-panel {
  margin-top: 12px;
  padding: 11px 12px;
  scroll-margin-top: 12px;
  border: 1px solid #b9cee8;
  border-left: 4px solid var(--blue);
  border-radius: 5px;
  background: #f5f9ff;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.project-rule-reason-panel.type-change {
  border-color: #e2b15f;
  border-left-color: var(--amber);
  background: #fffaf0;
  box-shadow: 0 0 0 2px rgba(190, 126, 24, 0.08);
}

.project-rule-reason-panel.invalid {
  border-color: var(--red);
  border-left-color: var(--red);
  background: #fff5f4;
  box-shadow: 0 0 0 3px rgba(190, 55, 48, 0.12);
}

.project-rule-reason-panel label small {
  color: #8b5a10;
  font-weight: 650;
}

.project-rule-reason-panel .textarea {
  min-height: 76px;
  resize: vertical;
}

.project-rule-reason-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
}

.project-rule-reason-panel .form-message {
  margin-bottom: 0;
  font-weight: 600;
}

.sensor-type-panel {
  margin-top: 12px;
  padding: 11px 12px;
  scroll-margin: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 5px;
  background: var(--surface-2);
}

.sensor-type-panel[hidden] {
  display: none;
}

.sensor-type-panel.invalid {
  border-color: var(--red);
  border-left-color: var(--red);
  background: #fff5f4;
  box-shadow: 0 0 0 3px rgba(190, 55, 48, 0.12);
}

.sensor-type-head,
.sensor-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sensor-type-head strong,
.sensor-type-head small,
.sensor-type-row strong,
.sensor-type-row small {
  display: block;
}

.sensor-type-head strong,
.sensor-type-row strong {
  font-size: 11px;
}

.sensor-type-head small,
.sensor-type-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 15px;
}

.required-mark {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.sensor-type-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.sensor-type-row {
  min-height: 44px;
  padding: 5px 7px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.sensor-type-row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sensor-type-row.invalid {
  border-color: var(--red);
}

.sensor-type-options {
  display: grid;
  width: 142px;
  flex: 0 0 142px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.sensor-type-options label {
  cursor: pointer;
}

.sensor-type-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sensor-type-options span {
  display: grid;
  min-height: 32px;
  place-items: center;
  border-radius: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.sensor-type-options input:checked + span {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(33, 94, 164, 0.22);
}

.sensor-type-options input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--blue) 45%, white);
  outline-offset: 1px;
}

.sensor-type-panel .form-message {
  margin: 7px 0 0;
  font-weight: 650;
}

.sensor-type-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.project-rule-config-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.project-rule-config-row {
  display: grid;
  min-height: 52px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.project-rule-config-row > input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.project-rule-config-row strong,
.project-rule-config-row small {
  display: block;
}

.project-rule-config-row strong {
  font-size: 11px;
}

.project-rule-config-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.rule-list {
  display: grid;
}

.rule-row {
  display: grid;
  min-height: 68px;
  grid-template-columns: 44px minmax(140px, 0.6fr) minmax(260px, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #e9ecf0;
}

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

.rule-code {
  display: grid;
  width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 4px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  font-weight: 700;
}

.rule-main strong,
.rule-main span {
  display: block;
}

.rule-main strong {
  font-size: 12px;
}

.rule-main span,
.rule-required {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.engine-events-panel {
  padding: 14px;
}

.event-list {
  display: grid;
  max-height: clamp(320px, calc(100vh - 330px), 680px);
  margin-top: 14px;
  padding-right: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (max-width: 767px) {
  .event-list {
    max-height: 52dvh;
  }
  .event-change {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .event-change-arrow {
    margin-left: 8px;
    transform: rotate(90deg);
  }
}

.event-row {
  position: relative;
  min-height: 56px;
  padding: 8px 0 8px 22px;
}

.event-row::before {
  position: absolute;
  top: 15px;
  left: 3px;
  z-index: 1;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 1px #9bcbd0;
  content: "";
}

.event-row::after {
  position: absolute;
  top: 23px;
  bottom: -9px;
  left: 6px;
  width: 1px;
  background: var(--line);
  content: "";
}

.event-row:last-child::after {
  display: none;
}

.event-row strong,
.event-row span {
  display: block;
}

.event-row strong {
  font-size: 11px;
  line-height: 17px;
}

.event-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.event-row > span {
  margin-top: 7px;
}

.event-source-context {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  margin-top: 7px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  white-space: nowrap;
}

.event-source-context > div {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  overflow: hidden;
}

.event-source-context > div + div {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.event-source-context small,
.event-source-context b {
  display: inline;
}

.event-source-context small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  line-height: 13px;
}

.event-source-context b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 10px;
  font-weight: 520;
  line-height: 15px;
}

.event-change {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}

.event-change-side {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.event-change-side.after {
  border-color: #b8dcca;
  background: var(--green-soft);
}

.event-change-side small,
.event-change-side b {
  display: block;
}

.event-change-side small {
  color: var(--muted);
  font-size: 9px;
  line-height: 13px;
}

.event-change-side.after small {
  color: var(--green);
}

.event-change-side b {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  font-weight: 620;
  line-height: 16px;
}

.event-change-arrow {
  display: grid;
  width: 22px;
  height: 22px;
  margin: 0;
  place-items: center;
  color: var(--blue);
}

.event-change-arrow svg {
  width: 15px;
  height: 15px;
}
/* Import */
.import-management {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 28px;
  border: 1px dashed #aeb7c3;
  border-radius: 6px;
  background: var(--surface);
  text-align: center;
  transition: border-color 130ms ease, background-color 130ms ease;
}

.drop-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.drop-zone.uploading {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.drop-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.drop-symbol svg {
  width: 22px;
  height: 22px;
}

.drop-zone.uploading .drop-symbol {
  width: 58px;
  height: 58px;
  box-shadow: 0 0 0 8px rgba(46, 99, 191, 0.08);
}

.drop-zone h2 {
  margin: 0;
  font-size: 15px;
}

.drop-zone p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 19px;
}

.import-mode {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.import-mode label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.import-mode input {
  position: static;
  width: 14px;
  height: 14px;
  opacity: 1;
  accent-color: var(--blue);
}

.pipeline {
  display: grid;
  gap: 0;
  padding: 12px 14px;
}

.pipeline-step {
  display: grid;
  min-height: 52px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #edf0f2;
}

.pipeline-step:last-child {
  border-bottom: 0;
}

.pipeline-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.pipeline-step.done .pipeline-icon {
  background: var(--green-soft);
  color: var(--green);
}

.pipeline-step.failed .pipeline-icon {
  background: var(--red-soft);
  color: var(--red);
}

.pipeline-step.processing .pipeline-icon {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(46, 99, 191, 0.08);
}

.pipeline-icon svg {
  width: 14px;
  height: 14px;
}

.pipeline-copy strong,
.pipeline-copy span {
  display: block;
}

.pipeline-copy strong {
  font-size: 12px;
}

.pipeline-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.pipeline-value {
  color: var(--muted);
  font-size: 11px;
}

.import-result-banner {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #b8ddc8;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  line-height: 19px;
}

.import-result-banner.visible {
  display: block;
}

.import-history {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.import-issues {
  overflow: hidden;
}

.import-issues-summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
  transition: background-color 140ms ease;
}

.import-issues-summary::-webkit-details-marker {
  display: none;
}

.import-issues-summary:hover {
  background: var(--surface-2);
}

.import-issues-summary h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 660;
}

.import-issues-summary p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.import-issues-summary-actions,
.import-issues-toggle {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.import-issues-toggle {
  color: var(--muted);
  font-size: 11px;
}

.import-issues-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.import-issues .when-open {
  display: none;
}

.import-issues[open] .when-closed {
  display: none;
}

.import-issues[open] .when-open {
  display: inline;
}

.import-issues[open] .import-issues-toggle svg {
  transform: rotate(180deg);
}

.import-issues-panel {
  border-top: 1px solid var(--line);
}

.import-issue-list {
  max-height: min(640px, 70dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.import-issue {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.import-issue:last-child {
  border-bottom: 0;
}

.import-issue.resolved {
  background: var(--surface-2);
}

.import-issue-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.import-issue.resolved .import-issue-mark {
  background: var(--green-soft);
  color: var(--green);
}

.import-issue-mark svg {
  width: 15px;
  height: 15px;
}

.import-issue-body {
  min-width: 0;
}

.import-issue-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.import-issue-title > div {
  min-width: 0;
}

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

.import-issue-title strong {
  font-size: 13px;
  line-height: 19px;
}

.import-issue-title > div > span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-issue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.import-issue-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.import-issue-meta svg {
  width: 12px;
  height: 12px;
}

.import-issue-content {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 18px;
}

.import-issue-content span {
  color: var(--muted);
}

.import-issue-sources {
  display: grid;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.import-issue-source {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
}

.import-issue-source:first-child {
  border-top: 0;
}

.import-issue-source.emphasized {
  background: rgba(46, 99, 191, 0.045);
}

.import-issue-source-copy {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
}

.import-issue-source-copy > span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.import-issue-source.emphasized .import-issue-source-copy > span {
  background: var(--blue-soft);
  color: var(--blue);
}

.import-issue-source-copy svg {
  width: 13px;
  height: 13px;
}

.import-issue-source-copy > div {
  min-width: 0;
}

.import-issue-source-copy strong,
.import-issue-source-copy small,
.import-issue-source-copy a,
.import-issue-source-copy em {
  display: block;
}

.import-issue-source-copy strong {
  font-size: 11px;
  line-height: 16px;
}

.import-issue-source-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.import-issue-source-copy a,
.import-issue-source-copy em {
  max-width: min(520px, 48vw);
  margin-top: 3px;
  overflow: hidden;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-style: normal;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-issue-source-copy em {
  color: var(--muted);
  font-family: inherit;
}

.import-issue-source-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.import-issue-explanation {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 9px 10px;
  border-left: 3px solid #df625b;
  background: #fff7f6;
}

.import-issue-explanation p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.import-issue-explanation b {
  color: var(--ink);
}

.import-issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.import-issue-actions .button svg[data-lucide="loader-circle"],
.modal-foot .button svg[data-lucide="loader-circle"] {
  animation: loading-spin 800ms linear infinite;
}

.import-issue-resolution {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 9px;
  color: var(--green);
  font-size: 11px;
}

.import-issue-resolution span {
  color: var(--muted);
}

.import-issue-technical {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.import-issue-technical summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
}

.import-issue-technical span,
.import-issue-technical code {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  line-height: 16px;
}

.import-issue-technical code {
  padding: 7px 8px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: pre-wrap;
}

.import-issue-modal-summary {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.import-issue-modal-summary strong {
  font-size: 12px;
}

.import-issue-modal-summary span,
.import-issue-modal-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.import-resolution-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid #bfd0f4;
  border-radius: 6px;
  background: var(--blue-soft);
}

.import-resolution-warning.danger {
  border-color: #e5b7b3;
  background: #fff7f6;
}

.import-resolution-warning > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--blue);
}

.import-resolution-warning.danger > svg {
  color: var(--red);
}

.import-resolution-warning strong,
.import-resolution-warning p {
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 17px;
}

.import-resolution-warning p {
  margin-top: 3px;
  color: var(--muted);
}

.replacement-file {
  display: grid;
  min-height: 82px;
  place-items: center;
  padding: 14px;
  border: 1px dashed #aeb7c3;
  border-radius: 6px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
}

.replacement-file span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.replacement-file svg {
  width: 16px;
  height: 16px;
}

.replacement-file small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replacement-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.import-resolution-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 17px;
}

.import-resolution-confirm input,
.ignore-reason-options input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.ignore-reason-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.ignore-reason-options legend {
  grid-column: 1 / -1;
  margin-bottom: 1px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.ignore-reason-options label {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 11px;
  line-height: 16px;
}

.ignore-reason-options label:has(input:checked) {
  border-color: rgba(46, 99, 191, 0.5);
  background: var(--blue-soft);
}

.project-log-export-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-log-export-options legend {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.project-log-export-options label {
  display: grid;
  min-height: 58px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.project-log-export-options label:has(input:checked) {
  border-color: rgba(46, 99, 191, 0.5);
  background: var(--blue-soft);
}

.project-log-export-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.project-log-export-options span {
  display: grid;
  gap: 2px;
}

.project-log-export-options strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.project-log-export-options small {
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.project-archive-export-list {
  display: grid;
  gap: 14px;
}

.project-archive-export-section {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.project-archive-export-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.project-archive-export-title {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.project-archive-export-title > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
}

.project-archive-export-title > span svg {
  width: 16px;
  height: 16px;
}

.project-archive-export-title > div {
  display: grid;
  gap: 1px;
}

.project-archive-export-title strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.project-archive-export-title small {
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.project-export-subactions {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding-left: 37px;
}

.project-export-subaction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.project-export-subaction > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.project-export-subaction strong {
  color: var(--ink-strong);
  font-size: 11px;
}

.project-export-subaction small {
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.project-archive-export-section .project-log-export-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-archive-export-section .project-log-export-options legend {
  grid-column: 1 / -1;
}

.project-archive-export-section .project-log-export-options label {
  min-height: 52px;
  padding: 7px 9px;
}

.project-archive-export-section .project-report-export-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hidden-inspection-export-status {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(46, 99, 191, 0.28);
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.hidden-inspection-export-status[hidden] {
  display: none;
}

.hidden-inspection-export-status > svg,
[data-hidden-inspection-download][aria-busy="true"] svg,
[data-road-strength-download][aria-busy="true"] svg {
  width: 17px;
  height: 17px;
  animation: loading-spin 800ms linear infinite;
}

.hidden-inspection-export-status > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.hidden-inspection-export-status strong {
  color: var(--ink-strong);
  font-size: 11px;
}

.hidden-inspection-export-status small {
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

@media (max-width: 560px) {
  .project-archive-export-section .project-report-export-options {
    grid-template-columns: 1fr;
  }
}

.delete-import-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e5b7b3;
  border-radius: 6px;
  background: #fff7f6;
  color: var(--ink);
}

.delete-import-batch-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.delete-import-batch-summary span {
  color: var(--muted);
  font-size: 11px;
}

.delete-import-batch-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.delete-import-date-picker {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.delete-import-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.delete-import-date-head > div {
  min-width: 0;
}

.delete-import-date-head > div > strong,
.delete-import-date-head > div > small {
  display: block;
}

.delete-import-date-head > div > strong {
  color: var(--ink);
  font-size: 12px;
}

.delete-import-date-head > div > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.delete-import-date-toolbar {
  padding-top: 10px;
}

.delete-import-select-all,
.delete-import-date-option {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.delete-import-select-all {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.delete-import-date-head > strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.delete-import-date-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  max-height: 260px;
  padding-top: 10px;
  overflow-y: auto;
}

.delete-import-date-option {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.delete-import-date-option:has(input:checked) {
  border-color: rgba(35, 112, 94, 0.52);
  background: var(--green-soft);
  box-shadow: 0 0 0 2px rgba(35, 112, 94, 0.09);
}

.delete-import-date-option input,
.delete-import-select-all input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.delete-import-date-option span {
  min-width: 0;
}

.delete-import-date-option strong,
.delete-import-date-option small {
  display: block;
}

.delete-import-date-option strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-import-date-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.delete-import-date-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.delete-import-warning > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--red);
}

.delete-import-warning p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 19px;
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(13, 16, 20, 0.58);
  animation: fade-in 130ms ease;
}

.modal {
  width: min(580px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(12, 18, 25, 0.24);
  animation: rise-in 160ms ease;
}

.modal.wide {
  width: min(760px, 100%);
}

.review-change-confirm-overlay {
  z-index: 130;
}

.review-change-confirm {
  width: min(560px, 100%);
}

.review-change-warning {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}

.review-change-warning svg {
  width: 18px;
  height: 18px;
}

.review-change-confirm-body {
  display: grid;
  grid-template-columns: clamp(136px, 35vw, 184px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.review-change-confirm-body > img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #11161c;
}

.review-change-confirm-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.review-change-confirm-copy > strong,
.review-change-confirm-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-change-confirm-copy > strong {
  font-size: 13px;
}

.review-change-confirm-copy > span {
  color: var(--muted);
  font-size: 11px;
}

.review-change-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.review-change-status > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.review-change-reasons {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(197, 58, 50, 0.18);
  border-radius: 4px;
  background: var(--red-soft);
}

.review-change-reasons > strong {
  color: var(--red);
  font-size: 11px;
}

.review-change-reasons ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-change-reasons li {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink);
  font-size: 11px;
  line-height: 17px;
}

.review-change-reasons li svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--red);
}

.review-change-reasons > p {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(197, 58, 50, 0.14);
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.review-change-reasons > p b {
  color: var(--ink);
}

.review-change-confirm-body > p {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.modal-head,
.drawer-head {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.drawer-head h2 {
  margin: 0;
  font-size: 15px;
}

.modal-head p,
.drawer-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-body {
  padding: 16px;
}

.modal-foot {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.reject-reason-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.reject-reason-fieldset legend {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.reject-reason-fieldset legend small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.reject-reason-groups {
  display: grid;
  gap: 10px;
}

.reject-reason-group h3 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.reject-reason-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.reject-reason-option {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f8fa;
  color: var(--ink);
  font-size: 11px;
  font-weight: 550;
  line-height: 15px;
  cursor: pointer;
}

.reject-reason-option:hover {
  border-color: #c98a85;
  background: #fff6f5;
}

.reject-reason-option:has(input:checked) {
  border-color: #c65e58;
  background: var(--red-soft);
  color: #8f2f2a;
  box-shadow: inset 3px 0 0 #c65e58;
}

.reject-reason-option input[type="radio"] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 0;
  accent-color: var(--red);
}

.reject-reason-option span {
  min-width: 0;
}

.reject-other-note {
  width: 100%;
  min-width: 0;
  height: 26px;
  margin-left: 2px;
  padding: 3px 7px;
  border: 1px solid #d7a19d;
  border-radius: 3px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: text;
}

.reject-other-note:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(198, 94, 88, 0.14);
}

.viewer-reject-panel {
  display: flex;
  width: min(400px, 38vw);
  min-width: 340px;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(108, 49, 45, 0.2);
  background: rgba(250, 250, 251, 0.98);
  color: var(--ink);
  box-shadow: 14px 0 38px rgba(12, 18, 25, 0.14);
  animation: reject-panel-in 180ms ease-out;
  backdrop-filter: blur(24px) saturate(125%);
}

.viewer-reject-panel > form {
  display: flex;
  width: 100%;
  min-height: 0;
  flex-direction: column;
}

.viewer-reject-head {
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.viewer-reject-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.viewer-reject-head h2,
.viewer-reject-head p {
  margin: 0;
}

.viewer-reject-head h2 {
  font-size: 14px;
  line-height: 19px;
}

.viewer-reject-head p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.viewer-reject-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.viewer-reject-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.viewer-reject-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
}

.viewer-reject-foot {
  display: flex;
  min-height: 60px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: rgba(245, 246, 248, 0.94);
}

.viewer-reject-foot .button.danger {
  min-width: 142px;
}

.viewer-reject-foot .button.loading {
  cursor: progress;
  opacity: .68;
}

@keyframes reject-panel-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes reject-panel-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 16, 20, 0.38);
  animation: fade-in 130ms ease;
}

#overlay-root > .overlay-refresh,
#overlay-root > .overlay-refresh .photo-detail-workspace,
#overlay-root > .overlay-refresh .drawer,
#overlay-root > .overlay-refresh .modal {
  animation: none;
}

.drawer {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: min(480px, 100%);
  flex-direction: column;
  background: var(--surface);
  box-shadow: -18px 0 48px rgba(12, 18, 25, 0.18);
  animation: slide-in 180ms ease;
}

.rule-config-drawer > form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.drawer-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.drawer-foot {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.path-step-list {
  display: grid;
  margin-top: 12px;
}

.path-step-row {
  display: grid;
  min-height: 54px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #edf0f2;
}

.step-state-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
}

.path-step-row.done .step-state-icon {
  background: var(--green-soft);
  color: var(--green);
}

.path-step-row.missing .step-state-icon {
  background: var(--red-soft);
  color: var(--red);
}

.step-state-icon svg {
  width: 13px;
  height: 13px;
}

.path-step-copy strong,
.path-step-copy span {
  display: block;
}

.path-step-copy strong {
  font-size: 12px;
}

.path-step-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

#photo-quick-preview {
  position: fixed;
  z-index: 95;
  display: flex;
  width: min(800px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(20, 23, 28, 0.96);
  color: #f5f7f8;
  box-shadow: 0 24px 70px rgba(11, 16, 22, 0.34);
  pointer-events: none;
  backdrop-filter: blur(24px) saturate(135%);
  animation: quick-preview-in 100ms ease-out;
}

#photo-quick-preview[hidden] {
  display: none;
}

.photo-quick-preview-stage {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  place-items: center;
  overflow: hidden;
  background: #0d0f12;
}

.photo-quick-preview-stage img {
  display: block;
  width: 100%;
  max-height: min(64dvh, 620px);
  object-fit: contain;
}

.photo-quick-preview-meta {
  flex: 0 0 auto;
  padding: 12px 14px 13px;
  border-top: 1px solid #363b43;
  background: rgba(28, 32, 38, 0.98);
}

.photo-quick-preview-meta > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.photo-quick-preview-meta strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-quick-preview-meta time,
.photo-quick-preview-meta > div span,
.photo-quick-preview-meta small {
  color: #adb5bf;
  font-size: 11px;
}

.photo-quick-preview-meta > div span {
  padding: 3px 7px;
  border: 1px solid #4a515b;
  border-radius: 4px;
  color: #e5e9ed;
}

.photo-quick-preview-meta p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 18px;
}

.photo-quick-preview-meta p + p,
.photo-quick-preview-meta small {
  display: block;
  margin-top: 3px;
  color: #c0c6ce;
}

.photo-quick-preview-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-detail-overlay {
  z-index: 105;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(12, 15, 19, 0.3);
  backdrop-filter: blur(3px);
}

.photo-detail-workspace {
  position: relative;
  display: flex;
  width: min(1180px, calc(100vw - 64px));
  height: min(760px, calc(100dvh - 64px));
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(25, 28, 33, 0.98);
  box-shadow: 0 28px 80px rgba(8, 12, 17, 0.36);
  pointer-events: auto;
  animation: rise-in 180ms ease;
}

.photo-detail-workspace > .photo-evidence-panel,
.photo-detail-workspace > .viewer-reject-panel {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  width: min(400px, 36vw);
  min-width: 0;
  flex: 0 0 min(400px, 36vw);
  pointer-events: auto;
}

.photo-detail-workspace > .viewer-reject-panel {
  border-right: 0;
  border-left: 1px solid rgba(108, 49, 45, 0.2);
  box-shadow: -14px 0 38px rgba(12, 18, 25, 0.14);
}

.photo-evidence-panel {
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
  border-left: 1px solid #353a41;
  background: rgba(25, 28, 33, 0.97);
  color: #f5f7f8;
  pointer-events: auto;
  backdrop-filter: blur(26px) saturate(125%);
}

.photo-evidence-panel-head {
  display: flex;
  min-height: 62px;
  flex: 0 0 auto;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #353a41;
}

.photo-evidence-panel-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.photo-evidence-panel-head strong,
.photo-evidence-panel-head small {
  display: block;
}

.photo-evidence-panel-head strong { font-size: 14px; }
.photo-evidence-panel-head small { margin-top: 2px; color: #aeb5be; font-size: 10px; }

.photo-evidence-panel-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: rgba(54, 112, 83, 0.32);
  color: #8cdaad;
}

.photo-evidence-panel-icon svg { width: 17px; height: 17px; }

.photo-evidence-panel-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 11px 13px 16px;
}

.photo-detail-drawer {
  position: relative;
  display: flex;
  width: auto;
  min-width: 0;
  flex: 1 1 680px;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  background: rgba(25, 28, 33, 0.97);
  color: #f5f7f8;
  pointer-events: auto;
  backdrop-filter: blur(26px) saturate(125%);
}

.photo-detail-head {
  display: flex;
  min-height: 62px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #353a41;
}

.photo-detail-head > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 9px;
}

.photo-detail-head h2 {
  margin: 0;
  font-size: 15px;
}

.photo-detail-head span {
  color: #aeb5be;
  font-size: 11px;
}

.photo-position {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aeb5be;
  font-size: 11px;
}

.photo-position b {
  padding: 3px 7px;
  border: 1px solid #626a75;
  border-radius: 4px;
  color: #f1f3f5;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.photo-boundary-notice {
  display: flex;
  min-height: 62px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 9px 16px 9px 14px;
  border: 2px solid #d78a00;
  border-left: 6px solid #d44431;
  background: #ffdf7a;
  color: #2a1b03;
  box-shadow: 0 7px 20px rgba(114, 70, 0, 0.24), inset 0 0 0 1px rgba(255, 250, 222, 0.72);
  animation: boundary-notice-in 180ms ease-out;
}

.photo-boundary-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #3b2505;
  color: #ffe495;
  box-shadow: 0 4px 13px rgba(74, 44, 4, 0.34);
  animation: boundary-icon-pop 260ms ease-out;
}

.photo-boundary-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.7;
}

.photo-boundary-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: left;
}

.photo-boundary-copy strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 20px;
}

.photo-boundary-copy small {
  color: #4c3005;
  font-size: 12px;
  font-weight: 680;
  line-height: 17px;
}

.photo-boundary-notice.floating {
  position: absolute;
  top: 74px;
  left: 50%;
  z-index: 4;
  width: min(560px, calc(100% - 32px));
  min-height: 66px;
  border: 2px solid #f5b72e;
  border-left: 6px solid #e0523d;
  border-radius: 8px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.46), 0 0 0 5px rgba(255, 205, 84, 0.24);
  transform: translateX(-50%);
}

@keyframes boundary-notice-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes boundary-icon-pop {
  0% { transform: scale(.7); }
  65% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.photo-detail-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.photo-detail-tools .icon-button {
  border-color: #414750;
  background: #292d33;
  color: #f5f7f8;
}

.photo-detail-tools .icon-button:hover {
  background: #353a42;
}

.photo-detail-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.photo-detail-image {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 240px;
  flex: 1 1 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid #353a41;
  border-radius: 0;
  background: #0d0f12;
  touch-action: none;
}

.photo-detail-image.pan-enabled {
  cursor: grab;
}

.photo-detail-image.pan-enabled.dragging {
  cursor: grabbing;
}

.photo-detail-image-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(24, 27, 32, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px) saturate(125%);
}

.photo-detail-image-tools .icon-button {
  border-color: #444a53;
  background: #282d33;
  color: #f5f7f8;
}

.photo-detail-image-tools .icon-button:hover,
.photo-detail-image-tools .icon-button.active {
  border-color: #6f9ce7;
  background: #263e65;
  color: #e3edff;
}

.photo-detail-image-tools .icon-button.copying,
.viewer-tools .icon-button.copying {
  cursor: progress;
  opacity: .68;
}

.photo-detail-image-tools .icon-button.copied,
.viewer-tools .icon-button.copied {
  border-color: #60ad82;
  background: #214735;
  color: #dff6e8;
}

.photo-detail-image-tools .icon-button.failed,
.viewer-tools .icon-button.failed {
  border-color: #c76d68;
  background: #552d2b;
  color: #ffe7e4;
}

.photo-copy-control {
  position: relative;
  display: flex;
}

.photo-copy-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 8;
  width: 190px;
  padding: 5px;
  border: 1px solid rgba(151, 175, 205, 0.42);
  border-radius: 6px;
  background: rgba(20, 31, 44, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px) saturate(135%);
}

.photo-copy-menu[hidden] {
  display: none;
}

.photo-copy-menu button {
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #f5f8fb;
  text-align: left;
  cursor: pointer;
}

.photo-copy-menu button:hover,
.photo-copy-menu button:focus-visible {
  outline: none;
  background: rgba(64, 139, 218, 0.28);
}

.photo-copy-menu button:disabled {
  color: #8593a2;
  cursor: not-allowed;
  opacity: .68;
}

.photo-copy-menu svg {
  width: 17px;
  height: 17px;
  justify-self: center;
}

.photo-copy-menu span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.photo-copy-menu strong,
.photo-copy-menu small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-copy-menu strong {
  font-size: 12px;
  line-height: 17px;
}

.photo-copy-menu small {
  color: #aab7c4;
  font-size: 10px;
  line-height: 14px;
}

.photo-copy-feedback {
  position: absolute;
  top: 52px;
  right: 10px;
  z-index: 4;
  max-width: min(360px, calc(100% - 20px));
  padding: 7px 10px;
  border: 1px solid #434a53;
  border-radius: 5px;
  background: rgba(31, 35, 41, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  color: #f4f6f8;
  font-size: 11px;
  line-height: 16px;
  pointer-events: none;
  backdrop-filter: blur(14px) saturate(120%);
}

.photo-copy-feedback.success {
  border-color: rgba(96, 173, 130, 0.7);
}

.photo-copy-feedback.failed {
  border-color: rgba(199, 109, 104, 0.8);
}

.viewer-main > .photo-copy-feedback {
  top: 58px;
  right: 14px;
}

.photo-detail-statuses {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.photo-rule-edit {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid #5f6b7b;
  border-radius: 4px;
  background: rgba(55, 63, 74, 0.8);
  color: #e7edf6;
  font-size: 10px;
}

.photo-rule-edit:hover {
  border-color: #8cb4ef;
  background: #29466f;
}

.photo-rule-edit svg {
  width: 12px;
  height: 12px;
}

.photo-rule-mapping-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #4a586b;
  border-radius: 5px;
  background: rgba(38, 51, 68, 0.78);
}

.photo-rule-mapping-editor > div:first-child {
  display: grid;
  gap: 2px;
}

.photo-rule-mapping-editor > .photo-rule-mapping-intro.required {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(240, 112, 103, 0.62);
  border-radius: 4px;
  background: rgba(120, 38, 34, 0.28);
}

.photo-rule-mapping-intro.required > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #ff8f87;
}

.photo-rule-mapping-intro.required > span svg {
  width: 15px;
  height: 15px;
}

.photo-rule-mapping-intro > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.photo-rule-mapping-intro.required strong { color: #ff9b94; }
.photo-rule-mapping-intro.required small { color: #ffc2bd; }

.photo-rule-mapping-editor strong { font-size: 11px; }
.photo-rule-mapping-editor small { color: #b6c3d3; font-size: 10px; line-height: 15px; }
.photo-rule-mapping-combobox { position: relative; z-index: 2; }
.photo-rule-mapping-search { width: 100%; }
.photo-rule-mapping-options {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  display: grid;
  max-height: min(42dvh, 320px);
  grid-template-columns: 1fr;
  gap: 4px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #5f6b7b;
  border-radius: 5px;
  background: #242f3e;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .24);
}
.photo-rule-mapping-group {
  display: grid;
  gap: 2px;
}
.photo-rule-mapping-editor .photo-rule-mapping-group-title {
  display: block;
  padding: 4px 6px 2px;
  color: #9eb6d2;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
}
.photo-rule-mapping-option {
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 24px;
  overflow: hidden;
  padding: 4px 6px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #e7edf6;
  font-size: 10px;
  line-height: 16px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.photo-rule-mapping-option:hover,
.photo-rule-mapping-option:focus-visible { background: #29466f; color: #ffffff; outline: 0; }
.photo-rule-mapping-search-empty { color: #f0aaa5 !important; }
.photo-rule-mapping-actions { display: flex; justify-content: flex-end; gap: 6px; }
.photo-rule-mapping-editor .form-message { display: none; }
.photo-rule-mapping-editor .form-message.visible { display: block; }

.photo-rule-readiness {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #3b424b;
}

.photo-rule-readiness-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-rule-readiness-summary > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: rgba(90, 104, 121, 0.32);
}

.photo-rule-readiness-summary > span.complete { color: #82d19f; background: rgba(57, 113, 78, 0.34); }
.photo-rule-readiness-summary > span.missing { color: #f0c06c; background: rgba(117, 80, 25, 0.38); }
.photo-rule-readiness-summary svg { width: 15px; height: 15px; }
.photo-rule-readiness-summary div { display: grid; gap: 1px; }
.photo-rule-readiness-summary strong { font-size: 11px; }
.photo-rule-readiness-summary small { color: #b7bec8; font-size: 10px; }

.photo-rule-readiness details {
  border: 1px solid #3b424b;
  border-radius: 4px;
  background: rgba(31, 35, 41, 0.55);
}

.photo-rule-readiness summary {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  color: #e7ebef;
  font-size: 11px;
  list-style: none;
}

.photo-rule-readiness summary::-webkit-details-marker { display: none; }
.photo-rule-readiness summary b { font-size: 10px; font-weight: 650; }
.photo-rule-readiness summary b.complete { color: #83d2a0; }
.photo-rule-readiness summary b.missing { color: #f0c16f; }
.photo-rule-readiness ul { display: grid; gap: 1px; margin: 0; padding: 0 8px 7px; list-style: none; }
.photo-rule-readiness li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 0; border-top: 1px solid rgba(75, 82, 91, 0.55); }
.photo-rule-readiness li > span { color: #7f8b99; }
.photo-rule-readiness li.complete > span { color: #76c895; }
.photo-rule-readiness li.missing > span { color: #edb75d; }
.photo-rule-readiness li svg { width: 13px; height: 13px; }
.photo-rule-readiness li div { min-width: 0; display: grid; gap: 1px; }
.photo-rule-readiness li strong { overflow: hidden; color: #dce1e7; font-size: 10px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.photo-rule-readiness li small { color: #87919d; font-size: 9px; }
.photo-rule-readiness li b { color: #7e8a96; font-size: 9px; font-weight: 560; white-space: nowrap; }
.photo-rule-readiness li.complete b { color: #79c894; }
.photo-rule-readiness li.missing b { color: #edb75d; }
.photo-rule-empty { margin: 0; padding: 0 8px 8px; color: #89929d; font-size: 10px; }
.photo-rule-readiness.unmatched { display: block; }
.photo-rule-readiness.unmatched > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.photo-rule-readiness.unmatched span { grid-row: span 2; color: #f0c16f; }
.photo-rule-readiness.unmatched strong { font-size: 11px; }
.photo-rule-readiness.unmatched small { color: #aeb7c1; font-size: 10px; }

.photo-rule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  color: #929ca8;
  font-size: 9px;
}

.photo-rule-legend span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 2px;
  background: #626c77;
  content: "";
}

.photo-rule-legend .complete::before { background: #48b978; }
.photo-rule-legend .current::before { background: #4d91f7; }
.photo-rule-legend .overdue::before { background: #d9554d; }
.photo-rule-legend .not_due::before { background: #5f6873; }

.photo-rule-readiness-group {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  border: 1px solid #3b424b;
  border-radius: 4px;
  background: rgba(31, 35, 41, 0.55);
}

.photo-rule-readiness-group > header {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid #3b424b;
  color: #e7ebef;
  font-size: 11px;
}

.photo-rule-readiness-group > header b {
  color: #aeb7c1;
  font-size: 10px;
  font-weight: 650;
}

.photo-rule-readiness-group > header b.complete { color: #83d2a0; }
.photo-rule-readiness-group > header b.missing { color: #f0c16f; }
.photo-rule-readiness-group > ul { padding-bottom: 5px; }
.photo-rule-readiness li.current > span,
.photo-rule-readiness li.current > b { color: #83b8ff; }
.photo-rule-readiness li.overdue > span,
.photo-rule-readiness li.overdue > b { color: #f18d86; }
.photo-rule-readiness li.not_due > span,
.photo-rule-readiness li.not_due > b { color: #8c98a5; }
.photo-rule-readiness li.pending > span,
.photo-rule-readiness li.pending > b { color: #edc16f; }

.photo-detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  object-fit: contain;
}

.photo-detail-info {
  max-height: min(32dvh, 220px);
  flex: 0 1 auto;
  overflow: auto;
  padding: 9px 14px 11px;
}

.photo-detail-byline {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  color: #c9ced5;
  font-size: 12px;
  line-height: 18px;
}

.photo-detail-origin {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.photo-detail-byline .photo-detail-statuses {
  flex: 0 1 auto;
  gap: 4px;
}

.photo-detail-byline .photo-rule-edit {
  min-height: 22px;
  padding: 2px 7px;
}

.photo-detail-rejection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  margin-top: 7px;
  padding: 7px 9px;
  border-left: 3px solid #d45d56;
  border-radius: 3px;
  background: rgba(145, 48, 43, 0.2);
}

.photo-detail-rejection > span {
  color: #f0aaa5;
  font-size: 10px;
  line-height: 18px;
}

.photo-detail-rejection > strong {
  color: #fff0ef;
  font-size: 12px;
  line-height: 18px;
}

.photo-detail-rejection > small {
  grid-column: 2;
  color: #d9c3c1;
  font-size: 10px;
  line-height: 16px;
}

.photo-detail-rejection + .photo-detail-byline {
  margin-top: 7px;
}

.photo-detail-byline span,
.photo-detail-byline strong,
.photo-detail-byline time {
  min-width: 0;
}

.photo-detail-byline i {
  color: #737b85;
  font-style: normal;
}

.photo-detail-copy {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
  align-items: baseline;
}

.photo-detail-copy strong {
  font-size: 13px;
  line-height: 19px;
}

.photo-detail-copy i {
  color: #737b85;
  font-style: normal;
}

.photo-detail-copy span {
  color: #aeb5be;
  font-size: 11px;
  line-height: 17px;
}

.photo-detail-drawer.editing .photo-detail-body {
  overflow: hidden;
}

.photo-detail-annotation-shell {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 14px 12px 112px;
  background: #0d0f12;
}

.photo-detail-annotation-shell .viewer-annotation-stage {
  width: min(100%, calc((100dvh - 210px) * var(--annotation-aspect)));
  max-height: calc(100dvh - 210px);
}

.photo-detail-annotation-shell .annotation-toolbar {
  bottom: 8px;
  width: calc(100% - 16px);
  max-width: none;
  flex-wrap: wrap;
  justify-content: center;
}

.photo-detail-annotation-shell .annotation-status {
  order: 4;
}

.photo-detail-drawer .viewer-review-actions {
  background: rgba(20, 23, 28, 0.98);
}

.photo-filmstrip {
  min-width: 0;
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px;
  border-top: 1px solid #353a41;
  background: rgba(15, 18, 22, 0.98);
  scrollbar-color: #59616c transparent;
  scrollbar-width: thin;
}

.photo-filmstrip-track {
  display: flex;
  width: max-content;
  gap: 7px;
}

.photo-filmstrip-item {
  position: relative;
  display: block;
  width: 76px;
  height: 56px;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 2px;
  border: 1px solid #454b54;
  border-radius: 5px;
  background: #20242a;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.photo-filmstrip-item:hover {
  border-color: #7f8895;
  transform: translateY(-1px);
}

.photo-filmstrip-item:focus-visible {
  outline: 2px solid #8ab4ff;
  outline-offset: 2px;
}

.photo-filmstrip-item.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px #6fa3ff, 0 7px 18px rgba(32, 87, 180, 0.42);
  transform: translateY(-2px);
}

.photo-filmstrip-item img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
  opacity: 0.66;
  transition: opacity 140ms ease;
}

.photo-filmstrip-item:hover img,
.photo-filmstrip-item.active img {
  opacity: 1;
}

.photo-filmstrip-index {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 20px;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(8, 10, 13, 0.78);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

.photo-filmstrip-status {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #8f98a4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.photo-filmstrip-status.approved {
  background: #4bc27c;
}

.photo-filmstrip-status.rejected {
  background: #e46d65;
}

.photo-filmstrip-status.suspect {
  background: #e8ae4d;
}

@keyframes quick-preview-in {
  from { opacity: 0; transform: translateY(4px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: #121418;
  color: #f5f7f8;
}

.viewer-overlay.rejecting {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
}

.viewer-overlay > .viewer-reject-panel {
  width: auto;
  min-width: 0;
  border-right: 0;
  border-left: 1px solid rgba(108, 49, 45, 0.2);
  box-shadow: -14px 0 38px rgba(12, 18, 25, 0.14);
}

.viewer-main {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
}

.viewer-main > .photo-filmstrip {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  background: rgba(15, 18, 22, 0.9);
  backdrop-filter: blur(16px) saturate(120%);
}

.viewer-image-stage {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 64px 56px 92px;
  touch-action: none;
}

.viewer-image-stage.pan-enabled {
  cursor: grab;
}

.viewer-image-stage.pan-enabled.dragging {
  cursor: grabbing;
}

.viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform: scale(1) rotate(0deg);
  transition: transform 130ms ease;
  user-select: none;
}

.viewer-topbar {
  position: absolute;
  inset: 14px 14px auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-counter {
  color: #bac0c7;
  font-size: 12px;
  white-space: nowrap;
}

.viewer-tools {
  display: flex;
  gap: 7px;
}

.viewer-tools .icon-button,
.viewer-nav {
  border-color: #3c4148;
  background: #24282e;
  color: #f5f7f8;
}

.viewer-tools .icon-button:hover,
.viewer-nav:hover {
  background: #30353c;
}

.viewer-tools .icon-button.active {
  border-color: #6f9ce7;
  background: #263e65;
  color: #dfeaff;
}

.viewer-tools .viewer-reject-trigger,
.viewer-tools .viewer-reject-trigger.active {
  border-color: #7d4743;
  background: #4b2927;
  color: #ffdeda;
}

.viewer-tools .viewer-reject-trigger:hover {
  border-color: #d2716a;
  background: #67312e;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 40px;
  height: 48px;
  place-items: center;
  border: 1px solid #3c4148;
  border-radius: 5px;
  transform: translateY(-50%);
}

.viewer-nav.prev {
  left: 14px;
}

.viewer-nav.next {
  right: 14px;
}

.viewer-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid #32363c;
  background: #1b1e23;
}

.viewer-side-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #32363c;
}

.viewer-side-head strong {
  font-size: 13px;
}

.viewer-side-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.viewer-side-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
}

.viewer-review-actions {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  border-top: 1px solid #32363c;
  background: #171a1f;
}

.viewer-review-actions > span {
  display: block;
  margin-bottom: 8px;
  color: #9da4ad;
  font-size: 10px;
}

.viewer-review-actions > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.viewer-review-actions button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #4a515b;
  border-radius: 7px;
  background: #24282e;
  color: #f4f6f8;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.viewer-review-actions button:active {
  transform: translateY(1px);
}

.viewer-review-actions button:focus-visible {
  outline: 2px solid #8ab4ff;
  outline-offset: 2px;
}

.review-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.review-action-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.4;
}

.review-action-label {
  line-height: 1;
}

.viewer-review-actions kbd {
  min-width: 18px;
  padding: 3px 4px;
  border: 1px solid #646c78;
  border-radius: 4px;
  background: #16191d;
  color: #dce2e9;
  font-family: inherit;
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.viewer-review-actions button:hover[data-viewer-review="approved"] {
  border-color: #71cf97;
  background: #1d4933;
}

.viewer-review-actions button:hover[data-viewer-review="rejected"] {
  border-color: #c26059;
  background: #542623;
}

.viewer-review-actions button:hover[data-viewer-review="suspect"] {
  border-color: #e3ad58;
  background: #4d361b;
}

.viewer-review-actions button.requires-rule-mapping {
  border-color: #c26059;
  background: #542623;
  color: #ffe7e4;
}

.viewer-review-actions button.requires-rule-mapping:hover {
  border-color: #ef8c84;
  background: #67312e;
}

.viewer-annotation-stage {
  --annotation-aspect: 1.5;
  --annotation-ratio: 3 / 2;
  position: relative;
  width: min(calc(100% - 70px), calc((100dvh - 146px) * var(--annotation-aspect)));
  max-height: calc(100dvh - 146px);
  overflow: hidden;
  aspect-ratio: var(--annotation-ratio);
  border: 1px solid #353a42;
  border-radius: 4px;
  background: #0d0f12;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.viewer-annotation-stage.loading::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #f5f7f8;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.annotation-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.overlay-canvas {
  cursor: crosshair;
  touch-action: none;
}

.overlay-canvas[data-tool="text"] {
  cursor: text;
}

.overlay-canvas[data-tool="select"] {
  cursor: default;
}

.annotation-inline-text {
  position: absolute;
  z-index: 7;
  width: 180px;
  min-width: 110px;
  min-height: 34px;
  padding: 4px 6px;
  overflow: hidden;
  border: 1px dashed #9bc0ff;
  border-radius: 2px;
  outline: 0;
  background: rgba(16, 19, 23, 0.78);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  font-weight: 600;
  line-height: 1.35;
  resize: none;
  transform: translateY(-2px);
}

.annotation-inline-text:focus {
  border-style: solid;
  border-color: #b8d2ff;
  box-shadow: 0 0 0 2px rgba(111, 156, 231, 0.24), 0 4px 16px rgba(0, 0, 0, 0.28);
}

.annotation-toolbar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 5;
  display: flex;
  width: max-content;
  max-width: calc(100% - 28px);
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border: 1px solid #444a53;
  border-radius: 6px;
  background: rgba(31, 35, 41, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  transform: translateX(-50%);
  backdrop-filter: blur(16px) saturate(130%);
}

.annotation-tool-group,
.annotation-options,
.annotation-actions,
.annotation-colors {
  display: flex;
  align-items: center;
}

.annotation-tool-group,
.annotation-options,
.annotation-actions {
  gap: 4px;
}

.annotation-options,
.annotation-actions {
  padding-left: 7px;
  border-left: 1px solid #454b54;
}

.annotation-tool,
.annotation-action {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #c6cbd2;
  font-size: 10px;
}

.annotation-tool:hover:not(:disabled),
.annotation-action:hover:not(:disabled) {
  background: #353a42;
  color: #fff;
}

.annotation-tool.selected {
  border-color: #547fca;
  background: #263e65;
  color: #e3edff;
}

.annotation-tool:disabled,
.annotation-action:disabled,
.annotation-color:disabled,
.annotation-size input:disabled {
  cursor: wait;
  opacity: 0.46;
}

.annotation-tool svg,
.annotation-action svg,
.annotation-size svg {
  width: 15px;
  height: 15px;
}

.annotation-color {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #25292f;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #555b64;
}

.annotation-color.selected {
  box-shadow: 0 0 0 2px #fff;
}

.annotation-size {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #aeb4bd;
}

.annotation-size input {
  width: 66px;
  accent-color: #6f9ce7;
}

.annotation-status {
  min-width: 0;
  max-width: 92px;
  overflow: hidden;
  color: #9ea5ae;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annotation-status:empty {
  display: none;
}

.annotation-status.error {
  color: #ffaaa4;
}

.annotation-action {
  min-width: auto;
  padding: 0 9px;
}

.annotation-action.primary {
  border-color: #4771b8;
  background: #315fba;
  color: #fff;
}

.toast-region {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  right: 18px;
  bottom: auto;
  z-index: 200;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  min-height: 48px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #30343a;
  border-radius: 5px;
  background: #20242a;
  color: #f6f7f8;
  box-shadow: 0 10px 28px rgba(13, 18, 24, 0.22);
  pointer-events: auto;
  animation: toast-in 180ms ease;
}

.toast svg {
  width: 16px;
  height: 16px;
  color: #74c79b;
}

.toast.error svg {
  color: #ef8a84;
}

.toast.prominent {
  min-height: 60px;
  padding: 12px 14px;
  border-color: #82c6a1;
  background: #163d2f;
  box-shadow: 0 12px 34px rgba(19, 74, 53, 0.28);
}

.toast.prominent.error {
  border-color: #d87972;
  background: #552825;
}

.toast.prominent svg {
  width: 22px;
  height: 22px;
}

.toast.prominent span {
  font-size: 13px;
  font-weight: 680;
}

.toast span {
  font-size: 12px;
  line-height: 18px;
}

.toast button {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 3px;
  background: #343941;
  color: #fff;
  font-size: 11px;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(13, 16, 20, 0.45);
}

.user-management {
  margin-bottom: 16px;
}

.login-log-panel {
  margin-bottom: 16px;
}

.login-log-list {
  max-height: clamp(320px, calc(100vh - 330px), 680px);
  overflow: auto;
}

.login-log-table {
  min-width: 920px;
}

.login-log-agent {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-table {
  min-width: 720px;
}

.user-identity {
  display: flex;
  min-width: 180px;
  align-items: center;
  gap: 9px;
}

.user-identity > span:last-child,
.user-identity strong,
.user-identity small {
  display: block;
}

.user-identity small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--green);
}

.user-avatar svg {
  width: 15px;
}

.user-management-loading {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.user-management-loading svg {
  animation: loading-spin 800ms linear infinite;
}

.user-active-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.user-active-field input {
  margin-top: 2px;
}

.user-active-field strong,
.user-active-field small {
  display: block;
}

.user-active-field small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.account-session-state,
.danger-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.account-session-state > svg,
.danger-note > svg {
  width: 18px;
  flex: 0 0 18px;
}

.account-session-state > svg {
  color: var(--green);
}

.danger-note {
  border-color: #ead2aa;
  background: var(--amber-soft);
  color: #774500;
  font-size: 11px;
  line-height: 17px;
}

.account-session-state strong,
.account-session-state span {
  display: block;
}

.account-session-state span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 17px;
}

.modal.compact {
  width: min(100%, 440px);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
  from { transform: translateX(24px); }
  to { transform: translateX(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 1600px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  }
}

@media (max-width: 1279px) {
  .audit-page {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .path-summary {
    grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr);
  }

  .engine-note {
    display: none;
  }

  .dashboard-priority-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-health-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .dashboard-health-item {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .dashboard-health-item:last-child {
    border-right: 0;
  }

  .project-archive-columns,
  .project-archive-row {
    grid-template-columns: minmax(190px, 1.1fr) minmax(270px, 1.4fr) minmax(110px, 0.6fr) minmax(135px, 0.65fr) minmax(100px, 0.5fr) 24px;
    gap: 10px;
  }
}

@media (max-width: 1023px) {
  .photo-detail-workspace {
    width: min(900px, calc(100vw - 32px));
    height: min(720px, calc(100dvh - 32px));
  }

  .photo-detail-workspace > .photo-evidence-panel,
  .photo-detail-workspace > .viewer-reject-panel {
    width: min(320px, 35vw);
    flex-basis: min(320px, 35vw);
  }

  .dashboard-command {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .dashboard-command-stats {
    grid-column: 1 / -1;
  }

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

  .dashboard-risk-row {
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
  }

  .dashboard-risk-reasons {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .dashboard-risk-actions {
    grid-column: 4;
    grid-row: 1 / 3;
  }

  .dashboard-analysis-grid,
  .dashboard-analysis-grid.secondary {
    grid-template-columns: 1fr;
  }

  .audit-project-summary {
    grid-template-columns: minmax(360px, 1.5fr) minmax(210px, 0.72fr) repeat(2, minmax(128px, 0.58fr));
  }

  .gantt-board {
    --gantt-label-width: 248px;
  }

  .gantt-section-head {
    display: block;
  }

  .gantt-head-meta {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .business-date span {
    display: none;
  }

  .business-date .business-date-compact {
    display: inline;
    font-size: 10px;
    font-weight: 650;
  }

  .audit-page {
    grid-template-columns: 1fr;
  }

  .task-rail {
    display: none;
  }

  .audit-mobile-switch {
    display: grid;
    min-height: 52px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
  }

  .audit-mobile-switch span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .audit-mobile-switch svg {
    width: 15px;
    height: 15px;
  }

  .audit-mobile-switch .select {
    min-height: 36px;
  }

  .import-history {
    grid-column: auto;
  }

  .project-archive-columns,
  .project-archive-row {
    grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.45fr) minmax(110px, 0.6fr) minmax(130px, 0.65fr) 24px;
  }

  .project-archive-columns > :nth-child(5),
  .project-archive-row > .project-latest {
    display: none;
  }

  .archive-overview-grid {
    grid-template-columns: 1fr;
  }

  .project-rule-row {
    grid-template-columns: 38px minmax(140px, 0.8fr) minmax(130px, 0.7fr) minmax(180px, 1.1fr) 78px;
    gap: 9px;
  }
}

@media (max-width: 767px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 54px;
  }

  .auth-screen {
    align-items: stretch;
    padding: 0;
    background: var(--surface);
  }

  .auth-panel {
    width: 100%;
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-heading {
    margin-top: clamp(42px, 10dvh, 84px);
  }

  body {
    overflow: auto;
  }

  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .brand {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .brand-copy,
  .primary-nav a span,
  .nav-count {
    display: block;
  }

  .primary-nav a {
    justify-content: flex-start;
    padding: 0 10px;
  }

  .sidebar-footer {
    display: block;
    padding: 12px 14px 15px;
  }

  .sidebar-toggle {
    display: none;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    gap: 9px;
    padding: 0 10px;
  }

  .mobile-menu {
    display: inline-flex;
    flex: 0 0 44px;
  }

  .icon-button {
    width: 44px;
    min-height: 44px;
  }

  .button,
  .input,
  .select {
    min-height: 44px;
  }

  .topbar-context {
    min-width: 0;
    flex: 1;
  }

  .topbar-context strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .notification-toggle {
    width: 44px;
    height: 44px;
  }

  .notification-popover {
    position: fixed;
    top: calc(var(--topbar-height) + 7px);
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100dvh - var(--topbar-height) - 15px - env(safe-area-inset-bottom));
  }

  .notification-item {
    min-height: 112px;
  }

  .account-status {
    width: 34px;
    min-height: 32px;
    justify-content: center;
    padding: 0;
  }

  .account-status span {
    display: none;
  }

  .topbar-actions > .button {
    display: none;
  }

  .business-date {
    min-height: 32px;
    padding: 0 7px;
  }

  .business-date-full {
    display: none;
  }

  .business-date .business-date-compact {
    display: inline;
    font-size: 10px;
    font-weight: 650;
  }

  .data-status span {
    display: none;
  }

  .data-status small {
    display: none;
  }

  #app {
    height: auto;
    min-height: calc(100dvh - var(--topbar-height));
    overflow: visible;
  }

  .page {
    padding: 16px 12px 34px;
  }

  .page-head {
    display: block;
  }

  .page-head h1 {
    font-size: 19px;
  }

  .dashboard-command {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 12px;
  }

  .dashboard-command-icon {
    width: 34px;
    height: 34px;
  }

  .dashboard-command-copy h2 {
    font-size: 17px;
    line-height: 23px;
  }

  .dashboard-command-copy p {
    font-size: 11px;
    line-height: 17px;
  }

  .dashboard-command-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-command-stats > div {
    padding: 9px 7px;
  }

  .dashboard-command-stats strong {
    font-size: 18px;
  }

  .dashboard-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-dimension {
    padding: 11px;
  }

  .dashboard-dimension-head {
    align-items: flex-end;
  }

  .dashboard-dimension-head > span {
    gap: 4px;
    font-size: 10px;
  }

  .dashboard-dimension-head strong {
    font-size: 17px;
  }

  .dashboard-risk-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 10px 9px;
  }

  .dashboard-risk-project {
    grid-column: 2;
  }

  .dashboard-priority-badge {
    grid-column: 3;
    grid-row: 1;
  }

  .dashboard-risk-reasons {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dashboard-risk-reasons .badge:nth-child(n + 4) {
    display: none;
  }

  .dashboard-risk-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: stretch;
  }

  .dashboard-risk-actions .button {
    flex: 1;
    justify-content: center;
  }

  .dashboard-health-list {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-legend {
    margin-top: 7px;
  }

  .dashboard-trend {
    height: 190px;
    gap: 5px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .data-table.dashboard-photographer-table {
    min-width: 0;
    table-layout: fixed;
  }

  .dashboard-photographer-table th,
  .dashboard-photographer-table td {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 10px;
    text-align: right;
  }

  .dashboard-photographer-table th:first-child,
  .dashboard-photographer-table td:first-child {
    width: 34%;
    text-align: left;
  }

  .dashboard-photographer-table th:nth-child(2),
  .dashboard-photographer-table td:nth-child(2),
  .dashboard-photographer-table th:nth-child(3),
  .dashboard-photographer-table td:nth-child(3) {
    display: none;
  }

  .trend-bar b {
    display: none;
  }

  .dashboard-footnote {
    padding-right: 3px;
    padding-left: 3px;
  }

  .audit-project-page {
    height: auto;
    min-height: calc(100dvh - var(--topbar-height));
    overflow: visible;
  }

  .audit-project-layout {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .audit-project-panel,
  .audit-project-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .audit-project-rail {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .audit-project-search {
    padding: 7px 9px 2px;
  }

  .audit-project-search input {
    height: 40px;
    font-size: 16px;
  }

  .audit-project-tabs {
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 9px 7px;
    border-right: 0;
  }

  .audit-project-empty {
    width: 100%;
    min-height: 72px;
  }

  .audit-project-tab {
    width: 238px;
    min-width: 238px;
  }

  .audit-project-tab.active {
    box-shadow: inset 0 -4px 0 var(--blue), inset 0 0 0 2px rgba(39, 110, 241, 0.68), 0 5px 14px rgba(35, 74, 139, 0.14);
  }

  .audit-project-tab.readonly.active {
    box-shadow: inset 0 -4px 0 var(--green), inset 0 0 0 2px rgba(39, 110, 241, 0.68), 0 5px 14px rgba(35, 74, 139, 0.14);
  }

  .audit-project-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-project-summary.readonly {
    grid-template-columns: 1fr 1fr;
  }

  .audit-project-summary.readonly .audit-readonly-summary {
    grid-column: 1 / -1;
  }

  .audit-project-summary > div {
    min-height: 76px;
    padding: 9px 10px;
  }

  .audit-rule-summary,
  .audit-material-summary {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line);
  }

  .audit-rule-summary .project-rule-mini {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audit-material-summary {
    min-height: 70px !important;
  }

  .audit-count-summary:nth-last-child(2) {
    border-right: 1px solid var(--line);
  }

  .audit-photo-grid {
    grid-template-columns: 1fr;
  }

  .audit-photo-meta {
    min-height: 92px;
  }

  .followup-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .data-table.followup-table {
    width: 100%;
    min-width: 0;
  }

  .followup-table thead {
    display: none;
  }

  .followup-table,
  .followup-table tbody {
    display: block;
  }

  .followup-table tbody {
    display: grid;
    gap: 9px;
  }

  .followup-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
  }

  .followup-table td {
    display: block;
    padding: 0;
    border: 0;
  }

  .followup-table td:nth-child(2),
  .followup-table td:nth-child(3),
  .followup-table td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .followup-table td:nth-child(2) {
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .followup-table td:nth-child(4) {
    align-self: center;
    color: var(--muted);
    font-size: 11px;
  }

  .followup-table td:nth-child(5) {
    grid-column: 2;
    grid-row: 4;
  }

  .followup-table td:nth-child(6) .button {
    width: 100%;
  }

  .followup-table .fact-cell,
  .followup-table .cell-main,
  .followup-table .followup-evidence-cell {
    min-width: 0;
    max-width: none;
  }

  .followup-table .followup-evidence-cell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px 10px;
    border-radius: 4px;
    background: var(--surface-2);
  }

  .project-archive-columns {
    display: none;
  }

  .project-archive-row {
    grid-template-columns: minmax(0, 1fr) 32px;
    gap: 12px;
    padding: 14px 12px;
  }

  .project-archive-row:first-of-type {
    border-top: 0;
  }

  .project-archive-identity {
    grid-column: 1;
  }

  .project-enter {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .project-rule-mini,
  .project-material-progress,
  .project-history-counts,
  .project-photo-only-summary {
    grid-column: 1 / -1;
  }

  .project-rule-mini {
    gap: 3px;
  }

  .project-rule-mini > span {
    min-height: 40px;
  }

  .project-material-progress {
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
  }

  .archive-summary-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-summary-band > div {
    min-height: 62px;
    padding: 10px 12px;
  }

  .archive-summary-band > div:nth-child(2) {
    border-right: 0;
  }

  .archive-summary-band > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .archive-rule-matrix {
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    overflow-x: auto;
  }

  .project-rule-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .project-rule-row > :nth-child(3),
  .project-rule-sites {
    grid-column: 2 / -1;
  }

  .project-rule-row > :nth-child(5) {
    grid-column: 3;
    grid-row: 1;
  }

  .head-actions {
    margin-top: 12px;
  }

  .audit-context {
    padding: 10px;
  }

  .audit-unavailable-page {
    min-height: 100%;
  }

  .audit-gate-empty {
    min-height: calc(100dvh - var(--topbar-height));
    padding: 32px 18px 80px;
  }

  .audit-gate-empty h1 {
    font-size: 18px;
    line-height: 26px;
  }

  .audit-context-top {
    display: block;
  }

  .audit-actions {
    margin-top: 9px;
  }

  .path-summary {
    display: block;
    padding: 9px;
  }

  .missing-steps {
    margin-top: 8px;
  }

  .photo-work-area {
    flex: none;
    overflow: visible;
    padding: 9px 9px 90px;
  }

  .photo-list-toolbar {
    top: var(--topbar-height);
    margin-right: -9px;
    margin-left: -9px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .photo-grid:not(.audit-photo-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .photo-meta {
    min-height: 50px;
    padding: 6px;
  }

  .photo-actions {
    height: 44px;
  }

  .dashboard-priority-layout,
  .dashboard-analysis-grid,
  .dashboard-analysis-grid.secondary {
    gap: 12px;
  }

  .gantt-board {
    --gantt-label-width: 220px;
  }

  .gantt-axis-label,
  .gantt-project-label {
    padding-right: 10px;
    padding-left: 10px;
  }

  .gantt-path-label {
    grid-template-columns: 23px minmax(0, 1fr) auto;
    gap: 5px;
    padding-right: 7px;
    padding-left: 9px;
  }

  .gantt-status {
    max-width: 54px;
  }

  .data-table {
    min-width: 760px;
  }

  .chain-lane {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .chain-label {
    padding: 10px;
  }

  .site-detail-head {
    display: block;
    padding: 14px 12px;
  }

  .site-detail-head .inline-actions {
    margin-top: 12px;
  }

  .project-status-action {
    min-height: 44px;
  }

  .site-facts {
    gap: 7px 14px;
  }

  .tabs {
    overflow-x: auto;
    gap: 16px;
    padding: 0 12px;
  }

  .tabs button {
    white-space: nowrap;
  }

  .site-detail-body {
    padding: 12px;
  }

  .archive-photo-head {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .rule-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .rule-governance-warning {
    margin-bottom: 10px;
  }

  .rule-project-scope {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .rule-backup-summary {
    grid-template-columns: 1fr;
  }

  .process-rule-row {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 11px 10px;
  }

  .process-rule-meta {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .process-rule-content ol {
    display: block;
  }

  .process-rule-content li {
    min-width: 0;
    max-width: none;
    margin-bottom: 5px;
  }

  .rule-required {
    grid-column: 2 / -1;
  }

  .form-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .rule-admin-auth-grid {
    grid-template-columns: 1fr;
  }

  .reject-reason-option {
    min-height: 44px;
    padding: 6px 8px;
  }

  #photo-quick-preview {
    display: none !important;
  }

  .photo-detail-workspace,
  .photo-detail-workspace.rejecting {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(190px, 34dvh);
    border-radius: 7px;
  }

  .photo-detail-overlay {
    padding: 8px;
  }

  .photo-detail-workspace > .photo-evidence-panel,
  .photo-detail-workspace > .viewer-reject-panel {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    flex-basis: auto;
    max-height: none;
    border-top: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
  }

  .photo-detail-workspace > .photo-detail-drawer {
    grid-row: 1;
    min-height: 0;
  }

  .photo-detail-head {
    min-height: 56px;
    padding: 8px 10px;
  }

  .photo-detail-image {
    min-height: 220px;
  }

  .photo-detail-image img {
    min-height: 0;
    max-height: 100%;
  }

  .photo-detail-info {
    max-height: min(30dvh, 190px);
    padding: 8px 12px 10px;
  }

  .viewer-overlay {
    grid-template-columns: 1fr;
  }

  .viewer-overlay.rejecting {
    grid-template: minmax(240px, 44dvh) minmax(0, 1fr) / 1fr;
  }

  .viewer-overlay.rejecting .viewer-main {
    grid-row: 1;
  }

  .viewer-overlay.rejecting > .viewer-reject-panel {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
    box-shadow: 0 -14px 38px rgba(12, 18, 25, 0.14);
  }

  .viewer-overlay.rejecting .viewer-main > .photo-filmstrip {
    display: none;
  }

  .viewer-overlay.rejecting .viewer-image-stage {
    padding-bottom: 10px;
  }

  .viewer-overlay:not(.editing) .viewer-topbar {
    inset: 8px 8px auto;
    justify-content: flex-end;
  }

  .viewer-overlay:not(.editing) .viewer-counter {
    position: absolute;
    top: 48px;
    left: 4px;
    z-index: 1;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(18, 20, 24, 0.78);
  }

  .viewer-overlay:not(.editing) .viewer-tools {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
  }

  .viewer-overlay:not(.editing) .viewer-tools .icon-button {
    width: 100%;
    min-width: 0;
  }

  .viewer-reject-head {
    min-height: 56px;
    padding: 7px 10px 7px 12px;
  }

  .viewer-reject-body {
    padding: 10px 12px;
  }

  .viewer-reject-foot {
    min-height: 58px;
    padding: 8px 10px;
  }

  .viewer-side {
    position: absolute;
    inset: auto 0 0;
    max-height: 38vh;
    border-top: 1px solid #32363c;
    border-left: 0;
  }

  .viewer-image-stage {
    align-items: center;
    justify-content: center;
    padding: 64px 12px 20px;
  }

  .viewer-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    align-self: auto;
    margin-top: 0;
  }

  .viewer-nav {
    top: 30%;
    width: 44px;
  }

  .viewer-overlay.editing .viewer-side {
    display: none;
  }

  .viewer-overlay.editing .viewer-main {
    padding: 56px 8px 116px;
  }

  .viewer-annotation-stage {
    width: min(100%, calc((100dvh - 188px) * var(--annotation-aspect)));
    max-height: calc(100dvh - 188px);
  }

  .annotation-toolbar {
    bottom: 8px;
    width: calc(100% - 16px);
    max-width: none;
    flex-wrap: wrap;
    justify-content: center;
  }

  .annotation-status {
    order: 4;
  }

  .overlay {
    padding: 8px;
  }

  .modal {
    max-height: calc(100dvh - 16px);
  }

  .toast-region {
    top: calc(var(--topbar-height) + env(safe-area-inset-top) + 9px);
    right: 9px;
    bottom: auto;
    width: calc(100vw - 18px);
  }

  .drop-zone {
    min-height: 240px;
    padding: 20px 16px;
  }

  .drop-zone > div {
    width: 100%;
    min-width: 0;
  }

  .import-mode {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
  }

  .import-issues-summary {
    min-height: 64px;
    gap: 10px;
    padding: 9px 12px;
  }

  .import-issues-summary p {
    max-width: 220px;
    font-size: 11px;
    line-height: 16px;
  }

  .import-issues-summary-actions {
    gap: 6px;
  }

  .import-issues-toggle > span {
    display: none !important;
  }

  .import-issue-list {
    max-height: 66dvh;
  }

  .import-issue {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .import-issue-mark {
    width: 26px;
    height: 26px;
  }

  .import-issue-title {
    gap: 8px;
  }

  .import-issue-actions .button {
    flex: 1 1 142px;
  }

  .import-issue-source {
    display: grid;
    gap: 8px;
  }

  .import-issue-source-copy a,
  .import-issue-source-copy em {
    max-width: 250px;
  }

  .import-issue-source-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .import-issue-source-actions .button {
    justify-content: center;
  }

  .ignore-reason-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .photo-grid:not(.audit-photo-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-card {
    font-size: 11px;
  }

  .button span.optional-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 767px) {
  .problem-record-toolbar {
    align-items: flex-end;
  }

  .problem-record-toolbar > div {
    min-width: 0;
  }

  .problem-record {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .problem-reply-history {
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .problem-record-action {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
}
/* Operational controls added after the evidence-policy audit. */
.project-plan-modal { width: min(860px, calc(100vw - 32px)); }
.project-plan-head,
.project-plan-row {
  display: grid;
  grid-template-columns: 52px minmax(160px, 1fr) 150px 150px;
  gap: 10px;
  align-items: center;
}
.project-plan-head {
  padding: 0 4px 6px;
  color: var(--muted);
  font-size: 12px;
}
.project-plan-row { padding: 6px 0; }
.project-plan-row > strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--blue) 12%, white);
  color: var(--blue);
}
.backup-list { display: grid; gap: 8px; }
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.backup-row > div:first-child { display: grid; gap: 4px; }
.backup-row span { color: var(--muted); font-size: 12px; }
.photo-window-more {
  display: flex;
  margin: 18px auto 4px;
  align-items: center;
  gap: 8px;
}
.photo-window-more small { color: var(--muted); }
.password-change-overlay { z-index: 1200; }
.password-change-modal { width: min(520px, calc(100vw - 28px)); }

.after-sales-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.after-sales-project-list { padding: 8px; display: grid; gap: 4px; }
.after-sales-project-list-head {
  display: flex;
  min-height: 38px;
  padding: 4px 8px 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.after-sales-project-list button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 11px 12px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.after-sales-project-list button:hover,
.after-sales-project-list button.active { background: color-mix(in srgb, var(--blue) 10%, var(--surface)); }
.after-sales-project-list span { min-width: 0; display: grid; gap: 3px; }
.after-sales-project-list strong,
.after-sales-project-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-project-list small { color: var(--muted); font-size: 11px; }
.after-sales-project-list b { min-width: 28px; text-align: center; color: var(--blue); }
.after-sales-main { min-width: 0; display: grid; gap: 16px; }
.after-sales-project-head {
  display: flex;
  min-height: 76px;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.after-sales-project-head > div:first-child { min-width: 0; display: grid; gap: 3px; }
.after-sales-project-head span,
.after-sales-project-head small { color: var(--muted); font-size: 11px; }
.after-sales-project-head h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.after-sales-view-tabs,
.after-sales-ledger-filters {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}
.after-sales-view-tabs button,
.after-sales-ledger-filters button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.after-sales-view-tabs button.active,
.after-sales-ledger-filters button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 32, 44, .09);
}
.after-sales-view-tabs svg { width: 15px; height: 15px; }
.after-sales-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.after-sales-metrics > div {
  min-width: 0;
  min-height: 82px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
}
.after-sales-metrics span,
.after-sales-metrics small { color: var(--muted); font-size: 11px; }
.after-sales-metrics strong { grid-row: 1 / 3; grid-column: 2; font-size: 24px; font-variant-numeric: tabular-nums; }
.after-sales-metrics small { grid-column: 1; }
.after-sales-metrics .warning strong { color: var(--orange); }
.after-sales-metrics .success strong { color: var(--green); }
.after-sales-analysis {
  min-width: 0;
  padding: 0 14px 16px;
  display: grid;
  gap: 10px;
}
.after-sales-analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.after-sales-analysis-summary > div {
  min-width: 0;
  min-height: 70px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 96%, var(--blue));
  display: grid;
  gap: 3px;
}
.after-sales-analysis-summary span,
.after-sales-analysis-summary small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-analysis-summary strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.after-sales-chart-card {
  min-width: 0;
  min-height: 246px;
  overflow: hidden;
}
.after-sales-chart-card > header {
  display: flex;
  min-height: 58px;
  padding: 11px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.after-sales-chart-card > header > div:first-child { min-width: 0; display: grid; gap: 2px; }
.after-sales-chart-card h2 { margin: 0; font-size: 13px; }
.after-sales-chart-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-chart-legend { display: flex; flex: 0 0 auto; gap: 10px; color: var(--muted); font-size: 10px; }
.after-sales-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.after-sales-chart-legend span::before { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); content: ""; }
.after-sales-chart-legend .resolved::before { background: #27a97b; }
.after-sales-chart-legend .open::before { background: #e0a23b; }
.after-sales-chart-legend .discovered::before { background: #3978d8; }
.after-sales-category-chart { padding: 12px 14px 14px; display: grid; align-content: start; gap: 10px; }
.after-sales-category-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.after-sales-category-row > div:first-child { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.after-sales-category-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-category-row b { font-size: 11px; font-variant-numeric: tabular-nums; }
.after-sales-category-row small { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 9px; white-space: nowrap; }
.after-sales-stacked-track {
  grid-column: 1;
  grid-row: 2;
  height: 7px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--soft);
  display: flex;
}
.after-sales-stacked-track i,
.after-sales-stacked-track em { display: block; height: 100%; min-width: 0; }
.after-sales-stacked-track i { background: linear-gradient(90deg, #238ba6, #27a97b); }
.after-sales-stacked-track em { background: linear-gradient(90deg, #e8b550, #d8922b); }
.after-sales-trend-chart {
  height: 187px;
  padding: 18px 14px 12px;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 8px;
  background-image: linear-gradient(to top, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 100% 25%;
}
.after-sales-trend-column { min-width: 38px; flex: 1; display: grid; grid-template-rows: minmax(0, 1fr) 18px; gap: 5px; text-align: center; }
.after-sales-trend-bars { display: flex; min-height: 0; align-items: flex-end; justify-content: center; gap: 4px; }
.after-sales-trend-bars i,
.after-sales-trend-bars em {
  position: relative;
  width: min(18px, 38%);
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  transition: height .2s ease;
}
.after-sales-trend-bars i { background: linear-gradient(180deg, #4f8fe9, #2767c4); }
.after-sales-trend-bars em { background: linear-gradient(180deg, #45b997, #238765); }
.after-sales-trend-bars span { position: absolute; top: -14px; left: 50%; color: var(--muted); font-size: 9px; font-style: normal; transform: translateX(-50%); }
.after-sales-trend-column > small { color: var(--muted); font-size: 9px; }
.after-sales-owner-head,
.after-sales-owner-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 54px 54px 64px 78px;
  gap: 8px;
  align-items: center;
}
.after-sales-owner-head { min-height: 31px; padding: 0 14px; background: var(--soft); color: var(--muted); font-size: 9px; }
.after-sales-owner-head span:not(:first-child),
.after-sales-owner-row span { text-align: right; }
.after-sales-owner-row { min-height: 39px; padding: 0 14px; border-top: 1px solid var(--line); font-size: 10px; }
.after-sales-owner-list .after-sales-owner-row:first-child { border-top: 0; }
.after-sales-owner-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-owner-row span { font-variant-numeric: tabular-nums; }
.after-sales-owner-row .attention { color: var(--orange); font-weight: 700; }
.after-sales-open-list { display: grid; }
.after-sales-open-row {
  min-height: 54px;
  padding: 8px 12px 8px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.after-sales-open-list .after-sales-open-row:first-child { border-top: 0; }
.after-sales-open-row:hover { background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.after-sales-open-row > span { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 7px; align-items: center; }
.after-sales-open-row b { padding: 2px 5px; border-radius: 4px; background: color-mix(in srgb, var(--blue) 8%, var(--surface)); color: var(--blue); font-size: 9px; white-space: nowrap; }
.after-sales-open-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-open-row span small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.after-sales-open-row > em { min-width: 38px; color: var(--orange); font-size: 18px; font-style: normal; font-weight: 720; text-align: right; }
.after-sales-open-row > em small { margin-left: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.after-sales-open-row > svg { width: 15px; height: 15px; color: var(--muted); }
.after-sales-open-empty { min-height: 178px; place-items: center; align-content: center; gap: 6px; color: var(--muted); display: grid; text-align: center; }
.after-sales-open-empty svg { width: 24px; height: 24px; color: var(--green); }
.after-sales-open-empty strong { color: var(--ink); font-size: 12px; }
.after-sales-open-empty span { font-size: 10px; }
.after-sales-analysis-empty { margin: 0 14px 16px; min-height: 320px; }
.after-sales-ledger-panel { min-width: 0; overflow: hidden; }
.after-sales-ledger-toolbar {
  display: flex;
  min-height: 58px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.after-sales-ledger-search {
  width: min(340px, 42%);
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.after-sales-ledger-search:focus-within { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 11%, transparent); }
.after-sales-ledger-search svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--muted); }
.after-sales-ledger-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.after-sales-ledger-head,
.after-sales-ledger-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(90px, 120px) minmax(120px, 150px) 76px;
  gap: 14px;
  align-items: center;
}
.after-sales-ledger-head {
  min-height: 34px;
  padding: 0 16px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
}
.after-sales-ledger-row {
  min-height: 106px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}
.after-sales-ledger-row.pending-review { box-shadow: inset 3px 0 0 var(--amber); }
.after-sales-ledger-row.recurrent-issue { box-shadow: inset 3px 0 0 var(--red); }
.after-sales-ledger-row.pending-review.recurrent-issue { box-shadow: inset 3px 0 0 var(--orange); }
.after-sales-ledger-list .after-sales-ledger-row:first-child { border-top: 0; }
.after-sales-ledger-row:hover { background: color-mix(in srgb, var(--blue) 3%, var(--surface)); }
.after-sales-ledger-problem { min-width: 0; display: grid; gap: 6px; }
.after-sales-ledger-problem > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.after-sales-evidence-link {
  min-height: 24px;
  font: inherit;
  cursor: pointer;
}
.after-sales-evidence-link:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); color: var(--blue); }
.after-sales-evidence-link svg { width: 12px; height: 12px; }
.after-sales-ledger-problem > strong { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.after-sales-ledger-problem p { margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.after-sales-ledger-problem small { display: flex; gap: 7px; color: var(--muted); line-height: 17px; overflow-wrap: anywhere; }
.after-sales-ledger-problem small b { color: var(--ink); white-space: nowrap; }
.after-sales-issue-history { margin-top: 2px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--canvas) 72%, var(--surface)); }
.after-sales-issue-history > summary { display: flex; min-height: 36px; align-items: center; gap: 10px; padding: 7px 9px; color: var(--ink); cursor: pointer; list-style: none; }
.after-sales-issue-history > summary::-webkit-details-marker { display: none; }
.after-sales-issue-history > summary > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.after-sales-issue-history > summary > span svg { width: 14px; height: 14px; color: var(--blue); }
.after-sales-issue-history > summary > small { min-width: 0; flex: 1; color: var(--muted); font-size: 11px; }
.after-sales-issue-history > summary > svg { width: 14px; height: 14px; color: var(--muted); transition: transform 160ms ease; }
.after-sales-issue-history[open] > summary > svg { transform: rotate(180deg); }
.after-sales-issue-history > div { max-height: 300px; overflow: auto; border-top: 1px solid var(--line); }
.after-sales-occurrence-summary { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 9px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--blue) 3%, var(--surface)); }
.after-sales-occurrence-summary > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 10px; line-height: 15px; }
.after-sales-occurrence-summary > span b { color: var(--ink); }
.after-sales-history-row { display: grid; width: 100%; grid-template-columns: 38px 132px minmax(180px, 1fr) minmax(150px, .8fr) 18px; align-items: center; gap: 8px; padding: 8px 9px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.after-sales-history-row:last-child { border-bottom: 0; }
.after-sales-history-row:hover { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.after-sales-history-row > time,
.after-sales-history-row > small { color: var(--muted); font-size: 10px; line-height: 15px; }
.after-sales-history-row > strong { font-size: 11px; line-height: 16px; overflow-wrap: anywhere; }
.after-sales-history-row > small { display: block; }
.after-sales-history-row > svg { width: 14px; height: 14px; color: var(--muted); }
.after-sales-history-role { display: inline-flex; min-height: 20px; align-items: center; justify-content: center; border-radius: 4px; font-size: 10px; font-weight: 700; }
.after-sales-history-role.observed { background: color-mix(in srgb, var(--amber) 16%, transparent); color: color-mix(in srgb, var(--amber) 78%, var(--ink)); }
.after-sales-history-role.handled { background: color-mix(in srgb, var(--green) 15%, transparent); color: color-mix(in srgb, var(--green) 78%, var(--ink)); }
.after-sales-ledger-owner,
.after-sales-ledger-date { min-width: 0; display: grid; gap: 4px; }
.after-sales-ledger-owner span,
.after-sales-ledger-date span { display: none; color: var(--muted); font-size: 11px; }
.after-sales-ledger-owner strong,
.after-sales-ledger-date strong { overflow-wrap: anywhere; font-size: 12px; }
.after-sales-ledger-date small { color: var(--muted); font-size: 11px; }
.after-sales-ledger-actions { display: flex; justify-content: flex-end; gap: 4px; }
.after-sales-ledger-actions .icon-button { width: 34px; height: 34px; }
.after-sales-ledger-empty-search { min-height: 220px; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.after-sales-ledger-empty-search:not([hidden]) { display: grid; }
.after-sales-ledger-empty-search svg { width: 28px; height: 28px; }
.after-sales-ledger-empty-search strong { color: var(--ink); }
.after-sales-issue-modal { width: min(760px, calc(100vw - 32px)); }
.after-sales-auto-review-note {
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--cyan) 30%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--cyan-soft) 70%, var(--surface));
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.after-sales-auto-review-note > svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--cyan); }
.after-sales-auto-review-note strong,
.after-sales-auto-review-note span { display: block; }
.after-sales-auto-review-note strong { font-size: 12px; }
.after-sales-auto-review-note span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 17px; }
.after-sales-resolution-fields {
  display: grid;
  grid-template-columns: minmax(150px, .72fr) minmax(260px, 1.28fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--green) 5%, var(--surface));
}
.after-sales-resolution-fields[hidden] { display: none; }
.after-sales-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; }
.after-sales-summary > div { padding: 14px 16px; display: grid; gap: 4px; background: color-mix(in srgb, var(--surface) 92%, var(--blue)); }
.after-sales-summary span,
.after-sales-summary small { color: var(--muted); font-size: 12px; }
.after-sales-photo-grid {
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.after-sales-photo-grid article { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.after-sales-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); }
.after-sales-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.after-sales-photo-grid article > div:last-child { padding: 10px 12px; display: grid; gap: 4px; }
.after-sales-photo-grid article strong,
.after-sales-photo-grid article span,
.after-sales-photo-grid article small { overflow-wrap: anywhere; }
.after-sales-photo-grid article span,
.after-sales-photo-grid article small { color: var(--muted); font-size: 11px; }

/* 售后照片浏览沿用持续审核的工作台密度，同时保留售后台账入口。 */
.after-sales-project-page {
  display: flex;
  height: 100%;
  min-height: 630px;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}
.after-sales-project-page .audit-project-layout { height: 100%; }
.after-sales-project-rail-head {
  display: flex;
  min-height: 38px;
  padding: 4px 16px 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.after-sales-project-tabs { padding-top: 2px; }
.after-sales-project-tab { min-height: 72px; }
.after-sales-project-tab .audit-project-tab-meta { margin-top: 6px; }
.after-sales-project-tab .audit-review-state { font-size: 9px; }
.after-sales-project-workspace {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 16px;
  background: var(--canvas);
  scrollbar-gutter: stable;
}
.after-sales-project-header {
  flex: 0 0 auto;
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 72%, transparent);
}
.after-sales-project-title-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
}
.after-sales-project-title-row > div:first-child { min-width: 0; display: grid; gap: 3px; }
.after-sales-project-title-row span,
.after-sales-project-title-row small { color: var(--muted); font-size: 11px; }
.after-sales-project-title-row h1 { margin: 0; overflow: hidden; font-size: 18px; line-height: 24px; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-project-title-row .inline-actions { flex: 0 0 auto; justify-content: flex-end; }
.after-sales-project-title-row .inline-actions .button { min-height: 34px; }
.after-sales-project-header .after-sales-view-tabs { width: fit-content; margin-bottom: -1px; }
.after-sales-project-workspace > .after-sales-metrics { margin: 14px 16px 0; }
.after-sales-project-workspace > .after-sales-ledger-panel,
.after-sales-project-workspace > .after-sales-photo-panel { flex: 0 0 auto; min-height: 0; margin: 14px 16px 0; overflow: hidden; }
.after-sales-project-workspace > .after-sales-analysis { margin-top: 14px; padding: 0 16px; }
.after-sales-photo-panel .section-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.after-sales-photo-work-area { padding-top: 0; }
.after-sales-photo-work-area .photo-list-toolbar { border-bottom: 1px solid var(--line); }
.after-sales-photo-card .photo-frame { cursor: pointer; }
.after-sales-photo-card .photo-meta { min-height: 70px; }
.after-sales-photo-detail-workspace { width: min(920px, calc(100vw - 64px)); }
.after-sales-photo-detail-info .photo-detail-origin > span { color: #7fc7f3; font-weight: 700; }
.after-sales-photo-viewer .viewer-main { background: #111418; }
.after-sales-photo-viewer .viewer-topbar {
  align-items: flex-start;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  background: rgba(24, 28, 34, .82);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px) saturate(125%);
}
.after-sales-viewer-context {
  display: grid;
  min-width: 0;
  max-width: min(620px, calc(100vw - 520px));
  gap: 2px;
}
.after-sales-viewer-context span,
.after-sales-viewer-context small { color: #abb4be; font-size: 10px; line-height: 15px; }
.after-sales-viewer-context strong,
.after-sales-viewer-context small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.after-sales-viewer-context strong { color: #f5f7f8; font-size: 13px; line-height: 18px; }
.after-sales-photo-viewer .viewer-image-stage { padding-top: 92px; }
.after-sales-photo-viewer .photo-filmstrip-item { min-width: 64px; height: 48px; padding: 2px; }
.after-sales-photo-viewer .photo-filmstrip-item img { width: 58px; height: 42px; object-fit: cover; }
.after-sales-search-empty { height: 100%; padding: 24px; }
.after-sales-search-empty > .empty-state { height: auto; min-height: 260px; }

@media (max-width: 1100px) {
  .after-sales-analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .project-plan-head { display: none; }
  .project-plan-row {
    grid-template-columns: 42px 1fr;
  }
  .project-plan-row [type="date"] { grid-column: 2; }
  .backup-row { align-items: flex-start; flex-direction: column; }
  .after-sales-layout,
  .after-sales-summary,
  .after-sales-resolution-fields { grid-template-columns: 1fr; }
  .after-sales-project-head,
  .after-sales-ledger-toolbar { align-items: stretch; flex-direction: column; }
  .after-sales-view-tabs,
  .after-sales-ledger-filters { width: 100%; }
  .after-sales-view-tabs button,
  .after-sales-ledger-filters button { flex: 1; justify-content: center; padding-inline: 7px; }
  .after-sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-analysis { padding: 0 10px 12px; }
  .after-sales-analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .after-sales-analysis-summary > div { min-height: 66px; }
  .after-sales-chart-card { min-height: 238px; }
  .after-sales-chart-card > header { padding-inline: 12px; }
  .after-sales-chart-legend { gap: 7px; }
  .after-sales-category-row { grid-template-columns: minmax(0, 1fr); }
  .after-sales-category-row small { grid-column: 1; grid-row: 3; }
  .after-sales-stacked-track { grid-column: 1; }
  .after-sales-owner-head,
  .after-sales-owner-row { grid-template-columns: minmax(74px, 1fr) 38px 38px 48px 58px; gap: 5px; }
  .after-sales-owner-head,
  .after-sales-owner-row { padding-inline: 10px; }
  .after-sales-open-row { padding-inline: 11px 8px; }
  .after-sales-analysis-empty { margin: 0 10px 12px; }
  .after-sales-ledger-search { width: 100%; }
  .after-sales-ledger-head { display: none; }
  .after-sales-ledger-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: start; }
  .after-sales-ledger-problem { grid-column: 1 / -1; }
  .after-sales-ledger-owner span,
  .after-sales-ledger-date span { display: block; }
  .after-sales-ledger-actions { grid-column: 2; grid-row: 2; align-self: center; }
  .after-sales-history-row { grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 5px 8px; }
  .after-sales-history-row > time { grid-column: 2; grid-row: 1; }
  .after-sales-history-row > strong { grid-column: 1 / -1; grid-row: 2; }
  .after-sales-history-row > small { grid-column: 1 / -1; grid-row: 3; }
  .after-sales-history-row > svg { grid-column: 3; grid-row: 1; }
  .after-sales-project-page { height: auto; min-height: calc(100dvh - var(--topbar-height)); overflow: visible; }
  .after-sales-project-page .audit-project-layout { height: auto; }
  .after-sales-project-title-row { align-items: stretch; flex-direction: column; }
  .after-sales-project-title-row .inline-actions { width: 100%; }
  .after-sales-project-title-row .inline-actions .button { flex: 1; justify-content: center; }
  .after-sales-project-workspace { padding-bottom: 10px; }
  .after-sales-project-header { padding: 12px 10px 0; }
  .after-sales-project-workspace > .after-sales-metrics,
  .after-sales-project-workspace > .after-sales-ledger-panel,
  .after-sales-project-workspace > .after-sales-photo-panel { margin: 10px 10px 0; }
  .after-sales-project-workspace > .after-sales-analysis { margin-top: 10px; padding: 0 10px; }
  .after-sales-project-workspace { scrollbar-gutter: auto; }
  .after-sales-photo-detail-workspace {
    width: calc(100vw - 16px);
    grid-template-rows: minmax(0, 1fr);
  }
  .after-sales-photo-viewer:not(.editing) .viewer-topbar {
    inset: 8px 8px auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 7px;
  }
  .after-sales-photo-viewer .after-sales-viewer-context {
    position: static;
    max-width: 100%;
    padding: 0 3px;
  }
  .after-sales-photo-viewer:not(.editing) .viewer-tools {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }
  .after-sales-photo-viewer .viewer-image-stage { padding: 132px 12px 74px; }
  .after-sales-photo-viewer .photo-filmstrip { padding: 6px 8px; }
  .after-sales-photo-viewer .photo-filmstrip-item { min-width: 54px; height: 42px; }
  .after-sales-photo-viewer .photo-filmstrip-item img { width: 48px; height: 36px; }
}

@media (max-width: 1199px) {
  .dashboard-section-grid,
  .dashboard-section-grid.portfolio,
  .dashboard-section-grid.execution,
  .dashboard-section-grid.quality,
  .dashboard-section-grid.closure,
  .dashboard-analysis-grid,
  .dashboard-analysis-grid.secondary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .dashboard-section-grid,
  .dashboard-section-grid.portfolio,
  .dashboard-section-grid.execution,
  .dashboard-section-grid.quality,
  .dashboard-section-grid.closure {
    grid-template-columns: 1fr;
  }

  .dashboard-material-kpis,
  .dashboard-learning-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-problem-sources {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .dashboard-type-head,
  .dashboard-stage-head,
  .dashboard-material-head,
  .dashboard-relevance-head {
    flex-wrap: wrap;
  }

  .dashboard-type-head > span,
  .dashboard-material-head b {
    margin-left: 0;
  }

  .dashboard-reason-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .dashboard-reason-track {
    grid-column: 2;
  }

  .dashboard-relevance-summary {
    gap: 8px 14px;
  }
}
.laya-advice-results {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.laya-advice-results .button {
  white-space: normal;
  overflow-wrap: anywhere;
  height: auto;
  min-height: 36px;
  text-align: left;
}
.jev-settings-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.jev-settings-meta > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}
.jev-settings-meta span {
  color: var(--muted);
  font-size: 10px;
}
.jev-settings-meta strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 650;
}
@media (max-width: 560px) {
  .jev-settings-meta {
    grid-template-columns: 1fr;
  }
}
