:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #dfe5ef;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #1769e0;
  --primary-weak: #e8f1ff;
  --danger: #d92d20;
  --warn: #b7791f;
  --ok: #15803d;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
}
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.danger { color: var(--danger); border-color: #f0b6ae; }
button.ghost { background: transparent; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 78px; resize: vertical; }
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
}
.login-visual {
  padding: 56px;
  background:
    linear-gradient(135deg, rgba(23,105,224,.92), rgba(19,147,122,.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18'%3E%3Cpath d='M80 120h340v180H80zM500 90h260v120H500zM820 160h300v220H820zM160 420h280v180H160zM560 360h260v260H560z'/%3E%3Cpath d='M420 210l80 20M760 160l60 90M440 500l120-10'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual h1 { margin: 0; font-size: 38px; letter-spacing: 0; }
.login-visual p { max-width: 620px; line-height: 1.8; color: rgba(255,255,255,.88); }
.login-card {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  box-shadow: -10px 0 30px rgba(15, 23, 42, .08);
}
.login-card h2 { margin: 0 0 10px; font-size: 24px; }
.login-card .hint { color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { color: #344054; font-weight: 600; }
.checkline { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 8px 0 18px; }
.checkline input { width: 16px; min-height: 16px; }
.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  overflow: hidden;
  transition: padding-right .2s ease;
}
.app-shell.assistant-space { padding-right: 420px; }
.sidebar {
  background: #0f172a;
  color: #dbeafe;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 8px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand strong { display: block; color: #fff; font-size: 17px; line-height: 1.5; }
.brand span { color: #93a4bd; font-size: 12px; }
.nav { display: grid; gap: 6px; }
.nav button {
  width: 100%;
  text-align: left;
  color: #cbd5e1;
  border: 0;
  background: transparent;
  min-height: 40px;
}
.nav button.active { background: rgba(255,255,255,.1); color: #fff; }
.userbox { margin-top: auto; padding: 10px; color: #cbd5e1; border-top: 1px solid rgba(255,255,255,.12); }
.userbox small { display: block; color: #93a4bd; margin-top: 4px; }
.main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { margin: 0; font-size: 20px; }
.content { padding: 22px 24px 36px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.card { padding: 16px; }
.card .label { color: var(--muted); margin-bottom: 8px; }
.card .value { font-size: 30px; font-weight: 700; }
.panel { padding: 16px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.toolbar {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, minmax(120px, .8fr)) auto;
  gap: 10px;
  align-items: end;
}
.ledger-toolbar {
  grid-template-columns: 1.6fr repeat(5, minmax(120px, .75fr)) auto;
}
.device-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(140px, .25fr) auto;
}
.account-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(460px, .65fr) auto;
}
.segmented {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.seg-button {
  min-height: 36px;
  border-color: #dbe3ef;
  background: #f8fafc;
  color: #475569;
}
.seg-button.active {
  border-color: var(--primary);
  background: var(--primary-weak);
  color: #0f4bb3;
  font-weight: 700;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.metric-card {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 68px;
  padding: 12px;
  text-align: left;
  background: #f8fafc;
}
.metric-card span {
  color: var(--muted);
  font-size: 12px;
}
.metric-card strong {
  font-size: 24px;
  line-height: 1.1;
}
.metric-card.active {
  border-color: var(--primary);
  background: var(--primary-weak);
  color: #0f4bb3;
}
.rule-note {
  margin-top: 12px;
  color: var(--muted);
}
.rule-note summary {
  cursor: pointer;
  line-height: 1.6;
}
.rule-note p {
  margin: 8px 0 0;
  line-height: 1.7;
}
table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap { overflow: visible; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 10px; text-align: left; vertical-align: middle; }
th { color: #475569; font-weight: 700; background: #f8fafc; }
th {
  position: relative;
}
td.actions { white-space: nowrap; width: 1%; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #eef2f7; color: #334155; font-size: 12px; }
.tag.ok { background: #dcfce7; color: var(--ok); }
.tag.warn { background: #fef3c7; color: var(--warn); }
.tag.danger { background: #fee2e2; color: var(--danger); }
.instant-tooltip {
  cursor: default;
}
.floating-tooltip {
  position: fixed;
  display: none;
  min-width: 240px;
  max-width: 380px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
  white-space: pre-line;
  line-height: 1.55;
  font-size: 12px;
  font-weight: 400;
  pointer-events: none;
  z-index: 1000;
}
.floating-tooltip.show {
  display: block;
}
.account-table-wrap {
  overflow: visible;
}
.column-filter-btn {
  display: inline-grid;
  gap: 2px;
  justify-items: start;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #475569;
  font-weight: 700;
  text-align: left;
}
.column-filter-btn::after {
  content: "筛选";
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.column-filter-btn.active {
  color: var(--primary);
}
.column-filter-btn small {
  display: inline-flex;
  max-width: 140px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: #0f4bb3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.column-filter-panel {
  position: absolute;
  left: 10px;
  top: calc(100% + 6px);
  z-index: 90;
  width: 260px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
}
.column-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.column-filter-head button {
  min-height: 28px;
  padding: 0 8px;
}
.column-filter-search {
  margin-bottom: 8px;
}
.column-filter-options {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.column-filter-options button {
  justify-content: flex-start;
  text-align: left;
  min-height: 32px;
  background: #f8fafc;
}
.column-filter-options button.active {
  border-color: var(--primary);
  background: var(--primary-weak);
  color: #0f4bb3;
}
.device-main-cell,
.stack-cell,
.action-stack,
.todo-list,
.relation-list {
  display: grid;
  gap: 6px;
}
.device-main-cell strong {
  font-size: 14px;
}
.device-main-cell span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  text-align: left;
}
.relation-list {
  min-width: 150px;
}
.relation-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 220px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
}
.relation-chip strong {
  color: #0f766e;
}
.todo-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 260px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  line-height: 1.45;
}
.action-stack {
  grid-template-columns: 1fr;
  min-width: 88px;
}
.person-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  max-width: 180px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}
.person-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-chip.unavailable {
  opacity: .72;
  text-decoration: line-through;
}
.dept-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}
.dept-red { background: #fee2e2; color: #b42318; }
.dept-green { background: #dcfce7; color: #15803d; }
.dept-blue { background: #dbeafe; color: #1d4ed8; }
.dept-purple { background: #ede9fe; color: #6d28d9; }
.dept-amber { background: #fef3c7; color: #b45309; }
.dept-cyan { background: #cffafe; color: #0e7490; }
.dept-slate { background: #e2e8f0; color: #475569; }
.dept-neutral { background: #eef2f7; color: #64748b; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.health-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.health-metric { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fafc; }
.health-metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.health-metric strong { display: block; font-size: 22px; line-height: 1.2; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 20;
}
.modal {
  width: min(1120px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .2);
}
.modal-head, .modal-foot { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
}
.modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 3;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  background: #fff;
}
.modal-body { padding: 18px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.error { color: var(--danger); min-height: 20px; }
.muted { color: var(--muted); }
.import-summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; word-break: break-word; }
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.section-title h3 {
  margin: 0;
  font-size: 15px;
}
.todo-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.todo-detail-list li {
  padding: 10px 12px;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  background: #fff1f2;
  color: #9f1239;
}
.edit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.edit-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}
.edit-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.edit-summary strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}
.edit-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
}
.issue-section {
  border-color: #fecdd3;
  background: #fff7f8;
}
.issue-list {
  display: grid;
  gap: 8px;
}
.issue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  background: #fff;
}
.issue-item strong {
  display: block;
  margin-bottom: 3px;
}
.issue-item span {
  color: #9f1239;
  font-size: 12px;
}
.asset-edit-compact {
  display: grid;
  gap: 10px;
}
.asset-edit-compact .edit-summary,
.asset-edit-compact .edit-section {
  margin-bottom: 0;
}
.compact-summary {
  grid-template-columns: 1.1fr .8fr 1fr .55fr;
  gap: 8px;
}
.compact-summary > div {
  padding: 9px 12px;
  border-radius: 6px;
}
.compact-summary span {
  margin-bottom: 3px;
}
.compact-summary strong {
  font-size: 16px;
}
.compact-edit-section {
  padding: 12px;
}
.compact-title {
  margin-bottom: 8px;
}
.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px 9px;
}
.asset-edit-compact .field {
  gap: 3px;
  margin-bottom: 0;
}
.asset-edit-compact .field label {
  font-size: 12px;
  color: #475569;
}
.asset-edit-compact input,
.asset-edit-compact select,
.asset-edit-compact textarea {
  min-height: 30px;
  padding: 5px 8px;
}
.asset-edit-compact textarea {
  min-height: 44px;
}
.asset-edit-compact .compact-form-grid > .field {
  padding: 6px 8px 7px;
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
  border-radius: 6px;
}
.asset-edit-compact .compact-form-grid > .field input,
.asset-edit-compact .compact-form-grid > .field select,
.asset-edit-compact .compact-form-grid > .field textarea {
  border-color: #dbe3ef;
  background: rgba(255, 255, 255, .88);
}
.field-plan {
  border-left-color: #2563eb !important;
  background: #f3f7ff;
}
.field-identity {
  border-left-color: #0f766e !important;
  background: #f0fdfa;
}
.field-owner {
  border-left-color: #7c3aed !important;
  background: #f7f3ff;
}
.field-location {
  border-left-color: #b45309 !important;
  background: #fff8eb;
}
.field-group-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.field-group-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.legend-plan {
  background: #dbeafe;
  color: #1d4ed8;
}
.legend-identity {
  background: #ccfbf1;
  color: #0f766e;
}
.legend-owner {
  background: #ede9fe;
  color: #6d28d9;
}
.legend-location {
  background: #fef3c7;
  color: #92400e;
}
.field-span-2 {
  grid-column: span 2;
}
.field-wide {
  grid-column: 1 / -1;
}
.compact-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.info-tile {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
  border-radius: 6px;
}
.info-tile span {
  display: block;
  margin-bottom: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.info-tile strong {
  display: block;
  min-height: 20px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.compact-issue-section {
  padding: 10px 12px;
}
.issue-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.issue-compact-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  background: #fff;
}
.issue-compact-item strong {
  font-size: 13px;
  line-height: 1.3;
}
.issue-compact-item span {
  min-width: 0;
  color: #9f1239;
  font-size: 12px;
  line-height: 1.35;
}
.issue-compact-item button {
  min-height: 30px;
  padding: 0 9px;
  white-space: nowrap;
}
.issue-platform-item {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: stretch;
}
.issue-platform-name {
  display: grid;
  align-content: center;
  gap: 3px;
}
.issue-platform-name small {
  color: var(--muted);
  font-size: 11px;
}
.issue-platform-list {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}
.issue-platform-list span {
  display: block;
}
.issue-platform-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.account-edit-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.account-edit-table {
  min-width: 1040px;
}
.account-edit-table th,
.account-edit-table td {
  padding: 8px;
  vertical-align: middle;
}
.account-edit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.account-edit-table input {
  min-height: 32px;
  padding: 5px 8px;
}
.account-edit-table td:nth-child(1) {
  width: 126px;
  min-width: 126px;
}
.account-edit-table td:nth-child(2) {
  min-width: 126px;
}
.account-edit-table td:nth-child(4),
.account-edit-table td:nth-child(5) {
  min-width: 104px;
}
.account-edit-table td:nth-child(6) {
  width: 72px;
  min-width: 72px;
}
.account-edit-table td:nth-child(3),
.account-edit-table td:nth-child(7),
.account-edit-table td:nth-child(8) {
  min-width: 148px;
}
.account-edit-table td:nth-child(9) {
  width: 64px;
  min-width: 64px;
}
.account-edit-table tbody tr:nth-child(even) {
  background: #fbfdff;
}
.platform-toggle-cell {
  white-space: nowrap;
}
.platform-toggle-cell strong {
  display: inline-block;
  min-width: 48px;
  margin-right: 6px;
  font-size: 14px;
}
.switch-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.switch-check input {
  width: 16px;
  min-height: 16px;
  flex: 0 0 auto;
}
.status-check {
  color: #166534;
  font-weight: 700;
}
.repair-cell {
  text-align: center;
}
.repair-mini-btn {
  min-height: 30px;
  padding: 0 10px;
  color: var(--primary);
  border-color: #bfdbfe;
  background: #eff6ff;
  white-space: nowrap;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.inline-check input {
  width: 16px;
  min-height: 16px;
}
.input-warning {
  border-color: #fda4af;
  background: #fff1f2;
}
.field-hint {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}
.field-hint.danger {
  color: #be123c;
}
.row-warning {
  background: #fffafa;
}
.device-edit-list {
  display: grid;
  gap: 8px;
}
.device-edit-row {
  border: 1px solid var(--line);
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}
.device-edit-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.device-edit-row .grid3,
.device-edit-row .grid2 {
  gap: 8px;
}
.device-edit-row .field {
  margin-bottom: 8px;
}
.issue-detail-item {
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
}
.subhead {
  margin: 18px 0 10px;
  font-size: 15px;
}
.mini-check {
  margin: 0;
  font-size: 12px;
}
.device-check {
  align-self: end;
  margin: 0 0 14px;
}
.asset-edit-compact .device-check {
  align-self: end;
  min-height: 32px;
  margin: 0;
  padding: 0 2px;
}
.assistant-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 56px;
  height: 56px;
  min-height: 56px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #1769e0, #14b8a6);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(23, 105, 224, .3);
}
.assistant-fab.hidden { display: none; }
.assistant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: calc(100vw - 24px);
  height: 100vh;
  z-index: 29;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 36px rgba(15, 23, 42, .12);
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.assistant-drawer.open { display: grid; }
.assistant-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.assistant-head strong { display: block; font-size: 16px; }
.assistant-head span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.assistant-quick {
  padding: 12px 16px;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.assistant-quick button {
  text-align: left;
  color: #334155;
  background: #f8fafc;
}
.assistant-body {
  padding: 14px 16px;
  overflow-y: auto;
  background: #fbfdff;
}
.assistant-message {
  display: flex;
  margin-bottom: 10px;
}
.assistant-message > div {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.6;
  word-break: break-word;
}
.assistant-message.assistant > div {
  background: #eef6ff;
  color: #1e3a5f;
}
.assistant-message.user { justify-content: flex-end; }
.assistant-message.user > div {
  background: var(--primary);
  color: #fff;
}
.assistant-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin: 12px 0;
}
.assistant-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.assistant-preview dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 10px;
  margin: 0 0 10px;
}
.assistant-preview dt { color: var(--muted); }
.assistant-preview dd { margin: 0; }
.assistant-preview ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.assistant-preview li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
}
.assistant-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.assistant-actions { display: flex; justify-content: flex-end; gap: 8px; }
.assistant-compose {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.assistant-compose textarea {
  min-height: 58px;
  max-height: 120px;
}
@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .app-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .main { height: auto; overflow: visible; }
  .topbar { position: sticky; top: 0; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards, .grid3, .grid2, .split, .health-grid { grid-template-columns: 1fr; }
  .compact-form-grid,
  .compact-summary,
  .compact-info-grid,
  .issue-compact-grid { grid-template-columns: 1fr; }
  .field-span-2,
  .field-wide { grid-column: auto; }
  .issue-compact-item { grid-template-columns: 64px minmax(0, 1fr); }
  .issue-compact-item button { grid-column: 2; justify-self: start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit-summary { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  table { min-width: 760px; }
  .table-wrap { overflow-x: auto; }
  .app-shell.assistant-space { padding-right: 0; }
  .assistant-drawer {
    top: 10px;
    right: 10px;
    bottom: 10px;
    height: auto;
    width: calc(100vw - 20px);
    border-radius: 8px;
    border: 1px solid var(--line);
  }
}
