:root {
  --bg: #f6f5f1;
  --paper: #fffefa;
  --surface: #ffffff;
  --surface-soft: #f1f1ed;
  --text: #111111;
  --muted: #74736d;
  --line: #d9d8d0;
  --line-strong: #b9b7ad;
  --accent: #b31f24;
  --gold: #d9ac1c;
  --blue: #0b63ce;
  --blue-soft: #e9f1ff;
  --green: #1d7a54;
  --green-soft: #eaf6ef;
  --amber: #9b6515;
  --amber-soft: #fff2d8;
  --red: #b31f24;
  --red-soft: #fff0ef;
  --radius: 8px;
  --radius-sm: 6px;
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.full-loader {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--muted);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 520px);
  align-items: center;
  gap: clamp(40px, 7vw, 120px);
  padding: clamp(28px, 6vw, 92px);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px) 0 0 / 88px 88px,
    var(--bg);
}

.auth-copy {
  max-width: 800px;
}

.brand-lockup,
.sidebar-brand,
.panel-title > div,
.user-chip,
.nav-button,
.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.tab-button,
.file-row,
.mini-button,
.metric span,
.panel-actions {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 16px;
  margin-bottom: clamp(44px, 7vw, 92px);
}

.brand-lockup strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0;
}

.logo-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  overflow: hidden;
}

.logo-mark.small {
  width: 44px;
  height: 44px;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-copy h1,
.hero-panel h1,
.standard-hero h1,
.console-hero h1 {
  margin: 0;
  max-width: 980px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-panel,
.panel,
.standard-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 56px rgba(17, 17, 17, 0.06);
}

.auth-panel {
  padding: 22px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-soft);
}

.segmented button {
  border: 0;
  min-height: 42px;
  background: transparent;
  color: #4c4b46;
  font-weight: 760;
}

.segmented button.active {
  color: #ffffff;
  background: #111111;
}

.auth-form,
.case-form,
.query-form,
.inline-editor {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #2d2c28;
  font-size: 12px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  outline: none;
  font-size: 14px;
}

input,
select {
  min-height: 44px;
}

textarea {
  min-height: 176px;
  resize: vertical;
  line-height: 1.65;
  white-space: pre-wrap;
}

textarea.compact-textarea {
  min-height: 94px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.primary-button,
.secondary-button,
.icon-button,
.tab-button,
.text-button,
.mini-button {
  border: 0;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 780;
  letter-spacing: 0;
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: #111111;
}

.primary-button:hover {
  background: #2a2926;
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  color: #111111;
  background: #ffffff;
  border: 1px solid var(--line);
}

.secondary-button:hover {
  border-color: #111111;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #111111;
  border: 1px solid var(--line);
}

.primary-button:disabled,
.secondary-button:disabled,
.mini-button:disabled {
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 282px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.sidebar-brand {
  gap: 12px;
  min-height: 54px;
  margin-bottom: 34px;
}

.sidebar-brand > div {
  min-width: 0;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.28;
}

.mobile-nav-toggle {
  display: none;
  margin-left: auto;
}

.sidebar-nav {
  display: grid;
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-label {
  padding: 0 12px 3px;
  color: #86847c;
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0;
}

.nav-button {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #44433f;
  justify-content: flex-start;
  gap: 11px;
  font-size: 14px;
  font-weight: 760;
}

.nav-button.active,
.nav-button:hover {
  color: #111111;
  border-color: var(--line);
  background: #ffffff;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.workspace {
  min-width: 0;
}

.topbar {
  height: 70px;
  padding: 0 34px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(280px, 460px) auto;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(246, 245, 241, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.topbar strong {
  display: block;
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 24px;
  line-height: 1;
}

.command-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  color: #34332f;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.command-trigger:hover {
  border-color: #111111;
  background: #ffffff;
}

.command-trigger span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-trigger kbd {
  min-width: 50px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: #4f4d47;
  font-size: 11px;
  font-weight: 820;
  text-align: center;
}

.user-chip {
  gap: 8px;
  justify-content: flex-end;
  color: #1d1c19;
}

.role {
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
}

.page-stack,
.cases-layout,
.issues-layout {
  padding: 30px 34px 46px;
}

.page-stack {
  display: grid;
  gap: 20px;
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--line);
}

.hero-panel h1 {
  font-size: 40px;
}

.console-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(179, 31, 36, 0.06), transparent 34%),
    var(--surface);
  box-shadow: 0 18px 56px rgba(17, 17, 17, 0.05);
}

.console-hero.compact-hero {
  padding: 24px 28px;
}

.console-hero h1 {
  max-width: 760px;
  font-size: 36px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 14px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
}

.standard-hero {
  padding: clamp(24px, 4vw, 44px);
}

.hero-actions,
.quick-actions,
.tab-row,
.upload-row,
.case-summary,
.stat-row,
.table-actions,
.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title.compact > div {
  gap: 9px;
}

.panel-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.stat-row,
.deploy-grid,
.codex-status,
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.home-grid,
.settings-grid,
.query-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.guided-steps,
.quick-start-grid,
.todo-grid,
.admin-kpi-grid,
.admin-console-grid {
  display: grid;
  gap: 16px;
}

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

.guided-step,
.quick-start-card,
.action-empty,
.case-wizard-step,
.case-create-step {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.guided-step {
  min-height: 138px;
  padding: 18px;
}

.guided-step span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: 50%;
  color: #ffffff;
  background: #111111;
  font-size: 13px;
  font-weight: 840;
}

.guided-step strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.guided-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

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

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

.quick-start-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  color: var(--text);
  text-align: left;
}

.quick-start-card svg {
  color: var(--accent);
}

.quick-start-card strong {
  font-size: 16px;
}

.quick-start-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.quick-start-card:hover {
  border-color: #111111;
  transform: translateY(-1px);
}

.todo-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  box-shadow: 0 14px 36px rgba(17, 17, 17, 0.05);
}

.todo-card span,
.todo-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.todo-card strong {
  font-size: 34px;
  line-height: 1;
}

.todo-card.blue strong { color: var(--blue); }
.todo-card.amber strong { color: var(--amber); }
.todo-card.red strong { color: var(--red); }

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

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

.admin-wide {
  grid-column: 1 / -1;
}

.action-empty {
  min-height: 148px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

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

.action-empty span {
  max-width: 360px;
  line-height: 1.6;
}

.compact-settings .panel {
  padding: 18px;
}

.metric {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.metric span {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 9px;
}

.metric strong {
  display: block;
  font-size: 16px;
  line-height: 1.36;
  word-break: break-word;
}

.query-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.query-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.query-form .primary-button {
  grid-column: 1 / -1;
}

.person-search-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.person-search-field .secondary-button {
  min-width: 92px;
  padding: 0 14px;
}

.compact-tabs {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.training-phase-block,
.training-after-block {
  display: grid;
  gap: 12px;
}

.training-certificate-scan {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.training-certificate-scan strong,
.training-certificate-scan span {
  display: block;
}

.training-certificate-scan span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.certificate-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.certificate-query-panel,
.certificate-batch-result {
  display: grid;
  gap: 12px;
}

.certificate-select-panel {
  display: grid;
  gap: 10px;
}

.certificate-search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.certificate-search-row span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.certificate-people-picker {
  max-height: 300px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.certificate-person-card {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  font-size: 13px;
}

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

.certificate-person-card span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.certificate-person-card strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-person-card em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-table {
  max-height: 320px;
  overflow: auto;
}

.reminder-box {
  display: grid;
  gap: 12px;
}

.query-card .reminder-box textarea {
  min-height: 128px;
}

.empty-line {
  min-height: 104px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 12px;
}

.issues-layout {
  display: grid;
  grid-template-columns: 390px minmax(360px, 1fr);
  grid-template-areas:
    "form list"
    "detail detail";
  gap: 20px;
}

.cases-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-areas:
    "form detail"
    "list detail";
  align-items: start;
  gap: 20px;
}

.case-view-switcher {
  padding: 12px;
}

.case-view-switcher .tab-row {
  justify-content: flex-start;
}

.case-list-tools {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.case-saved-views {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.case-view-chip {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.case-view-chip:hover,
.case-view-chip.active {
  border-color: #111111;
}

.case-view-chip.active {
  box-shadow: inset 0 3px 0 var(--accent);
}

.case-view-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.case-view-chip strong {
  font-size: 20px;
  line-height: 1;
}

.case-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.case-search-field > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.case-search-field input {
  min-height: 42px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.case-search-field input:focus {
  border-color: transparent;
  box-shadow: none;
}

.case-filter-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.case-filter-meta strong {
  color: var(--text);
}

.case-filter-meta span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--accent);
}

.cases-layout.focused {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "active";
}

.cases-layout.focused > .panel {
  grid-area: active;
}

.case-hidden-panel {
  display: none;
}

.case-context-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
}

.case-primary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.case-primary-actions .primary-button,
.case-primary-actions .secondary-button {
  text-decoration: none;
}

.cases-layout.focused .cases-list .table-wrap {
  overflow-x: auto;
}

.cases-layout > :nth-child(1),
.issues-layout > :nth-child(1) {
  grid-area: form;
}

.cases-layout > :nth-child(2),
.issues-layout > :nth-child(2) {
  grid-area: list;
}

.cases-layout > :nth-child(3),
.issues-layout > :nth-child(3) {
  grid-area: detail;
}

.cases-layout.focused > .panel {
  grid-area: active;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.check-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #6a6963;
  font-size: 12px;
  font-weight: 780;
  background: var(--surface-soft);
}

tbody tr:hover {
  background: #fbfaf6;
}

.selectable-row {
  cursor: pointer;
}

.selectable-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.pill.green { color: var(--green); background: var(--green-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.muted { color: var(--muted); background: #eeeeea; }

.role-select {
  min-height: 34px;
  width: 98px;
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 760;
}

.case-summary {
  margin-bottom: 14px;
}

.case-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.case-wizard-step {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--muted);
}

.case-wizard-step span {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: inherit;
  font-size: 12px;
  font-weight: 820;
}

.case-wizard-step strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.25;
}

.case-wizard-step.done {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  background: var(--green-soft);
}

.case-wizard-step.active,
.case-wizard-step.processing {
  color: #111111;
  border-color: #111111;
  background: var(--surface);
}

.case-form-wizard {
  gap: 16px;
}

.case-create-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.case-create-step {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 10px 12px;
  color: var(--muted);
  text-align: left;
}

.case-create-step span {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-size: 12px;
  font-weight: 840;
}

.case-create-step strong {
  color: inherit;
  font-size: 13px;
}

.case-create-step.active {
  color: #111111;
  border-color: #111111;
}

.case-create-step.done {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  background: var(--green-soft);
}

.case-form-section {
  display: grid;
  gap: 14px;
}

.case-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.case-create-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.case-create-review div {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.case-create-review span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.case-create-review strong {
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.panel-actions {
  justify-content: flex-end;
}

.panel-subtle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.settings-tabs-panel {
  padding: 12px;
}

.master-toolbar,
.pager-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.master-toolbar {
  margin-bottom: 14px;
}

.master-toolbar input {
  flex: 1 1 260px;
}

.pager-row {
  justify-content: flex-end;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.case-summary span {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #2d2c28;
  font-size: 13px;
}

.case-next-card {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.case-next-card strong {
  font-size: 14px;
}

.case-next-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.case-next-card.green {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  background: var(--green-soft);
}

.case-next-card.amber {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: var(--amber-soft);
}

.case-next-card.blue {
  border-color: color-mix(in srgb, var(--blue) 24%, var(--line));
  background: var(--blue-soft);
}

.case-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(246, 245, 241, 0.72));
}

.case-timeline-step {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.case-timeline-step:last-child {
  border-right: 0;
}

.case-timeline-step.active {
  color: #111111;
  background: rgba(255, 255, 255, 0.62);
}

.case-timeline-step.done {
  color: var(--green);
}

.case-timeline-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: inherit;
  font-size: 12px;
  font-weight: 840;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.case-timeline-mark svg {
  display: block;
  flex: 0 0 auto;
}

.case-timeline-step.done .case-timeline-mark {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: var(--green-soft);
}

.case-timeline-step > div > strong,
.case-timeline-step > div > span,
.case-timeline-step > div > p {
  display: block;
  min-width: 0;
}

.case-timeline-step > div > strong {
  margin-bottom: 4px;
  color: inherit;
  font-size: 13px;
}

.case-timeline-step > div > span {
  overflow: hidden;
  color: #4b4a45;
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-timeline-step > div > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.selected-files-preview {
  display: grid;
  gap: 5px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.selected-files-preview strong {
  font-size: 13px;
}

.selected-files-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.issue-description {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: #2d2c28;
  line-height: 1.65;
  white-space: pre-wrap;
}

.upload-row {
  align-items: center;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.upload-row input[type="file"] {
  flex: 1;
  min-width: 240px;
}

.upload-dropzone {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr) auto;
  gap: 12px;
}

.upload-drop-copy {
  display: grid;
  gap: 4px;
}

.upload-drop-copy strong {
  font-size: 14px;
}

.upload-drop-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-guide {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.case-materials-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr) minmax(0, 1fr);
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.help-step {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.help-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.help-step h3 {
  margin: 10px 0 8px;
  font-size: 16px;
}

.help-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.file-list,
.upload-checklist {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px;
  background: var(--paper);
}

.file-list h3,
.upload-checklist h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.upload-checklist ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: #34332f;
  font-size: 13px;
  line-height: 1.45;
}

.upload-checklist li::marker {
  color: var(--accent);
}

.file-row {
  gap: 9px;
  justify-content: space-between;
  color: #23221f;
  min-height: 40px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.file-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row:last-child {
  border-bottom: 0;
}

.process-button {
  margin-top: 16px;
}

.job-progress,
.package-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.job-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

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

.progress-track div {
  height: 100%;
  border-radius: inherit;
  background: #111111;
  transition: width 0.25s ease;
}

.job-progress p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.job-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.skill-run-proof {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}

.skill-run-proof strong {
  color: var(--text);
  font-size: 12px;
}

.skill-run-proof em {
  color: var(--green);
  font-style: normal;
  font-weight: 760;
}

.skill-run-proof code {
  color: var(--muted);
  font-size: 11px;
}

.package-preview h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.preview-grid {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  font-size: 13px;
}

.preview-grid span {
  color: var(--muted);
}

.preview-grid strong {
  font-weight: 780;
  word-break: break-word;
}

.package-preview-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.package-preview-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.package-preview-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-preview-file:hover {
  border-color: #111111;
}

.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.toggle-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle-row {
  color: #23221f;
  font-weight: 700;
}

.toggle-row input,
.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  color: #34332f;
  font-size: 14px;
}

.tab-row {
  overflow-x: auto;
}

.tab-button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
  color: #34332f;
  padding: 0 14px;
}

.tab-button.active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.inline-editor {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  margin-bottom: 16px;
}

.text-button {
  background: transparent;
  color: var(--accent);
  min-height: 0;
  padding: 0;
}

.text-button.danger {
  color: var(--red);
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: #111111;
  color: #ffffff;
}

.mini-button.danger {
  color: var(--red);
  background: var(--red-soft);
}

.user-edit-row td {
  background: #fbfbf8;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.user-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px 4px;
}

.user-edit-form label {
  min-width: 0;
}

.user-edit-toggle {
  min-height: 42px;
  align-content: center;
}

.user-edit-actions {
  align-self: end;
}

.danger-button {
  min-height: 34px;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(179, 31, 36, 0.22);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 780;
}

.review-mini-list {
  display: grid;
  gap: 10px;
}

.review-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.review-mini-row strong,
.review-mini-row span {
  display: block;
}

.review-mini-row span,
.clean-list {
  color: var(--muted);
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

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

.skill-check {
  min-height: 66px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.skill-check span,
.skill-check strong {
  display: block;
}

.skill-check span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
  word-break: break-all;
}

.skill-check strong {
  font-size: 15px;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.audit-filters {
  display: grid;
  grid-template-columns: 180px minmax(240px, 1fr) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.audit-detail {
  max-width: 520px;
  color: #33322e;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.notice-widget {
  position: relative;
}

.notice-widget .icon-button {
  position: relative;
}

.notice-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.notice-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(360px, 88vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.14);
}

.notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
}

.notice-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.notice-item.unread {
  background: #fbfaf6;
}

.notice-item strong {
  font-size: 13px;
}

.notice-item span,
.notice-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.notice-empty {
  padding: 16px;
  text-align: center;
}

.progress-list,
.version-list {
  display: grid;
  gap: 10px;
}

.progress-row,
.version-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-align: left;
}

.progress-row strong,
.version-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.progress-row span,
.version-row span,
.version-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-mark {
  width: 10px;
  height: 38px;
  border-radius: 999px;
  background: var(--line-strong);
}

.progress-mark.green { background: var(--green); }
.progress-mark.blue { background: var(--blue); }
.progress-mark.amber { background: var(--amber); }
.progress-mark.red { background: var(--red); }

.readiness {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.readiness strong {
  font-size: 14px;
}

.readiness span {
  color: var(--muted);
  font-size: 12px;
}

.readiness.green { color: var(--green); background: var(--green-soft); }
.readiness.amber { color: var(--amber); background: var(--amber-soft); }
.readiness.red { color: var(--red); background: var(--red-soft); }

.manual-confirmation-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #3e2a09;
}

.manual-confirmation-panel strong,
.manual-confirmation-panel span {
  display: block;
}

.manual-confirmation-panel strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.manual-confirmation-panel span,
.manual-confirmation-panel li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.manual-confirmation-panel ul {
  margin: 0;
  padding-left: 18px;
}

.manual-confirmation-panel .secondary-button {
  justify-self: start;
}

.manual-confirmation-details {
  display: grid;
  gap: 10px;
}

.manual-confirmation-details.in-dialog {
  max-height: min(42vh, 420px);
  overflow: auto;
  padding-right: 4px;
}

.manual-confirmation-detail {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--amber) 24%, var(--line));
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
}

.manual-confirmation-detail > strong {
  color: #3e2a09;
  font-size: 13px;
}

.manual-confirmation-detail pre {
  margin: 0;
  white-space: pre-wrap;
  color: #3e2a09;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.65;
}

.manual-confirmation-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.manual-confirmation-table {
  min-width: 720px;
  background: var(--paper);
  font-size: 12px;
}

.manual-confirmation-table th,
.manual-confirmation-table td {
  padding: 9px 10px;
  vertical-align: top;
}

.manual-confirmation-table th {
  color: #3e2a09;
  background: color-mix(in srgb, var(--amber-soft) 64%, #ffffff);
}

.manual-confirmation-table td {
  color: #3e2a09;
  line-height: 1.55;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.skill-check small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.error-line,
.notice-line,
.warning-line {
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
}

.error-line {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(179, 31, 36, 0.20);
}

.notice-line {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(29, 122, 84, 0.18);
}

.warning-line {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(155, 101, 21, 0.20);
}

.danger-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid rgba(179, 31, 36, 0.20);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
}

.danger-notice strong,
.danger-notice span {
  display: block;
}

.danger-notice strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.danger-notice span {
  color: #6b3935;
  font-size: 12px;
  line-height: 1.55;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(21, 21, 19, 0.18);
  backdrop-filter: blur(10px);
}

.command-backdrop {
  align-items: start;
  padding-top: min(12vh, 96px);
}

.command-dialog {
  width: min(680px, 100%);
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.98);
  box-shadow: 0 28px 80px rgba(16, 16, 14, 0.22);
}

.person-picker-dialog {
  width: min(620px, 100%);
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.98);
  box-shadow: 0 28px 80px rgba(16, 16, 14, 0.22);
}

.command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
}

.command-head span,
.command-item div span,
.command-empty {
  color: var(--muted);
  font-size: 12px;
}

.command-head strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.command-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #111111;
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.command-search input {
  min-height: 48px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.command-search input:focus {
  border-color: transparent;
  box-shadow: none;
}

.command-results {
  max-height: min(52vh, 460px);
  display: grid;
  gap: 6px;
  overflow: auto;
  padding: 2px;
}

.person-picker-results {
  max-height: min(56vh, 480px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: auto;
  padding: 2px;
}

.person-picker-item {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.person-picker-item:hover {
  border-color: #111111;
}

.person-picker-item > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
}

.person-picker-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.person-picker-item strong,
.person-picker-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.person-picker-item em,
.person-picker-item small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.command-section-label {
  padding: 8px 8px 2px;
  color: #75736b;
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0;
}

.command-item {
  width: 100%;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.command-item:hover {
  border-color: var(--line);
  background: var(--paper);
}

.command-item div {
  min-width: 0;
}

.command-kind {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 820;
}

.command-hint {
  min-width: 34px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: #56534c;
  font-size: 11px;
  font-weight: 820;
  text-align: center;
}

.command-item strong,
.command-item div span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-item strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.command-empty {
  padding: 24px;
  text-align: center;
}

.command-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.process-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.96);
  box-shadow: 0 28px 80px rgba(16, 16, 14, 0.20);
  text-align: center;
}

.precheck-dialog {
  width: min(620px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.98);
  box-shadow: 0 28px 80px rgba(16, 16, 14, 0.20);
}

.manual-confirmation-dialog {
  width: min(980px, 100%);
}

.manual-confirmation-dialog .preview-grid select {
  width: 100%;
}

.manual-confirmation-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.manual-confirmation-field textarea,
.manual-confirmation-field input {
  color: var(--text);
}

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

.precheck-list span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 12px;
}

.precheck-issues {
  display: grid;
  gap: 8px;
}

.precheck-issues p {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.precheck-issues .blocker {
  color: var(--red);
  background: var(--red-soft);
}

.precheck-issues .warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.dialog-icon.success {
  color: var(--green);
  background: var(--green-soft);
}

.dialog-icon.error {
  color: var(--red);
  background: var(--red-soft);
}

.process-dialog h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.process-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-dialog {
  justify-items: stretch;
  text-align: left;
}

.confirm-dialog .dialog-icon {
  justify-self: center;
}

.confirm-dialog h3,
.confirm-dialog p {
  text-align: center;
}

.confirm-dialog .dialog-actions {
  justify-content: center;
}

.error-line.global {
  margin: 14px 34px 0;
}

.code-block {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: #111111;
  color: #f7f7f2;
  overflow-x: auto;
  line-height: 1.55;
}

.chat-page {
  position: relative;
  height: calc(100vh - 126px);
  min-height: 560px;
  margin: 28px 34px;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbf8;
  box-shadow: 0 18px 56px rgba(17, 17, 17, 0.05);
}

.chat-history {
  min-width: 0;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #f1f0ea;
  overflow: auto;
}

.chat-history-head,
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-history-head {
  padding: 0 4px 12px;
}

.chat-history-head strong,
.chat-history-head span,
.chat-toolbar strong,
.chat-toolbar span {
  display: block;
}

.chat-history-head strong,
.chat-toolbar strong {
  font-size: 15px;
}

.chat-history-head span,
.chat-toolbar div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.chat-conversation-list {
  display: grid;
  gap: 6px;
}

.chat-conversation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.chat-conversation:hover,
.chat-conversation.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.chat-conversation > button {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.chat-conversation > button:first-child {
  padding: 0 8px;
}

.chat-conversation span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-delete {
  justify-content: center;
  color: var(--muted) !important;
}

.chat-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 68px auto minmax(0, 1fr) auto;
}

.chat-toolbar {
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.88);
  backdrop-filter: blur(14px);
}

.chat-new-button {
  min-height: 34px;
  padding: 0 10px;
}

.chat-model-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.chat-model-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.chat-model-picker select {
  min-height: 32px;
  width: auto;
  min-width: 210px;
  padding: 5px 28px 5px 8px;
  border: 0;
  background: transparent;
  font-weight: 760;
}

.chat-privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  line-height: 1.45;
}

.chat-privacy-note.external {
  background: var(--amber-soft);
  color: var(--amber);
}

.chat-privacy-note.empty {
  background: var(--red-soft);
  color: var(--red);
}

.chat-privacy-note span {
  min-width: 0;
}

.chat-messages {
  min-height: 0;
  padding: 28px clamp(20px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.86), rgba(251, 251, 248, 0.92)),
    #fbfbf8;
}

.chat-message {
  width: min(840px, 100%);
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.chat-message.user {
  justify-items: end;
}

.chat-message > strong {
  color: var(--muted);
  font-size: 12px;
}

.chat-message.user > strong {
  text-align: right;
}

.chat-message > div {
  width: fit-content;
  max-width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message.user > div {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.chat-message.pending > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.chat-message.streaming > div::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 3px;
  border-right: 2px solid currentColor;
  vertical-align: -0.16em;
  animation: chatCursorBlink 0.9s steps(2, start) infinite;
}

@keyframes chatCursorBlink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.chat-composer {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.08);
}

.chat-composer textarea {
  min-height: 52px;
  max-height: 140px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  resize: none;
}

.chat-send {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}

.chat-file-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-file-button input {
  display: none;
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-attachments.selected {
  grid-column: 1 / -1;
}

.chat-attachments span {
  max-width: 100%;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.chat-attachments.in-message {
  margin-top: 10px;
}

.chat-attachments.in-message span {
  background: #f7f7f2;
}

.chat-message.user .chat-attachments span {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.chat-attachments em {
  color: var(--muted);
  font-style: normal;
}

.chat-message.user .chat-attachments em {
  color: rgba(255, 255, 255, 0.72);
}

.chat-attachments button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #eeeeea;
  color: var(--muted);
}

.chat-welcome,
.chat-permission-empty,
.chat-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.chat-welcome {
  min-height: 100%;
}

.chat-welcome h2,
.chat-welcome p,
.chat-permission-empty h2,
.chat-permission-empty p {
  margin: 0;
}

.chat-permission-empty {
  min-height: 360px;
}

.chat-error {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 50%;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.12);
}

.provider-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1120px) {
  .auth-page,
  .home-grid,
  .settings-grid,
  .query-duo,
  .cases-layout,
  .issues-layout {
    grid-template-columns: 1fr;
  }

  .cases-layout,
  .issues-layout {
    grid-template-areas:
      "form"
      "list"
      "detail";
  }

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

  .stat-row,
  .deploy-grid,
  .audit-summary,
  .version-grid,
  .guided-steps,
  .quick-start-grid,
  .todo-grid,
  .admin-kpi-grid,
  .case-create-steps,
  .case-create-review,
  .case-wizard-steps,
  .case-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-timeline-step:nth-child(2n) {
    border-right: 0;
  }

  .case-timeline-step:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .admin-console-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    margin-bottom: 0;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .sidebar-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
  }

  .sidebar-nav.mobile-open {
    display: grid;
  }

  .nav-group {
    align-content: start;
  }

  .topbar {
    position: static;
    height: auto;
    padding: 16px;
    gap: 12px;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .command-trigger {
    width: 100%;
  }

  .user-chip {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topbar strong {
    font-size: 26px;
  }

  .page-stack,
  .cases-layout,
  .issues-layout {
    padding: 18px 16px 28px;
  }

  .chat-page {
    height: calc(100vh - 150px);
    min-height: 640px;
    margin: 16px;
    grid-template-columns: 1fr;
    grid-template-rows: 172px minmax(0, 1fr);
  }

  .chat-history {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-workspace {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .chat-conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-message {
    width: 100%;
  }

  .chat-toolbar {
    min-height: 84px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .chat-model-picker {
    order: 3;
    width: 100%;
  }

  .chat-model-picker select {
    flex: 1;
    min-width: 0;
  }

  .chat-messages {
    padding: 16px;
  }

  .chat-composer {
    width: calc(100% - 24px);
    margin-bottom: 12px;
  }

  .auth-page {
    padding: 22px 16px;
    gap: 28px;
  }

  .auth-copy h1,
  .hero-panel h1,
  .standard-hero h1,
  .console-hero h1 {
    font-size: 36px;
  }

  .query-form,
  .two-col,
  .section-split,
  .quick-start-grid,
  .certificate-result,
  .certificate-people-picker,
  .person-picker-results,
  .case-materials-grid,
  .case-saved-views,
  .case-filter-grid,
  .case-create-steps,
  .case-create-review,
  .upload-dropzone,
  .materials-grid,
  .help-grid,
  .inline-editor,
  .audit-summary,
  .audit-filters,
  .version-grid,
  .result-grid,
  .codex-status,
  .stat-row,
  .deploy-grid,
  .skill-check-grid,
  .guided-steps,
  .todo-grid,
  .admin-kpi-grid,
  .case-wizard-steps,
  .case-timeline {
    grid-template-columns: 1fr;
  }

  .case-timeline-step,
  .case-timeline-step:nth-child(2n) {
    border-right: 0;
  }

  .case-timeline-step,
  .case-timeline-step:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .case-timeline-step:last-child {
    border-bottom: 0;
  }

  .person-search-field > div {
    grid-template-columns: 1fr;
  }

  .person-search-field .secondary-button {
    width: 100%;
  }

  .console-hero {
    padding: 20px;
  }

  .command-backdrop {
    padding: 12px;
  }

  .command-dialog {
    align-self: start;
  }

  .command-item {
    grid-template-columns: 62px minmax(0, 1fr) auto;
  }

  .upload-row {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-row input[type="file"] {
    width: 100%;
    min-width: 0;
  }

  .progress-row,
  .version-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .progress-row .pill {
    grid-column: 2;
    justify-self: start;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  td {
    padding: 7px 0;
    border-bottom: 0;
    word-break: break-word;
  }

  td[data-label] {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  td[data-label] > .pill,
  td[data-label] > .table-actions {
    justify-self: start;
  }

  td + td {
    border-top: 1px solid var(--line);
  }

  .todo-card {
    min-height: 92px;
  }

  .master-toolbar,
  .pager-row {
    align-items: stretch;
    flex-direction: column;
  }
}
