:root {
  --bg: #f4f8fd;
  --bg-soft: #eef4fb;
  --panel: #ffffff;
  --panel-soft: #f7fbff;
  --line: #d9e5f2;
  --line-strong: #c8d8ea;
  --text: #182433;
  --muted: #66788f;
  --blue-50: #f3f8ff;
  --blue-100: #e8f1ff;
  --blue-200: #d9e8ff;
  --blue-300: #c4ddff;
  --blue-500: #6aa4ff;
  --blue-600: #4f8fee;
  --blue-700: #3977d8;
  --green: #2db584;
  --orange: #f29a38;
  --red: #e46767;
  --shadow: 0 18px 40px rgba(67, 93, 125, 0.12);
  --shadow-soft: 0 10px 24px rgba(67, 93, 125, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(129, 180, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  color: var(--text);
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid rgba(201, 220, 239, 0.75);
  backdrop-filter: blur(14px);
  padding: 22px 18px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #b9d7ff 0%, #6ea8ff 100%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.nav-group {
  margin-top: 14px;
}

.nav-title {
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: 0.18s ease;
}

.nav-item:hover {
  background: rgba(106, 164, 255, 0.08);
}

.nav-item.is-active {
  background: linear-gradient(180deg, #edf5ff 0%, #e6f0ff 100%);
  box-shadow: inset 0 0 0 1px rgba(106, 164, 255, 0.22);
  color: var(--blue-700);
}

.nav-item .icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--blue-50);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.sidebar-foot {
  margin-top: 22px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  border: 1px solid var(--line);
}

.sidebar-foot h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.sidebar-foot p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-50);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.chip.active {
  background: var(--blue-100);
  color: var(--blue-700);
  border-color: rgba(79, 143, 238, 0.22);
}

.content {
  padding: 18px 22px 26px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 220, 239, 0.75);
  box-shadow: var(--shadow-soft);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-left {
  flex: 1 1 auto;
}

.topbar-right {
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.workspace-switch,
.search,
.mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.workspace-switch {
  padding: 10px 14px;
  min-width: 190px;
}

.workspace-switch strong {
  display: block;
  font-size: 13px;
}

.workspace-switch span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  line-height: 1.4;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 340px;
  max-width: 100%;
  padding: 12px 14px;
  color: var(--muted);
}

.search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--text);
}

.top-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, #bedcff 0%, #82b8ff 100%);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: white;
  font-weight: 700;
}

.auth-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-status {
  max-width: 240px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 45, 0.28);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.auth-modal-backdrop.hidden,
.action-modal-backdrop.hidden {
  display: none;
}

.auth-modal {
  width: min(560px, 100%);
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-form {
  display: grid;
  gap: 0;
}

.action-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 45, 0.34);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 45;
}

.action-modal {
  width: min(640px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.auth-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.auth-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field-stack label {
  font-size: 12px;
  color: var(--muted);
}

.field-stack input,
.field-stack textarea,
.field-stack select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  color: var(--text);
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 2px;
  color: var(--text);
  font-size: 13px;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.helper-text {
  min-height: 18px;
  color: var(--orange);
  font-size: 12px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  color: var(--muted);
  line-height: 1.6;
}

.empty-state strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.screen {
  display: none;
  margin-top: 18px;
}

.screen.is-active {
  display: block;
}

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

.screen-head h2 {
  margin: 0 0 6px;
  font-size: 28px;
}

.screen-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 560px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(79, 143, 238, 0.22);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
  background: linear-gradient(180deg, #f4f7fb 0%, #e9eff7 100%);
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn.is-disabled:hover {
  transform: none;
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.layout-grid {
  display: grid;
  gap: 18px;
  min-width: 0;
}

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

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

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

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

.grid-split {
  grid-template-columns: 280px minmax(0, 1fr) 310px;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(201, 220, 239, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  min-width: 0;
}

.panel.pad {
  padding: 17px;
}

.panel h3,
.panel h4 {
  margin: 0;
}

.panel-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.stat-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
  border: 1px solid rgba(201, 220, 239, 0.9);
  box-shadow: var(--shadow);
}

.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.stat-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.positive { color: var(--green); }
.warn { color: var(--orange); }
.negative { color: var(--red); }

.list {
  display: grid;
  gap: 10px;
}

.task-item,
.entity-card,
.topic-card,
.review-card,
.queue-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  min-width: 0;
}

.task-item,
.queue-card,
.review-card {
  padding: 15px;
}

.task-item.active {
  border-color: rgba(79, 143, 238, 0.24);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow: inset 0 0 0 1px rgba(79, 143, 238, 0.08);
}

.task-item h4,
.entity-card h4,
.topic-card h4,
.queue-card h4,
.review-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.task-item p,
.entity-card p,
.topic-card p,
.queue-card p,
.review-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 11px;
}

.task-meta,
.entity-meta,
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f6f9fe;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.row-meta .tag {
  background: var(--blue-50);
  border-color: rgba(106, 164, 255, 0.18);
  color: var(--blue-700);
  font-weight: 600;
}

.tag.blue {
  background: var(--blue-100);
  color: var(--blue-700);
}

.tag.green {
  background: rgba(45, 181, 132, 0.1);
  border-color: rgba(45, 181, 132, 0.18);
  color: #1b8b61;
}

.tag.orange {
  background: rgba(242, 154, 56, 0.1);
  border-color: rgba(242, 154, 56, 0.18);
  color: #b76d16;
}

.tag.red {
  background: rgba(228, 103, 103, 0.1);
  border-color: rgba(228, 103, 103, 0.18);
  color: #b24c4c;
}

.tag-disabled {
  cursor: not-allowed;
  opacity: 0.72;
  background: #f3f6fa;
  border-color: var(--line-strong);
  color: var(--muted);
}

.clickable-tag {
  cursor: pointer;
}

.integration-panel {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 249, 255, 0.96) 100%);
}

.integration-panel-compact .integration-grid {
  margin-top: 12px;
}

.integration-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.integration-summary strong {
  display: block;
  font-size: 16px;
}

.integration-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.integration-summary.green {
  border-color: rgba(45, 181, 132, 0.2);
  background: linear-gradient(180deg, rgba(45, 181, 132, 0.12) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.integration-summary.orange {
  border-color: rgba(242, 154, 56, 0.24);
  background: linear-gradient(180deg, rgba(242, 154, 56, 0.13) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.integration-summary.red {
  border-color: rgba(228, 103, 103, 0.24);
  background: linear-gradient(180deg, rgba(228, 103, 103, 0.13) 0%, rgba(255, 255, 255, 0.97) 100%);
}

.integration-summary.blue {
  border-color: rgba(79, 143, 238, 0.18);
  background: linear-gradient(180deg, rgba(79, 143, 238, 0.11) 0%, rgba(255, 255, 255, 0.97) 100%);
}

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

.integration-highlights {
  margin-top: 12px;
}

.integration-grid {
  gap: 14px;
  align-items: stretch;
}

.integration-card {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-soft);
}

.integration-card.green {
  border-color: rgba(45, 181, 132, 0.18);
}

.integration-card.orange {
  border-color: rgba(242, 154, 56, 0.18);
}

.integration-card.red {
  border-color: rgba(228, 103, 103, 0.2);
}

.integration-card.blue {
  border-color: rgba(79, 143, 238, 0.18);
}

.integration-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-card-head h4 {
  margin: 0 0 4px;
}

.integration-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.integration-note {
  margin-top: 12px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.integration-url {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--blue-50);
  border: 1px solid rgba(106, 164, 255, 0.14);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
}

.automation-guard-panel {
  display: grid;
  gap: 12px;
}

.oneliner-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 52;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(79, 143, 238, 0.18);
  border-radius: 999px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 247, 255, 0.98) 100%);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
}

.oneliner-fab-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--blue-500) 0%, var(--blue-700) 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.oneliner-fab-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-700);
}

.oneliner-backdrop {
  position: fixed;
  inset: 0;
  z-index: 51;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 20px;
  background: rgba(15, 28, 45, 0.26);
  backdrop-filter: blur(8px);
}

.oneliner-backdrop.hidden {
  display: none;
}

.oneliner-panel {
  width: min(560px, 100%);
  height: min(90vh, 980px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: var(--shadow);
  padding: 20px;
}

.oneliner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.oneliner-head h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.oneliner-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.oneliner-meta,
.oneliner-sessions {
  display: grid;
  gap: 8px;
}

.oneliner-messages {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.oneliner-message {
  display: flex;
}

.oneliner-message.user {
  justify-content: flex-end;
}

.oneliner-message.assistant {
  justify-content: flex-start;
}

.oneliner-bubble {
  width: min(100%, 460px);
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  box-shadow: var(--shadow-soft);
}

.oneliner-message.user .oneliner-bubble {
  background: linear-gradient(180deg, #edf5ff 0%, #e6f0ff 100%);
  border-color: rgba(79, 143, 238, 0.2);
}

.oneliner-bubble strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.oneliner-bubble p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.oneliner-composer {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.oneliner-composer textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  color: var(--text);
}

.oneliner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.oneliner-actions .helper-text {
  min-height: 18px;
  flex: 1 1 auto;
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: initial;
}

.mobile-account-list {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
}

.account-select-card {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 10px;
}

.account-select-card:last-child {
  margin-bottom: 0;
}

.account-select-card.is-active {
  border-color: rgba(79, 143, 238, 0.24);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  box-shadow: inset 0 0 0 1px rgba(79, 143, 238, 0.08);
}

.compact-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sheet-html {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  padding: 14px;
}

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

.task-item.compact {
  padding: 12px 14px;
}

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

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

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

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

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

thead th {
  background: #f8fbff;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}

tbody tr:hover {
  background: rgba(106, 164, 255, 0.055);
}

.entity-cell {
  display: flex;
  gap: 12px;
  align-items: start;
}

.avatar-lg {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, #c9e2ff 0%, #8bbcff 100%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
}

.cell-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.cell-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.kpi-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.metric {
  font-weight: 600;
  color: var(--text);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f9ff 100%);
}

.toolbar-stack {
  display: grid;
  gap: 10px;
  min-width: min(760px, 100%);
}

.search-inline {
  min-width: 320px;
  width: min(720px, 100%);
  padding: 10px 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter {
  min-width: 132px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 12px;
}

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

.side-stack {
  display: grid;
  gap: 16px;
}

.insight-card {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f6faff 100%);
}

.insight-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.insight-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 11px;
}

.tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 18px;
}

.tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.tab.active {
  background: var(--blue-100);
  color: var(--blue-700);
  border-color: rgba(79, 143, 238, 0.2);
}

.hero-card {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(212, 230, 255, 0.85) 0%, rgba(245, 250, 255, 0.96) 72%);
  border: 1px solid rgba(180, 210, 248, 0.85);
  box-shadow: var(--shadow-soft);
}

.hero-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

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

.mini-card {
  padding: 14px;
}

.mini-card strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}

.playbook-list {
  display: grid;
  gap: 12px;
}

.playbook-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.playbook-item.active {
  border-color: rgba(79, 143, 238, 0.24);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.timeline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.step.done {
  color: #167657;
  border-color: rgba(45, 181, 132, 0.18);
  background: rgba(45, 181, 132, 0.08);
}

.step.current {
  color: var(--blue-700);
  border-color: rgba(79, 143, 238, 0.2);
  background: var(--blue-100);
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef3f8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #93c3ff 0%, #5c95ef 100%);
}

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

.day {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
}

.day strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

@media (max-width: 1400px) {
  .grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-split {
    grid-template-columns: 240px minmax(0, 1fr) 280px;
  }
}

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

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(201, 220, 239, 0.75);
    padding: 18px 18px 14px;
  }

  .brand {
    padding-bottom: 14px;
  }

  .nav-group {
    margin-top: 10px;
  }

  .nav-group + .nav-group {
    margin-top: 14px;
  }

  .nav-title {
    padding: 0 4px 8px;
  }

  .nav-group .nav-item {
    display: inline-flex;
    width: auto;
    margin: 0 8px 8px 0;
  }

  .sidebar-foot {
    margin-top: 12px;
  }

  .content {
    padding: 16px 18px 24px;
  }

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

  .topbar-left,
  .topbar-right {
    flex-wrap: wrap;
    width: 100%;
  }

  .workspace-switch,
  .search {
    width: 100%;
    min-width: 0;
  }

  .screen-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-head p {
    max-width: none;
  }

  .grid-main,
  .grid-split,
  .two-col,
  .three-col {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

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

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

  .toolbar-stack {
    min-width: 0;
  }

  table {
    min-width: 760px;
  }
}

@media (max-width: 760px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none !important;
  }

  .sidebar {
    padding: 14px 14px 12px;
  }

  .brand {
    gap: 10px;
    padding: 4px 4px 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand p {
    font-size: 11px;
  }

  .nav-group .nav-item {
    width: calc(50% - 8px);
    justify-content: flex-start;
    margin-right: 8px;
  }

  .sidebar-foot {
    padding: 12px;
  }

  .content {
    padding: 12px 12px 22px;
  }

  .topbar {
    padding: 14px;
    border-radius: 18px;
  }

  .topbar-left .chip-row,
  .topbar-right {
    width: 100%;
  }

  .topbar-left .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .topbar-left .chip-row::-webkit-scrollbar {
    display: none;
  }

  .top-pill {
    padding: 7px 10px;
  }

  .auth-inline {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .auth-status {
    max-width: none;
    width: 100%;
    grid-column: 1 / -1;
  }

  .auth-modal-backdrop,
  .action-modal-backdrop,
  .oneliner-backdrop {
    padding: 12px;
    align-items: end;
  }

  .auth-modal,
  .action-modal {
    width: 100%;
    max-height: min(90vh, 100%);
    border-radius: 20px;
    padding: 18px;
  }

  .oneliner-panel {
    width: 100%;
    height: min(88vh, 100%);
    border-radius: 22px;
    padding: 18px;
  }

  .oneliner-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .oneliner-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .oneliner-actions .btn {
    width: 100%;
  }

  .auth-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-actions {
    flex-direction: column-reverse;
  }

  .auth-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .screen {
    margin-top: 14px;
  }

  .screen-head {
    margin-bottom: 14px;
  }

  .screen-head h2 {
    font-size: 24px;
  }

  .screen-head p {
    font-size: 12px;
  }

  .action-row {
    width: 100%;
  }

  .action-row .btn {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .integration-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .integration-actions {
    width: 100%;
  }

  .integration-actions .btn {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .grid-4,
  .grid-5,
  .mini-grid,
  .calendar {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card strong {
    font-size: 24px;
  }

  .stat-foot {
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .panel.pad,
  .hero-card,
  .task-item,
  .queue-card,
  .review-card,
  .sheet-html,
  .insight-card,
  .playbook-item {
    padding: 14px;
  }

  .integration-summary {
    flex-direction: column;
  }

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

  .integration-actions .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .task-meta,
  .entity-meta,
  .row-meta,
  .chip-row,
  .kpi-inline,
  .timeline {
    gap: 6px;
  }

  .toolbar {
    padding: 14px;
  }

  .table-wrap .account-table {
    display: none;
  }

  .search-inline {
    width: 100%;
    min-width: 0;
  }

  .filters {
    gap: 8px;
  }

  .filter {
    min-width: calc(50% - 4px);
    flex: 1 1 calc(50% - 4px);
  }

  .mobile-account-list {
    padding: 12px;
  }

  .account-select-card {
    padding: 12px;
    gap: 8px;
  }

  .account-select-card .kpi-inline {
    justify-content: space-between;
  }

  .account-select-card .task-meta .tag {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    text-align: center;
  }

  .entity-cell {
    align-items: flex-start;
  }

  .avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .kpi-inline {
    gap: 8px;
    row-gap: 6px;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 12px;
  }

  .brand {
    padding: 2px 2px 10px;
  }

  .nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-top: 8px;
    scrollbar-width: none;
  }

  .nav-group::-webkit-scrollbar {
    display: none;
  }

  .nav-title {
    padding: 0 4px 0 2px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .nav-group .nav-item {
    width: auto;
    margin-right: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 11px;
  }

  .nav-item .icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    font-size: 12px;
  }

  .sidebar-foot {
    display: none;
  }

  .topbar-right {
    gap: 8px;
    align-items: stretch;
  }

  .search {
    padding: 10px 12px;
  }

  .action-row .btn,
  .auth-actions .btn {
    width: 100%;
  }

  .workspace-switch {
    padding: 10px 12px;
  }

  .workspace-switch strong {
    font-size: 12px;
  }

  .workspace-switch span {
    font-size: 11px;
  }

  .topbar-left .chip-row {
    gap: 6px;
  }

  .topbar-left .chip,
  .top-pill {
    font-size: 11px;
  }

  .topbar-right > :not(.avatar) {
    width: 100%;
  }

  .topbar-right .search {
    order: 2;
  }

  .topbar-right .auth-inline {
    order: 1;
  }

  .topbar-right .top-pill {
    width: auto;
  }

  .topbar-right .avatar {
    order: 4;
    align-self: flex-end;
  }

  .auth-inline .btn {
    width: 100%;
  }

  .hero-card .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .hero-card .chip-row::-webkit-scrollbar {
    display: none;
  }

  .oneliner-fab {
    right: 14px;
    bottom: 14px;
    padding: 11px 12px;
  }

  .oneliner-fab-text {
    font-size: 12px;
  }

  .compact-summary-row .tag {
    width: calc(50% - 4px);
    text-align: center;
  }

  .integration-card-head {
    flex-direction: column;
  }

  .task-item.compact,
  .review-card.compact {
    padding: 12px;
  }

  .task-item.compact h4,
  .review-card.compact h4 {
    font-size: 14px;
    line-height: 1.4;
  }

  .task-item.compact p,
  .review-card.compact p {
    font-size: 11px;
  }

  .filter {
    min-width: 100%;
    flex-basis: 100%;
  }

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

  .hero-card h3 {
    font-size: 17px;
  }

  .screen-head h2 {
    font-size: 22px;
  }

  .oneliner-fab {
    right: 12px;
    bottom: 12px;
    gap: 8px;
  }

  .oneliner-fab-mark {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .oneliner-panel {
    gap: 12px;
    padding: 16px;
  }

  .oneliner-head h3 {
    font-size: 20px;
  }

  .oneliner-bubble {
    width: 100%;
    padding: 12px;
    border-radius: 18px;
  }

  table {
    min-width: 620px;
  }
}

.slot {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--blue-50);
  border: 1px solid rgba(106, 164, 255, 0.16);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
