:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-2: #e8edf2;
  --sidebar: #101720;
  --sidebar-2: #16202b;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #eef3f8;
  --text: #17212c;
  --muted: #647181;
  --muted-2: #8a96a3;
  --stroke: #d9e1ea;
  --stroke-soft: rgba(24, 36, 48, 0.1);
  --accent: #2563eb;
  --accent-2: #00856f;
  --danger: #c2414b;
  --warn: #a86a09;
  --good: #08775f;
  --shadow: 0 18px 46px rgba(28, 42, 56, 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-width: 278px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.06), transparent 280px),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.48;
  letter-spacing: 0;
}

body.legal-page {
  display: block;
}

body:not(.is-logged-in):not(.legal-page) {
  grid-template-columns: minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.07) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(37, 99, 235, 0.06), transparent 260px),
    #f5f8fc;
  background-size: 44px 44px, auto, auto;
}

body:not(.is-logged-in):not(.legal-page) .sidebar,
body:not(.is-logged-in):not(.legal-page) .topbar {
  display: none;
}

body:not(.is-logged-in):not(.legal-page) main {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  padding: 32px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #1d55d8;
  border-radius: var(--radius-sm);
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

button:hover {
  background: #1d55d8;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

button.ghost {
  border-color: var(--stroke);
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

button.ghost:hover {
  border-color: #adc1d8;
  background: #f3f7fb;
}

button.danger,
button.ghost.danger {
  border-color: rgba(194, 65, 75, 0.3);
  color: var(--danger);
}

button.ghost.danger:hover {
  border-color: rgba(194, 65, 75, 0.6);
  background: #fff5f6;
}

button.ghost.danger:disabled:hover {
  border-color: rgba(194, 65, 75, 0.3);
  background: #ffffff;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.loading {
  color: var(--accent);
  opacity: 0.7;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #96a1ae;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

a {
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-top: 22px;
  color: #273445;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0;
}

p,
.muted {
  color: var(--muted);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(58, 82, 108, 0.28), transparent),
    var(--sidebar);
  color: #eaf0f6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.mark {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

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

.brand strong {
  font-size: 16px;
}

.brand span {
  margin-top: 2px;
  color: #9fb0c2;
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

body:not(.is-logged-in) .side-nav {
  display: none;
}

.nav-group {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-heading {
  padding: 0 10px 4px;
  color: #8494a6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #c8d3df;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: block;
  flex: 0 0 24px;
  padding: 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e1eb;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.side-nav a.active {
  border-color: rgba(147, 197, 253, 0.35);
  background: #f7f9fc;
  color: #101720;
}

.side-nav a.active .nav-icon {
  background: #2563eb;
  color: #ffffff;
}

.sidebar-note {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: #dbe5ef;
}

.sidebar-note strong {
  font-size: 13px;
}

.sidebar-note span {
  color: #9fb0c2;
  font-size: 12px;
  line-height: 1.6;
}

body:not(.is-logged-in) .sidebar-note {
  display: none;
}

@media (max-height: 840px) {
  .sidebar-note {
    display: none;
  }
}

main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  margin: -24px -24px 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(244, 246, 248, 0.9);
  backdrop-filter: blur(18px);
}

.topbar p {
  margin-top: 5px;
  max-width: 760px;
}

.topbar-actions,
.table-actions,
.list-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-color: var(--stroke);
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

.mobile-menu-button span:first-child {
  position: relative;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-menu-button span:first-child::before,
.mobile-menu-button span:first-child::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-menu-button span:first-child::before {
  top: -5px;
}

.mobile-menu-button span:first-child::after {
  top: 5px;
}

.list-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-result {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--muted);
  line-height: 1.55;
}

.inline-result.success {
  border-color: rgba(0, 133, 111, 0.3);
  background: #f1fbf8;
  color: var(--good);
}

.inline-result.warn {
  border-color: rgba(168, 106, 9, 0.3);
  background: #fffaf0;
  color: var(--warn);
}

.inline-result.danger {
  border-color: rgba(194, 65, 75, 0.32);
  background: #fff5f6;
  color: var(--danger);
}

.app-shell {
  max-width: 1520px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.panel,
.dashboard-main,
.process-rail,
.login-card,
.login-copy {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  margin: 0 0 18px;
  padding: 18px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
      "top"
      "copy"
      "card";
  gap: 16px;
  width: min(440px, 100%);
  max-width: 440px;
  margin: 0 auto;
  align-items: start;
}

.login-top {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0f1722;
  font-size: 15px;
}

.login-mark {
  width: 36px;
  height: 36px;
  display: block;
  border: 1px solid #d4dfec;
  border-radius: 8px;
  background: #ffffff;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(28, 42, 56, 0.08);
}

.login-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d4dfec;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #314052;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.login-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  padding: 32px 28px 28px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 52%),
    #ffffff;
}

.login-copy h2 {
  max-width: 560px;
  color: #0f1722;
  font-size: 32px;
  line-height: 1.12;
}

.login-copy h3 {
  margin-top: 4px;
  max-width: 620px;
  color: #182435;
  font-size: 24px;
  line-height: 1.28;
}

.login-copy p {
  max-width: 640px;
  line-height: 1.75;
}

.login-card {
  grid-area: card;
  padding: 24px;
  align-self: start;
  border-top: 4px solid var(--accent);
}

.login-card h2 {
  font-size: 22px;
}

.login-card-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.login-lock {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--accent);
}

.login-lock::before {
  content: "";
  width: 16px;
  height: 12px;
  display: block;
  border: 2px solid currentColor;
  border-radius: 4px;
  box-shadow: 0 -8px 0 -3px #eef4ff, 0 -8px 0 -1px currentColor;
}

.login-helper {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.login-process {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 2px 0 0;
  list-style: none;
  counter-reset: loginSteps;
}

.login-process li {
  position: relative;
  min-height: 58px;
  padding: 10px 12px 10px 46px;
  border: 1px solid #dce5ef;
  border-radius: var(--radius-sm);
  background: #f9fbfd;
  counter-increment: loginSteps;
}

.login-process li::before {
  content: counter(loginSteps);
  position: absolute;
  left: 12px;
  top: 13px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.login-process strong,
.login-process span {
  display: block;
}

.login-process span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  margin-top: 28px;
}

.login-flow span {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: #314052;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.client-downloads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 0;
  padding: 14px;
  border: 1px solid #cfe0f2;
  border-radius: var(--radius);
  background: #f8fbff;
}

.login-copy .client-downloads {
  display: block;
  margin-top: 0;
}

.login-copy .client-downloads > div:first-child {
  margin-bottom: 10px;
}

.manual-downloads {
  margin-top: 12px;
}

.client-downloads strong,
.client-downloads span {
  display: block;
}

.client-downloads strong {
  font-size: 15px;
}

.client-downloads span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  gap: 8px;
  flex-direction: column;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: normal;
  text-align: center;
  width: 100%;
}

.download-link:hover {
  filter: brightness(0.96);
}

.download-link.primary {
  border-color: #244ed1;
  background: #3b64e8;
  color: #ffffff;
}

.download-link-android {
  border-color: #087766;
  background: #0c8d78;
  color: #ffffff;
}

.download-link-manual {
  border-color: #5360bd;
  background: #6874d9;
  color: #ffffff;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.compact-title {
  min-height: auto;
  margin-top: 18px;
  padding-bottom: 8px;
}

.compact-title h3 {
  margin-top: 0;
}

.hero-title {
  align-items: flex-start;
}

.surface-label {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.dashboard-main,
.process-rail {
  padding: 18px;
}

.process-rail {
  align-self: start;
}

.process-rail h3 {
  margin-top: 0;
}

.process-rail ol {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
  counter-reset: steps;
}

.process-rail li {
  position: relative;
  min-height: 62px;
  padding: 10px 10px 10px 46px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  counter-increment: steps;
}

.process-rail li::before {
  content: counter(steps);
  position: absolute;
  left: 10px;
  top: 12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--accent);
  font-weight: 900;
}

.process-rail strong,
.process-rail span {
  display: block;
}

.process-rail span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ops-board,
.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.workflow-card,
.policy-card,
.context-card,
.form-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.workflow-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.workflow-card h3,
.policy-card strong {
  margin-top: 0;
  color: var(--text);
}

.workflow-card p {
  margin-top: 7px;
  line-height: 1.65;
}

.text-link {
  align-self: flex-start;
  white-space: nowrap;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-overview {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
  gap: 12px;
  margin-top: 14px;
}

.overview-card {
  align-self: start;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.overview-card-wide {
  grid-row: auto;
}

.overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke-soft);
}

.overview-card-head h3 {
  margin-top: 0;
}

.dashboard-progress {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.progress-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(0, 133, 111, 0.07));
}

.progress-hero strong,
.progress-hero span,
.progress-empty strong,
.progress-empty span {
  display: block;
}

.progress-hero span,
.progress-empty span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.progress-hero b {
  color: #0f1722;
  font-size: 34px;
  line-height: 1;
}

.progress-row {
  display: grid;
  gap: 7px;
}

.progress-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #273445;
  font-weight: 800;
}

.progress-row small {
  color: var(--muted);
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: var(--accent);
}

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

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

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

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-strip span,
.snapshot-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.metric-strip strong,
.snapshot-item strong,
.snapshot-item span {
  display: block;
}

.metric-strip strong {
  margin-bottom: 4px;
  color: #0f1722;
  font-size: 18px;
}

.progress-empty {
  padding: 14px;
  border: 1px dashed var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.progress-empty .text-link {
  display: inline-flex;
  margin-top: 10px;
}

.signal-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.signal-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.signal-item:hover {
  border-color: #adc1d8;
  background: #f3f7fb;
}

.signal-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.signal-item.good .signal-dot {
  background: var(--good);
}

.signal-item.warn .signal-dot {
  background: var(--warn);
}

.signal-item.danger .signal-dot {
  background: var(--danger);
}

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

.signal-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.activity-list,
.quick-action-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.activity-item,
.quick-action-item {
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.activity-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.activity-item:hover,
.quick-action-item:hover {
  border-color: #adc1d8;
  background: #f3f7fb;
}

.activity-item strong,
.activity-item small,
.quick-action-item strong,
.quick-action-item small {
  display: block;
}

.quick-action-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item strong {
  overflow-wrap: anywhere;
}

.activity-item small,
.quick-action-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.activity-item em {
  align-self: start;
  color: var(--muted-2);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.quick-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--stroke-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.quick-action-item.good {
  border-left-color: var(--good);
}

.quick-action-item.warn {
  border-left-color: var(--warn);
}

.quick-action-item.danger {
  border-left-color: var(--danger);
}

.quick-action-item b {
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

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

.snapshot-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.snapshot-item strong {
  overflow: hidden;
  margin-top: 5px;
  color: #0f1722;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
}

.manual-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.manual-actions a:hover {
  border-color: #adc1d8;
  background: #f3f7fb;
}

.policy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.policy-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
}

.policy-card span {
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #b8c8d8;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 15px;
}

.empty-state span {
  line-height: 1.6;
}

.table-wrap .empty-state {
  margin: 4px 0;
}

.primary-policy {
  border-color: rgba(0, 133, 111, 0.28);
  background: #f1fbf8;
}

.toolbar,
.import-box,
.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.toolbar,
.import-box,
.form-row,
.login-form,
.form-grid {
  margin-top: 14px;
}

.toolbar input:first-child {
  min-width: min(560px, 100%);
}

.audit-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr);
  align-items: stretch;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
}

.form-card {
  margin-top: 14px;
  padding: 14px;
}

.choice-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.role-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.role-guide div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.role-guide strong,
.role-guide span {
  display: block;
}

.role-guide span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.advanced-panel {
  margin-top: 10px;
  padding: 10px 12px 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.advanced-panel summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.notice-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 133, 111, 0.25);
  border-radius: var(--radius);
  background: #f1fbf8;
  color: var(--text);
  line-height: 1.55;
}

.notice-card span {
  color: var(--muted);
}

.appstore-status {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.appstore-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--panel-2);
}

.appstore-status-row strong {
  font-size: 0.92rem;
}

.appstore-status-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.appstore-status-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.login-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.login-form input,
.activation-grid input,
.login-form button,
.activation-grid button {
  min-height: 42px;
}

.membership-grid {
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(140px, 0.7fr) minmax(150px, 0.7fr) minmax(180px, 0.9fr) auto;
}

.membership-advanced-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) auto;
}

.admin-user-grid {
  grid-template-columns: 1fr 1fr minmax(150px, 0.8fr) minmax(180px, 0.9fr) minmax(140px, 0.7fr) auto;
}

.entry-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.team-grid {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
}

.subscription-grid {
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr) minmax(140px, 0.5fr) auto auto;
  align-items: center;
}

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

.activation-grid button {
  width: 100%;
}

.appstore-grid {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  justify-content: start;
}

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

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.integration-card {
  margin-top: 16px;
}

.integration-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.integration-grid .check-line {
  align-self: center;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.assistant-side-collapsed .assistant-layout {
  grid-template-columns: minmax(0, 1fr);
}

.assistant-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.assistant-main,
.assistant-side {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.assistant-main {
  min-height: 620px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.assistant-messages {
  min-height: 420px;
  max-height: 58vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff, #ffffff 260px);
}

.assistant-message,
.assistant-empty {
  max-width: min(720px, 88%);
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
  color: #273445;
  font-size: 15.5px;
  line-height: 1.75;
}

.assistant-message strong,
.assistant-empty strong {
  color: #17212c;
  font-size: 12px;
}

.assistant-message.from-user {
  align-self: flex-end;
  border-color: rgba(37, 99, 235, 0.24);
  background: #edf4ff;
}

.assistant-message.from-ai {
  align-self: flex-start;
}

.assistant-message.loading {
  color: var(--muted);
}

.assistant-composer textarea {
  font-size: 15.5px;
  line-height: 1.65;
}

.assistant-empty {
  align-self: center;
  margin: auto 0;
  text-align: center;
}

.assistant-empty span {
  color: var(--muted);
}

.assistant-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--stroke);
  background: var(--panel-2);
}

.assistant-drag-over .assistant-composer {
  outline: 2px dashed rgba(37, 99, 235, 0.55);
  outline-offset: -8px;
  background: #eef6ff;
}

.assistant-attachments {
  display: grid;
  gap: 8px;
}

.assistant-attachments input[type="file"] {
  display: none;
}

.assistant-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-attachment {
  max-width: min(360px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.assistant-attachment strong {
  display: block;
  overflow: hidden;
  color: #17212c;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-attachment small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.assistant-actions {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.assistant-knowledge-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #273445;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.assistant-knowledge-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.assistant-send-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.assistant-utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.assistant-side {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 120px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.assistant-side-collapsed .assistant-side {
  display: none;
}

.assistant-side-summary {
  display: grid;
  gap: 8px;
}

.assistant-side h3 {
  margin-top: 0;
}

.assistant-side-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.assistant-side-tabs button {
  min-height: 30px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 12px;
}

.assistant-side-tabs button span {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f7;
  color: #536173;
  font-size: 11px;
  line-height: 18px;
}

.assistant-side-tabs button.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: #edf4ff;
  color: var(--accent);
}

.assistant-side-tabs button.active span {
  background: #dbeafe;
  color: var(--accent);
}

.assistant-side-panels {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.assistant-side-panel {
  display: none;
  gap: 10px;
}

.assistant-side-panel.active {
  display: grid;
}

.assistant-side-panel h3 {
  margin-top: 0;
}

.assistant-prompt {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.assistant-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-message-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.assistant-message-sources span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.assistant-message-sources button {
  max-width: 180px;
  overflow: hidden;
  justify-content: flex-start;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-follow-up {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.assistant-follow-up span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.assistant-follow-up-button {
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  justify-content: flex-start;
  color: var(--accent);
  text-align: left;
  white-space: normal;
}

.assistant-message-sources button.active {
  border-color: rgba(37, 99, 235, 0.44);
  background: #edf4ff;
  color: var(--accent);
}

.assistant-source-detail {
  flex-basis: 100%;
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: #f8fbff;
}

.assistant-source-detail strong,
.assistant-source-detail small {
  display: block;
  line-height: 1.35;
}

.assistant-source-detail strong {
  color: #17212c;
  font-size: 12px;
}

.assistant-source-detail small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-source-detail p {
  max-height: 190px;
  overflow: auto;
  margin: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
}

.mini-button {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.assistant-insights,
.assistant-actions-list,
.assistant-plan-list,
.assistant-issue-list,
.assistant-knowledge-list {
  display: grid;
  gap: 8px;
}

.assistant-health {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius);
  background: #f8fbff;
}

.assistant-health div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.assistant-health strong {
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.assistant-health span {
  color: #314052;
  font-size: 13px;
  font-weight: 700;
}

.assistant-health p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-health.warn {
  border-color: rgba(168, 106, 9, 0.3);
  background: #fffaf0;
}

.assistant-health.good {
  border-color: rgba(8, 119, 95, 0.28);
  background: #f1fbf8;
}

.assistant-insight {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: start;
  padding: 10px 11px;
  border-color: var(--stroke);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  white-space: normal;
}

.assistant-insight:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: #f8fbff;
}

.assistant-insight span,
.assistant-insight strong {
  font-size: 12px;
  line-height: 1.3;
}

.assistant-insight strong {
  color: var(--accent);
}

.assistant-insight small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-insight.warn {
  border-color: rgba(168, 106, 9, 0.3);
  background: #fffaf0;
}

.assistant-insight.good {
  border-color: rgba(8, 119, 95, 0.28);
  background: #f1fbf8;
}

.assistant-action {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
  padding: 10px 11px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  white-space: normal;
  border-radius: 8px;
}

.assistant-action:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: #f8fbff;
}

.assistant-action span {
  min-width: 24px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.assistant-action strong {
  font-size: 12px;
  line-height: 1.35;
}

.assistant-action small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-action-buttons {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.assistant-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.assistant-plan strong {
  display: block;
  color: #17212c;
  font-size: 12px;
  line-height: 1.35;
}

.assistant-plan small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-plan.created {
  background: #f8fafc;
}

.assistant-issue {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.assistant-issue.warn {
  border-color: rgba(168, 106, 9, 0.3);
  background: #fffaf0;
}

.assistant-issue strong {
  display: block;
  color: #17212c;
  font-size: 12px;
  line-height: 1.35;
}

.assistant-issue small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-issue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.assistant-side-panel input[type="file"] {
  display: none;
}

.assistant-context-popover {
  position: relative;
}

.assistant-context-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  width: min(300px, calc(100vw - 32px));
  max-height: 320px;
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  margin-top: 0;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.assistant-context-popover:hover .assistant-context-panel,
.assistant-context-popover:focus-within .assistant-context-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.assistant-knowledge-ocr-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.assistant-knowledge-ocr-controls select {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #ffffff;
  color: #314052;
  font-size: 12px;
}

.assistant-knowledge-toolbar,
.assistant-knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.assistant-knowledge-toolbar {
  margin-bottom: 8px;
}

.assistant-knowledge-analytics {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.assistant-knowledge-analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.assistant-knowledge-analytics-grid div,
.assistant-knowledge-analytics-section {
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #f8fafc;
}

.assistant-knowledge-analytics-grid strong {
  display: block;
  color: #17212c;
  font-size: 16px;
  line-height: 1.2;
}

.assistant-knowledge-analytics-grid span,
.assistant-knowledge-analytics-section small {
  color: var(--muted);
  font-size: 12px;
}

.assistant-knowledge-analytics-section {
  display: grid;
  gap: 6px;
}

.assistant-knowledge-analytics-section p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: #314052;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.assistant-knowledge-analytics-section p span {
  flex: 0 0 auto;
  color: var(--muted);
}

.assistant-knowledge-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.assistant-knowledge-main {
  min-width: 0;
}

.assistant-knowledge-item strong {
  display: block;
  overflow: hidden;
  color: #17212c;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-knowledge-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.assistant-knowledge-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.assistant-knowledge-preview details {
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #f8fafc;
}

.assistant-knowledge-preview summary {
  cursor: pointer;
  color: #314052;
  font-size: 12px;
  font-weight: 700;
}

.assistant-knowledge-preview p {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
}

.assistant-knowledge-job {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: var(--radius);
  background: #f8fbff;
}

.assistant-knowledge-job-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #314052;
  font-size: 12px;
}

.assistant-knowledge-job-head strong {
  color: var(--accent);
}

.assistant-knowledge-progress {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #dbeafe;
}

.assistant-knowledge-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.18s ease;
}

.assistant-knowledge-job-files {
  display: grid;
  gap: 5px;
}

.assistant-knowledge-job-files div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-knowledge-job-files span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-knowledge-job-files strong {
  color: #314052;
}

.assistant-knowledge-job-files small {
  grid-column: 1 / -1;
  color: var(--danger);
}

.assistant-knowledge-job-files .failed strong {
  color: var(--danger);
}

.assistant-side-empty {
  padding: 10px;
  border: 1px dashed var(--stroke);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
}

.assistant-panel-more {
  width: 100%;
  min-height: 32px;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.assistant-preference {
  min-height: 86px;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.assistant-side-details {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.assistant-side-details summary {
  cursor: pointer;
  color: #273445;
  font-size: 12px;
  font-weight: 700;
}

.assistant-side-details[open] summary {
  margin-bottom: 8px;
}

.assistant-context {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.assistant-context div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-context strong {
  color: #314052;
}

.context-card {
  align-self: start;
  margin-top: 14px;
  padding: 16px;
}

.context-card h3 {
  margin-top: 0;
}

.context-card p {
  margin-top: 8px;
  line-height: 1.7;
}

.provider-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.provider-strip span {
  padding: 5px 8px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: #ffffff;
  color: #314052;
  font-size: 12px;
  font-weight: 800;
}

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

.compact-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 10px;
  color: #0f1722;
  font-size: 26px;
  line-height: 1;
}

.table-wrap {
  overflow: auto;
  margin-top: 14px;
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

table {
  width: 100% !important;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.select-col {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.select-col input {
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: #566475;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #273445;
}

td p {
  margin-top: 2px;
  font-size: 12px;
}

tr:hover td {
  background: #f8fbff;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-list {
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
}

.list-item strong {
  font-size: 14px;
}

.list-item.selected {
  border-color: rgba(37, 99, 235, 0.48);
  background: #f2f7ff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 133, 111, 0.24);
  border-radius: 999px;
  color: var(--good);
  background: #f1fbf8;
  font-size: 12px;
  font-weight: 700;
}

.muted-pill {
  border-color: #dce4ed;
  color: var(--muted);
  background: #f7f9fb;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #314052;
  font-weight: 700;
}

.file-field {
  min-width: min(420px, 100%);
  flex: 1 1 auto;
}

.token-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-radius: var(--radius);
  background: #f2f7ff;
  color: var(--text);
  overflow-wrap: anywhere;
}

.token-box code {
  display: block;
  margin-top: 8px;
  color: var(--good);
}

.legal-main {
  width: min(900px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.legal-panel {
  display: grid;
  gap: 14px;
  line-height: 1.72;
}

.legal-panel h1 {
  margin-bottom: 4px;
}

.legal-panel h2 {
  margin-top: 12px;
}

.legal-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
}

.legal-links {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: 13px;
}

.login-legal-links {
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.login-legal-links .beian-link {
  margin-left: auto;
  white-space: nowrap;
}

.activation-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dce5ef;
  border-radius: var(--radius);
  background: #f8fafc;
}

.activation-panel summary {
  color: #17212c;
  cursor: pointer;
  font-weight: 800;
}

.activation-helper {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.legal-links a {
  color: var(--muted);
  text-decoration: none;
}

.legal-links a:hover,
.legal-back:hover {
  color: var(--text);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.danger-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.danger-confirm-dialog {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(194, 65, 75, 0.28);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.danger-confirm-head,
.danger-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.danger-confirm-head strong {
  color: var(--danger);
}

.danger-confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.danger-confirm-dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.danger-confirm-dialog code {
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #fff5f6;
  color: var(--danger);
}

.danger-confirm-actions {
  justify-content: flex-end;
}

@media (max-width: 1260px) {
  .dashboard-grid,
  .split-layout,
  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .integration-grid {
    grid-template-columns: 1fr;
  }

  .process-rail {
    order: -1;
  }

  .stats-grid,
  .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-overview {
    grid-template-columns: 1fr;
  }

  .overview-card-wide {
    grid-row: auto;
  }

  .membership-grid,
  .membership-advanced-grid,
  .admin-user-grid,
  .entry-grid,
  .team-grid,
  .subscription-grid,
  .policy-grid,
  .role-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .login-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "copy"
      "card";
  }
}

@media (max-width: 860px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    grid-template-columns: 1fr;
  }

  body.is-logged-in {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0;
    z-index: 40;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.34);
    overscroll-behavior: contain;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .brand {
    margin-bottom: 10px;
  }

  .sidebar-note {
    display: none;
  }

  .side-nav {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 18px;
  }

  .side-nav a {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .nav-group {
    grid-column: auto;
    gap: 6px;
    padding-top: 14px;
    margin-top: 8px;
  }

  .nav-heading {
    padding-top: 2px;
    font-size: 12px;
  }

  main {
    padding: 16px;
  }

  body:not(.is-logged-in):not(.legal-page) main {
    padding: 72px 14px 24px;
    align-items: start;
  }

  .login-shell {
    grid-template-areas:
      "top"
      "copy"
      "card";
    gap: 12px;
  }

  @media (min-width: 640px) {
    .login-shell {
      margin-left: 80px;
      margin-right: auto;
    }
  }

  .login-top {
    min-height: 36px;
  }

  .login-brand {
    font-size: 13px;
  }

  .login-mark {
    width: 32px;
    height: 32px;
  }

  .login-help {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .login-card-title {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .login-lock {
    width: 34px;
    height: 34px;
  }

  .login-form {
    gap: 8px;
    margin-top: 12px;
  }

  .login-form input,
  .activation-grid input,
  .login-form button,
  .activation-grid button {
    min-height: 40px;
  }

  .activation-panel {
    margin-top: 12px;
    padding: 10px;
  }

  .activation-helper {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -16px -16px 16px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 12px;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .topbar > div:first-of-type {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .topbar p {
    display: none;
  }

  .topbar-actions {
    grid-column: 1 / -1;
  }

  .topbar-actions,
  .client-downloads,
  .section-title,
  .toolbar,
  .import-box,
  .form-row,
  .list-item,
  .workflow-card {
    align-items: stretch;
    flex-direction: column;
  }

  .client-downloads {
    grid-template-columns: 1fr;
  }

  .download-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .download-link {
    min-width: 0;
    padding: 0 10px;
    min-height: 42px;
  }

  .manual-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: stretch;
  }

  .stats-grid,
  .compact-stats,
  .metric-strip,
  .snapshot-grid,
  .form-grid,
  .login-form,
  .assistant-actions,
  .audit-toolbar,
  .appstore-grid,
  .membership-grid,
  .membership-advanced-grid,
  .workspace-grid,
  .admin-user-grid,
  .entry-grid,
  .team-grid,
  .activation-grid,
  .subscription-grid,
  .assistant-layout,
  .policy-grid,
  .role-guide,
  .ops-board {
    grid-template-columns: 1fr;
  }

  .progress-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-item,
  .quick-action-item {
    grid-template-columns: 1fr;
  }

  .activity-item em {
    white-space: normal;
  }

  .assistant-utility-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .assistant-utility-actions button {
    width: 100%;
  }

  .assistant-send-actions {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .assistant-send-actions button {
    width: 100%;
  }

  .assistant-title-actions {
    width: 100%;
    justify-content: stretch;
  }

  .assistant-title-actions .pill,
  .assistant-title-actions button {
    flex: 1 1 0;
    justify-content: center;
  }

  .assistant-main {
    min-height: 500px;
  }

  .assistant-side {
    position: static;
    max-height: none;
    overflow: visible;
    order: 1;
  }

  .assistant-side-panels {
    overflow: visible;
    padding-right: 0;
  }

  .assistant-message,
  .assistant-empty {
    max-width: 100%;
  }

  .panel,
  .dashboard-main,
  .process-rail,
  .login-card,
  .login-copy {
    padding: 14px;
  }

  .login-copy {
    min-height: auto;
    gap: 14px;
  }

  .login-copy h2 {
    font-size: 23px;
  }

  .login-copy h3 {
    margin-top: 6px;
    font-size: 18px;
    line-height: 1.35;
  }

  .login-copy p {
    line-height: 1.65;
  }

  .login-process {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .login-process li {
    min-height: 42px;
    padding: 10px 9px;
  }

  .login-process li::before,
  .login-process span {
    display: none;
  }

  .login-process strong {
    font-size: 12px;
    text-align: center;
  }

  .client-downloads {
    margin-top: 16px;
    padding: 12px;
  }

  .login-copy .client-downloads {
    margin-top: 0;
  }
}
