/* ==========================================================================
   AI guardian console
   ========================================================================== */

.ai-role-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 19px;
  margin-left: auto;
  padding: 0 7px;
  border: 1px solid rgba(83, 201, 181, 0.24);
  border-radius: var(--radius-pill);
  color: #207c69;
  background: rgba(83, 201, 181, 0.11);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ai-menu-link {
  color: #1c7c6d !important;
  background: rgba(83, 201, 181, 0.07);
}

.ai-menu-link .icon {
  color: var(--teal) !important;
}

.ai-page {
  gap: 17px;
}

.ai-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 10px;
}

.ai-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-breadcrumb a:hover {
  color: var(--ink);
}

.ai-breadcrumb .icon {
  width: 13px;
  height: 13px;
}

.ai-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.84fr);
  min-height: 350px;
  padding: 39px 43px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: var(--cream);
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 201, 74, 0.2), transparent 26%),
    radial-gradient(circle at 92% 92%, rgba(255, 111, 78, 0.19), transparent 33%),
    radial-gradient(circle at 50% 50%, rgba(45, 155, 141, 0.18), transparent 42%),
    linear-gradient(120deg, #0f292c 0%, #14383a 47%, #25294c 100%);
  box-shadow: 0 30px 70px rgba(17, 38, 37, 0.2);
  isolation: isolate;
}

.ai-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.37;
  background-image:
    linear-gradient(rgba(255, 248, 232, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 248, 232, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent, #000 38%, #000 78%, transparent);
}

.ai-hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 620px;
}

.ai-hero-title-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.ai-hero h1 {
  margin: 13px 0 10px;
  color: var(--cream);
  font-size: clamp(35px, 4.1vw, 54px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.ai-hero h1 em {
  color: #8ff2cf;
  font-style: normal;
  text-shadow: 0 0 35px rgba(143, 242, 207, 0.24);
}

.ai-running-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 11px;
  padding: 5px 9px;
  border: 1px solid rgba(143, 242, 207, 0.21);
  border-radius: var(--radius-pill);
  color: #a2f2d7;
  background: rgba(83, 201, 181, 0.09);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-running-badge i,
.ai-online-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(118, 224, 185, 0.1);
}

.ai-hero-copy > p {
  max-width: 570px;
  color: rgba(255, 248, 232, 0.57);
  font-size: 12.5px;
  line-height: 1.9;
}

.ai-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}

.ai-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
  color: rgba(255, 248, 232, 0.38);
  font-size: 8.5px;
}

.ai-provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(143, 242, 207, 0.17);
  border-radius: var(--radius-pill);
  color: #a9efd9;
  background: rgba(83, 201, 181, 0.06);
  font-size: 8px;
}

.ai-provider-pill .icon {
  width: 11px;
  height: 11px;
}

.ai-core-visual {
  position: relative;
  z-index: 2;
  min-height: 270px;
}

.ai-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(143, 242, 207, 0.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ai-orbit--one {
  width: 248px;
  height: 248px;
}

.ai-orbit--two {
  width: 300px;
  height: 300px;
  border-color: rgba(255, 201, 74, 0.1);
  border-style: dashed;
  animation: ai-orbit 24s linear infinite;
}

.ai-orbit--three {
  width: 180px;
  height: 180px;
  border-color: rgba(255, 255, 255, 0.08);
}

@keyframes ai-orbit {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.ai-core-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 94px;
  height: 94px;
  border: 1px solid rgba(143, 242, 207, 0.38);
  border-radius: 29px;
  background: rgba(143, 242, 207, 0.06);
  box-shadow:
    0 0 0 13px rgba(143, 242, 207, 0.04),
    0 0 60px rgba(83, 201, 181, 0.22);
  transform: translate(-50%, -50%) rotate(-4deg);
  backdrop-filter: blur(12px);
}

.ai-core-avatar .avatar {
  width: 65px;
  height: 65px;
  font-size: 23px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.ai-core-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 4px rgba(255, 201, 74, 0.08);
}

.ai-core-dot--one { top: 22%; left: 22%; }
.ai-core-dot--two { top: 33%; right: 17%; background: var(--mint); }
.ai-core-dot--three { right: 30%; bottom: 17%; background: var(--coral); }

.ai-core-tag {
  position: absolute;
  padding: 3px 7px;
  border: 1px solid rgba(255, 248, 232, 0.12);
  border-radius: 5px;
  color: rgba(255, 248, 232, 0.43);
  background: rgba(255, 255, 255, 0.045);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
}

.ai-core-tag--one { top: 25%; right: 16%; transform: rotate(6deg); }
.ai-core-tag--two { bottom: 21%; left: 12%; transform: rotate(-5deg); }

.ai-core-label {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  color: rgba(143, 242, 207, 0.32);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.19em;
  text-align: center;
}

.ai-hero-code {
  position: absolute;
  right: 25px;
  bottom: 22px;
  z-index: 0;
  color: rgba(255, 248, 232, 0.08);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  writing-mode: vertical-rl;
}

.ai-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.ai-stat-card {
  --ai-stat-color: var(--teal);
  position: relative;
  display: flex;
  min-height: 133px;
  flex-direction: column;
  padding: 15px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ai-stat-color) 16%, transparent);
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--ai-stat-color) 16%, transparent), transparent 57%),
    color-mix(in srgb, var(--ai-stat-color) 5%, #fffdf8);
  animation: admin-card-in 380ms var(--delay) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ai-stat-card--teal { --ai-stat-color: #2b9e82; }
.ai-stat-card--coral { --ai-stat-color: #ef7158; }
.ai-stat-card--amber { --ai-stat-color: #d5a126; }
.ai-stat-card--violet { --ai-stat-color: #8a70ec; }

.ai-stat-icon {
  display: flex;
  width: 29px;
  height: 29px;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border-radius: 9px;
  color: color-mix(in srgb, var(--ai-stat-color) 80%, #1b2b25);
  background: color-mix(in srgb, var(--ai-stat-color) 11%, #fffdf8);
}

.ai-stat-icon .icon {
  width: 15px;
  height: 15px;
}

.ai-stat-label {
  color: var(--muted);
  font-size: 8.5px;
}

.ai-stat-card strong {
  color: color-mix(in srgb, var(--ai-stat-color) 68%, #1c2c26);
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.ai-stat-card small {
  margin-top: auto;
  color: var(--muted-light);
  font-size: 7.5px;
}

.ai-live-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid rgba(28, 155, 131, 0.13);
  border-radius: 15px;
  background: rgba(118, 224, 185, 0.06);
}

.ai-live-pulse {
  display: flex;
  width: 26px;
  height: 26px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(28, 155, 131, 0.09);
}

.ai-live-pulse i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(28, 155, 131, 0.08);
}

.ai-live-strip p {
  color: var(--muted);
  font-size: 9.5px;
}

.ai-live-strip strong {
  color: var(--ink-soft);
}

.ai-live-mode {
  margin-left: auto;
  color: var(--teal);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7.5px;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  align-items: start;
  gap: 17px;
}

.ai-main,
.ai-aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 15px;
}

.ai-preview-card,
.ai-activity-card {
  padding: 21px;
}

.ai-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.ai-panel-head h2 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.3;
}

.ai-panel-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.ai-panel-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8px;
}

.ai-panel-badge .icon {
  width: 11px;
  height: 11px;
}

.ai-preview-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 14px;
}

.ai-preview-form textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  resize: vertical;
  color: var(--ink-soft);
  background: #fbf7ef;
  font-size: 11.5px;
  line-height: 1.75;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.ai-preview-form textarea::placeholder {
  color: var(--muted-light);
}

.ai-preview-form textarea:focus {
  border-color: rgba(28, 155, 131, 0.38);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(28, 155, 131, 0.06);
}

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

.ai-preview-actions > span {
  color: var(--muted-light);
  font-size: 8px;
}

.ai-preview-result {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.ai-preview-result--allow { border-color: rgba(28, 155, 131, 0.18); background: rgba(118, 224, 185, 0.07); }
.ai-preview-result--flag { border-color: rgba(213, 161, 38, 0.2); background: rgba(255, 201, 74, 0.075); }
.ai-preview-result--block { border-color: rgba(239, 113, 88, 0.22); background: rgba(255, 111, 78, 0.075); }

.ai-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.ai-result-badge .icon {
  width: 15px;
  height: 15px;
  color: var(--teal);
}

.ai-preview-result--flag .ai-result-badge .icon { color: #b9831f; }
.ai-preview-result--block .ai-result-badge .icon { color: var(--coral-deep); }

.ai-result-risk {
  color: var(--muted);
  font-size: 8.5px;
}

.ai-result-risk strong {
  margin-left: 3px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.ai-result-risk small {
  color: var(--muted-light);
  font-size: 8px;
}

.ai-risk-meter {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(24, 44, 39, 0.08);
}

.ai-risk-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sun) 55%, var(--coral));
  transition: width 500ms ease;
}

.ai-result-reason {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.75;
}

.ai-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.ai-result-tags span {
  padding: 3px 7px;
  border-radius: 5px;
  color: #8e4a39;
  background: rgba(255, 111, 78, 0.1);
  font-size: 8px;
}

.ai-result-tags .is-safe {
  color: var(--teal);
  background: rgba(28, 155, 131, 0.08);
}

.ai-result-source {
  margin-top: 9px;
  color: var(--muted-light);
  font-size: 7.5px;
}

.ai-record-list {
  display: flex;
  flex-direction: column;
}

.ai-record {
  display: flex;
  gap: 10px;
  padding: 15px 1px;
  border-bottom: 1px solid rgba(24, 44, 39, 0.06);
}

.ai-record:last-child {
  border-bottom: 0;
}

.ai-record-icon {
  display: flex;
  width: 30px;
  height: 30px;
  flex: none;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border-radius: 9px;
  color: var(--teal);
  background: rgba(28, 155, 131, 0.08);
}

.ai-record--flag .ai-record-icon {
  color: #b4821c;
  background: rgba(255, 201, 74, 0.11);
}

.ai-record--block .ai-record-icon {
  color: var(--coral-deep);
  background: rgba(255, 111, 78, 0.08);
}

.ai-record-icon .icon {
  width: 15px;
  height: 15px;
}

.ai-record-main {
  min-width: 0;
  flex: 1;
}

.ai-record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 8px;
}

.ai-record-type {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 7.5px;
}

.ai-decision {
  color: var(--teal);
  font-weight: 650;
}

.ai-decision--flag { color: #ad7c1e; }
.ai-decision--block { color: var(--coral-deep); }

.ai-record-risk {
  margin-left: auto;
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 8px;
}

.ai-record h3 {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-record-excerpt {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-record-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.ai-record-tags span {
  padding: 2px 6px;
  border-radius: 4px;
  color: color-mix(in srgb, var(--tag-color, var(--teal)) 75%, #2a3831);
  background: color-mix(in srgb, var(--tag-color, var(--teal)) 9%, transparent);
  font-size: 7.5px;
}

.ai-record-tags .is-safe {
  color: var(--muted-light);
  background: var(--surface-soft);
}

.ai-record-reason {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.65;
}

.ai-record-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 7.5px;
}

.ai-record-foot i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
}

.ai-record-removed {
  color: var(--coral-deep);
}

.ai-side-card {
  padding: 19px;
}

.ai-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid rgba(28, 155, 131, 0.13);
  border-radius: var(--radius-pill);
  color: var(--teal);
  background: rgba(28, 155, 131, 0.06);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.ai-account-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.ai-account-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.ai-account-row strong {
  font-size: 13px;
  font-weight: 800;
}

.ai-account-row span {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-engine-facts {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.ai-engine-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.ai-engine-facts span {
  color: var(--muted);
  font-size: 8.5px;
}

.ai-engine-facts strong {
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 650;
  text-align: right;
}

.ai-config-state {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #8a712f;
  background: rgba(255, 201, 74, 0.08);
  font-size: 7.5px;
  line-height: 1.65;
}

.ai-config-state--ready {
  color: var(--teal);
  background: rgba(118, 224, 185, 0.08);
}

.ai-config-state .icon {
  width: 12px;
  height: 12px;
  flex: none;
  margin-top: 1px;
}

.ai-config-state code {
  color: #74611f;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7px;
}

.ai-policy-list {
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

.ai-policy-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
}

.ai-policy-row + .ai-policy-row {
  border-top: 1px solid rgba(24, 44, 39, 0.05);
}

.ai-policy-dot {
  width: 6px;
  height: 6px;
  flex: none;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--policy-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--policy-color) 10%, transparent);
}

.ai-policy-row > div {
  min-width: 0;
}

.ai-policy-row strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.ai-policy-row p {
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 7.5px;
  line-height: 1.5;
}

.ai-agent-card {
  position: relative;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.08);
  border-radius: 21px;
  color: var(--cream);
  background:
    radial-gradient(circle at 94% 8%, rgba(143, 242, 207, 0.15), transparent 35%),
    linear-gradient(135deg, #152f2e, #1b3742 57%, #2b294c);
  box-shadow: 0 16px 34px rgba(17, 38, 37, 0.14);
}

.ai-agent-card::after {
  content: "AI";
  position: absolute;
  right: 9px;
  bottom: -24px;
  color: rgba(255, 248, 232, 0.05);
  font-family: var(--font-display);
  font-size: 106px;
  font-weight: 700;
  line-height: 1;
}

.ai-agent-card .kicker {
  color: rgba(143, 242, 207, 0.45);
}

.ai-agent-card h2 {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.ai-agent-card > p {
  margin-top: 6px;
  color: rgba(255, 248, 232, 0.47);
  font-size: 8.5px;
  line-height: 1.75;
}

.ai-agent-endpoint,
.ai-agent-token {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 248, 232, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.ai-agent-endpoint span,
.ai-agent-token span {
  flex: none;
  color: rgba(255, 248, 232, 0.32);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.ai-agent-endpoint span {
  color: #9fd8b2;
}

.ai-agent-endpoint code,
.ai-agent-token code {
  overflow: hidden;
  color: rgba(255, 248, 232, 0.7);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-agent-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  color: rgba(255, 248, 232, 0.28);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 7px;
}

.ai-agent-links code {
  color: rgba(255, 248, 232, 0.55);
}

.ai-agent-note {
  position: relative;
  z-index: 1;
  padding-top: 9px;
  margin-top: 10px !important;
  border-top: 1px solid rgba(255, 248, 232, 0.08);
  font-size: 7.5px !important;
}

@media (max-width: 1180px) {
  .ai-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
    padding-inline: 34px;
  }

  .ai-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 980px) {
  .ai-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 31px 30px;
  }

  .ai-core-visual {
    display: none;
  }

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

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

  .ai-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .ai-agent-card {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .ai-hero {
    padding: 27px 21px;
    border-radius: 25px;
  }

  .ai-hero h1 {
    font-size: 36px;
  }

  .ai-hero-copy > p {
    font-size: 11px;
  }

  .ai-live-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 11px 13px;
  }

  .ai-live-strip p {
    flex: 1;
    min-width: 190px;
    font-size: 9px;
  }

  .ai-live-mode {
    display: none;
  }

  .ai-preview-card,
  .ai-activity-card,
  .ai-side-card {
    padding: 16px 14px;
  }

  .ai-panel-head h2 {
    font-size: 19px;
  }

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

  .ai-agent-card {
    grid-column: auto;
  }

  .ai-record-excerpt {
    -webkit-line-clamp: 3;
  }

  .ai-preview-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .ai-preview-actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .ai-hero-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .ai-running-badge {
    order: -1;
    margin-bottom: 0;
  }

  .ai-stat-card {
    min-height: 116px;
    padding: 12px;
  }

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

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

  .ai-hero-actions .btn {
    width: 100%;
  }

  .ai-record {
    gap: 8px;
  }

  .ai-record-icon {
    width: 27px;
    height: 27px;
  }

  .ai-record-risk {
    width: 100%;
    margin-left: 0;
    order: 4;
  }
}

/* ===== WorkBuddy Agent 卡片与 provider 标注 ===== */
.workbuddy-agent-card { border-top: 3px solid #4f7cff; }

.workbuddy-conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.workbuddy-conn i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.workbuddy-conn--on {
  background: rgba(76, 158, 124, 0.12);
  color: #2f7a5c;
}
.workbuddy-conn--on i { background: #3d9c74; box-shadow: 0 0 0 3px rgba(61, 156, 116, 0.18); }
.workbuddy-conn--off {
  background: rgba(224, 163, 46, 0.12);
  color: #9a6d14;
}
.workbuddy-conn--off i { background: #e0a32e; box-shadow: 0 0 0 3px rgba(224, 163, 46, 0.16); }

.workbuddy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: #6b7f77;
}

.workbuddy-chat-form textarea {
  width: 100%;
  border: 1px solid #d7e2dc;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  background: #fbfdfc;
}
.workbuddy-chat-form textarea:focus {
  outline: none;
  border-color: #4f7cff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}

.workbuddy-chat-answer {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f4f7ff;
  border: 1px solid #d9e2fb;
}
.workbuddy-chat-answer--loading { display: flex; align-items: center; gap: 12px; color: #51607a; }
.workbuddy-chat-answer--error { background: #fdf3ef; border-color: #f0cdbd; color: #8a4632; }
.workbuddy-chat-answer--error strong { display: block; margin-bottom: 4px; }
.workbuddy-chat-answer--error small { display: block; margin-top: 6px; color: #a06a55; }
.workbuddy-chat-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.workbuddy-chat-answer-head small { color: #7d8ba3; }
.workbuddy-chat-answer p { margin: 0; line-height: 1.7; white-space: pre-wrap; }

.workbuddy-provider-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.workbuddy-provider-tag--on { background: rgba(79, 124, 255, 0.12); color: #3355c9; }
.workbuddy-provider-tag--local { background: rgba(107, 127, 119, 0.12); color: #5a6d64; }

.workbuddy-provider-note {
  margin: 6px 0;
  font-size: 12.5px;
  color: #7a8a82;
}
.office-answer-ai {
  margin: 4px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f7ff;
  border: 1px solid #d9e2fb;
  line-height: 1.75;
  white-space: pre-wrap;
}
