:root {
  color-scheme: light;
  --left-width: 224px;
  --ai-width: 320px;
  --handle-width: 8px;
  --registration-table-width: 2092px;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #dbe4f0;
  --text: #102033;
  --muted: #607086;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --red: #d91f45;
  --red-soft: #fff0f3;
  --green: #157f53;
  --amber: #a16207;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--left-width) var(--handle-width) minmax(0, 1fr) var(--handle-width) var(--ai-width);
  min-height: 100vh;
}

body[data-embedded="true"] {
  height: 100%;
  overflow: hidden;
}

body[data-embedded="true"] .app-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-embedded="true"] .sidebar,
body[data-embedded="true"] .main-content,
body[data-embedded="true"] .ai-dock {
  height: 100%;
}

.left-restore-zone {
  display: none;
}

.app-shell[data-left-visible="false"] {
  grid-template-columns: 0 0 minmax(0, 1fr) var(--handle-width) var(--ai-width);
}

/* 中文维护说明：嵌入 5199 且 AI 隐藏时，右侧浮动猫由 fixed 定位承载，主网格最后一列必须归零，避免页面右侧残留 88px 空白。 */
.app-shell[data-ai-visible="false"] {
  grid-template-columns: var(--left-width) var(--handle-width) minmax(0, 1fr) 0 0;
}

.app-shell[data-left-visible="false"][data-ai-visible="false"] {
  grid-template-columns: 0 0 minmax(0, 1fr) 0 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  overflow: hidden;
  padding: 18px 14px;
  background: #fff;
}

.app-shell[data-left-visible="false"] .sidebar {
  padding: 0;
  border: 0;
}

.app-shell[data-left-visible="false"] .left-restore-zone {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  display: block;
  width: 12px;
  height: 100vh;
  cursor: e-resize;
}

.resize-handle {
  position: relative;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.resize-handle::before {
  content: "";
  position: absolute;
  inset: 0 3px;
  background: var(--line);
}

.resize-handle:hover::before,
.resize-handle.dragging::before {
  background: var(--blue);
}

.resize-handle-left {
  border-left: 1px solid var(--line);
}

.resize-handle-ai {
  border-right: 1px solid var(--line);
}

.app-shell[data-left-visible="false"] .resize-handle-left,
.app-shell[data-ai-visible="false"] .resize-handle-ai {
  display: none;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

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

.brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px minmax(96px, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #26374f;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: var(--blue-soft);
  color: #123f91;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: inherit;
  font-weight: 700;
}

.nav-item em {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-style: normal;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.sidebar-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.sidebar-card span,
.sidebar-card strong {
  display: block;
}

.sidebar-card span {
  color: var(--muted);
  font-size: 13px;
}

.sidebar-card strong {
  margin-top: 8px;
  line-height: 1.5;
}

.app-version {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  min-width: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px;
}

body[data-embedded="true"] .main-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.ai-dock {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: #fff;
}

.ai-float-hit-layer {
  display: none;
}

.foundation-cat-ai-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
}

.app-shell[data-ai-visible="false"] .ai-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 88px;
  height: 112px;
  border-radius: 8px;
  background: transparent;
}

.app-shell[data-ai-visible="false"] .ai-float-hit-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  cursor: move;
  background: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.primary-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #26374f;
}

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

.page {
  display: none;
}

.page.active {
  display: block;
}

body[data-embedded="true"] #registrations.page.active {
  display: flex;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  overflow: hidden;
}

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

.metric-card,
.panel,
.customer-card,
.usage-list article,
.risk-board article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.stacked-panels {
  display: grid;
  gap: 16px;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: -4px 0 14px;
}

.compact-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.compact-metric-grid article {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.compact-metric-grid span,
.compact-metric-grid strong {
  display: block;
}

.compact-metric-grid span {
  color: var(--muted);
  font-size: 13px;
}

.compact-metric-grid strong {
  margin-top: 8px;
  font-size: 28px;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

body[data-embedded="true"] #registrations > .panel {
  display: flex;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 12px 16px 10px;
}

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

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.panel-heading span {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
}

.stage-row,
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(126px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stage-card,
.pipeline div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #35465e;
}

.stage-card span,
.pipeline span {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.stage-card.strong {
  border-color: #9bbcff;
  background: var(--blue-soft);
}

.stage-card.risk {
  border-color: #ffc4cf;
  background: var(--red-soft);
}

.task-list,
.notice-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-list li,
.notice-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f8;
}

.task-list span,
.notice-list span {
  color: var(--muted);
  text-align: right;
}

.change-log-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #edf2f8;
}

.change-log-title {
  margin-bottom: 10px;
  font-weight: 800;
}

.change-log-panel dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.change-log-panel dl div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
}

.change-log-panel dt {
  color: var(--muted);
}

.change-log-panel dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.empty-log {
  margin: 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tab {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #394b63;
}

.tab.active {
  border-color: #9bbcff;
  background: var(--blue-soft);
  color: #123f91;
  font-weight: 700;
}

#registrations > .panel {
  padding-top: 12px;
}

#registrations .tabs {
  margin-bottom: 8px;
}

.registration-table-frame {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

body[data-embedded="true"] #registrations .registration-table-frame {
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
}

body[data-embedded="true"] #registrations .table-scroll {
  /* 中文维护说明：5199 iframe 嵌入时，固定宽注册线索表只能在本容器内部横向滚动，不能反向撑开外层页面。 */
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-embedded="true"] #registrations .tabs,
body[data-embedded="true"] #registrations .registration-pagination {
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
}

.table-scroll table {
  min-width: 760px;
}

.table-scroll .registration-table {
  width: var(--registration-table-width, 2092px);
  min-width: var(--registration-table-width, 2092px);
  table-layout: fixed;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid #edf2f8;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f6f9fd;
  color: #435773;
  font-size: 13px;
}

.registration-table th,
.registration-table td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.45;
}

#registrations .table-scroll {
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#registrations .table-scroll::-webkit-scrollbar {
  width: 12px;
  height: 0;
}

#registrations .table-scroll::-webkit-scrollbar-track {
  background: #edf3fa;
  border-radius: 999px;
}

#registrations .table-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #edf3fa;
  border-radius: 999px;
  background: #8ea4c4;
}

#registrations .table-scroll::-webkit-scrollbar-thumb:hover {
  background: #627895;
}

.registration-bottom-scroll {
  /* 中文维护说明：注册线索只保留这一处底部横向滚动体，表格内容区自身横向滚动必须隐藏。 */
  flex: 0 0 16px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid #dbe5f1;
  background: #f6f9fd;
}

.registration-bottom-scroll-spacer {
  width: var(--registration-table-width, 2092px);
  height: 1px;
}

.registration-bottom-scroll::-webkit-scrollbar {
  height: 14px;
}

.registration-bottom-scroll::-webkit-scrollbar-track {
  background: #edf3fa;
  border-radius: 999px;
}

.registration-bottom-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #edf3fa;
  border-radius: 999px;
  background: #8ea4c4;
}

.registration-bottom-scroll::-webkit-scrollbar-thumb:hover {
  background: #627895;
}

.registration-table th {
  color: #334762;
  font-size: 14px;
  font-weight: 800;
}

.registration-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid #dbe5f1;
  background: #fbfdff;
  color: #435773;
  font-size: 13px;
}

.registration-pagination-summary {
  flex: 1 1 260px;
  min-width: min(100%, 260px);
  white-space: nowrap;
}

.registration-pagination-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.pagination-button,
.pagination-size-select {
  min-height: 32px;
  border: 1px solid #cfdbea;
  border-radius: 7px;
  background: #fff;
  color: #26374f;
  font-size: 14px;
}

.pagination-button {
  min-width: 64px;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
}

.pagination-button:disabled {
  color: #9aa8ba;
  background: #f2f6fb;
  cursor: not-allowed;
}

.pagination-button:not(:disabled):hover,
.pagination-button:not(:disabled):focus-visible,
.pagination-size-select:focus-visible {
  border-color: #7da2df;
  color: var(--blue);
  outline: none;
}

.pagination-size-select {
  width: 112px;
  padding: 0 10px;
  cursor: pointer;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.inline-form input,
.inline-form select {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.inline-form button {
  min-height: 38px;
  white-space: nowrap;
}

.data-table {
  min-width: 960px;
  table-layout: fixed;
}

.panel > .data-table,
.stacked-panels .data-table {
  display: table;
}

.data-table th {
  font-size: 14px;
  font-weight: 800;
}

.data-table td {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registration-table td[data-registration-column="company_name"],
.registration-table td[data-registration-column="processing_result"] {
  white-space: normal;
  overflow-wrap: anywhere;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 28px;
  min-width: 0;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.sort-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-button:hover,
.sort-button.active {
  color: var(--blue);
}

.sort-indicator {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.sort-button.active .sort-indicator {
  color: var(--blue);
}

.registration-month-row td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef4fb;
  color: #26374f;
}

.registration-month-row strong,
.registration-month-row span {
  display: inline-flex;
  align-items: center;
}

.registration-month-row span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
}

.registration-sequence-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.registration-sequence-number {
  min-width: 20px;
  font-weight: 700;
}

.registration-result-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.registration-result-cell span,
.registration-result-text {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.registration-detail-button {
  flex: 0 0 auto;
  min-height: 28px;
  margin-left: 0;
  padding: 0 10px;
  font-size: 13px;
}

.registration-table .status {
  min-height: 26px;
  padding: 0 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.registration-detail-row td {
  padding: 0 12px 14px;
  background: #fbfdff;
  white-space: normal;
}

.registration-detail-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px 14px;
  padding: 14px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fff;
}

.registration-detail-panel div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.registration-detail-panel b {
  color: var(--muted);
  font-size: 12px;
}

.registration-detail-panel span,
.registration-detail-panel p {
  overflow-wrap: anywhere;
}

.registration-detail-panel p {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: #26374f;
  line-height: 1.6;
}

.empty-table-cell {
  padding: 32px 14px;
  color: var(--muted);
  text-align: center;
}

.score,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef4fb;
  color: #34465e;
  font-weight: 700;
}

.score.high {
  background: #e8f8f1;
  color: var(--green);
}

.score.mid {
  background: #fff7df;
  color: var(--amber);
}

.score.low,
.status.muted {
  background: #eef1f5;
  color: var(--muted);
}

.status.urgent {
  background: var(--red-soft);
  color: var(--red);
}

.inline-action {
  min-height: 28px;
  margin-left: 8px;
  padding: 0 10px;
  border: 1px solid #b8c8dc;
  border-radius: 8px;
  background: #fff;
  color: #26374f;
  cursor: pointer;
}

.inline-action:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
}

.modal-backdrop[hidden] {
  display: none;
}

.record-dialog {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 32, 51, 0.18);
}

.record-dialog form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.record-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.record-dialog-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.dialog-close:hover {
  color: var(--red);
  border-color: #ffc4cf;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: #34465e;
  font-size: 13px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.form-grid input,
.form-grid select {
  height: 40px;
  padding: 0 11px;
}

.form-grid textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.55;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.span-all {
  grid-column: 1 / -1;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

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

.card-grid,
.usage-list,
.risk-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.customer-card,
.usage-list article,
.risk-board article {
  padding: 18px;
}

.customer-card strong,
.customer-card span,
.usage-list b,
.usage-list strong,
.usage-list span,
.risk-board b,
.risk-board span,
.risk-board p {
  display: block;
}

.customer-card span,
.risk-board span {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
}

.customer-card p,
.risk-board p,
.usage-list span {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.usage-list strong {
  margin-top: 10px;
  font-size: 36px;
}

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

.risk-board .danger {
  border-color: #ffc4cf;
  background: var(--red-soft);
}

.pipeline {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

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

  .app-shell,
  .app-shell[data-left-visible="false"],
  .app-shell[data-ai-visible="false"],
  .app-shell[data-left-visible="false"][data-ai-visible="false"] {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 14px;
    padding: 14px;
  }

  .resize-handle {
    display: none;
  }

  .ai-dock {
    min-height: 360px;
    height: 42vh;
    border-top: 1px solid var(--line);
  }

  .app-shell[data-ai-visible="false"] .ai-dock {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 88px;
    height: 112px;
    min-height: 0;
    border: 0;
  }

  .nav-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(136px, max-content);
    overflow-x: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 18px;
  }

  .metric-grid,
  .workbench,
  .card-grid,
  .usage-list,
  .risk-board {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .registration-detail-panel {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .registration-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .registration-pagination-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading span {
    text-align: left;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .record-dialog {
    max-height: calc(100vh - 24px);
  }

  .record-dialog form {
    padding: 16px;
  }

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

@media (max-width: 560px) {
  .brand strong {
    font-size: 15px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .registration-detail-panel {
    grid-template-columns: 1fr;
  }

  .task-list li,
  .notice-list li {
    display: grid;
  }

  .task-list span,
  .notice-list span {
    text-align: left;
  }
}
